/* ============================================================
   SHARED BASE + COMPONENTS — used by both sites.
   Loaded after tokens.css. Per-site accent, heading face & overrides
   live in site.css. Palantir-informed: sharp, hairline, mono-annotated.
   ============================================================ */

*,*::before,*::after { box-sizing:border-box; }
html { -webkit-text-size-adjust:100%; scroll-behavior:smooth; }
@media (prefers-reduced-motion: reduce){ html{scroll-behavior:auto;} *{animation:none!important;transition:none!important;} }

body{
  margin:0; background:var(--bg); color:var(--fg);
  font-family:var(--font-body); font-size:var(--step-0); line-height:1.6;
  font-synthesis-weight:none; text-rendering:optimizeLegibility;
  -webkit-font-smoothing:antialiased;
}
img{max-width:100%; height:auto; display:block;}
a{color:inherit;}
:focus-visible{ outline:2.5px solid var(--accent); outline-offset:3px; }
.skip-link{ position:absolute; left:-9999px; top:0; z-index:100;
  background:var(--accent); color:var(--accent-ink); padding:.6rem 1rem;
  font-family:var(--font-mono); font-size:.78rem; letter-spacing:.06em; text-decoration:none; }
.skip-link:focus{ left:0; }

h1,h2,h3,h4{ font-family:var(--font-display); font-weight:600; line-height:1.08;
  letter-spacing:-.01em; color:var(--fg); margin:0 0 .4em; }
h1{font-size:var(--step-4);} h2{font-size:var(--step-3);}
h3{font-size:var(--step-1); font-weight:600;} h4{font-size:var(--step-0);}
p{margin:0 0 1rem; max-width:var(--measure);}

/* --- mono annotation system (the recurring "technical label" layer) --- */
.eyebrow{ font-family:var(--font-mono); font-size:var(--step--1);
  letter-spacing:.15em; text-transform:uppercase; color:var(--accent);
  font-weight:500; margin:0 0 .9rem; }
.mono{ font-family:var(--font-mono); font-size:var(--step--1); letter-spacing:.14em;
  text-transform:uppercase; font-weight:500; }
.coord{ font-family:var(--font-mono); font-size:var(--step--1); letter-spacing:.08em;
  text-transform:none; color:var(--fg-mute); }
.lead{ font-size:var(--step-1); line-height:1.5; color:var(--fg-soft);
  font-family:var(--font-body); font-weight:300; max-width:52ch; }

/* ---------- layout ---------- */
.wrap{ width:min(74rem, 100% - (2 * var(--pad-x))); margin-inline:auto; }
.wrap-narrow{ width:min(46rem, 100% - (2 * var(--pad-x))); margin-inline:auto; }
section{ padding-block:clamp(3.4rem, 8vw, 6rem); }
.divide{ border-top:1px solid var(--border); }

/* ---------- section header with coordinate index ---------- */
.sec-head{ display:flex; align-items:baseline; gap:1.2rem; flex-wrap:wrap;
  margin-bottom:2.4rem; border-bottom:1px solid var(--border-2); padding-bottom:1rem; }
.sec-head .ix{ font-family:var(--font-mono); font-size:var(--step--1); letter-spacing:.12em;
  text-transform:uppercase; color:var(--accent); white-space:nowrap; }
.sec-head h2{ margin:0; }
.sec-intro{ max-width:62ch; color:var(--fg-soft); margin:0 0 2.6rem;
  font-size:var(--step-1); line-height:1.5; font-weight:300; }

/* ---------- header ---------- */
.site-head{ position:sticky; top:0; z-index:50;
  backdrop-filter:saturate(1.4) blur(10px); background:var(--header-bg);
  border-bottom:1px solid var(--border); }
.site-head .bar{ display:flex; align-items:center; gap:1.5rem; min-height:60px; }
.brand{ display:flex; align-items:center; gap:.6rem; text-decoration:none;
  font-family:var(--font-display); font-weight:700; font-size:1.05rem;
  letter-spacing:-.02em; color:var(--fg); }
.brand .mark{ width:10px; height:10px; border-radius:0; background:var(--accent);
  display:inline-block; }
.nav{ margin-left:auto; display:flex; gap:1.5rem; align-items:center; }
.nav a{ text-decoration:none; color:var(--fg-soft); font-family:var(--font-mono);
  font-size:.72rem; letter-spacing:.1em; text-transform:uppercase; font-weight:500; }
.nav a:hover{ color:var(--accent); }
.nav a.cross{ color:var(--fg-mute); }
.nav a.cross:hover{ color:var(--accent); }
.theme-btn{ background:none; border:1px solid var(--border-2); color:var(--fg-soft);
  border-radius:0; width:34px; height:34px; cursor:pointer; font-size:15px;
  display:grid; place-items:center; }
.theme-btn:hover{ color:var(--accent); border-color:var(--accent); }
@media (max-width:660px){
  .nav{ overflow-x:auto; -webkit-overflow-scrolling:touch; scrollbar-width:none; }
  .nav::-webkit-scrollbar{ display:none; }
  .nav a{ white-space:nowrap; }
}

/* ---------- buttons: sharp, mono ---------- */
.btn{ display:inline-flex; align-items:center; gap:.5rem; text-decoration:none;
  font-family:var(--font-mono); font-weight:500; font-size:.78rem; letter-spacing:.06em;
  text-transform:uppercase; padding:.8rem 1.2rem; border-radius:0;
  border:1px solid var(--border-2); transition:background .15s ease, border-color .15s, color .15s; cursor:pointer; }
.btn-primary{ background:var(--accent); color:var(--accent-ink); border-color:var(--accent); }
.btn-primary:hover{ filter:brightness(1.08); }
.btn-ghost{ background:transparent; color:var(--fg); }
.btn-ghost:hover{ border-color:var(--accent); color:var(--accent); }

/* ---------- dark hero (near-black + network motif) ---------- */
.hero{ position:relative; background:var(--black); color:var(--on-black);
  overflow:hidden; border-bottom:1px solid var(--line-dark); }
.hero canvas.net{ position:absolute; inset:0; width:100%; height:100%; display:block; z-index:0; }
.hero .inner{ position:relative; z-index:1;
  padding-block:clamp(4rem,10vw,8rem) clamp(3rem,7vw,6rem); }
.hero h1{ color:#fff; max-width:18ch; }
.hero .eyebrow{ color:var(--on-black-mute); display:flex; gap:.9rem; flex-wrap:wrap; align-items:center; }
.hero .eyebrow b{ color:var(--accent-on-black); font-weight:500; }
.hero .eyebrow .sep{ width:16px; height:1px; background:var(--line-dark-strong); display:inline-block; }
.hero .lead{ color:var(--on-black-soft); max-width:52ch; }
.hero .actions{ display:flex; gap:.7rem; flex-wrap:wrap; margin-top:2.2rem; }
.hero .btn-ghost{ color:var(--on-black); border-color:var(--line-dark-strong); }
.hero .btn-ghost:hover{ border-color:var(--on-black); color:#fff; }
.hero .btn-primary{ background:var(--accent-on-black); color:#06120f; border-color:var(--accent-on-black); }

/* ---------- spec bar (technical metadata strip under hero) ---------- */
.spec{ background:var(--black-2); border-bottom:1px solid var(--line-dark); }
.spec .row{ display:flex; flex-wrap:wrap; gap:0; }
.spec .cell{ padding:.9rem 1.4rem .9rem 0; margin-right:1.4rem; color:var(--on-black-mute);
  font-family:var(--font-mono); font-size:.7rem; letter-spacing:.1em; text-transform:uppercase;
  border-right:1px solid var(--line-dark); white-space:nowrap; }
.spec .cell:last-child{ border-right:none; margin-right:0; }
.spec .cell b{ color:var(--on-black-soft); font-weight:500; }

/* ---------- editorial index (replaces card grids) ---------- */
.index{ border-top:1px solid var(--border-2); }
.row-item{ display:grid; grid-template-columns:3.2rem 1fr; gap:1.4rem;
  padding:1.6rem 0 1.5rem; border-bottom:1px solid var(--border);
  position:relative; transition:background .15s; text-decoration:none; color:inherit; }
.row-item:hover{ background:var(--surface); }
.row-item .n{ font-family:var(--font-mono); font-size:1.05rem; color:var(--fg-mute);
  letter-spacing:.02em; padding-top:.2rem; }
.row-item:hover .n{ color:var(--accent); }
.row-body .tag{ display:inline-flex; align-items:center; gap:.5rem; font-family:var(--font-mono);
  font-size:.68rem; letter-spacing:.12em; text-transform:uppercase; color:var(--fg-mute);
  margin-bottom:.5rem; border:none; padding:0; border-radius:0; }
.row-body .tag .dot{ width:6px; height:6px; background:var(--accent); display:inline-block; }
.row-body .tag .dot.concept{ background:var(--line-strong); }
.row-body h3{ font-weight:600; letter-spacing:-.01em; font-size:var(--step-2);
  margin:0 0 .35rem; line-height:1.1; }
.row-body p{ margin:0; max-width:70ch; color:var(--fg-soft); }
.row-item .arrow{ position:absolute; right:.2rem; top:1.7rem; font-family:var(--font-mono);
  color:var(--line-strong); transition:color .15s, transform .15s; }
.row-item:hover .arrow{ color:var(--accent); transform:translateX(3px); }

/* ---------- cards (kept, now flat + sharp) ---------- */
.grid{ display:grid; gap:1px; background:var(--border); border:1px solid var(--border); }
.grid-3{ grid-template-columns:repeat(auto-fit, minmax(15rem,1fr)); }
.grid-2{ grid-template-columns:repeat(auto-fit, minmax(19rem,1fr)); }
/* exactly three across on desktop (no ragged auto-fit rows); 2 then 1 on smaller screens */
.grid--three{ grid-template-columns:1fr; }
@media (min-width:620px){ .grid--three{ grid-template-columns:repeat(2,1fr); } }
@media (min-width:900px){ .grid--three{ grid-template-columns:repeat(3,1fr); } }
.card{ background:var(--card); border:none; border-radius:0;
  padding:1.6rem 1.5rem 1.7rem; box-shadow:none; }
.card h3{ margin-bottom:.5rem; }
.card .num{ font-family:var(--font-mono); font-size:var(--step--1);
  color:var(--fg-mute); letter-spacing:.1em; }
.card p{ color:var(--fg-soft); margin-bottom:0; font-size:var(--step-0); }

/* pill / tag (standalone, e.g. status labels) */
.tag{ display:inline-block; font-family:var(--font-mono); font-size:.68rem;
  letter-spacing:.12em; text-transform:uppercase; color:var(--fg-mute);
  border:1px solid var(--border); border-radius:0; padding:.25rem .55rem; }

/* ---------- metrics band (sharp boxed grid) ---------- */
.metrics{ display:grid; grid-template-columns:repeat(auto-fit,minmax(11rem,1fr));
  gap:1px; background:var(--border-2); border:1px solid var(--border-2); }
.metric{ background:var(--surface); padding:1.5rem 1.4rem; }
.metric .v{ font-family:var(--font-display); font-weight:700; font-size:var(--step-3);
  letter-spacing:-.02em; line-height:1; color:var(--fg); }
.metric .v small{ font-size:.42em; color:var(--fg-mute); font-family:var(--font-mono);
  font-weight:400; letter-spacing:0; }
.metric .k{ font-family:var(--font-mono); font-size:.7rem; letter-spacing:.06em;
  text-transform:uppercase; color:var(--fg-mute); margin-top:.7rem; line-height:1.4; }

/* ---------- result block ---------- */
.result{ border:1px solid var(--border-2); background:var(--surface); padding:1.8rem; }
.result h3{ font-weight:700; letter-spacing:-.015em; font-size:var(--step-2);
  margin:.4rem 0 .6rem; max-width:26ch; }
.result p{ max-width:66ch; color:var(--fg-soft); margin:0 0 1rem; }
.chart-note, .note{ font-family:var(--font-mono); font-size:.7rem; letter-spacing:.04em;
  color:var(--fg-mute); margin-top:.6rem; }

/* ---------- dark statement band (editorial pace) ---------- */
.statement{ background:var(--black); color:#fff; border-block:1px solid var(--line-dark); }
.statement .inner{ padding-block:clamp(3.6rem,9vw,7rem); }
.statement .mono{ color:var(--accent-on-black); margin-bottom:1.4rem; }
.statement p.big{ font-family:var(--font-display); font-weight:300; font-size:var(--step-3);
  line-height:1.18; letter-spacing:-.02em; max-width:24ch; margin:0; color:#fff; }
.statement p.big b{ font-weight:700; }

/* ---------- cross-site strip ---------- */
.crossref{ background:var(--navy); color:#eef1fb; border-radius:0;
  padding:clamp(1.6rem,4vw,2.4rem); display:flex; gap:1.4rem;
  align-items:center; justify-content:space-between; flex-wrap:wrap; }
.crossref h3{ color:#fff; margin:0 0 .25rem; }
.crossref p{ color:#c7cef0; margin:0; max-width:44ch; }
.crossref .btn-primary{ background:#fff; color:var(--navy); border-color:#fff; }

/* ---------- footer ---------- */
.site-foot{ border-top:1px solid var(--border); padding-block:2.6rem 3rem;
  color:var(--fg-mute); font-size:var(--step--1); }
.site-foot .cols{ display:flex; gap:2.5rem; flex-wrap:wrap; justify-content:space-between; }
.site-foot strong{ font-family:var(--font-mono); font-size:.7rem; letter-spacing:.1em;
  text-transform:uppercase; color:var(--fg-mute); font-weight:500; }
.site-foot a{ color:var(--fg-soft); text-decoration:none; }
.site-foot a:hover{ color:var(--accent); }
.site-foot .legal{ margin-top:1.6rem; padding-top:1.2rem; border-top:1px solid var(--border);
  font-family:var(--font-mono); font-size:.7rem; line-height:1.8; color:var(--fg-mute); }

/* ---------- print (dark chrome flattens to paper; keep every box whole) ---------- */
@media print{
  .site-head,.theme-btn,.hero .actions,.hero canvas.net,.spec{ display:none; }
  body{ background:#fff; color:#000; }
  .hero,.statement{ background:#fff !important; color:#000 !important; border:none; }
  .hero h1,.hero .lead,.statement p.big{ color:#000 !important; }
  .hero .eyebrow,.statement .mono{ color:#333 !important; }
  .card,.crossref,.result,.metrics,.metric,.row-item,.statement,.pub,.tl li,.lecture,.kicker,figure.fig{
    break-inside:avoid; page-break-inside:avoid; }
  tr{ break-inside:avoid; }
  thead{ display:table-header-group; }
  h2,h3{ break-after:avoid; page-break-after:avoid; }
  a{ color:#000 !important; }
}
