/* ============================================================
   Doppelganger landing — refined monochrome
   Mirrors the app design system (packages/ui/DESIGN.md): one
   achromatic OKLCH ramp (the .dark tokens from globals.css),
   contrast over color, borders over shadows, Orbitron as the
   futuristic display face, system stacks for body and mono.
   ============================================================ */

@font-face {
  font-family: "Orbitron";
  font-style: normal;
  font-weight: 400 900;
  /* `optional` (not `swap`), matching the app (see apps/web): the font is
     preloaded and tiny, so it's ready at first paint in practice — and on a
     slow network the all-caps clamp()ed h1 must not reflow mid-read. */
  font-display: optional;
  src: url("fonts/orbitron-latin.woff2") format("woff2");
}

/* Hex/rgba fallback ramp first: engines without oklch() (older in-app
   webviews — X's in-app browser is a big slice of launch traffic) would
   otherwise drop every color. Custom properties can't fall back via a
   second declaration (an unsupported value inside var() invalidates the
   whole property at computed-value time), hence the @supports override. */
:root {
  --background: #0a0a0a;
  --foreground: #fafafa;
  --muted-fg: #a3a3a3;
  --dim: #737373;
  --border-soft: rgba(255, 255, 255, 0.06);
  --primary: #e5e5e5;
  --primary-fg: #171717;
  --font-display: "Orbitron", ui-sans-serif, system-ui, sans-serif;
  --font-body:
    ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --container: 1120px;
}

@supports (color: oklch(0.5 0 0)) {
  :root {
    --background: oklch(0.145 0 0);
    --foreground: oklch(0.985 0 0);
    --muted-fg: oklch(0.708 0 0);
    --dim: oklch(0.556 0 0);
    --border-soft: oklch(1 0 0 / 6%);
    --primary: oklch(0.922 0 0);
    --primary-fg: oklch(0.205 0 0);
  }
}

/* ============================================================
   Base
   ============================================================ */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--background);
  color: var(--foreground);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

h1,
h2 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.1;
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

p {
  margin: 0;
}

a {
  color: inherit;
  text-decoration: none;
}

img,
svg {
  display: block;
  max-width: 100%;
}

ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 24px;
}

::selection {
  background: rgba(255, 255, 255, 0.25);
  background: oklch(1 0 0 / 25%);
}

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

/* mono labels */
.eyebrow,
.sec-label,
.footer-copy {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

/* ============================================================
   Nav
   ============================================================ */

.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  border-bottom: 1px solid transparent;
  transition:
    background 0.2s ease,
    border-color 0.2s ease;
}

.nav.scrolled {
  background: rgba(10, 10, 10, 0.88);
  background: oklch(0.145 0 0 / 88%);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  border-bottom-color: var(--border-soft);
}

.nav-inner {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 24px;
  height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* the app's rail monogram: a "D" on a filled primary square */
.brand-mark {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  background: var(--primary);
  color: var(--primary-fg);
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 600;
}

.brand-word {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 14.5px;
  letter-spacing: -0.01em;
}

/* ============================================================
   Buttons — contrast, not color; color transitions only
   ============================================================ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 26px;
  border-radius: 8px;
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.01em;
  white-space: nowrap;
  transition:
    background 0.15s ease,
    border-color 0.15s ease,
    color 0.15s ease;
}

.btn-primary {
  background: var(--primary);
  color: var(--primary-fg);
}

.btn-primary:hover {
  background: var(--foreground);
}

.btn-sm {
  padding: 8px 16px;
  font-size: 13.5px;
  border-radius: 7px;
}

/* ============================================================
   Hero
   ============================================================ */

.hero {
  position: relative;
  padding: 180px 0 104px;
  overflow: clip;
}

/* blueprint grid, radially masked — monochrome, very faint */
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.045) 1px, transparent 1px);
  background-image:
    linear-gradient(oklch(1 0 0 / 4.5%) 1px, transparent 1px),
    linear-gradient(90deg, oklch(1 0 0 / 4.5%) 1px, transparent 1px);
  background-size: 54px 54px;
  -webkit-mask-image: radial-gradient(75% 64% at 50% 30%, #000 35%, transparent 100%);
  mask-image: radial-gradient(75% 64% at 50% 30%, #000 35%, transparent 100%);
}

.hero-inner {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.eyebrow {
  color: var(--muted-fg);
  margin-bottom: 30px;
}

.hero h1 {
  font-size: clamp(38px, 6.8vw, 78px);
  max-width: 16ch;
}

/* the doppelganger: a static offset echo of the word */
.ghost-wrap {
  position: relative;
  display: inline-block;
}

.ghost {
  position: absolute;
  inset: 0;
  z-index: -1;
  color: transparent;
  -webkit-text-stroke: 1px rgba(255, 255, 255, 0.2);
  -webkit-text-stroke: 1px oklch(1 0 0 / 20%);
  transform: translate(7px, 6px);
  pointer-events: none;
  user-select: none;
}

.sub {
  max-width: 56ch;
  margin-top: 28px;
  font-size: 18px;
  color: var(--muted-fg);
}

.cta-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 14px;
  margin-top: 40px;
}

/* stat strip — muted-fg, not dim: 12px text needs WCAG AA (4.5:1), and
   the app system reserves the dim gray for non-text (focus rings) */
.stat-strip {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  margin-top: 58px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted-fg);
}

.stat-strip li {
  padding: 0 26px;
  border-left: 1px solid var(--border-soft);
}

.stat-strip li:first-child {
  border-left: 0;
}

.stat-strip strong {
  color: var(--foreground);
  font-weight: 500;
  margin-right: 8px;
}

/* ============================================================
   Final CTA
   ============================================================ */

.section {
  position: relative;
  padding: 120px 0;
  border-top: 1px solid var(--border-soft);
}

.sec-label {
  color: var(--muted-fg);
}

.final-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 36px 0 26px;
}

/* 24px floor + 8vw: "BE EVERYWHERE" in Orbitron at the old 32px floor
   measured ~343px — wider than the 272px content box of a 320px phone
   (the overflow was masked by body overflow-x: hidden, not absent). */
.final-h {
  font-size: clamp(24px, 8vw, 60px);
  max-width: 100%;
}

.final .sec-label {
  margin: 28px 0 4px;
}

/* ============================================================
   Footer
   ============================================================ */

.footer {
  border-top: 1px solid var(--border-soft);
  padding: 48px 0 56px;
}

.footer-inner {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 32px;
  flex-wrap: wrap;
}

.footer-tag {
  margin-top: 8px;
  font-size: 13px;
  color: var(--muted-fg);
}

.footer-links {
  display: flex;
  gap: 28px;
}

.footer-links a {
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted-fg);
  transition: color 0.15s ease;
}

.footer-links a:hover {
  color: var(--foreground);
}

.footer-copy {
  color: var(--muted-fg);
  letter-spacing: 0.12em;
}

/* ============================================================
   Reveal on scroll — entrance-only, quick (DESIGN.md: 300ms ceiling)
   ============================================================ */

/* hidden start state is gated on html.js (set by app.js), so content
   stays visible without JavaScript */
html.js .reveal {
  opacity: 0;
  transform: translateY(12px);
  transition:
    opacity 0.3s ease,
    transform 0.3s ease;
}

html.js .reveal.in {
  opacity: 1;
  transform: none;
}

/* ============================================================
   Motion preferences
   ============================================================ */

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

/* ============================================================
   Responsive
   ============================================================ */

@media (max-width: 760px) {
  .hero {
    padding: 148px 0 76px;
  }

  .sub {
    font-size: 16.5px;
  }

  .section {
    padding: 84px 0;
  }

  .stat-strip {
    gap: 10px 18px;
  }

  /* no dividers when the strip can wrap — a wrapped row would otherwise
     start with an orphaned left rule */
  .stat-strip li {
    padding: 0;
    border-left: 0;
  }

  .footer-inner {
    flex-direction: column;
  }
}
