/* ============================================================
   BUKA · buka.css — shared system for all four pages
   Amber #F5B405 on Ink #0A0A0A. Soft White light theme on legal
   pages only. Engineering rules baked in:
   - no CSS `transition` on transform (CSS hover movement uses
     `translate` so GSAP owns transform exclusively)
   - no `opacity: 0` on content in base CSS (JS sets initial
     states; failed JS never blanks the page)
   - 100svh heroes; reduced-motion gets a designed calm tier
   ============================================================ */

/* ---- Fonts ---------------------------------------------------
   Self-hosted variable fonts (see css/fonts.css + assets/fonts/),
   unicode-range split: latin always; latin-ext only when needed
   (Tshivenḓa's ḓ). No third-party font connection.
   To shrink further (~35KB single file), run the pyftsubset
   command in README and merge latin+latin-ext. */
@import url('./fonts.css');
/* Metric-matched fallback to kill swap-CLS (Inter vs Roboto) */
@font-face {
  font-family: 'Inter-fallback';
  src: local('Roboto'), local('Arial');
  size-adjust: 107%; ascent-override: 90%; descent-override: 22.5%; line-gap-override: 0%;
}

:root {
  /* Brand */
  --amber: #F5B405;
  --amber-glow: #FFD451;
  --amber-press: #D89D04;
  --ink: #0A0A0A;
  --white: #FAFAFA;
  /* Ink ramp */
  --ink-800: #141414;
  --ink-700: #1E1E1E;
  --ink-600: #2A2A2A;
  --ink-500: #3D3D3D;
  --ink-400: #6B6B6B;
  --ink-300: #9A9A9A;
  --amber-08: rgba(245, 180, 5, 0.08);
  --amber-16: rgba(245, 180, 5, 0.16);
  /* Semantic (dark default) */
  --bg: var(--ink);
  --bg-card: var(--ink-800);
  --bg-raised: var(--ink-700);
  --line: var(--ink-600);
  --line-strong: var(--ink-500);
  --text-hi: var(--white);
  --text: #E4E4E4;
  --text-mut: var(--ink-300);
  --text-dim: var(--ink-400);
  --accent: var(--amber);
  /* Type */
  --sans: 'Inter', 'Inter-fallback', system-ui, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, Menlo, Consolas, monospace;
  --track-disp: -0.03em;
  --track-mono: 0.08em;
  --track-mono-wide: 0.16em;
  /* Scale */
  --step-hero: clamp(2.9rem, 11vw, 8.25rem);
  --step-h2: clamp(2rem, 5.5vw, 4.25rem);
  --step-h3: clamp(1.35rem, 3vw, 2rem);
  --step-body-lg: clamp(1.0625rem, 1.5vw, 1.3125rem);
  --step-body: 1rem;
  --step-mono: 0.8125rem;
  --step-mono-sm: 0.6875rem;
  /* Layout */
  --gutter: clamp(1.25rem, 5vw, 4.5rem);
  --max: 1280px;
  --tap: 44px;
  /* Radii */
  --r-sm: 6px; --r-md: 10px; --r-lg: 16px; --r-xl: 24px; --r-pill: 999px;
  /* Motion */
  --ease-play: cubic-bezier(0.22, 1, 0.36, 1);
}

/* ---- View Transitions (cross-document, progressive) ---- */
@view-transition { navigation: auto; }
.brand-mark { view-transition-name: buka-logo; }
@media (prefers-reduced-motion: reduce) {
  ::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*) { animation: none !important; }
}

/* ---- Base ---- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: auto !important; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 var(--step-body)/1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
  overscroll-behavior-y: none;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; }
::selection { background: var(--amber); color: var(--ink); }
:focus-visible { outline: 2px solid var(--amber-glow); outline-offset: 2px; }

h1, h2, h3 { margin: 0; color: var(--text-hi); }
p { margin: 0; }

.wrap { max-width: var(--max); margin-inline: auto; padding-inline: var(--gutter); }

/* ---- Typography helpers ---- */
.disp {
  font-weight: 900;
  letter-spacing: var(--track-disp);
  line-height: 0.94;
  text-wrap: balance;
}
.disp .hl { color: var(--amber); }
.eyebrow {
  display: inline-flex; align-items: center; gap: 10px;
  font: 500 var(--step-mono-sm)/1.4 var(--mono);
  letter-spacing: var(--track-mono-wide);
  text-transform: uppercase;
  white-space: nowrap;
  color: var(--amber);
}
.meta {
  font: 500 var(--step-mono-sm)/1.5 var(--mono);
  letter-spacing: var(--track-mono);
  text-transform: uppercase;
  color: var(--text-mut);
}

/* ---- The triangle glyph (always points right) ---- */
.tri {
  width: 0; height: 0; flex: none;
  border-top: 0.36em solid transparent;
  border-bottom: 0.36em solid transparent;
  border-left: 0.54em solid var(--amber);
}
.tri--ink { border-left-color: var(--ink); }

/* ---- Buttons ---- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: var(--tap);
  padding: 13px 26px;
  border: 2px solid transparent;
  border-radius: var(--r-pill);
  font: 900 1rem/1 var(--sans);
  letter-spacing: -0.01em;
  cursor: pointer;
  white-space: nowrap;
  user-select: none;
  /* movement via translate only — GSAP owns transform */
  translate: 0 0;
  transition: background-color 140ms ease, color 140ms ease, border-color 140ms ease, box-shadow 240ms var(--ease-play), translate 140ms ease;
}
.btn:active { translate: 0 1px; }
.btn--primary { background: var(--amber); color: var(--ink); }
.btn--primary:hover { background: var(--amber-glow); box-shadow: 0 6px 20px rgba(245, 180, 5, 0.28); }
.btn--wa { background: #25D366; color: var(--ink); }
.btn--wa:hover { background: #3BE07A; }
.btn--ghost { background: transparent; color: var(--text-hi); border-color: var(--line-strong); }
.btn--ghost:hover { border-color: var(--amber); color: var(--amber); }
.btn--lg { padding: 17px 32px; font-size: 1.125rem; }

/* ---- Chips / badges ---- */
.chip {
  display: inline-flex; align-items: center; gap: 8px;
  font: 500 var(--step-mono-sm)/1 var(--mono);
  letter-spacing: var(--track-mono);
  text-transform: uppercase;
  white-space: nowrap;
  padding: 7px 12px;
  border-radius: var(--r-pill);
  border: 1px solid var(--line-strong);
  color: var(--text);
}
.chip--amber { border-color: transparent; background: var(--amber-16); color: var(--amber); }
.chip--solid { border-color: transparent; background: var(--amber); color: var(--ink); }

/* ---- Header ---- */
.site-head {
  position: sticky; top: 0; z-index: 60;
  background: color-mix(in srgb, var(--ink) 86%, transparent);
  border-bottom: 1px solid var(--line);
}
@supports (backdrop-filter: blur(10px)) {
  .site-head { background: rgba(10, 10, 10, 0.7); backdrop-filter: blur(10px); }
}
.site-head__in {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  max-width: var(--max); margin-inline: auto;
  padding: 10px var(--gutter);
}
.brand-mark { display: inline-flex; align-items: center; gap: 10px; min-height: var(--tap); }
.brand-mark svg { height: 24px; width: auto; }
.brand-mark b { font: 900 1.3rem/1 var(--sans); letter-spacing: -0.03em; color: var(--text-hi); }
.site-nav { display: flex; align-items: center; gap: clamp(10px, 2.5vw, 28px); }
.site-nav a:not(.btn) {
  font: 700 0.875rem/1 var(--sans);
  color: var(--text);
  padding: 12px 2px;
}
.site-nav a:not(.btn):hover { color: var(--amber); }
.nav-links { display: flex; gap: clamp(14px, 2.5vw, 28px); }
@media (max-width: 700px) { .nav-links { display: none; } }

/* ---- Footer ---- */
.site-foot { border-top: 1px solid var(--line); padding: clamp(40px, 6vw, 72px) 0 36px; }
.site-foot__grid {
  display: grid; gap: clamp(28px, 4vw, 56px);
  grid-template-columns: minmax(230px, 1.4fr) repeat(3, minmax(120px, 1fr));
}
@media (max-width: 820px) { .site-foot__grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 480px) { .site-foot__grid { grid-template-columns: 1fr; } }
.site-foot h4 {
  font: 500 var(--step-mono-sm)/1 var(--mono);
  letter-spacing: var(--track-mono); text-transform: uppercase;
  color: var(--text-dim); margin: 0 0 14px;
}
.site-foot ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.site-foot ul a { font-size: 0.9375rem; color: var(--text); }
.site-foot ul a:hover { color: var(--amber); }
.site-foot__legal {
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px;
  margin-top: 44px; padding-top: 22px; border-top: 1px solid var(--line);
  font: 500 var(--step-mono-sm)/1.5 var(--mono);
  letter-spacing: var(--track-mono); text-transform: uppercase; color: var(--text-dim);
}
.site-foot__legal a:hover { color: var(--amber); }

/* ---- Sections ---- */
.sec { padding-block: clamp(64px, 10vw, 140px); }
.sec--plate { background: var(--amber-08); border-block: 1px solid var(--line); }
.sec-head { max-width: 720px; margin-bottom: clamp(28px, 5vw, 64px); }
.sec-head h2 { font-size: var(--step-h2); margin-top: 18px; }
.sec-head .lede { margin-top: 16px; font-size: var(--step-body-lg); color: var(--text-mut); max-width: 54ch; }

/* ---- Scroll reveals --------------------------------------------
   Compositor-thread CSS scroll-driven animations where supported,
   tier-gated. Base state is FULLY VISIBLE: if neither CSS nor JS
   path runs, nothing is hidden. GSAP path applies states via JS. */
@supports (animation-timeline: view()) {
  html[data-tier="1"] .rv, html[data-tier="2"] .rv {
    animation: rv-in linear both;
    animation-timeline: view();
    animation-range: entry 0% entry 64%;
  }
}
@keyframes rv-in {
  from { opacity: 0; transform: translateY(28px); }
  to { opacity: 1; transform: translateY(0); }
}
/* Tier 0: short designed fade on load, content never hidden long */
html[data-tier="0"] .rv { animation: t0-fade 220ms ease-out both; }
@keyframes t0-fade { from { opacity: 0.4; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
  html .rv { animation: t0-fade 200ms ease-out both !important; }
}

/* ---- FAQ accordion (zero JS) ---- */
.faq details {
  border-top: 1px solid var(--line);
}
.faq details:last-child { border-bottom: 1px solid var(--line); }
.faq summary {
  display: flex; align-items: center; gap: 16px;
  padding: 20px 4px;
  font: 700 var(--step-h3)/1.25 var(--sans);
  color: var(--text-hi);
  cursor: pointer;
  list-style: none;
  min-height: var(--tap);
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary .tri { rotate: 0deg; transition: rotate 240ms var(--ease-play); }
.faq details[open] summary .tri { rotate: 90deg; }
.faq .faq__a {
  padding: 0 4px 24px;
  max-width: 62ch;
  color: var(--text-mut);
  font-size: var(--step-body-lg);
}
@media (prefers-reduced-motion: no-preference) {
  .faq details::details-content {
    opacity: 0;
    block-size: 0;
    overflow-y: clip;
    transition: content-visibility 320ms allow-discrete, opacity 320ms var(--ease-play), block-size 320ms var(--ease-play);
  }
  .faq details[open]::details-content { opacity: 1; block-size: auto; }
}

/* ---- Skip link ---- */
.skip {
  position: absolute; left: 12px; top: -48px; z-index: 100;
  background: var(--amber); color: var(--ink);
  font: 700 0.875rem/1 var(--sans);
  padding: 12px 18px; border-radius: var(--r-pill);
}
.skip:focus { top: 12px; }
