/* Data centre design reference: one stylesheet, no web fonts, no third-party requests.
   Palette: deep teal accent on cool slate neutrals, amber for hazards. Every colour is a token below, light and dark.
   Content classes fragments may use: .lede .panel .grid2 .grid3 .callout .chip .figures .kv .small .muted .eyebrow
   figure.schematic, .model3d, .tablewrap (optional: bare tables scroll on their own). */
:root {
  color-scheme: light dark;
  --bg: #edf1f2; --surface: #f9fbfb; --surface-2: #e1e8ea; --ink: #10191d; --ink-2: #3c4b52; --muted: #56676f;
  --line: #c3cfd3; --line-strong: #8a9ba2; --accent: #0b7b80; --accent-ink: #075f64; --accent-soft: #d3ecec;
  --hazard: #c98a0b; --hazard-soft: #f6e6c2; --copper: #a34c22; --water-cold: #1d5a85; --water-warm: #6a8fa8; --ok: #23824f; --warn: #b7770a; --crit: #c23b2c;
  --font-display: "Arial Narrow", "Roboto Condensed", sans-serif-condensed, system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-body: system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --measure: 70ch;
  --radius: 3px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b1316; --surface: #111c20; --surface-2: #18262b; --ink: #e3ecee; --ink-2: #a9babf; --muted: #7b8d94;
    --line: #243439; --line-strong: #46595f; --accent: #3fbfbf; --accent-ink: #74d3d1; --accent-soft: #0e3437;
    --hazard: #eaa92d; --hazard-soft: #3a2d10; --copper: #e58a5a; --water-cold: #7fb6e0; --water-warm: #93aec0; --ok: #46b57a; --warn: #e3a33a; --crit: #e2604f;
  }
}
* { box-sizing: border-box; }
html { scroll-padding-top: 16px; -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--font-body); font-size: 16px; line-height: 1.55; -webkit-font-smoothing: antialiased; overflow-wrap: break-word; }
h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 600; letter-spacing: 0.01em; text-wrap: balance; margin: 0; line-height: 1.12; }
h1 { font-size: clamp(32px, 5vw, 48px); }
h2 { font-size: clamp(26px, 3.2vw, 34px); }
h3 { font-size: 22px; }
h4 { font-size: 18px; }
p, ul, ol, dl { margin: 0; }
p { max-width: var(--measure); }
ul, ol { padding-left: 22px; max-width: 80ch; }
li + li { margin-top: 6px; }
p + p, p + ul, p + ol, ul + p, ol + p, section > * + * { margin-top: 14px; }
section > h2 + * { margin-top: 0; }
h3 { margin-top: 28px; }
h4 { margin-top: 18px; }
a { color: var(--accent-ink); }
code, kbd, .mono { font-family: var(--font-mono); font-size: 0.88em; }
img { max-width: 100%; height: auto; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.eyebrow { font-family: var(--font-mono); font-size: 12px; text-transform: uppercase; letter-spacing: 0.12em; color: var(--muted); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.skip { position: absolute; left: 8px; top: -60px; z-index: 10; padding: 8px 12px; background: var(--surface); border: 1px solid var(--line-strong); }
.skip:focus { top: 8px; }

/* header */
.site-head { background: var(--surface); border-bottom: 1.5px solid var(--ink); }
.site-head-in { max-width: 2560px; margin: 0 auto; padding: 14px 16px 6px; }
.brand { display: inline-block; font-family: var(--font-display); font-size: 26px; font-weight: 600; letter-spacing: 0.01em; color: var(--ink); text-decoration: none; line-height: 1.1; }
.tagline { margin-top: 2px; }
.site-nav ul { list-style: none; margin: 8px 0 0; padding: 0; max-width: none; display: flex; flex-wrap: wrap; gap: 0 4px; }
.site-nav li + li { margin-top: 0; }
.site-nav a { display: inline-block; padding: 7px 10px; font-size: 14.5px; color: var(--ink-2); text-decoration: none; border-bottom: 2px solid transparent; }
.site-nav a:hover { color: var(--ink); border-bottom-color: var(--line-strong); }
.site-nav a[aria-current="page"] { color: var(--ink); font-weight: 600; border-bottom-color: var(--accent); }

/* layout: left table of contents and one reading column */
.sheet { --nav: clamp(208px, 15vw, 240px); max-width: 2560px; margin: 0 auto; padding: 24px 16px 64px; display: grid; grid-template-columns: var(--nav) minmax(0, 1fr); gap: clamp(20px, 2vw, 32px); }
.sheet.no-toc { grid-template-columns: minmax(0, 1fr); }
main { min-width: 0; }
.page-head { margin-bottom: 8px; }
.lede { font-size: 18px; color: var(--ink-2); max-width: 66ch; margin-top: 12px; }
nav.index { position: sticky; top: 16px; align-self: start; max-height: calc(100vh - 32px); overflow: auto; padding-top: 6px; }
nav.index ol, .toc-m ol { list-style: none; margin: 0; padding: 0; counter-reset: toc; border-left: 1px solid var(--line); }
nav.index li, .toc-m li { margin: 0; }
nav.index a, .toc-m a { counter-increment: toc; display: grid; grid-template-columns: 32px 1fr; gap: 4px; padding: 5px 10px; font-size: 14px; color: var(--ink-2); text-decoration: none; border-left: 2px solid transparent; margin-left: -1px; }
nav.index a::before, .toc-m a::before { content: counter(toc, decimal-leading-zero); font-family: var(--font-mono); font-size: 12px; color: var(--muted); padding-top: 1px; }
nav.index a:hover, .toc-m a:hover { color: var(--ink); border-left-color: var(--accent); }
.toc-m { display: none; margin-bottom: 20px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.toc-m summary { cursor: pointer; padding: 12px 14px; font-weight: 600; min-height: 44px; }
.toc-m ol { margin: 0 0 8px; }
@media (max-width: 980px) {
  .sheet { grid-template-columns: minmax(0, 1fr); gap: 0; padding-top: 16px; }
  nav.index { display: none; }
  .toc-m { display: block; }
}

/* sections: numbered by CSS, rule under the heading */
main { counter-reset: part; }
main > section { counter-increment: part; margin-top: 56px; scroll-margin-top: 16px; }
main > section > h2 { display: flex; align-items: baseline; gap: 14px; border-bottom: 1.5px solid var(--ink); padding-bottom: 8px; margin-bottom: 18px; }
main > section > h2::before { content: counter(part, decimal-leading-zero); font-family: var(--font-mono); font-size: 14px; font-weight: 400; color: var(--muted); min-width: 30px; }

/* panels, tables, key figures */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; min-width: 0; }
.grid2, .grid3 { display: grid; gap: 16px; }
.grid2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 860px) { .grid2, .grid3 { grid-template-columns: minmax(0, 1fr); } }
table { display: block; max-width: 100%; overflow-x: auto; border-collapse: collapse; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); font-size: 14px; }
.tablewrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.tablewrap table { display: table; width: 100%; border: 0; }
th, td { text-align: left; vertical-align: top; padding: 8px 10px; border-bottom: 1px solid var(--line); }
th { font-family: var(--font-mono); font-weight: 500; font-size: 12px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); background: var(--surface-2); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
tr:last-child td { border-bottom: 0; }
.figures { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); }
.figures div { background: var(--surface); padding: 12px 14px; min-width: 0; }
.figures b { display: block; font-family: var(--font-display); font-size: 30px; font-weight: 600; line-height: 1.05; }
.figures span { display: block; margin-top: 4px; font-size: 13px; color: var(--muted); line-height: 1.35; }
.kv { display: grid; grid-template-columns: minmax(120px, max-content) minmax(0, 1fr); gap: 6px 16px; font-size: 15px; }
.kv dt { color: var(--muted); font-family: var(--font-mono); font-size: 12px; padding-top: 3px; }
.kv dd { margin: 0; }
.chip { display: inline-flex; align-items: center; gap: 5px; font-family: var(--font-mono); font-size: 12px; padding: 2px 7px; border-radius: 99px; border: 1px solid var(--line-strong); color: var(--ink-2); white-space: nowrap; }
.chip.ok { border-color: var(--ok); color: var(--ok); }
.chip.warn { border-color: var(--warn); color: var(--warn); }
.chip.crit { border-color: var(--crit); color: var(--crit); }
.callout { border-left: 3px solid var(--hazard); background: var(--hazard-soft); padding: 12px 14px; border-radius: 0 var(--radius) var(--radius) 0; max-width: 78ch; }
.callout.info { border-left-color: var(--accent); background: var(--accent-soft); }
pre { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; overflow-x: auto; font-family: var(--font-mono); font-size: 13px; line-height: 1.5; margin: 0; }

/* figures: a schematic scrolls sideways on a narrow screen, the page never does */
figure { margin: 0; }
figure.schematic { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px; overflow-x: auto; 
  --sch-ink: var(--ink); --sch-fill: var(--surface); --sch-muted: var(--muted); --sch-accent: var(--copper);
  --sch-supply: var(--water-cold); --sch-return: var(--water-warm); --sch-dc: var(--hazard); --sch-font: var(--font-mono); }
figure.schematic svg { display: block; width: 100%; height: auto; min-width: 640px; }
figcaption { position: sticky; left: 0; font-size: 13.5px; color: var(--muted); margin-top: 8px; padding-inline: 4px; max-width: 90ch; }
.model3d { display: flex; align-items: center; justify-content: center; min-height: 280px; aspect-ratio: 16 / 9; max-width: 100%; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); color: var(--muted); text-align: center; }
.model3d canvas { display: block; width: 100%; height: 100%; }

/* citations and the sources list */
sup.cite { font-size: 0.72em; line-height: 0; margin-left: 1px; }
sup.cite a { text-decoration: none; padding: 0 1px; font-family: var(--font-mono); }
sup.cite a:hover { text-decoration: underline; }
ol.sources { max-width: 90ch; font-size: 14.5px; }
ol.sources li::marker { font-family: var(--font-mono); color: var(--muted); }
ol.sources li:target { background: var(--accent-soft); }
.src-url { display: block; font-family: var(--font-mono); font-size: 12.5px; overflow-wrap: anywhere; }

/* footer */
.site-foot { border-top: 1.5px solid var(--ink); background: var(--surface); }
.site-foot-in { max-width: 2560px; margin: 0 auto; padding: 18px 16px 28px; font-size: 14px; color: var(--ink-2); }
.site-foot p + p { margin-top: 6px; }

@media (max-width: 760px) {
  body { font-size: 16px; }
  table, figcaption, .small { font-size: 14px; }
  .kv { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .kv dt { padding-top: 8px; }
  .brand { font-size: 24px; }
}
@media (pointer: coarse) { .site-nav a, .toc-m a, .skip { min-height: 44px; display: inline-flex; align-items: center; } .toc-m a { display: grid; } }
@media print {
  .site-nav, nav.index, .toc-m, .skip { display: none !important; }
  .sheet { display: block; }
  body { background: #fff; color: #000; }
}
