:root {
  --ut-red: #b91f2b;
  --ut-gold: #f2b705;
  --ut-ink: #18212f;
  --ut-blue: #2563eb;
  --paper: #f7f8fb;
  --surface: rgba(255, 255, 255, 0.82);
  --surface-strong: #ffffff;
  --line: rgba(24, 33, 47, 0.14);
  --muted: #596579;
  --shadow: 0 18px 50px rgba(24, 33, 47, 0.13);
  --radius: 8px;
  --content: min(920px, calc(100vw - 48px));
  color-scheme: light;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; min-height: 100vh; font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; color: var(--ut-ink); background: linear-gradient(135deg, rgba(185,31,43,0.08), transparent 34%), linear-gradient(315deg, rgba(242,183,5,0.16), transparent 38%), var(--paper); line-height: 1.68; }
a { color: var(--ut-red); }
button, a { transition: color .18s ease, background .18s ease, border-color .18s ease, transform .18s ease; }
button:focus-visible, a:focus-visible, .glossary-term:focus-visible { outline: 3px solid rgba(37, 99, 235, .42); outline-offset: 3px; }
.skip-link { position: fixed; left: 18px; top: 12px; z-index: 50; padding: 10px 14px; background: var(--ut-ink); color: white; transform: translateY(-150%); border-radius: var(--radius); }
.skip-link:focus { transform: translateY(0); }
.site-header { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between; min-height: 76px; padding: 12px clamp(18px, 4vw, 48px); background: rgba(255,255,255,.78); backdrop-filter: blur(18px); border-bottom: 1px solid var(--line); }
.brand { display: inline-flex; gap: 12px; align-items: center; color: var(--ut-ink); text-decoration: none; }
.brand img { object-fit: contain; }
.brand strong, .brand small { display: block; line-height: 1.15; }
.brand small { color: var(--muted); font-size: .82rem; margin-top: 2px; }
.page-shell { width: var(--content); margin: 0 auto; padding: clamp(32px, 5vw, 64px) 0; }
.home-hero { min-height: calc(100vh - 174px); display: grid; place-items: center; gap: 28px; text-align: center; }
.home-logo { width: min(180px, 42vw); height: auto; filter: drop-shadow(0 14px 22px rgba(24,33,47,.18)); }
.placeholder-panel { max-width: 680px; padding: 28px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); backdrop-filter: blur(20px); box-shadow: var(--shadow); }
.intro-content { max-width: 900px; text-align: left; padding: clamp(22px, 4vw, 42px); border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); backdrop-filter: blur(20px); box-shadow: var(--shadow); }
.intro-content h1 { margin: 0 0 10px; font-size: 3.2rem; line-height: 1.08; }
.intro-content h2 { margin: 0 0 24px; font-size: 1.35rem; color: #6f1720; line-height: 1.25; }
.intro-content p { margin: 0 0 16px; color: #344054; }
.placeholder-panel h1, .lesson-hero h1 { margin: 8px 0 12px; line-height: 1.08; letter-spacing: 0; }
.placeholder-panel h1 { font-size: 4.8rem; }
.lesson-hero { padding: clamp(26px, 5vw, 48px); border-left: 6px solid var(--ut-red); border-radius: var(--radius); background: var(--surface); backdrop-filter: blur(20px); box-shadow: var(--shadow); }
.lesson-hero h1 { font-size: 4rem; }
.lesson-hero p, .placeholder-panel p { color: var(--muted); margin: 0; }
.eyebrow { display: inline-block; font-size: .76rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--ut-red); }
.lesson-body { margin-top: 36px; padding: clamp(22px, 4vw, 42px); background: var(--surface-strong); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 8px 28px rgba(24,33,47,.08); }
.lesson-body h2 { margin: 34px 0 12px; padding-top: 4px; font-size: 2rem; line-height: 1.22; color: #6f1720; }
.lesson-body h2:first-child { margin-top: 0; }
.lesson-body p { margin: 0 0 18px; }
.concept-list { margin: 18px 0 24px; padding-left: 1.2rem; }
.concept-list li { margin: 10px 0; }
.equation-block { margin: 24px 0; padding: 18px; overflow-x: auto; border: 1px solid rgba(185,31,43,.16); border-radius: var(--radius); background: #fffaf0; }
.math-inline { white-space: nowrap; }
.side-index { position: fixed; z-index: 30; right: 18px; top: 96px; width: 286px; max-height: calc(100vh - 118px); padding: 14px; border: 1px solid var(--line); border-radius: var(--radius); background: rgba(255,255,255,.86); backdrop-filter: blur(22px); box-shadow: var(--shadow); transition: transform .24s ease, width .24s ease; }
.side-index[data-collapsed="true"] { width: 56px; }
.index-toggle { width: 36px; height: 36px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: var(--radius); background: white; cursor: pointer; margin-left: auto; }
.index-toggle span, .index-toggle span::before, .index-toggle span::after { display: block; width: 16px; height: 2px; background: var(--ut-ink); content: ""; }
.index-toggle span::before { transform: translateY(-6px); }
.index-toggle span::after { transform: translateY(4px); }
.side-index ol { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 6px; }
.side-index a { display: grid; grid-template-columns: 34px 1fr; align-items: center; min-height: 42px; padding: 8px; border-radius: var(--radius); color: var(--ut-ink); text-decoration: none; }
.side-index a:hover { background: rgba(242,183,5,.18); }
.side-index a.active { background: var(--ut-red); color: white; }
.module-index { gap: 10px; }
.module-item { display: grid; gap: 6px; }
.module-toggle { width: 100%; min-height: 42px; display: grid; grid-template-columns: 44px 1fr; align-items: center; padding: 8px; border: 1px solid transparent; border-radius: var(--radius); background: rgba(24,33,47,.04); color: var(--ut-ink); text-align: left; cursor: pointer; font: inherit; font-weight: 800; }
.module-toggle:hover { background: rgba(242,183,5,.18); }
.module-toggle .nav-number { color: var(--ut-red); }
.sub-index { display: none !important; margin: 0 0 0 12px !important; padding-left: 10px !important; border-left: 2px solid rgba(185,31,43,.18); gap: 4px !important; }
.module-open > .sub-index { display: grid !important; }
.sub-index a { min-height: 36px; grid-template-columns: 32px 1fr; padding: 6px 8px; font-size: .92rem; }
.nav-number { font-size: .76rem; font-weight: 800; opacity: .74; }
.side-index[data-collapsed="true"] .nav-label, .side-index[data-collapsed="true"] nav { display: none; }
.media-grid { margin-top: 28px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.video-placeholder, .simulation-container { padding: 20px; border: 1px solid var(--line); border-radius: var(--radius); background: rgba(255,255,255,.72); box-shadow: 0 10px 26px rgba(24,33,47,.08); }
.video-placeholder h3, .simulation-container h3 { margin: 8px 0; font-size: 1.05rem; line-height: 1.3; }
.video-placeholder p, .simulation-container p { color: var(--muted); margin: 0 0 14px; }
.media-stage { min-height: 150px; display: grid; place-items: center; border: 1px dashed rgba(24,33,47,.28); border-radius: var(--radius); background: linear-gradient(135deg, rgba(185,31,43,.07), rgba(37,99,235,.07)); color: var(--muted); font-weight: 800; }
.expand-media { margin-top: 14px; width: 100%; min-height: 42px; border: 0; border-radius: var(--radius); background: var(--ut-ink); color: white; font-weight: 800; cursor: pointer; }
.expand-media:hover { transform: translateY(-1px); background: #263348; }
.support-preamble { margin-top: 30px; display: grid; gap: 16px; }
.support-preamble-card { padding: 22px; border: 1px solid var(--line); border-left: 5px solid var(--ut-gold); border-radius: var(--radius); background: rgba(255,255,255,.82); box-shadow: 0 10px 26px rgba(24,33,47,.08); }
.support-preamble-card h3 { margin: 8px 0 10px; font-size: 1.25rem; line-height: 1.25; color: #6f1720; }
.support-preamble-card p { margin: 0 0 12px; color: #344054; }
.support-preamble-card p:last-child { margin-bottom: 0; }
.support-subtitle { font-weight: 800; color: var(--muted); }
.media-card-used { display: grid; gap: 14px; }
.media-frame { position: relative; width: 100%; overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius); background: #0f172a; }
.media-frame iframe { display: block; width: 100%; border: 0; background: white; }
.video-frame { aspect-ratio: 16 / 9; }
.video-frame iframe { height: 100%; }
.simulation-frame { height: min(72vh, 720px); min-height: 460px; }
.simulation-frame iframe { height: 100%; }
.resource-link { display: inline-flex; align-items: center; justify-content: center; min-height: 40px; padding: 8px 12px; border-radius: var(--radius); background: var(--ut-ink); color: white; text-decoration: none; font-weight: 800; }
.resource-link:hover { background: #263348; color: white; }
.admin-shell { width: min(1180px, calc(100vw - 48px)); }
.admin-layout { display: grid; grid-template-columns: minmax(280px, 360px) minmax(0, 1fr); gap: 18px; align-items: start; }
.admin-panel { padding: 22px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface-strong); box-shadow: 0 8px 28px rgba(24,33,47,.08); }
.admin-panel h2 { margin: 0 0 14px; font-size: 1.25rem; line-height: 1.2; color: #6f1720; }
.admin-field { display: grid; gap: 6px; margin-bottom: 14px; font-weight: 800; color: var(--ut-ink); }
.admin-field input, .admin-field select, .admin-field textarea { width: 100%; min-height: 42px; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius); font: inherit; color: var(--ut-ink); background: white; }
.admin-field textarea { min-height: 112px; resize: vertical; line-height: 1.5; }
.editor-toolbar { display: flex; flex-wrap: wrap; gap: 8px; padding: 10px; margin-bottom: 12px; border: 1px solid var(--line); border-radius: var(--radius); background: #f8fafc; }
.tool-button { width: 40px; height: 40px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: var(--radius); background: white; color: var(--ut-ink); font-weight: 900; cursor: pointer; }
.tool-button:hover { background: rgba(242,183,5,.18); }
.admin-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.admin-actions button, .admin-actions a { min-height: 42px; display: inline-flex; align-items: center; justify-content: center; padding: 8px 12px; border: 0; border-radius: var(--radius); background: var(--ut-ink); color: white; text-decoration: none; font-weight: 800; cursor: pointer; }
.admin-actions .secondary-action { background: #e8edf5; color: var(--ut-ink); }
.status-list { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.status-list li { padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius); background: #fbfcff; color: #344054; }
.editor-preview { min-height: 320px; padding: 22px; border: 1px solid var(--line); border-radius: var(--radius); background: white; }
.editor-preview h1, .editor-preview h2 { margin-top: 0; color: #6f1720; }
.editor-preview img { max-width: 100%; height: auto; border-radius: var(--radius); }
.editor-preview iframe { width: 100%; aspect-ratio: 16 / 9; border: 0; border-radius: var(--radius); background: #0f172a; }
.editor-preview .simulation-embed { padding: 12px; border: 1px solid var(--line); border-radius: var(--radius); background: #f8fafc; }
.glossary-term { border: 0; border-bottom: 2px dotted rgba(185,31,43,.55); background: rgba(242,183,5,.18); color: #7c1520; padding: 0 2px; border-radius: 4px; cursor: help; font: inherit; }
.glossary-tooltip { position: fixed; z-index: 60; max-width: min(340px, calc(100vw - 28px)); padding: 12px 14px; border-radius: var(--radius); background: #18212f; color: white; box-shadow: var(--shadow); opacity: 0; transform: translateY(6px); pointer-events: none; transition: opacity .16s ease, transform .16s ease; font-size: .92rem; line-height: 1.45; }
.glossary-tooltip.visible { opacity: 1; transform: translateY(0); }
.modal-backdrop { position: fixed; inset: 0; z-index: 70; background: rgba(10,16,25,.58); backdrop-filter: blur(4px); }
.glossary-modal { position: fixed; z-index: 80; left: 50%; top: 50%; width: min(680px, calc(100vw - 32px)); max-height: min(78vh, 720px); overflow: auto; transform: translate(-50%, -50%); padding: clamp(24px, 4vw, 36px); border-radius: var(--radius); background: white; box-shadow: 0 28px 80px rgba(0,0,0,.32); }
.modal-close { position: absolute; right: 14px; top: 12px; width: 38px; height: 38px; border: 1px solid var(--line); border-radius: 50%; background: white; font-size: 1.5rem; cursor: pointer; }
.glossary-modal h2 { margin: 8px 42px 10px 0; line-height: 1.15; }
.modal-short { font-weight: 800; color: #6f1720; }
.modal-long { color: #344054; }
.site-footer { display: flex; gap: 12px; align-items: center; justify-content: center; padding: 26px 18px 36px; color: var(--muted); border-top: 1px solid var(--line); }
.site-footer p { margin: 0; }
@media (max-width: 1280px) { .side-index { right: 10px; width: 236px; } .page-shell { margin-left: clamp(18px, 5vw, 68px); } }
@media (max-width: 920px) { .page-shell { width: min(100% - 28px, 760px); margin: 0 auto; padding-top: 24px; } .placeholder-panel h1, .intro-content h1 { font-size: 3rem; } .lesson-hero h1 { font-size: 3rem; } .lesson-body h2 { font-size: 1.7rem; } .side-index { left: 14px; right: 14px; top: auto; bottom: 14px; width: auto; max-height: 52vh; } .side-index[data-collapsed="true"] { width: auto; transform: translateY(calc(100% - 58px)); } .media-grid { grid-template-columns: 1fr; } .site-footer { padding-bottom: 96px; } }
@media (max-width: 920px) { .admin-layout { grid-template-columns: 1fr; } .admin-shell { width: min(100% - 28px, 760px); } }
@media (max-width: 560px) { .brand small { display: none; } .placeholder-panel h1, .intro-content h1 { font-size: 2.35rem; } .intro-content h2 { font-size: 1.1rem; } .lesson-hero h1 { font-size: 2.2rem; } .lesson-body h2 { font-size: 1.45rem; } .lesson-body, .lesson-hero, .placeholder-panel, .intro-content { padding: 20px; } .side-index a { grid-template-columns: 30px 1fr; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; } }
