/* ==========================================================================
   Orbit Digital — coming soon
   Tokens are taken verbatim from DESIGN.md with two exceptions, both marked:
   the additions --text-hero, --text-fine and --ease-* (EXT), and the accent,
   which is violet #3a0ca3 by client direction rather than Sapphire Volt.
   ========================================================================== */

@font-face {
  font-family: 'Satoshi';
  src: url('/assets/fonts/satoshi-var.woff2') format('woff2');
  font-weight: 300 900;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'JetBrains Mono';
  src: url('/assets/fonts/jetbrains-mono-latin.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
                 U+02DC, U+2000-206F, U+2122, U+2212, U+FEFF, U+FFFD;
}

/* Metric-matched fallback. The boot screen already waits on document.fonts
   before revealing anything, so this is belt-and-braces rather than the only
   defence against a swap shift. Overrides measured against Arial. */
@font-face {
  font-family: 'Satoshi Fallback';
  src: local('Arial');
  ascent-override: 101%;
  descent-override: 24%;
  line-gap-override: 0%;
  size-adjust: 98.5%;
}

:root {
  /* Colors */
  --color-void: #000000;
  --color-obsidian: #1e1e1e;
  --color-graphite: #272727;
  --color-ash: #808080;
  --color-frost: #cccccc;
  --color-paper: #f8f8f8;
  --color-pure-white: #ffffff;
  /* Client direction: the accent is violet, not DESIGN.md's Sapphire Volt
     (#001391). Same role — the single chromatic voice, used only for the CTA,
     the brand mark and the light in the hero. */
  --color-violet-volt: #3a0ca3;
  --color-violet-deep: #26056e;          /* EXT: CTA hover/active step only */

  /* Type */
  --font-display: 'Satoshi', 'Satoshi Fallback', ui-sans-serif, system-ui,
                  -apple-system, 'Segoe UI', sans-serif;
  --font-body: var(--font-display);
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --text-caption: 10px;    --leading-caption: 1.5;
  --text-fine: 12px;       --leading-fine: 1.4;
  --text-body: 15px;       --leading-body: 1.67;
  --text-body-lg: 17px;    --leading-body-lg: 1.24;
  --text-subheading: 23px; --leading-subheading: 1.3;
  --text-heading: 28px;    --leading-heading: 1.4;
  --text-hero: clamp(2.75rem, min(15vw, 12.5vh), 8.5rem);    /* EXT: hero lockup */

  --weight-regular: 400;
  --weight-medium: 500;
  --weight-bold: 700;

  /* Spacing */
  --spacing-8: 8px;     --spacing-16: 16px;   --spacing-24: 24px;
  --spacing-32: 32px;   --spacing-48: 48px;   --spacing-64: 64px;
  --spacing-88: 88px;   --spacing-104: 104px; --spacing-128: 128px;
  --spacing-144: 144px; --spacing-176: 176px;

  /* Layout */
  --page-max-width: 640px;
  --section-gap: var(--spacing-88);
  --gutter: var(--spacing-24);

  /* Radius */
  --radius-tags: 4px;     --radius-cards: 12px;  --radius-inputs: 8px;
  --radius-buttons: 24px; --radius-pills: 128px;

  /* EXT: motion curves. Nothing here eases IN. The single exception on the
     page is the CTA's colour fade, which uses the built-in `ease`: a hover
     colour change is the one case that wants it. */
  --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-out-quint: cubic-bezier(0.22, 1, 0.36, 1);

  /* EXT: the entrance timeline, in one place. app.js reads the scene-side
     values off this element with getComputedStyle, so retiming the reveal
     means editing these tokens and nothing else. */
  --t-scene-in: 500ms;      /* poster out / canvas in, behind the boot sheet */
  --d-boot-out: 260ms;      /* the sheet waits for the scene to be up */
  --t-boot-out: 700ms;
  --d-word-a: 320ms;        /* "Orbit" */
  --d-word-b: 480ms;        /* "Digital" lands after it */
  --t-word: 1250ms;
  --d-eyebrow: 680ms;
  --t-eyebrow: 900ms;
  --t-ignite: 2200ms;       /* scene: light and haze ramp */
  --d-ring: 700ms;          /* scene: rings arrive late */
  --t-ring: 1700ms;
  --t-flash-peak: 700ms;    /* scene: ignition bloom */
  --t-flash-fall: 450ms;
}

/* --------------------------------------------------------------------- base */

*, *::before, *::after { box-sizing: border-box; }

html {
  background: var(--color-void);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--color-void);
  color: var(--color-paper);
  font-family: var(--font-body);
  font-size: var(--text-body-lg);
  line-height: var(--leading-body-lg);
  font-weight: var(--weight-regular);
  font-synthesis-weight: none;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  -webkit-tap-highlight-color: transparent;
}

body::after {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 70;
  pointer-events: none;
  opacity: 0.030;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

h1, p, ul, figure { margin: 0; }
ul { padding: 0; list-style: none; }
a { color: inherit; text-decoration: none; }

:where(a, button, input):focus-visible {
  outline: 1px solid var(--color-frost);
  outline-offset: 4px;
  border-radius: var(--radius-tags);
}

.mono {
  font-family: var(--font-mono);
  font-weight: var(--weight-regular);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.u-sr {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip-path: inset(50%); white-space: nowrap; border: 0;
}

/* --------------------------------------------------------------------- boot */

.boot {
  position: fixed; inset: 0; z-index: 90;
  display: grid; place-items: center;
  background: var(--color-void);
  transition: opacity var(--t-boot-out) var(--ease-out-expo) var(--d-boot-out),
              visibility 0s linear calc(var(--d-boot-out) + var(--t-boot-out));
}
.boot.is-done { opacity: 0; visibility: hidden; pointer-events: none; }

.boot__inner {
  display: grid; gap: var(--spacing-16); justify-items: center;
  transition: transform var(--t-boot-out) var(--ease-out-expo) var(--d-boot-out),
              opacity calc(var(--t-boot-out) * 0.7) var(--ease-out-quint) var(--d-boot-out),
              filter var(--t-boot-out) var(--ease-out-expo) var(--d-boot-out);
}
/* The rail is the same violet as the key light, so it hands off into the
   scene: it blooms outward and dissolves rather than fading to nothing. */
.boot.is-done .boot__inner {
  transform: scale(1.35);
  opacity: 0;
  filter: blur(8px);
}

.boot__rail {
  position: relative;
  width: 120px; height: 1px;
  background: var(--color-graphite);
  overflow: hidden;
}
.boot__fill {
  position: absolute; inset: 0;
  background: var(--color-violet-volt);
  transform: scaleX(0); transform-origin: left center;
  /* Deliberately no transition: paintProgress() lerps this every frame, and
     easing an already-eased value made the bar trail the counter beside it. */
}
.boot__pct {
  font-size: var(--text-caption);
  line-height: var(--leading-caption);
  color: var(--color-ash);
  font-variant-numeric: tabular-nums;
}

/* --------------------------------------------------------------------- hero */

.hero {
  position: relative;
  height: 100vh;
  height: 100dvh;
  min-height: 540px;
  overflow: hidden;
  background: var(--color-void);
}

/* Paints on the first frame, long before the shader has compiled. */
.hero__poster {
  position: absolute; inset: 0;
  background:
    radial-gradient(28% 22% at 61% 38%, rgba(58, 12, 163, 0.52) 0%, rgba(58, 12, 163, 0) 72%),
    radial-gradient(64% 48% at 50% 46%, #14101f 0%, #08060c 50%, #000000 80%);
  transition: opacity var(--t-scene-in) var(--ease-out-quint);
}
.hero.is-live .hero__poster { opacity: 0; }

.hero__canvas {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  display: block;
  opacity: 0;
  /* Same length as the poster's fade-out, so the two never double-expose. */
  transition: opacity var(--t-scene-in) var(--ease-out-quint);
}
.hero.is-live .hero__canvas { opacity: 1; }

/* DESIGN.md: never hard-cut the image into the void. */
.hero__veil {
  position: absolute; inset: auto 0 0 0;
  height: 26%;
  background: linear-gradient(to bottom in oklab, rgba(20, 20, 20, 0) 0%, #141414 64%, #000000 100%);
  pointer-events: none;
}

/* The wordmark splits around the subject: "Orbit" above it, "Digital" below,
   so the type frames the sphere instead of sitting on top of it. */
.lockup {
  position: absolute;
  left: 50%;
  top: calc(var(--spacing-64) + env(safe-area-inset-top));
  transform: translateX(-50%);
  margin: 0;
  pointer-events: none;
  text-align: center;
}

.lockup__word {
  display: block;
  overflow: hidden;
  margin: 0;
  font-size: var(--text-hero);
  font-weight: var(--weight-bold);
  line-height: 0.92;
  letter-spacing: -0.045em;
  color: var(--color-paper);
  /* letter-spacing is applied after the LAST character too, so that trailing
     space sits inside the box text-align centres. Negative tracking therefore
     pushes the visible glyphs right of true centre. Padding the same amount
     back onto the trailing side re-centres the ink. */
  padding: 0 0.045em 0.04em 0;
}
.lockup__word--alt { color: var(--color-frost); }

.lockup__word i {
  display: block;
  font-style: normal;
  transform: translateY(106%);
  transition: transform var(--t-word) var(--ease-out-expo) var(--d-word-a);
  will-change: transform;
}
.hero.is-live .lockup__word i { transform: translateY(0); }
.hero.is-live .lockup__word--alt i { transition-delay: var(--d-word-b); }
/* F5: the reveal runs once, so the layer promotion is released afterwards
   rather than held for the life of the page. */
.hero.is-settled .lockup__word i { will-change: auto; }

.hero__foot {
  position: absolute;
  opacity: var(--foot-opacity, 1);
  left: 50%; bottom: calc(var(--spacing-48) + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  display: grid; gap: var(--spacing-16);
  justify-items: center;
  text-align: center;
  width: 100%;
  padding: 0 var(--gutter);
}

.eyebrow {
  font-size: var(--text-fine);
  line-height: var(--leading-fine);
  letter-spacing: 0.14em;
  padding-left: 0.14em;    /* see .lockup__word: positive tracking leans left */
  color: var(--color-frost);
  opacity: 0;
  transform: translateY(60%);
  transition: opacity var(--t-eyebrow) var(--ease-out-quint) var(--d-eyebrow),
              transform var(--t-eyebrow) var(--ease-out-expo) var(--d-eyebrow);
}
.hero.is-live .eyebrow { opacity: 1; transform: none; }

/* ---------------------------------------------------------------- narrative */

.narrative {
  position: relative;
  background: var(--color-void);
  /* Content height, not viewport height. Centring the column vertically in a
     100dvh section put half the leftover height above the first line, which
     grew with the display: ~340px of dead space on a 1500px screen.

     The top padding is smaller than the bottom on purpose: the hero already
     contributes 48px of its own below its last line, so a symmetric 88px here
     stacked into 136px of black between two consecutive lines of text. At 32
     the run from the hero's last line to the first line here is 80px. */
  padding: var(--spacing-32) var(--gutter) var(--spacing-88);
}

.col {
  max-width: var(--page-max-width);
  margin: 0 auto;
  text-align: center;
  display: grid;
  justify-items: center;
}

.lede {
  font-size: var(--text-subheading);
  line-height: var(--leading-subheading);
  letter-spacing: -0.008em;
  color: var(--color-paper);
  max-width: 34ch;
  margin-bottom: var(--spacing-32);
  text-wrap: pretty;
}
.lede--muted { color: var(--color-ash); margin-bottom: var(--spacing-48); }

[data-reveal] {
  opacity: 0;
  transform: translateY(18px);
  filter: blur(6px);
  transition: opacity 900ms var(--ease-out-quint) var(--reveal-delay, 0ms),
              transform 1100ms var(--ease-out-expo) var(--reveal-delay, 0ms),
              filter 900ms var(--ease-out-quint) var(--reveal-delay, 0ms);
}
[data-reveal].is-in { opacity: 1; transform: none; filter: blur(0); }

/* ------------------------------------------------------------------ closing */

.closing {
  font-size: var(--text-heading);
  line-height: var(--leading-heading);
  letter-spacing: -0.02em;
  color: var(--color-paper);
  margin-bottom: var(--spacing-32);
  max-width: 26ch;
  text-wrap: balance;      /* even line lengths, since it is centred */
}

/* ----------------------------------------------------------------------- cta */

.btn {
  position: relative;
  display: inline-block;
  border: 0;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: var(--spacing-16);
  padding: 10px 10px 10px var(--spacing-32);
  font-family: var(--font-body);
  font-size: var(--text-body-lg);
  line-height: var(--leading-body-lg);
  color: var(--color-paper);
  background: var(--color-violet-volt);
  border-radius: var(--radius-pills);
  text-align: center;
  transition: background-color 180ms ease,
              transform 160ms var(--ease-out-expo);
}
/* Touch fires hover on tap, which would otherwise leave the CTA stuck in its
   hover colour after the finger lifts. */
@media (hover: hover) and (pointer: fine) {
  .btn:hover { background: var(--color-violet-deep); }
}
.btn:active { transform: scale(0.97); }

/* The arrow sits in its own well rather than floating beside the label, and
   leans out on hover: the kinetic tension is inside the button, not on it. */
.btn__icon {
  display: grid;
  place-items: center;
  flex: none;
  width: 33px; height: 33px;
  border-radius: var(--radius-pills);
  background: rgba(248, 248, 248, 0.12);
  transition: transform 260ms var(--ease-out-expo),
              background-color 200ms ease;
}
.btn__icon svg { width: 15px; height: 15px; }
@media (hover: hover) and (pointer: fine) {
  .btn:hover .btn__icon {
    transform: translate(2px, -2px);
    background: rgba(248, 248, 248, 0.2);
  }
}

.fineprint {
  margin-top: var(--spacing-24);
  max-width: 46ch;
  font-size: var(--text-caption);
  line-height: var(--leading-caption);
  color: var(--color-ash);
  letter-spacing: 0.08em;
  padding-left: 0.08em;
}

/* --------------------------------------------------------------------- foot */

.foot {
  margin-top: var(--spacing-88);
  display: grid;
  justify-items: center;
}
.foot__meta {
  font-size: var(--text-caption);
  line-height: var(--leading-caption);
  color: var(--color-ash);
  opacity: 0.6;
}

/* ------------------------------------------------------------------- mobile */

@media (max-width: 640px) {
  .lede { font-size: 19px; line-height: 1.38; max-width: 30ch; }
  .closing { font-size: var(--text-subheading); line-height: var(--leading-subheading); }
  .btn { display: inline-flex; width: 100%; justify-content: space-between; }
  .foot { margin-top: var(--spacing-64); }
}

@media (max-height: 760px) {
  .hero__foot { gap: var(--spacing-8); }
  .lockup { top: calc(var(--spacing-48) + env(safe-area-inset-top)); }
}

@media (max-height: 540px) and (orientation: landscape) {
  .hero { height: 540px; }
  .lockup { top: calc(var(--spacing-32) + env(safe-area-inset-top)); }
}

/* ----------------------------------------------------------- reduced motion */
/* Not a stripped version: one composed still frame, everything resolved. */

@media (prefers-reduced-motion: reduce) {
  .boot { display: none; }
  .hero__poster { opacity: 0; }
  .hero__canvas { opacity: 1; }
  .eyebrow { opacity: 1; transform: none; }
  .lockup__word i { transform: none; }
  [data-reveal] { opacity: 1; transform: none; filter: none; }

  /* Drop movement, keep feedback: opacity and colour still transition, so
     hovering and pressing the CTA is still acknowledged. */
  *, *::before, *::after {
    animation: none !important;
    transition-property: opacity, color, background-color, border-color, filter !important;
    transition-duration: 200ms !important;
    transition-delay: 0s !important;
    scroll-behavior: auto !important;
  }
  .btn:active { transform: none; }
  .boot.is-done .boot__inner { transform: none; filter: none; }
}
