/* Homepage dark restyle. Imported only by public/index.html.
   Do not @import this file from landing-v2.css or marketing-layout.css —
   those leak into the SPA and the light marketing shell. */

@font-face {
  font-family: 'Syne';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('/fonts/syne-latin-600-normal.woff2') format('woff2');
}
@font-face {
  font-family: 'Syne';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('/fonts/syne-latin-700-normal.woff2') format('woff2');
}

body.home-dark {
  --home-bg: #05070a;
  --home-fg: #f2f5f8;
  --home-muted: #8b95a3;
  --home-surface: #0c1118;
  --home-surface-2: #121922;
  --home-border: #1c2733;
  --home-glow: #1a9fe0;
  --display: 'Syne', var(--sans);

  --v-bg: var(--home-bg);
  --v-surface: var(--home-surface);
  --v-surface-muted: var(--home-surface-2);
  --v-fg: var(--home-fg);
  --v-fg-muted: var(--home-muted);
  --v-fg-subtle: #8b95a3;
  --v-border: var(--home-border);
  --v-hover: rgba(255, 255, 255, 0.06);
  --brand-tint: rgba(15, 129, 199, 0.16);
  --brand-line: rgba(15, 129, 199, 0.35);
  --hair: 0 0 0 1px rgba(255, 255, 255, 0.07);
  --sh-1: 0 1px 2px -1px rgba(0, 0, 0, 0.45), 0 8px 24px -10px rgba(0, 0, 0, 0.55);
  --sh-2: 0 2px 6px -2px rgba(0, 0, 0, 0.5), 0 18px 40px -16px rgba(0, 0, 0, 0.62);
  --elev: var(--hair), var(--sh-1);

  background: var(--home-bg);
  color: var(--home-fg);
  color-scheme: dark;
}

body.home-dark ::selection {
  background: rgba(26, 159, 224, 0.35);
  color: var(--home-fg);
}

body.home-dark :focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 3px;
}

/* Display face: homepage headlines and labels only. Nav/body/buttons stay Geist. */
body.home-dark .kicker,
body.home-dark .eyebrow,
body.home-dark h1,
body.home-dark h2,
body.home-dark h3,
body.home-dark .home-cinematic-line {
  font-family: var(--display);
}

body.home-dark .kicker,
body.home-dark .eyebrow {
  letter-spacing: 0.18em;
}

/* The white glass capsule is a light surface sitting on ink. Keep its type
   and hover tokens on the light axis so links do not wash out. A little
   more see-through than the light-page pill so the hero reads through it. */
body.home-dark .nav-in {
  --v-fg: #0a0a0a;
  --v-fg-muted: #5a5a5a;
  --v-fg-subtle: #767676;
  --v-hover: rgba(10, 10, 10, 0.06);
  --v-surface: #ffffff;
  --v-border: #d4d4d4;
  --v-chrome-bg: #ffffff;
  --v-chrome-border: #e3e3e3;
  --v-chrome-hover: #f5f5f5;
  --hair: 0 0 0 1px rgba(16, 38, 56, 0.07);
  --sh-nav: 0 1px 2px rgba(16, 38, 56, 0.05), 0 10px 28px -14px rgba(16, 38, 56, 0.22);
  color: #0a0a0a;
  background: #fffffff0;
  backdrop-filter: saturate(180%) blur(18px);
  -webkit-backdrop-filter: saturate(180%) blur(18px);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.45), var(--sh-nav);
}
body.home-dark .nav.scrolled .nav-in {
  background: #fffffff0;
}

/* Mobile menu primary CTA. landing-v2 paints it background:var(--v-fg) with
   #fafafa text — --v-fg is near-white here (the menu sits outside .nav-in's
   light re-scope), so invert to a light button with ink text. */
body.home-dark .mobile-menu-signin[href="/app/start"],
body.home-dark .mobile-menu a.m-primary {
  background: var(--home-fg);
  color: #0a0a0a;
  border-color: var(--home-fg);
}
body.home-dark .mobile-menu-signin[href="/app/start"]:hover,
body.home-dark .mobile-menu a.m-primary:hover {
  background: #d9e1e8;
  color: #0a0a0a;
  border-color: #d9e1e8;
}

body.home-dark .eyebrow {
  background: rgba(12, 17, 24, 0.72);
  color: rgba(242, 245, 248, 0.88);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.12);
}

/* Hero loop sits above the LCP still and fades in; scrim/copy stay above it. */
body.home-dark header.hero.hero-rail .home-loop {
  z-index: 1;
}
body.home-dark header.hero.hero-rail .hero-rail-scrim,
body.home-dark header.hero.hero-rail .hero-in {
  z-index: 2;
}
body.home-dark header.hero.hero-rail .hero-rail-line {
  z-index: 3;
}

body.home-dark .hero-text > * {
  animation: home-rise-in 0.7s cubic-bezier(0.22, 1, 0.36, 1) both;
}
body.home-dark .hero-text > *:nth-child(1) { animation-delay: 80ms; }
body.home-dark .hero-text > *:nth-child(2) { animation-delay: 160ms; }
body.home-dark .hero-text > *:nth-child(3) { animation-delay: 240ms; }
body.home-dark .hero-text > *:nth-child(4) { animation-delay: 340ms; }

@keyframes home-rise-in {
  from { opacity: 0; transform: translateY(14px); filter: blur(6px); }
  to { opacity: 1; transform: translateY(0); filter: blur(0); }
}

/* Stay in the tunnel — no grey ramp back to #fafafa.
   Light homepage uses this band as a long dissolve; here it is the same
   ink as #features, so the inherited tight-section pad reads as dead space. */
body.home-dark header.hero.hero-rail + .formats-section {
  background: var(--home-bg);
  padding-bottom: clamp(12px, 1.6vw, 20px);
}

body.home-dark #features {
  padding-top: clamp(28px, 3.2vw, 48px);
}

body.home-dark .formats {
  background: rgba(12, 17, 24, 0.92);
  box-shadow: inset 0 0 0 1px var(--home-border), var(--sh-1);
}

body.home-dark .formats .lead::after,
body.home-dark .hero-format:not(:last-child)::after,
body.home-dark .hero-format:nth-child(3n+4)::before {
  background: var(--home-border);
}

body.home-dark .section-panel {
  background:
    radial-gradient(88% 70% at 92% 0%, rgba(15, 129, 199, 0.14) 0%, rgba(15, 129, 199, 0) 58%),
    var(--home-surface);
  box-shadow: inset 0 0 0 1px var(--home-border);
}

body.home-dark .hsq-tile:hover {
  background: rgba(255, 255, 255, 0.08);
}

body.home-dark .hsq-more {
  background: var(--brand-tint);
  color: #9fd4f5;
}

body.home-dark .guard-type.t-danger {
  background: rgba(229, 72, 77, 0.14);
}
body.home-dark .guard-type.t-warn {
  background: rgba(245, 166, 35, 0.14);
  color: #f0c36a;
}

body.home-dark .cta-band {
  color: var(--home-fg);
  background:
    radial-gradient(72% 88% at 50% -12%, rgba(15, 129, 199, 0.34) 0%, rgba(15, 129, 199, 0) 62%),
    var(--home-surface);
  box-shadow: inset 0 0 0 1px var(--home-border), var(--sh-2);
}

body.home-dark .cta-band .btn-on-dark:hover {
  box-shadow: 0 16px 40px -14px rgba(26, 148, 221, 0.55);
}

body.home-dark .cta-band .btn-dark-ghost:hover {
  box-shadow: inset 0 0 0 1px rgba(142, 210, 245, 0.45), 0 14px 36px -12px rgba(26, 148, 221, 0.55);
}

body.home-dark .cta-band .btn svg {
  flex: none;
  transition: transform 0.16s ease, color 0.16s ease, filter 0.16s ease;
}

body.home-dark .cta-band .btn:hover svg {
  transform: translateX(2px);
  color: #c6e9fb;
  filter: drop-shadow(0 0 6px rgba(142, 210, 245, 0.85));
}

body.home-dark .footer {
  background: var(--home-bg);
  border-top: 1px solid var(--home-border);
}

/* ---- loops ---- */
.home-loop {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.home-loop-poster,
.home-loop-layer {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

body.home-dark header.hero.hero-rail .home-loop-layer {
  object-position: 50% 54%;
}

.home-loop-layer {
  opacity: 0;
  transition: opacity 0.56s linear;
}

.home-loop-layer.is-live {
  opacity: 1;
}

/* ---- cinematic band ---- */
.home-cinematic {
  position: relative;
  isolate: isolate;
  overflow: hidden;
  min-height: 80vh;
  background: var(--home-bg);
}

.home-cinematic-art {
  position: absolute;
  inset: 0;
  display: block;
}

.home-cinematic-art img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  object-position: 50% 54%;
}

.home-cinematic-scrim {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(5, 7, 10, 0.28) 0%, rgba(5, 7, 10, 0.08) 40%, #05070a 100%),
    linear-gradient(90deg, rgba(5, 7, 10, 0.72) 0%, rgba(5, 7, 10, 0.2) 48%, transparent 72%);
}

.home-cinematic-copy {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: flex-end;
  min-height: 80vh;
  width: calc(100% - var(--gutter) * 2);
  max-width: var(--hero-maxw);
  margin: 0 auto;
  padding: clamp(48px, 8vw, 96px) 0;
}

.home-cinematic-line {
  margin: 0;
  max-width: 18ch;
  font-size: clamp(32px, 5vw, 56px);
  font-weight: 600;
  line-height: 1.08;
  letter-spacing: -0.03em;
  color: var(--home-fg);
  text-wrap: balance;
}

@media (max-width: 920px) {
  body.home-dark header.hero.hero-rail .home-loop {
    bottom: auto;
    height: clamp(260px, 42vh, 420px);
    -webkit-mask-image: linear-gradient(180deg, #000 58%, transparent 100%);
    mask-image: linear-gradient(180deg, #000 58%, transparent 100%);
  }
  body.home-dark header.hero.hero-rail .home-loop-layer {
    object-position: 62% 46%;
  }
}

@media (prefers-reduced-motion: reduce) {
  body.home-dark .hero-text > * {
    animation: none;
  }
  .home-loop-layer {
    transition: none;
  }
}
