/* ============================================================
   GMCA — Gamepad Media Center Aggregator
   Clean, flat, editorial. Neutral charcoal (derived from the
   remote-icon black #242328) + cream ink + the four backend
   colours used equitably. No glow, no glass, no gradients.
   ============================================================ */

:root {
  /* Neutral charcoal base — sampled from the app icon body (#242328) */
  --bg:        #0d0d10;
  --bg-2:      #101014;
  --surface:   #16161a;
  --surface-2: #242328;  /* sampled black of the app-icon body (the signature charcoal) */
  --surface-3: #2b2b31;

  /* Cream ink for warmth + character */
  --text:      #f2efe7;
  --text-dim:  #a7a39b;
  --text-faint:#8a877f;  /* lightened to clear WCAG-AA on the dark base */

  --line:      rgba(242,239,231,0.09);
  --line-2:    rgba(242,239,231,0.16);
  --line-3:    rgba(242,239,231,0.28);

  /* Backend spectrum — equal weight, the only accents on the page */
  --plex:      #e5a00d;
  --jellyfin:  #00a4dc;
  --emby:      #52b54b;
  --stremio:   #7b5bf5;
  --files:     #9aa0a6;
  /* Stremio's violet has the lowest luminance of the five; as small foreground
     text on the dark base #7b5bf5 lands at ~4.1:1 (below AA 4.5:1). This lifted
     tint clears AA for small text while still reading as the Stremio accent.
     The raw --stremio stays for fills/borders and the large hero word (≥3:1). */
  --stremio-ink: #9575f7;

  --on-plex:     #1a1400;
  --on-jellyfin: #002430;
  --on-emby:     #06210a;
  --on-stremio:  #ffffff;

  --maxw: 1200px;
  --pad: clamp(1.15rem, 4vw, 3rem);

  --font-display: 'Archivo', system-ui, sans-serif;
  --font-body: 'Hanken Grotesk', system-ui, sans-serif;
  --font-mono: 'Fragment Mono', ui-monospace, monospace;

  --ease: cubic-bezier(.4,.02,.16,1);
}

* { 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(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 800;
  font-stretch: 78%;
  line-height: 0.98;
  letter-spacing: -0.01em;
  margin: 0;
  text-transform: uppercase;
}

.wrap { max-width: var(--maxw); margin: 0 auto; padding-inline: var(--pad); }

/* Mono label / kicker */
.kicker, .sec-kicker {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--text-faint);
}

.skip-link {
  position: absolute; left: 0; top: 0; transform: translateY(-120%);
  background: var(--text); color: var(--bg); padding: 0.6rem 1rem;
  font-family: var(--font-mono); font-size: 0.8rem; z-index: 999;
}
.skip-link:focus { transform: translateY(0); }

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

/* ============ Header ============ */
.nav {
  position: sticky; top: 0; z-index: 100;
  display: flex; align-items: center; gap: 1.5rem;
  height: 62px;
  padding-inline: var(--pad);
  background: var(--bg);
  border-bottom: 1px solid var(--line);
  transform: translateY(-100%);
  transition: transform .32s var(--ease);
}
.nav.nav-shown, .nav:focus-within { transform: translateY(0); }
html:not(.js) .nav { transform: none; }
/* Secondary pages have no big brand block to reveal past — keep the nav pinned. */
.page-guide .nav { transform: translateY(0); }

/* ============ Masthead (big brand, before the hero) ============ */
.masthead {
  max-width: var(--maxw); margin: 0 auto;
  padding: clamp(1.8rem,5vh,3.4rem) var(--pad) clamp(1.4rem,3vh,2.2rem);
  display: flex; align-items: center; justify-content: space-between; gap: 2rem; flex-wrap: wrap;
}
.mast-brand { display: flex; align-items: center; gap: clamp(1.1rem,2vw,1.8rem); }
.mast-logo { width: clamp(104px, 12vw, 168px); height: auto; filter: drop-shadow(0 10px 26px rgba(0,0,0,0.55)); }
.mast-name { display: flex; flex-direction: column; }
.mast-wordmark { font-family: var(--font-display); font-weight: 900; font-stretch: 66%; font-size: clamp(3rem,6.5vw,4.6rem); line-height: 0.84; letter-spacing: 0.01em; }
.mast-expand { font-family: var(--font-mono); font-size: clamp(0.7rem,1vw,0.82rem); letter-spacing: 0.16em; text-transform: uppercase; color: var(--text-dim); margin-top: 0.55rem; }
.mast-spec { border: 1px solid var(--line-2); border-radius: 6px; overflow: hidden; font-family: var(--font-mono); font-size: 0.66rem; letter-spacing: 0.1em; text-transform: uppercase; min-width: 15rem; }
.mast-spec span { display: block; padding: 0.5rem 0.9rem; border-top: 1px solid var(--line); color: var(--text-dim); }
.mast-spec span:first-child { border-top: none; color: var(--text); }
.mast-spec .muted { color: var(--text-faint); font-size: 0.58rem; }
.mast-spec b { color: var(--text); font-weight: 700; }
@media (max-width: 720px) { .masthead { gap: 1.4rem; } .mast-spec { align-self: stretch; min-width: 0; } }

.nav-brand { display: inline-flex; align-items: center; gap: 0.6rem; margin-right: auto; }
.brand-mark {
  width: 34px; height: 34px; border-radius: 8px;
}
.wordmark {
  font-family: var(--font-display); font-weight: 900; font-stretch: 70%;
  font-size: 1.28rem; letter-spacing: 0.02em; color: var(--text);
}

.nav-links { display: flex; gap: 1.6rem; }
.nav-links a {
  font-family: var(--font-mono);
  font-size: 0.72rem; letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--text-dim);
  padding: 0.4rem 0;
  transition: color .2s var(--ease);
}
.nav-links a:hover { color: var(--text); }

.nav-gh { color: var(--text-dim); display: inline-flex; transition: color .2s var(--ease); }
.nav-gh:hover { color: var(--text); }

@media (max-width: 860px) {
  .nav-links { display: none; }
}

/* ============ Buttons ============ */
.btn {
  display: inline-flex; align-items: center; gap: 0.55rem;
  font-family: var(--font-mono); font-size: 0.8rem; letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.85rem 1.4rem;
  border: 1px solid var(--line-3);
  border-radius: 4px;
  transition: transform .18s var(--ease), background .18s var(--ease), color .18s var(--ease), border-color .18s var(--ease);
  cursor: pointer;
}
.btn:hover { transform: translateY(-2px); }
.btn-primary { background: var(--text); color: var(--bg); border-color: var(--text); font-weight: 700; }
.btn-primary:hover { background: #fff; border-color: #fff; }
.btn-ghost { background: transparent; color: var(--text); }
.btn-ghost:hover { border-color: var(--text); background: rgba(242,239,231,0.04); }
.btn-glyph {
  display: inline-grid; place-items: center;
  width: 1.5em; height: 1.5em; border-radius: 50%;
  border: 1.5px solid currentColor; font-size: 0.6em; font-weight: 700;
  line-height: 1; letter-spacing: 0; /* single glyph: kill the inherited tracking + tall line-box that pushed the letter out of the circle */
}

/* ============ Hero ============ */
.hero {
  position: relative;
  padding-top: clamp(2.5rem, 7vh, 5rem);
  padding-bottom: clamp(2rem, 5vh, 3.5rem);
  border-bottom: 1px solid var(--line);
  overflow: hidden;
}
.hero-grid {
  max-width: var(--maxw); margin: 0 auto; padding-inline: var(--pad);
  display: grid; grid-template-columns: 0.92fr 1.08fr; gap: clamp(1.5rem, 4vw, 3rem);
  align-items: center;
}
.hero-copy { max-width: 40rem; }
.hero h1 {
  font-size: clamp(2.2rem, 5vw, 3.9rem);
  font-stretch: 74%;
}
.hero-rotator { min-height: 3.1em; }
.hero-rotator .hl-line { display: block; white-space: nowrap; }
.rot { display: inline-block; transition: color .35s var(--ease), opacity .26s var(--ease), transform .26s var(--ease); }
.rot.swap { opacity: 0; transform: translateY(-0.22em); }
.rot-mc { color: var(--rot-mc, var(--text)); }
.rot-dev { white-space: nowrap; } /* letters coloured per-device inline by JS; falls back to cream without JS */
.hero-sub {
  margin: 1.5rem 0 2rem; font-size: 1.12rem; color: var(--text-dim); max-width: 30rem;
}
.hero-sub strong { color: var(--text); font-weight: 700; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 0.8rem; }

.hero-media { position: relative; margin: 0; } /* drop the UA default <figure> margin */
.hero-stage { position: relative; height: clamp(360px, 46vw, 560px); }
.dev-img {
  position: absolute; inset: 0; margin: auto;
  max-width: 100%; max-height: 100%; width: auto; height: auto;
  object-fit: contain;
  opacity: 0; transform: scale(0.965);
  transition: opacity .5s var(--ease), transform .5s var(--ease);
  filter: drop-shadow(0 26px 50px rgba(0,0,0,0.55));
  will-change: opacity, transform;
}
.dev-img.on { opacity: 1; transform: scale(1); }
.hero-media figcaption {
  margin-top: 1rem; text-align: center;
  font-family: var(--font-mono); font-size: 0.68rem; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--text-faint);
}
/* The small caption tag needs AA on the dark base, so it reads --rot-mc-ink
   (a lifted tint for Stremio); the large hero word keeps the raw --rot-mc. */
.hero-media .tag { color: var(--rot-mc-ink, var(--rot-mc, var(--emby))); transition: color .4s var(--ease); }

/* ============ Hero — centered poster (header row · one-line headline · full-width device · copy) ============ */
.hero-center { text-align: center; padding-top: clamp(1.8rem, 4vh, 3rem); }
.hero-center .center {
  max-width: var(--maxw); margin: 0 auto; padding-inline: var(--pad);
  display: flex; flex-direction: column; align-items: center;
}
/* Brand header — logo beside a big GMCA + baseline lockup, tag below */
.center-head { display: flex; flex-direction: column; align-items: center; gap: 1rem; }
.center-lockup { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: clamp(1rem, 1.8vw, 1.6rem); }
.center-logo { width: clamp(104px, 12vw, 164px); height: auto; filter: drop-shadow(0 16px 34px rgba(0,0,0,0.6)); }
.center-name { display: flex; flex-direction: column; align-items: flex-start; }
.center-wordmark {
  font-family: var(--font-display); font-weight: 900; font-stretch: 70%;
  font-size: clamp(2.6rem, 5vw, 4.2rem); line-height: 0.88; letter-spacing: 0.01em; color: var(--text);
}
.center-baseline { font-family: var(--font-mono); font-size: clamp(0.66rem, 0.95vw, 0.78rem); letter-spacing: 0.16em; text-transform: uppercase; color: var(--text-dim); margin-top: 0.45rem; }
.center-tag {
  align-self: flex-start; margin-top: 0.8rem;
  font-family: var(--font-mono); font-size: 0.64rem; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--text-dim); border: 1px solid var(--line-2); border-radius: 100px; padding: 0.32rem 0.85rem;
}
/* One-line rotating headline (device + full stop stay together).
   Scoped with .hero-center to outrank the base ".hero h1" font-size. */
.hero-center .center-rotator { min-height: 0; font-size: clamp(2.4rem, 6vw, 5rem); line-height: 1.0; margin-top: clamp(1.4rem, 3vh, 2.4rem); }
/* Full-width centred device */
.center-media { margin: clamp(1.6rem, 3.5vh, 2.6rem) 0 0; width: 100%; }
/* Canvas is now 1280×640 with every device normalised to a common height */
.center-media .hero-stage { height: clamp(280px, 40vw, 560px); }
.center-media figcaption { margin-top: 1rem; }
.hero-center .hero-sub { margin: clamp(1.4rem, 3vh, 2rem) auto 1.6rem; max-width: 48ch; }
.hero-center .hero-cta { justify-content: center; }
.center-note {
  margin: 1.3rem 0 0; font-family: var(--font-mono); font-size: 0.62rem; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--text-faint);
}
@media (max-width: 520px) {
  .center-name { align-items: center; }
}

/* ============ Spec strip (technical facts — interstitial on the same black, hero → §01) ============ */
.specs {
  margin: 0; /* reset the UA <dl> margin so the strip sits flush on the page black */
  border-bottom: 1px solid var(--line); /* single separator like every other block; the hero already carries its own border-bottom above */
}
.specs-inner {
  max-width: var(--maxw); margin: 0 auto;
  padding: clamp(1.5rem, 3.2vw, 2.1rem) var(--pad);
  display: flex; flex-wrap: wrap; align-items: flex-start;
  justify-content: space-between;
  column-gap: clamp(2rem, 5vw, 4rem); row-gap: 1.5rem;
}
.spec { display: flex; flex-direction: column; gap: 0.55rem; }
.spec dt {
  font-family: var(--font-mono); font-size: 0.62rem; letter-spacing: 0.2em;
  text-transform: uppercase; color: var(--text-faint);
}
.spec dd { margin: 0; font-size: 0.98rem; color: var(--text-dim); line-height: 1.4; }
.spec dd strong { color: var(--text); font-weight: 700; }
.spec a {
  color: var(--text); text-decoration: underline;
  text-decoration-color: var(--line-3); text-underline-offset: 2px;
}
.spec a:hover { text-decoration-color: currentColor; }

/* Builds stay inline as the 4th fact; format pills reuse the §01 channel-badge idiom */
.builds { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.fmt {
  font-family: var(--font-mono); font-size: 0.64rem; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--fc); border: 1px solid var(--fc); border-radius: 20px; padding: 0.2rem 0.66rem;
}
.fmt[data-b="switch"]  { --fc: var(--plex); }
.fmt[data-b="vita"]    { --fc: var(--jellyfin); }
.fmt[data-b="pi"]      { --fc: var(--emby); }
.fmt[data-b="desktop"] { --fc: var(--stremio-ink); }

@media (max-width: 640px) {
  .specs-inner { column-gap: 2rem; }
}

/* ============ Section shell ============ */
.section { padding: clamp(3.5rem, 9vh, 6.5rem) 0; border-bottom: 1px solid var(--line); }
.section-head {
  display: flex; align-items: flex-end; justify-content: space-between; gap: 2rem;
  margin-bottom: clamp(2rem, 5vh, 3.2rem);
}
.section-head .lead { max-width: 46rem; }
.sec-num {
  display: inline-grid; place-items: center;
  width: 2.1rem; height: 2.1rem; border-radius: 5px;
  font-family: var(--font-mono); font-size: 0.82rem; font-weight: 700;
  margin-bottom: 1rem;
}
.section h2 { font-size: clamp(2rem, 5vw, 3.2rem); font-stretch: 76%; }
.section .sec-kicker { display: block; margin-bottom: 0.7rem; }
.section-head p { margin: 1rem 0 0; color: var(--text-dim); font-size: 1.05rem; }
.section-head .aside {
  font-family: var(--font-mono); font-size: 0.66rem; letter-spacing: 0.16em;
  text-transform: uppercase; color: var(--text-faint); text-align: right; white-space: nowrap;
}
@media (max-width: 720px) { .section-head { flex-direction: column; align-items: flex-start; } .section-head .aside { text-align: left; } }

/* Equitable backend colouring of section numbers */
#servers  .sec-num { background: var(--plex);     color: var(--on-plex); }
#devices  .sec-num { background: var(--jellyfin); color: var(--on-jellyfin); }
#features .sec-num { background: var(--emby);      color: var(--on-emby); }
#screens  .sec-num { background: var(--stremio);   color: var(--on-stremio); }
#install  .sec-num { background: var(--plex);      color: var(--on-plex); }

/* ============ Servers — "one app, every server" ============ */
.channels { display: grid; gap: 0; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.channel {
  display: grid; grid-template-columns: 4px 3.4rem 1fr; align-items: stretch;
  border-top: 1px solid var(--line);
  transition: background .2s var(--ease);
}
.channel:first-child { border-top: none; }
.channel:hover { background: var(--surface); }
.channel .bar { background: var(--c); }
.channel .no {
  display: grid; place-items: center;
  font-family: var(--font-mono); font-size: 0.85rem; color: var(--c); font-weight: 700;
  background: var(--surface); border-right: 1px solid var(--line);
}
.channel .body { padding: 1.15rem 1.3rem; display: flex; flex-wrap: nowrap; align-items: baseline; gap: 0.5rem 1rem; }
.channel .name { flex: none; white-space: nowrap; font-family: var(--font-display); font-weight: 800; font-stretch: 82%; font-size: 1.35rem; text-transform: uppercase; letter-spacing: 0.01em; }
.channel .kind {
  flex: none; white-space: nowrap;
  font-family: var(--font-mono); font-size: 0.6rem; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--c); border: 1px solid var(--c); border-radius: 20px; padding: 0.12rem 0.55rem; align-self: center;
}
/* name + badge + description stay on one line; overlong copy ellipsises instead of wrapping */
.channel .desc { flex: 1 1 auto; min-width: 0; color: var(--text-dim); font-size: 0.96rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.channels-note {
  margin-top: 1rem; font-family: var(--font-mono); font-size: 0.66rem; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--text-faint);
}
.channel[data-b="plex"]     { --c: var(--plex); }
.channel[data-b="jellyfin"] { --c: var(--jellyfin); }
.channel[data-b="emby"]     { --c: var(--emby); }
.channel[data-b="stremio"]  { --c: var(--stremio-ink); }
.channel[data-b="files"]    { --c: var(--files); }
/* Below the one-line threshold: let the description drop to its own full, readable line */
@media (max-width: 820px) {
  .channel .body { flex-wrap: wrap; }
  .channel .desc { flex: 1 1 100%; white-space: normal; overflow: visible; text-overflow: clip; }
}
@media (max-width: 480px) {
  .channel { grid-template-columns: 4px 2.4rem 1fr; }
  .channel .body { padding: 0.95rem 0.95rem; }
}
@media (max-width: 360px) {
  .hero h1 { font-size: clamp(1.85rem, 8.5vw, 2.2rem); }
}

/* ============ Devices ============ */
.devices { display: grid; grid-template-columns: repeat(2, 1fr); gap: clamp(1.2rem, 3vw, 2.2rem); }
.device {
  border: 1px solid var(--line); border-radius: 10px; padding: clamp(1.2rem,2.5vw,2rem);
  background: var(--surface); display: flex; flex-direction: column;
  transition: border-color .2s var(--ease), transform .2s var(--ease);
}
.device:hover { border-color: var(--line-2); transform: translateY(-3px); }
.device-shot { display: grid; place-items: center; min-height: 190px; margin-bottom: 1.3rem; }
.device-shot img { width: 100%; height: auto; max-height: 260px; object-fit: contain; }
.device .tagline {
  font-family: var(--font-mono); font-size: 0.62rem; letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--text-faint); margin-bottom: 0.5rem; /* the "·" separator stays neutral */
}
/* the two descriptor words carry the device's two iconic colours, like the hero */
.device .tagline .t1 { color: var(--dc1); }
.device .tagline .t2 { color: var(--dc2); }
.device h3 { font-size: 1.5rem; font-stretch: 82%; }
.device p { margin: 0.6rem 0 1rem; color: var(--text-dim); font-size: 0.96rem; flex: 1; }
.device .meta { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.device .meta span {
  font-family: var(--font-mono); font-size: 0.6rem; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--text-dim); border: 1px solid var(--line-2); border-radius: 3px; padding: 0.2rem 0.5rem;
}
/* Device colour pairs match the hero exactly (main.js DEV map). Vita uses two
   of the four PlayStation face-button colours; desktop has no hero pair, so it
   keeps its single Stremio accent until one is chosen. */
.device[data-b="switch"]   { --dc1: #00c3e3; --dc2: #ff4554; } /* Nintendo blue · Switch red */
/* vita tagline (Pocket = PS gunmetal · OLED lettered in the four PS colours) is coloured inline in the HTML */
.device[data-b="pi"]       { --dc1: #ff5a9e; --dc2: #6cc04a; } /* Raspberry pink · Pi green */
.device[data-b="desktop"]  { --dc1: #0a84ff; --dc2: #b8bcc4; } /* Windows blue · Apple silver */
@media (max-width: 720px) { .devices { grid-template-columns: 1fr; } }

/* ============ Features ============ */
.features { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.feature { background: var(--bg); padding: 1.5rem 1.4rem; }
.feature .ic { color: var(--fc); margin-bottom: 0.9rem; display: block; }
.feature h3 { font-size: 1.02rem; font-stretch: 88%; letter-spacing: 0; text-transform: none; font-weight: 800; }
.feature p { margin: 0.5rem 0 0; color: var(--text-dim); font-size: 0.88rem; line-height: 1.5; }
.feature:nth-child(4n+1) { --fc: var(--plex); }
.feature:nth-child(4n+2) { --fc: var(--jellyfin); }
.feature:nth-child(4n+3) { --fc: var(--emby); }
.feature:nth-child(4n+4) { --fc: var(--stremio); }
@media (max-width: 900px) { .features { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 520px) { .features { grid-template-columns: 1fr; } }

/* ============ Screens rail ============ */
.rail-wrap { position: relative; }
.rail {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: clamp(1rem, 2vw, 1.4rem);
}
.shot {
  width: 100%;
  border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: var(--surface);
  padding: 0; cursor: zoom-in; text-align: left;
  transition: border-color .2s var(--ease), transform .2s var(--ease);
}
.shot:hover { border-color: var(--line-2); transform: translateY(-3px); }
.shot img { display: block; width: 100%; height: auto; }
@media (max-width: 680px) { .rail { grid-template-columns: 1fr; } }
.shot figcaption {
  display: flex; align-items: center; gap: 0.5rem;
  padding: 0.7rem 0.9rem; font-family: var(--font-mono); font-size: 0.66rem;
  letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-dim);
  border-top: 1px solid var(--line);
}
.shot figcaption .pin { width: 8px; height: 8px; border-radius: 50%; background: var(--sc); }
.shot[data-b="plex"]     { --sc: var(--plex); }
.shot[data-b="jellyfin"] { --sc: var(--jellyfin); }
.shot[data-b="emby"]     { --sc: var(--emby); }
.shot[data-b="stremio"]  { --sc: var(--stremio); }
.shot[data-b="multi"]    { --sc: var(--text-dim); }

/* ---- "Same app, every server" : one switch flips every screen card ---- */
.mc-switch {
  display: flex; flex-wrap: wrap; align-items: center; gap: 0.7rem 1.2rem;
  margin-bottom: clamp(1.1rem, 2.2vw, 1.6rem);
}
.mc-switch-label {
  font-family: var(--font-mono); font-size: 0.68rem; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--text-faint);
}
.mc-tabs { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.mc-tab {
  font-family: var(--font-mono); font-size: 0.7rem; letter-spacing: 0.1em; text-transform: uppercase;
  padding: 0.45rem 0.95rem; border: 1px solid var(--line); border-radius: 999px; background: transparent;
  color: var(--text-dim); cursor: pointer;
  transition: color .2s var(--ease), border-color .2s var(--ease), background .2s var(--ease);
}
.mc-tab:hover { color: var(--text); border-color: var(--line-2); }
.mc-tab[data-mc="plex"].is-on     { color: var(--on-plex);     background: var(--plex);     border-color: var(--plex); }
.mc-tab[data-mc="jellyfin"].is-on { color: var(--on-jellyfin); background: var(--jellyfin); border-color: var(--jellyfin); }
.mc-tab[data-mc="emby"].is-on     { color: var(--on-emby);     background: var(--emby);     border-color: var(--emby); }
.mc-tab[data-mc="stremio"].is-on  { color: var(--on-stremio);  background: var(--stremio);  border-color: var(--stremio); }

.screens-rail .scr {
  margin: 0; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: var(--surface);
  cursor: zoom-in; transition: border-color .2s var(--ease), transform .2s var(--ease);
}
.screens-rail .scr:hover { border-color: var(--line-2); transform: translateY(-3px); }
.scr-stack { position: relative; aspect-ratio: 16 / 9; background: #000; }
.scr-img {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
  opacity: 0; transition: opacity .45s var(--ease);
}
.scr-img.on { opacity: 1; }
.screens-rail .scr figcaption {
  display: flex; align-items: center; gap: 0.5rem;
  padding: 0.7rem 0.9rem; font-family: var(--font-mono); font-size: 0.66rem;
  letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-dim);
  border-top: 1px solid var(--line);
}
.screens-rail .scr .pin { width: 8px; height: 8px; border-radius: 50%; background: var(--sc, var(--text-dim)); transition: background .3s var(--ease); }
.screens-rail[data-mc="plex"]     { --sc: var(--plex); }
.screens-rail[data-mc="jellyfin"] { --sc: var(--jellyfin); }
.screens-rail[data-mc="emby"]     { --sc: var(--emby); }
.screens-rail[data-mc="stremio"]  { --sc: var(--stremio); }
/* A screen the active server doesn't have (e.g. Stremio has no seasons). */
.scr-na { color: var(--text-faint); text-transform: none; letter-spacing: 0.04em; }
.screens-rail .scr.na .scr-stack::after {
  content: "Not on this server"; position: absolute; inset: 0;
  display: grid; place-items: center; color: var(--text-faint);
  font-family: var(--font-mono); font-size: 0.7rem; letter-spacing: 0.14em; text-transform: uppercase;
}

/* ============ Install ============ */
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(1rem, 2.5vw, 1.8rem); }
.step { border: 1px solid var(--line); border-radius: 10px; padding: 1.6rem; background: var(--surface); }
.step-num {
  display: inline-grid; place-items: center; width: 2.4rem; height: 2.4rem; border-radius: 50%;
  font-family: var(--font-display); font-weight: 900; font-size: 1.15rem; margin-bottom: 1rem;
}
.steps .step:nth-child(1) .step-num { background: var(--jellyfin); color: var(--on-jellyfin); }
.steps .step:nth-child(2) .step-num { background: var(--emby); color: var(--on-emby); }
.steps .step:nth-child(3) .step-num { background: var(--stremio); color: var(--on-stremio); }
.step h3 { font-size: 1.15rem; font-stretch: 86%; text-transform: none; }
.step p { margin: 0.55rem 0 0; color: var(--text-dim); font-size: 0.92rem; }
.step .mono { font-family: var(--font-mono); font-size: 0.8rem; color: var(--text); }
.install-cta { display: flex; flex-wrap: wrap; gap: 0.8rem; margin-top: 2rem; }
@media (max-width: 720px) { .steps { grid-template-columns: 1fr; } }

/* ============ Console bar ============ */
.console-bar {
  position: sticky; bottom: 0; z-index: 90;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0.5rem var(--pad);
  background: var(--bg);
  border-top: 1px solid var(--line);
  font-family: var(--font-mono); font-size: 0.68rem; letter-spacing: 0.1em; color: var(--text-dim);
}
.cb-left, .cb-right { display: flex; align-items: center; gap: 0.9rem; }
.cb-left svg { color: var(--text-faint); }
.cb-hint { display: inline-flex; align-items: center; gap: 0.4rem; text-transform: uppercase; }
.cb-hint .btn-glyph { border-color: var(--text-dim); }
.cb-hint .btn-glyph-a { color: var(--emby); border-color: var(--emby); }
@media (max-width: 620px) { .cb-hint:first-child { display: none; } }

/* ============ Footer ============ */
.footer { padding: clamp(3rem, 7vh, 5rem) 0 2.5rem; }
.footer-inner {
  max-width: var(--maxw); margin: 0 auto; padding-inline: var(--pad);
  display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 2.5rem;
}
.footer-brand .wordmark-footer { font-family: var(--font-display); font-weight: 900; font-stretch: 70%; font-size: 1.6rem; display: block; margin-bottom: 0.9rem; }
.footer-brand p { color: var(--text-dim); font-size: 0.9rem; max-width: 34rem; }
.footer-brand a { color: var(--text); border-bottom: 1px solid var(--line-3); }
.footer-col h3 { font-family: var(--font-mono); font-size: 0.66rem; letter-spacing: 0.2em; text-transform: uppercase; color: var(--text-faint); font-weight: 400; margin-bottom: 1rem; }
.footer-col a { display: block; color: var(--text-dim); font-size: 0.92rem; padding: 0.3rem 0; transition: color .2s var(--ease); }
.footer-col a:hover { color: var(--text); }
.footer-legal {
  max-width: var(--maxw); margin: 2.5rem auto 0; padding: 1.5rem var(--pad) 0;
  border-top: 1px solid var(--line);
  font-family: var(--font-mono); font-size: 0.66rem; letter-spacing: 0.06em; color: var(--text-faint); line-height: 1.7;
}
.footer-legal a { color: var(--text-dim); border-bottom: 1px solid var(--line-2); }
@media (max-width: 720px) { .footer-inner { grid-template-columns: 1fr; gap: 1.8rem; } }

/* ============ Lightbox ============ */
.lightbox { border: none; padding: 0; background: transparent; max-width: 92vw; max-height: 92vh; }
.lightbox::backdrop { background: rgba(6,6,8,0.9); }
.lightbox img { width: 100%; height: auto; border-radius: 8px; border: 1px solid var(--line-2); }
.lightbox-close {
  position: fixed; top: 1.2rem; right: 1.4rem; background: var(--surface-2); color: var(--text);
  border: 1px solid var(--line-2); border-radius: 50%; width: 2.6rem; height: 2.6rem; font-size: 1.1rem; cursor: pointer;
}

/* ============ Reveal ============ */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .7s var(--ease), transform .7s var(--ease); transition-delay: calc(var(--i, 0) * 70ms); }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .reveal { opacity: 1; transform: none; transition: none; } }
html:not(.js) .reveal { opacity: 1; transform: none; }

/* ============ Guide ============ */
.guide { max-width: 880px; margin: 0 auto; padding: clamp(2.5rem,7vh,5rem) var(--pad) 6rem; }
.guide-hero { margin-bottom: clamp(1.5rem,4vh,2.5rem); }
.guide-kicker { font-family: var(--font-mono); font-size: 0.72rem; letter-spacing: 0.2em; text-transform: uppercase; color: var(--text-faint); margin: 0 0 1rem; }
.guide-hero h1 { font-size: clamp(2.8rem, 8vw, 5rem); }

/* Table of contents */
.toc { margin-top: 2rem; max-width: 34rem; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.toc a { display: flex; align-items: center; gap: 0.9rem; padding: 0.72rem 1rem; border-top: 1px solid var(--line); color: var(--text-dim); font-size: 0.95rem; transition: background .2s var(--ease), color .2s var(--ease); }
.toc a:first-child { border-top: none; }
.toc a:hover { background: var(--surface); color: var(--text); }
.toc-num { font-family: var(--font-mono); font-size: 0.72rem; color: var(--text-faint); min-width: 1.4rem; }

/* Sections */
.guide-section { padding: clamp(2.2rem,5vh,3.4rem) 0; border-top: 1px solid var(--line); }
.sec-head { display: flex; align-items: center; gap: 1rem; margin-bottom: 1.4rem; }
.guide .sec-num { display: inline-grid; place-items: center; width: 2.1rem; height: 2.1rem; border-radius: 5px; background: var(--surface-2); color: var(--text-dim); font-family: var(--font-mono); font-size: 0.8rem; font-weight: 700; margin: 0; flex: none; }
.guide-section:nth-of-type(1) .sec-num { background: var(--plex); color: var(--on-plex); }
.guide-section:nth-of-type(2) .sec-num { background: var(--jellyfin); color: var(--on-jellyfin); }
.guide-section:nth-of-type(3) .sec-num { background: var(--emby); color: var(--on-emby); }
.guide-section:nth-of-type(4) .sec-num { background: var(--stremio); color: var(--on-stremio); }
.guide-section:nth-of-type(5) .sec-num { background: var(--plex); color: var(--on-plex); }
.guide-section:nth-of-type(6) .sec-num { background: var(--jellyfin); color: var(--on-jellyfin); }
.sec-head h2 { font-size: clamp(1.6rem,3.6vw,2.3rem); font-stretch: 80%; margin: 0; }

/* Body prose */
.guide-body p, .guide-body li { color: var(--text-dim); line-height: 1.66; }
.guide-body a { color: var(--text); border-bottom: 1px solid var(--line-3); }
.guide-body a:hover { border-color: var(--text); }
.guide-body ol, .guide-body ul { padding-left: 1.2rem; }
.guide-body li { margin: 0.4rem 0; }
.guide-body h3 { font-size: 1.1rem; text-transform: none; margin: 1.6rem 0 0.6rem; }

/* Inline code / keys / blocks */
code { font-family: var(--font-mono); font-size: 0.85em; background: var(--surface-2); padding: 0.12em 0.42em; border-radius: 4px; color: var(--text); }
kbd { font-family: var(--font-mono); font-size: 0.8em; background: var(--surface-2); border: 1px solid var(--line-2); border-bottom-width: 2px; border-radius: 4px; padding: 0.12em 0.45em; color: var(--text); white-space: nowrap; }
pre { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 1rem 1.1rem; overflow-x: auto; margin: 1.1rem 0; }
pre code { background: none; padding: 0; font-size: 0.82rem; line-height: 1.55; }

/* Callout */
.note { border: 1px solid var(--line-2); background: var(--surface); padding: 1rem 1.2rem; border-radius: 8px; margin: 1.4rem 0; color: var(--text-dim); }
.note strong { color: var(--text); }

/* Platform / connect definition lists */
.platform-list { margin: 1.3rem 0; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.platform-list > div { display: grid; grid-template-columns: 12rem 1fr; gap: 1.2rem; padding: 1.05rem 1.2rem; border-top: 1px solid var(--line); }
.platform-list > div:first-child { border-top: none; }
.platform-list dt { font-family: var(--font-display); font-weight: 800; font-stretch: 84%; text-transform: uppercase; font-size: 1.02rem; color: var(--text); }
.platform-list dd { margin: 0; color: var(--text-dim); font-size: 0.94rem; line-height: 1.6; }
@media (max-width: 620px) { .platform-list > div { grid-template-columns: 1fr; gap: 0.35rem; } }

/* Controls table */
.controls { width: 100%; border-collapse: collapse; margin: 0.3rem 0 1.4rem; }
.controls th { text-align: left; font-family: var(--font-mono); font-size: 0.64rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--text-faint); font-weight: 400; padding: 0.5rem 0.8rem; border-bottom: 1px solid var(--line-2); }
.controls td { padding: 0.5rem 0.8rem; border-bottom: 1px solid var(--line); color: var(--text-dim); font-size: 0.92rem; vertical-align: middle; }
.controls td:last-child { color: var(--text); }
.controls .btn-glyph { width: 1.7em; height: 1.7em; font-size: 0.62rem; }

/* FAQ disclosures */
.guide-body details { border: 1px solid var(--line); border-radius: 8px; margin: 0.7rem 0; background: var(--surface); overflow: hidden; }
.guide-body summary { padding: 0.9rem 1.1rem; cursor: pointer; font-weight: 700; color: var(--text); list-style: none; display: flex; justify-content: space-between; align-items: center; gap: 1rem; }
.guide-body summary::-webkit-details-marker { display: none; }
.guide-body summary::after { content: '+'; font-family: var(--font-mono); color: var(--text-faint); font-size: 1.1rem; }
.guide-body details[open] summary { border-bottom: 1px solid var(--line); }
.guide-body details[open] summary::after { content: '\2212'; }
.guide-body details > *:not(summary) { margin-left: 1.1rem; margin-right: 1.1rem; }
.guide-body details > p:last-child { margin-bottom: 1rem; }

/* ============ 404 ============ */
.err-panel { border: 1px solid var(--line-2); border-radius: 10px; padding: 1.6rem; background: var(--surface); margin-bottom: 2rem; font-family: var(--font-mono); font-size: 0.9rem; }
.err-strong { color: var(--text); font-weight: 700; margin-bottom: 0.5rem; }
.err-soft { color: var(--text-faint); margin-top: 0.5rem; }
.page-404 .hero-cta { margin-top: 1.5rem; }
