/* ==========================================================================
   Quanta Diplomacy · base.css
   Tokens, reset, typography, grid, themes.
   ========================================================================== */

:root {
  /* Palette: drawn from the QD crest */
  --navy-990: #050b1a;
  --navy-950: #071026;
  --navy-900: #0a1630;
  --navy-800: #0f2350;
  --navy-700: #16306a;
  --royal: #1f4fa8;
  --royal-300: #8fb0e8;
  --silver: #c9d1dc;
  --silver-100: #eef1f5;
  --silver-300: #aeb8c6;
  --silver-500: #7d8898;
  --gold: #c9a24a;
  --gold-300: #e2c47d;
  --gold-700: #7f611c; /* AA on ivory for small text */
  --ivory: #f6f4ef;
  --ivory-200: #ece9e1;
  --ink: #0a1630;
  --ink-soft: #3b4559;

  /* Type */
  --font-display: "Inter Tight", "Inter", "Helvetica Neue", Arial, sans-serif;
  --font-head: "Manrope", "Helvetica Neue", Arial, sans-serif;
  --font-body: "Inter", "Helvetica Neue", Arial, sans-serif;

  --fs-body: clamp(17px, 0.98rem + 0.18vw, 19px);
  --fs-small: clamp(13px, 0.78rem + 0.1vw, 14px);
  --fs-lede: clamp(1.18rem, 1.02rem + 0.55vw, 1.5rem);
  --fs-h3: clamp(1.25rem, 1.08rem + 0.5vw, 1.6rem);
  --fs-h2: clamp(2.4rem, 1.3rem + 3.8vw, 6rem);
  --fs-h1: clamp(3.1rem, 1.1rem + 7.2vw, 10.5rem);
  --fs-mega: clamp(3.5rem, 0.6rem + 9.6vw, 14rem);

  /* Layout */
  --margin: clamp(20px, 4.6vw, 104px);
  --gutter: clamp(16px, 1.8vw, 36px);
  --maxw: 1760px;
  --nav-h: 76px;
  --section-y: clamp(96px, 12vw, 220px);

  /* Motion: custom curves, never the defaults */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out: cubic-bezier(0.76, 0, 0.24, 1);
  --ease-precise: cubic-bezier(0.65, 0.05, 0, 1);
  --ease-soft: cubic-bezier(0.33, 0.0, 0.18, 1);
  --dur-1: 0.28s;
  --dur-2: 0.6s;
  --dur-3: 1.1s;

  --hairline: 1px solid rgba(10, 22, 48, 0.16);
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font-body);
  font-size: var(--fs-body);
  font-weight: 400;
  line-height: 1.66;
  color: var(--ink);
  background: var(--ivory);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  font-feature-settings: "kern", "liga", "calt";
  overflow-x: clip;
}
img, video, canvas, svg { display: block; max-width: 100%; }
img { height: auto; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
input, textarea, select { font: inherit; color: inherit; }
h1, h2, h3, h4, p, ul, ol, figure, blockquote, dl, dd { margin: 0; }
ul, ol { padding: 0; list-style: none; }
::selection { background: var(--gold); color: var(--navy-900); }

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

.skip-link {
  position: fixed; top: 12px; left: 12px; z-index: 1000;
  padding: 12px 18px; background: var(--gold); color: var(--navy-900);
  font-family: var(--font-head); font-weight: 800; font-size: 14px;
  transform: translateY(-160%); transition: transform var(--dur-1) var(--ease-out);
}
.skip-link:focus { transform: none; }

.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* Lenis */
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
.lenis.lenis-smooth [data-lenis-prevent] { overscroll-behavior: contain; }
.lenis.lenis-stopped { overflow: hidden; }

/* ---------- Typography ---------- */
.t-mega, .t-h1, .t-h2, .t-display {
  font-family: var(--font-display);
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 0.92;
  text-wrap: balance;
  font-feature-settings: "ss01", "cv11", "tnum" 0;
}
.t-mega { font-size: var(--fs-mega); font-weight: 900; letter-spacing: -0.045em; line-height: 0.88; }
.t-h1 { font-size: var(--fs-h1); font-weight: 900; letter-spacing: -0.045em; }
.t-h2 { font-size: var(--fs-h2); letter-spacing: -0.04em; line-height: 0.94; }
.t-mega em, .t-h1 em, .t-h2 em { font-style: normal; color: var(--royal); }
.theme-dark .t-mega em, .theme-dark .t-h1 em, .theme-dark .t-h2 em,
.theme-deep .t-mega em, .theme-deep .t-h1 em, .theme-deep .t-h2 em { color: var(--silver-300); }

.t-h3 {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: var(--fs-h3);
  letter-spacing: -0.015em;
  line-height: 1.2;
}
.t-h4 {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: -0.005em;
  line-height: 1.35;
}
.t-eyebrow {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  line-height: 1.4;
}
.t-meta {
  font-family: var(--font-head);
  font-weight: 600;
  font-size: var(--fs-small);
  letter-spacing: 0.02em;
  font-variant-numeric: tabular-nums;
}
.t-lede {
  font-size: var(--fs-lede);
  line-height: 1.5;
  letter-spacing: -0.008em;
  font-weight: 400;
  text-wrap: pretty;
}
.t-body p + p { margin-top: 1.05em; }
.t-body p { text-wrap: pretty; max-width: 66ch; }
.t-num { font-variant-numeric: tabular-nums lining-nums; }

.link-u {
  background-image: linear-gradient(currentColor, currentColor);
  background-size: 100% 1px; background-position: 0 100%; background-repeat: no-repeat;
  transition: background-size var(--dur-2) var(--ease-precise);
  padding-bottom: 2px;
}
.link-u:hover { background-size: 0% 1px; background-position: 100% 100%; }

/* ---------- Layout ---------- */
.wrap {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: var(--margin);
}
.grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: var(--gutter);
}
.section { padding-block: var(--section-y); position: relative; }
.section--tight { padding-block: clamp(64px, 8vw, 140px); }

.rule { height: 1px; background: currentColor; opacity: 0.18; border: 0; margin: 0; transform-origin: left center; }

/* ---------- Themes ---------- */
.theme-dark {
  background: var(--navy-900);
  color: #e8ecf2;
  --muted: #a9b4c4;
  --line: rgba(201, 209, 220, 0.18);
  --accent: var(--gold);
}
.theme-deep {
  background: var(--navy-950);
  color: #e8ecf2;
  --muted: #a9b4c4;
  --line: rgba(201, 209, 220, 0.16);
  --accent: var(--gold);
}
.theme-light {
  background: var(--ivory);
  color: var(--ink);
  --muted: var(--ink-soft);
  --line: rgba(10, 22, 48, 0.16);
  --accent: var(--gold-700);
}
.theme-white {
  background: #ffffff;
  color: var(--ink);
  --muted: var(--ink-soft);
  --line: rgba(10, 22, 48, 0.14);
  --accent: var(--gold-700);
}
.theme-silver {
  background: var(--silver-100);
  color: var(--ink);
  --muted: var(--ink-soft);
  --line: rgba(10, 22, 48, 0.16);
  --accent: var(--gold-700);
}
.muted { color: var(--muted); }
.accent { color: var(--accent); }

/* ---------- Utilities ---------- */
.hide-sm { }
@media (max-width: 760px) { .hide-sm { display: none !important; } }
.show-sm { display: none !important; }
@media (max-width: 760px) { .show-sm { display: initial !important; } }
