/* Sovereign Frontier — shared design system
 * Used by all 8 category pages.
 */

:root {
  --bg-base: #FAFAF8;
  --bg-surface: #FFFFFF;
  --bg-subtle: #F1EFE8;
  --text-primary: #1A1A1A;
  --text-secondary: #5F5E5A;
  --text-tertiary: #888780;
  --border-subtle: rgba(0,0,0,0.06);
  --border-default: rgba(0,0,0,0.14);
  --border-strong: rgba(0,0,0,0.28);

  --sealed-bg: #EEEDFE;
  --sealed-fg: #26215C;
  --sealed-accent: #534AB7;
  --hardened-bg: #E1F5EE;
  --hardened-fg: #04342C;
  --hardened-accent: #0F6E56;
  --quarantine-bg: #FAEEDA;
  --quarantine-fg: #412402;
  --quarantine-accent: #BA7517;
  --interdicted-bg: #FCEBEB;
  --interdicted-fg: #501313;
  --interdicted-accent: #A32D2D;

  --info-bg: #E6F1FB;
  --info-fg: #0C447C;

  --font-sans: 'IBM Plex Sans', system-ui, sans-serif;
  --font-mono: 'IBM Plex Mono', ui-monospace, monospace;

  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: var(--font-sans);
  background: var(--bg-base);
  color: var(--text-primary);
  -webkit-font-smoothing: antialiased;
  font-size: 14px;
  line-height: 1.55;
}

h1 { font-size: 32px; font-weight: 500; letter-spacing: -0.02em; margin: 0; }
h2 { font-size: 22px; font-weight: 500; letter-spacing: -0.01em; margin: 0; }
h3 { font-size: 16px; font-weight: 500; margin: 0; }

.app { max-width: 1440px; margin: 0 auto; }

/* TOP NAV */
.top-nav {
  display: flex; align-items: center; gap: 28px;
  padding: 12px 24px;
  border-bottom: 0.5px solid var(--border-subtle);
  background: var(--bg-surface);
  position: sticky; top: 0; z-index: 10;
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 500; font-size: 13px; letter-spacing: 0.5px; text-decoration: none; color: inherit; }
.brand svg { flex-shrink: 0; }
.nav-tabs { display: flex; gap: 2px; flex: 1; flex-wrap: wrap; }
.nav-tab {
  padding: 6px 12px; font-size: 13px;
  color: var(--text-secondary); text-decoration: none;
  border-radius: var(--radius-sm);
  transition: background 0.12s, color 0.12s; cursor: pointer;
}
.nav-tab:hover { background: var(--bg-subtle); color: var(--text-primary); }
.nav-tab.active { color: var(--text-primary); font-weight: 500; background: var(--bg-subtle); }
.nav-right { font-size: 12px; color: var(--text-secondary); display: flex; align-items: center; gap: 8px; }
.clearance-pill { background: var(--info-bg); color: var(--info-fg); padding: 3px 9px; border-radius: var(--radius-sm); font-size: 11px; font-weight: 500; }

/* SF·R (restricted) dark nav — emitted by SF.renderNav when the page is
   a restricted-tier page. Strict B&W on a black canvas, mono uppercase.   */
.sfr-nav {
  display: flex; align-items: center; gap: 24px;
  padding: 12px 24px;
  background: #000000;
  border-bottom: 1px solid #2a2a2a;
  position: sticky; top: 0; z-index: 10;
}
.sfr-nav .brand {
  display: flex; align-items: center; gap: 10px;
  color: #ffffff; text-decoration: none;
  font-family: var(--font-mono, ui-monospace, SFMono-Regular, monospace);
  font-size: 11px; letter-spacing: 0.2em; font-weight: 700;
  flex-shrink: 0;
}
.sfr-nav .brand svg { color: #ffffff; }
.sfr-nav .nav-tabs { display: flex; flex-wrap: wrap; gap: 2px; flex: 1; margin-left: 8px; }
.sfr-nav .nav-tab {
  padding: 6px 10px;
  font-family: var(--font-mono, ui-monospace, SFMono-Regular, monospace);
  font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase;
  color: #b8b8b8; text-decoration: none;
  border: 1px solid transparent; border-radius: 0;
  background: transparent;
}
.sfr-nav .nav-tab:hover { color: #ffffff; background: transparent; border-color: rgba(255,255,255,0.18); }
.sfr-nav .nav-tab.active {
  color: #000000; background: #ffffff; border-color: #ffffff; font-weight: 700;
}
.sfr-nav .nav-right { flex-shrink: 0; }
.sfr-nav .sfr-pill {
  background: #ffffff; color: #000000;
  font-family: var(--font-mono, ui-monospace, SFMono-Regular, monospace);
  font-size: 10px; font-weight: 700; letter-spacing: 0.18em;
  padding: 4px 10px;
}

/* SF·R CUI banner — top + fixed-bottom marking; injected on every SF·R page
   for consistent classification chrome. */
.cui-banner {
  background: #ffffff;
  color: #000000;
  font-family: var(--font-mono, ui-monospace, SFMono-Regular, monospace);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-align: center;
  padding: 6px 12px;
  text-transform: uppercase;
  border-bottom: 1px solid #000000;
}
.cui-banner-bottom {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  z-index: 1000;
  border-top: 1px solid #000000;
  border-bottom: none;
}

/* SF·R chrome-bar — session / org / tier strip that sits between the
   top CUI banner and the dark nav on every Government page. Emitted
   globally by SF.renderNav so all 9 SF·R pages share identical chrome. */
.chrome-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 24px;
  background: #000000;
  border-bottom: 1px solid rgba(255,255,255,0.18);
  font-family: var(--font-mono, ui-monospace, SFMono-Regular, monospace);
  font-size: 11px;
  color: #b8b8b8;
}
.chrome-bar .left  { display: flex; gap: 16px; align-items: center; }
.chrome-bar .right { display: flex; gap: 12px; align-items: center; }
.chrome-bar .chrome-val { color: #ffffff; }
.chrome-bar a { color: #b8b8b8; text-decoration: none; }
.chrome-bar a:hover { color: #ffffff; }
.sfr-badge {
  padding: 3px 8px;
  background: #ffffff; color: #000000;
  font-family: var(--font-mono, ui-monospace, SFMono-Regular, monospace);
  font-weight: 700; letter-spacing: 0.18em; text-transform: uppercase;
  font-size: 11px;
}
.tier-badge {
  padding: 3px 8px;
  background: #000000; color: #ffffff;
  border: 1px solid #ffffff;
  font-family: var(--font-mono, ui-monospace, SFMono-Regular, monospace);
  letter-spacing: 0.18em; font-weight: 700;
  font-size: 11px;
}

/* SF·R body canvas — every Government page gets the same dark grid canvas
   as the Overview page. theme.js adds body.sfr-page on URL-regex match. */
body.sfr-page {
  background: #0a0a0a;
  background-image:
    linear-gradient(rgba(255,255,255,0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.04) 1px, transparent 1px);
  background-size: 24px 24px, 24px 24px;
  min-height: 100vh;
  padding-bottom: 52px;
}

/* PAGE HEADER */
.page-header { padding: 36px 24px 20px; }
.eyebrow { font-size: 11px; letter-spacing: 0.8px; color: var(--text-tertiary); text-transform: uppercase; font-weight: 500; margin-bottom: 10px; }
.page-header p { color: var(--text-secondary); max-width: 640px; margin: 10px 0 0; }

/* METRIC STRIP */
.metric-strip { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; padding: 0 24px 24px; }
.metric-card {
  padding: 14px 16px;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: transform 0.1s, filter 0.1s;
  border: 0.5px solid transparent;
}
.metric-card:hover { transform: translateY(-1px); filter: brightness(0.98); }
.metric-card.active { outline: 2px solid currentColor; outline-offset: -2px; }
.metric-card .label { font-size: 11px; letter-spacing: 0.5px; font-weight: 500; margin-bottom: 4px; opacity: 0.82; text-transform: uppercase; }
.metric-card .value { font-size: 26px; font-weight: 500; line-height: 1.1; }
.metric-card.tier-sealed { background: var(--sealed-bg); color: var(--sealed-fg); }
.metric-card.tier-hardened { background: var(--hardened-bg); color: var(--hardened-fg); }
.metric-card.tier-quarantine { background: var(--quarantine-bg); color: var(--quarantine-fg); }
.metric-card.tier-interdicted { background: var(--interdicted-bg); color: var(--interdicted-fg); }

/* LAYOUT */
.layout { display: grid; grid-template-columns: 240px 1fr; gap: 32px; padding: 0 24px 48px; }
@media (max-width: 960px) { .layout { grid-template-columns: 1fr; } .filter-sidebar { position: static !important; max-height: none !important; } }

/* FILTER SIDEBAR */
.filter-sidebar {
  position: sticky; top: 68px;
  align-self: start;
  max-height: calc(100vh - 88px);
  overflow-y: auto;
  padding-right: 4px;
}
.filter-section { padding: 16px 0; border-bottom: 0.5px solid var(--border-subtle); }
.filter-section:first-child { padding-top: 0; }
.filter-section:last-child { border-bottom: none; }
.filter-section h4 {
  font-size: 11px; letter-spacing: 0.8px;
  color: var(--text-tertiary);
  margin: 0 0 10px; font-weight: 500;
  text-transform: uppercase;
}
.filter-chips { display: flex; flex-wrap: wrap; gap: 4px; }
.chip {
  padding: 5px 10px; font-size: 12px;
  border-radius: 999px;
  border: 0.5px solid var(--border-default);
  background: transparent;
  cursor: pointer;
  transition: all 0.12s;
  font-family: inherit;
  color: inherit;
}
.chip:hover { background: var(--bg-subtle); }
.chip.active { background: var(--text-primary); color: var(--bg-surface); border-color: var(--text-primary); }

/* RESULTS AREA */
.results-area { min-width: 0; }
.controls-row { display: flex; gap: 8px; margin-bottom: 20px; align-items: center; }
.search-input {
  flex: 1; padding: 8px 12px 8px 34px;
  border: 0.5px solid var(--border-default);
  border-radius: var(--radius-md);
  font-family: inherit; font-size: 13px;
  background: var(--bg-surface) url("data:image/svg+xml;utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 14 14'%3E%3Ccircle cx='6' cy='6' r='4.5' fill='none' stroke='%23888780' stroke-width='1.2'/%3E%3Cline x1='9.5' y1='9.5' x2='12.5' y2='12.5' stroke='%23888780' stroke-width='1.2' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat 10px center;
}
.search-input:focus { outline: none; border-color: var(--text-primary); }
.sort-select {
  padding: 8px 12px;
  border: 0.5px solid var(--border-default);
  border-radius: var(--radius-md);
  font-family: inherit; font-size: 13px;
  background: var(--bg-surface);
  cursor: pointer;
}

/* SOTA SECTION */
.sota-section {
  padding: 20px;
  background: var(--bg-surface);
  border: 0.5px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  margin-bottom: 20px;
}
.section-header { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 4px; flex-wrap: wrap; gap: 10px; }
.section-title { font-size: 11px; letter-spacing: 0.8px; color: var(--text-tertiary); text-transform: uppercase; font-weight: 500; margin: 0; }
.section-link { font-size: 12px; color: var(--text-secondary); text-decoration: none; cursor: pointer; }
.section-link:hover { color: var(--text-primary); }
.sota-desc { font-size: 13px; color: var(--text-secondary); margin: 0 0 14px; line-height: 1.55; }
.sota-table { background: var(--bg-base); border-radius: var(--radius-md); font-family: var(--font-mono); }
.sota-row {
  display: grid;
  grid-template-columns: 28px 1fr auto;
  gap: 12px; padding: 10px 14px;
  border-top: 0.5px solid var(--border-subtle);
  align-items: baseline;
}
.sota-row:first-of-type { border-top: none; }
.sota-rank { color: var(--text-tertiary); font-size: 12px; }
.sota-row.top .sota-rank { color: var(--text-primary); font-weight: 500; }
.sota-row.top .sota-name { font-weight: 500; }
.sota-name { font-size: 13px; margin-bottom: 1px; }
.sota-meta { font-size: 10px; color: var(--text-tertiary); }
.sota-score { font-size: 13px; white-space: nowrap; }
.sota-row.top .sota-score { font-weight: 500; }

/* FEATURED CARD */
.featured-card {
  background: var(--sealed-bg);
  border: 2px solid var(--sealed-accent);
  border-radius: var(--radius-lg);
  padding: 20px;
  margin-bottom: 20px;
}
.featured-label { font-size: 11px; letter-spacing: 0.8px; color: var(--sealed-fg); font-weight: 500; margin-bottom: 8px; text-transform: uppercase; }
.featured-name { font-size: 20px; font-weight: 500; color: var(--sealed-fg); margin: 0 0 2px; letter-spacing: -0.01em; }
.featured-publisher { font-family: var(--font-mono); font-size: 12px; color: var(--sealed-fg); opacity: 0.72; margin: 0 0 10px; }
.featured-desc { font-size: 13px; color: var(--sealed-fg); margin: 0 0 12px; line-height: 1.55; }
.featured-tags { display: flex; gap: 5px; flex-wrap: wrap; }
.featured-tag { background: rgba(255,255,255,0.78); color: var(--sealed-fg); font-size: 10px; padding: 3px 8px; border-radius: var(--radius-sm); font-weight: 500; font-family: var(--font-mono); letter-spacing: 0.3px; }

/* CARDS / LIST */
.list-header { display: flex; justify-content: space-between; margin-bottom: 10px; align-items: baseline; font-size: 12px; color: var(--text-secondary); }
.artifact-grid { display: flex; flex-direction: column; gap: 8px; }
.artifact-card {
  background: var(--bg-surface);
  border: 0.5px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 16px 18px;
  cursor: pointer;
  transition: border-color 0.12s, box-shadow 0.12s;
}
.artifact-card:hover { border-color: var(--border-default); }
.artifact-card.expanded { border-color: var(--border-default); }
.card-header { display: grid; grid-template-columns: 1fr auto; gap: 16px; align-items: start; }
.card-main { min-width: 0; }
.card-title-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 3px; }
.card-name { font-size: 15px; font-weight: 500; margin: 0; letter-spacing: -0.005em; }
.card-handle { font-family: var(--font-mono); font-size: 11px; color: var(--text-tertiary); margin: 0 0 6px; }
.card-desc { font-size: 12px; color: var(--text-secondary); margin: 0 0 8px; line-height: 1.5; }
.card-tags { display: flex; gap: 5px; flex-wrap: wrap; }
.tag { background: var(--bg-subtle); color: var(--text-secondary); font-size: 10px; padding: 2px 7px; border-radius: var(--radius-sm); font-family: var(--font-mono); letter-spacing: 0.3px; }
.card-meta { text-align: right; font-size: 10px; color: var(--text-tertiary); white-space: nowrap; font-family: var(--font-mono); }
.card-meta p { margin: 0 0 2px; }
/* Per-model download-format dropdown (native <details>) */
.dl-dd { position: relative; display: inline-block; margin-top: 7px; }
.dl-dd > summary { list-style: none; cursor: pointer; font-family: var(--font-mono); font-size: 10px; padding: 4px 10px; border: 0.5px solid #26215C; border-radius: 4px; background: #26215C; color: #fff; white-space: nowrap; user-select: none; }
.dl-dd > summary::-webkit-details-marker { display: none; }
.dl-dd > summary:hover { background: #1c1848; }
.dl-dd[open] > summary { background: #1c1848; }
.dl-menu { position: absolute; right: 0; top: calc(100% + 4px); min-width: 230px; text-align: left; background: var(--bg-surface); border: 0.5px solid var(--border-default); border-radius: 7px; box-shadow: 0 10px 28px rgba(0,0,0,0.18); z-index: 1000; overflow: hidden; }
/* Lift the card whose download dropdown is open above its grid siblings so the
   popup overlays them instead of being painted under the next card. */
.artifact-card { position: relative; }
.artifact-card:has(.dl-dd[open]) { z-index: 1000; }
.dl-menu a { display: block; padding: 8px 12px; font-size: 12px; font-family: var(--font-sans); color: var(--text-primary); text-decoration: none; border-bottom: 0.5px solid var(--border-subtle); white-space: normal; }
.dl-menu a:last-child { border-bottom: 0; }
.dl-menu a:hover { background: var(--bg-base); color: #26215C; }
.dl-menu a .fmt-sub { display: block; font-family: var(--font-mono); font-size: 10px; color: var(--text-tertiary); margin-top: 1px; }

/* TIER BADGE */
.tier-badge {
  display: inline-block;
  font-size: 10px; padding: 2px 7px;
  border-radius: var(--radius-sm);
  font-weight: 500; letter-spacing: 0.3px;
  font-family: var(--font-mono);
  text-transform: uppercase;
}
.tier-badge.sealed { background: var(--sealed-bg); color: var(--sealed-fg); }
.tier-badge.hardened { background: var(--hardened-bg); color: var(--hardened-fg); }
.tier-badge.quarantine { background: var(--quarantine-bg); color: var(--quarantine-fg); }
.tier-badge.interdicted { background: var(--interdicted-bg); color: var(--interdicted-fg); }

/* EXPANDED CARD */
.expanded-content {
  margin-top: 14px; padding-top: 14px;
  border-top: 0.5px solid var(--border-subtle);
  display: grid; grid-template-columns: 1fr 1fr; gap: 20px;
}
@media (max-width: 720px) { .expanded-content { grid-template-columns: 1fr; } }
.expanded-section h5 { font-size: 10px; letter-spacing: 0.8px; color: var(--text-tertiary); margin: 0 0 8px; font-weight: 500; text-transform: uppercase; }
.attest-block {
  font-family: var(--font-mono); font-size: 10.5px; line-height: 1.8;
  color: var(--text-secondary);
  background: var(--bg-base);
  padding: 10px 12px;
  border-radius: var(--radius-sm);
}
.attest-block .k { color: var(--text-primary); display: inline-block; width: 110px; }
.prov-block { font-family: var(--font-mono); font-size: 11px; line-height: 1.7; color: var(--text-secondary); }
.prov-label { font-size: 10px; color: var(--text-tertiary); margin-bottom: 4px; letter-spacing: 0.3px; }
.prov-chip {
  display: inline-block;
  background: var(--hardened-bg);
  color: var(--hardened-fg);
  padding: 2px 7px;
  border-radius: var(--radius-sm);
  margin: 2px 3px 2px 0;
  font-size: 10px; font-weight: 500;
}
.prov-chip.sealed { background: var(--sealed-bg); color: var(--sealed-fg); }
.prov-chip.dataset { background: #FDF1E0; color: #5B3E14; }

/* ACTIONS */
.expanded-actions { grid-column: 1 / -1; display: flex; gap: 6px; flex-wrap: wrap; }
.btn {
  padding: 6px 14px; font-size: 12px;
  border: 0.5px solid var(--border-default);
  border-radius: var(--radius-md);
  background: transparent;
  font-family: inherit; cursor: pointer;
  color: inherit;
  transition: background 0.1s, border-color 0.1s;
}
.btn:hover { background: var(--bg-subtle); }
.btn.primary { background: var(--text-primary); color: var(--bg-surface); border-color: var(--text-primary); }
.btn.primary:hover { background: #333; }

/* EMPTY STATE */
.empty-state {
  padding: 56px 24px; text-align: center;
  color: var(--text-secondary);
  background: var(--bg-surface);
  border: 0.5px solid var(--border-subtle);
  border-radius: var(--radius-lg);
}
.empty-state h3 { color: var(--text-primary); margin-bottom: 4px; font-weight: 500; }
.empty-state p { margin: 0; font-size: 13px; }

/* FOOTER */
.footer {
  padding: 32px 24px 48px;
  font-size: 11px; color: var(--text-tertiary);
  border-top: 0.5px solid var(--border-subtle);
  font-family: var(--font-mono);
  line-height: 1.7;
}
.footer a { color: var(--text-secondary); }

/* CATEGORY-SPECIFIC EXTENSIONS */

/* Datasets: subset viz + PII scan */
.subset-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 6px; margin-top: 8px; }
.subset-tile {
  padding: 8px 10px;
  background: var(--bg-base);
  border-left: 2px solid var(--hardened-accent);
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: 10px;
}
.subset-tile.flagged { border-left-color: var(--quarantine-accent); }
.subset-tile.passed { border-left-color: var(--hardened-accent); }
.subset-tile .sub-name { font-weight: 500; color: var(--text-primary); font-size: 10px; }
.subset-tile .sub-meta { color: var(--text-tertiary); font-size: 9px; }
.pii-scan {
  display: flex; gap: 8px; flex-wrap: wrap; margin-top: 6px;
}
.pii-chip {
  font-family: var(--font-mono);
  font-size: 10px;
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  background: var(--hardened-bg);
  color: var(--hardened-fg);
}
.pii-chip.flagged { background: var(--quarantine-bg); color: var(--quarantine-fg); }
.pii-chip.interdicted { background: var(--interdicted-bg); color: var(--interdicted-fg); }

/* Architectures: paradigm tag */
.paradigm-pill {
  display: inline-block;
  padding: 2px 7px; font-size: 10px;
  background: #F2EDF7; color: #3B2259;
  border-radius: var(--radius-sm);
  font-family: var(--font-mono); font-weight: 500;
  letter-spacing: 0.3px;
}

/* Protocols: interop matrix */
.interop-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 4px;
  margin-top: 6px;
  font-family: var(--font-mono);
  font-size: 10px;
}
.interop-cell {
  padding: 4px 6px;
  border-radius: var(--radius-sm);
  text-align: center;
  background: var(--hardened-bg);
  color: var(--hardened-fg);
}
.interop-cell.partial { background: var(--quarantine-bg); color: var(--quarantine-fg); }
.interop-cell.none { background: var(--bg-subtle); color: var(--text-tertiary); }

/* Processors: supply chain */
.supply-chain { display: flex; gap: 4px; align-items: center; flex-wrap: wrap; font-family: var(--font-mono); font-size: 10px; }
.supply-node {
  padding: 3px 8px;
  background: var(--bg-base);
  border: 0.5px solid var(--border-default);
  border-radius: var(--radius-sm);
}
.supply-arrow { color: var(--text-tertiary); }

/* ═══════════════════════════════════════════════════════════════════════
   Marketing surface — used by /products-live.html and /product/*.html.
   Same color tokens as the engineering pages, looser spacing, bigger
   typography. The product pages should feel like marketing, not docs.
   ═══════════════════════════════════════════════════════════════════════ */

/* Hero — for product detail pages */
.mkt-hero { padding: 96px 24px 80px; max-width: 1100px; margin: 0 auto; }
.mkt-hero .eyebrow { color: var(--text-secondary); margin-bottom: 18px; font-size: 12px; letter-spacing: 1px; }
.mkt-hero h1 { font-size: 56px; line-height: 1.05; max-width: 880px; letter-spacing: -0.02em; font-weight: 500; }
.mkt-hero .lede { font-size: 19px; max-width: 680px; margin: 24px 0 0; color: var(--text-secondary); line-height: 1.55; }
@media (max-width: 720px) { .mkt-hero { padding: 56px 24px 48px; } .mkt-hero h1 { font-size: 38px; } .mkt-hero .lede { font-size: 16px; } }

.mkt-hero .cta-row { display: flex; gap: 12px; margin-top: 36px; flex-wrap: wrap; }
.btn-primary, .btn-ghost { font-size: 14px; padding: 12px 22px; border-radius: var(--radius-md); text-decoration: none; font-weight: 500; transition: all 0.1s; display: inline-flex; align-items: center; gap: 8px; }
.btn-primary { background: var(--text-primary); color: var(--bg-base); border: 0.5px solid var(--text-primary); }
.btn-primary:hover { background: #000; }
.btn-ghost { background: transparent; color: var(--text-primary); border: 0.5px solid var(--border-default); }
.btn-ghost:hover { background: var(--bg-subtle); border-color: var(--border-strong); }
.btn-arrow { font-family: var(--font-mono); font-size: 12px; }

/* Marketing section — tight spacing, big anchor text */
.mkt-section { padding: 72px 24px; max-width: 1100px; margin: 0 auto; }
.mkt-section + .mkt-section { padding-top: 0; }
.mkt-section .label { font-family: var(--font-mono); font-size: 11px; color: var(--text-tertiary); letter-spacing: 1px; text-transform: uppercase; margin-bottom: 12px; }
.mkt-section h2 { font-size: 36px; line-height: 1.15; max-width: 720px; letter-spacing: -0.01em; font-weight: 500; }
.mkt-section .lede { font-size: 16px; color: var(--text-secondary); max-width: 640px; margin: 16px 0 0; line-height: 1.6; }
@media (max-width: 720px) { .mkt-section { padding: 48px 24px; } .mkt-section h2 { font-size: 28px; } }

/* Big quote / pull-quote */
.mkt-quote { padding: 96px 24px; background: var(--bg-subtle); border-top: 0.5px solid var(--border-subtle); border-bottom: 0.5px solid var(--border-subtle); }
.mkt-quote blockquote { max-width: 880px; margin: 0 auto; font-size: 32px; line-height: 1.3; letter-spacing: -0.01em; font-weight: 400; color: var(--text-primary); }
.mkt-quote cite { display: block; max-width: 880px; margin: 24px auto 0; font-style: normal; font-size: 13px; color: var(--text-tertiary); font-family: var(--font-mono); letter-spacing: 0.5px; }
@media (max-width: 720px) { .mkt-quote { padding: 56px 24px; } .mkt-quote blockquote { font-size: 22px; } }

/* Three / four column feature grid for product pages */
.mkt-features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 32px; margin-top: 48px; }
@media (max-width: 880px) { .mkt-features { grid-template-columns: 1fr; gap: 32px; } }
.mkt-feature h3 { font-size: 17px; font-weight: 500; margin-bottom: 8px; }
.mkt-feature p { font-size: 14px; color: var(--text-secondary); line-height: 1.6; margin: 0; }
.mkt-feature .icon-line { width: 28px; height: 1px; background: var(--text-primary); margin-bottom: 18px; }

/* Big numbers */
.mkt-numbers { display: grid; grid-template-columns: repeat(4, 1fr); gap: 32px; padding: 48px 0; border-top: 0.5px solid var(--border-subtle); border-bottom: 0.5px solid var(--border-subtle); margin-top: 48px; }
@media (max-width: 720px) { .mkt-numbers { grid-template-columns: repeat(2, 1fr); padding: 32px 0; } }
.mkt-number .big { font-size: 40px; font-weight: 500; letter-spacing: -0.02em; line-height: 1; }
.mkt-number .label-sm { font-family: var(--font-mono); font-size: 10px; color: var(--text-tertiary); letter-spacing: 0.5px; text-transform: uppercase; margin-top: 10px; }
.mkt-number .desc { font-size: 13px; color: var(--text-secondary); margin-top: 8px; line-height: 1.5; max-width: 220px; }

/* Pricing card */
.mkt-pricing { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 48px; }
@media (max-width: 880px) { .mkt-pricing { grid-template-columns: 1fr; } }
.price-card { padding: 32px 28px; background: var(--bg-surface); border: 0.5px solid var(--border-subtle); border-radius: var(--radius-lg); display: flex; flex-direction: column; }
.price-card.featured { border-color: var(--text-primary); background: var(--bg-base); position: relative; }
.price-card.featured::before { content: 'RECOMMENDED'; position: absolute; top: -10px; left: 28px; padding: 3px 10px; background: var(--text-primary); color: var(--bg-base); font-family: var(--font-mono); font-size: 9px; letter-spacing: 1px; border-radius: var(--radius-sm); }
.price-card .tier { font-size: 13px; color: var(--text-tertiary); font-family: var(--font-mono); letter-spacing: 0.5px; text-transform: uppercase; margin-bottom: 12px; }
.price-card .price { font-size: 42px; font-weight: 500; letter-spacing: -0.02em; line-height: 1; }
.price-card .price .unit { font-size: 13px; color: var(--text-tertiary); font-weight: 400; letter-spacing: normal; margin-left: 4px; }
.price-card .desc { font-size: 14px; color: var(--text-secondary); margin: 16px 0 24px; line-height: 1.55; }
.price-card ul { list-style: none; padding: 0; margin: 0 0 28px; flex: 1; }
.price-card ul li { font-size: 13px; color: var(--text-primary); padding: 8px 0; border-top: 0.5px solid var(--border-subtle); display: flex; gap: 10px; align-items: baseline; }
.price-card ul li::before { content: '+'; color: var(--text-tertiary); font-family: var(--font-mono); font-size: 11px; }
.price-card ul li:first-child { border-top: none; }
.price-card .btn-primary, .price-card .btn-ghost { width: 100%; justify-content: center; }

/* Product cards (grid on /products-live.html) */
.product-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin-top: 48px; }
@media (max-width: 880px) { .product-grid { grid-template-columns: 1fr; } }
.product-card { padding: 36px 32px; background: var(--bg-surface); border: 0.5px solid var(--border-subtle); border-radius: var(--radius-lg); text-decoration: none; color: inherit; transition: all 0.15s; display: flex; flex-direction: column; min-height: 280px; }
.product-card:hover { border-color: var(--text-primary); transform: translateY(-2px); }
.product-card .product-eyebrow { font-family: var(--font-mono); font-size: 10px; color: var(--text-tertiary); letter-spacing: 1px; text-transform: uppercase; margin-bottom: 14px; }
.product-card h3 { font-size: 26px; font-weight: 500; letter-spacing: -0.01em; line-height: 1.15; margin-bottom: 10px; }
.product-card p { font-size: 14px; color: var(--text-secondary); margin: 0; flex: 1; line-height: 1.55; }
.product-card .product-meta { display: flex; justify-content: space-between; align-items: center; margin-top: 24px; padding-top: 16px; border-top: 0.5px solid var(--border-subtle); font-family: var(--font-mono); font-size: 11px; }
.product-card .product-meta .price-from { color: var(--text-primary); font-weight: 500; }
.product-card .product-meta .arrow { color: var(--text-tertiary); }

/* Status pill on product cards */
.status-pill { padding: 3px 8px; border-radius: var(--radius-sm); font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.5px; text-transform: uppercase; display: inline-block; }
.status-pill.shipping { background: var(--hardened-bg); color: var(--hardened-fg); }
.status-pill.preview  { background: var(--quarantine-bg); color: var(--quarantine-fg); }
.status-pill.private  { background: var(--sealed-bg); color: var(--sealed-fg); }

/* Final CTA section */
.mkt-cta { padding: 96px 24px; text-align: center; }
.mkt-cta h2 { font-size: 44px; font-weight: 500; letter-spacing: -0.02em; line-height: 1.1; max-width: 780px; margin: 0 auto; }
.mkt-cta .lede { font-size: 18px; max-width: 560px; margin: 24px auto 36px; color: var(--text-secondary); line-height: 1.55; }
.mkt-cta .cta-row { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
@media (max-width: 720px) { .mkt-cta { padding: 64px 24px; } .mkt-cta h2 { font-size: 30px; } }

/* ═══════════════════════════════════════════════════════════════════════
   Blog surface — used by /blog-live.html and /blog/*.html.
   The blog is the canonical landing page for new model releases:
   indexed, filterable, with attestation blocks embedded in every post.
   ═══════════════════════════════════════════════════════════════════════ */

/* ---------- INDEX page ---------- */
.blog-hero { padding: 56px 24px 32px; max-width: 1100px; margin: 0 auto; }
.blog-hero .eyebrow { font-family: var(--font-mono); font-size: 11px; color: var(--text-secondary); letter-spacing: 1px; text-transform: uppercase; margin-bottom: 14px; }
.blog-hero h1 { font-size: 44px; line-height: 1.1; max-width: 820px; letter-spacing: -0.02em; font-weight: 500; }
.blog-hero .lede { font-size: 16px; max-width: 680px; margin: 18px 0 0; color: var(--text-secondary); line-height: 1.55; }
@media (max-width: 720px) { .blog-hero h1 { font-size: 32px; } }

/* Filter strip on index */
.blog-filters { max-width: 1100px; margin: 0 auto; padding: 0 24px 12px; display: flex; gap: 24px; flex-wrap: wrap; align-items: baseline; border-bottom: 0.5px solid var(--border-subtle); }
.blog-filters .group { display: flex; gap: 6px; align-items: baseline; flex-wrap: wrap; }
.blog-filters .group-label { font-family: var(--font-mono); font-size: 10px; color: var(--text-tertiary); letter-spacing: 0.8px; text-transform: uppercase; margin-right: 4px; }
.blog-filters .filter-chip { padding: 4px 10px; border-radius: var(--radius-sm); border: 0.5px solid var(--border-subtle); background: var(--bg-surface); font-size: 12px; cursor: pointer; transition: all 0.1s; font-family: var(--font-mono); letter-spacing: 0.3px; }
.blog-filters .filter-chip:hover { background: var(--bg-subtle); }
.blog-filters .filter-chip.active { background: var(--text-primary); color: var(--bg-base); border-color: var(--text-primary); }

/* Featured post (top of index) */
.blog-featured { max-width: 1100px; margin: 0 auto; padding: 32px 24px 16px; }
.blog-featured a { display: grid; grid-template-columns: 1.4fr 1fr; gap: 32px; padding: 32px; background: var(--bg-surface); border: 0.5px solid var(--border-subtle); border-radius: var(--radius-lg); text-decoration: none; color: inherit; transition: all 0.15s; }
.blog-featured a:hover { border-color: var(--text-primary); }
@media (max-width: 880px) { .blog-featured a { grid-template-columns: 1fr; } }
.blog-featured .feat-meta { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; font-family: var(--font-mono); font-size: 11px; }
.blog-featured .feat-pill { padding: 3px 8px; border-radius: var(--radius-sm); background: var(--text-primary); color: var(--bg-base); letter-spacing: 0.5px; }
.blog-featured h2 { font-size: 30px; line-height: 1.15; letter-spacing: -0.01em; font-weight: 500; margin-bottom: 14px; }
.blog-featured .feat-summary { font-size: 14px; color: var(--text-secondary); line-height: 1.6; }
.blog-featured .feat-side { display: flex; flex-direction: column; gap: 14px; align-self: center; }
.blog-featured .feat-side-stat { padding: 14px 16px; background: var(--bg-subtle); border-radius: var(--radius-md); }
.blog-featured .feat-side-stat .v { font-family: var(--font-mono); font-size: 16px; font-weight: 500; }
.blog-featured .feat-side-stat .l { font-family: var(--font-mono); font-size: 10px; color: var(--text-tertiary); letter-spacing: 0.5px; text-transform: uppercase; margin-top: 4px; }

/* Post list */
.blog-list { max-width: 1100px; margin: 0 auto; padding: 16px 24px 80px; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
@media (max-width: 880px) { .blog-list { grid-template-columns: 1fr; } }
.blog-list a { padding: 24px; background: var(--bg-surface); border: 0.5px solid var(--border-subtle); border-radius: var(--radius-md); text-decoration: none; color: inherit; transition: all 0.15s; display: flex; flex-direction: column; min-height: 200px; }
.blog-list a:hover { border-color: var(--text-primary); transform: translateY(-1px); }
.blog-list .post-meta { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 12px; font-family: var(--font-mono); font-size: 10px; color: var(--text-tertiary); letter-spacing: 0.5px; }
.blog-list h3 { font-size: 18px; line-height: 1.25; font-weight: 500; margin-bottom: 8px; }
.blog-list p { font-size: 13px; color: var(--text-secondary); line-height: 1.55; margin: 0; flex: 1; }
.blog-list .post-foot { display: flex; justify-content: space-between; align-items: baseline; margin-top: 16px; padding-top: 12px; border-top: 0.5px solid var(--border-subtle); font-family: var(--font-mono); font-size: 11px; color: var(--text-tertiary); }
.blog-list .post-foot .arrow { color: var(--text-primary); }

/* Tier pill on posts */
.tag-pill { padding: 2px 8px; border-radius: var(--radius-sm); font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.5px; }
.tag-pill.sealed    { background: var(--sealed-bg); color: var(--sealed-fg); }
.tag-pill.hardened  { background: var(--hardened-bg); color: var(--hardened-fg); }
.tag-pill.quarantine{ background: var(--quarantine-bg); color: var(--quarantine-fg); }
.tag-pill.editorial { background: var(--bg-base); color: var(--text-secondary); border: 0.5px solid var(--border-default); }
.tag-pill.family { background: var(--bg-subtle); color: var(--text-primary); border: 0.5px solid var(--border-subtle); }

/* ---------- POST page ---------- */
.post-hero { max-width: 760px; margin: 0 auto; padding: 64px 24px 32px; }
.post-hero .post-meta { font-family: var(--font-mono); font-size: 11px; color: var(--text-tertiary); letter-spacing: 0.5px; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 18px; }
.post-hero h1 { font-size: 44px; line-height: 1.1; letter-spacing: -0.02em; font-weight: 500; margin-bottom: 16px; }
.post-hero .post-lede { font-size: 17px; line-height: 1.6; color: var(--text-secondary); }
@media (max-width: 720px) { .post-hero { padding: 40px 24px 24px; } .post-hero h1 { font-size: 30px; } }

/* Tldr box */
.post-tldr { max-width: 760px; margin: 24px auto 0; padding: 22px 28px; background: var(--bg-subtle); border-left: 2px solid var(--text-primary); border-radius: 0 var(--radius-md) var(--radius-md) 0; }
.post-tldr .tldr-label { font-family: var(--font-mono); font-size: 10px; letter-spacing: 1px; text-transform: uppercase; color: var(--text-tertiary); margin-bottom: 8px; }
.post-tldr p { font-size: 14px; line-height: 1.6; margin: 0; color: var(--text-primary); }

/* Article body */
.post-body { max-width: 760px; margin: 0 auto; padding: 40px 24px 16px; }
.post-body h2 { font-size: 24px; font-weight: 500; letter-spacing: -0.01em; margin: 48px 0 16px; }
.post-body h3 { font-size: 17px; font-weight: 500; margin: 32px 0 10px; }
.post-body p { font-size: 15px; line-height: 1.7; color: var(--text-primary); margin: 0 0 16px; }
.post-body ul, .post-body ol { font-size: 15px; line-height: 1.7; color: var(--text-primary); margin: 0 0 16px; padding-left: 22px; }
.post-body li { margin-bottom: 6px; }
.post-body a { color: var(--text-primary); text-decoration: underline; text-decoration-color: var(--border-default); text-underline-offset: 3px; }
.post-body a:hover { text-decoration-color: var(--text-primary); }
.post-body code { font-family: var(--font-mono); font-size: 13px; background: var(--bg-subtle); padding: 1px 6px; border-radius: var(--radius-sm); }
.post-body pre { background: var(--bg-subtle); border: 0.5px solid var(--border-subtle); border-radius: var(--radius-md); padding: 18px 20px; overflow-x: auto; font-family: var(--font-mono); font-size: 13px; line-height: 1.5; margin: 16px 0; }
.post-body pre code { background: none; padding: 0; }

/* Spec block — "what you need to know" data sheet at top of every post */
.post-specs { max-width: 760px; margin: 32px auto 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; background: var(--border-subtle); border: 0.5px solid var(--border-subtle); border-radius: var(--radius-md); overflow: hidden; }
@media (max-width: 720px) { .post-specs { grid-template-columns: repeat(2, 1fr); } }
.post-specs .cell { padding: 14px 16px; background: var(--bg-surface); display: flex; flex-direction: column; gap: 4px; }
.post-specs .cell .l { font-family: var(--font-mono); font-size: 9px; letter-spacing: 0.8px; color: var(--text-tertiary); text-transform: uppercase; }
.post-specs .cell .v { font-family: var(--font-mono); font-size: 13px; color: var(--text-primary); }

/* Deploy block — shows the runtime/quant/platform options for this model */
.post-deploy { max-width: 760px; margin: 32px auto; }
.post-deploy h3 { font-size: 14px; font-weight: 500; font-family: var(--font-mono); letter-spacing: 0.8px; text-transform: uppercase; color: var(--text-tertiary); margin-bottom: 16px; }
.deploy-table { display: grid; grid-template-columns: 1.2fr 0.7fr 0.6fr 1fr 1fr; gap: 1px; background: var(--border-subtle); border: 0.5px solid var(--border-subtle); border-radius: var(--radius-md); overflow: hidden; font-size: 13px; }
.deploy-table > div { background: var(--bg-surface); padding: 10px 14px; }
.deploy-table .head { background: var(--bg-subtle); font-family: var(--font-mono); font-size: 10px; color: var(--text-tertiary); letter-spacing: 0.5px; text-transform: uppercase; padding: 8px 14px; }
.deploy-table .platform { font-weight: 500; }
.deploy-table .quant, .deploy-table .size, .deploy-table .runtime, .deploy-table .target { font-family: var(--font-mono); font-size: 11px; color: var(--text-secondary); }
.deploy-table .target { color: var(--text-primary); }
@media (max-width: 720px) {
  .deploy-table { grid-template-columns: 1fr 1fr; }
  .deploy-table .head:nth-child(n+3):nth-child(-n+5) { display: none; }
  .deploy-table > div:not(.head):nth-child(5n+2),
  .deploy-table > div:not(.head):nth-child(5n+3),
  .deploy-table > div:not(.head):nth-child(5n+4) { display: none; }
}

/* Attestation block — the unique-to-us payload */
.post-attest { max-width: 760px; margin: 32px auto; padding: 24px 28px; background: var(--bg-base); border: 0.5px solid var(--border-default); border-radius: var(--radius-md); }
.post-attest .label { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.8px; text-transform: uppercase; color: var(--text-tertiary); margin-bottom: 14px; display: flex; gap: 10px; align-items: center; }
.post-attest .label::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: #10A150; box-shadow: 0 0 0 3px rgba(16,161,80,0.18); }
.post-attest dl { display: grid; grid-template-columns: 130px 1fr; gap: 10px 18px; font-family: var(--font-mono); font-size: 12px; margin: 0; }
.post-attest dt { color: var(--text-tertiary); }
.post-attest dd { color: var(--text-primary); margin: 0; word-break: break-all; }
@media (max-width: 720px) { .post-attest dl { grid-template-columns: 1fr; } .post-attest dt { color: var(--text-tertiary); margin-top: 4px; } }
.post-attest .sig-row { margin-top: 14px; padding-top: 14px; border-top: 0.5px solid var(--border-subtle); display: flex; gap: 8px; flex-wrap: wrap; }
.post-attest .sig-row .panel-pill { padding: 3px 8px; border-radius: var(--radius-sm); background: var(--bg-surface); border: 0.5px solid var(--border-subtle); font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.3px; }

/* Bottom of post — related links and back to index */
.post-related { max-width: 760px; margin: 48px auto; padding: 32px 0; border-top: 0.5px solid var(--border-subtle); }
.post-related h4 { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.8px; text-transform: uppercase; color: var(--text-tertiary); margin-bottom: 16px; }
.post-related ul { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
@media (max-width: 720px) { .post-related ul { grid-template-columns: 1fr; } }
.post-related li a { display: block; padding: 14px 18px; background: var(--bg-surface); border: 0.5px solid var(--border-subtle); border-radius: var(--radius-md); text-decoration: none; color: inherit; transition: all 0.1s; }
.post-related li a:hover { border-color: var(--text-primary); }
.post-related li .title { font-size: 14px; font-weight: 500; line-height: 1.3; margin-bottom: 4px; }
.post-related li .desc { font-size: 12px; color: var(--text-secondary); font-family: var(--font-mono); }


/* FEATURED SEALED STRIP (auto-rendered above category grids) */
#featured-sealed { margin-bottom: 22px; }
.sealed-strip-row {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 10px;
}
.sealed-strip-card {
  display: block; text-decoration: none; color: inherit;
  background: var(--sealed-bg);
  border: 1px solid var(--sealed-accent);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  transition: transform 80ms ease, box-shadow 80ms ease;
}
.sealed-strip-card:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(0,0,0,0.22); }
.sealed-strip-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.sealed-strip-pulls { font-family: var(--font-mono); font-size: 10px; color: var(--sealed-fg); opacity: 0.7; }
.sealed-strip-name { font-size: 13.5px; font-weight: 500; color: var(--sealed-fg); margin: 2px 0 2px; line-height: 1.25; }
.sealed-strip-pub { font-family: var(--font-mono); font-size: 10.5px; color: var(--sealed-fg); opacity: 0.78; }
.sealed-strip-hash { font-family: var(--font-mono); font-size: 10px; color: var(--sealed-fg); opacity: 0.55; margin-top: 4px; }


/* ═══════════════════════════════════════════════════════════════════════
   UI refinements (M59) — focus rings, smooth color transitions,
   reduced-motion respect. Tokens unchanged; behavior only.
   ═══════════════════════════════════════════════════════════════════════ */

html { color-scheme: light dark; }

body,
.top-nav,
.metric-card,
.artifact-card,
.featured-card,
.sota-section,
.cat-card,
.product-card,
.price-card,
.mkt-quote,
.btn,
.btn-primary,
.btn-ghost,
.chip,
.search-input,
.sort-select,
.attest-block,
.deploy-table > div,
.post-specs .cell {
  transition: background-color 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
.chip:focus-visible,
.nav-tab:focus-visible,
.metric-card:focus-visible {
  outline: 2px solid var(--text-primary);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

/* Theme toggle button (rendered by SF.renderNav) */
.theme-toggle {
  appearance: none;
  background: transparent;
  border: 0.5px solid var(--border-default);
  color: var(--text-secondary);
  width: 28px; height: 28px;
  border-radius: var(--radius-sm);
  display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer;
  padding: 0;
  transition: background-color 0.12s, border-color 0.12s, color 0.12s;
}
.theme-toggle:hover { background: var(--bg-subtle); color: var(--text-primary); border-color: var(--border-strong); }
.theme-toggle svg { display: block; }
.theme-toggle .icon-sun  { display: none; }
.theme-toggle .icon-moon { display: block; }
[data-theme="dark"] .theme-toggle .icon-sun  { display: block; }
[data-theme="dark"] .theme-toggle .icon-moon { display: none; }

/* ═══════════════════════════════════════════════════════════════════════
   DARK MODE (M59) — explicit via [data-theme="dark"] and implicit via
   OS preference unless user has chosen light. Token overrides only;
   no layout changes. Add token overrides for the few hard-coded colors
   used inline in legacy rules.
   ═══════════════════════════════════════════════════════════════════════ */

[data-theme="dark"] {
  color-scheme: dark;
  --bg-base:        #0E0F11;
  --bg-surface:     #16181B;
  --bg-subtle:      #1E2024;
  --text-primary:   #ECEAE3;
  --text-secondary: #A6A49E;
  --text-tertiary:  #6E6C66;
  --border-subtle:  rgba(255,255,255,0.07);
  --border-default: rgba(255,255,255,0.16);
  --border-strong:  rgba(255,255,255,0.30);

  --sealed-bg:        #1F1C3E;
  --sealed-fg:        #C9C2FF;
  --sealed-accent:    #8E84F0;
  --hardened-bg:      #0F2D24;
  --hardened-fg:      #7BE3BD;
  --hardened-accent:  #2EBE93;
  --quarantine-bg:    #3A280F;
  --quarantine-fg:    #F0C079;
  --quarantine-accent:#DDA050;
  --interdicted-bg:   #3A1414;
  --interdicted-fg:   #F2A0A0;
  --interdicted-accent:#DA6262;

  --info-bg:        #122B45;
  --info-fg:        #95C8F4;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg-base:        #0E0F11;
    --bg-surface:     #16181B;
    --bg-subtle:      #1E2024;
    --text-primary:   #ECEAE3;
    --text-secondary: #A6A49E;
    --text-tertiary:  #6E6C66;
    --border-subtle:  rgba(255,255,255,0.07);
    --border-default: rgba(255,255,255,0.16);
    --border-strong:  rgba(255,255,255,0.30);

    --sealed-bg:        #1F1C3E;
    --sealed-fg:        #C9C2FF;
    --sealed-accent:    #8E84F0;
    --hardened-bg:      #0F2D24;
    --hardened-fg:      #7BE3BD;
    --hardened-accent:  #2EBE93;
    --quarantine-bg:    #3A280F;
    --quarantine-fg:    #F0C079;
    --quarantine-accent:#DDA050;
    --interdicted-bg:   #3A1414;
    --interdicted-fg:   #F2A0A0;
    --interdicted-accent:#DA6262;

    --info-bg:        #122B45;
    --info-fg:        #95C8F4;
  }
}

/* Overrides for hard-coded color literals in legacy rules. */
[data-theme="dark"] .btn.primary:hover { background: #d6d4cd; }
[data-theme="dark"] .btn-primary:hover { background: #ffffff; }
[data-theme="dark"] .featured-tag      { background: rgba(0,0,0,0.35); }
[data-theme="dark"] .prov-chip.dataset { background: #3A2D14; color: #F0C079; }
[data-theme="dark"] .paradigm-pill     { background: #2A1E40; color: #D0BCF0; }

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .btn.primary:hover { background: #d6d4cd; }
  :root:not([data-theme="light"]) .btn-primary:hover { background: #ffffff; }
  :root:not([data-theme="light"]) .featured-tag      { background: rgba(0,0,0,0.35); }
  :root:not([data-theme="light"]) .prov-chip.dataset { background: #3A2D14; color: #F0C079; }
  :root:not([data-theme="light"]) .paradigm-pill     { background: #2A1E40; color: #D0BCF0; }
}

/* Search-input SVG icon — recolor the stroke for dark mode so the
   magnifier remains visible against the dark surface. */
[data-theme="dark"] .search-input {
  background-image: url("data:image/svg+xml;utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 14 14'%3E%3Ccircle cx='6' cy='6' r='4.5' fill='none' stroke='%23A6A49E' stroke-width='1.2'/%3E%3Cline x1='9.5' y1='9.5' x2='12.5' y2='12.5' stroke='%23A6A49E' stroke-width='1.2' stroke-linecap='round'/%3E%3C/svg%3E");
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .search-input {
    background-image: url("data:image/svg+xml;utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 14 14'%3E%3Ccircle cx='6' cy='6' r='4.5' fill='none' stroke='%23A6A49E' stroke-width='1.2'/%3E%3Cline x1='9.5' y1='9.5' x2='12.5' y2='12.5' stroke='%23A6A49E' stroke-width='1.2' stroke-linecap='round'/%3E%3C/svg%3E");
  }
}

/* ─────────────────────────────────────────────────────────────────────
   M60 — UI refinements continued.
   1) nav: horizontal scroll with fade edges (no more 2-3 row wrap)
   2) cards: gentle hover lift + ring
   3) buttons: refined hover/active microstates
   4) skeletons: shimmer loading state to replace "loading..." text
   5) scrollbars: thin, themed
   6) tables: subtle zebra + better row dividers
   7) section headers: refined hierarchy
   ───────────────────────────────────────────────────────────────────── */

/* === 1) Nav: horizontal scroll with fade edges ===
   The .nav-tabs container becomes a single-row horizontal scroller; the
   .top-nav wrapper holds gradient overlays on left/right that fade out
   when the user scrolls to the corresponding end. Works in both themes. */
.nav-tabs {
  flex: 1;
  display: flex;
  flex-wrap: nowrap;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;          /* Firefox */
  -ms-overflow-style: none;       /* IE/old Edge */
  scroll-behavior: smooth;
  mask-image: linear-gradient(to right, transparent 0, #000 24px, #000 calc(100% - 24px), transparent 100%);
  -webkit-mask-image: linear-gradient(to right, transparent 0, #000 24px, #000 calc(100% - 24px), transparent 100%);
}
.nav-tabs::-webkit-scrollbar { display: none; } /* Chrome/Safari */
.nav-tabs .nav-tab { flex: 0 0 auto; white-space: nowrap; }

/* === 2) Cards: gentle hover lift + tier-tinted ring === */
.artifact-card,
.featured-card,
.cat-card,
.product-card,
.price-card,
.metric-card {
  transition: background-color 0.18s ease, border-color 0.18s ease,
              color 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
}
.artifact-card:hover,
.featured-card:hover,
.cat-card:hover,
.product-card:hover {
  transform: translateY(-1px);
  border-color: var(--border-default);
  box-shadow: 0 1px 0 var(--border-subtle), 0 8px 24px -12px rgba(0, 0, 0, 0.08);
}
[data-theme="dark"] .artifact-card:hover,
[data-theme="dark"] .featured-card:hover,
[data-theme="dark"] .cat-card:hover,
[data-theme="dark"] .product-card:hover {
  box-shadow: 0 1px 0 var(--border-default), 0 8px 24px -12px rgba(0, 0, 0, 0.6);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .artifact-card:hover,
  :root:not([data-theme="light"]) .featured-card:hover,
  :root:not([data-theme="light"]) .cat-card:hover,
  :root:not([data-theme="light"]) .product-card:hover {
    box-shadow: 0 1px 0 var(--border-default), 0 8px 24px -12px rgba(0, 0, 0, 0.6);
  }
}

/* === 3) Button microstates === */
.btn, .btn-primary, .btn-ghost {
  position: relative;
  transition: background-color 0.15s ease, border-color 0.15s ease,
              color 0.15s ease, transform 0.08s ease;
}
.btn:active,
.btn-primary:active,
.btn-ghost:active { transform: translateY(0.5px); }
.btn:disabled,
.btn-primary:disabled,
.btn-ghost:disabled { opacity: 0.55; cursor: not-allowed; transform: none !important; }

/* === 4) Skeleton loading shimmer ===
   Replace plain "loading..." text with .sf-skeleton block.
   Use in JS by setting innerHTML to `<div class="sf-skeleton"></div>`
   or by adding the class to any block that should show a shimmer. */
@keyframes sf-skeleton-shimmer {
  0%   { background-position: -200px 0; }
  100% { background-position: calc(200px + 100%) 0; }
}
.sf-skeleton {
  display: block;
  position: relative;
  background: var(--bg-subtle);
  background-image: linear-gradient(
    90deg,
    transparent 0,
    rgba(255, 255, 255, 0.45) 50%,
    transparent 100%
  );
  background-repeat: no-repeat;
  background-size: 200px 100%;
  background-position: -200px 0;
  border-radius: var(--radius-sm);
  min-height: 12px;
  animation: sf-skeleton-shimmer 1.4s ease-in-out infinite;
}
.sf-skeleton + .sf-skeleton { margin-top: 6px; }
.sf-skeleton.line-sm { height: 10px; }
.sf-skeleton.line-md { height: 14px; }
.sf-skeleton.line-lg { height: 20px; }
.sf-skeleton.w-25 { width: 25%; }
.sf-skeleton.w-40 { width: 40%; }
.sf-skeleton.w-60 { width: 60%; }
.sf-skeleton.w-80 { width: 80%; }
[data-theme="dark"] .sf-skeleton {
  background-image: linear-gradient(
    90deg,
    transparent 0,
    rgba(255, 255, 255, 0.06) 50%,
    transparent 100%
  );
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .sf-skeleton {
    background-image: linear-gradient(
      90deg,
      transparent 0,
      rgba(255, 255, 255, 0.06) 50%,
      transparent 100%
    );
  }
}
@media (prefers-reduced-motion: reduce) {
  .sf-skeleton { animation: none; background-image: none; }
}

/* === 5) Custom scrollbars (WebKit) === */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: var(--border-subtle);
  border-radius: 8px;
  border: 2px solid var(--bg-base);
}
::-webkit-scrollbar-thumb:hover { background: var(--border-default); }
* { scrollbar-color: var(--border-subtle) transparent; scrollbar-width: thin; }

/* === 6) Table refinements === */
table.sf-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
table.sf-table th {
  text-align: left;
  font-weight: 500;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-tertiary);
  padding: 10px 12px;
  border-bottom: 0.5px solid var(--border-default);
  background: transparent;
}
table.sf-table td {
  padding: 10px 12px;
  border-bottom: 0.5px solid var(--border-subtle);
  color: var(--text-secondary);
}
table.sf-table tbody tr:hover td { background: var(--bg-subtle); }
table.sf-table tbody tr:last-child td { border-bottom: none; }

/* === 7) Section header hierarchy === */
.section-title {
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-tertiary);
  margin: 0 0 8px 0;
}

/* Larger headings: tighten optical kerning */
h1, h2, h3 {
  letter-spacing: -0.01em;
}

/* === 8) Tighten clearance / live pill === */
.clearance-pill {
  background: var(--info-bg);
  color: var(--info-fg);
  font-size: 10.5px;
  font-weight: 500;
  padding: 4px 8px;
  border-radius: 999px;
  white-space: nowrap;
}
/* ─────────────────────────────────────────────────────────────────────
   M61 — Grouped nav dropdowns.
   Replaces the 35-tab horizontal scroll with 6 dropdown groups.
   Container `.nav-tabs.nav-grouped` reuses nav-tabs flex layout but
   does NOT need overflow-x scroll — 6 groups fit on every viewport.
   ───────────────────────────────────────────────────────────────────── */

.nav-tabs.nav-grouped {
  overflow: visible;                /* allow dropdowns to escape */
  mask-image: none;
  -webkit-mask-image: none;
  gap: 2px;
  flex-wrap: nowrap;
}

.nav-group {
  position: relative;
  flex: 0 0 auto;
}

.nav-group-trigger {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: transparent;
  border: none;
  font: inherit;
  font-size: 13px;
  font-weight: 400;
  color: var(--text-secondary);
  padding: 8px 12px;
  margin: 0;
  border-radius: var(--radius-sm);
  cursor: pointer;
  white-space: nowrap;
  transition: background-color 0.15s ease, color 0.15s ease;
}
/* Government flat tab — match trigger padding so it sits on the same baseline */
.nav-tabs.nav-grouped .nav-tab-top {
  padding: 8px 12px;
}
.nav-group-trigger .nav-caret {
  opacity: 0.55;
  transition: transform 0.18s ease, opacity 0.15s ease;
}
.nav-group-trigger:hover,
.nav-group-trigger:focus-visible {
  color: var(--text-primary);
  background: var(--bg-subtle);
}
.nav-group-trigger:hover .nav-caret,
.nav-group-trigger:focus-visible .nav-caret { opacity: 0.9; }
.nav-group-trigger.active {
  color: var(--text-primary);
  font-weight: 500;
}
.nav-group-trigger.active::after {
  content: "";
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: -1px;
  height: 1.5px;
  background: var(--text-primary);
  border-radius: 1px;
}
.nav-group.open .nav-group-trigger .nav-caret,
.nav-group:hover .nav-group-trigger .nav-caret,
.nav-group:focus-within .nav-group-trigger .nav-caret {
  transform: rotate(180deg);
}

.nav-group-menu {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  min-width: 184px;
  background: var(--bg-base);
  border: 0.5px solid var(--border-default);
  border-radius: var(--radius-md);
  box-shadow: 0 1px 0 var(--border-subtle), 0 12px 32px -16px rgba(0, 0, 0, 0.18);
  padding: 4px;
  display: flex;
  flex-direction: column;
  gap: 1px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-4px);
  transition: opacity 0.12s ease, transform 0.14s ease, visibility 0.12s ease;
  z-index: 100;
}
[data-theme="dark"] .nav-group-menu {
  box-shadow: 0 1px 0 var(--border-default), 0 16px 40px -20px rgba(0, 0, 0, 0.65);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .nav-group-menu {
    box-shadow: 0 1px 0 var(--border-default), 0 16px 40px -20px rgba(0, 0, 0, 0.65);
  }
}

/* Open on hover (desktop) OR focus-within (keyboard) OR explicit .open (tap/click) */
.nav-group:hover > .nav-group-menu,
.nav-group:focus-within > .nav-group-menu,
.nav-group.open > .nav-group-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.nav-menu-item {
  display: block;
  padding: 7px 12px;
  font-size: 13px;
  color: var(--text-secondary);
  text-decoration: none;
  border-radius: var(--radius-sm);
  white-space: nowrap;
  transition: background-color 0.12s ease, color 0.12s ease;
}
.nav-menu-item:hover,
.nav-menu-item:focus-visible {
  background: var(--bg-subtle);
  color: var(--text-primary);
}
.nav-menu-item.active {
  background: var(--bg-subtle);
  color: var(--text-primary);
  font-weight: 500;
}

/* Right-edge groups: flip the dropdown to align right so it doesn't overflow */
.nav-group:nth-last-child(-n+2) > .nav-group-menu {
  left: auto;
  right: 0;
}

@media (max-width: 720px) {
  .nav-group-trigger { padding: 8px 10px; font-size: 12px; }
  .nav-group-menu { min-width: 168px; }
}