/* ============================================================================
   hero.css : navbar, hero, otter logo stroke-draw intro
   ============================================================================ */

/* ─── Navbar ─── */
.nav {
  position: fixed; inset: 0 0 auto 0; z-index: 100;
  height: var(--nav-h);
  display: flex; align-items: center;
  transition: background var(--t-quick) var(--ease-smooth), border-color var(--t-quick) var(--ease-smooth), backdrop-filter var(--t-quick) var(--ease-smooth);
  border-bottom: 1px solid transparent;
}
.nav.is-scrolled {
  background: var(--bg-navbar);
  backdrop-filter: blur(16px) saturate(140%);
  border-bottom-color: var(--border);
}
.nav .wrap { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.nav-brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 19px; letter-spacing: -0.02em; white-space: nowrap; flex-shrink: 0; }
.nav-brand .mark { width: 30px; height: 30px; }
.nav-brand .lab { font-weight: 300; color: var(--coral); }
.nav-links { display: flex; align-items: center; gap: 28px; }
.nav-links a { position: relative; font-size: 14.5px; color: var(--text-secondary); font-weight: 500; transition: color var(--t-micro) var(--ease-smooth); white-space: nowrap; }
.nav-links a:hover { color: var(--text); }
.nav-links a.is-current { color: var(--text); }
/* scroll-spy underline (desktop) — transform-only, grows from center, no CLS */
@media (min-width: 861px) {
  .nav-links a::after {
    content: ""; position: absolute; left: 2px; right: 2px; bottom: -6px; height: 2px;
    background: var(--cyan); border-radius: 2px; box-shadow: 0 0 8px var(--cyan-glow);
    transform: scaleX(0); transform-origin: center;
    transition: transform var(--t-quick) var(--ease-spring);
  }
  .nav-links a.is-current::after { transform: scaleX(1); }
}
@media (prefers-reduced-motion: reduce) { .nav-links a::after { transition: none; } }
.nav-cta { display: flex; align-items: center; gap: 12px; }
.nav-toggle { display: none; }

@media (max-width: 860px) {
  .nav-links {
    position: absolute; top: var(--nav-h); left: 0; right: 0;
    flex-direction: column; gap: 4px; align-items: stretch;
    padding: 14px 24px 22px;
    background: var(--bg-navbar); backdrop-filter: blur(18px);
    border-bottom: 1px solid var(--border);
    transform: translateY(-12px); opacity: 0; pointer-events: none;
    visibility: hidden; /* keep closed links out of the tab order */
    transition: opacity 0.2s, transform 0.2s, visibility 0s linear 0.2s;
  }
  .nav-links.open { transform: none; opacity: 1; pointer-events: auto; visibility: visible; transition-delay: 0s; }
  .nav-links a { padding: 11px 4px; font-size: 16px; border-bottom: 1px solid var(--border); }
  .nav-toggle {
    display: inline-flex; align-items: center; justify-content: center;
    width: 42px; height: 42px; border-radius: 10px;
    background: rgba(255,255,255,0.05); border: 1px solid var(--border-strong); color: var(--text);
    cursor: pointer;
  }
  .nav-cta .btn-desktop { display: none; }
}

/* ─── Hero ─── */
.hero {
  position: relative;
  /* 86vh, not 100vh: a full-bleed hero centred in 100vh leaves a ~150px void
     below the copy before the metaphor band. 86vh trims that void to match the
     page rhythm and lets the otter quote peek up to invite the scroll. */
  min-height: 86vh; min-height: 86svh;
  display: flex; align-items: center;
  padding-top: calc(var(--nav-h) + 40px);
  padding-bottom: 56px;
  overflow: hidden;
}
.hero .wrap { position: relative; z-index: 2; }
.hero-grid {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: clamp(32px, 4.5vw, 64px);
  align-items: center;
}
@media (max-width: 980px) {
  .hero-grid { grid-template-columns: 1fr; gap: 48px; }
}

.hero-logo { width: 84px; height: 84px; margin-bottom: 26px; }

/* Category pill — plants the flag before the headline lands */
.hero-badge {
  display: inline-flex; align-items: center; gap: 9px;
  padding: 7px 16px 7px 13px; margin-bottom: 28px;
  border-radius: var(--r-pill);
  border: 1px solid var(--border-cyan);
  background: rgba(0, 229, 255, 0.06);
  font-family: var(--font-mono); font-size: 12px; font-weight: 500;
  letter-spacing: 0.14em; text-transform: uppercase; color: var(--cyan-soft);
  white-space: nowrap;
}
.hero-badge-dot {
  width: 7px; height: 7px; border-radius: 999px; background: var(--cyan); flex-shrink: 0;
  animation: badge-pulse 4.4s ease-in-out infinite;
}
/* breath uses filter: drop-shadow (compositor-eligible), NOT box-shadow
   (paint-thread) — same rule + pattern as the audit chip-dot and pulse-glow. */
@keyframes badge-pulse {
  0%, 100% { filter: drop-shadow(0 0 5px rgba(0, 229, 255, 0.5)); }
  50% { filter: drop-shadow(0 0 11px rgba(0, 229, 255, 0.9)); }
}
@media (prefers-reduced-motion: reduce) { .hero-badge-dot { animation: none; filter: drop-shadow(0 0 7px rgba(0,229,255,0.7)); } }

.hero h1 {
  font-size: clamp(44px, 7vw, 80px);
  line-height: 0.96;
  letter-spacing: -0.045em;
  margin-bottom: 26px;
  text-wrap: balance;
}
.hero-sub {
  font-size: clamp(16px, 1.7vw, 19px);
  line-height: 1.55;
  color: var(--text-secondary);
  max-width: 44ch;
  margin-bottom: 36px;
}
.hero-cta { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; }
/* ─── Otter logo stroke-draw intro (from LoginView.vue / BrandSplash.vue) ─── */
@keyframes logoDraw { to { stroke-dashoffset: 0; } }
@keyframes logoDotIn { from { opacity: 0; transform: scale(0); } to { opacity: 1; transform: scale(1); } }

/* Continuous "breathing" halo — ported (in spirit) from the product login
   avatar (chatbot-main_otter-lab · @keyframes avatar-breathe / .avatar-thinking),
   the cyan glow that makes the mark feel alive while the agent "thinks".
   Re-expressed as filter: drop-shadow to honour this site's motion rule
   (animate transform/opacity/FILTER — never loop box-shadow): drop-shadow is
   compositor-eligible AND traces the glyph silhouette, so the halo hugs the
   whole </>-in-circle instead of a square box.

   Breath anatomy (v2 — light + form + organic rhythm):
   · CREST AT 42%, not 50% — real respiration is asymmetric: a quicker inhale,
     a longer exhale. A 50% crest is a sine wave and reads as a blinking lamp;
     42/58 reads as a living thing. (--ease-smooth per segment supplies the
     softness; the asymmetry lives in the keyframe placement.)
   · MICRO-SCALE rides the glow — the standalone `scale` property (composes
     with any inherited transform instead of stomping it; unknown to old
     engines, which harmlessly keep the glow-only breath). Living things swell
     when they inhale: light and form must move as ONE. 2% at crest is felt,
     not seen — bigger would wobble, and wobble is cheap.
   · THREE shadow layers at crest — tight core / wide bloom / faint atmosphere
     — a light source in air, not a sticker glow. EVERY keyframe carries the
     same 3-shadow list (outer layers zeroed at rest): equal-length filter
     lists interpolate function-by-function, which keeps the whole breath
     compositor-eligible and cut-free. */
@keyframes logoBreathe {
  0%, 100% {
    scale: 1;
    filter: drop-shadow(0 0 7px rgba(0, 229, 255, 0.38))
            drop-shadow(0 0 0 rgba(0, 229, 255, 0))
            drop-shadow(0 0 0 rgba(0, 229, 255, 0));
  }
  42% {
    scale: 1.02;
    filter: drop-shadow(0 0 13px rgba(0, 229, 255, 0.6))
            drop-shadow(0 0 28px rgba(0, 229, 255, 0.32))
            drop-shadow(0 0 48px rgba(0, 229, 255, 0.12));
  }
}

/* THE FIRST BREATH — a one-shot birth beat, same period & curve as the loop.
   The old breathe ignited with a hard cut (filter: none → 6px halo the instant
   the delay expired). Now the mark's first breath IS the ignition: it rises
   from zero glow (0%), crests DEEPER and brighter than the loop ever will
   (42%, scale 1.035 — the one forte note), and exhales into exactly the loop's
   rest state (100%). The infinite loop takes over one period later on the same
   grid, so from birth onward the rhythm is one unbroken line: draw → dot →
   one deep first breath → calm forever. Same vocabulary as logoBreathe — an
   entrance INTO the ambient, not a new idiom. */
@keyframes logoFirstBreath {
  0% {
    scale: 1;
    filter: drop-shadow(0 0 0 rgba(0, 229, 255, 0))
            drop-shadow(0 0 0 rgba(0, 229, 255, 0))
            drop-shadow(0 0 0 rgba(0, 229, 255, 0));
  }
  42% {
    scale: 1.035;
    filter: drop-shadow(0 0 16px rgba(0, 229, 255, 0.8))
            drop-shadow(0 0 36px rgba(0, 229, 255, 0.42))
            drop-shadow(0 0 64px rgba(0, 229, 255, 0.18));
  }
  100% {
    scale: 1;
    filter: drop-shadow(0 0 7px rgba(0, 229, 255, 0.38))
            drop-shadow(0 0 0 rgba(0, 229, 255, 0))
            drop-shadow(0 0 0 rgba(0, 229, 255, 0));
  }
}

/* The whole intro timeline rides --motion-scale via calc, so it stretches as
   one piece: curve draws → core strokes land → dot pops → the whole mark breathes. */
.ol-curve { stroke-dasharray: 216; stroke-dashoffset: 216; animation: logoDraw var(--t-draw) var(--ease-draw) calc(0.15s * var(--motion-scale)) forwards; }
.ol-dot { opacity: 0; transform: scale(0); transform-origin: 20px 25px;
  animation: logoDotIn var(--t-quick) var(--ease-bounce) calc(0.95s * var(--motion-scale)) forwards; }
.ol-core path { stroke-dasharray: 34; stroke-dashoffset: 34; animation: logoDraw var(--t-base) var(--ease-draw) forwards; }
.ol-core path:nth-child(1) { animation-delay: calc(1.05s * var(--motion-scale)); }
.ol-core path:nth-child(2) { animation-delay: calc(1.18s * var(--motion-scale)); }
.ol-core path:nth-child(3) { stroke-dasharray: 42; stroke-dashoffset: 42; animation-delay: calc(1.3s * var(--motion-scale)); }
/* As the final stroke lands (1.8s·scale — the last .ol-core delay 1.3s + its
   --t-base 0.5s), the mark takes its FIRST BREATH: one deep one-shot cycle
   igniting from zero glow. The infinite loop starts exactly one period later
   (1.8s + 2.2s = 4s·scale), from the identical rest pose the first breath
   exhales into — a seamless handoff (logoBreathe is last in the list, so it
   wins over the settled `forwards` fill the moment it starts). Base period
   2.2s matches the login avatar; ×scale keeps it in proportion with the site
   tempo. --ease-smooth is the system's mandated curve for looping/ambient. */
.hero-logo, .story-logo {
  animation:
    logoFirstBreath calc(2.2s * var(--motion-scale)) var(--ease-smooth) calc(1.8s * var(--motion-scale)) forwards,
    logoBreathe calc(2.2s * var(--motion-scale)) var(--ease-smooth) calc(4s * var(--motion-scale)) infinite;
}

@media (prefers-reduced-motion: reduce) {
  .ol-curve, .ol-core path { stroke-dasharray: none; stroke-dashoffset: 0; animation: none; }
  .ol-dot { opacity: 1; transform: none; animation: none; }
  .hero-logo, .story-logo { animation: none; filter: drop-shadow(0 0 12px var(--cyan-glow)); }
}

/* Static (nav / footer) marks keep a quieter core-only glow — a full breathing
   halo on a 30px fixed-navbar mark would fidget; restraint holds the hierarchy.
   NB: pulse-glow is a 2-stop keyframe + `alternate`, so one rest→bloom→rest
   breath is 2× the period. 2.4s → ~4.8s/cycle keeps this in family with the hero
   mark (3.74s) and badge dot (4.4s); don't push the period past ~2.5s or the
   round-trip crosses into sluggish/near-static. */
.ol-core-static { animation: pulse-glow 2.4s var(--ease-smooth) infinite alternate; filter: drop-shadow(0 0 10px var(--cyan-glow)); }
@media (prefers-reduced-motion: reduce) { .ol-core-static { animation: none; } }
