/* ==========================================================================
   Launch Labs — Hero
   Plus Jakarta Sans (headline) + Hanken Grotesk (nav/body/UI)
   Black is the default state; red and white are switchable variants.
   Structure: reset -> theme tokens -> nav -> hero atmosphere -> content ->
              headline -> support/cta -> focal visual -> scroll cue -> motion

   Two easing tiers (per emil-design-eng): --ease is the slower, expressive
   curve reserved for the one-time page-load reveal and ambient motion;
   --ease-ui is a snappier curve for anything the user directly triggers
   (hover, press, theme switch) and stays under ~250ms.
   ========================================================================== */

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

html, body { height: 100%; }

body {
  display: flex;
  flex-direction: column;
  min-height: 100svh;
  font-family: 'Hanken Grotesk', 'Helvetica Neue', Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background-color 0.5s ease, color 0.5s ease;
}

a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; }

/* Keyboard focus: on-brand rings instead of the browser default, which
   would otherwise render as a jarring blue ring against this palette */
.nav__links a:focus-visible,
.theme-swatch:focus-visible,
.btn:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 4px;
  border-radius: 2px;
}

.theme-swatch:focus-visible { border-radius: 50%; outline-offset: 3px; }
.btn:focus-visible { outline-offset: 3px; }

main {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

:root {
  --ease: cubic-bezier(0.19, 1, 0.22, 1);
  --ease-ui: cubic-bezier(0.23, 1, 0.32, 1);
  --nav-h: 4.75rem;
}

/* ==========================================================================
   Theme tokens
   ========================================================================== */
body[data-theme="red"] {
  --bg-base:   #D92632;
  --bg-bright: #F0384A;
  --bg-deep:   #B81C28;
  --ink:       #FFFFFF;
  --ink-muted: rgba(255, 255, 255, 0.8);
  --ink-soft:  rgba(255, 255, 255, 0.58);
  --hairline:  rgba(255, 255, 255, 0.28);
  --contrast:  #010202;
  --contrast-glow: rgba(1, 2, 2, 0.24);
  --cta-bg:    #FFFFFF;
  --cta-text:  #010202;
  --cta-spotlight: rgba(1, 2, 2, 0.05);
  --focal-fill:   rgba(255, 255, 255, 0.10);
  --focal-fill-2: rgba(255, 255, 255, 0.16);
  --focal-border: rgba(255, 255, 255, 0.26);
  background: var(--bg-base);
  color: var(--ink);
}

body[data-theme="black"] {
  --bg-base:   #010202;
  --charcoal:  #0b0a0d;
  --bg-bright: rgba(255, 253, 250, 0.032);
  --bg-deep:   rgba(0, 0, 0, 0.5);
  --ink:       #FFFFFF;
  --ink-muted: rgba(255, 255, 255, 0.86);
  --ink-soft:  rgba(255, 255, 255, 0.62);
  --hairline:  rgba(255, 255, 255, 0.14);
  --contrast:  #D92632;
  --contrast-glow: rgba(217, 38, 50, 0.32);
  --cta-bg:    #D92632;
  --cta-text:  #FFFFFF;
  --cta-spotlight: rgba(255, 110, 118, 0.3);
  --focal-fill:   rgba(255, 255, 255, 0.05);
  --focal-fill-2: rgba(255, 255, 255, 0.11);
  --focal-border: rgba(255, 255, 255, 0.16);
  background: var(--bg-base);
  color: var(--ink);
}

body[data-theme="white"] {
  --bg-base:   #FFFFFF;
  --bg-bright: transparent;
  --bg-deep:   transparent;
  --ink:       #010202;
  --ink-muted: rgba(1, 2, 2, 0.66);
  --ink-soft:  rgba(1, 2, 2, 0.45);
  --hairline:  rgba(1, 2, 2, 0.12);
  --contrast:  #D92632;
  --contrast-glow: rgba(217, 38, 50, 0.22);
  --cta-bg:    #010202;
  --cta-text:  #FFFFFF;
  --cta-spotlight: rgba(255, 255, 255, 0.14);
  --focal-fill:   rgba(1, 2, 2, 0.035);
  --focal-fill-2: rgba(217, 38, 50, 0.08);
  --focal-border: rgba(1, 2, 2, 0.12);
  background: var(--bg-base);
  color: var(--ink);
}

/* ==========================================================================
   Nav
   ========================================================================== */
.nav {
  flex: 0 0 auto;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  padding: 0 clamp(1.5rem, 4vw, 4rem);
  position: relative;
  z-index: 10;
  isolation: isolate;
  opacity: 0;
  animation: rise 0.8s var(--ease) forwards;
  animation-delay: 0.05s;
}

.nav__logo {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-weight: 700;
  font-size: 1.1rem;
  letter-spacing: -0.015em;
  color: var(--ink);
  flex: 0 0 auto;
}

.logo-mark { color: var(--ink); }
body[data-theme="black"] .logo-mark { color: var(--contrast); }

.nav__links {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  gap: clamp(1.5rem, 3vw, 2.5rem);
}

.nav__links a {
  font-size: 0.8125rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  color: var(--ink-muted);
  position: relative;
  padding-bottom: 0.3rem;
}

.nav__links a::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 1px;
  background: var(--ink);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.3s var(--ease-ui);
}

@media (hover: hover) and (pointer: fine) {
  .nav__links a:hover::after { transform: scaleX(1); transform-origin: left; }
  .nav__links a:hover { color: var(--ink); }
}

body[data-theme="black"] .nav__links a::after { background: var(--contrast); }

.theme-switch {
  display: flex;
  align-items: center;
  gap: 0.15rem;
  flex: 0 0 auto;
}

/* The visible dot stays small and refined; the button itself meets the
   44x44px touch-target minimum, with the extra hit area invisible */
.theme-swatch {
  position: relative;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 50%;
  background: none;
  border: none;
  padding: 0;
}

.theme-swatch::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 1.05rem;
  height: 1.05rem;
  border-radius: 50%;
  border: 1.5px solid var(--hairline);
  transform: translate(-50%, -50%);
  transition: transform 0.2s var(--ease-ui), border-color 0.3s var(--ease-ui);
}

@media (hover: hover) and (pointer: fine) {
  .theme-swatch:hover::after { transform: translate(-50%, -50%) scale(1.15); }
}

.theme-swatch:active::after { transform: translate(-50%, -50%) scale(0.85); }
.theme-swatch.is-active::after { outline: 1.5px solid var(--ink); outline-offset: 2px; border-color: transparent; }

.theme-swatch[data-theme-value="red"]::after { background: #D92632; }
.theme-swatch[data-theme-value="black"]::after { background: #010202; }
.theme-swatch[data-theme-value="white"]::after { background: #FFFFFF; border-color: rgba(1, 2, 2, 0.2); }

@media (max-width: 56rem) {
  .nav__links { display: none; }
}

/* ==========================================================================
   Hero — atmosphere
   ========================================================================== */
.hero {
  flex: 1;
  min-height: 90svh;
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 1.5rem clamp(1.5rem, 4vw, 4rem) 2.5rem;
  overflow: hidden;
  isolation: isolate;
}

.hero__atmosphere {
  position: absolute;
  inset: 0;
  z-index: -1;
  background-image:
    radial-gradient(52rem 42rem at 14% 12%, var(--bg-bright), transparent 62%),
    radial-gradient(48rem 40rem at 88% 92%, var(--bg-deep), transparent 66%);
  background-repeat: no-repeat;
  background-size: 150% 150%, 145% 145%;
  background-position: 8% 6%, 92% 94%;
  animation: atmosphere-drift 26s var(--ease) infinite alternate;
}

.hero__grain {
  position: absolute;
  inset: 0;
  opacity: 0.05;
  mix-blend-mode: overlay;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* Dark theme only: extremely subtle grain + a near-invisible vignette to deepen the edges */
body[data-theme="black"] .hero__grain { opacity: 0.025; }

body[data-theme="black"] .hero__atmosphere::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(120% 95% at 50% 42%, transparent 60%, rgba(0, 0, 0, 0.4) 100%);
  pointer-events: none;
}

/* ==========================================================================
   Hero — content grid
   ========================================================================== */
.hero__grid {
  flex: 1;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  align-items: center;
  gap: clamp(2rem, 5vw, 4rem);
}

.hero__content { max-width: 52rem; }

.hero__headline {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: clamp(2.66rem, 4.5vw, 4.35rem);
  line-height: 1.12;
  letter-spacing: -0.02em;
}

/* Dark theme: a touch more scale and a tighter grid so the text and the
   framed visual read as one composition rather than two islands */
body[data-theme="black"] .hero__grid {
  grid-template-columns: minmax(0, 1.8fr) minmax(0, 1fr);
  gap: clamp(1.25rem, 3vw, 2.5rem);
  width: 100%;
  max-width: 88rem;
  margin-inline: auto;
}

/* Nudge the text block off the left edge, toward the section's middle,
   rather than letting it hug the padding */
body[data-theme="black"] .hero__content {
  position: relative;
  z-index: 1;
  max-width: 58rem;
  padding-left: clamp(0.5rem, 3.5vw, 2.25rem);
  transform: translateY(-20px);
}

body[data-theme="black"] .hero__headline {
  font-size: clamp(3.01rem, 5.2vw, 4.9rem);
  line-height: 1.18;
  letter-spacing: -0.025em;
}

.hl-row { display: block; overflow: hidden; }

.hl-line {
  display: block;
  font-weight: 800;
  color: var(--ink);
  opacity: 0;
  transform: translateY(105%);
  animation: rise-line 0.9s var(--ease) forwards;
}

.hl-row:nth-child(1) .hl-line { animation-delay: 0.26s; }
.hl-row:nth-child(2) .hl-line { animation-delay: 0.35s; }
.hl-row:nth-child(3) .hl-line { animation-delay: 0.44s; }

.hl-dot { color: var(--contrast); }

.hero__support {
  margin-top: 3.6875rem;
  max-width: 32rem;
  font-size: 1.9125rem;
  line-height: 1.5;
  font-weight: 400;
  color: var(--ink-muted);
  opacity: 0;
  animation: rise 0.8s var(--ease) forwards;
  animation-delay: 0.72s;
}

.hero__cta {
  margin-top: 3.6875rem;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  width: fit-content;
  gap: 0.9rem;
  opacity: 0;
  animation: rise 0.8s var(--ease) forwards;
  animation-delay: 0.88s;
}

.hero__cta-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 1.4625rem;
}

.hero__cta-primary {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5875rem;
}

.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  padding: 1.05rem 2.5rem;
  background: var(--cta-bg);
  color: var(--cta-text);
  font-family: 'Hanken Grotesk', sans-serif;
  font-size: 0.9375rem;
  font-weight: 600;
  letter-spacing: 0.005em;
  border-radius: 14px;
  overflow: hidden;
  isolation: isolate;
  box-shadow:
    0 1px 1px rgba(1, 2, 2, 0.06),
    0 10px 24px rgba(1, 2, 2, 0.16),
    0 2px 8px rgba(1, 2, 2, 0.10);
  transition: box-shadow 0.22s var(--ease-ui);
  will-change: transform;
}

/* Primary CTA only — the ghost button keeps its own padding */
.btn:not(.btn--ghost) {
  padding-inline: 4rem;
}

@media (hover: hover) and (pointer: fine) {
  .btn:hover {
    box-shadow:
      0 2px 2px rgba(1, 2, 2, 0.07),
      0 18px 34px rgba(1, 2, 2, 0.20),
      0 4px 12px rgba(1, 2, 2, 0.12);
  }

  .btn:hover .btn__spotlight { opacity: 1; }
}

/* Touch/coarse pointers skip the JS magnetic effect entirely, so they keep
   a plain CSS press state for tactile feedback */
@media (hover: none) {
  .btn:active {
    transform: scale(0.97);
    transition: transform 0.12s var(--ease-ui);
  }
}

/* Dark theme: the red CTA needs a red-tinted glow — a black shadow would vanish against the near-black background */
body[data-theme="black"] .btn {
  box-shadow:
    0 1px 1px rgba(0, 0, 0, 0.4),
    0 12px 28px rgba(217, 38, 50, 0.24),
    0 3px 10px rgba(217, 38, 50, 0.18);
}

@media (hover: hover) and (pointer: fine) {
  body[data-theme="black"] .btn:hover {
    box-shadow:
      0 2px 2px rgba(0, 0, 0, 0.45),
      0 20px 42px rgba(217, 38, 50, 0.36),
      0 5px 16px rgba(217, 38, 50, 0.24);
  }
}

/* A soft highlight that follows the cursor, like light catching a physical
   surface — set via --spot-x/--spot-y by js/hero.js on pointermove */
.btn__spotlight {
  position: absolute;
  inset: 0;
  z-index: -1;
  opacity: 0;
  transition: opacity 0.3s var(--ease-ui);
  background: radial-gradient(
    120px 120px at var(--spot-x, 50%) var(--spot-y, 50%),
    var(--cta-spotlight),
    transparent 70%
  );
}

.btn__arrow { transition: transform 0.22s var(--ease-ui); }

@media (hover: hover) and (pointer: fine) {
  .btn:hover .btn__arrow { transform: translateX(0.25rem); }
}

/* Secondary CTA: a quiet ghost button, never competing with the red primary.
   Tokens keep it theme-safe; the black-theme block below dials in the exact
   understated look (8% border, near-black hover fill, red glow on contact). */
.btn--ghost {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--hairline);
  box-shadow: none;
  transition:
    color 0.22s var(--ease-ui),
    border-color 0.22s var(--ease-ui),
    background-color 0.22s var(--ease-ui),
    box-shadow 0.22s var(--ease-ui),
    transform 0.22s var(--ease-ui);
}

@media (hover: hover) and (pointer: fine) {
  .btn--ghost:hover {
    color: var(--contrast);
    border-color: var(--contrast);
    transform: translateY(-2px);
    box-shadow: 0 10px 28px var(--contrast-glow), 0 2px 10px var(--contrast-glow);
  }
}

@media (hover: none) {
  .btn--ghost:active { transform: scale(0.97); }
}

body[data-theme="black"] .btn--ghost {
  border-color: rgba(255, 255, 255, 0.08);
  box-shadow: none;
}

@media (hover: hover) and (pointer: fine) {
  body[data-theme="black"] .btn--ghost:hover {
    background: #111111;
    border-color: var(--contrast);
    color: var(--contrast);
    box-shadow: 0 10px 28px var(--contrast-glow), 0 2px 10px var(--contrast-glow);
  }
}

.hero__cta-note {
  align-self: center;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--ink-soft);
}

/* ==========================================================================
   Hero — focal visual
   ========================================================================== */
.hero__focal {
  position: relative;
  height: 100%;
  min-height: 22rem;
}

.focal-frame {
  position: absolute;
  border-radius: 22px;
  border: 1px solid var(--focal-border);
}

.focal-frame--back {
  inset: 8% 14% 8% 4%;
  background: var(--focal-fill);
  transform: rotate(-4deg);
}

.focal-frame--front {
  inset: 2% 2% 2% 16%;
  background:
    linear-gradient(155deg, var(--focal-fill-2), var(--focal-fill) 60%);
  transform: rotate(2.5deg);
  overflow: hidden;
  box-shadow: 0 30px 60px rgba(1, 2, 2, 0.22);
}

.focal-frame__sheen {
  position: absolute;
  inset: -20%;
  background: linear-gradient(
    115deg,
    transparent 40%,
    rgba(255, 255, 255, 0.22) 50%,
    transparent 60%
  );
  background-size: 260% 260%;
  animation: sheen-sweep 9s var(--ease) infinite;
}

/* ---------- Dark theme: framed visual (replaces the translucent panels) ---------- */
.visual-frame { display: none; }

body[data-theme="black"] .hero__focal {
  overflow: visible;
}

body[data-theme="black"] .focal-frame { display: none; }

body[data-theme="black"] .visual-frame {
  display: block;
  position: absolute;
  inset: 0;
  overflow: visible;
  transform: scale(2);
}

.visual-frame__inner {
  position: absolute;
  inset: 0;
}

/* Soft black fade over the top and bottom of the photo only, matching the
   page background so those edges dissolve rather than cut off hard. */
.visual-frame__inner::before,
.visual-frame__inner::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  height: 22%;
  z-index: 1;
  pointer-events: none;
}

.visual-frame__inner::before {
  top: 0;
  background: linear-gradient(to bottom, #010202 0%, transparent 100%);
}

.visual-frame__inner::after {
  bottom: 0;
  background: linear-gradient(to top, #010202 0%, transparent 100%);
}

/* object-fit: contain — the whole photo stays visible, uncropped, at all
   times. Its own built-in fade blends the letterboxed edges into the black
   page background, so no mask/vignette is layered on top here. */
.visual-frame__photo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  filter: saturate(1.04) contrast(1.02);
}

.visual-frame__grain {
  position: absolute;
  inset: 0;
  opacity: 0.05;
  mix-blend-mode: overlay;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ==========================================================================
   Hero — trust bar
   ========================================================================== */
.hero__trust {
  flex: 0 0 auto;
  margin-top: clamp(2rem, 5vw, 3.5rem);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.6rem 0.9rem;
  opacity: 0;
  transform: translateY(-150px);
  animation: trust-rise 0.8s var(--ease) forwards;
  animation-delay: 1.05s;
}

.hero__trust-stars {
  font-size: 0.875rem;
  letter-spacing: 0.12em;
  color: var(--contrast);
}

.hero__trust-item {
  font-size: 0.8125rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  color: var(--ink-soft);
  white-space: nowrap;
}

.hero__trust-sep {
  color: var(--hairline);
  font-size: 0.7rem;
}

/* ==========================================================================
   Motion
   ========================================================================== */
@keyframes rise {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes trust-rise {
  from { opacity: 0; transform: translateY(-140px); }
  to   { opacity: 1; transform: translateY(-150px); }
}

@keyframes rise-line {
  from { opacity: 0; transform: translateY(105%); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes atmosphere-drift {
  from { background-position: 8% 6%, 92% 94%; }
  to   { background-position: 14% 12%, 86% 88%; }
}

@keyframes sheen-sweep {
  0%   { background-position: 120% -20%; }
  55%  { background-position: -20% 120%; }
  100% { background-position: -20% 120%; }
}

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 64rem) {
  .hero__grid { grid-template-columns: 1fr; }
  .hero__focal { display: none; }
  .hero__content { max-width: 34rem; }
}

@media (max-width: 30rem) {
  .hero { padding-top: 1rem; }
  .nav__logo { font-size: 1.05rem; }
}
