/* TACO2Shell advisory styles, round 2. Tokens from art-r2/BRAND.md. About 90% neutral;
   red is reserved for critical severity. No dependencies; fonts are self-hosted. */

@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url(/assets/fonts/inter-latin.woff2) format("woff2");
}
@font-face {
  font-family: "JetBrains Mono";
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url(/assets/fonts/jetbrains-mono-latin.woff2) format("woff2");
}

:root {
  --bg: #FFFFFF;        --bg-2: #F6F7F9;      --surface: #FFFFFF;
  --border: #E4E7EB;    --border-2: #CDD2D8;
  --text: #0E1116;      --text-2: #535B66;    --text-3: #868D97;
  --ink: #0E1116;       --on-ink: #FFFFFF;
  --ink-hover: #2A3038;
  --crit: #E5484D;
  --crit-text: #C4262E;
  --crit-solid: #C4262E;
  --crit-tint: #FDECEC;
  --focus: #2F6FEB;
  --nav-bg: rgba(255, 255, 255, .92);
  --radius: 8px;
  --nav-h: 64px;
  --sans: Inter, "Segoe UI", Helvetica, Arial, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0B0D10;      --bg-2: #111418;      --surface: #15181D;
    --border: #23272E;  --border-2: #323842;
    --text: #EDEEF0;    --text-2: #A3AAB4;    --text-3: #6E7580;
    --ink: #F3F4F6;     --on-ink: #0B0D10;
    --ink-hover: #D5D8DD;
    --crit: #E5484D;    --crit-text: #FF7A7E; --crit-solid: #C4262E; --crit-tint: #2A1416;
    --focus: #7AA7FF;
    --nav-bg: rgba(11, 13, 16, .9);
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--nav-h) + 20px); -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 16.5px/1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img { max-width: 100%; height: auto; display: block; }
picture { display: block; }
a { color: var(--text); text-decoration: underline; text-decoration-color: var(--border-2); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { text-decoration-color: currentColor; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
strong { font-weight: 600; }
h1, h2, h3 { margin: 0; }
h2 { font: 600 28px/1.2 var(--sans); letter-spacing: -.02em; }
h3 { font: 600 18px/1.35 var(--sans); letter-spacing: -.01em; }
p { margin: 0 0 1em; }
code, .mono, .cve { font-family: var(--mono); font-weight: 500; }
code { font-size: .86em; }
.mono { font-size: .9em; }
:not(pre) > code {
  white-space: nowrap;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: .06em .32em;
}
:not(pre) > code.code-long { white-space: normal; overflow-wrap: anywhere; word-break: break-all; }
.cve { font-size: .9em; letter-spacing: 0; white-space: nowrap; }
pre .cve, h1 .cve { font-size: inherit; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip { position: absolute; left: 12px; top: -60px; z-index: 100; background: var(--ink); color: var(--on-ink); padding: 10px 14px; border-radius: var(--radius); font-weight: 600; text-decoration: none; }
.skip:focus { top: 12px; }

.wrap { max-width: 1240px; margin: 0 auto; padding: 0 24px; }
@media (max-width: 600px) { .wrap { padding: 0 16px; } }

/* ------------------------------------------------------------------ buttons, badges */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5em;
  font: 600 15px/1 var(--sans);
  padding: 14px 18px; border-radius: 6px; min-height: 44px;
  border: 1px solid transparent; cursor: pointer; text-decoration: none;
  transition: background-color .15s, border-color .15s;
}
.btn-primary { background: var(--ink); color: var(--on-ink); }
.btn-primary:hover { background: var(--ink-hover); }
.btn-secondary { background: var(--surface); color: var(--text); border-color: var(--border-2); }
.btn-secondary:hover { border-color: var(--text); }
.btn-sm { font-size: 14px; padding: 10px 16px; min-height: 40px; }

.hero-badges { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; margin: 0 0 28px; padding: 0; }
.badge {
  display: inline-flex; align-items: center; gap: 7px;
  font: 500 12.5px/1 var(--sans);
  padding: 7px 11px; border-radius: 999px; white-space: nowrap;
  border: 1px solid var(--border); color: var(--text-2); background: var(--surface);
}
.badge-mono, .badge-crit, .badge-solid { font-family: var(--mono); font-size: 12px; }
.badge-crit, .badge-solid { font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.badge-crit { color: var(--crit-text); border-color: var(--crit); }
.badge-solid { color: #FFFFFF; background: var(--crit-solid); border-color: var(--crit-solid); letter-spacing: .04em; }
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--crit); flex: none; }

/* ------------------------------------------------------------------ nav */
.site-nav {
  position: sticky; top: 0; z-index: 50;
  background: var(--nav-bg);
  -webkit-backdrop-filter: saturate(1.4) blur(10px); backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--border);
}
.nav-inner { display: flex; align-items: center; gap: 24px; height: var(--nav-h); }
.brand { display: block; text-decoration: none; flex: none; padding: 4px 0; }
.brand img { height: 30px; width: auto; }
.nav-links { display: flex; gap: 30px; margin-left: auto; }
.nav-links a { color: var(--text-2); text-decoration: none; font-size: 15px; font-weight: 500; }
.nav-links a:hover { color: var(--text); }
.nav-cta { flex: none; margin-left: auto; }
.nav-links + .nav-cta { margin-left: 0; }
@media (max-width: 880px) {
  .nav-links { display: none; }
  .nav-links + .nav-cta { margin-left: auto; }
}
@media (max-width: 360px) { .nav-cta { padding: 10px 12px; font-size: 13px; } .brand img { height: 26px; } }

/* ------------------------------------------------------------------ hero */
.hero { padding: 56px 0 72px; border-bottom: 1px solid var(--border); }
.hero-grid { display: grid; grid-template-columns: minmax(0, 600fr) minmax(0, 536fr); gap: 56px; align-items: start; }
.wordmark {
  font: 700 clamp(44px, 14.5vw, 88px)/1 var(--sans);
  letter-spacing: -.035em;
  color: var(--ink);
  margin: 0 0 30px;
  margin-left: -.04em;
}
.wordmark .two { color: var(--crit); }
.wordmark .shell { font-weight: 500; }
.tagline { font: 600 clamp(22px, 2.4vw, 30px)/1.22 var(--sans); letter-spacing: -.02em; max-width: 16.5em; margin: 0 0 20px; }
.lede { font-size: 17px; line-height: 1.62; color: var(--text-2); margin: 0 0 24px; max-width: 36em; }
.hero-stat { margin: 0 0 30px; padding: 2px 0 2px 16px; border-left: 2px solid var(--border-2); }
.stat { margin: 0 0 4px; display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.stat-num { font: 700 32px/1.1 var(--sans); letter-spacing: -.03em; color: var(--text); }
.stat-label { font-size: 17px; font-weight: 500; }
.stat-cap { font-size: 13px; line-height: 1.5; color: var(--text-2); }
.cta-row { display: flex; flex-wrap: wrap; gap: 10px; }
.credit {
  display: flex; align-items: center; gap: 24px;
  margin-top: 32px; padding-top: 28px; border-top: 1px solid var(--border);
}
.credit-badge { flex: none; }
.credit-badge img { height: 40px; width: auto; }
.credit p { margin: 0; font-size: 14px; line-height: 1.55; color: var(--text-2); }
.credit strong { color: var(--text); }

.hero-fig { margin: 0; }
.fig-panel { border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); padding: 8px; }
.fig-panel img { width: 100%; }
.hero-fig figcaption { margin-top: 12px; font-size: 13px; line-height: 1.5; color: var(--text-2); max-width: 46em; }

@media (min-width: 960px) {
  .wordmark { font-size: clamp(64px, 6.1vw, 88px); }
}
@media (max-width: 959px) {
  .hero { padding: 40px 0 56px; }
  .hero-grid { grid-template-columns: minmax(0, 1fr); gap: 44px; }
}
@media (max-width: 600px) {
  .wordmark { margin-bottom: 22px; }
  .hero-badges { margin-bottom: 22px; gap: 6px; }
  .cta-row .btn { flex: 1 1 100%; }
  .credit { flex-direction: column; align-items: flex-start; gap: 14px; }
  .fig-panel { padding: 4px; }
}

/* ------------------------------------------------------------------ layout + TOC */
.layout { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 64px; align-items: start; }
.toc { position: sticky; top: var(--nav-h); padding-top: 72px; }
.toc-title { font: 700 11.5px/1 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--text-2); margin: 0 0 14px; }
.toc ol, .toc-mobile ol { list-style: none; margin: 0; padding: 0; }
.toc li a {
  display: block; padding: 6px 0 6px 12px; border-left: 1px solid var(--border);
  color: var(--text-2); text-decoration: none; font-size: 14px; line-height: 1.4;
}
.toc li a:hover { color: var(--text); border-left-color: var(--border-2); }
.toc li a[aria-current] { color: var(--text); font-weight: 600; border-left: 2px solid var(--ink); padding-left: 11px; }
.toc-mobile { display: none; }
.content { min-width: 0; }

@media (max-width: 1023px) {
  .layout { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .toc { display: none; }
  .toc-mobile {
    display: block; margin: 32px 0 0;
    border: 1px solid var(--border); border-radius: var(--radius); background: var(--bg-2);
  }
  .toc-mobile summary {
    cursor: pointer; padding: 14px 16px; min-height: 44px;
    font: 700 12px/1.3 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--text-2);
  }
  .toc-mobile ol { padding: 0 16px 12px; }
  .toc-mobile a { display: block; padding: 8px 0; color: var(--text); text-decoration: none; border-top: 1px solid var(--border); }
}

/* ------------------------------------------------------------------ sections */
.sec { padding: 64px 0; border-top: 1px solid var(--border); }
.content > .sec:first-of-type { border-top: 0; }
.toc-mobile + .sec { border-top: 0; }
.sec > h2 { margin-bottom: 22px; }
.sec h3 { margin: 36px 0 12px; }
.sec p, .sec li { max-width: 46em; }
.sec ol, .sec ul { padding-left: 1.3em; margin: 0 0 1.2em; }
.sec li { margin: 0 0 .6em; }
.sec li::marker { color: var(--text-3); }
@media (max-width: 600px) {
  .sec { padding: 48px 0; }
  h2 { font-size: 24px; }
  body { font-size: 16px; }
}

blockquote.callout {
  margin: 28px 0; padding: 16px 20px; max-width: 46em;
  background: var(--bg-2); border: 1px solid var(--border); border-left: 3px solid var(--text-2);
  border-radius: 0 var(--radius) var(--radius) 0;
  font-size: 15.5px;
}
blockquote.callout p { margin: 0; }

/* ------------------------------------------------------------------ tables */
.table-wrap {
  margin: 24px 0; overflow-x: auto;
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--surface);
}
.tbl { width: 100%; border-collapse: collapse; font-size: 14.5px; line-height: 1.5; }
.tbl th, .tbl td { text-align: left; vertical-align: top; padding: 12px 16px; border-top: 1px solid var(--border); }
.tbl thead th {
  border-top: 0; background: var(--bg-2);
  font: 700 11.5px/1.3 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--text-2);
  white-space: nowrap;
}
.tbl tbody th { font-weight: 600; }
.tbl tbody th .cve { font-size: 13.5px; font-weight: 700; }
.tbl .mono { font-size: 13px; white-space: nowrap; }
.tbl-vulns tbody th { white-space: nowrap; }
.tbl-vulns td:nth-child(2) { width: 38%; }
.tbl-vulns td:nth-child(3) { width: 20%; }
.tbl-upgrade td:nth-child(2), .tbl-upgrade td:nth-child(3) { white-space: nowrap; }
.tbl-ioc td:nth-child(2) code { font-size: 12.5px; background: none; border: 0; padding: 0; border-radius: 0; }
.tbl-ioc tbody th { width: 1%; }
.tbl-timeline tbody th { width: 1%; white-space: nowrap; font-weight: 500; }
.table-note { font-size: 13.5px; color: var(--text-2); margin-top: -10px; }
.table-wrap:focus-visible { outline-offset: 2px; }

/* stacked "card" rows on small screens: no horizontal scrolling */
@media (max-width: 760px) {
  .table-wrap:has(.tbl-stack) { border: 0; background: none; overflow: visible; }
  .tbl-stack, .tbl-stack tbody, .tbl-stack tr, .tbl-stack th, .tbl-stack td { display: block; width: auto; }
  .tbl-stack thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .tbl-stack tr {
    border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface);
    margin: 0 0 12px; padding: 4px 0;
  }
  .tbl-stack th, .tbl-stack td { border-top: 0; padding: 6px 14px; white-space: normal !important; width: auto !important; }
  .tbl-stack tbody th { padding-top: 10px; width: auto; }
  .tbl-stack td::before {
    content: attr(data-label); display: block;
    font: 700 11px/1.3 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--text-2);
    margin-bottom: 2px;
  }
  .tbl-stack tr td:last-child { padding-bottom: 12px; }
}
@media (max-width: 480px) {
  .tbl-timeline th, .tbl-timeline td { padding: 10px 12px; }
  .tbl-timeline tbody th { white-space: normal; width: 6.5em; }
}

/* ------------------------------------------------------------------ code */
.code {
  margin: 20px 0 24px; border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--bg-2); overflow: hidden; max-width: 100%;
}
.code-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  min-height: 40px; padding: 6px 8px 6px 14px; border-bottom: 1px solid var(--border);
}
.code-lang { font: 700 11px/1 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--text-2); }
.copy-btn {
  font: 500 12px/1 var(--sans); color: var(--text-2); background: var(--surface);
  border: 1px solid var(--border); border-radius: 5px; padding: 6px 10px; cursor: pointer; min-height: 28px;
}
.copy-btn:hover { color: var(--text); border-color: var(--border-2); }
.copy-btn.copied { color: var(--text); }
.code pre {
  margin: 0; padding: 14px 16px; overflow-x: auto;
  font: 500 13px/1.65 var(--mono); color: var(--text);
  white-space: pre; tab-size: 2;
}
.code pre code { font-size: inherit; }
.t-com { color: var(--text-2); }
.t-key { font-weight: 700; }
.t-str, .t-num { color: var(--text); }

/* ------------------------------------------------------------------ Q&A, updates */
.qa-list { border-top: 1px solid var(--border); }
.qa { padding: 22px 0 8px; border-bottom: 1px solid var(--border); }
.qa h3 { margin: 0 0 8px; }
.sec .qa h3 { margin-top: 0; }

.updates { list-style: none; padding: 0 !important; margin: 0; }
.upd { position: relative; padding: 0 0 22px 22px; margin: 0 !important; border-left: 1px solid var(--border); max-width: 46em; }
.upd:last-child { padding-bottom: 0; }
.upd::before {
  content: ""; position: absolute; left: -4px; top: 7px; width: 7px; height: 7px;
  border-radius: 50%; background: var(--surface); border: 1px solid var(--text-3);
}
.upd p { margin: 0; }
.upd-when {
  display: block; margin-bottom: 4px;
  font: 600 12.5px/1.4 var(--mono); letter-spacing: .02em; color: var(--text-2);
}

/* ------------------------------------------------------------------ footer */
.site-footer { background: var(--bg-2); border-top: 1px solid var(--border); padding: 56px 0 64px; font-size: 14.5px; color: var(--text-2); }
.footer-grid { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 64px; }
.footer-brand img { height: 30px; width: auto; }
.site-footer h2 { font: 700 11.5px/1 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--text-2); margin: 6px 0 16px; }
.footer-text p { max-width: 52em; }
.footer-text strong { color: var(--text); }
.copyright { margin: 20px 0 0; font-size: 13px; }
@media (max-width: 1023px) { .footer-grid { grid-template-columns: minmax(0, 1fr); gap: 28px; } }

/* ------------------------------------------------------------------ toasts (unused on this page, kept for app.js) */
.toast-region { position: fixed; right: 16px; bottom: 16px; z-index: 80; display: grid; gap: 8px; }
.toast { background: var(--ink); color: var(--on-ink); padding: 12px 16px; border-radius: var(--radius); font-size: 14px; max-width: 340px; }
.toast.out { opacity: 0; transition: opacity .3s; }

/* ------------------------------------------------------------------ 404 */
body:has(.nf) { min-height: 100vh; display: flex; flex-direction: column; }
.nf { padding: 72px 0 96px; flex: 1; }
.nf-inner { max-width: 720px; }
.nf-code { font: 700 12px/1 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--text-2) !important; margin: 0 0 14px; display: flex; align-items: center; gap: 8px; }
.nf h1 { font: 700 clamp(30px, 5vw, 44px)/1.12 var(--sans); letter-spacing: -.03em; margin: 0 0 24px; }
.nf p { color: var(--text-2); max-width: 40em; }
.nf .cta-row { margin-top: 28px; }
.nf-footer { padding: 28px 0; }
.nf-log pre { white-space: pre-wrap; overflow-wrap: anywhere; }
.nf-footer .copyright { margin: 0; }

@media print {
  .site-nav, .toc, .toc-mobile, .copy-btn, .cta-row { display: none; }
  .layout { display: block; }
}
