/* ==========================================================================
   State of Agentic Coding — "dusk" design system, ported from the Sylin
   night-garden aesthetic (single dark theme, amber accent, system fonts, no
   webfonts/trackers) and extended with the data-matrix, picker, chart and
   long-form report components this content needs. Accent stays amber; semantic
   colours (green/amber/rose) carry meaning only in the privacy matrix.
   ========================================================================== */

:root {
  --bg: #0f0e12;
  --bg-2: #0d0c10;
  --panel: #131217;
  --panel-2: #0e0e11;
  --ink: #f4f4f5;
  --ink-2: #c9c9d1;
  --ink-3: #a1a1aa;
  --muted: #71717a;
  --faint: #52525b;
  --line: rgba(255, 255, 255, 0.06);
  --line-2: rgba(255, 255, 255, 0.1);
  --amber: #fbbf24;
  --amber-2: #fcd34d;
  --amber-rgb: 251, 191, 36;
  --good: #4ade80;
  --good-rgb: 74, 222, 128;
  --warn: #fbbf24;
  --bad: #fb7185;
  --bad-rgb: 251, 113, 133;
  --mono: 'Cascadia Code', 'JetBrains Mono', ui-monospace, Consolas, monospace;
  --sans: 'Segoe UI', system-ui, -apple-system, 'Helvetica Neue', Arial, sans-serif;
  --col: 1120px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
html, body { margin: 0; background: var(--bg); overflow-x: hidden; }
body { color: var(--ink-2); font-family: var(--sans); line-height: 1.7; -webkit-font-smoothing: antialiased; }
a { color: var(--ink-3); text-decoration: none; transition: color 0.25s; }
a:hover { color: var(--amber); }
a:focus-visible, button:focus-visible, input:focus-visible, th:focus-visible {
  outline: 2px solid var(--amber); outline-offset: 3px; border-radius: 2px;
}
h1, h2, h3, h4 { margin: 0; color: var(--ink); font-weight: 600; }

.wrap { max-width: var(--col); margin: 0 auto; padding: 0 32px; }
.narrow { max-width: 820px; margin: 0 auto; padding: 0 32px; }
.eyebrow { font-weight: 500; font-size: 11.5px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--amber); }
.mono { font-family: var(--mono); }
.muted { color: var(--muted); }

@keyframes twinkle { 0%, 100% { opacity: 0.12; transform: scale(0.7); } 50% { opacity: 0.95; transform: scale(1.15); } }
@keyframes glow { 0%, 100% { filter: drop-shadow(0 0 6px rgba(var(--amber-rgb), 0.4)); } 50% { filter: drop-shadow(0 0 16px rgba(var(--amber-rgb), 0.75)); } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto; } }

/* ---------- top bar ---------- */
.topbar { position: sticky; top: 0; z-index: 40; border-bottom: 1px solid var(--line); background: rgba(15, 14, 18, 0.94); backdrop-filter: blur(8px); }
.topbar .wrap { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 14px 28px; max-width: none; }
.topbar .brand { font-weight: 600; font-size: 13px; letter-spacing: 0.2em; color: var(--ink); white-space: nowrap; }
.topbar .brand { color: var(--amber); }
.topbar .brand { display: inline-flex; gap: 8px; align-items: center; }
.topbar .links { display: flex; gap: 22px; font-size: 14px; flex-wrap: wrap; justify-content: flex-end; }
.topbar .links a { color: var(--ink-3); }
.topbar .links a:hover { color: var(--amber); }
.topbar .links a.here { color: var(--amber); }
.topbar .links a.gh { color: var(--amber); }

/* ---------- persistent left rail ---------- */
:root { --rail-w: 236px; --topbar-h: 51px; }
.rail { position: fixed; top: var(--topbar-h); left: 0; width: var(--rail-w); bottom: 0; z-index: 30;
  overflow-y: auto; padding: 22px 20px 28px; border-right: 1px solid var(--line);
  background: var(--bg-2); display: flex; flex-direction: column; gap: 20px; }
.rail-cta { display: flex; flex-direction: column; gap: 10px; }
.rail-cta .btn { padding: 10px 14px; font-size: 13px; text-align: center; }
.rail-toc { font-size: 13px; }
.rail-toc > summary { list-style: none; font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted); margin-bottom: 10px; }
.rail-toc > summary::-webkit-details-marker { display: none; }
.rail-toc ol { list-style: none; margin: 0; padding: 0; }
.rail-toc li { margin: 0 0 2px; }
.rail-toc a { display: block; padding: 5px 10px; border-left: 2px solid transparent; border-radius: 0 6px 6px 0; color: var(--ink-3); line-height: 1.4; }
.rail-toc a:hover { color: var(--amber); background: rgba(255, 255, 255, 0.03); }
.rail-toc a.active { color: var(--amber); border-left-color: var(--amber); background: rgba(var(--amber-rgb), 0.06); }
.rail-foot { margin-top: auto; font-size: 11px; color: var(--faint); letter-spacing: 0.04em; }

.content { padding-left: var(--rail-w); }

/* ---------- hero ---------- */
.hero { position: relative; text-align: center; padding: 104px 32px 92px; overflow: hidden;
  min-height: 500px; display: flex; align-items: center; justify-content: center;
  background: #0f0e12 url('hero.jpg') center center / cover no-repeat; }
/* scrim: darker behind the centred headline, lighter at the edges so the dev
   (left) and the helper robots (right) stay visible; fades into the page at the
   bottom. */
.hero::before { content: ''; position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(ellipse 64% 94% at 50% 46%, rgba(15, 14, 18, 0.84) 0%, rgba(15, 14, 18, 0.56) 46%, rgba(15, 14, 18, 0.26) 100%),
    linear-gradient(to bottom, rgba(15, 14, 18, 0.4) 0%, transparent 24%, transparent 66%, #0f0e12 100%); }
.hero .star { position: absolute; border-radius: 50%; animation: twinkle 3.6s ease-in-out infinite; }
.hero-inner { max-width: 780px; margin: 0 auto; position: relative; z-index: 1; }
.hero h1, .hero .lede { text-shadow: 0 2px 22px rgba(0, 0, 0, 0.55); }
.hero .mark { font-size: 40px; line-height: 1; animation: glow 4.5s ease-in-out infinite; display: inline-block; margin-bottom: 18px; }
.hero h1 { font-size: 50px; line-height: 1.08; font-weight: 300; color: var(--ink); letter-spacing: -0.02em; }
.hero h1 em { font-style: normal; color: var(--amber); }
.hero .lede { margin: 22px auto 0; max-width: 640px; font-size: 18px; line-height: 1.6; color: var(--ink-2); }
.hero .prov { margin: 20px 0 0; font-size: 12.5px; color: var(--faint); font-family: var(--mono); }
.cta-row { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; margin-top: 28px; }
.btn { padding: 12px 22px; border-radius: 6px; font-size: 14px; transition: all 0.2s; display: inline-block; }
.btn-primary { background: var(--amber); color: #18181b; font-weight: 500; }
.btn-primary:hover { background: var(--amber-2); color: #18181b; transform: translateY(-2px); }
.btn-ghost { border: 1px solid rgba(255, 255, 255, 0.18); color: var(--ink); }
.btn-ghost:hover { border-color: rgba(255, 255, 255, 0.4); color: var(--ink); }

/* edition pill */
.edition-pill { display: inline-flex; align-items: center; gap: 8px; font-family: var(--mono); font-size: 12px;
  padding: 6px 12px; border-radius: 999px; color: var(--amber-2);
  background: rgba(var(--amber-rgb), 0.1); border: 1px solid rgba(var(--amber-rgb), 0.28); margin-bottom: 22px; }
.edition-pill .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--good); box-shadow: 0 0 8px var(--good); }

/* ---------- bands ---------- */
.band { border-top: 1px solid var(--line); }
.band.alt { background: var(--bg-2); }
.band .wrap { padding: 52px 32px; }
.band-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin-bottom: 26px; }
.band-head h2 { font-size: 26px; font-weight: 400; letter-spacing: -0.01em; }
.band-head p { margin: 6px 0 0; font-size: 14.5px; color: var(--muted); max-width: 620px; }
.band-note { margin-top: 20px; font-size: 13px; color: var(--muted); border-top: 1px solid var(--line); padding-top: 16px; }

/* ---------- stat callouts ---------- */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 20px; }
.stat { border-left: 2px solid rgba(var(--amber-rgb), 0.5); padding: 4px 0 4px 18px; }
.stat .n { font-size: 30px; font-weight: 600; color: var(--ink); line-height: 1.1; letter-spacing: -0.02em; }
.stat .n em { font-style: normal; color: var(--amber); }
.stat .k { font-size: 13.5px; color: var(--ink-3); margin-top: 6px; line-height: 1.5; }

/* ---------- picker ---------- */
.picker-box { max-width: 760px; }
.picker-search { position: relative; margin-bottom: 20px; }
.picker-search input { width: 100%; font-size: 15px; font-family: var(--sans); color: var(--ink);
  background: var(--panel); border: 1px solid var(--line-2); border-radius: 10px; padding: 14px 16px; }
.picker-search input::placeholder { color: var(--faint); }
.pick-list { display: flex; flex-direction: column; gap: 10px; }
.pick-row { display: grid; grid-template-columns: 1fr auto 1.1fr; gap: 16px; align-items: center;
  background: rgba(255, 255, 255, 0.02); border: 1px solid var(--line-2); border-radius: 12px; padding: 16px 18px; }
.pick-row .sit { color: var(--ink-2); font-size: 15px; }
.pick-row .arrow { color: var(--amber); font-size: 18px; }
.pick-row .pick { color: var(--ink); font-weight: 500; font-size: 15px; }
.pick-row .pick a { color: var(--amber-2); }
.pick-row .pick .why { display: block; margin-top: 4px; font-weight: 400; font-size: 12.5px; color: var(--muted); }
.pick-row[hidden] { display: none; }
#picker-empty { color: var(--muted); font-size: 14px; padding: 10px 2px; }
@media (max-width: 640px) { .pick-row { grid-template-columns: 1fr; gap: 4px; } .pick-row .arrow { display: none; } }

/* ---------- data matrices / tables ---------- */
.table-scroll { overflow-x: auto; border: 1px solid var(--line-2); border-radius: 12px; }
table.matrix { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.matrix th, table.matrix td { text-align: left; padding: 11px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.matrix thead th { position: sticky; top: 0; background: var(--panel-2); color: var(--ink); font-weight: 600;
  font-size: 12px; letter-spacing: 0.03em; white-space: nowrap; z-index: 1; }
table.matrix tbody tr:hover { background: rgba(255, 255, 255, 0.025); }
table.matrix tbody tr:last-child td { border-bottom: none; }
table.matrix td:first-child { color: var(--ink); font-weight: 500; }
table.matrix a { color: var(--amber-2); }
table.matrix .num { font-family: var(--mono); }

/* privacy semantic pills */
.pill { display: inline-block; font-size: 11.5px; font-weight: 500; padding: 3px 9px; border-radius: 999px; line-height: 1.5; }
.pill.yes { color: var(--good); background: rgba(var(--good-rgb), 0.12); border: 1px solid rgba(var(--good-rgb), 0.3); }
.pill.caution { color: var(--amber); background: rgba(var(--amber-rgb), 0.12); border: 1px solid rgba(var(--amber-rgb), 0.3); }
.pill.no { color: var(--bad); background: rgba(var(--bad-rgb), 0.12); border: 1px solid rgba(var(--bad-rgb), 0.3); }

/* ---------- charts ---------- */
.chart { margin: 8px 0 4px; }
.bar-row { display: grid; grid-template-columns: 190px 1fr; gap: 14px; align-items: center; margin: 9px 0; font-size: 13px; }
.bar-row .lbl { color: var(--ink-2); text-align: right; }
.bar-row .lbl .sub { display: block; color: var(--faint); font-size: 11px; }
.bar-track { position: relative; background: rgba(255, 255, 255, 0.04); border-radius: 5px; height: 26px; }
.bar-fill { position: absolute; inset: 0 auto 0 0; border-radius: 5px; background: linear-gradient(90deg, rgba(var(--amber-rgb), 0.55), rgba(var(--amber-rgb), 0.9));
  display: flex; align-items: center; justify-content: flex-end; padding-right: 8px; font-family: var(--mono); font-size: 11.5px; color: #18181b; font-weight: 600; min-width: 30px; }
.bar-fill.muted { background: linear-gradient(90deg, rgba(255,255,255,0.12), rgba(255,255,255,0.22)); color: var(--ink); }
.chart-legend { font-size: 12px; color: var(--muted); margin-top: 12px; }
@media (max-width: 560px) { .bar-row { grid-template-columns: 120px 1fr; } }

/* ---------- report: sticky TOC + prose ---------- */
.page-hero { position: relative; overflow: hidden; padding: 64px 32px 40px;
  background: radial-gradient(ellipse 90% 80% at 30% -10%, #1d1a28 0%, #131218 55%, #0f0e12 100%); }
.page-hero .wrap { max-width: var(--col); }
.page-hero h1 { font-size: 40px; font-weight: 300; letter-spacing: -0.01em; }
.page-hero .lede { margin: 16px 0 0; max-width: 720px; font-size: 17px; color: var(--ink-2); }
.page-hero .prov { margin-top: 14px; font-size: 12px; color: var(--faint); font-family: var(--mono); }

/* report prose sits full-width in the content column; the rail carries the TOC */
.report-wrap { max-width: var(--col); margin: 0 auto; padding: 40px 32px 64px; }

/* prose (rendered markdown) */
.prose { max-width: 760px; }
.prose h1 { font-size: 30px; font-weight: 300; margin: 0 0 20px; }
.prose h2 { font-size: 23px; font-weight: 500; margin: 48px 0 14px; padding-top: 12px; scroll-margin-top: 78px; }
.prose h2:first-of-type { margin-top: 8px; }
.prose h3 { font-size: 17px; font-weight: 600; color: var(--ink-2); margin: 30px 0 10px; scroll-margin-top: 78px; }
.prose p, .prose li { font-size: 15.5px; line-height: 1.75; color: var(--ink-3); }
.prose strong { color: var(--ink); font-weight: 600; }
.prose em { color: var(--ink-2); }
.prose a { color: var(--amber-2); border-bottom: 1px solid rgba(var(--amber-rgb), 0.25); }
.prose a:hover { color: var(--amber); }
.prose ul, .prose ol { padding-left: 22px; }
.prose li { margin: 6px 0; }
.prose blockquote { border-left: 3px solid rgba(var(--amber-rgb), 0.4); margin: 18px 0; padding: 4px 0 4px 18px; color: var(--ink-2); }
.prose code { font-family: var(--mono); font-size: 0.88em; background: rgba(255, 255, 255, 0.06); padding: 1px 6px; border-radius: 4px; color: var(--amber-2); }
.prose pre { background: #0a090c; border: 1px solid var(--line-2); border-radius: 10px; padding: 16px; overflow-x: auto; }
.prose pre code { background: none; padding: 0; color: var(--ink-2); }
.prose hr { border: none; border-top: 1px solid var(--line); margin: 34px 0; }
.prose .header-anchor { color: var(--faint); text-decoration: none; border: none; margin-left: 8px; opacity: 0; font-weight: 400; }
.prose h2:hover .header-anchor, .prose h3:hover .header-anchor { opacity: 1; }
.prose table { width: 100%; border-collapse: collapse; font-size: 13px; margin: 18px 0; display: block; overflow-x: auto; }
.prose th, .prose td { text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.prose thead th { background: var(--panel-2); color: var(--ink); font-weight: 600; white-space: nowrap; }
.prose td:first-child { color: var(--ink-2); }

/* command / prompt block (methodology) */
.copy-host { position: relative; }
.copy-btn { position: absolute; top: 10px; right: 10px; display: inline-flex; align-items: center; gap: 5px; font-family: var(--sans);
  font-size: 11px; color: var(--faint); background: rgba(255, 255, 255, 0.05); border: 1px solid var(--line-2); border-radius: 6px;
  padding: 5px 8px; cursor: pointer; opacity: 0.6; transition: opacity 0.15s, color 0.15s; }
.copy-host:hover .copy-btn { opacity: 1; }
.copy-btn:hover { color: var(--ink); }
.copy-btn.copied { color: var(--good); border-color: rgba(var(--good-rgb), 0.4); opacity: 1; }

/* ---------- footer ---------- */
.foot { border-top: 1px solid var(--line); background: var(--bg); }
.foot .wrap { padding: 32px 32px; }
.foot-row { display: flex; flex-wrap: wrap; gap: 12px 20px; align-items: center; justify-content: space-between; }
.foot-row .prov { font-size: 12.5px; color: var(--ink-3); }
.colophon { margin-top: 14px; font-size: 12px; color: var(--faint); line-height: 1.7; max-width: 900px; }
.colophon a { color: var(--muted); }
.colophon a:hover { color: var(--amber); }
.reuse { margin-top: 14px; padding: 12px 16px; max-width: 900px; font-size: 12.5px; line-height: 1.7;
  color: var(--ink-3); background: rgba(var(--amber-rgb), 0.05); border: 1px solid rgba(var(--amber-rgb), 0.2); border-radius: 8px; }
.reuse strong { color: var(--amber-2); }
.reuse a { color: var(--amber-2); }

/* reuse callout (data page top) */
.callout { max-width: var(--col); margin: 0 auto; padding: 22px 32px 0; }
.callout .inner { padding: 16px 18px; border-radius: 10px; font-size: 14px; line-height: 1.65; color: var(--ink-2);
  background: rgba(var(--amber-rgb), 0.06); border: 1px solid rgba(var(--amber-rgb), 0.24); }
.callout .inner strong { color: var(--amber-2); }
.callout .inner a { color: var(--amber-2); }

/* rail collapses below the top bar on narrow screens: static block, TOC folds */
@media (max-width: 980px) {
  .content { padding-left: 0; }
  .rail { position: static; width: auto; height: auto; bottom: auto; border-right: none;
    border-bottom: 1px solid var(--line); flex-direction: row; flex-wrap: wrap; align-items: center;
    gap: 12px 20px; padding: 14px 20px; }
  .rail-cta { flex-direction: row; }
  .rail-toc { flex: 1 1 100%; }
  .rail-toc > summary { display: block; cursor: pointer; margin-bottom: 8px; }
  .rail-toc[open] > summary { color: var(--amber); }
  .rail-toc ol { columns: 2; column-gap: 24px; }
  .rail-foot { display: none; }
}
@media (min-width: 981px) {
  /* on desktop the rail is always open and not collapsible */
  .rail-toc > summary { pointer-events: none; }
}

@media (max-width: 720px) {
  .hero h1 { font-size: 36px; }
  .page-hero h1 { font-size: 30px; }
  .band .wrap { padding: 40px 24px; }
  .wrap, .topbar .wrap { padding-left: 20px; padding-right: 20px; }
  .rail-toc ol { columns: 1; }
}
