/* ==========================================================================
   em8 — Design Tokens
   Senior-led AI studio · production AI for $5M–$100M B2B companies
   Derived from: em8/brand-book/design_handoff_em8_brand/01_design_system/
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Archivo+Black&family=Source+Serif+4:ital,opsz,wght@0,8..60,300;0,8..60,400;0,8..60,500;0,8..60,600;1,8..60,300;1,8..60,400;1,8..60,500&family=Archivo:wght@400;500&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
  /* Palette — warm studio */
  --ink: #1A1614;
  --ink-soft: #3A322C;
  --ink-deep: #0B0907;
  --ink-60: rgba(26,22,20,0.62);
  --ink-40: rgba(26,22,20,0.42);
  --ink-24: rgba(26,22,20,0.24);
  --ink-16: rgba(26,22,20,0.16);
  --ink-08: rgba(26,22,20,0.08);
  --paper: #F4EFE6;
  --bone: #EDE4D3;
  --clay: #C9A57B;
  --paper-60: rgba(244,239,230,0.60);
  --paper-40: rgba(244,239,230,0.40);
  --paper-16: rgba(244,239,230,0.16);
  --paper-12: rgba(244,239,230,0.12);
  --navy: #2E5A9C;
  --navy-deep: #1F3F72;
  --navy-tint: #B8CFEE;
  --oxblood: #6B1F1A;
  --oxblood-deep: #4E1612;
  --moss: #4A5538;

  /* Fonts */
  --font-display: 'Archivo Black', Arial Black, sans-serif;
  --font-serif: 'Source Serif 4', Georgia, 'Times New Roman', serif;
  --font-sans: 'Archivo', ui-sans-serif, system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, Menlo, monospace;
  --font-body: var(--font-serif);

  /* Type scale */
  --t-display-xl: clamp(52px, 7.4vw, 104px);
  --t-display-lg: clamp(48px, 6.4vw, 88px);
  --t-display-md: clamp(34px, 3.6vw, 52px);
  --t-display-sm: 28px;
  --t-lede: 19px;
  --t-body: 16px;
  --t-body-sm: 14px;
  --t-caption: 13px;
  --t-mono-md: 11px;
  --t-mono-sm: 10.5px;

  /* Tracking */
  --track-display: -0.04em;
  --track-tight: -0.025em;
  --track-mono: 0.18em;
  --track-mono-lg: 0.2em;

  /* Radii */
  --r-0: 0;
  --r-1: 2px;
  --r-full: 999px;

  /* Shadows */
  --shadow-paper: 0 1px 2px rgba(26,22,20,.05), 0 0 0 1px rgba(26,22,20,.06);
  --shadow-press: inset 0 1px 2px rgba(26,22,20,.08);

  /* Motion */
  --ease: cubic-bezier(0.2, 0, 0, 1);
  --dur-fast: 140ms;
  --dur-mid: 160ms;
  --dur-slow: 220ms;

  --content-max: 1320px;
  --gutter: 40px;
}

@media (max-width: 768px) {
  :root {
    --gutter: 24px;
  }
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: var(--t-body);
  line-height: 1.55;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

body {
  position: relative;
  overflow-x: hidden;
}

/* Grain overlay — subtle atmospheric texture */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9999;
  opacity: 0.028;
  background-image: url("/brand/grain.svg");
  mix-blend-mode: multiply;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

::selection { background: var(--navy); color: var(--paper); }

*:focus-visible {
  outline: 2px solid var(--navy);
  outline-offset: 3px;
}

/* Typographic utilities */
.t-display-xl, .t-display-lg, .t-display-md, .t-display-sm {
  font-family: var(--font-display);
  font-weight: 400;
  letter-spacing: var(--track-display);
  line-height: 0.96;
  color: var(--ink);
  text-wrap: balance;
  margin: 0;
}
.t-display-xl { font-size: var(--t-display-xl); line-height: 0.94; }
.t-display-lg { font-size: var(--t-display-lg); line-height: 0.98; }
.t-display-md { font-size: var(--t-display-md); line-height: 1; }
.t-display-sm { font-size: var(--t-display-sm); line-height: 1.1; }

.t-lede {
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: var(--t-lede);
  line-height: 1.55;
  color: var(--ink-soft);
  margin: 0;
}
.t-lede b { color: var(--ink); font-weight: 600; }
.t-lede .red { color: var(--oxblood); font-weight: 600; }

.kicker {
  font-family: var(--font-mono);
  font-size: var(--t-mono-md);
  font-weight: 500;
  letter-spacing: var(--track-mono-lg);
  text-transform: uppercase;
  color: var(--oxblood);
  display: inline-flex;
  align-items: center;
  gap: 12px;
}
.kicker .dot {
  width: 7px;
  height: 7px;
  border-radius: var(--r-full);
  background: var(--moss);
  display: inline-block;
}
.kicker .dot.clay { background: var(--clay); }

.mono {
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: var(--t-mono-md);
  letter-spacing: var(--track-mono);
  text-transform: uppercase;
  color: var(--ink-60);
}
.mono-sm {
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: var(--t-mono-sm);
  letter-spacing: var(--track-mono-lg);
  text-transform: uppercase;
  color: var(--ink-60);
}

/* Navy underline highlight — for the one highlighted word */
.hl-navy { box-shadow: inset 0 -0.12em 0 var(--navy); }
.hl-ox { box-shadow: inset 0 -0.12em 0 var(--oxblood); }
.hl-ox-thick { box-shadow: inset 0 -0.14em 0 var(--oxblood); }

/* Rules */
.rule { border-top: 1px solid var(--ink-16); }
.rule-strong { border-top: 1px solid var(--ink); }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 11.5px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  padding: 14px 22px;
  cursor: pointer;
  border: 1px solid var(--ink);
  background: var(--ink);
  color: var(--paper);
  transition: background var(--dur-mid) var(--ease), border-color var(--dur-mid) var(--ease), transform var(--dur-fast) var(--ease);
  border-radius: var(--r-0);
}
.btn:hover { background: var(--oxblood); border-color: var(--oxblood); }
.btn:active { transform: translateY(1px); opacity: 0.92; }
.btn.primary { background: var(--navy); border-color: var(--navy); }
.btn.primary:hover { background: var(--ink); border-color: var(--ink); }
.btn.ghost { background: transparent; color: var(--ink); }
.btn.ghost:hover { background: var(--ink); color: var(--paper); }
.btn .arr {
  width: 9px; height: 9px;
  border-top: 1.5px solid currentColor;
  border-right: 1.5px solid currentColor;
  transform: rotate(45deg);
}

/* Status dots */
.status-dot {
  display: inline-block;
  width: 7px; height: 7px;
  border-radius: var(--r-full);
  background: var(--ink);
  vertical-align: middle;
}
.status-dot.live { background: var(--moss); }
.status-dot.pending { background: var(--clay); }
.status-dot.alert { background: var(--oxblood); }
.status-dot.focus { background: var(--navy); }

/* Container */
.container {
  max-width: var(--content-max);
  margin: 0 auto;
  padding-left: var(--gutter);
  padding-right: var(--gutter);
}

/* Section fade-in */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}
.fade-up { animation: fadeUp 440ms var(--ease) both; }
.fade-up-1 { animation: fadeUp 440ms var(--ease) 80ms both; }
.fade-up-2 { animation: fadeUp 440ms var(--ease) 160ms both; }
.fade-up-3 { animation: fadeUp 440ms var(--ease) 240ms both; }
.fade-up-4 { animation: fadeUp 440ms var(--ease) 320ms both; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
