@font-face { font-family: 'Michroma'; font-weight: 400; font-display: swap; src: url('/assets/fonts/Michroma-normal-400-latin.woff2') format('woff2'); }
@font-face { font-family: 'IBM Plex Sans'; font-weight: 300 700; font-display: swap; src: url('/assets/fonts/IBMPlexSans-normal-300-700-latin.woff2') format('woff2'); }
@font-face { font-family: 'IBM Plex Mono'; font-weight: 400; font-display: swap; src: url('/assets/fonts/IBMPlexMono-normal-400-latin.woff2') format('woff2'); }

:root {
  --night: #020A2A; --blue: #06164E; --panel: #0B1C55; --line: #19317F;
  --text: #EEF2FC; --soft: #B4C4EE; --body: #D3DDF6; --link: #A9C6FF; --cyan: #00F0FF; --cobalt: #1F5BFF; --pink: #FF4FA0;
  --rail: 15rem; --col: 42rem; --bar: 3.25rem;
}
* { box-sizing: border-box; }
html { scroll-padding-top: 1.5rem; }
html, body { margin: 0; overflow-x: clip; background: var(--blue); color: var(--text); font-family: 'IBM Plex Sans', 'Helvetica Neue', Arial, sans-serif; }
a { color: var(--link); }
a:hover, a:focus-visible { color: var(--cyan); }
:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; }

/* Masthead */
.masthead { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 0.9rem 1.25rem; background: var(--night); border-bottom: 1px solid var(--line); }
.masthead a { display: block; line-height: 0; }
.masthead img { height: auto; width: min(300px, 52vw); }
.masthead nav a { white-space: nowrap; }
@media (max-width: 34rem) { .masthead { padding: 0.8rem 16px; } .masthead img { width: 38vw; } .masthead nav a { margin-left: 0.55rem; font-size: 0.68rem; letter-spacing: 0; } }
.masthead nav { font-family: 'IBM Plex Mono', monospace; font-size: 0.8rem; letter-spacing: 0.12em; }
.masthead nav a { color: var(--soft); text-decoration: none; margin-left: 1.1rem; line-height: 1.5; display: inline; }
.masthead nav a:hover, .masthead nav a:focus-visible { color: var(--cyan); }
/* The language switch: the same three links in the masthead and the footer. */
.masthead .lang-switch { flex: none; color: var(--soft); }
.masthead .lang-switch a { margin-left: 0; }
.lang-switch a[aria-current] { color: var(--cyan); }
footer .lang-switch { margin-top: 0.4rem; }
@media (max-width: 34rem) { .masthead .lang-switch { font-size: 0.68rem; letter-spacing: 0; } }
/* German's long compounds need breaking in the narrow columns: the sidebars and companion lists, and the text on phones. */
:lang(de) aside.sidebar, :lang(de) nav.comp-side, :lang(de) nav.story-end { -webkit-hyphens: auto; hyphens: auto; }
@media (max-width: 47rem) { :lang(de) .story p { -webkit-hyphens: auto; hyphens: auto; } }
/* Phones and small tablets: the banner's lettering would be too small to read, so the words are set as text
   (the banner itself is the front page's .d-cover, in front.css). */
.hero-text { display: none; }
@media (max-width: 47rem) {
  .hero-text { display: block; padding: 1.25rem 16px 1.5rem; background: var(--night); border-bottom: 1px solid var(--line); }
  .hero-text .kicker { margin: 0 0 0.7rem; font-family: 'IBM Plex Mono', monospace; font-size: 0.75rem; letter-spacing: 0.25em; color: var(--cyan); text-transform: uppercase; }
  .hero-text .title { margin: 0 0 0.8rem; padding-left: 0.8rem; border-left: 3px solid; border-image: linear-gradient(var(--cyan), var(--pink)) 1; font-family: 'Michroma', sans-serif; font-size: 1.6rem; line-height: 1.2; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text); }
  .hero-text .intro { margin: 0; font-size: 1.05rem; line-height: 1.6; font-weight: 300; color: var(--body); }
}

.vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 0; z-index: 50; padding: 0.6rem 1rem; background: var(--cyan); color: var(--night); font-family: 'IBM Plex Mono', monospace; }
.skip:focus { left: 1rem; }

.demo-note { max-width: calc(var(--col) + 2.5rem); margin: 1.5rem auto 0; padding: 0.8rem 1.25rem; font-family: 'IBM Plex Mono', monospace; font-size: 0.8rem; line-height: 1.6; color: var(--pink); border: 1px dashed var(--pink); }
@media (max-width: 47rem) { .demo-note { margin: 1rem 16px 0; } }

/* Page frame: contents rail beside one reading column */
.frame { display: grid; grid-template-columns: var(--rail) minmax(0, var(--col)); justify-content: center; gap: 3.5rem; padding: 0 1.25rem; }
.story { position: relative; min-width: 0; padding: 2.5rem 0 4rem; }

/* Contents */
.toc { position: sticky; top: 0; align-self: start; max-height: 100vh; overflow-y: auto; padding: 2.5rem 0 2rem; scrollbar-width: thin; scrollbar-color: var(--line) transparent; }
.toc-toggle { display: none; }
.toc h2 { font-family: 'IBM Plex Mono', monospace; font-weight: 400; font-size: 0.75rem; letter-spacing: 0.25em; color: var(--cyan); margin: 0 0 1rem; text-transform: uppercase; }
.toc ol { list-style: none; margin: 0; padding: 0; counter-reset: sec; }
.toc li { counter-increment: sec; }
.toc li > a, .toc li > span { display: grid; grid-template-columns: 1.8rem 1fr; padding: 0.42rem 0 0.42rem 0.7rem; border-left: 2px solid var(--line); font-size: 0.92rem; line-height: 1.35; color: var(--soft); text-decoration: none; }
.toc li > a::before, .toc li > span::before { content: counter(sec) "."; font-family: 'IBM Plex Mono', monospace; font-size: 0.8rem; color: var(--soft); opacity: 0.6; padding-top: 0.08rem; }
.toc .comp li > a, .toc .comp li > span { grid-template-columns: 1fr; }
.toc .comp li > a::before, .toc .comp li > span::before { content: none; }
.toc li > span { opacity: 0.55; }
.toc li > a:hover, .toc li > a:focus-visible { color: var(--text); border-left-color: var(--soft); }
.toc a[aria-current="true"] { color: var(--text); border-left-color: var(--cyan); font-weight: 500; }
.toc a[aria-current="true"]::before { color: var(--cyan); }
.toc .companions { margin-top: 1.6rem; }

/* Phones and narrow screens: the contents become a bar at the top */
@media (max-width: 64rem) {
  .frame { display: block; padding: 0 16px; }
  .story { max-width: var(--col); margin: 0 auto; padding-top: 1.75rem; }
  html { scroll-padding-top: calc(var(--bar) + 1rem); }
  .toc { position: sticky; top: 0; z-index: 20; max-height: none; overflow: visible; margin: 0 -16px; padding: 0; background: var(--night); border-bottom: 1px solid var(--line); }
  .toc-toggle { display: flex; align-items: center; gap: 0.7rem; width: 100%; min-height: var(--bar); padding: 0 16px; font: inherit; color: var(--text); background: none; border: 0; cursor: pointer; text-align: left; }
  .toc-toggle .label { font-family: 'IBM Plex Mono', monospace; font-size: 0.72rem; letter-spacing: 0.2em; color: var(--cyan); text-transform: uppercase; }
  .toc-toggle .current { flex: 1; font-size: 0.92rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .toc-toggle .chev { color: var(--cyan); transition: transform 0.2s; }
  .toc[data-open="true"] .chev { transform: rotate(180deg); }
  .toc-panel { display: none; max-height: calc(100vh - var(--bar)); overflow-y: auto; padding: 0.5rem 16px 1.25rem; border-top: 1px solid var(--line); }
  .toc[data-open="true"] .toc-panel { display: block; }
  .toc h2:first-child { display: none; }
  .toc h2.companions { margin-top: 1.2rem; }
}

/* Reading */
.section-head { margin: 0 0 2rem; }
.section-head .num { font-family: 'IBM Plex Mono', monospace; font-size: 0.8rem; letter-spacing: 0.25em; color: var(--cyan); margin: 0 0 0.8rem; }
h1, .section-head h2 { overflow-wrap: anywhere; font-family: 'Michroma', sans-serif; font-weight: 400; font-size: clamp(1.45rem, 4.2vw, 2.2rem); letter-spacing: 0.08em; line-height: 1.25; margin: 0; }
.section-head h2 a.anchor { color: inherit; text-decoration: none; }
.section-head h2 a.anchor:hover::after, .section-head h2 a.anchor:focus-visible::after { content: " #"; color: var(--cyan); }
.story p { font-size: 1.15rem; line-height: 1.75; font-weight: 300; color: var(--body); margin: 0 0 1.25rem; }
/* Lists on the plain pages (About), set like the paragraphs. */
.story > ul { margin: 0 0 1.25rem; padding-left: 1.3rem; }
.story > ul li { font-size: 1.15rem; line-height: 1.75; font-weight: 300; color: var(--body); margin: 0 0 .4rem; }
.story p.lead:not(.capped)::first-letter, .story p.lead .cap { font-family: 'Michroma', sans-serif; float: left; font-size: 3.2rem; line-height: 0.9; padding: 0.35rem 0.6rem 0 0; }
.story p.lead .cap { padding-right: 0.1rem; }

/* Sections of the main history, one after another on the page */
.story > section + section { margin-top: 4.5rem; padding-top: 3rem; border-top: 1px solid var(--line); }

/* Figures */
figure { margin: 2.25rem 0; }
figure img { display: block; width: 100%; height: auto; background: var(--night); }
figcaption { margin-top: 0.6rem; font-size: 0.9rem; line-height: 1.5; color: var(--soft); }
figcaption .credit { display: block; margin-top: 0.25rem; font-family: 'IBM Plex Mono', monospace; font-size: 0.72rem; letter-spacing: 0.02em; opacity: 0.75; }
figcaption .credit a { color: inherit; }
/* A definite width, so the browser reserves the picture's height before it loads (--w and --h come from the build) */
figure.tall img { width: 100%; max-width: calc(34rem * var(--w) / var(--h)); margin: 0 auto; }
figure.small img { max-width: 25rem; }
figure.cover { float: right; width: 13.5rem; margin: 0.4rem 0 1.25rem 1.75rem; }
figure.cover img { border: 1px solid var(--line); }
figure.cover figcaption { font-size: 0.82rem; }
figure.covers { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
figure.covers img { border: 1px solid var(--line); }
figure.covers figcaption { grid-column: 1 / -1; margin-top: 0; }
@media (max-width: 34rem) {
  figure.cover { float: none; width: 62%; margin: 2rem auto; }
}
.clear { clear: both; }

/* Sidebars: panels at a pause in the story */
aside.sidebar { clear: both; margin: 2.75rem 0; padding: 1.6rem 1.6rem 0.6rem; background: var(--panel); border-top: 3px solid var(--cyan); }
aside.sidebar .kicker { font-family: 'IBM Plex Mono', monospace; font-size: 0.72rem; letter-spacing: 0.25em; color: var(--cyan); text-transform: uppercase; margin: 0 0 0.6rem; }
aside.sidebar h3 { font-family: 'Michroma', sans-serif; font-weight: 400; font-size: 1.05rem; letter-spacing: 0.08em; line-height: 1.4; margin: 0 0 1.1rem; color: var(--text); }
aside.sidebar p { font-size: 1.02rem; line-height: 1.7; }
aside.sidebar figure { margin: 0.5rem 0 1.4rem; }
@media (max-width: 34rem) { aside.sidebar { margin-left: -16px; margin-right: -16px; padding: 1.4rem 16px 0.4rem; } }

/* Companion invitations */
a.companion { clear: both; display: block; margin: 2.5rem 0; padding: 1.2rem 1.4rem; border: 1px solid var(--line); border-left: 3px solid var(--pink); text-decoration: none; background: linear-gradient(90deg, rgba(255,79,160,0.08), transparent 60%); }
a.companion .kicker { display: block; font-family: 'IBM Plex Mono', monospace; font-size: 0.72rem; letter-spacing: 0.25em; color: var(--pink); text-transform: uppercase; margin-bottom: 0.45rem; }
a.companion .title { display: block; font-family: 'Michroma', sans-serif; font-size: 1rem; letter-spacing: 0.06em; line-height: 1.45; color: var(--text); }
a.companion .desc { display: block; margin-top: 0.35rem; color: var(--soft); font-size: 0.98rem; line-height: 1.5; }
a.companion .go { display: block; margin-top: 0.7rem; font-family: 'IBM Plex Mono', monospace; font-size: 0.82rem; color: var(--cyan); }
a.companion:hover, a.companion:focus-visible { border-color: var(--pink); }

/* Listening cards (click to load; nothing comes from YouTube before the click) */
.listen { clear: both; margin: 2.5rem 0; border: 1px solid var(--line); background: var(--night); }
.listen-stage { position: relative; aspect-ratio: 16 / 9; display: grid; place-items: center; padding: 1rem; text-align: center;
  background: radial-gradient(ellipse at 50% 120%, rgba(31,91,255,0.35), transparent 60%), var(--night); }
.listen:not([data-state]) .listen-stage { aspect-ratio: auto; min-height: 7.5rem; }
.listen-stage iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.listen-stage .wave { position: absolute; left: 8%; right: 8%; bottom: 18%; height: 2px; background: linear-gradient(90deg, transparent, var(--cyan), var(--pink), transparent); opacity: 0.5; }
.listen-play { position: relative; font: inherit; font-family: 'IBM Plex Mono', monospace; font-size: 0.95rem; letter-spacing: 0.08em; color: var(--night); background: var(--cyan); border: 0; padding: 0.85rem 1.4rem; cursor: pointer; }
.listen-play:hover, .listen-play:focus-visible { background: #7DF7FF; }
.listen-meta { padding: 1rem 1.15rem 1.1rem; border-top: 1px solid var(--line); }
.listen-kicker { margin: 0 0 0.35rem; font-family: 'IBM Plex Mono', monospace; font-size: 0.72rem; letter-spacing: 0.25em; color: var(--cyan); text-transform: uppercase; }
.story .listen-title { margin: 0; font-size: 1.02rem; font-weight: 600; line-height: 1.45; color: var(--text); }
.story .listen-for { margin: 0.35rem 0 0; font-size: 1rem; line-height: 1.55; color: var(--soft); }
.story .listen-notice { margin: 0.7rem 0 0; font-size: 0.78rem; line-height: 1.5; color: var(--soft); opacity: 0.75; }
.listen-after { display: none; gap: 0.6rem; flex-wrap: wrap; padding: 0 1.15rem 1.1rem; }
.listen[data-state=ended] .listen-after { display: flex; }
.listen-hint { display: none; margin: 0; padding: 0.65rem 1.15rem 0; font-family: 'IBM Plex Mono', monospace; font-size: 0.85rem; color: var(--cyan); }
.listen[data-state=tap] .listen-hint { display: block; }
.listen-error { display: none; margin: 0; padding: 1rem 1.15rem 0; font-size: 1rem; line-height: 1.55; }
.story .listen-error { color: var(--text); }
.listen[data-state^=error] .listen-error { display: block; }
.listen[data-state^=error] .listen-stage { display: none; }
.listen[data-provider=bandcamp][data-state=playing] .listen-stage { aspect-ratio: auto; height: 274px; padding: 0; }
.listen-after button, .listen-after a { font: inherit; font-family: 'IBM Plex Mono', monospace; font-size: 0.82rem; color: var(--text); background: none; border: 1px solid var(--line); padding: 0.45rem 0.8rem; cursor: pointer; text-decoration: none; }
.listen-after button:hover, .listen-after a:hover { border-color: var(--cyan); color: var(--cyan); }
.listen-full { display: inline-block; margin-top: 0.6rem; font-family: 'IBM Plex Mono', monospace; font-size: 0.8rem; }

/* Companion page */
.companion-page .story { max-width: var(--col); margin: 0 auto; padding: 2.5rem 16px 4rem; }
.companion-page .story h2 { font-family: 'Michroma', sans-serif; font-weight: 400; font-size: 1.15rem; letter-spacing: 0.1em; line-height: 1.4; color: var(--text); margin: 3rem 0 1.2rem; }
.back-top { font-family: 'IBM Plex Mono', monospace; font-size: 0.82rem; margin: 0 0 2rem; }
.back-top a { text-decoration: none; }
.kicker-line { font-family: 'IBM Plex Mono', monospace; font-size: 0.8rem; letter-spacing: 0.25em; color: var(--pink); text-transform: uppercase; margin: 0 0 1rem; }
.standfirst { font-size: 1.25rem !important; line-height: 1.6 !important; font-weight: 300; }
a.return { display: block; margin: 3rem 0 0; padding: 1.1rem 1.3rem; border: 1px solid var(--line); border-left: 3px solid var(--cyan); text-decoration: none; }
a.return .kicker { display: block; font-family: 'IBM Plex Mono', monospace; font-size: 0.72rem; letter-spacing: 0.25em; color: var(--cyan); text-transform: uppercase; margin-bottom: 0.35rem; }
a.return .title { color: var(--text); font-size: 1.02rem; }

/* Next section, footer */
.next { margin: 3.5rem 0 0; padding-top: 1.5rem; border-top: 1px solid var(--line); font-family: 'IBM Plex Mono', monospace; font-size: 0.85rem; color: var(--soft); }
footer { font-family: 'IBM Plex Mono', monospace; font-size: 0.78rem; letter-spacing: 0.1em; color: var(--soft); opacity: 0.75; text-align: center; padding: 1.5rem 16px; border-top: 1px solid var(--line); background: var(--night); }
footer a { color: inherit; }
.toc em { padding-right: 0.12em; }

/* Wide screens: a third column on the right, where each sidebar sits beside its passage.
   toc.js positions them; without the script they stay in the text. */
.comp-side { display: none; }
@media (min-width: 78rem) {
  .frame { grid-template-columns: 13rem minmax(0, 39rem) 18rem; gap: 2.5rem; }
  aside.sidebar.in-margin { position: absolute; left: calc(100% + 2.5rem); width: 18rem; margin: 0; padding: 1.25rem 1.25rem 0.4rem; }
  aside.sidebar.in-margin h3 { font-size: 0.95rem; }
  aside.sidebar.in-margin p { font-size: 0.95rem; line-height: 1.65; }
  /* The companion stories sit at the top of the right-hand column and scroll away with the page;
     the contents rail keeps only the ten sections (the user, 30 Oct). */
  .toc .companions, .toc .comp { display: none; }
  .comp-side { display: block; position: absolute; top: 2.5rem; left: calc(100% + 2.5rem); width: 18rem; }
}
/* The reading column is 840 px (52.5rem) wherever the three columns fit it (the user, 30 Oct). */
@media (min-width: 91rem) {
  .frame { grid-template-columns: 13rem minmax(0, 52.5rem) 18rem; }
}
/* Companion stories in the right-hand column (wide screens only; elsewhere they are in the contents menu) */
.comp-side h2 { font-family: 'IBM Plex Mono', monospace; font-weight: 400; font-size: 0.75rem; letter-spacing: 0.25em; color: var(--pink); text-transform: uppercase; margin: 0 0 1rem; }
.comp-side ol { list-style: none; margin: 0; padding: 0; }
.comp-side li a { display: block; padding: 0.42rem 0 0.42rem 0.7rem; border-left: 2px solid var(--line); font-size: 0.92rem; line-height: 1.35; color: var(--soft); text-decoration: none; }
.comp-side li a:hover, .comp-side li a:focus-visible { color: var(--text); border-left-color: var(--pink); }
.companion-page .standfirst { margin-top: 1.4rem; }

/* Two-part companions: onward and back links */
.back-top .sep { color: var(--soft); margin: 0 0.4rem; }
.part-next { margin: 1rem 0 0; font-family: 'IBM Plex Mono', monospace; font-size: 0.85rem; }
.story .part-next a { text-decoration: none; }

/* After the last section: the companion stories */
.story-end { clear: both; margin: 4.5rem 0 0; padding-top: 2.5rem; border-top: 1px solid var(--line); }
.story-end h2 { font-family: 'IBM Plex Mono', monospace; font-weight: 400; font-size: 0.75rem; letter-spacing: 0.25em; color: var(--pink); text-transform: uppercase; margin: 0 0 1rem; }
.story-end ul { list-style: none; margin: 0; padding: 0; }
.story-end li a { display: block; padding: 0.5rem 0 0.5rem 0.9rem; border-left: 2px solid var(--line); color: var(--soft); text-decoration: none; font-size: 1rem; line-height: 1.4; }
.story-end li a:hover, .story-end li a:focus-visible { color: var(--text); border-left-color: var(--pink); }
