/* I Saw Him Too — The First Look. Mobile-first. */
:root {
  color-scheme: dark;
  --bg: #0f1211;
  --bg-2: #161a18;
  --ink: #ece6d8;
  --ink-2: #b8b1a3;
  --muted: #7f7a70;
  --line: rgba(236, 230, 216, 0.12);
  --ochre: #c9a24a;
  --ochre-2: #e0bd6a;
  --amber: #c98a3a;
  --display: 'Fraunces', 'Iowan Old Style', 'Palatino Linotype', Georgia, serif;
  --body: 'Spectral', 'Iowan Old Style', Georgia, serif;
  --stage-h: 58svh;
}
* { box-sizing: border-box; }
html { background: var(--bg); -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: var(--body); font-size: 17px; line-height: 1.55; font-weight: 300;
  -webkit-font-smoothing: antialiased;
}
button, input { font: inherit; color: inherit; }
button { cursor: pointer; -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 2px solid var(--ochre); outline-offset: 3px; border-radius: 2px; }
[hidden] { display: none !important; }
em { font-style: italic; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--ochre); color: #1a160c; padding: 8px 12px; z-index: 50; }
.skip:focus { left: 8px; }

/* ---------- layout ---------- */
.app { display: block; min-height: 100svh; }
.stage {
  position: sticky; top: 0; z-index: 1;
  height: var(--stage-h); min-height: 300px; width: 100%;
  overflow: hidden; background: #0b0d0d; touch-action: pan-y;
  isolation: isolate;
}
.side {
  position: relative; z-index: 2; background: var(--bg);
  border-top: 1px solid var(--line);
  padding: 20px 22px calc(28px + env(safe-area-inset-bottom));
  min-height: calc(100svh - var(--stage-h));
  display: flex; flex-direction: column; gap: 14px;
  box-shadow: 0 -30px 60px rgba(15, 18, 17, 0.9);
}
@media (min-width: 900px) {
  .app { display: grid; grid-template-columns: minmax(0, 1fr) clamp(380px, 36vw, 520px); height: 100svh; }
  .stage { position: relative; height: 100svh; min-height: 0; }
  .side { border-top: 0; border-left: 1px solid var(--line); height: 100svh; overflow-y: auto; padding: 40px 44px 36px; box-shadow: none; }
}
@media (min-width: 1400px) { .side { padding: 56px 60px 44px; } }

/* ---------- stage internals ---------- */
.scene { position: absolute; will-change: transform; transform-style: preserve-3d; transform-origin: 50% 50%; }
.grain { position: absolute; inset: -2%; z-index: 50; pointer-events: none; opacity: .085; mix-blend-mode: overlay; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .5 0 0 0 0 .5 0 0 0 0 .5 0 0 0 .9 0'/%3E%3C/filter%3E%3Crect width='300' height='300' filter='url(%23n)'/%3E%3C/svg%3E"); background-size: 300px 300px; animation: grain .9s steps(1) infinite; }
@keyframes grain { 0% { transform: translate(0,0); } 25% { transform: translate(-1.5%,1%); } 50% { transform: translate(1%,-1.2%); } 75% { transform: translate(-.8%,-.6%); } 100% { transform: translate(1.2%,.8%); } }
.vignette { position: absolute; inset: 0; z-index: 49; pointer-events: none; background: radial-gradient(ellipse at 50% 45%, transparent 55%, rgba(6,8,8,.55) 100%); }
.layer { position: absolute; will-change: transform; transform-origin: 50% 50%; }
.layer .inner { display: block; width: 100%; height: 100%; object-fit: fill; pointer-events: none; user-select: none; -webkit-user-drag: none; transition: opacity .6s ease, filter 1.6s ease, transform 3s ease-in-out; }
.layer.state.is-off .inner { opacity: 0; }
.layer.lift .inner { filter: brightness(1.12) contrast(1.03); }
.layer.exit-left .inner { transform: translateX(-160%) translateY(4%); opacity: 0; transition: transform 3.4s cubic-bezier(.5,.05,.4,1), opacity 2.4s ease .8s; }
.layer.gone .inner { opacity: 0; transition: opacity 3s ease; }
.layer.appear .inner { opacity: 0; transition: opacity 2.2s ease; }
.layer.appear.in .inner { opacity: 1; }
.layer.recede .inner { transform: translate(-9%, -7%) scale(.72); opacity: 0; transition: transform 16s ease-in, opacity 12s ease-in 4s; }
.layer.lift-loop .inner { animation: paper 9s ease-in-out infinite; transform-origin: 90% 100%; }
@keyframes paper { 0%, 78%, 100% { transform: none; } 84% { transform: rotate(-1.4deg) translateY(-1.5px); } 91% { transform: rotate(.4deg); } }

.curtain { position: absolute; inset: 0; z-index: 60; background: #0b0d0d; opacity: 0; pointer-events: none; transition: opacity .7s ease; }
.curtain.on { opacity: 1; pointer-events: auto; }
.stage.result .scene { filter: brightness(.55) saturate(.8); }

.bus-wipe { position: absolute; inset: 0; z-index: 55; pointer-events: none; overflow: hidden; }
.bus-wipe i { position: absolute; top: -10%; height: 120%; width: 160%; left: 100%; background: #0d1011; }
.bus-wipe i:nth-child(2) { background: repeating-linear-gradient(90deg, transparent 0 9%, rgba(255,190,110,.18) 9% 13%, transparent 13% 22%); top: 22%; height: 24%; }
.bus-wipe i:nth-child(3) { background: linear-gradient(90deg, rgba(255,255,255,.06), transparent 30%); }
.bus-wipe.run i { animation: wipe 1.05s cubic-bezier(.55,.05,.35,1) forwards; }
@keyframes wipe { to { left: -170%; } }

.bar {
  position: absolute; z-index: 40; inset: 0 0 auto 0;
  display: flex; justify-content: space-between; align-items: flex-start;
  padding: calc(12px + env(safe-area-inset-top)) 16px 28px;
  background: linear-gradient(180deg, rgba(10,12,12,.72), rgba(10,12,12,0));
  pointer-events: none;
}
.bar > * { pointer-events: auto; }
.wordmark { color: var(--ink); text-decoration: none; font-family: var(--display); font-size: 15px; letter-spacing: .04em; font-weight: 400; line-height: 1.15; }
.wordmark span { display: block; white-space: nowrap; font-family: var(--body); font-size: 10.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-2); margin-top: 4px; }
.controls { display: flex; gap: 8px; }
.ctl { white-space: nowrap; background: rgba(15,18,17,.55); border: 1px solid rgba(236,230,216,.22); color: var(--ink); border-radius: 999px; padding: 7px 12px; font-size: 12.5px; letter-spacing: .04em; -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); min-height: 34px; }
.ctl:hover { border-color: var(--ochre); }

@media (max-width: 899px) {
  .bar { padding: calc(10px + env(safe-area-inset-top)) 14px 26px; }
  .wordmark { font-size: 14px; }
  .wordmark span { font-size: 9.5px; letter-spacing: .12em; }
  .ctl { padding: 6px 10px; font-size: 11.5px; min-height: 32px; }
  .side { margin-top: -18px; border-radius: 18px 18px 0 0; border-top: 1px solid var(--line); }
  .side::before { content: ''; display: block; width: 36px; height: 3px; border-radius: 2px; background: var(--line); margin: -6px auto 6px; }
}

/* ---------- atmosphere ---------- */
.fx { position: absolute; pointer-events: none; }
.fx-sweep { inset: 0; overflow: hidden; mix-blend-mode: screen; }
.fx-sweep i { position: absolute; top: -20%; bottom: -20%; width: 34%; left: 0; opacity: var(--o);
  background: linear-gradient(100deg, transparent 0%, rgba(255,240,220,.5) 45%, rgba(255,240,220,.9) 50%, rgba(255,240,220,.5) 55%, transparent 100%);
  transform: translateX(-160%) skewX(-8deg); animation: sweep var(--d) ease-in-out infinite; }
@keyframes sweep { 0% { transform: translateX(-160%) skewX(-8deg); } 58% { transform: translateX(420%) skewX(-8deg); } 100% { transform: translateX(420%) skewX(-8deg); } }
.fx-glow { background: radial-gradient(ellipse at center, rgba(var(--c), var(--o)) 0%, rgba(var(--c), 0) 70%); mix-blend-mode: screen; animation: breathe 7s ease-in-out infinite; }
.fx-glow.flicker { animation: flicker 6.5s steps(1, end) infinite; }
@keyframes breathe { 0%,100% { opacity: .85; } 50% { opacity: 1; } }
@keyframes flicker { 0%,100% { opacity: 1; } 31% { opacity: .82; } 33% { opacity: 1; } 47% { opacity: .9; } 49% { opacity: 1; } 78% { opacity: .78; } 80% { opacity: 1; } }
.fx-wash { overflow: hidden; mix-blend-mode: screen; }
.fx-wash i { position: absolute; top: 0; bottom: 0; width: 55%; left: 0; opacity: var(--o);
  background: linear-gradient(90deg, transparent, rgba(var(--c), 1) 50%, transparent); transform: translateX(-120%); animation: wash var(--d) ease-in-out infinite; }
@keyframes wash { 0% { transform: translateX(-120%); } 42% { transform: translateX(300%); } 100% { transform: translateX(300%); } }
.fx-steam { width: 0; height: 0; opacity: 0; transition: opacity 1.2s ease .3s; }
.fx-steam.on { opacity: 1; }
.fx-steam i { position: absolute; left: calc(var(--s) * -14px * var(--k)); top: calc(var(--s) * -20px * var(--k)); width: calc(var(--s) * 28px * var(--k)); height: calc(var(--s) * 28px * var(--k)); border-radius: 50%;
  background: radial-gradient(circle, rgba(240,236,228,.55), rgba(240,236,228,0) 70%); filter: blur(calc(var(--s) * 2px)); animation: steam 3.6s ease-out infinite; }
.fx-steam i:nth-child(2) { animation-delay: 1.2s; left: calc(var(--s) * -6px * var(--k)); }
.fx-steam i:nth-child(3) { animation-delay: 2.4s; left: calc(var(--s) * -20px * var(--k)); }
@keyframes steam { 0% { transform: translateY(0) scale(.6); opacity: 0; } 25% { opacity: .55; } 100% { transform: translateY(calc(var(--s) * -70px * var(--k))) translateX(calc(var(--s) * 10px)) scale(1.7); opacity: 0; } }
.fx-rain, .fx-drizzle, .fx-runoff { overflow: hidden; }
.fx-rain, .fx-drizzle { inset: 0; }
.fx-runoff { mask-image: linear-gradient(180deg, rgba(0,0,0,.9), rgba(0,0,0,.6) 50%, transparent 100%); -webkit-mask-image: linear-gradient(180deg, rgba(0,0,0,.9), rgba(0,0,0,.6) 50%, transparent 100%); }
.drops { position: absolute; left: -5%; top: 0; width: 110%; height: calc(var(--s) * 3600px); opacity: var(--o);
  background-image: var(--tile); background-size: calc(var(--s) * 400px) calc(var(--s) * 600px); background-repeat: repeat;
  transform: translateY(calc(var(--s) * -600px)); animation: fall var(--d) linear infinite; }
.fx-runoff .drops { background-size: calc(var(--s) * 300px) calc(var(--s) * 600px); }
@keyframes fall { to { transform: translateY(0); } }
.fx-shade { transform: translate(-50%, -50%); border-radius: 50%; background: radial-gradient(ellipse at center, rgba(20,16,12,.85), rgba(20,16,12,0) 72%); opacity: 0; transition: opacity 7s ease; mix-blend-mode: multiply; }
.fx-shade.on { opacity: var(--o); }
.fx-focus { inset: 0; opacity: 0; transition: opacity 2.6s ease; background: radial-gradient(circle at var(--x) var(--y), rgba(0,0,0,0) var(--r), rgba(6,8,8,.5) 100%); }
.fx-focus.on { opacity: 1; }

/* motes: soft bokeh drifting in the humid air near the glass */
.fx-motes { inset: 0; overflow: hidden; }
.fx-motes i { position: absolute; border-radius: 50%; opacity: 0; background: radial-gradient(circle, rgba(255,236,210,.9), rgba(255,236,210,0) 70%); filter: blur(calc(var(--s) * 1.2px)); animation-name: mote, motefade; animation-timing-function: ease-in-out, ease-in-out; animation-iteration-count: infinite, infinite; }
@keyframes mote { 0% { transform: translate(0,0); } 100% { transform: translate(var(--dx), var(--dy)); } }
@keyframes motefade { 0%, 100% { opacity: 0; } 50% { opacity: var(--o); } }
/* haze: slow mist band */
.fx-haze { overflow: hidden; mix-blend-mode: screen; }
.fx-haze i { position: absolute; top: 0; bottom: 0; width: 120%; left: -10%; opacity: var(--o); background: radial-gradient(ellipse at 50% 60%, rgba(200,210,215,.55), rgba(200,210,215,0) 70%); filter: blur(calc(var(--s) * 18px)); animation: haze var(--d) ease-in-out infinite alternate; }
.fx-haze i:nth-child(2) { animation-duration: calc(var(--d) * 1.6); animation-direction: alternate-reverse; opacity: calc(var(--o) * .6); }
@keyframes haze { from { transform: translateX(-6%) scaleY(1); } to { transform: translateX(6%) scaleY(1.08); } }

/* pause + reduced motion: freeze loops */
.stage.paused .fx i, .stage.paused .grain, .stage.paused .drops, .stage.paused .fx-glow, .stage.paused .layer.lift-loop .inner, .stage.hidden-tab .fx i, .stage.hidden-tab .drops { animation-play-state: paused; }
.stage.paused .fx-rain, .stage.paused .fx-drizzle, .stage.paused .fx-runoff { opacity: .55; }
.motion-off .layer .inner { transition-duration: .5s; }
.motion-off .layer.exit-left .inner { transition-duration: .6s, .5s; transition-delay: 0s; }
.motion-off .layer.recede .inner { transition-duration: 1s; transition-delay: 0s; }
.motion-off .curtain { transition-duration: .35s !important; }
.motion-off .bus-wipe.run i { animation-duration: .5s; }

/* ---------- side panel typography ---------- */
.side-head { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; flex-wrap: wrap; }
.progress, .place { margin: 0; font-size: 11.5px; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); }
.progress { color: var(--ochre); }
.panel { outline: none; display: flex; flex-direction: column; gap: 14px; }
.eyebrow { margin: 0; font-size: 11.5px; letter-spacing: .18em; text-transform: uppercase; color: var(--ochre); }
.display { font-family: var(--display); font-weight: 300; letter-spacing: -.012em; line-height: 1.12; font-variation-settings: 'opsz' 60; }
h1.display { font-size: clamp(28px, 6.4vw, 40px); margin: 4px 0 6px; }
h2.display { font-size: clamp(23px, 5.2vw, 30px); margin: 10px 0 4px; }
@media (min-width: 900px) { h1.display { font-size: clamp(30px, 2.6vw, 42px); } h2.display { font-size: clamp(24px, 1.9vw, 31px); } }
.lead { margin: 0; color: var(--ink-2); font-size: 17px; }
.lead.counter { border-left: 2px solid var(--line); padding-left: 14px; }
.meta { margin: 6px 0 0; font-size: 13px; color: var(--muted); letter-spacing: .02em; }
.copy { display: flex; flex-direction: column; gap: 12px; min-height: 2em; }
.copy-line { margin: 0; opacity: 0; transform: translateY(6px); transition: opacity .9s ease, transform .9s ease; font-size: 17.5px; }
.copy-line.in { opacity: 1; transform: none; }
.motion-off .copy-line { transition-duration: .25s; }
.question { opacity: 0; transition: opacity .8s ease; margin-top: 6px; padding-top: 16px; border-top: 1px solid var(--line); }
.question.in { opacity: 1; }
.choices { display: grid; gap: 8px; margin-top: 12px; }
.choice { display: flex; gap: 14px; align-items: flex-start; text-align: left; width: 100%;
  background: rgba(236,230,216,.03); border: 1px solid var(--line); border-radius: 4px; padding: 13px 14px; min-height: 48px; line-height: 1.45; font-size: 16px; color: var(--ink);
  transition: background .25s, border-color .25s, opacity .5s; }
.choice:hover:not(:disabled) { background: rgba(201,162,74,.08); border-color: rgba(201,162,74,.6); }
.choice .n { flex: none; font-family: var(--display); font-size: 13px; color: var(--ochre); padding-top: 3px; min-width: 12px; }
.choice.chosen { border-color: var(--ochre); background: rgba(201,162,74,.1); }
.choice.faded { opacity: .38; }
.choice:disabled { cursor: default; }
.hint { margin: 8px 0 0; font-size: 13px; color: var(--muted); font-style: italic; }
.response { margin-top: 18px; border-left: 2px solid var(--ochre); padding: 2px 0 2px 16px; opacity: 0; transform: translateY(6px); transition: opacity .9s ease, transform .9s ease; }
.response.in { opacity: 1; transform: none; }
.frag { margin: 0 0 10px; color: var(--ink-2); }
.frag.after { opacity: 0; transition: opacity 1.2s ease; margin-top: 10px; }
.frag.after.in { opacity: 1; }
.coda { margin: 0; font-family: var(--display); font-style: italic; font-size: 20px; line-height: 1.3; color: var(--ink); }
.actions { display: flex; flex-direction: column; gap: 10px; margin-top: 12px; }
.primary { display: flex; justify-content: space-between; align-items: center; gap: 12px; text-decoration: none;
  background: var(--ochre); color: #1a160c; border: 1px solid var(--ochre); border-radius: 4px; padding: 14px 18px; min-height: 48px; font-size: 16px; font-weight: 400; width: 100%; text-align: left;
  transition: background .25s, opacity .6s, transform .6s; }
.primary::after { content: '→'; font-family: var(--display); }
.primary:hover { background: var(--ochre-2); }
.question .primary { margin-top: 18px; opacity: 0; transform: translateY(6px); }
.question .primary.in { opacity: 1; transform: none; }
.ghost { background: transparent; border: 1px solid var(--line); color: var(--ink-2); border-radius: 4px; padding: 12px 16px; min-height: 46px; font-size: 15px; text-align: left; }
.ghost:hover { border-color: var(--ochre); color: var(--ink); }
.link { background: none; border: 0; padding: 8px 0; color: var(--muted); font-size: 13px; letter-spacing: .02em; text-decoration: underline; text-decoration-color: var(--line); text-underline-offset: 3px; }
.link:hover { color: var(--ochre); }
.side-foot { margin-top: auto; padding-top: 18px; border-top: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.foot-note { font-size: 12px; color: var(--muted); }
.disclaimer { margin: 6px 0 0; font-size: 14px; color: var(--muted); }
.closing { font-style: italic; font-size: 22px; margin: 14px 0 4px; color: var(--ink); }
.chosen { border: 1px solid var(--line); border-radius: 4px; padding: 10px 14px; }
.chosen summary { cursor: pointer; font-size: 13px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.chosen-list { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 8px; font-size: 15px; color: var(--ink-2); }
.chosen-list span { display: block; font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--ochre); margin-bottom: 2px; }
.bridge { margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--line); }
.bridge p { margin: 0 0 10px; color: var(--ink-2); }
.bridge-lead { font-family: var(--display); font-size: 20px; line-height: 1.3; color: var(--ink) !important; }

.toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 10px); background: #1e2321; color: var(--ink); border: 1px solid var(--line); padding: 10px 16px; border-radius: 4px; font-size: 14px; opacity: 0; transition: opacity .3s, transform .3s; z-index: 100; max-width: min(92vw, 420px); }
.toast.in { opacity: 1; transform: translate(-50%, 0); }

.reader { background: var(--bg-2); color: var(--ink); border: 1px solid var(--line); border-radius: 6px; padding: 32px 28px; width: min(92vw, 480px); }
.reader::backdrop { background: rgba(5,7,7,.78); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }
.reader .close { position: absolute; right: 8px; top: 4px; background: none; border: 0; font-size: 28px; color: var(--muted); padding: 6px 10px; }
.reader form { display: grid; gap: 8px; margin-top: 16px; }
.reader label { font-size: 11.5px; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); }
.reader input { background: rgba(236,230,216,.04); border: 1px solid var(--line); border-radius: 4px; padding: 12px 14px; font-size: 18px; letter-spacing: .12em; text-transform: uppercase; color: var(--ink); min-height: 48px; }

@media (prefers-reduced-motion: reduce) {
  .fx-rain, .fx-drizzle, .fx-runoff, .fx-sweep, .fx-wash, .fx-motes, .fx-haze { display: none; }
  .grain { animation: none; }
  .fx-glow, .fx-steam i { animation: none; }
}
@media (max-width: 899px) and (orientation: landscape) { :root { --stage-h: 70svh; } }
@media (max-height: 560px) and (max-width: 899px) { :root { --stage-h: 52svh; } }
