/* SignNowGo Academy opening film (about 14 s).
   Five illustrated shots, one lit subject each, the camera always moving and
   light carrying every cut: late-night study -> practice -> the path ahead ->
   a first signing -> the Academy page. The film keeps its own night palette in
   both themes; the last shot brightens into the page's own theme. */

/* First-paint cover while the opening is pending (set by the inline head script).
   A CSS-only failsafe lifts it even if the script never runs. */
html[data-academy-intro]::after {
  content: ""; position: fixed; inset: 0; z-index: 2147483000;
  background: #070d10;
  animation: sai-failsafe .4s 12s forwards;
}
html[data-academy-intro="playing"]::after { animation: none; opacity: 0; pointer-events: none; }
@keyframes sai-failsafe { to { opacity: 0; visibility: hidden; } }

.sai {
  --night: #070d10; --night-2: #0d171b; --ink: #eef5f2; --muted: #9db0ab;
  --mint: #63d4a7; --mint-hi: #b8f3dc; --copper: #d8915a; --lamp: #f3c98b;
  --line: rgb(217 232 226 / 14%);
  --page-bg: var(--sng-canvas, #0b1011); --page-ink: var(--sng-ink, #f5f8f7); --page-accent: var(--sng-accent, #63d4a7);
  position: fixed; inset: 0; z-index: 2147483001; overflow: hidden; isolation: isolate;
  background: var(--night); color: var(--ink);
  font-family: var(--font-geist-sans), "Geist", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}
.sai * { box-sizing: border-box; }
.sai svg { display: block; overflow: visible; }

/* ---------- Shots ---------- */
.sai-shot { position: absolute; inset: 0; opacity: 0; will-change: opacity, transform; }
.sai-cam { position: absolute; inset: -4%; will-change: transform; }
.sai-bg { position: absolute; inset: 0; width: 100%; height: 100%; }
.sai-subject { position: absolute; left: 50%; top: 46%; transform: translate(-50%, -50%); }

/* Shared light */
.sai-key { position: absolute; border-radius: 50%; pointer-events: none;  }
.sai-sweep {
  position: absolute; inset: -10% -40%; z-index: 30; pointer-events: none; opacity: 0;
  background: linear-gradient(100deg, transparent 38%, rgb(184 243 220 / 0%) 42%, rgb(184 243 220 / 22%) 49%, rgb(255 255 255 / 34%) 50%, rgb(184 243 220 / 18%) 51%, transparent 60%);
  
}
.sai-grain {
  position: absolute; inset: 0; z-index: 31; pointer-events: none; opacity: .06;
  background-image: radial-gradient(rgb(255 255 255 / 60%) .6px, transparent .7px);
  background-size: 3px 3px;
}
.sai-vignette { position: absolute; inset: 0; z-index: 29; pointer-events: none; background: radial-gradient(ellipse 75% 70% at 50% 46%, transparent 55%, rgb(0 0 0 / 55%)); }

/* Shot 1: late-night study */
.sai-room-wall { fill: #0b1418; }
.sai-window { fill: #0f2230; stroke: #1c3440; stroke-width: 6; }
.sai-sky { fill: url(#sai-skyg); }
.sai-skyline path { fill: #091218; }
.sai-skyline rect { fill: var(--lamp); opacity: .55; }
.sai-moon { fill: #e9f3ef; opacity: .9; }
.sai-desk { fill: #132126; }
.sai-lampcone { position: absolute; left: 4%; top: -10%; width: 70vmax; height: 70vmax; background: radial-gradient(circle at 30% 20%, rgb(243 201 139 / 30%), rgb(243 201 139 / 8%) 40%, transparent 65%); }
.sai-laptop { width: min(84vw, 640px); }
.sai-lid {
  position: relative; aspect-ratio: 16 / 10; border-radius: 16px 16px 6px 6px; padding: 3.2% 3.2% 3%;
  background: linear-gradient(160deg, #26343a, #121b1f); border: 1px solid #36474e;
  box-shadow: 0 40px 90px rgb(0 0 0 / 55%), 0 0 0 1px rgb(255 255 255 / 3%) inset;
}
.sai-screen {
  position: relative; height: 100%; border-radius: 8px; overflow: hidden; padding: 5% 6%;
  background: radial-gradient(ellipse at 20% 0%, #163128, #0b1513 70%); color: var(--ink);
  display: flex; flex-direction: column; gap: 5%;
  box-shadow: 0 0 60px rgb(99 212 167 / 18%);
}
.sai-base { height: 14px; margin: 0 -7%; border-radius: 0 0 18px 18px; background: linear-gradient(#2c3a40, #10171a); box-shadow: 0 18px 40px rgb(0 0 0 / 50%); }
.sai-base::after { content: ""; display: block; width: 18%; height: 5px; margin: 0 auto; border-radius: 0 0 8px 8px; background: #0b1113; }
.sai-app-top { display: flex; justify-content: space-between; align-items: center; font: 600 clamp(8px, 1.4vw, 11px) var(--font-geist-mono), ui-monospace, monospace; letter-spacing: .12em; color: var(--mint); }
.sai-app-top span:last-child { color: var(--muted); letter-spacing: .04em; }
.sai-lesson-title { margin: 0; font-size: clamp(15px, 3vw, 26px); font-weight: 500; letter-spacing: -.03em; }
.sai-lesson-lines { display: grid; gap: 7%; flex: 1; align-content: start; }
.sai-lesson-lines i { display: block; height: clamp(5px, .9vw, 8px); border-radius: 6px; background: rgb(238 245 242 / 14%); transform-origin: left; transform: scaleX(0); }
.sai-lesson-lines i:nth-child(2) { width: 86%; } .sai-lesson-lines i:nth-child(3) { width: 92%; } .sai-lesson-lines i:nth-child(4) { width: 64%; }
.sai-lesson-lines i.hl { background: linear-gradient(90deg, rgb(99 212 167 / 55%), rgb(99 212 167 / 20%)); }
.sai-meter { height: 6px; border-radius: 6px; background: rgb(238 245 242 / 10%); overflow: hidden; }
.sai-meter b { display: block; height: 100%; background: var(--mint); transform-origin: left; transform: scaleX(.16); box-shadow: 0 0 12px var(--mint); }
.sai-mug { position: absolute; right: -9%; bottom: 6%; width: 11%; }
.sai-steam path { fill: none; stroke: rgb(238 245 242 / 30%); stroke-width: 3; stroke-linecap: round; }

/* Shot 2: practice */
.sai-bokeh i { position: absolute; border-radius: 50%; background: radial-gradient(circle, rgb(99 212 167 / 30%), transparent 70%); }
.sai-q {
  width: min(88vw, 560px); padding: clamp(20px, 4vw, 34px); border-radius: 26px;
  background: linear-gradient(160deg, rgb(24 36 40 / 96%), rgb(13 22 25 / 96%)); border: 1px solid var(--line);
  box-shadow: 0 50px 120px rgb(0 0 0 / 55%), 0 0 0 1px rgb(255 255 255 / 3%) inset;
  transform-style: preserve-3d;
}
.sai-q-top { display: flex; justify-content: space-between; align-items: center; font: 600 11px var(--font-geist-mono), ui-monospace, monospace; letter-spacing: .12em; color: var(--mint); }
.sai-ring { width: 46px; height: 46px; }
.sai-ring circle { fill: none; stroke-width: 4; }
.sai-ring .bg { stroke: rgb(238 245 242 / 10%); }
.sai-ring .fg { stroke: var(--mint); stroke-linecap: round; transform: rotate(-90deg); transform-origin: 23px 23px; }
.sai-ring text { fill: var(--ink); font: 600 11px var(--font-geist-sans), Arial, sans-serif; text-anchor: middle; dominant-baseline: central; }
.sai-q h3 { margin: 18px 0 20px; font-size: clamp(20px, 3.4vw, 30px); font-weight: 500; letter-spacing: -.035em; line-height: 1.15; }
.sai-opts { display: grid; gap: 10px; }
.sai-opt { display: flex; align-items: center; gap: 12px; padding: 13px 15px; border-radius: 14px; border: 1px solid var(--line); font-size: clamp(14px, 2.2vw, 16px); color: var(--ink); background: rgb(255 255 255 / 2%); transition: none; }
.sai-opt s { text-decoration: none; width: 20px; height: 20px; border-radius: 50%; border: 1.5px solid rgb(238 245 242 / 25%); flex: none; display: grid; place-items: center; font-size: 12px; color: transparent; }
.sai-opt.is-right { border-color: rgb(99 212 167 / 70%); background: rgb(99 212 167 / 12%); box-shadow: 0 0 40px rgb(99 212 167 / 18%); }
.sai-opt.is-right s { background: var(--mint); border-color: var(--mint); color: var(--night); }
.sai-opt.is-dim { opacity: .45; }
.sai-cursor { position: absolute; width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--ink); background: rgb(238 245 242 / 18%); opacity: 0; pointer-events: none; }

/* Shot 3: the path ahead */
.sai-path-svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.sai-road { fill: none; stroke: rgb(238 245 242 / 8%); stroke-width: 26; stroke-linecap: round; }
.sai-road-line { fill: none; stroke: var(--mint); stroke-width: 3; stroke-linecap: round; }
.sai-road-dash { fill: none; stroke: rgb(238 245 242 / 18%); stroke-width: 2; stroke-dasharray: 2 16; stroke-linecap: round; }
.sai-mile circle.halo { fill: rgb(99 212 167 / 0%); }
.sai-mile circle.dot { fill: var(--night-2); stroke: rgb(238 245 242 / 30%); stroke-width: 3; }
.sai-mile text { fill: var(--muted); font: 500 26px var(--font-geist-sans), Arial, sans-serif; letter-spacing: -.01em; }
.sai-mile text.n { font: 600 16px var(--font-geist-mono), ui-monospace, monospace; letter-spacing: .1em; fill: rgb(238 245 242 / 40%); }
.sai-mile.is-on circle.dot { fill: var(--mint); stroke: var(--mint-hi); }
.sai-mile.is-on circle.halo { fill: rgb(99 212 167 / 18%); }
.sai-mile.is-on text { fill: var(--ink); }
.sai-mile.is-on text.n { fill: var(--mint); }
.sai-traveller { fill: #fff; }

/* Shot 4: a first signing (top-down table) */
.sai-table { fill: #15110d; }
.sai-table-grain path { fill: none; stroke: rgb(216 145 90 / 7%); stroke-width: 2; }
.sai-doc { fill: #f2efe8; }
.sai-doc-line { stroke: #c9c3b6; stroke-width: 5; stroke-linecap: round; }
.sai-doc-head { stroke: #8f887a; stroke-width: 9; stroke-linecap: round; }
.sai-sigline { stroke: #6e675b; stroke-width: 2.5; }
.sai-sig { fill: none; stroke: #173b6e; stroke-width: 4.5; stroke-linecap: round; stroke-linejoin: round; }
.sai-journal { fill: #1f3a33; }
.sai-journal-page { fill: #e7e2d6; }
.sai-pen { fill: #0d1214; }
.sai-pen-tip { fill: var(--copper); }
.sai-seal-shadow { fill: rgb(0 0 0 / 35%); filter: blur(10px); }
.sai-seal circle { fill: none; stroke: var(--copper); }
.sai-seal text { fill: var(--copper); font: 600 15px var(--font-geist-mono), ui-monospace, monospace; letter-spacing: .26em; }
.sai-impact { fill: none; stroke: var(--copper); stroke-width: 3; opacity: 0; }
.sai-tablelamp { position: absolute; inset: 0; background: radial-gradient(ellipse 60% 55% at 52% 44%, rgb(243 201 139 / 22%), transparent 70%);  }

/* Shot 5: the page */
.sai-end { background: var(--page-bg); }
.sai-bloom { position: absolute; left: 50%; top: 46%; width: 10px; height: 10px; border-radius: 50%; transform: translate(-50%, -50%); background: radial-gradient(circle, #fff, rgb(184 243 220 / 60%) 30%, transparent 70%); opacity: 0; z-index: 28; pointer-events: none; }
.sai-steps { position: absolute; left: 50%; top: 66%; transform: translateX(-50%); width: min(88vw, 560px); display: grid; grid-template-columns: repeat(4, 1fr); opacity: 0; }
.sai-steps::before { content: ""; position: absolute; left: 12.5%; right: 12.5%; top: 6px; height: 1px; background: var(--page-accent); opacity: .7; }
.sai-steps div { position: relative; display: grid; justify-items: center; gap: 9px; font-size: 12px; color: var(--page-ink); }
.sai-steps i { width: 13px; height: 13px; border-radius: 50%; background: var(--page-accent); box-shadow: 0 0 0 5px color-mix(in srgb, var(--page-accent) 16%, transparent); }
.sai-steps span { font: 400 10px var(--font-geist-mono), ui-monospace, monospace; letter-spacing: .08em; opacity: .7; }
.sai-title {
  position: fixed; margin: 0; opacity: 0; transform-origin: 0 0; z-index: 27;
  font-family: var(--font-geist-sans), "Geist", Arial, sans-serif; -webkit-font-smoothing: antialiased;
  font-weight: 500; letter-spacing: -.045em; line-height: 1.12; color: var(--sng-ink, #f5f8f7);
  pointer-events: none;
}
.sai-title em { font-style: normal; color: var(--sng-accent, #63d4a7); }

/* ---------- Captions & chrome ---------- */
.sai-cap { position: absolute; z-index: 32; left: clamp(20px, 5vw, 64px); bottom: clamp(70px, 12vh, 120px); width: min(calc(100vw - 40px), 470px); pointer-events: none; }
.sai-cap > div { position: absolute; left: 0; bottom: 0; width: 100%; opacity: 0; }
.sai-cap small { display: block; font: 600 11px var(--font-geist-mono), ui-monospace, monospace; letter-spacing: .14em; color: var(--mint); margin-bottom: 10px; }
.sai-cap h2 { margin: 0; font-size: clamp(26px, 4.4vw, 46px); font-weight: 500; letter-spacing: -.045em; line-height: 1.05; color: #fff; text-shadow: 0 2px 30px rgb(0 0 0 / 60%); }
.sai-cap h2 em { font-style: normal; color: var(--mint); }
.sai-cap p { margin: 10px 0 0; font-size: clamp(13px, 1.6vw, 15px); line-height: 1.5; color: #c9d6d2; text-shadow: 0 1px 14px rgb(0 0 0 / 70%); }
.sai-label { position: absolute; z-index: 33; left: 20px; bottom: max(18px, env(safe-area-inset-bottom)); margin: 0; font-size: 11px; color: rgb(238 245 242 / 62%); letter-spacing: .02em; opacity: 0; }
.sai-skip {
  position: absolute; z-index: 33; right: 18px; bottom: max(14px, env(safe-area-inset-bottom));
  font: 600 12px/1 var(--font-geist-sans), Arial, sans-serif; color: #fff;
  background: rgb(10 16 17 / 72%);
  border: 1px solid rgb(255 255 255 / 16%); border-radius: 30px; padding: 10px 15px; cursor: pointer;
}
.sai-skip:focus-visible { outline: 2px solid var(--mint); outline-offset: 3px; }
.sai-progress { position: absolute; z-index: 33; left: 0; right: 0; bottom: 0; height: 2px; }
.sai-progress b { display: block; height: 100%; background: var(--mint); transform-origin: left; transform: scaleX(0); opacity: .75; }
.sai-brand { position: absolute; z-index: 33; left: clamp(20px, 5vw, 64px); top: max(22px, env(safe-area-inset-top)); font: 600 11px var(--font-geist-mono), ui-monospace, monospace; letter-spacing: .2em; color: rgb(238 245 242 / 70%); opacity: 0; }

/* Phones: subjects sit higher, captions below them. */
@media (max-aspect-ratio: 1/1) {
  .sai-subject { top: 38%; }
  .sai-cap { bottom: clamp(64px, 11vh, 96px); }
  .sai-mug { display: none; }
  .sai-mile text { font-size: 30px; }
}
@media (max-width: 560px) {
  .sai-label { max-width: 52vw; }
  .sai-q h3 { margin: 14px 0 14px; }
  .sai-opt { padding: 11px 12px; }
}

/* Light theme: the headline accent lands in the page's text mint. */
html[data-sng-theme="light"] .sai-title em { color: var(--sng-accent-text, #0f7a5a); }
