/* retrofax.app (beta site), "Page 100": the site is itself a teletext
   service wrapped in a calm, modern page. Every section is a numbered page,
   the navigation is the four Fastext keys, and the hero is a live 40 x 25
   screen. Era details: an LCD "now showing" display, soft glossy controls
   (original designs), a shelf of pages with reflections, a source list and
   a column browser. Plain CSS, no build step, nothing from other sites.
   Dark by design; the paper section is the only light surface. */
/* retrofax.app: the shared base (RF-2022 split of the old single site.css, 28 Oct 2026). Everything the legal pages (terms, privacy, refunds) and every other page need: tokens, fonts, header, footer, buttons, text. It is the one stylesheet that is public, like the legal pages that load it. */

/* retrofax.app (beta site), "Page 100": the site is itself a teletext
   service wrapped in a calm, modern page. Every section is a numbered page,
   the navigation is the four Fastext keys, and the hero is a live 40 x 25
   screen. Era details: an LCD "now showing" display, soft glossy controls
   (original designs), a shelf of pages with reflections, a source list and
   a column browser. Plain CSS, no build step, nothing from other sites.
   Dark by design; the paper section is the only light surface. */
@font-face { font-family: 'Bedstead'; src: url('fonts/bedstead-condensed.woff') format('woff'); font-display: swap; }
@font-face { font-family: 'Inter'; src: url('fonts/inter-latin-var.woff2') format('woff2'); font-weight: 100 900; font-display: swap; }
@font-face { font-family: 'JetBrains Mono'; src: url('fonts/jetbrains-mono-latin-400.woff2') format('woff2'); font-display: swap; }
:root {
  /* Canvas */
  --bg: #0B0B10;
  --bg-raised: #15151C;
  --bg-raised-2: #1C1C25;
  --bg-screen: #000000;
  --paper: #F2EFE6;
  --ink-on-paper: #16161A;
  --muted-on-paper: #5E5B55;

  /* Text on dark */
  --fg: #EDEDE6;
  --fg-muted: #9A9AA3;
  --rule: #2A2A33;

  /* Signature */
  --accent: #FFFF00;
  --accent-ink: #16161A;

  /* Teletext 8 */
  --tt-black: #000000; --tt-red: #FF0000; --tt-green: #00FF00; --tt-yellow: #FFFF00;
  --tt-blue: #0000FF; --tt-magenta: #FF00FF; --tt-cyan: #00FFFF; --tt-white: #FFFFFF;

  /* Links and focus */
  --link: #00FFFF;
  --link-hover: #FFFF00;
  --focus: 0 0 0 3px var(--bg), 0 0 0 5px var(--tt-cyan);

  /* Glow (hero screen only) and the sunset horizon behind it */
  --glow: 0 0 0 1px #1d1d1d, 0 0 24px rgba(255, 255, 220, .10), 0 0 80px rgba(120, 180, 255, .08);
  --glow-off: 0 0 0 1px #1d1d1d;
  --hero-horizon: linear-gradient(180deg, #FF3EA5 0%, #FF8A3D 52%, #FFE14D 100%);

  /* Type */
  --font-tt: 'Bedstead', ui-monospace, Menlo, monospace;
  --font-body: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, Menlo, monospace;
  --fs-body: clamp(17px, 0.6vw + 14px, 19px);
  --lh-body: 1.55;
  --fs-small: 0.875rem;
  --fs-h3: clamp(1.15rem, 0.6vw + 1rem, 1.35rem);
  --fs-h2: clamp(1.25rem, 1.4vw + 0.8rem, 1.9rem);
  --fs-h1: clamp(1.5rem, 2.6vw + 0.6rem, 2.7rem);
  --measure: 62ch;

  /* Teletext screen: 40 Bedstead Condensed cells are 18em; the grid is
     drawn 2x wide, as the app draws it (cells 0.9 of their height). */
  --tt-cols: 40; --tt-rows: 25; --tt-stretch: 2;

  /* Space and shape */
  --gutter: 16px;
  --space-1: 4px; --space-2: 8px; --space-3: 16px; --space-4: 24px;
  --space-5: 40px; --space-6: 64px; --space-7: 104px;
  --max: 1200px;
  --radius-screen: 6px; --radius-card: 14px; --radius-key: 8px;

  /* Motion */
  --t-fast: 120ms; --t-base: 200ms; --t-roll: 450ms; --t-ident: 1200ms;
  --ease: cubic-bezier(.2, .7, .2, 1);
  --flash-period: 1000ms;

  color-scheme: dark;
}
@media (prefers-reduced-motion: reduce) {
  :root { --t-fast: 0ms; --t-base: 0ms; --t-roll: 0ms; --t-ident: 0ms; }
  *, *::before, *::after { scroll-behavior: auto !important; }
}
/* ------------------------------------------------------------- basics --- */
*, *::before, *::after { box-sizing: border-box; }
html { background: var(--bg); -webkit-text-size-adjust: 100%; scroll-padding-top: 88px; }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
body {
  margin: 0; background: var(--bg); color: var(--fg);
  font: 400 var(--fs-body)/var(--lh-body) var(--font-body);
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}
img, svg, video { max-width: 100%; height: auto; display: block; }
/* RF-2022: the WebP wrapper takes no box of its own, so the picture inside lays out exactly as before. */
picture { display: contents; }
a { color: var(--link); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--link-hover); }
:focus-visible { outline: none; box-shadow: var(--focus); border-radius: 4px; }
p { margin: 0 0 1em; }
h1, h2, h3 { margin: 0 0 .5em; line-height: 1.15; }
h3 { font-size: var(--fs-h3); font-weight: 650; letter-spacing: -0.01em; }
ul, ol { padding-left: 1.2em; }
li { margin-bottom: .35em; }
b, strong { font-weight: 650; }
.skip { position: absolute; left: 8px; top: -60px; z-index: 100; padding: 10px 14px; background: var(--accent); color: var(--accent-ink); font-weight: 700; border-radius: 8px; text-decoration: none; }
.skip:focus { top: 8px; }
.wrap { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 var(--space-5); }
.muted { color: var(--fg-muted); }
.lede { font-size: clamp(1.1rem, 0.7vw + 0.95rem, 1.3rem); color: #D6D6CF; max-width: var(--measure); line-height: 1.5; }
/* Bedstead Condensed at twice the size has the proportions of a teletext
   double-height row (the screen draws single height 2x wide). */
.dh { margin: 0; line-height: 1; }
.prose { max-width: var(--measure); }
/* ------------------------------------------------------------ header bar --- */
.hdr { position: sticky; top: 0; z-index: 50; background: #0B0B10; border-bottom: 1px solid #1d1d25; }
.hdr::after { content: ''; position: absolute; left: 0; right: 0; bottom: -1px; height: 1px; background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .08), transparent); }
.hdr-in { max-width: 1320px; margin: 0 auto; padding: 0 24px; height: 68px; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 20px; }
.brand { display: inline-flex; align-items: center; gap: 6px; text-decoration: none; color: var(--fg); font-family: var(--font-tt); font-size: 22px; white-space: nowrap; }
/* The app icon has transparent margins (macOS template), so it sits a little larger than the type. */
.brand-icon { display: block; width: 32px; height: 32px; margin: 0 -2px 0 -4px; flex: none; }
.brand .word b { color: var(--accent); font-weight: 400; }
.brand:hover { color: #fff; }
@media (max-width: 1180px) {
  .hdr-in { gap: 14px; }
}
@media (max-width: 760px) {
  html { scroll-padding-top: 16px; }
  .hdr { position: relative; }
  .hdr-in { height: auto; padding: 10px var(--gutter) 12px; grid-template-columns: auto minmax(0, 1fr); row-gap: 10px; column-gap: 12px; }
  /* 44 px touch target, pulled back by 6 px above and below so the header keeps its height */
  .brand { font-size: 19px; min-height: 44px; margin: -6px 0; display: inline-flex; align-items: center; }
}
/* ------------------------------------------------- bands, mosaic rules --- */
.band { position: relative; color: #000; }
.band-cyan { background: var(--tt-cyan); }
.band-blue { background: var(--tt-blue); color: #fff; }
.band-in { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; min-height: 96px; padding-top: 18px; padding-bottom: 14px; }
.band h1, .band h2 { font-family: var(--font-tt); font-weight: 400; font-size: clamp(1.45rem, 2.4vw + .5rem, 2.6rem); letter-spacing: .01em; }
.mosaic-rule {
  height: 12px;
  background:
    linear-gradient(90deg, var(--tt-red) 0 12.5%, var(--tt-green) 12.5% 25%, var(--tt-yellow) 25% 37.5%, var(--tt-blue) 37.5% 50%, var(--tt-magenta) 50% 62.5%, var(--tt-cyan) 62.5% 75%, var(--tt-white) 75% 87.5%, var(--tt-red) 87.5% 100%);
  background-size: 192px 100%;
  -webkit-mask: linear-gradient(90deg, #000 0 50%, transparent 50%) 0 0 / 12px 6px, linear-gradient(90deg, transparent 0 50%, #000 50%) 0 6px / 12px 6px;
  -webkit-mask-repeat: repeat-x; mask: linear-gradient(90deg, #000 0 50%, transparent 50%) 0 0 / 12px 6px repeat-x, linear-gradient(90deg, transparent 0 50%, #000 50%) 0 6px / 12px 6px repeat-x;
  opacity: .9;
}
.phead { margin-bottom: var(--space-5); }
.phead .lede { margin-top: var(--space-5); margin-bottom: 0; }
/* Index lists with dot leaders (regions on the home page, the footer) */
.index { list-style: none; margin: 0; padding: 0; font-family: var(--font-tt); }
.index li { margin: 0; }
.index a { display: flex; align-items: baseline; gap: 10px; padding: 6px 0; color: var(--fg); text-decoration: none; font-size: 18px; }
.index a:hover span { color: var(--accent); }
/* --------------------------------------------- source-list layout (side) --- */
.with-side { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 56px; align-items: start; padding-bottom: var(--space-7); }
.side { position: sticky; top: 92px; max-height: calc(100vh - 110px); overflow: auto; padding: 14px 10px; border-radius: 14px;
  background: linear-gradient(180deg, #16161e, #121219); box-shadow: 0 0 0 1px #24242d, inset 0 1px 0 rgba(255, 255, 255, .04); }
.side-h { font: 700 11px/1 var(--font-body); letter-spacing: .12em; text-transform: uppercase; color: #8A8A94; margin: 6px 10px 10px; }
.side ul { list-style: none; margin: 0 0 6px; padding: 0; }
.side li { margin: 0; }
.side a { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: 8px; color: #D9D9D2; text-decoration: none; font-size: 15px; font-weight: 500; }
.side a small { margin-left: auto; color: #77777f; font-size: 12px; }
.side a:hover { background: #1f1f28; color: #fff; }
.side a.on { color: #0b0b10; background: linear-gradient(180deg, #8fb4ff 0%, #4f82f0 50%, #3a6fe6 52%, #6d9cff 100%); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .5), 0 0 0 1px #1d3f99; color: #fff; text-shadow: 0 1px 1px rgba(0, 0, 0, .35); }
.side a.on small { color: #e6eeff; }
.side-ico { width: 16px; height: 16px; border-radius: 4px; flex: none; position: relative; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .5), 0 0 0 1px rgba(0, 0, 0, .5); }
.ico-r { background: linear-gradient(#ff8a7e, #ff2a1f); }
.ico-g { background: linear-gradient(#8ff59a, #22db3f); }
.ico-y { background: linear-gradient(#fff98a, #ffe600); }
.ico-c { background: linear-gradient(#8ff3f9, #12d4e2); }
.ico-b { background: linear-gradient(#7d94ff, #1430f0); }
.ico-m { background: linear-gradient(#ff8af6, #ff00e6); }
.ico-w { background: linear-gradient(#ffffff, #b9bcc8); }
.side-main { min-width: 0; }
.side-main > section { scroll-margin-top: 90px; }
@media (max-width: 960px) {
  .with-side { grid-template-columns: 1fr; gap: 24px; }
  .side { position: static; max-height: none; padding: 12px; }
  .side ul { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
  .side a { position: relative; isolation: isolate; z-index: 0; border-radius: 999px; padding: 8px 12px; font-size: 14px; background: linear-gradient(180deg, #4a4e5c, #2a2d37); box-shadow: 0 0 0 1px #000, inset 0 1px 0 rgba(255, 255, 255, .2); color: #fff; }
  .side a small { display: none; }
}
/* Feature sections (Features page) */
.feat { padding: 0 0 var(--space-6); }
.feat + .feat { padding-top: var(--space-2); }
.feat-band { display: flex; justify-content: space-between; align-items: center; padding: 12px 18px 10px; border-radius: 10px 10px 0 0; font-family: var(--font-tt); color: #000; }
.feat-band h2 { margin: 0; font-weight: 400; font-size: clamp(20px, 1.2vw + 12px, 28px); line-height: 1; }
.feat-band span { font-size: 18px; }
.feat-band.red { background: var(--tt-red); }
.feat-band.green { background: var(--tt-green); }
.feat-band.yellow { background: var(--tt-yellow); }
.feat-band.cyan { background: var(--tt-cyan); }
.feat-band.blue { background: var(--tt-blue); color: #fff; }
.feat-band.magenta { background: var(--tt-magenta); }
.feat-body { background: var(--bg-raised); border-radius: 0 0 var(--radius-card) var(--radius-card); padding: 28px; box-shadow: 0 0 0 1px #22222b; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); gap: 32px; align-items: start; }
.feat-body.one { grid-template-columns: 1fr; }
@media (max-width: 1180px) { .feat-body { grid-template-columns: 1fr; } }
.feat-body h3 { font-size: var(--fs-h3); margin-top: 0; }
.feat-body ul { padding-left: 1.1em; }
.feat-body li::marker { color: var(--accent); }
/* --------------------------------------------------------------- footer --- */
.ftr { margin-top: 0; background: #08080c; border-top: 1px solid #1a1a22; }
.ftr-grid { display: grid; grid-template-columns: 4fr 5fr; gap: 24px 64px; padding-top: 48px; padding-bottom: 40px; }
.ftr-word { font-family: var(--font-tt); font-size: 26px; margin: 0 0 10px; display: flex; align-items: center; gap: 8px; }
.ftr-word .brand-icon { width: 48px; height: 48px; margin-left: -5px; }
.ftr-word b { color: var(--accent); font-weight: 400; }
.ftr-id p:not(.ftr-word) { color: var(--fg-muted); font-size: 15px; max-width: 40ch; }
.ftr-h { font: 700 11px/1 var(--font-body); letter-spacing: .12em; text-transform: uppercase; color: #8A8A94; margin: 6px 0 8px; }
.ftr .index { columns: 2; column-gap: 40px; }
.ftr .index li { break-inside: avoid; }
.ftr .index a { font-size: 17px; padding: 5px 0; }
.ftr-small { grid-column: 1 / -1; border-top: 1px solid #1e1e26; padding-top: 22px; display: grid; grid-template-columns: 1fr 1fr; gap: 12px 48px; }
.ftr-small p { color: #8E8E97; font-size: 13.5px; margin: 0; }
.ftr-small a { color: #B9F6F9; }
@media (max-width: 960px) {
  .wrap { padding-left: 28px; padding-right: 28px; }
  .feat-body { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  :root { --space-7: 72px; --space-6: 48px; }
  .wrap { padding-left: var(--gutter); padding-right: var(--gutter); }
  .band-in { min-height: 76px; }
  .feat-body { padding: 20px; }
  .side a { white-space: nowrap; font-size: 13.5px; gap: 8px; }
  :root { --fs-h2: 1.55rem; }
  .ftr-grid { grid-template-columns: 1fr; }
  .ftr .index { columns: 1; }
  .ftr .index li a { padding: 10px 0; }
  /* RF-2022 pass 2: the contents pills wrap instead of cutting the words off ("What stays on your d") */
  .side ul li a { min-height: 44px; white-space: normal; line-height: 1.2; border-radius: 22px; padding-top: 6px; padding-bottom: 6px; }
  .band-in { align-items: center; padding-top: 20px; padding-bottom: 18px; }
  .ftr-small { grid-template-columns: 1fr; }
}
