/* =============================================================
   OpenAfterHours Docs — Landing page
   Source of truth for the Zensical landing-page design system.
   Single-screen constellation hero; adapts to Material's light/
   dark colour scheme toggle.
   ============================================================= */

/* Brand tokens (--oah-* palette, font stack, --ease-std) and the
   Google Fonts import now live in tokens.css — the single source
   of truth, loaded before this file via zensical.toml extra_css.
   This file only consumes them via var(--oah-*). */

/* ---------- Landing hero tokens (always dark) --------------- */
/* Landing is fixed dark by design; it does not participate in
   Material's light/dark toggle. Only docs pages respect the
   user's palette choice. */
body:has(.landing-hero) {
  margin: 0;
  overflow: hidden;
  background: var(--oah-slate-900);   /* match the hero edge so the ground-shake reveals nothing */

  --hero-bg-gradient: radial-gradient(ellipse at 50% 30%, #1a1f2e 0%, var(--oah-slate-900) 70%);
  --hero-scrim:
    radial-gradient(ellipse 70% 60% at 50% 45%, rgba(13,14,17,0.55) 0%, rgba(13,14,17,0) 70%),
    linear-gradient(180deg,
      rgba(13,14,17,0.45) 0%,
      rgba(13,14,17,0.10) 30%,
      rgba(13,14,17,0.10) 70%,
      rgba(13,14,17,0.65) 100%);
  --hero-fg:            var(--oah-slate-100);
  --hero-fg-muted:      var(--oah-slate-200);
  --hero-fg-faint:      var(--oah-slate-300);
  --hero-fg-mute:       var(--oah-slate-400);
  --hero-border:        rgba(216, 222, 233, 0.18);
  --hero-border-soft:   rgba(216, 222, 233, 0.10);
  --hero-border-strong: rgba(216, 222, 233, 0.30);
  --hero-install-bg:    rgba(13, 14, 17, 0.50);
  --hero-install-border: rgba(216, 222, 233, 0.14);
}

/* ---------- Hero stage -------------------------------------- */
/* Scoped box-sizing reset so the hero lays out identically when the
   host page hasn't applied a global reset (the app loads only this
   stylesheet on its landing page, not app.css). On the Material docs
   this is a no-op — the theme already sets border-box globally. */
.landing-hero,
.landing-hero *,
.landing-hero *::before,
.landing-hero *::after {
  box-sizing: border-box;
}
.landing-hero {
  position: relative;
  min-height: 100svh;
  max-height: 1100px;
  width: 100%;
  overflow: hidden;
  color: var(--hero-fg);
  font-family: var(--font-sans);
  background: var(--hero-bg-gradient);
}

/* ---------- Constellation background (polar bear) ----------- */
/* The SVG is injected into .constellation-bg at runtime by
   assets/javascripts/bear-constellation.js — a polar bear drawn as a
   constellation that walks across the hero. The script owns its own
   reduced-motion handling (it renders a single static pose). */
.constellation-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
}
.bear-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.bear-label {
  font-family: var(--font-mono);
  font-size: 3px;
  letter-spacing: 0.42px;
  text-transform: uppercase;
  fill: var(--oah-orange);
  user-select: none;
}

/* ---------- Scrim (readability gradient) -------------------- */
.landing-scrim {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: var(--hero-scrim);
  pointer-events: none;
}

/* ---------- Hero layout ------------------------------------- */
.hero {
  position: relative;
  z-index: 2;
  min-height: 100svh;
  max-height: 1100px;
  display: grid;
  grid-template-rows: auto 1fr auto;
  padding: 28px 56px;
  max-width: 1280px;
  margin: 0 auto;
}

/* ---------- Nav --------------------------------------------- */
.hero-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: inherit;
}
.brand-icon {
  width: 40px;
  height: 40px;
  border-radius: 999px;
  border: 1px solid var(--oah-orange);
  background: var(--oah-slate-700);
}
.brand-text { line-height: 1; }
.brand-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 17px;
  letter-spacing: -0.01em;
  color: var(--oah-orange);
  line-height: 1;
}
.brand-tag {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.06em;
  color: var(--hero-fg-faint);
  margin-top: 4px;
  text-transform: uppercase;
}
.nav-links {
  display: flex;
  align-items: center;
  gap: 28px;
  font-size: 14px;
}
.nav-links a {
  color: var(--hero-fg-muted);
  text-decoration: none;
  transition: color 120ms ease;
}
.nav-links a:hover { color: var(--oah-orange); }
.github-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 12px;
  border: 1px solid var(--hero-border);
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 12px;
}
.github-link:hover {
  border-color: var(--oah-orange);
  color: var(--oah-orange);
}

/* ---------- Hero body --------------------------------------- */
.hero-body {
  display: flex;
  flex-direction: column;
  justify-content: center;
  max-width: 780px;
  padding: 32px 0;
}
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.18em;
  color: var(--oah-orange);
  margin-bottom: 28px;
}
.eyebrow .prompt {
  color: var(--oah-terminal-green);
  font-weight: 700;
}
.title {
  font-family: var(--font-display);
  font-size: clamp(40px, 5.4vw, 68px);
  line-height: 1.04;
  letter-spacing: -0.025em;
  font-weight: 700;
  margin: 0 0 24px;
  color: var(--hero-fg);
}
.title-accent {
  background: linear-gradient(90deg,
    var(--oah-orange) 0%,
    var(--oah-orange-bright) 60%,
    var(--oah-owl-eye) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  font-style: italic;
  font-weight: 500;
}
.lede {
  font-size: 17px;
  line-height: 1.55;
  color: var(--hero-fg-muted);
  max-width: 620px;
  margin: 0 0 36px;
  text-wrap: pretty;
}
.lede .num {
  color: var(--oah-orange);
  font-family: var(--font-mono);
  font-size: 15.5px;
}

/* ---------- Buttons ----------------------------------------- */
.cta-row {
  display: flex;
  gap: 14px;
  align-items: center;
  margin-bottom: 28px;
  flex-wrap: wrap;
}
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 13px 22px;
  border-radius: 8px;
  font-family: var(--font-sans);
  font-size: 14.5px;
  font-weight: 600;
  text-decoration: none;
  transition: all 200ms var(--ease-std);
  cursor: pointer;
  border: none;
}
.btn-primary {
  background: var(--oah-orange);
  color: #fff;
  box-shadow: 0 4px 16px rgba(255, 145, 0, 0.22);
}
.btn-primary:hover {
  background: var(--oah-orange-bright);
  box-shadow: 0 6px 24px rgba(255, 145, 0, 0.36);
  transform: translateY(-1px);
  color: #fff;
}
.btn-ghost {
  background: transparent;
  color: var(--hero-fg);
  border: 1.5px solid var(--hero-border-strong);
}
.btn-ghost:hover {
  border-color: var(--oah-orange);
  color: var(--oah-orange);
}
.btn-ghost .ext {
  font-family: var(--font-mono);
  margin-left: 2px;
}

/* ---------- Install snippet --------------------------------- */
.install {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px 10px 16px;
  background: var(--hero-install-bg);
  border: 1px solid var(--hero-install-border);
  border-radius: 8px;
  font-family: var(--font-mono);
  font-size: 13px;
  margin-bottom: 40px;
  width: fit-content;
  backdrop-filter: blur(8px);
}
.install .prompt {
  color: var(--oah-terminal-green);
  font-weight: 700;
}
.install code {
  background: none;
  padding: 0;
  color: var(--hero-fg);
  font-family: var(--font-mono);
}
.copy-btn {
  background: none;
  border: none;
  padding: 4px;
  color: var(--hero-fg-faint);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  border-radius: 4px;
  transition: color 120ms ease, background 120ms ease;
}
.copy-btn:hover {
  color: var(--oah-orange);
  background: rgba(255, 145, 0, 0.10);
}
.copy-btn.is-copied { color: var(--oah-terminal-green); }

/* ---------- Meta row (stats) -------------------------------- */
.meta-row {
  display: flex;
  align-items: center;
  gap: 28px;
  padding-top: 24px;
  border-top: 1px solid var(--hero-border-soft);
}
.meta { min-width: 0; }
.meta-num {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 700;
  color: var(--hero-fg);
  letter-spacing: -0.01em;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.meta-lbl {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.06em;
  color: var(--hero-fg-mute);
  text-transform: uppercase;
  margin-top: 4px;
}
.meta-divider {
  width: 1px;
  height: 32px;
  background: var(--hero-border-soft);
}
.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--oah-terminal-green);
  box-shadow: 0 0 0 3px rgba(61, 214, 140, 0.15);
  animation: oah-pulse 2.4s ease-in-out infinite;
}
@keyframes oah-pulse {
  50% { box-shadow: 0 0 0 7px rgba(61, 214, 140, 0); }
}

/* ---------- Footer ------------------------------------------ */
.hero-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.04em;
  color: var(--hero-fg-mute);
  padding-top: 12px;
}
.footer-meta { color: var(--hero-fg-mute); }

/* ---------- Responsive -------------------------------------- */
@media (max-width: 880px) {
  .hero { padding: 20px 24px; }
  .nav-links a:not(.github-link) { display: none; }
  .meta-row { flex-wrap: wrap; gap: 16px 20px; }
  .meta-divider { display: none; }
  .hero-footer .footer-meta { display: none; }

  /* Bear-tows-text intro. On phones the constellation bear (bear-constellation.js)
     stands centred, then bolts off the right edge, and the hero copy is pulled in
     from the left in the same beat — so the bear never sits behind the full-width
     text. Pure-CSS auto-play; fill-mode `both` applies the hidden 0% state from the
     first painted frame (no flash, no JS arming). Keep timing in sync with the JS
     INTRO_T0/INTRO_END: duration = INTRO_END - INTRO_T0 (5s), hold % =
     (4 - INTRO_T0) / (INTRO_END - INTRO_T0) (50%). */
  @keyframes bear-tow-in {
    0%, 50% { opacity: 0; transform: translateX(-110%); }  /* held while the bear stands */
    100%    { opacity: 1; transform: translateX(0); }       /* towed in as the bear bolts */
  }
  .hero-body {
    animation: bear-tow-in 5s var(--ease-std) both;
    will-change: transform, opacity;
  }
}

@media (min-width: 1600px) {
  body:has(.landing-hero) {
    --hero-bg-gradient: radial-gradient(ellipse 65% 75% at 50% 30%, #1a1f2e 0%, var(--oah-slate-900) 75%);
  }
}

/* ---------- Reduced motion ---------------------------------- */
/* The bear animation disables itself in JS; only the CSS-driven
   animations/transitions need silencing here. */
@media (prefers-reduced-motion: reduce) {
  .status-dot { animation: none; }
  .btn, .nav-links a, .copy-btn { transition: none; }
  .hero-body { animation: none; }   /* show the hero copy immediately, no tow-in */
}
