/* DS2 Revival website. System fonts only; nothing is loaded from elsewhere. */
:root {
  color-scheme: dark;
  --bg: #12141a;
  --bg-2: #181b23;
  --surface: #1d212b;
  --surface-2: #252a36;
  --line: #2e3442;
  --text: #ecebe6;
  --text-2: #bdbbb2;
  --muted: #9b9991;
  --accent: #d6a645;
  --accent-ink: #1a1408;
  --link: #e7bd62;
  --series: #3987e5;
  --series-wash: rgba(57, 135, 229, 0.12);
  --grid: #2b303c;
  --ok: #3fb27f;
  --bad: #e66767;
  --bw: #9085e9;
  --ds2: #3987e5;
  --radius: 12px;
  --serif: Georgia, "Iowan Old Style", "Palatino Linotype", Palatino, "Times New Roman", serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "Cascadia Mono", Consolas, "SFMono-Regular", Menlo, monospace;
}
@media (prefers-color-scheme: light) {
  :root {
    color-scheme: light;
    --bg: #f6f4ef;
    --bg-2: #efece4;
    --surface: #fcfcfb;
    --surface-2: #f1efe9;
    --line: #dedad0;
    --text: #1b1a17;
    --text-2: #4a4843;
    --muted: #66645e;
    --accent: #8f6312;
    --accent-ink: #ffffff;
    --link: #8a5f10;
    --series: #2a78d6;
    --series-wash: rgba(42, 120, 214, 0.10);
    --grid: #e6e2d9;
    --ok: #17804f;
    --bad: #c23b3a;
    --bw: #6250d6;
    --ds2: #2a78d6;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font: 16px/1.6 var(--sans);
  color: var(--text);
  background: var(--bg);
  background-image: radial-gradient(1200px 500px at 50% -200px, rgba(214, 166, 69, 0.10), transparent 70%);
  background-repeat: no-repeat;
}
a { color: var(--link); text-underline-offset: 2px; }
a:hover { text-decoration-thickness: 2px; }
code, .mono { font-family: var(--mono); font-size: 0.9em; }
code { background: var(--surface-2); border: 1px solid var(--line); border-radius: 6px; padding: 0.05em 0.35em;
  overflow-wrap: break-word; -webkit-box-decoration-break: clone; box-decoration-break: clone; }
pre { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px;
  overflow-x: auto; font: 14px/1.5 var(--mono); }
pre code { background: none; border: 0; padding: 0; overflow-wrap: normal; word-break: normal; white-space: pre; }
h1, h2, h3, h4 { font-family: var(--serif); font-weight: 600; line-height: 1.2; letter-spacing: 0.005em; }
h1 { font-size: clamp(2rem, 4vw + 1rem, 3.2rem); margin: 0.6em 0 0.3em; text-wrap: balance; }
h2 { font-size: 1.6rem; margin: 1.8em 0 0.6em; }
h3 { font-size: 1.2rem; margin: 1.4em 0 0.4em; }
h4 { font-size: 1.05rem; margin: 0; }
p, ul, ol, dl { margin: 0 0 1em; }
p, li, dd, dt, td, th, h1, h2, h3, h4, figcaption { overflow-wrap: break-word; }
li { margin: 0.25em 0; }
.wrap { width: min(1140px, 100% - 32px); margin-inline: auto; }
.muted { color: var(--muted); }
.small { font-size: 0.9rem; }
.lead { font-size: 1.15rem; color: var(--text-2); max-width: 46em; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--accent); color: var(--accent-ink); padding: 8px 12px;
  border-radius: 8px; z-index: 10; }
.skip:focus { left: 8px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

/* header / footer */
.top { position: sticky; top: 0; z-index: 5; background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.top-inner { display: flex; align-items: center; gap: 24px; min-height: 60px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none;
  font-family: var(--serif); font-size: 1.2rem; }
.brand b { color: var(--accent); font-weight: 600; }
.top nav { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; flex: 1; justify-content: flex-end; }
.top nav a { color: var(--text-2); text-decoration: none; padding: 6px 10px; border-radius: 8px; white-space: nowrap;
  font-size: 0.95rem; }
.top nav a:hover { background: var(--surface-2); color: var(--text); }
.top nav a[aria-current="page"] { color: var(--text); background: var(--surface-2); box-shadow: inset 0 -2px 0 var(--accent); }
.foot { border-top: 1px solid var(--line); margin-top: 64px; padding: 24px 0 40px; color: var(--muted); font-size: 0.9rem; }
@media (max-width: 760px) {
  .top { position: static; }
  .top-inner { gap: 4px; padding: 8px 0; }
  .top nav { flex-basis: 100%; justify-content: flex-start; flex-wrap: wrap; overflow: visible; }
  .top nav a { padding: 6px 10px; }
}

/* hero */
.hero { padding: 40px 0 8px; }
.eyebrow { text-transform: uppercase; letter-spacing: 0.14em; font-size: 0.8rem; color: var(--accent); margin: 0; }
.actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 24px; }
.button { display: inline-block; background: var(--accent); color: var(--accent-ink); font-weight: 600;
  text-decoration: none; padding: 10px 18px; border-radius: 10px; border: 1px solid var(--accent); }
.button:hover { filter: brightness(1.08); }
.button.ghost { background: transparent; color: var(--text); border-color: var(--line); }
.button.ghost:hover { border-color: var(--accent); }

/* tiles */
.summary-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: 16px 0 12px; }
.tiles { display: grid; align-items: stretch; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin: 12px 0; }
.small-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.tile { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; }
.tile-label { color: var(--text-2); font-size: 0.9rem; }
.tile-value { font-size: clamp(1.7rem, 4vw, 2.2rem); font-weight: 650; line-height: 1.15; font-variant-numeric: tabular-nums; margin-top: 4px; }
.tile-value .unit { font-size: 0.95rem; font-weight: 500; color: var(--muted); margin-right: 6px; }
.tile-note { color: var(--muted); font-size: 0.85rem; margin-top: 2px; }
.stale { opacity: 0.6; }

.pill { display: inline-flex; align-items: center; gap: 6px; padding: 2px 10px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--surface); font-size: 0.85rem; font-weight: 600; white-space: nowrap; }
.pill .dot { width: 8px; height: 8px; border-radius: 50%; }
.pill.ok .dot { background: var(--ok); box-shadow: 0 0 0 3px color-mix(in srgb, var(--ok) 25%, transparent); }
.pill.bad .dot { background: var(--bad); }
.pill.bad { color: var(--bad); }

/* cards & grids */
.grid > *, .tiles > *, .steps > li, .two > *, .charts > *, .section-head > *, .portal-head > *, main > * { min-width: 0; }
.grid { display: grid; gap: 12px; }
.grid + p, .steps + p, .steps + .note, .table-wrap + p { margin-top: 14px; }
.features { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.portals { grid-template-columns: repeat(auto-fill, minmax(min(100%, 150px), 1fr)); }
.charts { grid-template-columns: repeat(auto-fit, minmax(min(100%, 440px), 1fr)); }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.card h3 { margin-top: 0; }
.card p:last-child { margin-bottom: 0; }
.portal-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.portal-head h4 { overflow-wrap: anywhere; }
.portal .count, .card .count { font-variant-numeric: tabular-nums; font-weight: 650; color: var(--muted); }
.portal.busy { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); }
.portal.busy .count { color: var(--text); }
.nicks { list-style: none; padding: 0; margin: 6px 0 0; display: flex; flex-wrap: wrap; gap: 4px; }
.nicks li { margin: 0; background: var(--surface-2); border-radius: 6px; padding: 1px 8px; font-size: 0.85rem;
  max-width: 100%; overflow-wrap: anywhere; }
.empty { background: var(--surface); border: 1px dashed var(--line); border-radius: var(--radius); padding: 18px 20px; }
.empty p:last-child { margin: 0; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
@media (max-width: 860px) { .two { grid-template-columns: 1fr; } }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.section-head h2 { margin-bottom: 0.6em; }

/* steps */
.steps { list-style: none; padding: 0; counter-reset: s; display: grid; gap: 12px;
  grid-template-columns: repeat(3, minmax(0, 1fr)); }
.steps > li { counter-increment: s; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px 18px 16px 62px; position: relative; margin: 0; }
.steps > li::before { content: counter(s); position: absolute; left: 16px; top: 16px; width: 32px; height: 32px;
  border-radius: 50%; background: var(--accent); color: var(--accent-ink); font-weight: 700; display: grid; place-items: center; }
.steps h3 { margin: 2px 0 6px; }
.prose .steps { grid-template-columns: 1fr; }
.steps p:last-child { margin-bottom: 0; }

/* column counts per width: no orphaned last row */
@media (max-width: 1000px) { .features { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 900px) { .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); } .steps { grid-template-columns: 1fr; } }
@media (max-width: 560px) { .features { grid-template-columns: 1fr; } }

/* tables */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
table { border-collapse: collapse; width: 100%; font-size: 0.95rem; }
th, td { text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-weight: 600; color: var(--text-2); background: var(--surface-2); white-space: nowrap; }
tbody tr:last-child td { border-bottom: 0; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
td.gname { font-weight: 600; overflow-wrap: anywhere; min-width: 12em; max-width: 26em; }
td code, th code { overflow-wrap: normal; }   /* identifiers stay whole; the table scrolls in its box instead */
@media (min-width: 600px) { td:first-child:not(.gname) { white-space: nowrap; } td:first-child wbr { display: none; } }   /* phones: break at <wbr> */
.tag { display: inline-flex; align-items: center; gap: 6px; font-size: 0.85rem; white-space: nowrap; }
.tag::before { content: ""; width: 10px; height: 10px; border-radius: 3px; background: var(--muted); }
.tag.ds2::before { background: var(--ds2); }
.tag.bw::before { background: var(--bw); }
.lock { font-size: 0.85em; }

/* tabs */
.tabs { display: inline-flex; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 3px; }
.tabs a { padding: 5px 12px; border-radius: 7px; color: var(--text-2); text-decoration: none; font-size: 0.9rem; }
.tabs a[aria-current="page"] { background: var(--surface-2); color: var(--text); font-weight: 600; }

/* charts */
.chart-card { margin: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px 16px 10px; }
.chart-card h3 { margin: 0; font-family: var(--sans); font-size: 1rem; }
.chart-card figcaption p { margin: 0 0 4px; }
.chart { position: relative; padding-top: 18px; }
.plot { position: relative; height: 170px; touch-action: pan-y; }
.chart-svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; display: block; }
.chart-svg .grid { stroke: var(--grid); stroke-width: 1; vector-effect: non-scaling-stroke; }
.chart-svg .line { fill: none; stroke: var(--series); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round;
  vector-effect: non-scaling-stroke; }
.chart-svg .area { fill: var(--series-wash); stroke: none; }
.chart-svg .ring { stroke: var(--surface); stroke-width: 12; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.chart-svg .dot { stroke: var(--series); stroke-width: 8; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.chart-svg .xhair { stroke: var(--muted); stroke-width: 1; vector-effect: non-scaling-stroke; }
.ylab { position: absolute; left: 0; transform: translateY(-100%); padding: 0 6px 2px 0; font-size: 0.75rem; line-height: 1.2;
  color: var(--muted); font-variant-numeric: tabular-nums; background: color-mix(in srgb, var(--surface) 75%, transparent);
  pointer-events: none; }
.y0 { top: 0; } .y1 { top: 25%; } .y2 { top: 50%; } .y3 { top: 75%; } .y4 { top: 100%; }
.xaxis { position: relative; height: 1.4em; margin-top: 6px; font-size: 0.75rem; color: var(--muted); }
.xl { position: absolute; top: 0; white-space: nowrap; transform: translateX(-50%); font-variant-numeric: tabular-nums; }
.x0 { left: 0; transform: none; } .x1 { left: 16.667%; } .x2 { left: 33.333%; } .x3 { left: 50%; }
.x4 { left: 66.667%; } .x5 { left: 83.333%; } .x6 { left: 100%; transform: translateX(-100%); }
@media (max-width: 560px) { .x1, .x3, .x5 { display: none; } .plot { height: 150px; }
  .tile { padding: 12px 14px; } .tile-label { font-size: 0.85rem; } }
.tip { position: absolute; top: 0; pointer-events: none; background: var(--surface-2); border: 1px solid var(--line);
  border-radius: 8px; padding: 4px 10px; font-size: 0.85rem; white-space: nowrap; box-shadow: 0 4px 14px rgba(0,0,0,0.25);
  z-index: 2; }
.tip strong { display: block; font-variant-numeric: tabular-nums; }
.tip span { color: var(--muted); }
.table-view { margin-top: 8px; font-size: 0.9rem; }
.table-view summary { cursor: pointer; color: var(--text-2); }
.table-view .table-wrap { max-height: 260px; overflow-y: auto; margin-top: 8px; }

/* prose pages */
.prose { max-width: 50em; }
.prose h2 { border-bottom: 1px solid var(--line); padding-bottom: 6px; }
.toc { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 18px; margin: 16px 0 24px; }
.toc ol { margin: 0; padding-left: 1.3em; columns: 2 16em; }
.note, .warn { border-left: 3px solid var(--accent); background: var(--surface); padding: 10px 14px; border-radius: 0 10px 10px 0; }
.warn { border-left-color: var(--bad); }
dl.faq dt { font-weight: 650; margin-top: 1em; }
dl.faq dd { margin: 0.2em 0 0.8em 0; color: var(--text-2); }
kbd { font: 0.85em var(--mono); border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 5px; padding: 0 5px; background: var(--surface-2); }

@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto; } }
@media (forced-colors: active) { .chart-svg .line, .chart-svg .dot { stroke: CanvasText; } .pill .dot { forced-color-adjust: none; } }
