/* Minimus — minimus.tv
 *
 * One token block per theme. The seven service colours are the broadcast
 * colour bars (white, yellow, cyan, green, magenta, red, blue) and each one
 * names a part of the system everywhere it appears: the stripe, the legend
 * and the live diagram all use the same mapping.
 */

/* Archivo (SIL Open Font License, see fonts/OFL.txt), served from this
 * site rather than a font CDN so no visitor data goes to a third party. */
@font-face {
  font-family: "Archivo"; font-style: normal; font-display: swap;
  font-weight: 100 900; font-stretch: 62% 125%;
  src: url("fonts/archivo-latin-ext-wdth-normal.woff2") format("woff2-variations");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Archivo"; font-style: normal; font-display: swap;
  font-weight: 100 900; font-stretch: 62% 125%;
  src: url("fonts/archivo-latin-wdth-normal.woff2") format("woff2-variations");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  color-scheme: light;
  --paper: #f1f3f5;
  --raised: #ffffff;
  --ink: #121722;
  --muted: #4b5466;
  --rule: #d3d8df;
  --rule-strong: #aab2be;
  --focus: #2d50d2;

  --c-apps: #8a93a3;    /* white bar: player apps and viewers */
  --c-vod: #b58900;     /* yellow: films and series */
  --c-live: #0090b0;    /* cyan: streaming nodes */
  --c-guide: #1e8e45;   /* green: programme guide */
  --c-guard: #b5178e;   /* magenta: security */
  --c-source: #d0392f;  /* red: your sources */
  --c-data: #2d50d2;    /* blue: backups and storage */

  --font: "Archivo", system-ui, -apple-system, "Segoe UI", sans-serif;
  --measure: 66ch;
  --gutter: clamp(16px, 4vw, 40px);
  --page: 1180px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --paper: #0c111c;
    --raised: #141b2a;
    --ink: #e8ecf2;
    --muted: #9aa4b5;
    --rule: #263045;
    --rule-strong: #3b4762;
    --focus: #8ea4ff;
    --c-apps: #8d97aa;
    --c-vod: #f2cc2e;
    --c-live: #22c3e6;
    --c-guide: #3ccb6e;
    --c-guard: #e04bc0;
    --c-source: #f05a4e;
    --c-data: #6b88ff;
  }
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --paper: #0c111c;
  --raised: #141b2a;
  --ink: #e8ecf2;
  --muted: #9aa4b5;
  --rule: #263045;
  --rule-strong: #3b4762;
  --focus: #8ea4ff;
  --c-apps: #8d97aa;
  --c-vod: #f2cc2e;
  --c-live: #22c3e6;
  --c-guide: #3ccb6e;
  --c-guard: #e04bc0;
  --c-source: #f05a4e;
  --c-data: #6b88ff;
}

*,
*::before,
*::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.6;
  font-variation-settings: "wdth" 100;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img, svg, canvas { display: block; max-width: 100%; }

a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 0.18em; }
a:hover { text-decoration-thickness: 2px; }

:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; border-radius: 2px; }

.skip {
  position: absolute; left: -9999px; top: 8px;
  background: var(--ink); color: var(--paper); padding: 8px 12px; z-index: 10;
}
.skip:focus { left: 8px; }

.wrap { width: min(100% - 2 * var(--gutter), var(--page)); margin-inline: auto; }

/* ── The colour-bar stripe ─────────────────────────────────────────── */

.bars {
  display: grid; grid-template-columns: repeat(7, 1fr); height: 6px;
}
.bars span:nth-child(1) { background: var(--c-apps); }
.bars span:nth-child(2) { background: var(--c-vod); }
.bars span:nth-child(3) { background: var(--c-live); }
.bars span:nth-child(4) { background: var(--c-guide); }
.bars span:nth-child(5) { background: var(--c-guard); }
.bars span:nth-child(6) { background: var(--c-source); }
.bars span:nth-child(7) { background: var(--c-data); }

/* ── Header ────────────────────────────────────────────────────────── */

.site-header { border-bottom: 1px solid var(--rule); }
.site-header .wrap {
  display: flex; align-items: center; gap: 24px; min-height: 68px;
}
.brand {
  display: inline-flex; align-items: center; gap: 10px;
  text-decoration: none; color: var(--ink);
}
.brand svg { width: 30px; height: 30px; }
.wordmark {
  font-size: 1.45rem; line-height: 1; letter-spacing: -0.02em;
  font-weight: 760; font-variation-settings: "wdth" 125;
}
.site-nav { display: flex; gap: 22px; margin-left: auto; align-items: center; }
.site-nav a { text-decoration: none; color: var(--muted); font-size: 0.95rem; }
.site-nav a:hover, .site-nav a[aria-current="page"] { color: var(--ink); }
.theme-toggle {
  border: 1px solid var(--rule-strong); background: transparent; color: var(--ink);
  width: 36px; height: 36px; border-radius: 50%; cursor: pointer; display: grid; place-items: center;
}
.theme-toggle svg { width: 18px; height: 18px; }

@media (max-width: 760px) {
  .site-nav a.nav-optional { display: none; }
}

/* ── Buttons ───────────────────────────────────────────────────────── */

.button {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 46px; padding: 0 20px; border-radius: 999px;
  font: inherit; font-weight: 650; font-size: 1rem; text-decoration: none; cursor: pointer;
  border: 1.5px solid var(--ink); background: var(--ink); color: var(--paper);
}
.button:hover { text-decoration: none; filter: brightness(1.12); }
.button.quiet { background: transparent; color: var(--ink); }
.button.quiet:hover { background: color-mix(in srgb, var(--ink) 7%, transparent); filter: none; }

/* ── Type ──────────────────────────────────────────────────────────── */

h1, h2, h3 { margin: 0; line-height: 1.08; text-wrap: balance; }
h1 {
  font-size: clamp(2.5rem, 6.4vw, 5.1rem);
  font-weight: 800; letter-spacing: -0.025em;
  font-variation-settings: "wdth" 118;
}
h2 {
  font-size: clamp(1.85rem, 3.6vw, 2.75rem);
  font-weight: 760; letter-spacing: -0.018em;
  font-variation-settings: "wdth" 112;
}
h3 { font-size: 1.2rem; font-weight: 700; line-height: 1.25; }
p { margin: 0; }
.lede { font-size: clamp(1.1rem, 1.6vw, 1.3rem); color: var(--muted); max-width: 46ch; }
.prose p + p { margin-top: 1em; }
.prose { max-width: var(--measure); }
.muted { color: var(--muted); }

/* ── Hero ──────────────────────────────────────────────────────────── */

.hero { padding: clamp(40px, 6vw, 80px) 0 clamp(28px, 4vw, 48px); }
.hero-grid {
  display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: clamp(24px, 4vw, 56px); align-items: center;
}
.hero h1 { font-size: clamp(2.2rem, 3.6vw, 3.4rem); }
.hero .lede { margin-top: 24px; }
.hero .actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 32px; }
@media (max-width: 900px) { .hero-grid { grid-template-columns: 1fr; } }

/* ── Topology ──────────────────────────────────────────────────────── */

.topology-stage { position: relative; width: 100%; aspect-ratio: 6 / 5; max-height: 620px; }
.topology-stage canvas { width: 100%; height: 100%; position: absolute; inset: 0; }
@media (max-width: 900px) { .topology-stage { aspect-ratio: 3 / 4; max-height: 640px; } }
.motion-toggle {
  position: absolute; right: 8px; bottom: 8px; z-index: 1;
  font: inherit; font-size: 0.82rem; font-weight: 600; color: var(--muted);
  background: color-mix(in srgb, var(--paper) 85%, transparent); border: 1px solid var(--rule);
  border-radius: 999px; padding: 6px 12px; cursor: pointer;
}
.motion-toggle:hover { color: var(--ink); border-color: var(--rule-strong); }

.topology { border-block: 1px solid var(--rule); background: var(--raised); }
.topology-legend { padding: clamp(28px, 4vw, 44px) 0; }
.topology-legend header { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 20px; margin-bottom: 18px; }
.topology-legend h2 { font-size: 1.5rem; font-variation-settings: "wdth" 110; }
.topology-legend header p { color: var(--muted); font-size: 0.95rem; }
.legend {
  list-style: none; margin: 0 -10px; padding: 0;
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px 12px;
}
@media (max-width: 1000px) { .legend { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .legend { grid-template-columns: 1fr; } }
.legend button {
  all: unset; box-sizing: border-box; display: grid; grid-template-columns: 14px 1fr; gap: 0 12px;
  width: 100%; padding: 10px 10px; border-radius: 8px; cursor: default;
}
.legend button:focus-visible { outline: 2px solid var(--focus); outline-offset: 0; }
.legend button:hover,
.legend button.is-active { background: color-mix(in srgb, var(--ink) 6%, transparent); }
.legend .swatch { width: 12px; height: 12px; border-radius: 3px; margin-top: 6px; background: var(--swatch); }
.legend .name { font-weight: 680; }
.legend .what { grid-column: 2; color: var(--muted); font-size: 0.9rem; line-height: 1.45; }

/* ── Sections ──────────────────────────────────────────────────────── */

.band { padding: clamp(56px, 9vw, 112px) 0; }
.band + .band { border-top: 1px solid var(--rule); }
.split {
  display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: clamp(28px, 5vw, 72px);
  align-items: start;
}
.split > header p { margin-top: 18px; color: var(--muted); max-width: 40ch; }
@media (max-width: 860px) { .split { grid-template-columns: 1fr; } }

/* Spec sheet: a real table, figures aligned */
.spec { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.spec th, .spec td { text-align: left; vertical-align: top; padding: 16px 0; border-bottom: 1px solid var(--rule); }
.spec tr:first-child th, .spec tr:first-child td { border-top: 1px solid var(--rule-strong); }
.spec th { font-weight: 500; color: var(--muted); width: 44%; padding-right: 24px; }
.spec td strong { display: block; font-weight: 720; font-size: 1.15rem; }
.spec td span { color: var(--muted); font-size: 0.95rem; }
@media (max-width: 560px) {
  .spec th, .spec td { display: block; width: auto; padding: 0; border: 0; }
  .spec tr { display: block; padding: 14px 0; border-bottom: 1px solid var(--rule); }
  .spec tr:first-child { border-top: 1px solid var(--rule-strong); }
  .spec tr:first-child th, .spec tr:first-child td { border-top: 0; }
  .spec th { margin-bottom: 4px; }
}

/* The stack: a real layer diagram, top of the stack first */
.stack {
  list-style: none; margin: 0; padding: 0;
  border: 1px solid var(--rule-strong); border-radius: 14px; overflow: hidden; background: var(--raised);
}
.stack li {
  display: grid; grid-template-columns: 170px minmax(0, 1fr); gap: 4px 24px; align-items: baseline;
  padding: 18px 22px 18px 26px; position: relative;
}
.stack li + li { border-top: 1px solid var(--rule); }
.stack li::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 5px; background: var(--layer);
}
.stack h3 { font-size: 1.05rem; }
.stack p { color: var(--muted); font-size: 0.95rem; line-height: 1.5; }
@media (max-width: 640px) { .stack li { grid-template-columns: 1fr; } }

/* Your data */
.facts { display: grid; gap: 28px; }
.facts h3 { margin-bottom: 6px; }
.facts p { color: var(--muted); }
.outbound { margin-top: 40px; }
.outbound h3 { margin-bottom: 12px; }
.outbound .spec th { color: var(--ink); font-weight: 650; }
.outbound-note { margin-top: 14px; font-weight: 650; }

/* Content statement: the one dark slab on the page */
.statement { background: var(--ink); color: var(--paper); }
.statement .muted, .statement p { color: color-mix(in srgb, var(--paper) 78%, var(--ink)); }
.statement h2 { color: var(--paper); max-width: 18ch; }
.statement .split > div > p + p { margin-top: 1em; }
.statement a { color: var(--paper); }
.statement .button { background: var(--paper); color: var(--ink); border-color: var(--paper); margin-top: 28px; }

/* What's new: three groups of features, by what they do for you */
.new-head { display: grid; gap: 14px; max-width: 60ch; margin-bottom: clamp(28px, 4vw, 48px); }
.new-head p { color: var(--muted); }
.new-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(28px, 4vw, 56px); }
@media (max-width: 960px) { .new-grid { grid-template-columns: 1fr; } }
.new-grid h3 { font-size: 1.05rem; padding-bottom: 10px; border-bottom: 1px solid var(--rule-strong); margin-bottom: 4px; }
.new-list { list-style: none; margin: 0; padding: 0; }
.new-list li { padding: 14px 0; border-bottom: 1px solid var(--rule); color: var(--muted); font-size: 0.95rem; line-height: 1.5; }
.new-list li strong { display: block; color: var(--ink); font-size: 1rem; margin-bottom: 2px; }
.new-grid .guide-key { margin: 14px 0 6px; max-width: none; }

/* Guide */
.guide-key {
  display: flex; align-items: center; gap: 16px; margin-top: 28px; padding: 18px 20px;
  border: 1px dashed var(--rule-strong); border-radius: 12px; max-width: 520px;
}
.guide-key svg { width: 34px; height: 34px; flex: none; color: var(--c-guide); }
.guide-key p { color: var(--muted); font-size: 0.95rem; }
.guide-key strong { color: var(--ink); display: block; font-size: 1rem; }

/* Contact */
.contact { text-align: left; }
.contact h2 { max-width: 20ch; }
.contact p { margin-top: 16px; color: var(--muted); max-width: 48ch; }
.contact .actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }

/* ── Footer ────────────────────────────────────────────────────────── */

.site-footer { border-top: 1px solid var(--rule); padding: 40px 0 28px; }
.site-footer .wrap { display: grid; grid-template-columns: 1fr auto; gap: 24px 40px; align-items: start; }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 10px 24px; }
.site-footer nav a { color: var(--muted); text-decoration: none; font-size: 0.95rem; }
.site-footer nav a:hover { color: var(--ink); text-decoration: underline; }
.site-footer small { color: var(--muted); font-size: 0.85rem; grid-column: 1 / -1; }
.giant {
  grid-column: 1 / -1; margin-top: 24px;
  font-size: clamp(4rem, 19vw, 15rem); line-height: 0.82; letter-spacing: -0.04em;
  font-weight: 820; font-variation-settings: "wdth" 125;
  color: color-mix(in srgb, var(--ink) 9%, var(--paper));
  user-select: none; overflow: hidden; white-space: nowrap;
}
@media (max-width: 640px) { .site-footer .wrap { grid-template-columns: 1fr; } }

/* ── Licence terms page ────────────────────────────────────────────── */

.doc { padding: clamp(40px, 7vw, 88px) 0; }
.doc .wrap { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: clamp(28px, 5vw, 72px); }
.doc-toc { position: sticky; top: 24px; align-self: start; font-size: 0.92rem; }
.doc-toc ol { margin: 12px 0 0; padding-left: 1.4em; color: var(--muted); }
.doc-toc li { margin: 6px 0; }
.doc-toc a { text-decoration: none; color: var(--muted); }
.doc-toc a:hover { color: var(--ink); }
.doc article { max-width: var(--measure); }
.doc h1 { font-size: clamp(2.2rem, 5vw, 3.4rem); max-width: none; }
.doc .updated { color: var(--muted); margin-top: 12px; }
.doc .summary {
  margin: 32px 0 8px; padding: 20px 22px; border-left: 4px solid var(--c-guard);
  background: var(--raised); border-radius: 0 10px 10px 0;
}
.doc .summary ul { margin: 8px 0 0; padding-left: 1.2em; }
.doc .summary li { margin: 4px 0; }
.doc h2 { font-size: 1.45rem; margin: 44px 0 12px; font-variation-settings: "wdth" 108; scroll-margin-top: 24px; }
.doc p, .doc li { color: color-mix(in srgb, var(--ink) 86%, var(--paper)); }
.doc p + p, .doc p + ul, .doc ul + p { margin-top: 0.9em; }
.doc ul { padding-left: 1.2em; }
.doc li + li { margin-top: 0.35em; }
.doc dl { margin: 0.6em 0 0; }
.doc dt { font-weight: 700; margin-top: 0.7em; }
.doc dd { margin: 0.15em 0 0; }
.placeholder {
  background: color-mix(in srgb, var(--c-vod) 26%, transparent);
  padding: 0 0.25em; border-radius: 3px; font-weight: 600;
}
@media (max-width: 860px) {
  .doc .wrap { grid-template-columns: 1fr; }
  .doc-toc { position: static; }
}
