/* ============================================================
   APSIVO / SYSTEMS — shared design system
   One source of truth for every page. Edit here, not per-page.
   Palette: ink / paper / gold (locked on-site June 2026)
   ============================================================ */

:root {
  --ink: #0B1220;
  --ink-2: #101a2e;            /* dark-panel gradient partner */
  --paper: #F6F4EE;
  --gold: #C9A24B;
  --gold-bright: #E3BE6A;      /* gold for small text on dark — passes contrast */
  --gold-soft: rgba(201,162,75,0.14);
  --rule: #E5E0D5;
  --muted: #6B7280;
  --ink-soft: rgba(11,18,32,0.66);
  --ink-faint: rgba(11,18,32,0.10);
  --paper-soft: rgba(246,244,238,0.72);
  --paper-dim: rgba(246,244,238,0.55);
  --paper-line: rgba(246,244,238,0.12);
  --radius: 3px;
  --pad-x: 48px;
  --max-w: 1280px;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, monospace;
  --shadow-card: 0 1px 2px rgba(11,18,32,0.04), 0 8px 24px -12px rgba(11,18,32,0.10);
  --shadow-card-hover: 0 2px 4px rgba(11,18,32,0.05), 0 20px 44px -16px rgba(11,18,32,0.18);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
html, body { background: var(--paper); color: var(--ink); }
body {
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
  line-height: 1.55;
  text-rendering: optimizeLegibility;
}
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
img, svg { display: block; max-width: 100%; }
.mono { font-family: var(--font-mono); }

::selection { background: var(--gold); color: var(--ink); }

:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
  border-radius: 2px;
}

.skip-link {
  position: absolute; left: -9999px; top: 12px; z-index: 200;
  background: var(--ink); color: var(--paper);
  font-family: var(--font-mono); font-size: 12px;
  padding: 10px 16px; letter-spacing: 0.08em; text-transform: uppercase;
}
.skip-link:focus { left: 12px; }

/* ============ TEXTURE — faint blueprint grid on dark panels ============ */
.blueprint {
  background-image:
    linear-gradient(rgba(246,244,238,0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(246,244,238,0.035) 1px, transparent 1px);
  background-size: 56px 56px;
}

/* ============ NAV ============ */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: rgba(246,244,238,0.9);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--rule);
  padding: 16px var(--pad-x);
  display: flex; align-items: center; justify-content: space-between;
  transition: box-shadow .25s ease;
}
.nav.scrolled { box-shadow: 0 10px 30px -18px rgba(11,18,32,0.25); }
.nav-logo { display: flex; align-items: center; gap: 12px; flex-shrink: 0; }
.nav-logo .wordmark {
  font-family: var(--font-mono); font-size: 11px;
  letter-spacing: 0.32em; text-transform: uppercase; color: var(--ink);
  white-space: nowrap;
}
.nav-logo .wordmark .slash { color: var(--gold); margin: 0 6px; }
.nav-items { display: flex; gap: 34px; align-items: center; }
.nav-items a {
  font-size: 14px; font-weight: 500; color: var(--ink-soft);
  position: relative; padding: 4px 0; transition: color .15s;
}
.nav-items a::after {
  content: ''; position: absolute; left: 0; bottom: -2px;
  width: 100%; height: 2px; background: var(--gold);
  transform: scaleX(0); transform-origin: left;
  transition: transform .22s ease;
}
.nav-items a:hover { color: var(--ink); }
.nav-items a:hover::after, .nav-items a.active::after { transform: scaleX(1); }
.nav-items a.active { color: var(--ink); font-weight: 600; }
.nav-right { display: flex; align-items: center; gap: 16px; }
.nav-cta {
  font-family: var(--font-mono); font-size: 12px; padding: 10px 18px;
  border: 1px solid var(--ink); color: var(--ink);
  letter-spacing: 0.08em; text-transform: uppercase;
  transition: background .18s, color .18s;
  white-space: nowrap;
}
.nav-cta:hover { background: var(--ink); color: var(--paper); }

/* Mobile hamburger */
.nav-burger {
  display: none;
  background: none; border: 0; padding: 8px;
  flex-direction: column; gap: 5px;
}
.nav-burger span {
  display: block; width: 22px; height: 2px; background: var(--ink);
  transition: transform .25s ease, opacity .2s ease;
}
.nav-burger[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-burger[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-burger[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.nav-drawer {
  display: none;
  position: fixed; top: 61px; left: 0; right: 0; z-index: 49;
  background: var(--paper);
  border-bottom: 1px solid var(--rule);
  padding: 12px 24px 24px;
  box-shadow: 0 24px 48px -24px rgba(11,18,32,0.3);
}
.nav-drawer.open { display: block; }
.nav-drawer a {
  display: block; padding: 14px 4px;
  font-size: 16px; font-weight: 500; color: var(--ink);
  border-bottom: 1px solid var(--rule);
}
.nav-drawer a.active { color: var(--gold); font-weight: 600; }
.nav-drawer a:last-child { border-bottom: 0; }

/* ============ TYPE & SECTION SCAFFOLD ============ */
.wrap { max-width: var(--max-w); margin: 0 auto; padding-left: var(--pad-x); padding-right: var(--pad-x); }

.eyebrow {
  font-family: var(--font-mono); font-size: 11px;
  letter-spacing: 0.24em; text-transform: uppercase;
  color: var(--ink-soft); margin-bottom: 24px;
  display: flex; align-items: center; gap: 12px;
}
.eyebrow .dot { width: 6px; height: 6px; background: var(--gold); border-radius: 50%; flex-shrink: 0; }
.eyebrow .num { color: var(--gold); }
.eyebrow .line { flex: 0 1 64px; height: 1px; background: var(--gold); opacity: 0.6; }

.gold { color: var(--gold); }
h1 .gold, h2 .gold, h3 .gold { font-style: italic; font-weight: 500; }

.display {
  font-weight: 700;
  font-size: clamp(46px, 6.6vw, 92px);
  line-height: 0.98;
  letter-spacing: -0.03em;
  text-wrap: balance;
}
.h2 {
  font-weight: 700;
  font-size: clamp(34px, 4.4vw, 56px);
  line-height: 1.04; letter-spacing: -0.022em;
  text-wrap: balance;
}
.lead {
  font-size: clamp(17px, 1.7vw, 21px); line-height: 1.55; color: var(--ink-soft);
  font-weight: 400;
}
.lead strong { color: var(--ink); font-weight: 600; }
.deck {
  font-size: 18px; line-height: 1.6; color: var(--ink-soft);
  max-width: 760px;
}
.deck strong { color: var(--ink); font-weight: 600; }

.section { padding: 110px 0 0; }
.section-head { margin-bottom: 56px; }
.section-head .h2 { max-width: 920px; margin-bottom: 24px; }

/* ============ BUTTONS ============ */
.btn-primary {
  font-family: var(--font-mono);
  background: var(--ink); color: var(--paper);
  padding: 17px 26px; font-size: 13px;
  letter-spacing: 0.1em; text-transform: uppercase;
  display: inline-flex; align-items: center; gap: 10px;
  border: 1px solid var(--ink);
  position: relative; overflow: hidden;
  transition: transform .15s ease, box-shadow .2s ease;
}
.btn-primary::after {
  content: ''; position: absolute; left: 0; bottom: 0;
  height: 2px; width: 100%; background: var(--gold);
  transform: scaleX(0); transform-origin: left;
  transition: transform .28s ease;
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 10px 24px -10px rgba(11,18,32,0.45); }
.btn-primary:hover::after { transform: scaleX(1); }
.btn-gold {
  font-family: var(--font-mono);
  background: var(--gold); color: var(--ink);
  padding: 17px 26px; font-size: 13px; font-weight: 600;
  letter-spacing: 0.1em; text-transform: uppercase;
  display: inline-flex; align-items: center; gap: 10px;
  transition: transform .15s ease, box-shadow .2s ease;
}
.btn-gold:hover { transform: translateY(-1px); box-shadow: 0 10px 24px -10px rgba(201,162,75,0.5); }
.btn-link {
  font-family: var(--font-mono);
  color: var(--ink); padding: 17px 0;
  font-size: 13px; letter-spacing: 0.1em; text-transform: uppercase;
  border-bottom: 1px solid var(--ink);
  display: inline-flex; align-items: center; gap: 8px;
  transition: border-color .15s, color .15s;
}
.btn-link .arrow { transition: transform .2s ease; }
.btn-link:hover { color: var(--gold); border-color: var(--gold); }
.btn-link:hover .arrow { transform: translateX(4px); }
.btn-ghost-dark {
  font-family: var(--font-mono);
  color: var(--paper); padding: 17px 0;
  font-size: 13px; letter-spacing: 0.1em; text-transform: uppercase;
  border-bottom: 1px solid var(--paper-line);
  display: inline-flex; align-items: center; gap: 8px;
  transition: border-color .15s, color .15s;
}
.btn-ghost-dark:hover { color: var(--gold-bright); border-color: var(--gold); }
.cta-row { display: flex; gap: 24px; align-items: center; flex-wrap: wrap; }

/* ============ CARDS ============ */
.card {
  background: #fff; border: 1px solid var(--rule); border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  position: relative;
  transition: transform .22s ease, box-shadow .22s ease, border-color .22s ease;
}
.card::before {
  content: ''; position: absolute; top: -1px; left: -1px; right: -1px;
  height: 2px; background: var(--gold);
  transform: scaleX(0); transform-origin: left;
  transition: transform .3s ease;
}
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow-card-hover); border-color: #d8d2c2; }
.card:hover::before { transform: scaleX(1); }
.card-static:hover { transform: none; box-shadow: var(--shadow-card); }
.card-static:hover::before { transform: scaleX(0); }

.k-label {
  font-family: var(--font-mono); font-size: 10.5px;
  color: var(--gold); letter-spacing: 0.15em; text-transform: uppercase;
}

/* ============ DARK PANEL ============ */
.panel-dark {
  background: linear-gradient(160deg, var(--ink) 0%, var(--ink-2) 100%);
  color: var(--paper);
  border-radius: 4px;
  position: relative; overflow: hidden;
}
.panel-dark::before {
  content: ''; position: absolute; top: 0; left: 0; height: 3px; width: 100%;
  background: linear-gradient(90deg, var(--gold) 0%, rgba(201,162,75,0.25) 100%);
  z-index: 1;
}
.panel-dark .k-label { color: var(--gold-bright); }

/* ============ LEAK METER — the signature motif ============ */
.leak-meter { width: 100%; }
.leak-meter .lm-track {
  height: 6px; border-radius: 3px;
  background: var(--paper-line);
  position: relative; overflow: hidden;
}
.leak-meter.on-light .lm-track { background: var(--ink-faint); }
.leak-meter .lm-fill {
  position: absolute; inset: 0 auto 0 0; width: 0%;
  border-radius: 3px;
  background: linear-gradient(90deg, rgba(201,162,75,0.35), var(--gold) 82%, var(--gold-bright));
  transition: width 1.6s cubic-bezier(.22,1,.3,1);
}
.leak-meter .lm-scale {
  display: flex; justify-content: space-between;
  font-family: var(--font-mono); font-size: 10px;
  letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--paper-dim); margin-top: 10px;
}
.leak-meter.on-light .lm-scale { color: var(--ink-soft); }

/* ============ SCROLL REVEAL ============ */
.reveal {
  opacity: 0; transform: translateY(22px);
  transition: opacity .7s ease, transform .7s cubic-bezier(.22,1,.3,1);
}
.reveal.in { opacity: 1; transform: none; }
.reveal-d1 { transition-delay: .08s; }
.reveal-d2 { transition-delay: .16s; }
.reveal-d3 { transition-delay: .24s; }

/* ============ FOOTER (unified, dark, every page) ============ */
.site-footer {
  background: var(--ink); color: var(--paper);
  padding: 80px var(--pad-x) 32px; margin-top: 130px;
  position: relative;
}
.site-footer::before {
  content: ''; position: absolute; top: 0; left: 0; height: 3px; width: 100%;
  background: linear-gradient(90deg, var(--gold), rgba(201,162,75,0.2));
}
.footer-inner {
  max-width: var(--max-w); margin: 0 auto;
  display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 56px;
}
.footer-brand .mark { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; }
.footer-brand .wordmark {
  font-family: var(--font-mono); font-size: 12px;
  letter-spacing: 0.32em; text-transform: uppercase; color: var(--paper);
}
.footer-brand .wordmark .slash { color: var(--gold); margin: 0 6px; }
.footer-brand p { font-size: 14px; color: var(--paper-dim); line-height: 1.6; max-width: 360px; }
.footer-col h2 {
  font-family: var(--font-mono); font-size: 11px; font-weight: 500;
  color: var(--gold-bright); letter-spacing: 0.14em; text-transform: uppercase;
  margin-bottom: 16px;
}
.footer-col a {
  display: block; font-size: 14px; color: var(--paper-soft);
  margin-bottom: 10px; transition: color .15s;
}
.footer-col a:hover { color: var(--gold-bright); }
.footer-bottom {
  max-width: var(--max-w); margin: 48px auto 0; padding-top: 24px;
  border-top: 1px solid var(--paper-line);
  display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  font-family: var(--font-mono); font-size: 11px;
  color: rgba(246,244,238,0.4); letter-spacing: 0.1em; text-transform: uppercase;
}

/* ============ PRODUCT PAGES (what-we-do/*) ============ */
.product-page { max-width: 1180px; margin: 0 auto; padding: 72px var(--pad-x) 0; }
.product-page .display { font-size: clamp(40px, 5.5vw, 72px); margin-bottom: 28px; max-width: 900px; }
.product-page > .lead { max-width: 760px; }

.product-tabs { display: flex; gap: 10px; margin-bottom: 52px; flex-wrap: wrap; }
.product-tab {
  font-family: var(--font-mono); font-size: 11px;
  letter-spacing: 0.14em; text-transform: uppercase;
  padding: 10px 16px; border: 1px solid var(--rule); border-radius: 2px;
  color: var(--ink-soft); background: #fff;
  transition: border-color .15s, color .15s;
}
.product-tab.active { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.product-tab:hover:not(.active) { border-color: var(--ink); color: var(--ink); }
.product-tab.tab-system { margin-left: auto; }

.psection { margin-top: 88px; padding-top: 48px; border-top: 1px solid var(--rule); }
.psection .k-label { display: block; margin-bottom: 18px; }
.psection h2 { font-weight: 700; font-size: clamp(26px, 3.2vw, 34px); letter-spacing: -0.02em; line-height: 1.12; margin-bottom: 14px; }
.psection .intro { font-size: 16px; color: var(--ink-soft); max-width: 700px; line-height: 1.6; margin-bottom: 36px; }
.psection .intro strong { color: var(--ink); font-weight: 600; }

.tile-grid { display: grid; gap: 20px; }
.tile-grid.cols-2 { grid-template-columns: repeat(2, 1fr); }
.tile-grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.tile-grid.cols-4 { grid-template-columns: repeat(4, 1fr); }
.tile { padding: 28px 28px 24px; }
.tile .k-label { display: block; margin-bottom: 12px; }
.tile h3 { font-size: 17.5px; font-weight: 600; letter-spacing: -0.01em; margin-bottom: 8px; line-height: 1.3; }
.tile p { font-size: 14px; color: var(--ink-soft); line-height: 1.6; }

.product-page .cta-row { margin-top: 80px; }

@media (max-width: 960px) {
  .product-page { padding-top: 52px; }
  .tile-grid.cols-2, .tile-grid.cols-3 { grid-template-columns: 1fr; }
  .tile-grid.cols-4 { grid-template-columns: 1fr 1fr; }
  .product-tab.tab-system { margin-left: 0; }
}

/* ============ RESPONSIVE ============ */
@media (max-width: 960px) {
  :root { --pad-x: 24px; }
  .nav-items { display: none; }
  .nav-burger { display: flex; }
  .nav .nav-cta { display: none; }
  .footer-inner { grid-template-columns: 1fr; gap: 36px; }
  .section { padding-top: 80px; }
  .cta-row { gap: 16px; }
}

/* ============ REDUCED MOTION ============ */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .leak-meter .lm-fill { transition: none; }
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; }
}

/* ============ READABLE GOLD (Oct 2026) ============
   Brand gold #C9A24B is 2.2:1 on paper, too faint for text.
   Gold stays for lines, dots and fills; text on light uses --gold-ink (4.6:1). */
:root { --gold-ink: #8A6A1F; }
.gold, .k-label, .eyebrow .num { color: var(--gold-ink); }
.btn-link:hover { color: var(--gold-ink); border-color: var(--gold-ink); }
.panel-dark .gold, .site-footer .gold { color: var(--gold); }
.panel-dark .k-label { color: var(--gold-bright); }
.k-label { font-size: 11.5px; }
.eyebrow { font-size: 12px; }

/* ============ TWO-LINE TITLES (Oct 2026) ============
   The gold phrase that ends a big title always starts its own line
   and stays on one line (wraps only on phones). */
.tl2 { display: block; }
@media (min-width: 761px) { .tl2 { white-space: nowrap; } }
