/* =============================================================================
   chopakalabs.com — shared site system  (light-first marketing web)
   -----------------------------------------------------------------------------
   Consumes the brand single-source-of-truth (tokens.css) against its LIGHT
   theme. Pages set <html data-theme="light"> and link: tokens.css → site.css.
   This file holds the chrome (header, footer, nav), layout primitives, type
   helpers, buttons, and the inset mountain logo lockup. Page-specific layout
   lives in each page's own <style> block.
   ============================================================================= */

* { box-sizing: border-box; -webkit-font-smoothing: antialiased; }
html { scroll-behavior: smooth; }
html, body { margin: 0; }
body {
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-body);
  line-height: var(--lh-normal);
  font-size: var(--text-base);
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }

/* ---- layout primitives ---------------------------------------------------- */
.container { max-width: 1120px; margin: 0 auto; padding: 0 32px; }
.section { padding: 96px 0; }
.section--tight { padding: 64px 0; }
.divider { border: none; border-top: 1px solid var(--color-border); margin: 0; }

/* ---- type helpers --------------------------------------------------------- */
.kicker {
  font-family: var(--font-mono); font-size: 12px; font-weight: 500;
  letter-spacing: 0.22em; text-transform: uppercase; color: var(--color-primary);
  margin: 0 0 18px;
}
.display {
  font-family: var(--font-display); font-weight: 900; letter-spacing: -0.02em;
  line-height: 1.02; color: var(--color-text); margin: 0;
  font-size: clamp(38px, 6vw, 68px);
}
h1, h2, h3 { font-family: var(--font-display); letter-spacing: -0.01em; color: var(--color-text); margin: 0; }
h2.head { font-weight: 800; font-size: clamp(28px, 3.6vw, 44px); line-height: 1.04; }
h3.sub { font-weight: 700; font-size: clamp(20px, 2vw, 26px); line-height: 1.12; }
.lead { color: var(--color-text-muted); font-size: clamp(17px, 1.5vw, 20px); line-height: 1.55; max-width: 60ch; text-wrap: pretty; }
.prose p { color: var(--color-text-muted); font-size: 17px; line-height: 1.62; margin: 0 0 18px; max-width: 65ch; text-wrap: pretty; }
.prose p:last-child { margin-bottom: 0; }
.prose strong { color: var(--color-text); font-weight: 600; }
.mono { font-family: var(--font-mono); }

/* ---- buttons -------------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  font-family: var(--font-body); font-weight: 600; font-size: 15px;
  height: var(--control-md); padding: 0 20px; border-radius: 10px;
  border: 1px solid transparent; cursor: pointer; white-space: nowrap;
  transition: background var(--dur-fast) var(--ease-standard), border-color var(--dur-fast) var(--ease-standard), color var(--dur-fast) var(--ease-standard), transform var(--dur-instant) var(--ease-standard);
}
.btn:active { transform: translateY(1px); }
.btn--primary { background: var(--color-primary); color: var(--color-on-primary); }
.btn--primary:hover { background: var(--color-primary-hover); }
.btn--ghost { background: transparent; color: var(--color-text); border-color: var(--color-border); }
.btn--ghost:hover { border-color: color-mix(in srgb, var(--color-text) 30%, transparent); background: color-mix(in srgb, var(--color-text) 4%, transparent); }
.btn--lg { height: var(--control-lg); padding: 0 26px; font-size: 16px; border-radius: 12px; }
.btn svg { width: 18px; height: 18px; flex: none; }

/* ---- the inset mountain logo lockup --------------------------------------
   The ridge mark with CHOPAKA LABS knocked into its lower body. One element,
   sized by its container's --lk-w; the wordmark scales off the same width so
   the lockup stays proportional from a 160px header to a 480px hero.        */
.brand-lockup { position: relative; display: inline-block; width: var(--lk-w, 180px); line-height: 0; }
.brand-lockup img { width: 100%; }
.brand-lockup .inwm {
  position: absolute; left: 4%; right: 4%; bottom: 15%;
  text-align: center; line-height: 1; white-space: nowrap;
  font-family: var(--font-display); font-weight: 900; letter-spacing: -0.005em;
  font-size: calc(var(--lk-w, 180px) * 0.062);
  color: var(--cloud);
}
.brand-lockup .inwm .paka { color: var(--sky); }
.brand-lockup .inwm .labs { color: color-mix(in srgb, var(--cloud) 64%, transparent); font-weight: 800; }
/* footer variant: the ridge is the light Cloud mark, so the ambient text flips to ink
   and the Paka syllable wears Steel (the on-light value from the name-color contract) */
.footer-brand .inwm { color: var(--ink); }
.footer-brand .inwm .paka { color: var(--steel); }
.footer-brand .inwm .labs { color: var(--ink); }

/* ---- site header ---------------------------------------------------------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--color-bg) 82%, transparent);
  backdrop-filter: saturate(160%) blur(14px);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid var(--color-border);
}
.site-header .container { display: flex; align-items: center; gap: 28px; height: 68px; }
.brand { --lk-w: 156px; display: inline-flex; align-items: center; flex: none; }
.site-nav { display: flex; align-items: center; gap: 4px; margin-left: 8px; }
.nav-link {
  font-size: 15px; font-weight: 500; color: var(--color-text-muted);
  padding: 8px 13px; border-radius: 8px; transition: color var(--dur-fast), background var(--dur-fast);
}
.nav-link:hover { color: var(--color-text); background: color-mix(in srgb, var(--color-text) 5%, transparent); }
.nav-link.is-active { color: var(--color-text); }
.header-right { margin-left: auto; display: flex; align-items: center; gap: 12px; }

/* ---- mobile menu (hidden on desktop) -------------------------------------- */
.header-menu-btn {
  display: none; order: 9; /* order pushes it to the right edge of header-right */
  width: 44px; height: 44px; flex: none;
  align-items: center; justify-content: center;
  border: 1px solid var(--color-border); border-radius: var(--radius-md);
  background: var(--color-surface); color: var(--color-text); cursor: pointer;
}
.header-menu-btn svg { width: 22px; height: 22px; }
.header-menu-btn .ic-close { display: none; }
.header-menu-btn[aria-expanded="true"] .ic-open { display: none; }
.header-menu-btn[aria-expanded="true"] .ic-close { display: block; }
.mobile-backdrop {
  display: none; position: fixed; inset: 0; z-index: 48;
  background: color-mix(in srgb, var(--slate-900) 44%, transparent);
}
.mobile-backdrop.is-open { display: block; }
.mobile-menu {
  display: none; position: fixed; top: 68px; left: 0; right: 0; z-index: 49;
  flex-direction: column; gap: 2px;
  padding: 14px 22px 22px;
  background: var(--color-bg);
  border-bottom: 1px solid var(--color-border);
  box-shadow: var(--shadow-card);
}
.mobile-menu .nav-link { font-size: 17px; padding: 14px 12px; border-radius: var(--radius-sm); }
.mobile-menu .nav-link.is-active { background: color-mix(in srgb, var(--color-text) 5%, transparent); }
.mobile-menu .btn { margin-top: 12px; width: 100%; justify-content: center; height: 50px; }

/* ---- site footer (the dark-contrast anchor; raw palette = theme-independent) */
.site-footer { background: var(--slate-900); color: var(--cloud); padding: 72px 0 36px; }
.footer-top { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 40px; }
.footer-brand { max-width: 320px; }
.footer-brand .brand-lockup { --lk-w: 200px; }
.footer-tag { color: var(--cloud-dim); font-size: 14px; line-height: 1.55; margin: 20px 0 0; }
.footer-col h4 {
  font-family: var(--font-mono); font-size: 11px; font-weight: 500; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--mist); margin: 4px 0 16px;
}
.footer-col a { display: block; color: var(--cloud-dim); font-size: 14.5px; padding: 6px 0; transition: color var(--dur-fast); }
.footer-col a:hover { color: var(--cloud); }
.footer-bottom {
  display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap;
  margin-top: 56px; padding-top: 26px; border-top: 1px solid rgba(222,222,223,0.12);
}
.footer-copy { font-size: 13px; color: var(--mist); }
.footer-region { font-family: var(--font-mono); font-size: 12px; color: var(--mist); letter-spacing: 0.04em; }

/* ---- responsive ----------------------------------------------------------- */
@media (max-width: 860px) {
  .container { padding: 0 22px; }
  .section { padding: 64px 0; }
  .site-nav, .header-right .btn--ghost { display: none; }
  .header-menu-btn { display: inline-flex; }
  .mobile-menu.is-open { display: flex; }
  .footer-top { grid-template-columns: 1fr 1fr; gap: 32px; }
  .footer-brand { grid-column: 1 / -1; }
}
