/* ──────────────────────────────────────────────────────────────────
   Zib Digital — base.css
   Shared design system: tokens, reset, header, nav, footer, reveals.
   Page-specific styles stay inline in each .html file.
   ────────────────────────────────────────────────────────────────── */

:root {
  --bg: #FFFFFF;
  --paper: #FAFAF8;
  --ink: #000000;
  --ink-2: #0F0F0F;
  --ink-3: #1A1A1A;
  --muted: #6B6B6B;
  --muted-2: #9C9C9C;
  --rule: #E8E5DD;
  --rule-2: #D4D0C4;
  --accent: #FF6200;
  --accent-tint: #FFE8D9;
  --score-good: #0BAB6E;
  --score-mid:  #FF9D00;
  --score-bad:  #E03A3A;
  --dim: #F5F2EB;

  --display: "neue-haas-grotesk-display", "Helvetica Neue", Helvetica, Roboto, system-ui, -apple-system, "Segoe UI", sans-serif;
  --body:    "neue-haas-grotesk-display", "Helvetica Neue", Helvetica, Roboto, system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono:    "JetBrains Mono", "SF Mono", ui-monospace, Menlo, Consolas, monospace;

  --max: 1320px;
  --pad: clamp(20px, 4vw, 56px);
  --section-y: clamp(112px, 16vh, 220px);

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

/* ─── Reset ───────────────────────────────────────────────────── */
* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--body);
  font-size: 17px;
  line-height: 1.55;
  font-feature-settings: "kern", "liga", "ss01";
  font-variant-numeric: lining-nums;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  text-rendering: optimizeLegibility;
}
::selection { background: var(--accent); color: #fff; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; border-radius: 2px; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
img, svg { display: block; max-width: 100%; }
em { font-style: italic; font-weight: 400; }

/* ─── Utilities ────────────────────────────────────────────────── */
.container { max-width: var(--max); margin: 0 auto; padding-left: var(--pad); padding-right: var(--pad); }
.mono { font-family: var(--mono); font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; font-weight: 500; }
.tabular { font-variant-numeric: tabular-nums; }
.italic { font-style: italic; color: var(--accent); font-weight: 400; }
h1, h2, h3, .hero-h, .fork-h, .path-title, .moat-h, .cta-title { text-wrap: balance; }

/* ─── Site header / nav ──────────────────────────────────────── */
.site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 50;
  background: rgba(255,255,255,0.78);
  backdrop-filter: saturate(160%) blur(16px);
  -webkit-backdrop-filter: saturate(160%) blur(16px);
  border-bottom: 0.5px solid transparent;
  transition: border-color 320ms var(--ease), background 320ms var(--ease);
}
.site-header.scrolled { border-bottom-color: var(--rule); background: rgba(255,255,255,0.92); }
.site-header .row { display: flex; align-items: center; justify-content: space-between; height: 68px; }
.brand { display: inline-flex; align-items: baseline; }
.brand img { height: 28px; width: auto; }
.nav { display: flex; gap: clamp(14px, 2vw, 28px); align-items: center; font-family: var(--display); font-size: 14px; }
.nav a { color: var(--ink); opacity: 0.72; transition: opacity 200ms var(--ease); }
.nav a:hover, .nav a[aria-current="page"] { opacity: 1; }
.nav a.cta {
  background: var(--ink);
  color: #fff;
  opacity: 1;
  padding: 10px 20px;
  border-radius: 999px;
  font-weight: 500;
  transition: transform 200ms var(--ease);
}
.nav a.cta:hover { transform: translateY(-1px); }
@media (max-width: 880px) {
  .nav a:not(.cta) { display: none; }
}
.header-spacer { height: 68px; }

/* ─── Buttons (shared) ────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 16px 26px; border-radius: 999px;
  font-family: var(--display); font-size: 15px; font-weight: 500;
  transition: transform 200ms var(--ease), background 200ms var(--ease), color 200ms var(--ease);
}
.btn .arr { transition: transform 200ms var(--ease); }
.btn:hover .arr { transform: translateX(4px); }
.btn-primary { background: var(--ink); color: #fff; }
.btn-primary:hover { transform: translateY(-1px); }
.btn-outline { background: transparent; color: var(--ink); border: 1px solid var(--ink); }
.btn-outline:hover { background: var(--ink); color: #fff; }
.btn-light { background: #fff; color: var(--ink); }
.btn-light:hover { transform: translateY(-1px); }

/* ─── Footer ──────────────────────────────────────────────────── */
/* Default footer styles. Pages can override (e.g. dark theme) by
   defining matching selectors in their own inline <style> block —
   inline rules come after this stylesheet, so they win on ties. */
footer {
  border-top: 0.5px solid var(--rule);
  padding-top: clamp(56px, 7vw, 88px);
  padding-bottom: 28px;
}
.foot-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: clamp(24px, 4vw, 64px);
  padding-bottom: clamp(56px, 7vw, 88px);
}
.foot-grid h4 {
  font-family: var(--display);
  font-weight: 500;
  font-size: 13px;
  letter-spacing: 0.02em;
  color: var(--muted);
  margin-bottom: 20px;
}
.foot-grid ul { list-style: none; display: grid; gap: 10px; padding: 0; margin: 0; }
.foot-grid li { font-size: 15px; color: var(--ink-3); }
.foot-grid a { font-size: 15px; color: var(--ink-3); transition: color 200ms var(--ease); }
.foot-grid a:hover { color: var(--accent); }
.foot-tag {
  font-family: var(--display);
  font-weight: 500;
  font-size: clamp(20px, 2vw, 26px);
  letter-spacing: -0.025em;
  line-height: 1.2;
  max-width: 28ch;
  margin-top: 24px;
}
.foot-bar {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  padding-top: 24px;
  border-top: 0.5px solid var(--rule);
  color: var(--muted);
  align-items: center;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.foot-clock {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
@keyframes fpulse { 0%,100% { opacity: 1; } 50% { opacity: 0.4; } }
.foot-clock .pulse {
  width: 6px; height: 6px;
  border-radius: 50%;
  display: inline-block;
  background: var(--score-good);
  animation: fpulse 2s ease-in-out infinite;
}
@media (max-width: 720px) {
  .foot-grid { grid-template-columns: 1fr 1fr; }
  .foot-grid > div:first-child { grid-column: 1 / -1; }
}
@media (max-width: 480px) {
  .foot-grid { grid-template-columns: 1fr; gap: 32px; }
  .foot-grid > div:first-child { grid-column: 1; }
}

/* ─── Reveals ─────────────────────────────────────────────────── */
.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 800ms var(--ease), transform 800ms var(--ease);
}
.reveal.in { opacity: 1; transform: translateY(0); }
.reveal-stagger > * {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 700ms var(--ease), transform 700ms var(--ease);
}
.reveal-stagger.in > * { opacity: 1; transform: translateY(0); }
.reveal-stagger.in > *:nth-child(1) { transition-delay: 0ms; }
.reveal-stagger.in > *:nth-child(2) { transition-delay: 100ms; }
.reveal-stagger.in > *:nth-child(3) { transition-delay: 200ms; }
.reveal-stagger.in > *:nth-child(4) { transition-delay: 300ms; }
.reveal-stagger.in > *:nth-child(5) { transition-delay: 400ms; }
.reveal-stagger.in > *:nth-child(6) { transition-delay: 500ms; }
.reveal-stagger.in > *:nth-child(7) { transition-delay: 600ms; }
.reveal-stagger.in > *:nth-child(8) { transition-delay: 700ms; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .reveal, .reveal-stagger > * { opacity: 1 !important; transform: none !important; }
}
