/* ============================================================
   TechNewsKB — redesign system
   Display: Space Grotesk · Body: IBM Plex Sans · Code: JetBrains Mono
   ============================================================ */

/* ---- Tokens ---- */
:root {
  /* fonts (overridable by [data-fonts]) */
  --font-display: "Space Grotesk", system-ui, sans-serif;
  --font-body: "IBM Plex Sans", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, monospace;

  /* accent (overridable by [data-accent] / tweak) */
  --accent: #2563eb;
  --accent-ink: #ffffff;
  --accent-soft: color-mix(in srgb, var(--accent) 12%, transparent);
  --accent-line: color-mix(in srgb, var(--accent) 30%, transparent);

  /* trust / verified (E-E-A-T signals) */
  --trust: #0d9d6e;
  --trust-soft: color-mix(in srgb, var(--trust) 13%, transparent);
  --trust-line: color-mix(in srgb, var(--trust) 32%, transparent);
  /* AI / generative-engine accent */
  --ai: #7c5cff;
  --ai-soft: color-mix(in srgb, var(--ai) 13%, transparent);
  --ai-line: color-mix(in srgb, var(--ai) 32%, transparent);

  /* neutrals — light */
  --bg: #f5f8fc;
  --surface: #ffffff;
  --surface-2: #eef3f9;
  --border: #e2e9f2;
  --border-strong: #d3dce8;
  --text: #0e1a2b;
  --text-2: #51617a;
  --text-3: #8493a8;
  --navy: #0a1322;
  --navy-2: #111d31;
  --on-navy: #e9eef7;
  --on-navy-2: #97a6bf;

  /* shadow (tweakable) */
  --shadow-hsl: 218 45% 18%;
  --shadow-strength: 0.08;
  --sh-sm: 0 1px 2px hsl(var(--shadow-hsl) / calc(var(--shadow-strength) * 1));
  --sh-md: 0 6px 18px hsl(var(--shadow-hsl) / calc(var(--shadow-strength) * 1.4)),
           0 1px 3px hsl(var(--shadow-hsl) / calc(var(--shadow-strength) * 1));
  --sh-lg: 0 18px 50px hsl(var(--shadow-hsl) / calc(var(--shadow-strength) * 1.6)),
           0 4px 12px hsl(var(--shadow-hsl) / calc(var(--shadow-strength) * 1));

  /* shape & rhythm (tweakable) */
  --radius: 14px;
  --radius-sm: calc(var(--radius) * 0.55);
  --radius-pill: 999px;
  --density: 1;
  --gutter: clamp(20px, 4vw, 56px);
  --maxw: 1240px;

  --t: 180ms cubic-bezier(.3,.7,.4,1);
}

/* Suppress transitions during a theme/tweak swap so var-driven backgrounds
   repaint instantly instead of getting stuck mid-transition. */
.theme-switching, .theme-switching *, .theme-switching *::before, .theme-switching *::after {
  transition: none !important;
}

[data-theme="dark"] {
  --bg: #070b14;
  --surface: #0f1726;
  --surface-2: #15203200;
  --surface-2: #141d2e;
  --border: #1f2a3d;
  --border-strong: #2a384e;
  --text: #eaf0fa;
  --text-2: #9fb0c8;
  --text-3: #67788f;
  --navy: #0b1322;
  --navy-2: #0f1a2d;
  --on-navy: #e9eef7;
  --on-navy-2: #97a6bf;
  --shadow-hsl: 220 60% 2%;
  --shadow-strength: 0.5;
  --accent-soft: color-mix(in srgb, var(--accent) 18%, transparent);
  --accent-line: color-mix(in srgb, var(--accent) 45%, transparent);
  --trust: #2bd49b;
  --trust-soft: color-mix(in srgb, var(--trust) 16%, transparent);
  --trust-line: color-mix(in srgb, var(--trust) 38%, transparent);
  --ai: #9d86ff;
  --ai-soft: color-mix(in srgb, var(--ai) 18%, transparent);
  --ai-line: color-mix(in srgb, var(--ai) 40%, transparent);
}

/* ---- Font pairings ---- */
[data-fonts="archivo"]  { --font-display: "Archivo", system-ui, sans-serif; }
[data-fonts="sora"]     { --font-display: "Sora", system-ui, sans-serif; --font-body: "Sora", system-ui, sans-serif; }
[data-fonts="editorial"]{ --font-display: "Newsreader", Georgia, serif; }

/* ---- Density ---- */
[data-density="compact"] { --density: 0.82; }
[data-density="comfy"]   { --density: 1.18; }

/* ---- Reset ---- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; overflow-x: clip; }
body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  overflow-x: clip;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; }
h1,.h1,h2,.h2,h3,.h3,h4,.h4 { font-family: var(--font-display); font-weight: 600; line-height: 1.08; letter-spacing: -.02em; color: var(--text); }
::selection { background: var(--accent); color: var(--accent-ink); }


.wrap { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: var(--gutter); }
.section { padding-block: calc(58px * var(--density)); }

/* ---- Generic bits ---- */
.eyebrow {
  font-family: var(--font-mono);
  font-size: 11px; letter-spacing: .16em; text-transform: uppercase;
  color: var(--text-3); font-weight: 500;
}
.cat-badge {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--font-mono); font-size: 11px; font-weight: 500;
  letter-spacing: .08em; text-transform: uppercase;
  color: var(--accent);
  background: var(--accent-soft);
  padding: 5px 10px; border-radius: var(--radius-pill);
  border: 1px solid var(--accent-line);
}
.cat-badge::before { content:""; width: 5px; height: 5px; border-radius: 50%; background: var(--accent); }
.cat-badge.muted { color: var(--text-2); background: var(--surface-2); border-color: var(--border); }
.cat-badge.muted::before { background: var(--text-3); }

.meta {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  font-size: 13px; color: var(--text-3);
}
.meta .dot { width: 3px; height: 3px; border-radius: 50%; background: currentColor; opacity: .5; }
.meta strong { color: var(--text-2); font-weight: 600; }

.btn {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--font-display); font-weight: 500; font-size: 14px;
  padding: 11px 18px; border-radius: var(--radius-pill);
  border: 1px solid transparent; transition: var(--t);
  white-space: nowrap;
}
.btn-primary { background: var(--accent); color: var(--accent-ink); box-shadow: var(--sh-sm); }
.btn-primary:hover { filter: brightness(1.06); transform: translateY(-1px); box-shadow: var(--sh-md); }
.btn-ghost { background: var(--surface); border-color: var(--border-strong); color: var(--text); }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }
.btn .arr { transition: transform var(--t); }
.btn:hover .arr { transform: translateX(3px); }

/* ---- Image placeholders ---- */
.ph {
  position: relative; overflow: hidden;
  container-type: size;
  display: grid; place-items: center;
  background:
    radial-gradient(130% 130% at 0% 0%, color-mix(in srgb, var(--accent) 15%, var(--surface)), transparent 60%),
    radial-gradient(130% 130% at 100% 100%, color-mix(in srgb, var(--accent) 9%, var(--surface)), transparent 55%),
    var(--surface);
  border: 1px solid var(--border);
}
/* soft dot field */
.ph .ph-glyph,
.ph::before {
  content: ""; grid-area: 1 / 1; align-self: stretch; justify-self: stretch;
  background-image: radial-gradient(color-mix(in srgb, var(--accent) 16%, transparent) 1px, transparent 1.5px);
  background-size: 17px 17px; opacity: .5; pointer-events: none;
  position: static; inset: auto; color: transparent;
}
/* centered brand tile + monogram — scales to any card, no image needed */
.ph::after {
  content: "T"; grid-area: 1 / 1; place-self: center; z-index: 1;
  display: grid; place-items: center;
  width: clamp(30px, 30cqmin, 104px); aspect-ratio: 1; border-radius: 24%;
  background: linear-gradient(145deg, var(--accent), color-mix(in srgb, var(--accent) 52%, #000));
  box-shadow: 0 10px 24px color-mix(in srgb, var(--accent) 30%, transparent);
  font-family: var(--font-display); font-weight: 700; color: #fff; line-height: 1;
  font-size: clamp(16px, 16cqmin, 54px);
  /* neutralize old label styles */
  left: auto; bottom: auto; border: 0; padding: 0;
  -webkit-backdrop-filter: none; backdrop-filter: none; letter-spacing: 0;
}
.ph .ph-glyph svg { display: none; }

/* ============================================================
   HEADER
   ============================================================ */
.topbar {
  background: var(--navy);
  color: var(--on-navy-2);
  font-size: 12.5px;
}
.topbar .wrap { display: flex; align-items: center; justify-content: space-between; height: 38px; }
.topbar .date { font-family: var(--font-mono); letter-spacing: .04em; }
.topbar nav { display: flex; gap: 18px; align-items: center; }
.topbar a:hover { color: #fff; }
.topbar .live { display: inline-flex; align-items: center; gap: 7px; color: var(--on-navy); }
.topbar .live i { width: 7px; height: 7px; border-radius: 50%; background: #34d27b; box-shadow: 0 0 0 0 #34d27b88; animation: pulse 2s infinite; }
@keyframes pulse { 0%{box-shadow:0 0 0 0 #34d27b66} 70%{box-shadow:0 0 0 7px #34d27b00} 100%{box-shadow:0 0 0 0 #34d27b00} }

.header {
  position: sticky; top: 0; z-index: 60;
  background: color-mix(in srgb, var(--surface) 86%, transparent);
  -webkit-backdrop-filter: saturate(180%) blur(14px); backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--border);
  transition: var(--t);
}
.header .wrap { display: flex; align-items: center; gap: 26px; height: 70px; }
.logo { display: flex; align-items: center; gap: 11px; font-family: var(--font-display); font-weight: 700; font-size: 20px; letter-spacing: -.02em; }
.logo .mark {
  width: 34px; height: 34px; border-radius: 9px; flex: none;
  background: linear-gradient(140deg, var(--accent), color-mix(in srgb, var(--accent) 55%, #000));
  display: grid; place-items: center; color: #fff;
  font-family: var(--font-mono); font-weight: 700; font-size: 15px;
  box-shadow: var(--sh-sm);
}
.logo .kb { color: var(--accent); }
.mainnav { display: flex; gap: 3px; margin-inline-start: 6px; }
.mainnav a {
  font-family: var(--font-display); font-weight: 500; font-size: 14.5px;
  padding: 9px 13px; border-radius: 9px; color: var(--text-2);
  transition: var(--t); position: relative;
}
.mainnav a:hover { color: var(--text); background: var(--surface-2); }
.mainnav a.active { color: var(--accent); }
.header .right { margin-inline-start: auto; display: flex; align-items: center; gap: 8px; }
.icon-btn {
  width: 40px; height: 40px; border-radius: 10px; flex: none;
  display: grid; place-items: center; background: transparent;
  border: 1px solid transparent; color: var(--text-2); transition: var(--t);
}
.icon-btn:hover { background: var(--surface-2); color: var(--text); }
.icon-btn svg { width: 19px; height: 19px; }

/* ---- Ticker ---- */
.ticker {
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  overflow: hidden;
}
.ticker .wrap { display: flex; align-items: center; gap: 18px; height: 44px; }
.ticker .tag {
  font-family: var(--font-mono); font-size: 11px; font-weight: 600; letter-spacing: .12em;
  color: var(--accent-ink); background: var(--accent); padding: 4px 10px; border-radius: 6px;
  flex: none; text-transform: uppercase;
}
.ticker .track { position: relative; flex: 1; overflow: hidden; height: 100%; mask-image: linear-gradient(90deg, transparent, #000 4%, #000 92%, transparent); }
.ticker .run { display: flex; gap: 42px; align-items: center; height: 100%; white-space: nowrap; animation: scrollx 34s linear infinite; }
.ticker:hover .run { animation-play-state: paused; }
.ticker .item { display: inline-flex; align-items: center; gap: 10px; font-size: 13.5px; color: var(--text-2); }
.ticker .item:hover { color: var(--text); }
.ticker .item b { color: var(--accent); font-family: var(--font-mono); font-size: 11px; }
@keyframes scrollx { from { transform: translateX(0); } to { transform: translateX(-50%); } }

/* ============================================================
   HERO
   ============================================================ */
.hero { padding-top: calc(40px * var(--density)); }
.hero-grid { display: grid; grid-template-columns: 1.55fr 1fr; gap: 22px; }
.hero-side { display: grid; grid-template-rows: 1fr 1fr; gap: 22px; }

.feature {
  position: relative; border-radius: var(--radius); overflow: hidden;
  background: var(--surface); border: 1.5px solid color-mix(in srgb, var(--accent) 26%, var(--border)); box-shadow: var(--sh-md);
  display: flex; flex-direction: column;
}
.feature:hover { border-color: var(--accent); box-shadow: 0 16px 40px color-mix(in srgb, var(--accent) 20%, transparent), var(--sh-md); }
.feature .ph { aspect-ratio: 16 / 9; border: 0; border-bottom: 1px solid var(--border); }
.feature .body { padding: clamp(20px, 2.4vw, 30px); display: flex; flex-direction: column; gap: 14px; flex: 1; }
.feature h2 { font-size: clamp(26px, 3vw, 40px); }
.feature .h2 { font-size: clamp(26px, 3vw, 40px); }
.feature .dek { color: var(--text-2); font-size: 16px; max-width: 56ch; }
.feature .meta { margin-top: auto; }
.feature.lg h2 a:hover, .card h3 a:hover, .mini a:hover { color: var(--accent); }

.card {
  display: flex; flex-direction: column;
  border-radius: var(--radius); overflow: hidden;
  background: linear-gradient(180deg, var(--surface), color-mix(in srgb, var(--accent) 4%, var(--surface)));
  border: 1.5px solid color-mix(in srgb, var(--accent) 22%, var(--border));
  transition: var(--t);
}
.card:hover { border-color: var(--accent); box-shadow: 0 10px 26px color-mix(in srgb, var(--accent) 20%, transparent), var(--sh-sm); transform: translateY(-3px); }
.card .ph { aspect-ratio: 16 / 9; border: 0; border-bottom: 1.5px solid color-mix(in srgb, var(--accent) 18%, var(--border)); }
.card .body { padding: 16px 17px 18px; display: flex; flex-direction: column; gap: 9px; flex: 1; }
.card h3 { font-size: 17.5px; line-height: 1.22; }
.card .h3 { font-size: 17.5px; line-height: 1.22; }
.card .meta { margin-top: auto; font-size: 12.5px; }

/* horizontal small card for hero side */
.hcard { display: grid; grid-template-columns: 132px 1fr; background: linear-gradient(180deg, var(--surface), color-mix(in srgb, var(--accent) 4%, var(--surface))); border: 1.5px solid color-mix(in srgb, var(--accent) 22%, var(--border)); border-radius: var(--radius); overflow: hidden; transition: var(--t); }
.hcard:hover { border-color: var(--accent); box-shadow: 0 10px 26px color-mix(in srgb, var(--accent) 18%, transparent), var(--sh-sm); transform: translateY(-2px); }
.hcard .ph { border: 0; border-right: 1.5px solid color-mix(in srgb, var(--accent) 18%, var(--border)); height: 100%; }
.hcard .body { padding: 15px 16px; display: flex; flex-direction: column; gap: 8px; }
.hcard h3 { font-size: 16px; line-height: 1.2; }
.hcard .h3 { font-size: 16px; line-height: 1.2; }

/* ---- hero numbered "Latest posts" panel ---- */
.hero-side { display: block; }
.latest-panel {
  height: 100%; display: flex; flex-direction: column;
  background: linear-gradient(180deg, var(--surface), color-mix(in srgb, var(--accent) 4%, var(--surface)));
  border: 1.5px solid color-mix(in srgb, var(--accent) 22%, var(--border));
  border-radius: var(--radius); padding: 8px clamp(16px, 1.6vw, 22px) 10px;
  box-shadow: var(--sh-sm);
}
.lp-head {
  display: flex; align-items: center; gap: 11px;
  font-family: var(--font-display); font-weight: 600; font-size: 16px;
  padding: 16px 0 12px; color: var(--text);
}
.lp-head .bar { width: 4px; height: 1.05em; border-radius: 3px; background: var(--accent); }
.lp-item {
  display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 15px;
  padding: 14px 0; border-top: 1px solid var(--border);
  flex: 1; min-height: 0;
}
.lp-num {
  font-family: var(--font-display); font-weight: 700; font-size: 26px; line-height: 1;
  color: color-mix(in srgb, var(--accent) 38%, var(--text-3));
  font-variant-numeric: tabular-nums; min-width: 1.4em; transition: var(--t);
}
.lp-item:hover .lp-num { color: var(--accent); }
.lp-body { display: flex; flex-direction: column; gap: 7px; min-width: 0; }
.lp-title {
  font-family: var(--font-display); font-weight: 600; font-size: 15.5px; line-height: 1.25;
  color: var(--text); transition: var(--t);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.lp-item:hover .lp-title { color: var(--accent); }
.lp-meta { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--text-3); }

/* ---- section heads ---- */
.shead { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 26px; }
.shead .t { display: flex; flex-direction: column; gap: 9px; }
.shead h2, .shead .h2 { font-size: clamp(22px, 2.6vw, 30px); display: flex; align-items: center; gap: 12px; }
.shead h2 .bar, .shead .h2 .bar { width: 4px; height: 1.05em; border-radius: 3px; background: var(--accent); display: inline-block; }
.shead .link { display: inline-flex; align-items: center; gap: 7px; font-family: var(--font-display); font-weight: 500; font-size: 14px; color: var(--text-2); transition: var(--t); }
.shead .link:hover { color: var(--accent); }
.shead .link .arr { transition: transform var(--t); }
.shead .link:hover .arr { transform: translateX(3px); }

/* ---- categories ---- */
.cat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.cat-tile {
  display: flex; align-items: center; gap: 14px; padding: 16px 17px;
  background: linear-gradient(180deg, var(--surface), color-mix(in srgb, var(--accent) 4%, var(--surface))); border: 1.5px solid color-mix(in srgb, var(--accent) 22%, var(--border)); border-radius: var(--radius);
  transition: var(--t);
}
.cat-tile:hover { border-color: var(--accent); transform: translateY(-2px); box-shadow: 0 10px 26px color-mix(in srgb, var(--accent) 18%, transparent), var(--sh-sm); }
.cat-tile .ic {
  width: 46px; height: 46px; flex: none; border-radius: 12px; display: grid; place-items: center;
  background: var(--accent-soft); color: var(--accent); border: 1px solid var(--accent-line);
}
.cat-tile .ic svg { width: 22px; height: 22px; }
.cat-tile .nm { font-family: var(--font-display); font-weight: 600; font-size: 15.5px; }
.cat-tile .ct { font-family: var(--font-mono); font-size: 11.5px; color: var(--text-3); margin-top: 2px; }
.cat-tile .go { margin-left: auto; color: var(--text-3); transition: var(--t); }
.cat-tile:hover .go { color: var(--accent); transform: translateX(2px); }

/* ---- latest grid ---- */
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }

/* ---- trending ---- */
.trend-rail { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(300px, 1fr); gap: 18px; overflow-x: auto; padding-bottom: 8px; scroll-snap-type: x mandatory; scrollbar-width: thin; }
.trend-card { scroll-snap-align: start; position: relative; display: grid; grid-template-columns: auto 1fr; gap: 16px; padding: 18px; background: linear-gradient(180deg, var(--surface), color-mix(in srgb, var(--accent) 4%, var(--surface))); border: 1.5px solid color-mix(in srgb, var(--accent) 22%, var(--border)); border-radius: var(--radius); transition: var(--t); }
.trend-card:hover { border-color: var(--accent); box-shadow: 0 10px 26px color-mix(in srgb, var(--accent) 18%, transparent), var(--sh-sm); transform: translateY(-2px); }
.trend-card .num { font-family: var(--font-display); font-weight: 700; font-size: 34px; line-height: 1; color: color-mix(in srgb, var(--accent) 32%, var(--text-3)); -webkit-text-stroke: 0; }
.trend-card .body { display: flex; flex-direction: column; gap: 8px; }
.trend-card h3, .trend-card .h3 { font-size: 16.5px; line-height: 1.22; }


/* ---- AI dark section ---- */
.darksec { background: var(--navy); color: var(--on-navy); position: relative; overflow: hidden; }
.darksec::before { content:""; position: absolute; inset: 0; background: radial-gradient(900px 400px at 88% -10%, color-mix(in srgb, var(--accent) 40%, transparent), transparent 60%); opacity: .5; }
.darksec .wrap { position: relative; }
.darksec h2, .darksec h3 { color: #fff; }
.darksec .shead .link { color: var(--on-navy-2); }
.darksec .shead .link:hover { color: #fff; }
.darksec .eyebrow { color: var(--on-navy-2); }
.dk-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 20px; }
.dk-card { display: flex; flex-direction: column; gap: 12px; padding: 22px; border-radius: var(--radius); background: var(--navy-2); border: 1.5px solid color-mix(in srgb, var(--accent) 30%, #20304a); transition: var(--t); }
.dk-card:hover { border-color: var(--accent); transform: translateY(-3px); box-shadow: 0 14px 34px color-mix(in srgb, var(--accent) 24%, transparent); }
.dk-card.big { padding: 0; overflow: hidden; }
.dk-card.big .ph { aspect-ratio: 16/10; border: 0; background:
    radial-gradient(130% 130% at 0% 0%, color-mix(in srgb, var(--accent) 26%, var(--navy-2)), transparent 60%),
    radial-gradient(130% 130% at 100% 100%, color-mix(in srgb, var(--accent) 14%, var(--navy-2)), transparent 55%),
    var(--navy-2); }
.dk-card.big .ph::before { background-image: radial-gradient(color-mix(in srgb, var(--accent) 26%, transparent) 1px, transparent 1.5px); opacity: .4; }
.dk-card.big .body { padding: 22px; display: flex; flex-direction: column; gap: 12px; }
.dk-card h3 { font-size: 19px; }
.dk-card .dek { color: var(--on-navy-2); font-size: 14px; }
.dk-card .meta { color: var(--on-navy-2); }
.dk-card .meta strong { color: var(--on-navy); }
.dk-card .cat-badge { background: color-mix(in srgb, var(--accent) 22%, transparent); color: #cfe0ff; border-color: var(--accent-line); }

/* ---- newsletter band ---- */
.cta-band { background: var(--surface); border: 1px solid var(--border); border-radius: calc(var(--radius) * 1.4); padding: clamp(26px, 4vw, 48px); display: grid; grid-template-columns: 1.2fr 1fr; gap: 32px; align-items: center; box-shadow: var(--sh-md); position: relative; overflow: hidden; }
.cta-band::before { content:""; position: absolute; right: -60px; top: -60px; width: 280px; height: 280px; border-radius: 50%; background: var(--accent-soft); }
.cta-band .l { position: relative; }
.cta-band h2 { font-size: clamp(24px, 3vw, 34px); margin-bottom: 12px; }
.cta-band p { color: var(--text-2); max-width: 46ch; }
.cta-form { position: relative; display: flex; flex-direction: column; gap: 12px; }
.cta-form .field { display: flex; gap: 10px; }
.cta-input { flex: 1; padding: 13px 16px; border-radius: var(--radius-pill); border: 1px solid var(--border-strong); background: var(--bg); color: var(--text); font: inherit; font-size: 14px; outline: none; transition: var(--t); }
.cta-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.cta-note { font-size: 12px; color: var(--text-3); display: flex; align-items: center; gap: 7px; }

/* ============================================================
   FOOTER
   ============================================================ */
.footer { background: var(--navy); color: var(--on-navy-2); margin-top: 20px; }
.footer .top { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1.4fr; gap: 36px; padding-block: 54px; border-bottom: 1px solid #1c2940; }
.footer h4 { color: #fff; font-size: 13px; font-family: var(--font-mono); font-weight: 500; letter-spacing: .1em; text-transform: uppercase; margin-bottom: 18px; }
.footer .logo { color: #fff; margin-bottom: 14px; }
.footer p { font-size: 14px; line-height: 1.6; max-width: 38ch; }
.footer ul { list-style: none; padding: 0; display: flex; flex-direction: column; gap: 11px; }
.footer ul a { font-size: 14px; transition: var(--t); }
.footer ul a:hover { color: #fff; }
.footer .socials { display: flex; gap: 10px; margin-top: 20px; }
.footer .socials a { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; border: 1px solid #21304a; color: var(--on-navy-2); transition: var(--t); }
.footer .socials a:hover { background: var(--accent); border-color: var(--accent); color: #fff; }
.footer .socials svg { width: 17px; height: 17px; }
.footer .bottom { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-block: 22px; font-size: 13px; flex-wrap: wrap; }
.footer .bottom nav { display: flex; gap: 18px; }
.footer .bottom a:hover { color: #fff; }
.footer .fnews { display: flex; gap: 8px; }
.footer .fnews input { flex: 1; padding: 11px 14px; border-radius: 9px; border: 1px solid #21304a; background: #0c1626; color: #fff; font: inherit; font-size: 13px; outline: none; }
.footer .fnews input:focus { border-color: var(--accent); }
.footer .fnews button { padding: 11px 14px; border-radius: 9px; background: var(--accent); color: #fff; border: 0; font-family: var(--font-display); font-weight: 500; }

/* ============================================================
   ARTICLE PAGE
   ============================================================ */
.progress { position: fixed; top: 0; left: 0; height: 3px; width: 0; background: var(--accent); z-index: 100; transition: width 60ms linear; }
.crumbs { display: flex; align-items: center; gap: 9px; font-size: 13px; color: var(--text-3); font-family: var(--font-mono); }
.crumbs a:hover { color: var(--accent); }
.crumbs .sep { opacity: .5; }

.art-head { padding-top: calc(34px * var(--density)); }
.art-head h1 { font-size: clamp(30px, 4.6vw, 54px); margin: 18px 0 16px; max-width: none; text-wrap: balance; }
.art-head .dek { font-size: clamp(17px, 2vw, 21px); color: var(--text-2); max-width: 62ch; line-height: 1.45; }
.byline { display: flex; align-items: center; gap: 16px; margin-top: 26px; flex-wrap: wrap; }
.byline .who { display: flex; align-items: center; gap: 12px; }
.byline .avatar { width: 46px; height: 46px; border-radius: 50%; flex: none;
  display: grid; place-items: center; color: #fff; font-family: var(--font-display); font-weight: 700; font-size: 17px;
  background: linear-gradient(145deg, var(--accent), color-mix(in srgb, var(--accent) 52%, #000));
  border: 0; box-shadow: var(--sh-sm); }
.byline .avatar::after { content: "A"; }
.byline .nm { font-family: var(--font-display); font-weight: 600; font-size: 15px; color: var(--text); }
.byline .sub { font-size: 12.5px; color: var(--text-3); }
.byline .share { margin-left: auto; display: flex; gap: 8px; }

.art-hero-img { aspect-ratio: 21 / 9; border-radius: var(--radius); margin-top: 30px; }

.art-layout { display: grid; grid-template-columns: minmax(0,1fr) 320px; gap: 56px; align-items: start; padding-top: calc(40px * var(--density)); }

/* prose */
.prose { font-size: 17.5px; line-height: 1.75; color: var(--text); max-width: 70ch; }
.prose > * + * { margin-top: 1.35em; }
.prose h2 { font-size: 27px; margin-top: 1.8em; scroll-margin-top: 90px; }
.prose h3 { font-size: 21px; margin-top: 1.6em; scroll-margin-top: 90px; }
.prose p { color: var(--text); }
.prose a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1.5px; text-decoration-color: var(--accent-line); }
.prose a:hover { text-decoration-color: var(--accent); }
.prose strong { font-weight: 600; }
.prose ul, .prose ol { padding-left: 1.3em; display: flex; flex-direction: column; gap: .55em; }
.prose li::marker { color: var(--accent); }
.prose img, .prose .ph { border-radius: var(--radius); }
.prose figure { margin-block: 1.8em; }
.prose figcaption { font-size: 13px; color: var(--text-3); margin-top: 10px; font-family: var(--font-mono); }

.callout { display: grid; grid-template-columns: auto 1fr; gap: 15px; padding: 18px 20px; border-radius: var(--radius); background: var(--accent-soft); border: 1px solid var(--accent-line); }
.callout .ic { width: 30px; height: 30px; border-radius: 8px; background: var(--accent); color: #fff; display: grid; place-items: center; flex: none; }
.callout .ic svg { width: 17px; height: 17px; }
.callout b { font-family: var(--font-display); display: block; margin-bottom: 3px; color: var(--text); }
.callout p { font-size: 15px; color: var(--text-2); margin: 0; }

.prose blockquote { border-left: 3px solid var(--accent); padding: 6px 0 6px 22px; font-family: var(--font-display); font-size: 22px; line-height: 1.4; color: var(--text); font-weight: 500; }

/* code block */
.codeblock { border-radius: var(--radius); overflow: hidden; border: 1px solid var(--border-strong); background: #0c1422; box-shadow: var(--sh-sm); }
.codeblock .bar { display: flex; align-items: center; gap: 8px; padding: 10px 14px; background: #0a1120; border-bottom: 1px solid #1c2940; }
.codeblock .bar .dots { display: flex; gap: 6px; }
.codeblock .bar .dots i { width: 11px; height: 11px; border-radius: 50%; background: #2a3850; }
.codeblock .bar .nm { font-family: var(--font-mono); font-size: 12px; color: #7d8ba6; margin-left: 6px; }
.codeblock .bar .copy { margin-left: auto; font-family: var(--font-mono); font-size: 11px; color: #7d8ba6; background: #131d30; border: 1px solid #243450; padding: 4px 9px; border-radius: 6px; transition: var(--t); }
.codeblock .bar .copy:hover { color: #fff; border-color: var(--accent); }
.codeblock pre { margin: 0; padding: 18px 18px; overflow-x: auto; }
.codeblock code { font-family: var(--font-mono); font-size: 13.5px; line-height: 1.7; color: #c9d6ea; white-space: pre; }
.codeblock .c-key { color: #7aa2ff; }
.codeblock .c-str { color: #7ee0a8; }
.codeblock .c-com { color: #5b6b86; font-style: italic; }
.codeblock .c-num { color: #f0a868; }

/* sidebar */
.aside { position: sticky; top: 90px; display: flex; flex-direction: column; gap: 22px; }
.widget { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; }
.widget h4 { font-family: var(--font-mono); font-size: 11.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--text-3); margin-bottom: 16px; font-weight: 500; }
.toc { display: flex; flex-direction: column; gap: 2px; }
.toc a { font-size: 14.5px; color: var(--text-2); padding: 8px 12px; border-radius: 8px; border-left: 2px solid transparent; transition: var(--t); line-height: 1.3; }
.toc a:hover { background: var(--surface-2); color: var(--text); }
.toc a.active { color: var(--accent); border-left-color: var(--accent); background: var(--accent-soft); font-weight: 500; }

.author-card { display: flex; flex-direction: column; gap: 12px; align-items: flex-start; }
.author-card .row { display: flex; align-items: center; gap: 12px; }
.author-card .avatar { width: 52px; height: 52px; border-radius: 50%; flex: none;
  display: grid; place-items: center; color: #fff; font-family: var(--font-display); font-weight: 700; font-size: 19px;
  background: linear-gradient(145deg, var(--accent), color-mix(in srgb, var(--accent) 52%, #000)); border: 0; box-shadow: var(--sh-sm); }
.author-card .avatar::after { content: "A"; }
.author-card .nm { font-family: var(--font-display); font-weight: 600; font-size: 16px; }
.author-card .role { font-size: 12.5px; color: var(--text-3); }
.author-card p { font-size: 14px; color: var(--text-2); line-height: 1.6; }

.pop { display: flex; flex-direction: column; gap: 14px; }
.pop a { display: grid; grid-template-columns: 56px 1fr; gap: 12px; align-items: center; }
.pop .ph { aspect-ratio: 1; border-radius: 9px; }
.pop .pt { font-family: var(--font-display); font-weight: 500; font-size: 14px; line-height: 1.25; transition: var(--t); }
.pop a:hover .pt { color: var(--accent); }
.pop .pm { font-family: var(--font-mono); font-size: 11px; color: var(--text-3); margin-top: 4px; }

.tags { display: flex; flex-wrap: wrap; gap: 8px; }
.tag { font-size: 12.5px; font-family: var(--font-mono); color: var(--text-2); background: var(--surface-2); border: 1px solid var(--border); padding: 6px 11px; border-radius: var(--radius-pill); transition: var(--t); }
.tag:hover { border-color: var(--accent); color: var(--accent); }

.w-news .cta-input { width: 100%; margin-bottom: 10px; background: var(--bg); }
.w-news p { font-size: 13.5px; color: var(--text-2); margin-bottom: 14px; line-height: 1.5; }
.w-news .btn { width: 100%; justify-content: center; }

/* ---- ad slot ---- */
.w-ad { padding: 0; overflow: hidden; }
.w-ad .ad-label { font-family: var(--font-mono); font-size: 10px; letter-spacing: .14em; text-transform: uppercase; color: var(--text-3); text-align: center; padding: 8px 0 0; }
.ad-slot {
  position: relative; margin: 8px; border-radius: var(--radius-sm);
  display: grid; place-items: center; text-align: center; gap: 6px; padding: 28px 18px;
  min-height: 240px;
  color: var(--text-3);
  border: 1px dashed var(--border-strong);
  background:
    repeating-linear-gradient(135deg,
      color-mix(in srgb, var(--accent) 6%, transparent) 0 2px,
      transparent 2px 11px),
    var(--surface-2);
}
.ad-slot .ic { width: 34px; height: 34px; color: color-mix(in srgb, var(--accent) 40%, var(--text-3)); }
.ad-slot .ic svg { width: 100%; height: 100%; }
.ad-slot .t { font-family: var(--font-display); font-weight: 600; font-size: 14px; color: var(--text-2); }
.ad-slot .d { font-size: 12px; }
.ad-slot .dims { font-family: var(--font-mono); font-size: 10.5px; color: var(--text-3); }

/* share buttons */
.sbtn { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; border: 1px solid var(--border-strong); color: var(--text-2); background: var(--surface); transition: var(--t); }
.sbtn:hover { border-color: var(--accent); color: var(--accent); transform: translateY(-2px); }
.sbtn svg { width: 16px; height: 16px; }

/* comments */
.comments { border-top: 1px solid var(--border); margin-top: 56px; padding-top: 40px; }
.comment-form { display: flex; flex-direction: column; gap: 12px; max-width: 70ch; margin-bottom: 36px; }
.comment-form textarea { padding: 14px 16px; border-radius: var(--radius); border: 1px solid var(--border-strong); background: var(--surface); color: var(--text); font: inherit; font-size: 14.5px; resize: vertical; min-height: 90px; outline: none; transition: var(--t); }
.comment-form textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.comment-note { display: flex; align-items: flex-start; gap: 11px; max-width: 70ch; margin: -22px 0 30px; padding: 14px 16px; border-radius: var(--radius); background: var(--trust-soft); border: 1px solid var(--trust-line); color: var(--text); font-size: 14px; line-height: 1.5; }
.comment-note svg { width: 19px; height: 19px; flex: none; color: var(--trust); margin-top: 1px; }
.comment-note b { font-weight: 600; }
.mod-hint { display: inline-flex; align-items: center; gap: 6px; font-family: var(--font-mono); font-size: 11px; letter-spacing: .03em; color: var(--text-3); font-weight: 400; margin-left: 4px; }
.mod-hint svg { width: 13px; height: 13px; }
.comment {
  display: grid; grid-template-columns: auto 1fr; gap: 15px;
  padding: 18px 20px; max-width: 70ch;
  border-radius: var(--radius); margin-bottom: 14px;
  background: linear-gradient(180deg, var(--surface), color-mix(in srgb, var(--cmt) 4%, var(--surface)));
  border: 1.5px solid color-mix(in srgb, var(--cmt) 40%, var(--border));
  position: relative; transition: var(--t);
  --cmt: var(--accent);
}
.comment:hover { border-color: var(--cmt); box-shadow: var(--sh-sm); }
.comment .avatar {
  width: 44px; height: 44px; border-radius: 50%; flex: none;
  display: grid; place-items: center;
  font-family: var(--font-display); font-weight: 700; font-size: 16px; color: #fff;
  background: linear-gradient(145deg, var(--cmt), color-mix(in srgb, var(--cmt) 55%, #000));
  border: 0; box-shadow: var(--sh-sm);
}
/* color variants so cards + avatars share a hue */
.comment:nth-child(3n) { --cmt: var(--trust); }
.comment:nth-child(3n+1) { --cmt: var(--ai); }
.comment .nm { font-family: var(--font-display); font-weight: 600; font-size: 14.5px; }
.comment .when { font-size: 12px; color: var(--text-3); font-family: var(--font-mono); }
.comment p { font-size: 14.5px; color: var(--text); margin-top: 7px; line-height: 1.6; }
.comment .react { display: flex; gap: 9px; margin-top: 12px; font-size: 12.5px; }
.comment .react span {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 5px 11px; border-radius: var(--radius-pill);
  background: var(--surface-2); border: 1px solid var(--border);
  color: var(--text-2); font-family: var(--font-display); font-weight: 500;
  cursor: pointer; transition: var(--t); user-select: none;
}
.comment .react span:hover { border-color: var(--cmt); color: var(--cmt); background: color-mix(in srgb, var(--cmt) 12%, transparent); }

/* related */
.related { margin-top: 56px; }

/* ============================================================
   E-E-A-T · GEO · AI-CITE · SEO COMPONENTS
   ============================================================ */

/* ---- richer content surface: tint the body band + cards ---- */
.art-body-band { background:
    linear-gradient(180deg, var(--bg), color-mix(in srgb, var(--accent) 3%, var(--bg)) 60%, var(--bg)); }
[data-theme="dark"] .art-body-band { background:
    linear-gradient(180deg, var(--bg), color-mix(in srgb, var(--accent) 7%, var(--bg)) 55%, var(--bg)); }
.card { background: linear-gradient(180deg, var(--surface), color-mix(in srgb, var(--accent) 3%, var(--surface))); position: relative; }
.card::before { content: ""; position: absolute; top: 0; left: 0; right: 0; height: 3px; background: var(--accent); transform: scaleX(0); transform-origin: left; transition: transform var(--t); z-index: 2; }
.card:hover::before { transform: scaleX(1); }
.card:hover { border-color: var(--accent-line); }
.card:hover .ph { filter: saturate(1.1); }
.card .ph { transition: filter var(--t); }
.card .body { gap: 9px; }
.widget { background: linear-gradient(180deg, var(--surface), color-mix(in srgb, var(--accent) 3%, var(--surface))); border: 1.5px solid color-mix(in srgb, var(--accent) 20%, var(--border)); border-radius: var(--radius); padding: 20px; }

/* ---- E-E-A-T trust bar ---- */
.trust-bar {
  display: flex; align-items: center; gap: 10px 20px; flex-wrap: wrap;
  margin-top: 22px; padding: 14px 18px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--sh-sm);
}
.trust-item { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-2); }
.trust-item svg { width: 16px; height: 16px; flex: none; }
.trust-item strong { color: var(--text); font-weight: 600; }
.trust-item .vrf { color: var(--trust); }
.trust-item a { color: var(--accent); }
.trust-sep { width: 1px; height: 22px; background: var(--border); }
.trust-badge {
  display: inline-flex; align-items: center; gap: 7px; font-family: var(--font-mono);
  font-size: 11px; font-weight: 500; letter-spacing: .04em; text-transform: uppercase;
  color: var(--trust); background: var(--trust-soft); border: 1px solid var(--trust-line);
  padding: 5px 10px; border-radius: var(--radius-pill);
}
.trust-badge svg { width: 13px; height: 13px; }

/* ---- GEO: Key takeaways ---- */
.takeaways {
  margin: 2em 0; padding: 22px 24px 24px;
  background: var(--accent-soft); border: 1px solid var(--accent-line);
  border-radius: var(--radius); position: relative;
}
.takeaways .tk-head { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.takeaways .tk-head .ic { width: 28px; height: 28px; border-radius: 8px; background: var(--accent); color: #fff; display: grid; place-items: center; flex: none; }
.takeaways .tk-head .ic svg { width: 16px; height: 16px; }
.takeaways .tk-head h2 { font-size: 16px; margin: 0; font-family: var(--font-mono); font-weight: 600; letter-spacing: .06em; text-transform: uppercase; }
.takeaways ul { margin: 0; padding-left: 1.2em; display: flex; flex-direction: column; gap: .55em; }
.takeaways li { font-size: 16px; line-height: 1.55; color: var(--text); }
.takeaways li::marker { color: var(--accent); }

/* ---- E-E-A-T: author "why trust this" experience note ---- */
.exp-note {
  display: grid; grid-template-columns: auto 1fr; gap: 16px; align-items: start;
  margin: 2em 0; padding: 20px 22px; border-radius: var(--radius);
  background: linear-gradient(180deg, var(--surface), color-mix(in srgb, var(--accent) 5%, var(--surface)));
  border: 1.5px solid color-mix(in srgb, var(--accent) 26%, var(--border));
}
.exp-note .exp-av {
  width: 52px; height: 52px; border-radius: 50%; flex: none;
  display: grid; place-items: center; font-family: var(--font-display); font-weight: 700;
  font-size: 18px; color: #fff; box-shadow: var(--sh-sm);
  background: linear-gradient(145deg, var(--accent), color-mix(in srgb, var(--accent) 55%, #000));
}
.exp-note .exp-head {
  display: flex; align-items: center; gap: 9px; flex-wrap: wrap; margin-bottom: 6px;
}
.exp-note .exp-title { font-family: var(--font-display); font-weight: 600; font-size: 15.5px; color: var(--text); }
.exp-note .exp-by { font-size: 12.5px; color: var(--text-3); }
.exp-note .exp-by a { color: var(--accent); }
.exp-note .exp-tag {
  display: inline-flex; align-items: center; gap: 5px; font-family: var(--font-mono);
  font-size: 10.5px; font-weight: 500; letter-spacing: .04em; text-transform: uppercase;
  color: var(--trust); background: var(--trust-soft); border: 1px solid var(--trust-line);
  padding: 3px 8px; border-radius: var(--radius-pill);
}
.exp-note .exp-tag svg { width: 12px; height: 12px; }
.exp-note p { font-size: 15px; line-height: 1.6; color: var(--text-2); margin: 0; }
.exp-note p strong { color: var(--text); font-weight: 600; }
@media (max-width: 560px) { .exp-note { grid-template-columns: 1fr; } .exp-note .exp-av { width: 44px; height: 44px; } }

/* ---- GEO: Quick answer box (AI-extractable) ---- */
.answer-box {
  margin: 2em 0; padding: 20px 22px; border-radius: var(--radius);
  background: var(--trust-soft); border: 1px solid var(--trust-line);
}
.answer-box .ab-tag { display: inline-flex; align-items: center; gap: 7px; font-family: var(--font-mono); font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--trust); margin-bottom: 9px; }
.answer-box .ab-tag svg { width: 14px; height: 14px; }
.answer-box p { font-size: 16.5px; line-height: 1.6; color: var(--text); margin: 0; }
.answer-box strong { font-weight: 600; }

/* ---- GEO/SEO: FAQ ---- */
.faq { margin-top: 2.4em; }
.faq > h2 { font-size: 26px; margin-bottom: 6px; scroll-margin-top: 90px; }
.faq .faq-q { border-bottom: 1px solid var(--border); }
.faq .faq-q:first-of-type { border-top: 1px solid var(--border); }

/* ---- AI Cite widget ---- */
.w-cite { border-color: var(--ai-line); background: linear-gradient(180deg, var(--surface), var(--ai-soft)); }
.w-cite h4 { color: var(--ai); display: flex; align-items: center; gap: 8px; }
.w-cite h4 svg { width: 15px; height: 15px; }
.cite-card { background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 13px 14px; }
.cite-text { font-size: 12.5px; line-height: 1.55; color: var(--text-2); font-family: var(--font-mono); word-break: break-word; }
.cite-text b { color: var(--text); font-weight: 600; }
.cite-actions { display: flex; gap: 8px; margin-top: 12px; }
.cite-btn {
  flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  font-family: var(--font-display); font-weight: 500; font-size: 12.5px;
  padding: 9px 10px; border-radius: var(--radius-sm); border: 1px solid var(--border-strong);
  background: var(--surface); color: var(--text-2); transition: var(--t);
}
.cite-btn:hover { border-color: var(--ai); color: var(--ai); }
.cite-btn svg { width: 14px; height: 14px; }
.ask-ai { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.ask-ai .ask-btn {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: var(--radius-sm);
  border: 1px solid var(--border); background: var(--surface); transition: var(--t); font-size: 13px; color: var(--text-2);
}
.ask-ai .ask-btn:hover { border-color: var(--ai); color: var(--text); transform: translateX(2px); }
.ask-ai .ask-btn .lg { width: 22px; height: 22px; border-radius: 6px; display: grid; place-items: center; flex: none; background: var(--ai-soft); color: var(--ai); font-family: var(--font-mono); font-weight: 700; font-size: 12px; }
.ask-ai .ask-btn .arr { margin-left: auto; color: var(--text-3); }

/* ---- AEO comparison table ---- */
.prose .cmp { width: 100%; border-collapse: collapse; font-size: 15px; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.prose .cmp th, .prose .cmp td { text-align: left; padding: 12px 15px; border-bottom: 1px solid var(--border); vertical-align: top; line-height: 1.45; }
.prose .cmp thead th { background: var(--accent-soft); color: var(--text); font-family: var(--font-display); font-weight: 600; font-size: 13px; letter-spacing: .01em; }
.prose .cmp tbody tr:nth-child(even) { background: color-mix(in srgb, var(--accent) 3.5%, var(--surface)); }
.prose .cmp tbody tr:last-child td { border-bottom: 0; }
.prose .cmp td strong { font-weight: 600; }
.prose .cmp .diff { font-family: var(--font-mono); font-size: 12.5px; color: var(--accent); }

/* ---- cite: format chips + AI copy ---- */
.cite-formats { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.cite-fmt { font-family: var(--font-mono); font-size: 11.5px; padding: 6px 11px; border-radius: var(--radius-pill); border: 1px solid var(--border-strong); background: var(--surface); color: var(--text-2); cursor: pointer; transition: var(--t); }
.cite-fmt:hover { border-color: var(--ai); color: var(--ai); }
.cite-fmt.active { background: var(--ai-soft); border-color: var(--ai-line); color: var(--ai); }
.cite-actions { margin-top: 10px; }
.cite-actions .cite-btn { width: 100%; }
.cite-ai-btn { width: 100%; margin-top: 9px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; font-family: var(--font-display); font-weight: 500; font-size: 12.5px; padding: 10px 12px; border-radius: var(--radius-sm); border: 1px solid var(--ai-line); background: var(--ai-soft); color: var(--ai); cursor: pointer; transition: var(--t); }
.cite-ai-btn:hover { filter: brightness(1.05); transform: translateY(-1px); }
.cite-ai-btn svg { width: 15px; height: 15px; }

/* ---- enhanced E-E-A-T author card ---- */
.author-card .verified { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; color: var(--trust); font-weight: 600; }
.author-card .verified svg { width: 13px; height: 13px; }
.cred-row { display: flex; gap: 8px; flex-wrap: wrap; }
.cred { font-family: var(--font-mono); font-size: 11px; color: var(--text-2); background: var(--surface-2); border: 1px solid var(--border); padding: 5px 9px; border-radius: var(--radius-pill); display: inline-flex; align-items: center; gap: 5px; }
.cred svg { width: 12px; height: 12px; color: var(--accent); }
.author-stats { display: flex; gap: 18px; padding: 12px 0; border-block: 1px solid var(--border); width: 100%; }
.author-stats .s b { font-family: var(--font-display); font-weight: 700; font-size: 17px; display: block; line-height: 1; }
.author-stats .s span { font-size: 10.5px; color: var(--text-3); font-family: var(--font-mono); letter-spacing: .04em; }

/* ---- sources / references (E-E-A-T) ---- */
.sources {
  margin-top: 2.6em; padding: 26px 26px 28px;
  background:
    linear-gradient(180deg, var(--trust-soft), color-mix(in srgb, var(--trust) 4%, var(--surface)));
  border: 1px solid var(--trust-line);
  border-radius: var(--radius);
  box-shadow: var(--sh-sm);
}
.sources h2 { font-size: 20px; margin: 0 0 4px; display: flex; align-items: center; gap: 10px; }
.sources h2 .ic { width: 26px; height: 26px; border-radius: 7px; background: color-mix(in srgb, var(--trust) 16%, transparent); border: 1px solid var(--trust-line); color: var(--trust); display: grid; place-items: center; flex: none; }
.sources h2 .ic svg { width: 15px; height: 15px; }
.sources .src-note { font-size: 13px; color: var(--text-3); margin: 0 0 18px; }
.sources ol { list-style: none; counter-reset: src; padding: 0; display: flex; flex-direction: column; gap: 11px; }
.sources li { counter-increment: src; position: relative; padding-left: 38px; font-size: 14.5px; color: var(--text-2); line-height: 1.5; min-height: 26px; display: flex; align-items: center; flex-wrap: wrap; gap: 4px 6px; }
.sources li::before {
  content: counter(src); position: absolute; left: 0; top: 0;
  width: 26px; height: 26px; border-radius: 50%;
  background: var(--trust); color: #fff;
  font-family: var(--font-mono); font-size: 12px; font-weight: 600;
  display: grid; place-items: center;
}
.sources a { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; text-decoration-color: var(--accent-line); }
.sources a:hover { text-decoration-color: var(--accent); }
.sources .src-src { color: var(--text-3); font-family: var(--font-mono); font-size: 12px; }

@media (max-width: 560px) {
  .trust-sep { display: none; }
  .author-stats { gap: 14px; }
}


/* ---- back-to-feed link ---- */
.return { display: inline-flex; align-items: center; gap: 8px; font-family: var(--font-display); font-weight: 500; font-size: 14px; color: var(--text-2); }
.return:hover { color: var(--accent); }

/* ============================================================
   GENERIC PAGE HERO
   ============================================================ */
.page-hero { padding-top: calc(46px * var(--density)); padding-bottom: calc(8px * var(--density)); }
.page-hero.bordered { border-bottom: 1px solid var(--border); padding-bottom: calc(40px * var(--density)); }
.page-hero h1 { font-size: clamp(34px, 5.2vw, 60px); margin: 14px 0 18px; letter-spacing: -.03em; max-width: 22ch; }
.page-hero .dek { font-size: clamp(17px, 2vw, 20px); color: var(--text-2); max-width: 62ch; line-height: 1.5; }
.page-hero .crumbs { margin-bottom: 4px; }
.stats-inline { display: flex; gap: 36px; margin-top: 28px; flex-wrap: wrap; }
.stats-inline .s { display: flex; flex-direction: column; gap: 3px; }
.stats-inline .s b { font-family: var(--font-display); font-weight: 700; font-size: clamp(22px, 2.6vw, 30px); letter-spacing: -.02em; }
.stats-inline .s span { font-family: var(--font-mono); font-size: 11.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--text-3); }

/* ---- filter chips ---- */
.chips-row { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 30px; }
.chip-f { padding: 9px 16px; border-radius: var(--radius-pill); border: 1px solid var(--border-strong); background: var(--surface); font-family: var(--font-display); font-weight: 500; font-size: 14px; color: var(--text-2); transition: var(--t); }
.chip-f:hover { border-color: var(--accent); color: var(--accent); }
.chip-f.active { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }

/* ---- pagination ---- */
.pagination { display: flex; gap: 8px; justify-content: center; align-items: center; margin-top: 44px; flex-wrap: wrap; }
.pagination a, .pagination span { min-width: 44px; height: 44px; padding: 0 15px; display: inline-flex; align-items: center; justify-content: center; border-radius: 12px; border: 1px solid var(--border); background: var(--surface); font-family: var(--font-display); font-weight: 500; font-size: 14px; color: var(--text-2); transition: var(--t); }
.pagination a:hover { border-color: var(--accent); color: var(--accent); }
.pagination .cur { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.pagination .gap { border: 0; background: transparent; min-width: 24px; }

/* ---- category hub grid ---- */
.cathub-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
.cathub-tile {
  display: flex; flex-direction: column; align-items: flex-start; gap: 8px;
  padding: 22px; border-radius: var(--radius);
  background: linear-gradient(180deg, var(--surface), color-mix(in srgb, var(--accent) 4%, var(--surface)));
  border: 1.5px solid color-mix(in srgb, var(--accent) 22%, var(--border));
  transition: var(--t); position: relative; overflow: hidden;
}
.cathub-tile:hover { border-color: var(--accent); transform: translateY(-3px); box-shadow: 0 12px 28px color-mix(in srgb, var(--accent) 18%, transparent), var(--sh-sm); }
.cathub-tile .ic { width: 48px; height: 48px; border-radius: 13px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); border: 1px solid var(--accent-line); margin-bottom: 4px; }
.cathub-tile .ic svg { width: 23px; height: 23px; }
.cathub-tile .ct { font-family: var(--font-mono); font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--text-3); }
.cathub-tile h3 { font-size: 19px; }
.cathub-tile p { font-size: 13.5px; color: var(--text-2); line-height: 1.5; }
.cathub-tile .go { margin-top: auto; padding-top: 10px; display: inline-flex; align-items: center; gap: 7px; font-family: var(--font-display); font-weight: 500; font-size: 13.5px; color: var(--accent); }
.cathub-tile .go .arr { transition: transform var(--t); }
.cathub-tile:hover .go .arr { transform: translateX(3px); }
.cathub-tile.feature-tile { grid-column: span 2; background: var(--navy); border-color: #20304a; }
.cathub-tile.feature-tile h3, .cathub-tile.feature-tile .go { color: #fff; }
.cathub-tile.feature-tile p { color: var(--on-navy-2); }
.cathub-tile.feature-tile .ct { color: var(--on-navy-2); }
.cathub-tile.feature-tile .ic { background: color-mix(in srgb, var(--accent) 24%, transparent); color: #cfe0ff; border-color: var(--accent-line); }
.cathub-tile.feature-tile:hover { border-color: var(--accent); }
@media (max-width: 980px) { .cathub-grid { grid-template-columns: repeat(2, 1fr); } .cathub-tile.feature-tile { grid-column: span 2; } }
@media (max-width: 560px) { .cathub-grid { grid-template-columns: 1fr; } .cathub-tile.feature-tile { grid-column: span 1; } }

/* ---- stat band ---- */
.stat-band { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; padding: clamp(28px, 4vw, 44px); background: var(--surface); border: 1px solid var(--border); border-radius: calc(var(--radius) * 1.4); box-shadow: var(--sh-md); }
.stat { display: flex; flex-direction: column; gap: 7px; }
.stat b { font-family: var(--font-display); font-weight: 700; font-size: clamp(30px, 4vw, 44px); letter-spacing: -.02em; color: var(--text); }
.stat b.accent { color: var(--accent); }
.stat span { font-size: 14px; color: var(--text-2); }
.darksec .stat-band { background: var(--navy-2); border-color: #20304a; }
.darksec .stat b { color: #fff; }
.darksec .stat span { color: var(--on-navy-2); }

/* ---- lede + prose page ---- */
.lede { font-size: clamp(19px, 2.4vw, 25px); line-height: 1.5; color: var(--text); font-family: var(--font-display); font-weight: 400; letter-spacing: -.01em; max-width: 60ch; }
.prose-page { font-size: 17px; line-height: 1.75; color: var(--text-2); max-width: 68ch; }
.prose-page > * + * { margin-top: 1.3em; }
.prose-page strong { color: var(--text); font-weight: 600; }

/* ---- feature/value cards ---- */
.feature-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.fcard { padding: 26px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); transition: var(--t); }
.fcard:hover { border-color: var(--border-strong); box-shadow: var(--sh-md); transform: translateY(-2px); }
.fcard .ic { width: 48px; height: 48px; border-radius: 13px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); border: 1px solid var(--accent-line); }
.fcard .ic svg { width: 23px; height: 23px; }
.fcard h3 { font-size: 18.5px; margin: 16px 0 9px; }
.fcard p { font-size: 14.5px; color: var(--text-2); line-height: 1.6; }

/* ---- team grid ---- */
.team-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 22px; }
.team-card {
  --tc: var(--accent);
  background: linear-gradient(180deg, var(--surface), color-mix(in srgb, var(--tc) 4%, var(--surface)));
  border: 1.5px solid color-mix(in srgb, var(--tc) 26%, var(--border)); border-radius: var(--radius);
  padding: 24px; display: flex; flex-direction: column; gap: 5px; transition: var(--t);
}
.team-card:hover { border-color: var(--tc); box-shadow: 0 12px 28px color-mix(in srgb, var(--tc) 18%, transparent), var(--sh-sm); transform: translateY(-3px); }
.team-card:nth-child(4n+2) { --tc: var(--trust); }
.team-card:nth-child(4n+3) { --tc: var(--ai); }
.team-card:nth-child(4n) { --tc: #e0892b; }
.team-card .avatar, .author-hero .avatar-lg, .info-row .av, .team-card .av {
    display: grid; place-items: center; color: #fff; font-family: var(--font-display); font-weight: 700;
    background: linear-gradient(145deg, var(--tc, var(--accent)), color-mix(in srgb, var(--tc, var(--accent)) 52%, #000)); border: 0; box-shadow: var(--sh-sm); }
.team-card .avatar, .team-card .av { width: 62px; height: 62px; border-radius: 50%; margin-bottom: 12px; font-size: 22px; }
.team-card .nm { font-family: var(--font-display); font-weight: 600; font-size: 16.5px; }
.team-card .role { font-family: var(--font-mono); font-size: 11px; color: var(--tc); text-transform: uppercase; letter-spacing: .06em; margin-bottom: 6px; }
.team-card p { font-size: 13.5px; color: var(--text-2); line-height: 1.55; }
.team-card .tc-socials { display: flex; gap: 8px; margin-top: 14px; }
.team-card .tc-socials a { width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; border: 1px solid var(--border); color: var(--text-3); transition: var(--t); }
.team-card .tc-socials a:hover { border-color: var(--tc); color: var(--tc); background: color-mix(in srgb, var(--tc) 10%, transparent); transform: translateY(-2px); }
.team-card .tc-socials svg { width: 15px; height: 15px; }
.team-card .tags-mini { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 13px; }
.team-card .tag-mini { font-family: var(--font-mono); font-size: 10.5px; color: var(--text-2); background: var(--surface-2); border: 1px solid var(--border); padding: 3px 8px; border-radius: var(--radius-pill); }
.card-cta { margin-top: 13px; display: inline-flex; align-items: center; gap: 7px; font-family: var(--font-display); font-weight: 500; font-size: 13px; color: var(--tc, var(--accent)); transition: var(--t); }
.card-cta .arr { transition: transform var(--t); }
.team-card:hover .card-cta .arr, .lead-card:hover .card-cta .arr { transform: translateX(3px); }

/* leadership row — wide cards */
.lead-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }
.lead-card {
  --tc: var(--accent);
  display: grid; grid-template-columns: auto 1fr; gap: 22px; align-items: start;
  background: linear-gradient(180deg, var(--surface), color-mix(in srgb, var(--tc) 5%, var(--surface)));
  border: 1.5px solid color-mix(in srgb, var(--tc) 28%, var(--border)); border-radius: var(--radius);
  padding: 26px; transition: var(--t);
}
.lead-card:nth-child(2) { --tc: var(--trust); }
.lead-card:hover { border-color: var(--tc); box-shadow: 0 14px 32px color-mix(in srgb, var(--tc) 18%, transparent), var(--sh-sm); transform: translateY(-3px); }
.lead-card .av { width: 84px; height: 84px; border-radius: 50%; flex: none; margin: 0; font-size: 30px;
  display: grid; place-items: center; color: #fff; font-family: var(--font-display); font-weight: 700;
  background: linear-gradient(145deg, var(--tc), color-mix(in srgb, var(--tc) 52%, #000)); box-shadow: var(--sh-sm); }
.lead-card .lc-body { min-width: 0; }
.lead-card .nm { font-family: var(--font-display); font-weight: 700; font-size: 21px; }
.lead-card .nm a { color: inherit; transition: var(--t); }
.lead-card .nm a:hover { color: var(--tc); }
.lead-card .role { font-family: var(--font-mono); font-size: 11.5px; color: var(--tc); text-transform: uppercase; letter-spacing: .07em; margin: 5px 0 10px; }
.lead-card p { font-size: 14px; color: var(--text-2); line-height: 1.6; }
.lead-card .tc-socials { display: flex; gap: 8px; margin-top: 15px; }
.lead-card .tc-socials a { width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; border: 1px solid var(--border); color: var(--text-3); transition: var(--t); }
.lead-card .tc-socials a:hover { border-color: var(--tc); color: var(--tc); background: color-mix(in srgb, var(--tc) 10%, transparent); transform: translateY(-2px); }
.lead-card .tc-socials svg { width: 15px; height: 15px; }

/* dept divider label */
.dept-label { display: flex; align-items: center; gap: 14px; margin: 8px 0 22px; }
.dept-label h3 { font-family: var(--font-display); font-weight: 600; font-size: 18px; white-space: nowrap; }
.dept-label .cnt { font-family: var(--font-mono); font-size: 11px; color: var(--text-3); }
.dept-label .rule { flex: 1; height: 1px; background: var(--border); }

@media (max-width: 980px) { .lead-grid { grid-template-columns: 1fr; } }

/* ---- forms ---- */
.form-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: clamp(24px, 3vw, 38px); box-shadow: var(--sh-md); }
.form-grid { display: flex; flex-direction: column; gap: 19px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 19px; }
.field-group { display: flex; flex-direction: column; gap: 8px; }
.field-group label { font-family: var(--font-display); font-weight: 500; font-size: 14px; color: var(--text); }
.field-group .req { color: var(--accent); }
.input, .textarea, select.input { width: 100%; padding: 13px 15px; border-radius: var(--radius-sm); border: 1px solid var(--border-strong); background: var(--bg); color: var(--text); font: inherit; font-size: 14.5px; outline: none; transition: var(--t); }
.input:focus, .textarea:focus, select.input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); background: var(--surface); }
.textarea { resize: vertical; min-height: 150px; line-height: 1.6; }
.field-hint { font-size: 12.5px; color: var(--text-3); }

/* ---- contact ---- */
.contact-grid { display: grid; grid-template-columns: 1.3fr .8fr; gap: 36px; align-items: start; }
.info-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 26px; display: flex; flex-direction: column; gap: 22px; }
.info-row { display: flex; gap: 14px; align-items: flex-start; }
.info-row .ic { width: 42px; height: 42px; flex: none; border-radius: 11px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); border: 1px solid var(--accent-line); }
.info-row .ic svg { width: 19px; height: 19px; }
.info-row .k { font-family: var(--font-display); font-weight: 600; font-size: 14.5px; margin-bottom: 3px; }
.info-row .v { font-size: 14px; color: var(--text-2); line-height: 1.5; }
.info-row .v a { color: var(--accent); }

/* ---- steps ---- */
.steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.step { padding: 24px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); position: relative; }
.step .n { font-family: var(--font-display); font-weight: 700; font-size: 32px; line-height: 1; color: color-mix(in srgb, var(--accent) 38%, var(--text-3)); }
.step h3 { font-size: 16.5px; margin: 12px 0 7px; }
.step p { font-size: 13.5px; color: var(--text-2); line-height: 1.55; }

/* ---- author hero ---- */
.author-hero { display: flex; gap: 30px; align-items: center; padding: clamp(24px, 3vw, 38px); background: var(--surface); border: 1px solid var(--border); border-radius: calc(var(--radius) * 1.3); box-shadow: var(--sh-md); flex-wrap: wrap; }
.author-hero .avatar-lg { width: 108px; height: 108px; border-radius: 50%; flex: none; }
.author-hero .ah-body { flex: 1; min-width: 260px; }
.author-hero .nm { font-family: var(--font-display); font-weight: 600; font-size: clamp(26px, 3.4vw, 38px); letter-spacing: -.02em; }
.author-hero .role { font-family: var(--font-mono); font-size: 11.5px; color: var(--accent); text-transform: uppercase; letter-spacing: .08em; margin-top: 8px; }
.author-hero p { color: var(--text-2); max-width: 62ch; margin-top: 14px; line-height: 1.6; font-size: 15.5px; }
.author-hero .a-stats { display: flex; gap: 30px; margin-top: 22px; flex-wrap: wrap; }
.author-hero .a-stats .s b { font-family: var(--font-display); font-weight: 700; font-size: 22px; display: block; }
.author-hero .a-stats .s span { font-family: var(--font-mono); font-size: 10.5px; letter-spacing: .07em; text-transform: uppercase; color: var(--text-3); }
.author-hero .a-socials { display: flex; gap: 9px; margin-top: 20px; }
.author-hero .a-socials a { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; border: 1px solid var(--border-strong); color: var(--text-2); transition: var(--t); }
.author-hero .a-socials a:hover { border-color: var(--accent); color: var(--accent); transform: translateY(-2px); }
.author-hero .a-socials svg { width: 16px; height: 16px; }

/* ---- map / faq mini ---- */
.faq-q { padding-block: 16px; border-bottom: 1px solid var(--border); }
.faq-q summary { font-family: var(--font-display); font-weight: 600; font-size: 16px; cursor: pointer; list-style: none; display: flex; justify-content: space-between; align-items: center; gap: 14px; }
.faq-q summary::-webkit-details-marker { display: none; }
.faq-q summary::after { content: "+"; font-size: 22px; color: var(--accent); font-weight: 400; transition: var(--t); }
.faq-q[open] summary::after { transform: rotate(45deg); }
.faq-q p { font-size: 14.5px; color: var(--text-2); line-height: 1.6; margin-top: 12px; max-width: 64ch; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1080px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero-side { grid-template-rows: none; grid-template-columns: 1fr 1fr; }
  .dk-grid { grid-template-columns: 1fr 1fr; }
  .dk-card.big { grid-column: 1 / -1; }
  .art-layout { grid-template-columns: minmax(0, 1fr); gap: 40px; }
  .aside { position: static; }
  .footer .top { grid-template-columns: 1fr 1fr; gap: 30px; }
  .team-grid { grid-template-columns: 1fr 1fr; }
  .steps { grid-template-columns: 1fr 1fr; }
  .stat-band { grid-template-columns: 1fr 1fr; gap: 28px; }
  .contact-grid { grid-template-columns: 1fr; }
}
@media (max-width: 820px) {
  .mainnav, .topbar nav .hide-sm { display: none; }
  .header .right > .btn { display: none; }        /* Subscribe lives in the drawer on mobile */
  .header .wrap { gap: 14px; }
  .header .right { gap: 4px; }
  .cat-grid { grid-template-columns: 1fr 1fr; }
  .grid-3 { grid-template-columns: 1fr 1fr; }
  .cta-band { grid-template-columns: 1fr; }
  .dk-grid { grid-template-columns: 1fr; }
  .feature-grid { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .hero-side { grid-template-columns: 1fr; }
  .grid-3, .cat-grid { grid-template-columns: 1fr; }
  .hcard { grid-template-columns: 110px 1fr; }
  .byline .share { margin-left: 0; width: 100%; }
  .footer .top { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 28px 24px; }
  .footer .top > :first-child { grid-column: 1 / -1; }
  .footer .top > :last-child { grid-column: 1 / -1; }
  .footer .fnews { min-width: 0; }
  .footer .fnews input { min-width: 0; }
  .team-grid, .steps, .stat-band { grid-template-columns: 1fr; }
  .author-hero { flex-direction: column; align-items: flex-start; text-align: left; }
}

/* ============================================================
   MOBILE NAV DRAWER (injected by app.jsx)
   ============================================================ */
.nav-toggle { display: none; }
.nav-scrim { position: fixed; inset: 0; background: rgba(8,12,20,.55); -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px); z-index: 90; opacity: 0; visibility: hidden; transition: opacity .25s; }
.nav-scrim.open { opacity: 1; visibility: visible; }
.nav-drawer { position: fixed; top: 0; right: 0; height: 100%; width: min(346px, 87vw); background: var(--surface); border-left: 1px solid var(--border); z-index: 91; transform: translateX(102%); transition: transform .32s cubic-bezier(.3,.7,.4,1); display: flex; flex-direction: column; padding: 18px; overflow-y: auto; box-shadow: var(--sh-lg); }
.nav-drawer.open { transform: none; }
.nav-drawer .nd-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.nav-drawer .nd-search { display: flex; gap: 8px; margin-bottom: 14px; }
.nav-drawer .nd-search input { flex: 1; padding: 11px 14px; border-radius: var(--radius-sm); border: 1px solid var(--border-strong); background: var(--bg); color: var(--text); font: inherit; font-size: 14.5px; outline: none; }
.nav-drawer .nd-search input:focus { border-color: var(--accent); }
.nav-drawer .nd-search button { width: 44px; flex: none; border-radius: var(--radius-sm); border: 0; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; }
.nav-drawer .nd-search button svg { width: 18px; height: 18px; }
.nav-drawer .nd-sect { font-family: var(--font-mono); font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--text-3); padding: 16px 10px 6px; }
.nav-drawer a.nd-link { padding: 12px 10px; border-radius: 10px; font-family: var(--font-display); font-weight: 500; font-size: 16px; color: var(--text); transition: var(--t); }
.nav-drawer a.nd-link:hover { background: var(--surface-2); color: var(--accent); }
.nav-drawer .nd-cta { margin-top: 18px; justify-content: center; }
@media (max-width: 820px) { .nav-toggle { display: grid; } }

/* ============================================================
   SEARCH RESULTS
   ============================================================ */
.search-hero { padding-top: calc(40px * var(--density)); padding-bottom: calc(30px * var(--density)); border-bottom: 1px solid var(--border); }
.search-box { display: flex; gap: 12px; margin: 22px 0 16px; max-width: 720px; }
.search-box .field { flex: 1; position: relative; }
.search-box .field svg { position: absolute; left: 18px; top: 50%; transform: translateY(-50%); width: 20px; height: 20px; color: var(--text-3); }
.search-box input { width: 100%; padding: 16px 18px 16px 50px; border-radius: var(--radius-pill); border: 1px solid var(--border-strong); background: var(--surface); color: var(--text); font: inherit; font-size: 16px; outline: none; transition: var(--t); box-shadow: var(--sh-sm); }
.search-box input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.search-box .btn { padding-inline: 26px; }
.s-meta { font-size: 14px; color: var(--text-3); font-family: var(--font-mono); }
.s-meta b { color: var(--text); }
.s-layout { display: grid; grid-template-columns: minmax(0,1fr) 280px; gap: 48px; align-items: start; padding-top: calc(36px * var(--density)); }
.s-result { display: grid; grid-template-columns: 168px 1fr; gap: 22px; padding: 24px 0; border-bottom: 1px solid var(--border); transition: var(--t); }
.s-result:first-child { padding-top: 0; }
.s-result .ph { aspect-ratio: 16/10; border-radius: var(--radius-sm); }
.s-result .body { display: flex; flex-direction: column; gap: 9px; }
.s-result h3 { font-size: 20px; line-height: 1.22; }
.s-result h3 a:hover { color: var(--accent); }
.s-result .ex { font-size: 14.5px; color: var(--text-2); line-height: 1.55; }
.s-result mark { background: var(--accent-soft); color: var(--accent); padding: 0 3px; border-radius: 3px; }
.s-result .url { font-family: var(--font-mono); font-size: 11.5px; color: color-mix(in srgb, var(--accent) 70%, var(--text-3)); }

/* ============================================================
   LEGAL / DOC PAGES
   ============================================================ */
.doc-layout { display: grid; grid-template-columns: minmax(0,1fr) 280px; gap: 56px; align-items: start; padding-top: calc(36px * var(--density)); }
.doc-meta { font-family: var(--font-mono); font-size: 12px; color: var(--text-3); letter-spacing: .03em; }
.doc { font-size: 16.5px; line-height: 1.72; color: var(--text-2); max-width: 70ch; }
.doc > * + * { margin-top: 1.2em; }
.doc h2 { font-size: 23px; margin-top: 1.7em; color: var(--text); scroll-margin-top: 90px; }
.doc h3 { font-size: 18px; margin-top: 1.4em; color: var(--text); }
.doc strong { color: var(--text); font-weight: 600; }
.doc ul { padding-left: 1.3em; display: flex; flex-direction: column; gap: .5em; }
.doc li::marker { color: var(--accent); }
.doc a { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; }

/* ============================================================
   404
   ============================================================ */
.err-wrap { min-height: 62vh; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding-block: 60px; }
.err-code { font-family: var(--font-display); font-weight: 700; font-size: clamp(96px, 18vw, 200px); line-height: .9; letter-spacing: -.04em; background: linear-gradient(150deg, var(--accent), color-mix(in srgb, var(--accent) 45%, var(--text-3))); -webkit-background-clip: text; background-clip: text; color: transparent; }
.err-wrap h1 { font-size: clamp(24px, 3.4vw, 36px); margin: 14px 0 12px; }
.err-wrap p { color: var(--text-2); max-width: 48ch; font-size: 16.5px; }
.err-wrap .search-box { margin-top: 28px; width: min(560px, 92vw); }
.err-links { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; margin-top: 26px; }

@media (max-width: 980px) {
  .s-layout, .doc-layout { grid-template-columns: minmax(0, 1fr); gap: 40px; }
}
@media (max-width: 560px) {
  .s-result { grid-template-columns: 1fr; }
  .s-result .ph { aspect-ratio: 16/9; }
  .search-box { flex-direction: column; }
}

/* ============================================================
   UTILITY CLASSES (replace inline styles — keep markup clean)
   ============================================================ */
.pt-0 { padding-top: 0; }
.pt-28 { padding-top: calc(28px * var(--density)); }
.pt-30 { padding-top: calc(30px * var(--density)); }
.pt-34 { padding-top: calc(34px * var(--density)); }
.pb-56 { padding-block: calc(56px * var(--density)); }
.mt-8 { margin-top: 8px; }
.mt-14 { margin-top: 14px; }
.mt-18 { margin-top: 18px; }
.mt-1-2 { margin-top: 1.2em; }
.mb-16 { margin-bottom: 16px; }
.mb-34 { margin-bottom: 34px; }
.mb-42 { margin-bottom: 42px; }
.mb-46 { margin-bottom: 46px; }
.spacer-40 { height: 40px; }
.wrap-narrow { max-width: 820px; }
.lead-grid-solo { grid-template-columns: 1fr; margin-bottom: 46px; }
.btn-flex { flex: 1; justify-content: center; }
.btn-sm { font-size: 13px; padding: 9px 14px; }
.align-start { align-items: flex-start; }
.row-actions { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.col-gap-22 { display: flex; flex-direction: column; gap: 22px; }
.k-label { font-family: var(--font-mono); font-size: 11.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--text-3); }
.list-tight { display: flex; flex-direction: column; gap: .6em; padding-left: 1.2em; margin-top: 1.1em; }
.a-accent { color: var(--accent); }
.kbd-inline { font-family: var(--font-mono); font-size: .92em; }
.comments-h { font-size: 24px; margin-bottom: 18px; }
.muted-count { color: var(--text-3); font-weight: 400; }
.s-count { float: right; color: var(--text-3); font-family: var(--font-mono); font-size: 11px; }
.bibtex-pre { font-family: var(--font-mono); font-size: 11px; white-space: pre-wrap; }
