:root { color-scheme:light dark; --bg:var(--background,Canvas); --panel:var(--card,Canvas); --ink:var(--foreground,CanvasText); --muted:var(--muted-foreground,CanvasText); --gold:var(--primary,LinkText); --edge:var(--border,GrayText); }
* { box-sizing:border-box; }
body { margin:0; background:var(--bg); color:var(--ink); font:1rem/1.55 system-ui,sans-serif; }
button,input,a,summary { -webkit-tap-highlight-color:transparent; }
button { font:inherit; border:1px solid var(--edge); background:var(--panel); color:var(--ink); border-radius:.65rem; min-height:44px; padding:.55rem .9rem; cursor:pointer; }
button:hover { border-color:var(--gold); }
button:focus-visible,a:focus-visible,input:focus-visible,summary:focus-visible { outline:3px solid var(--gold); outline-offset:4px; }
button:disabled { cursor:wait; opacity:.65; }
button.primary { background:var(--gold); color:var(--bg); border-color:var(--gold); font-weight:700; }
a { color:var(--muted); text-underline-offset:.2em; display:inline-flex; min-height:44px; align-items:center; }
h1,h2,p { margin:0; }
h1 { font:clamp(1.75rem,4vw,2.5rem)/1.15 Georgia,serif; }
.film-shell { width:min(1160px,100%); margin:auto; padding:1.2rem 1.2rem 3rem; }
.film-header { display:flex; justify-content:space-between; gap:1rem; align-items:center; }
.film-header a { font-size:.875rem; }
.eyebrow { font-size:.875rem; letter-spacing:.17em; color:var(--gold); margin-bottom:.3rem; }
.draft-note { color:var(--muted); font-size:.875rem; margin:1rem 0; max-width:90ch; }
.draft-note strong { font-weight:500; color:var(--ink); }
.act-tabs { display:flex; gap:.6rem; margin-bottom:.8rem; }
.act-tabs button { text-align:left; }
.act-tabs span { font-size:.875rem; color:var(--muted); margin-left:.6rem; }
.act-tabs [aria-pressed="true"] { border-color:var(--gold); box-shadow:inset 0 -2px var(--gold); }
.film-player { border:1px solid var(--edge); border-radius:1rem; overflow:hidden; background:var(--panel); }
.picture { position:relative; width:100%; aspect-ratio:16/9; max-height:62svh; overflow:hidden; background:var(--bg); }
.picture img { width:100%; height:100%; object-fit:cover; object-position:center top; display:block; transform-origin:20% 0%; will-change:transform; }
.scene-heading { position:absolute; inset:0 0 auto; padding:1.2rem 1.5rem 2.5rem; background:linear-gradient(color-mix(in srgb, var(--bg) 90%, transparent),transparent); pointer-events:none; }
.scene-heading p { font-size:.875rem; color:var(--ink); letter-spacing:.08em; }
.scene-heading h2 { font:clamp(1.15rem,2.5vw,1.9rem)/1.25 Georgia,serif; margin-top:.2rem; text-shadow:0 1px 7px var(--bg); }
.subtitle-band { min-height:7.8rem; display:flex; flex-direction:column; justify-content:center; text-align:center; padding:.8rem 1.2rem; background:var(--bg); border-top:1px solid var(--edge); }
#caption-kind { color:var(--gold); font-size:.875rem; letter-spacing:.07em; min-height:1.2rem; margin-bottom:.35rem; }
#subtitle { white-space:pre-line; font-size:clamp(1rem,2vw,1.32rem); line-height:1.45; max-width:78ch; margin:0 auto; }
.transport { padding:.5rem 1rem 1rem; }
.seek-label { position:absolute; width:1px; height:1px; overflow:hidden; clip-path:inset(50%); }
input[type="range"] { accent-color:var(--gold); cursor:pointer; min-height:44px; margin:0; }
#film-seek { width:100%; display:block; }
.controls { display:flex; flex-wrap:wrap; gap:.6rem; align-items:center; }
.controls button { font-size:.875rem; }
.volume-label { display:flex; gap:.5rem; align-items:center; font-size:.875rem; color:var(--muted); }
.volume-label input { width:85px; }
#film-time { margin-left:auto; color:var(--muted); font-size:.875rem; font-variant-numeric:tabular-nums; }
#playback-status:not(:empty) { margin-top:.8rem; color:var(--gold); }
.image-error { position:absolute; inset:auto 1rem 1rem; background:var(--bg); padding:1rem; }
.act-end { border:1px solid var(--edge); border-radius:.8rem; padding:1rem; margin-top:1rem; }
.act-end p { margin-bottom:.8rem; }
.act-end button { margin:.2rem .4rem .2rem 0; }
.commentary { margin-top:1.2rem; color:var(--muted); }
.commentary summary { min-height:44px; cursor:pointer; padding:.5rem 0; color:var(--ink); }
.commentary-note { max-width:85ch; font-size:.875rem; margin:.5rem 0 1.2rem; }
.commentary h3 { color:var(--gold); font:1.5rem Georgia,serif; margin:1.6rem 0 .8rem; }
.commentary h4 { color:var(--ink); margin:.9rem 0 .3rem; }
.commentary ol { padding-left:1.8rem; max-width:88ch; }
.commentary li { padding:.25rem 0; white-space:pre-line; }
.motion-note { font-size:.875rem; }
[hidden] { display:none !important; }
.quiz-shell { border:1px solid var(--edge); border-radius:1rem; padding:1.2rem; margin-top:1rem; background:var(--panel); }
.quiz-shell h2 { font:clamp(1.3rem,3vw,1.65rem)/1.35 Georgia,serif; }
.quiz-invite { display:flex; align-items:center; justify-content:space-between; gap:1rem; }
.quiz-invite p,.quiz-hint { color:var(--muted); font-size:.875rem; margin-top:.5rem; }
.quiz-invite button { flex-shrink:0; }
.quiz-top { display:flex; justify-content:space-between; align-items:center; gap:.75rem; margin-bottom:1rem; }
#quiz-progress { color:var(--gold); font-size:.875rem; }
.quiz-answers { display:grid; gap:.65rem; margin:1.1rem 0; }
.quiz-answers button { text-align:left; min-height:52px; line-height:1.5; padding:.75rem 1rem; }
.quiz-answers button:disabled { opacity:1; cursor:default; }
.quiz-answers [data-result="correct"] { border-color:var(--gold); background:color-mix(in srgb, var(--gold) 12%, var(--panel)); }
.quiz-answers [data-result="selected"] { border-style:dashed; }
.quiz-feedback { border-left:3px solid var(--gold); padding:.4rem 1rem; margin:1rem 0; }
.quiz-feedback h3 { font-size:1rem; margin:0 0 .35rem; }
#quiz-reference { color:var(--gold); font-size:.875rem; margin-top:.5rem; }
.quiz-actions { display:flex; flex-wrap:wrap; gap:.6rem; margin-top:1rem; }
.quiz-shell [tabindex="-1"]:focus { outline:2px solid var(--gold); outline-offset:5px; }
#quiz-summary-text { margin-top:1rem; }
@media(max-width:600px) { .quiz-invite { align-items:stretch; flex-direction:column; } .quiz-shell { padding:1rem; } .quiz-top button { font-size:.875rem; } }
@media(max-width:600px) {
  .film-shell { padding:.8rem .65rem 2rem; }
  .film-header { align-items:flex-start; }
  .film-header a { max-width:9rem; text-align:right; font-size:.875rem; }
  .act-tabs { gap:.4rem; }
  .act-tabs button { flex:1; font-size:.9rem; padding:.45rem .6rem; }
  .act-tabs span { display:block; margin:0; font-size:.875rem; }
  .scene-heading { padding:.7rem .8rem 1.5rem; }
  .scene-heading p { font-size:.875rem; letter-spacing:0; }
  .subtitle-band { min-height:9rem; padding:.65rem .85rem; }
  .controls { gap:.4rem; }
  .controls button { flex:1 1 auto; }
  .controls .primary { flex-basis:100%; }
  .volume-label { flex:1; }
  .volume-label input { width:90px; }
}
@media(prefers-reduced-motion:reduce) { .picture img { transform:none !important; will-change:auto; } }

.picture video { position:absolute; inset:0; width:100%; height:100%; object-fit:cover; object-position:center top; }
.film-layer { position:absolute; inset:0; width:100%; height:100%; will-change:transform; }
.sinaj-lightning { position:absolute; inset:0; width:100%; height:100%; pointer-events:none; fill:none; stroke:#eee5ff; stroke-width:2; filter:drop-shadow(0 0 7px #dbbdff); }
.sinaj-lightning path { vector-effect:non-scaling-stroke; }
.picture video:not([hidden]) + img { visibility:hidden; }
@media(prefers-reduced-motion:reduce) { .picture video { display:none; } .picture video + img { visibility:visible; } }
@media(prefers-reduced-motion:reduce) { .film-layer { transform:none !important; will-change:auto; } .sinaj-lightning { display:none !important; } }
