/* 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; scroll-padding-top: 84px; }
@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%; }
[hidden] { display: none !important; }

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: 30;
}
.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 {
  position: sticky; top: 0; z-index: 20; border-bottom: 1px solid var(--rule);
  background: color-mix(in srgb, var(--paper) 92%, transparent);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
}
.site-header .wrap {
  display: flex; align-items: center; gap: 24px; min-height: 62px;
}
.brand {
  display: inline-flex; align-items: center; gap: 10px; min-height: 44px;
  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: 14px; margin-left: auto; align-items: center; }
.nav-links { display: flex; gap: 22px; align-items: center; margin-right: 8px; }
.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); }
.icon-button {
  border: 1px solid var(--rule-strong); background: transparent; color: var(--ink);
  width: 40px; height: 40px; border-radius: 50%; cursor: pointer; display: grid; place-items: center; flex: none;
}
.icon-button svg { width: 18px; height: 18px; }
.menu-toggle { 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:disabled { opacity: 0.4; cursor: default; filter: none; }
.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; } }

/* ── The hero diagram: one source, one engine, many viewers ──────────
 * Red is your source, cyan is streaming: the same colours as the bars.
 * Only links that carry a stream move; everything else is drawn once. */

.flow-stage { margin: 0; position: relative; }
.flow { width: 100%; height: auto; max-height: 460px; overflow: visible; font-family: var(--font); }
.flow .links path { fill: none; stroke: var(--rule-strong); stroke-width: 2; transition: stroke 0.35s, opacity 0.35s; }
.flow .vlink { opacity: 0.55; }
.flow .vlink.on, .flow[data-live="1"] .slink { stroke-width: 2.5; stroke-dasharray: 7 7; animation: flow-dash 0.9s linear infinite; opacity: 1; }
.flow .vlink.on { stroke: var(--c-live); }
.flow[data-live="1"] .slink { stroke: var(--c-source); }
.flow[data-live="0"] .slink { opacity: 0.35; }
@keyframes flow-dash { to { stroke-dashoffset: -14; } }
.flow-stage.is-paused .flow * { animation-play-state: paused; }
@media (prefers-reduced-motion: reduce) { .flow * { animation: none !important; transition: none !important; } }

.flow .source circle { fill: var(--raised); stroke: var(--rule-strong); stroke-width: 1.5; transition: stroke 0.35s; }
.flow[data-live="1"] .source circle { stroke: var(--c-source); stroke-width: 2.5; }
.flow .icon { fill: none; stroke: var(--ink); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.flow text { fill: var(--muted); font-size: 14px; }
.flow .source text { font-weight: 600; fill: var(--ink); }
.flow .engine rect { fill: var(--raised); stroke: var(--ink); stroke-width: 2; }
.flow .engine .mark { fill: var(--ink); }
.flow .engine .name { fill: var(--ink); font-size: 23px; font-weight: 760; font-variation-settings: "wdth" 120; letter-spacing: -0.02em; }
.flow .engine .sub { font-size: 14px; }
.flow .kind { font-size: 14px; font-weight: 650; fill: var(--muted); }
.flow .engine .state { font-size: 13px; font-weight: 650; fill: var(--ink); }
.flow .engine .dot { fill: var(--rule-strong); transition: fill 0.35s; }
.flow[data-live="1"] .engine .dot { fill: var(--c-guide); }
.flow .viewer rect { fill: var(--raised); stroke: var(--rule-strong); stroke-width: 1.5; transition: stroke 0.35s, opacity 0.35s; }
.flow .viewer { opacity: 0.4; transition: opacity 0.35s; }
.flow .viewer.on { opacity: 1; }
.flow .viewer.on rect { stroke: var(--c-live); stroke-width: 2; }

.flow-stage figcaption { margin-top: 8px; }
.flow-stats { display: flex; gap: 28px; margin: 0; }
.flow-stats div { display: flex; flex-direction: column-reverse; }
.flow-stats dt { color: var(--muted); font-size: 0.85rem; }
.flow-stats dd { margin: 0; font-size: 1.6rem; font-weight: 800; line-height: 1.1; font-variant-numeric: tabular-nums; font-variation-settings: "wdth" 112; }
.flow-stats div:last-child dd { color: var(--c-source); transition: color 0.35s; }
.flow-stats dd.zero { color: var(--muted) !important; }
.flow-caption { margin-top: 6px; color: var(--muted); min-height: 3.2em; }
@media (max-width: 900px) { .flow { max-height: 340px; } }
/* Phones draw the diagram at about 0.64 scale: larger labels keep ~11 px. */
@media (max-width: 640px) {
  .flow .source text { font-size: 18px; }
  .flow .engine .sub { font-size: 17px; }
  .flow .engine .state { font-size: 18px; }
  .flow .kind { font-size: 18px; }
}

.flow-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.motion-toggle {
  flex: none;
  font: inherit; font-size: 0.82rem; font-weight: 600; color: var(--muted);
  background: transparent; border: 1px solid var(--rule);
  border-radius: 999px; padding: 6px 14px; min-height: 40px; cursor: pointer;
}
.motion-toggle:hover { color: var(--ink); border-color: var(--rule-strong); }
@media (prefers-reduced-motion: reduce) { .motion-toggle { display: none; } }

/* ── 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; } }

/* 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); }
/* In dark mode --ink is light: keep the slab darker than the page instead. */
:root[data-theme="dark"] .statement { background: #05080f; color: var(--ink); border-block: 1px solid var(--rule-strong); }
:root[data-theme="dark"] .statement h2, :root[data-theme="dark"] .statement a { color: var(--ink); }
:root[data-theme="dark"] .statement p { color: var(--muted); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .statement { background: #05080f; color: var(--ink); border-block: 1px solid var(--rule-strong); }
  :root:not([data-theme="light"]) .statement h2, :root:not([data-theme="light"]) .statement a { color: var(--ink); }
  :root:not([data-theme="light"]) .statement p { color: var(--muted); }
}

/* 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; padding: 8px 0; }
.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, 18.4vw, 14.5rem); line-height: 0.86; 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; }
}

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

.site-nav .nav-signin { color: var(--ink); font-weight: 600; }
.button.small { min-height: 40px; padding: 0 16px; font-size: 0.95rem; white-space: nowrap; }
.site-nav .button { color: var(--paper); }
.site-nav .button:hover { color: var(--paper); }
/* Narrow screens: the links fold into a menu under the header. */
@media (max-width: 1040px) {
  .menu-toggle { display: grid; }
  .nav-links {
    display: none; position: absolute; left: 0; right: 0; top: 100%; margin: 0;
    flex-direction: column; align-items: stretch; gap: 0; padding: 6px var(--gutter) 14px;
    background: var(--paper); border-bottom: 1px solid var(--rule-strong);
    box-shadow: 0 18px 30px -24px color-mix(in srgb, var(--ink) 50%, transparent);
  }
  .nav-links.is-open { display: flex; }
  .nav-links a { padding: 12px 0; font-size: 1.05rem; color: var(--ink); border-bottom: 1px solid var(--rule); }
  .nav-links a:last-child { border-bottom: 0; }
}
@media (max-width: 480px) {
  .site-header .wrap { gap: 10px; }
  .site-nav { gap: 8px; }
  .brand svg { width: 26px; height: 26px; }
  .brand .wordmark { font-size: 1.25rem; }
  .button.small { padding: 0 12px; font-size: 0.88rem; }
  .site-nav > .theme-toggle { display: none; }
  .nav-links .theme-row { display: block; }
}
.theme-row {
  display: none; font: inherit; font-size: 1.05rem; text-align: left; color: var(--ink); cursor: pointer;
  background: none; border: 0; border-top: 1px solid var(--rule); padding: 12px 0; min-height: 44px;
}

/* ── Hero proof and reassurance ───────────────────────────────────── */

.hero .assure { margin-top: 14px; color: var(--muted); font-size: 0.95rem; }
.proof {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0;
  margin: 36px 0 0; border-top: 1px solid var(--rule-strong);
}
.proof div { padding: 14px 16px 0 0; }
.proof div + div { padding-left: 16px; border-left: 1px solid var(--rule); }
.proof dt { font-weight: 760; font-size: 1.3rem; line-height: 1.2; font-variant-numeric: tabular-nums; font-variation-settings: "wdth" 112; }
.proof dd { margin: 4px 0 0; color: var(--muted); font-size: 0.88rem; line-height: 1.4; }
@media (max-width: 480px) {
  .proof { margin-top: 28px; }
  .proof div { padding-right: 10px; }
  .proof div + div { padding-left: 10px; }
  .proof dt { font-size: 1.1rem; }
  .proof dd { font-size: 0.8rem; }
}

/* ── Only in Minimus ───────────────────────────────────────────────── */

.section-head { display: grid; gap: 14px; max-width: 62ch; margin-bottom: clamp(32px, 5vw, 56px); }
.section-head p { color: var(--muted); }

.epg {
  display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: clamp(28px, 5vw, 64px);
  align-items: start; padding-bottom: clamp(40px, 6vw, 72px); border-bottom: 1px solid var(--rule);
}
@media (max-width: 900px) { .epg { grid-template-columns: 1fr; } }
.epg h3 { font-size: clamp(1.5rem, 2.6vw, 2rem); font-weight: 760; font-variation-settings: "wdth" 112; letter-spacing: -0.012em; }
.epg .intro { margin-top: 14px; color: var(--muted); max-width: 46ch; }
.ticks { list-style: none; margin: 22px 0 0; padding: 0; display: grid; gap: 12px; }
.ticks li { position: relative; padding-left: 28px; line-height: 1.5; }
.ticks li::before {
  content: ""; position: absolute; left: 2px; top: 0.42em; width: 14px; height: 8px;
  border-left: 2.5px solid var(--tick, var(--c-guide)); border-bottom: 2.5px solid var(--tick, var(--c-guide));
  transform: rotate(-45deg);
}
.ticks li span { color: var(--muted); }
.plain-ticks { margin: 0 0 28px; }
.plan .ticks li span { display: block; font-size: 0.86rem; }

/* The demo: a slice of the panel's EPG page, rendered in HTML */
.demo {
  border: 1px solid var(--rule-strong); border-radius: 14px; background: var(--raised);
  overflow: hidden; box-shadow: 0 1px 0 var(--rule), 0 18px 40px -28px color-mix(in srgb, var(--ink) 45%, transparent);
}
.demo-top {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  padding: 14px 18px; border-bottom: 1px solid var(--rule);
}
.demo-top strong { font-size: 1rem; }
.demo-top .count { color: var(--muted); font-size: 0.9rem; font-variant-numeric: tabular-nums; }
.demo table { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
.demo th {
  text-align: left; font-weight: 600; color: var(--muted); font-size: 0.82rem;
  padding: 8px 18px; border-bottom: 1px solid var(--rule); background: color-mix(in srgb, var(--ink) 3%, var(--raised));
}
.demo td { padding: 10px 18px; border-bottom: 1px solid var(--rule); vertical-align: top; }
.demo tr:last-child td { border-bottom: 0; }
.demo td:first-child { font-weight: 600; white-space: nowrap; }
.demo td:last-child { width: 52%; }
.demo .none { color: var(--muted); }
.demo .got { display: inline-flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.demo .got::before {
  content: ""; width: 10px; height: 6px; flex: none; transform: translateY(-2px) rotate(-45deg);
  border-left: 2px solid var(--c-guide); border-bottom: 2px solid var(--c-guide);
}
.demo .cc {
  font-size: 0.75rem; font-weight: 700; color: var(--muted); border: 1px solid var(--rule-strong);
  border-radius: 4px; padding: 0 5px; line-height: 1.5;
}
.demo .pick { display: grid; gap: 6px; }
.demo .pick p { color: var(--muted); font-size: 0.84rem; }
.demo .chips { display: flex; flex-wrap: wrap; gap: 6px; }
.demo .chip {
  font: inherit; font-size: 0.86rem; font-weight: 700; cursor: pointer; color: var(--ink);
  background: transparent; border: 1.5px solid var(--c-guide); border-radius: 999px; padding: 4px 14px; min-height: 40px; min-width: 56px;
}
.demo .chip:hover { background: color-mix(in srgb, var(--c-guide) 12%, transparent); }
.demo tr.is-new td { animation: settle 0.5s ease-out; }
@keyframes settle { from { background: color-mix(in srgb, var(--c-guide) 16%, transparent); } to { background: transparent; } }
@media (prefers-reduced-motion: reduce) { .demo tr.is-new td { animation: none; } }
.demo-foot {
  display: flex; align-items: center; gap: 12px 16px; flex-wrap: wrap;
  padding: 14px 18px; border-top: 1px solid var(--rule); background: color-mix(in srgb, var(--ink) 3%, var(--raised));
}
.demo-foot .button { min-height: 40px; font-size: 0.92rem; }
.demo-foot .status { color: var(--muted); font-size: 0.9rem; }
.demo-foot .reset {
  font: inherit; font-size: 0.9rem; color: var(--muted); background: none; border: 0; padding: 4px 0; min-height: 40px;
  text-decoration: underline; text-underline-offset: 0.18em; cursor: pointer; margin-left: auto;
}
.demo-note { margin-top: 10px; color: var(--muted); font-size: 0.85rem; }
@media (max-width: 560px) {
  .demo thead { display: none; }
  .demo tr { display: block; padding: 10px 16px; border-bottom: 1px solid var(--rule); }
  .demo tr:last-child { border-bottom: 0; }
  .demo td { display: block; padding: 0; border: 0; width: auto !important; }
  .demo td:first-child { margin-bottom: 4px; white-space: normal; }
}

.features {
  list-style: none; margin: clamp(36px, 5vw, 56px) 0 0; padding: 0;
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 clamp(24px, 4vw, 48px);
}
@media (max-width: 960px) { .features { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 600px) { .features { grid-template-columns: 1fr; } }
.features li { padding: 20px 0 22px; border-top: 1px solid var(--rule); position: relative; }
.features li::before { content: ""; position: absolute; left: 0; top: -1px; width: 36px; height: 3px; background: var(--swatch); }
.features h3 { font-size: 1.08rem; }
.features p { margin-top: 6px; color: var(--muted); font-size: 0.95rem; line-height: 1.5; }

/* ── Move in ───────────────────────────────────────────────────────── */

.steps { list-style: none; margin: 0; padding: 0; counter-reset: step; display: grid; gap: 0; }
.steps li {
  counter-increment: step; display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: 2px 16px;
  padding: 18px 0; border-top: 1px solid var(--rule);
}
.steps li:last-child { border-bottom: 1px solid var(--rule); }
.steps li::before {
  content: counter(step); grid-row: span 2; width: 34px; height: 34px; border-radius: 50%;
  display: grid; place-items: center; font-weight: 720; font-size: 0.95rem;
  border: 1.5px solid var(--c-source); color: var(--ink);
}
.steps h3 { font-size: 1.05rem; align-self: center; }
.steps p { color: var(--muted); font-size: 0.95rem; line-height: 1.5; }
.measured { margin-top: 22px; padding: 16px 18px; border-left: 4px solid var(--c-source); background: var(--raised); border-radius: 0 10px 10px 0; font-size: 0.95rem; }
.measured strong { display: block; }
.measured span { color: var(--muted); }

/* ── Comparison table ──────────────────────────────────────────────── */

.compare-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; border: 1px solid var(--rule-strong); border-radius: 14px; background: var(--raised); }
.compare { width: 100%; min-width: 720px; border-collapse: collapse; font-size: 0.95rem; }
.compare th, .compare td { padding: 13px 16px; border-bottom: 1px solid var(--rule); text-align: left; vertical-align: top; }
.compare tbody tr:last-child th, .compare tbody tr:last-child td { border-bottom: 0; }
.compare thead th { font-size: 0.95rem; font-weight: 700; vertical-align: bottom; background: color-mix(in srgb, var(--ink) 3%, var(--raised)); }
.compare thead th small { display: block; font-weight: 500; color: var(--muted); font-size: 0.8rem; }
.compare tbody th { font-weight: 600; width: 30%; }
.compare tbody th span { display: block; font-weight: 400; color: var(--muted); font-size: 0.85rem; line-height: 1.4; margin-top: 2px; }
.compare .us { background: color-mix(in srgb, var(--c-guide) 7%, var(--raised)); }
.compare thead .us { background: color-mix(in srgb, var(--c-guide) 13%, var(--raised)); }
.compare td { color: var(--muted); font-size: 0.9rem; line-height: 1.45; }
.compare td.us { color: var(--ink); }
.compare .yes, .compare .no, .compare .part { display: inline-flex; align-items: baseline; gap: 6px; font-weight: 650; color: var(--ink); }
.compare .yes::before { content: ""; width: 11px; height: 6px; flex: none; transform: translateY(-3px) rotate(-45deg); border-left: 2.2px solid var(--c-guide); border-bottom: 2.2px solid var(--c-guide); }
.compare .no { color: var(--muted); font-weight: 500; }
.compare .no::before { content: ""; width: 10px; height: 2px; flex: none; background: var(--rule-strong); transform: translateY(-4px); }
.compare .part { font-weight: 600; }
.compare .part::before { content: ""; width: 9px; height: 9px; flex: none; border-radius: 50%; border: 2px solid var(--c-vod); transform: translateY(0); }
.compare td small { display: block; margin-top: 2px; color: var(--muted); font-size: 0.84rem; line-height: 1.4; }
.compare .plain { font-weight: 600; color: var(--ink); }
.compare thead th:first-child, .compare tbody th {
  position: sticky; left: 0; z-index: 1; background: var(--raised);
  box-shadow: inset -1px 0 0 var(--rule);
}
.compare thead th:first-child { background: color-mix(in srgb, var(--ink) 3%, var(--raised)); }
@media (max-width: 640px) {
  .compare { min-width: 760px; }
  .compare tbody th { width: 150px; min-width: 150px; }
  .compare tbody th span { display: none; }
}
.compare-note { margin-top: 12px; color: var(--muted); font-size: 0.85rem; max-width: 80ch; }
.compare-key { display: flex; flex-wrap: wrap; gap: 6px 20px; margin-top: 10px; font-size: 0.85rem; color: var(--muted); }

/* ── Pricing ───────────────────────────────────────────────────────── */

.plans { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; align-items: stretch; }
@media (max-width: 960px) { .plans { grid-template-columns: 1fr; max-width: 520px; } }
.plan {
  display: flex; flex-direction: column; border: 1px solid var(--rule-strong); border-radius: 16px;
  background: var(--raised); padding: 26px 24px 24px; position: relative;
}
.plan.lead { border: 2px solid var(--ink); padding: 25px 23px 23px; }
.plan .tag {
  position: absolute; top: -13px; left: 22px; background: var(--ink); color: var(--paper);
  font-size: 0.8rem; font-weight: 700; padding: 3px 10px; border-radius: 999px;
}
.plan h3 { font-size: 1.3rem; font-variation-settings: "wdth" 112; }
.plan .for { margin-top: 6px; color: var(--muted); font-size: 0.93rem; min-height: 3em; }
.plan .price { margin-top: 18px; display: flex; align-items: baseline; gap: 6px; font-variant-numeric: tabular-nums; }
.plan .price strong { font-size: 2.6rem; font-weight: 800; letter-spacing: -0.02em; font-variation-settings: "wdth" 110; line-height: 1; }
.plan .price span { color: var(--muted); font-size: 0.95rem; }
.plan .ticks { margin: 20px 0 24px; gap: 10px; font-size: 0.95rem; }
.plan .button { margin-top: auto; width: 100%; }
.plan .button.quiet { border-color: var(--rule-strong); }
.trial {
  margin-bottom: 20px; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 8px 24px; align-items: center;
  padding: 20px 24px; border: 1px dashed var(--rule-strong); border-radius: 16px;
}
.trial .price strong { color: var(--ink); font-size: 1.8rem; font-weight: 800; font-variation-settings: "wdth" 110; }
.trial h3 { font-size: 1.1rem; }
.trial p { color: var(--muted); font-size: 0.95rem; }
@media (max-width: 760px) { .trial { grid-template-columns: 1fr; } }
.price-note { margin-top: 14px; color: var(--muted); font-size: 0.88rem; }
.try-row { margin-top: 18px; display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; font-size: 0.95rem; }
.try-row .muted { color: var(--muted); font-size: 0.88rem; }

/* ── FAQ ───────────────────────────────────────────────────────────── */

.faq { border-top: 1px solid var(--rule-strong); }
.faq details { border-bottom: 1px solid var(--rule); }
.faq summary {
  list-style: none; cursor: pointer; padding: 18px 40px 18px 0; position: relative;
  font-weight: 650; font-size: 1.05rem;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: ""; position: absolute; right: 8px; top: 50%; width: 10px; height: 10px; margin-top: -7px;
  border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(45deg);
  transition: transform 0.2s;
}
.faq details[open] summary::after { transform: rotate(-135deg); margin-top: -2px; }
@media (prefers-reduced-motion: reduce) { .faq summary::after { transition: none; } }
.faq details > div { padding: 0 0 20px; color: var(--muted); max-width: 64ch; }
.faq details > div p + p { margin-top: 0.8em; }

/* ── Community ─────────────────────────────────────────────────────── */

.community { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
@media (max-width: 760px) { .community { grid-template-columns: 1fr; } }
.channel {
  display: grid; grid-template-columns: 52px minmax(0, 1fr); gap: 4px 18px; align-items: start;
  padding: 22px 24px; border: 1px solid var(--rule-strong); border-radius: 16px; background: var(--raised);
  text-decoration: none; color: var(--ink);
}
.channel:hover { border-color: var(--ink); text-decoration: none; }
.channel svg { width: 52px; height: 52px; grid-row: span 3; border-radius: 14px; }
.channel strong { font-size: 1.15rem; }
.channel span { color: var(--muted); font-size: 0.95rem; line-height: 1.5; }
.channel em { font-style: normal; font-weight: 650; font-size: 0.95rem; text-decoration: underline; text-underline-offset: 0.18em; margin-top: 6px; }

.closing { padding: clamp(56px, 8vw, 96px) 0; }
.closing h2 { max-width: 22ch; }
.closing p { margin-top: 16px; color: var(--muted); max-width: 52ch; }
.closing .actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }

/* ── Inside the panel ──────────────────────────────────────────────── */

.tour-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
@media (max-width: 640px) {
  .tour-tabs { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin-inline: calc(-1 * var(--gutter)); padding-inline: var(--gutter); }
  .tour-tabs::-webkit-scrollbar { display: none; }
  .tour-tabs [role="tab"] { flex: none; }
}
.tour-tabs [role="tab"] {
  font: inherit; font-weight: 650; font-size: 0.95rem; cursor: pointer; color: var(--muted);
  background: transparent; border: 1px solid var(--rule-strong); border-radius: 999px; padding: 0 18px; min-height: 42px;
}
.tour-tabs [role="tab"]:hover { color: var(--ink); border-color: var(--ink); }
.tour-tabs [role="tab"][aria-selected="true"] { color: var(--paper); background: var(--ink); border-color: var(--ink); }
.shot { margin: 0; }
.shot + .shot { margin-top: 32px; }
.tour.is-ready .shot + .shot { margin-top: 0; }
.shot .frame {
  border: 1px solid var(--rule-strong); border-radius: 14px; overflow: hidden; background: var(--raised);
  box-shadow: 0 24px 50px -36px color-mix(in srgb, var(--ink) 55%, transparent);
}
.shot img { width: 100%; height: auto; }
.full-size { display: inline-flex; align-items: center; min-height: 44px; margin-top: 4px; font-size: 0.9rem; font-weight: 600; }
.full-size.for-dark { display: none; }
:root[data-theme="dark"] .full-size.for-light { display: none; }
:root[data-theme="dark"] .full-size.for-dark { display: inline-flex; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .full-size.for-light { display: none; }
  :root:not([data-theme="light"]) .full-size.for-dark { display: inline-flex; }
}
.shot figcaption { margin-top: 8px; color: var(--muted); max-width: 70ch; }
.for-dark { display: none; }
:root[data-theme="dark"] .for-light { display: none; }
:root[data-theme="dark"] .for-dark { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .for-light { display: none; }
  :root:not([data-theme="light"]) .for-dark { display: block; }
}

/* ── Calls to action between sections ─────────────────────────────── */

.cta-row {
  display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px;
  margin-top: clamp(28px, 4vw, 40px); padding: 18px 22px;
  border: 1px solid var(--rule-strong); border-radius: 14px; background: var(--raised);
}
.cta-row p { font-weight: 650; margin-right: auto; }
.cta-row.compact { margin-top: 24px; }

/* ── Comparison with a typical panel: three columns fit any screen ── */

.compare thead th small { display: block; }
.compare.compare-two { min-width: 0; table-layout: fixed; }
.compare-two td, .compare-two th { overflow-wrap: anywhere; hyphens: auto; }
.compare-two tbody th { width: 30%; }
.compare-two .us, .compare-two td { width: 35%; }
@media (max-width: 640px) {
  .compare-scroll { overflow: visible; }
  .compare-two th, .compare-two td { padding: 12px 10px; }
  .compare-two thead th { position: sticky; top: 68px; z-index: 2; }
  .compare-two tbody th, .compare-two thead th:first-child { position: static; box-shadow: none; }
  .compare-two thead th:first-child { position: sticky; }
}

/* Wide screens: the table fits, so its column names can stay in view. */
@media (min-width: 900px) {
  .compare-scroll { overflow: visible; }
  .compare thead th { position: sticky; top: 68px; z-index: 2; }
  .compare thead th:first-child { z-index: 3; }
}

/* The corner cells follow the box's rounded corners: where the box lets
   the table overflow (wide screens, phones), a filled corner cell would
   square its corner off. */
.compare thead th:first-child { border-top-left-radius: 14px; }
.compare thead th:last-child { border-top-right-radius: 14px; }
.compare tbody tr:last-child th { border-bottom-left-radius: 14px; }
.compare tbody tr:last-child td:last-child { border-bottom-right-radius: 14px; }

.visually-hidden {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; border: 0;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
}

/* ── The engine ────────────────────────────────────────────────────── */

.engine { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
@media (max-width: 1000px) { .engine { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .engine { grid-template-columns: 1fr; } }
.engine-card {
  position: relative; padding: 24px 22px 22px; border: 1px solid var(--rule-strong); border-radius: 14px;
  background: var(--raised); overflow: hidden;
}
.engine-card::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 4px; background: var(--accent); }
.engine-card h3 { font-size: 1.25rem; font-variation-settings: "wdth" 112; }
.engine-card p { margin-top: 8px; color: var(--muted); font-size: 0.95rem; line-height: 1.5; }
.engine-note { margin-top: 16px; color: var(--muted); font-size: 0.92rem; }

/* ── Films and series import ──────────────────────────────────────── */

.vod {
  display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: 16px clamp(28px, 5vw, 64px); align-items: center;
  margin-top: clamp(40px, 6vw, 64px); padding: clamp(24px, 4vw, 36px);
  border: 1px solid var(--rule-strong); border-radius: 16px; background: var(--raised);
}
@media (max-width: 900px) { .vod { grid-template-columns: 1fr; } }
.vod h3 { font-size: clamp(1.4rem, 2.4vw, 1.8rem); font-weight: 760; font-variation-settings: "wdth" 112; margin-top: 10px; }
.vod .intro { margin-top: 10px; color: var(--muted); }
.vod .ticks { margin: 0; }

/* ── Ten years ─────────────────────────────────────────────────────── */

.maker .maker-lede { font-size: clamp(1.25rem, 2.2vw, 1.6rem); line-height: 1.35; font-weight: 600; max-width: 34ch; }
.maker .muted { margin-top: 14px; max-width: 56ch; }

.trial-steps { margin: 4px 0 0; padding: 0; list-style: none; counter-reset: t; display: flex; flex-wrap: wrap; gap: 4px 18px; color: var(--muted); font-size: 0.95rem; }
.trial-steps li { counter-increment: t; }
.trial-steps li::before { content: counter(t) ". "; font-weight: 700; color: var(--ink); }

/* ── Load balancing and domains ────────────────────────────────────── */

.section-shot { margin: clamp(28px, 4vw, 44px) 0 0; }
.section-shot .frame { width: fit-content; max-width: 100%; }
.section-shot .frame {
  border: 1px solid var(--rule-strong); border-radius: 14px; overflow: hidden; background: var(--raised);
  box-shadow: 0 24px 50px -36px color-mix(in srgb, var(--ink) 55%, transparent);
}
.section-shot img { width: auto; max-width: 100%; height: auto; }
.rules-lede { font-weight: 650; }
.rules { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin: 14px 0 0; }
@media (max-width: 560px) { .rules { grid-template-columns: 1fr; } }
.rules div { padding: 14px 16px; border: 1px solid var(--rule-strong); border-radius: 12px; background: var(--raised); border-top: 3px solid var(--c-live); }
.rules dt { font-weight: 700; }
.rules dd { margin: 4px 0 0; color: var(--muted); font-size: 0.93rem; line-height: 1.45; }

.engine-card sup a { text-decoration: none; font-weight: 700; padding: 0 2px; }
