/* Tokens follow the Noopher design system (design-noopher skill). */
:root {
  --black: #000000;
  --graphite: #272729;
  --crimson: #C41E3A;
  --crimson-hover: #D14154;
  --crimson-active: #9E102D;
  --dark-text: #DCDCDC;
  --dark-text-2: #ADADAD;
  --dark-line: rgba(255, 255, 255, 0.10);

  --sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "PingFang TC", "Noto Sans TC", Helvetica, Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  --ease-in: cubic-bezier(0.215, 0.61, 0.355, 1);
  --ease: cubic-bezier(0.645, 0.045, 0.355, 1);
  --radius: 8px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
/* The page never scrolls; main.js steps between scenes on wheel / swipe / keys. */
html, body { height: 100%; overflow: hidden; overscroll-behavior: none; }
body {
  margin: 0;
  background: var(--black);
  color: var(--dark-text);
  font: 400 14px/1.571 var(--sans);
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, p, ol { margin: 0; }
a { color: inherit; text-decoration: none; }

.wrap { width: 100%; max-width: 1120px; margin: 0 auto; padding: 0 24px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }

:focus-visible { outline: 2px solid var(--crimson-hover); outline-offset: 3px; border-radius: 3px; }


.eyebrow {
  font: 500 13px/1 var(--mono);
  letter-spacing: 0.08em;
  color: var(--dark-text-2);
  margin-bottom: 24px;
}

/* ---------- Story: pinned 3D stage ---------- */
.story { position: relative; height: 100%; background: var(--black); }
.stage {
  position: sticky; top: 0;
  height: 100vh; height: 100svh;
  display: flex; flex-direction: column;
  overflow: hidden;
  isolation: isolate;
}
.stage__canvas { position: absolute; inset: 0; width: 100%; height: 100%; z-index: -2; }
.stage__grid {
  position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background-image:
    linear-gradient(var(--dark-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--dark-line) 1px, transparent 1px);
  background-size: 64px 64px;
  background-position: center center;
  opacity: 0.22;
  mask-image: radial-gradient(ellipse 70% 50% at 50% 35%, #000 10%, transparent 70%);
  -webkit-mask-image: radial-gradient(ellipse 70% 50% at 50% 35%, #000 10%, transparent 70%);
}

.nav { display: flex; align-items: center; justify-content: space-between; padding-top: 24px; padding-bottom: 24px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: #fff; font-weight: 600; font-size: 18px; letter-spacing: 0.01em; }
.brand__mark { width: 28px; height: 28px; }
.tag {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 12px;
  border: 1px solid var(--dark-line);
  border-radius: 5px;
  font: 500 12px/1 var(--mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--dark-text-2);
}
.tag__dot { width: 6px; height: 6px; border-radius: 50%; background: var(--crimson); animation: pulse 2s var(--ease) infinite; }
@keyframes pulse { 50% { opacity: 0.3; } }

/* Panels stack in one grid cell below the animation; only the active one is visible. */
.panels { flex: 1; display: grid; align-items: start; padding-bottom: 32px; } /* padding-top set by main.js */
.panel {
  grid-area: 1 / 1;
  justify-self: start;
  width: calc(100% - var(--x, 0%));
  max-width: 760px;
  text-align: left;
  margin-left: var(--x, 0);
  opacity: 0;
  will-change: opacity;
}
.panel:not(.is-active) { visibility: hidden; }
.panel.is-active { opacity: 1; }
.panel { perspective: 1000px; perspective-origin: 0 50%; }
.panel > * { transform-origin: 0 50%; will-change: transform, filter; }
/* Loose, editorial placement: each scene starts at a different column. */
.panel[data-panel="0"] { --x: 0%; }
.panel[data-panel="1"] { --x: 14%; }
.panel[data-panel="2"] { --x: 4%; }
.panel[data-panel="3"] { --x: 26%; }
.panel[data-panel="4"] { --x: 8%; }
.panel[data-panel="5"] { --x: 18%; }
.panel[inert] { pointer-events: none; }

.hero__title {
  font-size: clamp(40px, 5.2vw, 72px);
  line-height: 1.05;
  font-weight: 600;
  letter-spacing: -0.035em;
  color: #fff;
}
.hero__title .line { display: inline-block; opacity: 0; transform: translateY(24px); }
.is-ready .hero__title .line { animation: rise 0.9s var(--ease-in) forwards; }
.hero__title .line--accent { color: var(--crimson); }
.is-ready .hero__title .line--accent { animation-delay: 0.15s; }
.hero__vision {
  margin: 20px 0 0;
  max-width: 34em;
  font-size: clamp(16px, 1.4vw, 18px);
  line-height: 1.7;
  color: var(--dark-text);
  opacity: 0;
}
.panel .signup { opacity: 0; }
.is-ready .hero__vision { animation: fade-in 0.9s var(--ease-in) 0.35s forwards; }
.is-ready .panel .signup { animation: fade-in 0.9s var(--ease-in) 0.5s forwards; }
/* Text position is computed by main.js; keep it hidden until then so it never jumps. */
.stage:not(.is-ready) .panels { visibility: hidden; }
@keyframes rise { to { opacity: 1; transform: none; } }
@keyframes fade-in { to { opacity: 1; } }

.panel__title {
  font-size: clamp(32px, 3.8vw, 52px);
  line-height: 1.1;
  text-wrap: balance;
  font-weight: 600;
  letter-spacing: -0.03em;
  color: #fff;
}
.panel__text { margin: 20px 0 0; max-width: 30em; font-size: clamp(16px, 1.4vw, 18px); line-height: 1.7; color: var(--dark-text-2); }

.stage__meta {
  display: flex; justify-content: space-between; align-items: center; gap: 16px;
  padding-bottom: 24px;
  font: 500 13px/1 var(--mono);
  letter-spacing: 0.08em;
  color: #8a8a8d;
}
.flow span { transition: color 0.3s var(--ease); }
.flow span.is-on { color: #fff; }
.progress { display: inline-flex; align-items: center; gap: 12px; }
.progress__hint { color: var(--crimson-hover); animation: pulse 2s var(--ease) infinite; transition: opacity 0.3s var(--ease); }
.progress.is-scrolled .progress__hint { opacity: 0; animation: none; }
.progress__bar { position: relative; width: 96px; height: 1px; background: rgba(255, 255, 255, 0.16); }
.progress__bar span { position: absolute; left: 0; top: 0; bottom: 0; width: 0; background: var(--crimson); }

/* ---------- Signup form ---------- */
.signup { margin: 28px 0 0; max-width: 480px; }
.signup__field {
  display: flex;
  padding: 4px;
  background: rgba(39, 39, 41, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 10px;
  transition: border-color 0.2s var(--ease);
}
.signup__field:focus-within { border-color: var(--crimson); }
.signup__field::before {
  content: "›";
  align-self: center;
  padding-left: 14px;
  font: 500 18px/1 var(--mono);
  color: var(--crimson-hover);
}
.signup input[type="email"] {
  flex: 1; min-width: 0;
  padding: 12px 10px;
  background: transparent; border: 0; outline: 0;
  color: #fff;
  font: 400 16px/1.25 var(--sans);
}
.signup input::placeholder { color: #77777a; }
.signup button {
  flex: none;
  padding: 12px 20px;
  border: 0; border-radius: var(--radius);
  background: var(--crimson);
  color: #fff;
  font: 600 14px/1.25 var(--sans);
  cursor: pointer;
  transition: background-color 0.2s var(--ease), transform 0.1s var(--ease);
}
.signup button:hover { background: var(--crimson-hover); }
.signup button:active { background: var(--crimson-active); transform: scale(0.98); }
.signup button:disabled { opacity: 0.6; cursor: progress; }
.signup__msg { min-height: 22px; margin-top: 12px; font-size: 14px; color: var(--dark-text-2); }
.signup__msg.is-ok { color: #fff; }
.signup__msg.is-ok::before { content: "✓ "; color: var(--crimson-hover); }
.signup__msg.is-error { color: #F7C3C5; }
.signup.is-done .signup__field { border-color: rgba(196, 30, 58, 0.6); }

/* ---------- Byline (always visible in the bottom bar) ---------- */
.byline {
  font: 400 13px/1 var(--sans); letter-spacing: 0; color: #8a8a8d;
}

/* ---------- Responsive ---------- */
@media (max-width: 760px) {
  .wrap { padding-left: 16px; padding-right: 16px; }
  .panels { padding-bottom: 24px; }
  .panel { margin-left: calc(var(--x, 0%) / 4); width: calc(100% - var(--x, 0%) / 4); }
  .hero__title .line { display: block; }
  .panel__text { margin-top: 16px; }
  .signup { margin-top: 28px; }
  .stage__meta { font-size: 12px; }
  .stage__meta .flow { display: none; }
  .stage__meta .progress { margin-left: auto; }
  .stage__meta > * { white-space: nowrap; }
  .signup button { padding: 12px 16px; }
  .progress__hint { display: none; }
  .progress__bar { width: 64px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01s !important; animation-delay: 0s !important; transition-duration: 0.01s !important; }
}
