/* ============================================================================
   hero.css : navbar, hero, otter logo stroke-draw intro
   Ported from the Otter Lab landing site; copy blocks re-set for zh-Hant.
   ============================================================================ */

/* ─── 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: 26px; }
.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: 960px) {
  .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;
  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.12fr 0.88fr;
  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 */
@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)); } }

/* zh-Hant display: slightly tighter clamp than the latin flagship — CJK glyphs
   run wider per character, and line-height must clear ascenders/descenders */
.hero h1 {
  font-size: clamp(38px, 5.6vw, 64px);
  line-height: 1.18;
  letter-spacing: -0.02em;
  margin-bottom: 26px;
  text-wrap: balance;
}
.hero-sub {
  font-size: clamp(16px, 1.7vw, 19px);
  line-height: 1.7;
  color: var(--text-secondary);
  max-width: 34em;
  margin-bottom: 36px;
}
.hero-sub strong { color: var(--text); font-weight: 600; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; margin-bottom: 40px; }

/* proof strip — the 3-second verdict numbers */
.proof-strip {
  display: flex; flex-wrap: wrap; gap: 10px 28px;
  padding-top: 22px;
  border-top: 1px solid var(--border);
  max-width: 560px;
}
.proof-strip .p-item { display: flex; align-items: baseline; gap: 8px; white-space: nowrap; }
.proof-strip .p-num { font-family: var(--font-mono); font-weight: 500; font-size: 18px; color: var(--text); }
.proof-strip .p-num em { font-style: normal; color: var(--cyan); }
.proof-strip .p-label { font-size: 12.5px; color: var(--text-muted); }

/* ─── Otter logo stroke-draw intro ─── */
@keyframes logoDraw { to { stroke-dashoffset: 0; } }
@keyframes logoDotIn { from { opacity: 0; transform: scale(0); } to { opacity: 1; transform: scale(1); } }

/* Continuous breathing halo — see the flagship hero.css for the anatomy notes:
   crest at 42% (organic inhale/exhale), micro-scale rides the glow, 3-layer
   shadow at crest, equal-length filter lists for clean interpolation. */
@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 — one-shot birth beat; ignites from zero glow, crests
   deeper than the loop ever will, exhales into the loop's exact rest pose. */
@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 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, the mark takes its first breath, then the calm
   loop takes over exactly one period later — a seamless handoff. */
.hero-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 { animation: none; filter: drop-shadow(0 0 12px var(--cyan-glow)); }
}

/* Static (nav / footer) marks keep a quieter core-only glow. */
.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; } }
