/* ============================================================
   BeoFamily — Basis-Stylesheet
   ============================================================ */

@font-face {
  font-family: "Sora";
  src: url("../fonts/Sora-Variable.woff2") format("woff2");
  font-weight: 400 800;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Manrope";
  src: url("../fonts/Manrope-Variable.woff2") format("woff2");
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
}

:root {
  --font-display: "Sora", "Helvetica Neue", Arial, sans-serif;
  --font-text: "Manrope", "Helvetica Neue", Arial, sans-serif;

  --aluminium-light: linear-gradient(180deg, #EDEDEB 0%, #F2F2F0 22%, #D6D5D1 46%, #C0BFBB 70%, #9B9A96 100%);
  --aluminium-dark: linear-gradient(180deg, #6B6A67 0%, #9B9A96 14%, #C7C6C2 32%, #8A8987 60%, #55534F 82%, #2C2A27 100%);
  --aluminium-dark-sammler: linear-gradient(180deg, #6B6A67 0%, #9B9A96 14%, #C7C6C2 32%, #8A8987 60%, #6E6C64 82%, #4A473F 100%);
  /* Darker peak than --aluminium-dark, so #F2F1EE text clears 4.5:1 even at the gradient's brightest point (peak measured at 5.17:1). Used by both hero bands (article + portal). */
  --aluminium-hero: linear-gradient(180deg, #46443F 0%, #55534F 14%, #666560 32%, #46443F 60%, #302E2A 82%, #17150F 100%);

  --ink: #1C1B19;
  --paper: #F5F4F2;
  --line: rgba(28, 27, 25, 0.12);
  --line-on-dark: rgba(255, 255, 255, 0.18);

  /* Flat chapter surfaces. Gradient/glow backgrounds are reserved for the
     hero bands (--aluminium-hero) only; every chapter below alternates
     between these two flat tones instead. */
  --surface: #EDEDEB;
  --surface-gold: #F0E3BE;

  --max-width: 980px;
  --gutter: clamp(1.25rem, 4vw, 3.5rem);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  /* Reserves this much room above every native anchor-scroll target,
     site-wide, so the fixed 64px .topnav never covers whatever was jumped
     to. Centralized here instead of scroll-margin-top on each individual
     target (.chapter, .chapter h3, .appendix li): scroll-margin-top on an
     inline target (like a footnote's <a> inside <sup>, mid-sentence) was
     observed to be unreliable in Safari specifically, landing a couple of
     lines short when several citations sit close together. scroll-padding
     on the scroll container itself applies uniformly regardless of
     whether the target is inline or block, and has been reliable in
     Safari since 14.1. */
  scroll-padding-top: 64px;
}

/* Slightly larger base size on devices with a mouse/trackpad (real desktops
   and laptops), left untouched on touch devices like phones and tablets,
   since those already read comfortably at 16px. Every rem-based size in
   this file scales with it. */
@media (hover: hover) and (pointer: fine) {
  html {
    font-size: 18px;
  }
}

body {
  margin: 0;
  font-family: var(--font-text);
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.1;
  margin: 0 0 0.6em;
  letter-spacing: -0.01em;
}

p {
  line-height: 1.65;
  margin: 0 0 1.2em;
}

a {
  color: inherit;
}

/* currentColor instead of the browser's default blue keeps the keyboard
   focus ring visible against every chapter background, dark or light. */
:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 2px;
}

a[href^="#fnref"] {
  text-decoration: none;
}

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

/* ---------------- Top navigation ---------------- */

.topnav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  /* Explicit height, not left to content: an unset height inherited the
     page's line-height on whichever child happened to carry the tallest
     hidden line box, producing a ~16-21px difference between pages (e.g.
     Impressum vs. the article) and a visible "jump" when navigating
     between them. Pinning it here plus line-height: 1 on the brand link,
     nav links and language switcher below keeps it identical everywhere. */
  height: 64px;
  padding: 0 var(--gutter);
  background: rgba(245, 244, 242, 0.86);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid transparent;
  transform: translateY(-100%);
  transition: transform 0.4s ease, border-color 0.4s ease;
}

/* Brand (Sora), links and language switch (Manrope) have different font
   metrics, so centring their boxes leaves the text at different heights.
   In the full bar they are aligned on the shared text baseline instead,
   and the group is centred in the 64px bar by the padding. */
.topnav:not(.is-compact) {
  align-items: baseline;
  padding-top: calc(32px - 0.45em);
  box-sizing: border-box;
}

.topnav.is-visible {
  transform: translateY(0);
  border-bottom-color: var(--line);
}

.topnav__brand {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.95rem;
  line-height: 1;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--ink);
}

.topnav__links {
  display: flex;
  align-items: center;
  gap: clamp(0.9rem, 2vw, 1.8rem);
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: 0.88rem;
  line-height: 1;
}

.topnav__links a {
  font-size: 0.88rem;
  line-height: 1;
  letter-spacing: 0.03em;
  text-decoration: none;
  color: var(--ink);
  opacity: 0.72;
  transition: opacity 0.2s ease;
  white-space: nowrap;
}

.topnav__links a:hover {
  opacity: 1;
}

.topnav__lang {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.78rem;
  line-height: 1;
  letter-spacing: 0.04em;
}

.topnav__lang a {
  text-decoration: none;
  opacity: 0.55;
}

.topnav__lang a.is-active {
  opacity: 1;
  font-weight: 600;
}

.topnav__toggle {
  display: none;
  width: 44px;
  height: 44px;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  padding: 0;
  margin: 0 0.2rem 0 -0.5rem;
  cursor: pointer;
  color: var(--ink);
  flex-shrink: 0;
  -webkit-tap-highlight-color: transparent;
}

.topnav__toggle svg {
  width: 22px;
  height: 22px;
}

.topnav__toggle-line {
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  transform-origin: center;
  transition: transform 0.25s ease, opacity 0.2s ease;
}

.topnav__toggle[aria-expanded="true"] .topnav__toggle-line--top {
  transform: translateY(5px) rotate(45deg);
}

.topnav__toggle[aria-expanded="true"] .topnav__toggle-line--mid {
  opacity: 0;
}

.topnav__toggle[aria-expanded="true"] .topnav__toggle-line--bottom {
  transform: translateY(-5px) rotate(-45deg);
}

/* Hamburger layout. nav.js adds .is-compact as soon as brand, links and
   language switch no longer fit side by side. The links then live in a
   drawer that slides in from the left (built by nav.js, see .drawer below).
   The 760px media query is only the fallback before the script has run. */
.topnav.is-compact .topnav__toggle {
  display: inline-flex;
}

.topnav.is-compact .topnav__links {
  display: none;
}

/* ---------------- Slide-in menu ---------------- */

.drawer {
  position: fixed;
  inset: 0;
  z-index: 200;
  visibility: hidden;
  pointer-events: none;
  transition: visibility 0s linear 0.4s;
}

.drawer.is-open {
  visibility: visible;
  pointer-events: auto;
  transition-delay: 0s;
}

.drawer__scrim {
  position: absolute;
  inset: 0;
  background: rgba(20, 19, 17, 0.45);
  opacity: 0;
  transition: opacity 0.4s ease;
}

.drawer.is-open .drawer__scrim {
  opacity: 1;
}

.drawer__panel {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: min(86vw, 22rem);
  display: flex;
  flex-direction: column;
  padding: 0 var(--gutter) 2rem;
  background: var(--paper);
  box-shadow: 0 0 40px rgba(20, 19, 17, 0.25);
  overflow-y: auto;
  transform: translateX(-100%);
  transition: transform 0.4s cubic-bezier(0.22, 0.8, 0.24, 1);
}

.drawer.is-open .drawer__panel {
  transform: none;
}

.drawer__panel:focus {
  outline: none;
}

.drawer__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
  flex-shrink: 0;
}

.drawer__brand {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.95rem;
  line-height: 1;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--ink);
}

.drawer__close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  margin-right: -10px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--ink);
  cursor: pointer;
}

.drawer__close svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
}

.drawer__links {
  list-style: none;
  margin: 1.5rem 0 0;
  padding: 0;
}

.drawer__links a {
  display: block;
  padding: 0.85rem 0;
  border-bottom: 1px solid var(--line);
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 1.25rem;
  line-height: 1.2;
  letter-spacing: 0.01em;
  text-decoration: none;
  color: var(--ink);
}

.drawer__links a:hover {
  opacity: 0.6;
}

.drawer__lang {
  display: flex;
  gap: 1rem;
  margin-top: auto;
  padding-top: 2rem;
  font-size: 0.9rem;
  letter-spacing: 0.06em;
}

.drawer__lang a {
  text-decoration: none;
  color: var(--ink);
  opacity: 0.55;
}

.drawer__lang a.is-active {
  opacity: 1;
  font-weight: 600;
}

html.menu-open {
  overflow: hidden;
}

@media (prefers-reduced-motion: reduce) {
  .drawer,
  .drawer__scrim,
  .drawer__panel {
    transition: none;
  }
}

@media (max-width: 760px) {
  .topnav__toggle {
    display: inline-flex;
  }

  .topnav__links {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    gap: 0;
    padding: 0.5rem var(--gutter) 1rem;
    background: rgba(245, 244, 242, 0.98);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--line);
  }

  .topnav__links.is-open {
    display: flex;
  }

  .topnav__links a {
    display: block;
    padding: 0.85rem 0;
    border-bottom: 1px solid var(--line);
    opacity: 0.85;
  }

  .topnav__links li:last-child a {
    border-bottom: none;
  }

}

@media (max-width: 760px) {
  /* On touch screens the timeline already scrolls by swipe; the click
     arrows are fixed to the container edge and collide with the dot of
     whichever item lands there once the track is scrolled that far, so
     they only make sense on the wider desktop/tablet layout. */
  .hz-timeline__arrow {
    display: none !important;
  }

  /* These tables and the Bauzeiten chart are always wider than the screen
     here, so fade whichever edge still has content to scroll to, a
     visible hint that there's more. JS (nav.js) toggles .scrolled once
     scrollLeft leaves 0 and .at-end once it reaches the far side. */
  .table-wrap,
  .bz-chart {
    -webkit-mask-image: linear-gradient(to right, black calc(100% - 48px), transparent 100%);
    mask-image: linear-gradient(to right, black calc(100% - 48px), transparent 100%);
  }

  .table-wrap.at-end,
  .bz-chart.at-end {
    -webkit-mask-image: none;
    mask-image: none;
  }

  .table-wrap.scrolled,
  .bz-chart.scrolled {
    -webkit-mask-image: linear-gradient(to right, transparent 0, black 48px, black calc(100% - 48px), transparent 100%);
    mask-image: linear-gradient(to right, transparent 0, black 48px, black calc(100% - 48px), transparent 100%);
  }

  .table-wrap.scrolled.at-end,
  .bz-chart.scrolled.at-end {
    -webkit-mask-image: linear-gradient(to right, transparent 0, black 48px, black 100%);
    mask-image: linear-gradient(to right, transparent 0, black 48px, black 100%);
  }
}

/* ---------------- Hero ---------------- */

.hero {
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 7rem var(--gutter) 5rem;
  background: var(--aluminium-hero);
  color: #F2F1EE;
  position: relative;
  overflow: hidden;
}

.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(120% 90% at 50% 0%, rgba(255,255,255,0.10), transparent 60%);
  pointer-events: none;
}

.hero__eyebrow {
  font-size: 0.78rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  /* Dimmed text throughout this file (this rule and others like
     .hero__subtitle, .site-footer__meta, .portal-credit, .appendix a)
     used to be done with opacity on top of the element's own color. That
     interacted badly with gradient/variable backgrounds and sometimes
     compounded with a parent's own opacity, dropping contrast well below
     WCAG AA in several places. Each was replaced with this kind of
     hand-picked solid color instead, checked against its actual
     background to clear 4.5:1 (body text) or 3:1 (large text). */
  color: #E4E2DE;
  margin-bottom: 1.4rem;
}

.hero__title {
  font-size: clamp(2.6rem, 7vw, 5.6rem);
  font-weight: 700;
  letter-spacing: 0.01em;
  margin-bottom: 1.1rem;
  max-width: 18ch;
}

.hero__subtitle {
  font-family: var(--font-text);
  font-size: clamp(1.02rem, 1.6vw, 1.3rem);
  font-weight: 400;
  color: #E4E2DE;
  max-width: 64ch;
  margin: 0 auto 1.8rem;
  line-height: 1.55;
}

.hero__models {
  font-size: 0.82rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #E4E2DE;
}

.hero__scroll {
  position: absolute;
  bottom: 2.2rem;
  left: 50%;
  transform: translateX(-50%);
  width: 1px;
  height: 42px;
  background: linear-gradient(180deg, rgba(242,241,238,0.7), transparent);
}

/* ---------------- Chapters ---------------- */

.chapter {
  position: relative;
  padding: clamp(4rem, 8vw, 7rem) var(--gutter);
  /* The fixed nav's clearance above anchor-scroll targets is handled
     site-wide by scroll-padding-top on html (see there for why that
     replaced a per-target scroll-margin-top here). */
}

.chapter__inner {
  position: relative;
  max-width: var(--max-width);
  margin: 0 auto;
}

.chapter__eyebrow {
  display: block;
  font-family: var(--font-display);
  font-size: 0.78rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  margin-bottom: 1rem;
  color: var(--chapter-eyebrow, inherit);
}

.chapter__title {
  font-size: clamp(1.9rem, 3.6vw, 2.9rem);
  margin-bottom: 2.6rem;
  max-width: 22ch;
}

.chapter h3 {
  font-size: clamp(1.15rem, 1.8vw, 1.4rem);
  margin-top: 2.6rem;
}

.chapter h3:first-of-type {
  margin-top: 0;
}

.chapter h4 {
  font-size: clamp(1rem, 1.4vw, 1.15rem);
  margin-top: 2.8rem;
}

/* Earlier version of the chapter themes used an aluminium gradient with a
   glossy highlight per chapter, some tinted rosé/magenta. Kept below,
   commented out, in case that look needs to come back for a chapter. */

/* Vorherige Fassungen (Aluminium-Verlauf mit Glanzlicht, teils Rosé/Magenta), zum Zurückbauen:
.chapter--intro {
  background: var(--aluminium-light);
  background-repeat: no-repeat;
  color: #26241F;
  --chapter-eyebrow: #6B6862;
}

.chapter--geschichte {
  background:
    linear-gradient(rgba(242,194,48,0.26), rgba(242,194,48,0.26)),
    var(--aluminium-light);
  background-repeat: no-repeat;
  color: #332B14;
  --chapter-eyebrow: #7A5E12;
}

.chapter--modelle {
  background: var(--aluminium-light);
  background-repeat: no-repeat;
  color: #26241F;
  --chapter-eyebrow: #6B6862;
}

.chapter--zubehoer {
  background:
    linear-gradient(rgba(217,171,74,0.22), rgba(217,171,74,0.22)),
    var(--aluminium-light);
  background-repeat: no-repeat;
  color: #3A2E14;
  --chapter-eyebrow: #8F702E;
}

.chapter--sammler {
  background:
    linear-gradient(rgba(163,21,72,0.38), rgba(163,21,72,0.38)),
    var(--aluminium-dark-sammler);
  background-repeat: no-repeat;
  color: #F6DCE6;
  --chapter-eyebrow: #DE93B0;
}

.chapter--sammler a { color: #F6DCE6; text-decoration-color: rgba(246,220,230,0.5); }

.chapter--ueberblick {
  background:
    linear-gradient(rgba(178,53,104,0.11), rgba(178,53,104,0.11)),
    var(--aluminium-light);
  background-repeat: no-repeat;
  color: #3A1424;
  --chapter-eyebrow: #9C3E6B;
}

.chapter--sammler {
  background: var(--aluminium-dark);
  background-repeat: no-repeat;
  color: #EDEDEB;
  --chapter-eyebrow: #B9B8B2;
}

.chapter--sammler a { color: #EDEDEB; text-decoration-color: rgba(237,237,235,0.5); }

.chapter--ueberblick {
  background: var(--aluminium-light);
  background-repeat: no-repeat;
  color: #26241F;
  --chapter-eyebrow: #6B6862;
}

.chapter--quellen {
  background: var(--aluminium-dark);
  background-repeat: no-repeat;
  color: #EDEDEB;
  --chapter-eyebrow: #B9B8B2;
}

.chapter--quellen a { color: #EDEDEB; }
*/

/* Current chapter themes: flat surfaces alternating --surface (neutral) and
   --surface-gold down the page, so no two adjacent chapters share a tone.
   .chapter--nachwort and .chapter--quellen used to be one shared class
   (both "quellen"); they were split so the afterword and the sources
   section, which sit back to back, don't render in the same color. */

.chapter--intro {
  background: var(--surface);
  color: #26241F;
  --chapter-eyebrow: #6B6862;
}

.chapter--geschichte {
  background: var(--surface-gold);
  color: #332B14;
  --chapter-eyebrow: #7A5E12;
}

.chapter--modelle {
  background: var(--surface);
  color: #26241F;
  --chapter-eyebrow: #6B6862;
}

.chapter--zubehoer {
  background: var(--surface-gold);
  color: #3A2E14;
  --chapter-eyebrow: #8F702E;
}

.chapter--sammler {
  background: var(--surface);
  color: #26241F;
  --chapter-eyebrow: #6B6862;
}

.chapter--ueberblick {
  background: var(--surface-gold);
  color: #3A2E14;
  --chapter-eyebrow: #8F702E;
}

.chapter--nachwort {
  background: var(--surface);
  color: #26241F;
  --chapter-eyebrow: #6B6862;
}

.chapter--rueckkehr {
  background: var(--surface);
  color: #26241F;
  --chapter-eyebrow: #6B6862;
}

.chapter--quellen {
  background: var(--surface-gold);
  color: #3A2E14;
  --chapter-eyebrow: #8F702E;
}

.chapter--literatur {
  background: var(--surface);
  color: #26241F;
  --chapter-eyebrow: #6B6862;
}

/* A sub-section that continues a chapter without repeating the H2 needs less top padding */
.chapter--sub {
  padding-top: clamp(3rem, 6vw, 5rem);
}

/* Small print inside a chapter (notes on a table, spelling remarks). Takes the
   text colour of the chapter it sits in, so it never clashes with the
   background, and uses the same size as the source list (0.86rem). */
.note {
  font-size: 0.86rem;
  line-height: 1.6;
  opacity: 0.78;
}

/* ---------------- Content elements ---------------- */

.excursus {
  border-left: 1px solid currentColor;
  padding: 0.2rem 0 0.2rem 1.4rem;
  margin: 2rem 0;
}

.excursus > :last-child {
  margin-bottom: 0;
}

.excursus-title {
  display: block;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.95rem;
  letter-spacing: 0.02em;
  margin-bottom: 0.6rem;
}

.table-wrap {
  overflow-x: auto;
  margin: 1.6rem 0;
}

table {
  border-collapse: collapse;
  width: 100%;
  font-size: 0.92rem;
}

/* Specs tables (Grunddaten, Radio, CD, Kassette): identical column widths
   across all four, so the same device always lines up in the same place. */
.specs-table {
  table-layout: fixed;
  min-width: 640px;
}

.specs-table col.label { width: 22%; }
.specs-table col.device { width: 15.6%; }
.specs-table th { hyphens: none; }

/* Safari/WebKit sometimes lets row content influence column widths even
   under table-layout: fixed, despite the colgroup above already setting
   them, pinning the widths on the header cells themselves as well keeps
   every column the same width regardless of whether its header wraps. */
.specs-table th:first-child, .specs-table td:first-child { width: 22%; }
.specs-table th:not(:first-child), .specs-table td:not(:first-child) { width: 15.6%; }

.table-sammler {
  table-layout: fixed;
  min-width: 640px;
}

/* Serial-number comparison table: fixed layout with explicit column widths
   so every source column gets the same running width and the merged-source
   column (three names stacked in its header) has room to breathe. The 13%
   first column carries extra right padding so "Erste Ziffern" doesn't sit
   tight against the next column's header. Empty cells are dimmed instead
   of being left blank, so a missing value reads as "this source has no
   entry" rather than as a rendering gap. */
.table-seriennummern {
  table-layout: fixed;
  min-width: 680px;
}

.table-seriennummern col.jahr { width: 13%; }
.table-seriennummern col.gruppe { width: 21%; }
.table-seriennummern col.quelle { width: 22%; }
.table-seriennummern th { hyphens: none; }
.table-seriennummern td.na { opacity: 0.4; }
.table-seriennummern th:first-child,
.table-seriennummern td:first-child {
  padding-right: 1.8rem;
}

th, td {
  text-align: left;
  padding: 0.6rem 1rem 0.6rem 0;
  border-bottom: 1px solid currentColor;
  border-bottom-color: rgba(0,0,0,0.14);
  vertical-align: top;
  overflow-wrap: break-word;
  hyphens: auto;
}

/* Nicht mehr gebraucht, seit Sammler/Quellen keine dunklen Kapitel mehr sind, zum Zurückbauen:
.chapter--sammler th, .chapter--sammler td,
.chapter--quellen th, .chapter--quellen td {
  border-bottom-color: rgba(255,255,255,0.18);
}
*/

th {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.8rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  opacity: 0.75;
}

ul, ol {
  padding-left: 1.3rem;
  line-height: 1.65;
}

li {
  margin-bottom: 0.5rem;
}

/* Superscripts must not push their line apart. With the browser default
   (vertical-align: super) every line holding a footnote number came out
   3 to 6px taller than its neighbours, so the line spacing looked uneven.
   Raised by position instead, with no effect on the line box. */
sup {
  font-size: 0.65em;
  line-height: 0;
  vertical-align: baseline;
  position: relative;
  top: -0.55em;
}

/* 11px is the minimum still considered legible for a superscript number;
   the previous 0.75em came out to 10.35px, just under it. */
sup a {
  text-decoration: none;
  font-size: 11px;
}

/* The backlink (↑) target is this citation number itself, an <a>, so the
   browser auto-focuses it on jumping back here, triggering the global
   :focus-visible ring from earlier. At 11px that box looks broken rather
   than helpful, so it's turned off just for citation numbers; real
   keyboard tabbing elsewhere on the site keeps its focus ring. */
sup a:focus-visible {
  outline: none;
}

hr {
  border: none;
  border-top: 1px solid currentColor;
  opacity: 0.16;
  margin: 2.4rem 0;
}

/* ---------------- Back-to-top per section ---------------- */

.section-top-link {
  position: absolute;
  right: var(--gutter);
  bottom: 1.5rem;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1.5px solid currentColor;
  display: flex;
  align-items: center;
  justify-content: center;
  color: inherit;
  text-decoration: none;
  opacity: 0.62;
  transition: opacity 0.2s ease;
}

.section-top-link:hover {
  opacity: 1;
}

.section-top-link svg {
  width: 20px;
  height: 20px;
  stroke: currentColor;
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
}

/* Return link for pages reachable from more than one article (the
   serial-number reference page). The matching data-back-link handler in
   nav.js sends visitors back to wherever they actually came from; the
   href in the markup is only the fallback. Kept low-contrast so it reads
   as navigation, not as a call to action. */
.page-back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.85rem;
  text-decoration: none;
  color: inherit;
  opacity: 0.65;
}

.page-back-link:hover {
  opacity: 1;
}

.page-back-link--top {
  margin-bottom: 2rem;
}

.page-back-link--bottom {
  display: block;
  margin-top: 3rem;
}

@media (max-width: 640px) {
  .section-top-link { right: 1rem; bottom: 1rem; }
}

/* ---------------- Footer ---------------- */

.site-footer {
  background: var(--ink);
  color: #EDEDEB;
  padding: 3rem var(--gutter) 2.4rem;
  text-align: center;
}

.site-footer__links {
  display: flex;
  gap: 1.6rem;
  justify-content: center;
  list-style: none;
  padding: 0;
  margin: 0 0 1.2rem;
  font-size: 0.85rem;
}

.site-footer__links a {
  text-decoration: none;
  color: #EDEDEB;
  opacity: 0.75;
}

.site-footer__links a:hover {
  opacity: 1;
}

.site-footer__meta {
  font-size: 0.78rem;
  color: #A8A7A4;
}

/* ---------------- Portal (root landing page) ---------------- */

.portal-hero {
  text-align: center;
  padding: 2.6rem var(--gutter) 1.6rem;
  background: var(--aluminium-hero);
  color: #F2F1EE;
}

.portal-hero__eyebrow {
  font-size: 0.78rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: #E4E2DE;
}

.portal-hero__title {
  font-size: clamp(1.9rem, 6vw, 3rem);
  letter-spacing: 0.04em;
  margin: 0.4em 0 0;
}

.portal-intro {
  margin-inline: auto;
  padding-top: clamp(1.6rem, 4vw, 2.4rem);
  text-align: center;
  line-height: 1.6;
  color: #4A4844;
}

.portal-lang {
  display: flex;
  justify-content: center;
  gap: 0.6rem;
  margin-top: 1.6rem;
  font-size: 0.82rem;
  letter-spacing: 0.04em;
}

.portal-lang a {
  text-decoration: none;
  color: inherit;
  opacity: 0.6;
}

.portal-lang a.is-active {
  opacity: 1;
  font-weight: 600;
}

.portal-tiles {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(1.2rem, 3vw, 1.8rem);
  padding-block: clamp(2.5rem, 6vw, 4.5rem);
  /* Tiles top out at 15rem each, so wide windows never change their size. */
  max-width: calc(45rem + 3.6rem + 2 * var(--gutter));
}

@media (max-width: 640px) {
  .portal-tiles { grid-template-columns: 1fr; }
}

.portal-tile {
  position: relative;
  display: block;
  aspect-ratio: 1 / 1;
  border-radius: 12px;
  overflow: hidden;
  text-decoration: none;
  color: #F5F4F2;
  background: var(--ink);
  container-type: inline-size;
}

.portal-tile img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.portal-tile:hover img {
  transform: scale(1.04);
}

/* For a project not live yet: markup uses a <div> here instead of an <a>,
   so there is no href to visit in the first place; this only strips the
   hover cue that would otherwise still suggest it's clickable. */
.portal-tile--disabled:hover img {
  transform: none;
}

.portal-tile::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 40%, rgba(0,0,0,0.72) 100%);
}

.portal-tile__label {
  position: absolute;
  left: 1.4rem;
  right: 1.4rem;
  bottom: 1.4rem;
  z-index: 1;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.2rem, 2.4vw, 1.6rem);
  letter-spacing: 0.02em;
}

/* Same size at every width, always one line. The padding follows the tile
   so the longest title still fits in the narrowest three-column layout. */
@supports (width: 1cqw) {
  .portal-tile__label {
    left: 6cqw;
    right: 6cqw;
    bottom: 6cqw;
    font-size: 16px;
    white-space: nowrap;
  }
}

.portal-tile__badge {
  position: absolute;
  top: 1rem;
  right: 1rem;
  z-index: 1;
  background: rgba(245, 244, 242, 0.92);
  color: var(--ink);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.35em 0.7em;
  border-radius: 999px;
}

.portal-credit {
  text-align: center;
  font-size: 0.8rem;
  color: #57544E;
  padding-bottom: 3rem;
}

/* ---------------- Legal pages ---------------- */

.legal {
  min-height: 100vh;
  /* Shares the chapter system's flat --surface token (was previously its
     own gradient, --aluminium-light) so Impressum/Datenschutz stay
     visually consistent now that gradients are gone everywhere except
     the hero bands. */
  background: var(--surface);
  padding: 9rem var(--gutter) 5rem;
}

.legal__inner {
  max-width: 72ch;
  margin: 0 auto;
}

/* Wider column for legal-page-style pages that hold a wide table (e.g.
   the serial-number reference), matching the article's chapter width
   instead of the narrower prose measure used by Impressum/Datenschutz. */
.legal__inner--wide {
  max-width: var(--max-width);
}

.legal h1 {
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  margin-bottom: 2rem;
}

.legal p, .legal li {
  color: #3A3833;
}

/* ---------------- Appendix (Quellen, unnumbered) ---------------- */

.appendix {
  position: relative;
  background: var(--paper);
  padding: clamp(2.5rem, 5vw, 4rem) var(--gutter);
  font-size: 0.86rem;
}

.appendix__inner {
  max-width: var(--max-width);
  margin: 0 auto;
  color: #57544E;
}

.appendix h2 {
  font-size: 1rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #6B6862;
  margin-bottom: 1.4rem;
}

.appendix h3 {
  font-size: 0.86rem;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: #6B6862;
  margin: 2.2rem 0 1rem;
}

.appendix a {
  color: #57544E;
  /* Long, unwrapped footnote-source URLs used to run past this
     container's edge on narrow screens. Worse, that overflow inflated the
     page's overall layout viewport width beyond the visual viewport,
     which then stretched every position: fixed; left: 0; right: 0
     element (including the sticky nav) wider than the visible screen, a
     mobile-wide layout bug, not just an appendix one. */
  overflow-wrap: anywhere;
}

.appendix li {
  margin-bottom: 0.4rem;
}

/* ---------------- Horizontal timeline ---------------- */

.hz-timeline {
  position: relative;
  margin: 3rem 0 2rem;
}

.hz-timeline__scroll {
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
  padding-bottom: 0.5rem;
}

.hz-timeline__scroll::-webkit-scrollbar {
  display: none;
}

.hz-timeline__track {
  position: relative;
  display: flex;
  gap: 0.3rem;
  min-width: max-content;
  padding: 0 0.5rem;
}

.hz-timeline__line {
  position: absolute;
  left: 0;
  right: 0;
  top: 155px;
  height: 1px;
  background: currentColor;
  opacity: 0.3;
}

.hz-timeline__item {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 260px;
  flex-shrink: 0;
}

.hz-timeline__slot {
  height: 150px;
  display: flex;
  flex-direction: column;
  text-align: center;
  font-size: 0.85rem;
  line-height: 1.45;
  overflow: visible;
}

.hz-timeline__slot--top { justify-content: flex-end; align-items: center; }
.hz-timeline__slot--bottom { justify-content: flex-start; align-items: center; }

.hz-timeline__arrow {
  position: absolute;
  top: 155px;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1.5px solid currentColor;
  background: currentColor;
  color: inherit;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0.85;
  z-index: 2;
  transition: opacity 0.2s ease;
}

.hz-timeline__arrow:hover { opacity: 1; }
.hz-timeline__arrow[hidden] { display: none; }
.hz-timeline__arrow--prev { left: -10px; }
.hz-timeline__arrow--next { right: -10px; }

.hz-timeline__arrow svg {
  width: 17px;
  height: 17px;
  stroke: var(--paper);
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
}

.hz-timeline__dot-row {
  height: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hz-timeline__dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: currentColor;
}

.hz-timeline__year {
  display: block;
  font-family: var(--font-display);
  font-weight: 700;
  margin-bottom: 0.3rem;
}

/* ---------------- Bauzeiten-Chart (Gantt) ---------------- */

.bz-chart {
  position: relative;
  margin: 2rem 0 1rem;
  overflow-x: auto;
}

.bz-chart__inner {
  position: relative;
  min-width: 696px;
  /* Leaves room for the first/last year label, which sits centred on its
     tick (translateX(-50%)) and would otherwise overhang the edge and get
     clipped by .bz-chart's overflow-x. Also gives a clipped bar's fade a
     few pixels to resolve into before the box edge, instead of ending
     exactly on it. */
  padding: 0 28px;
}

.bz-chart__years {
  position: relative;
  height: 1.2rem;
  margin-bottom: 0.6rem;
  font-size: 0.7rem;
  opacity: 0.6;
  font-variant-numeric: tabular-nums;
}

.bz-chart__years span {
  position: absolute;
  top: 0;
  transform: translateX(-50%);
  white-space: nowrap;
  padding: 0 0.2rem;
}

.bz-chart__grid {
  position: absolute;
  top: 0.15rem;
  bottom: -0.9rem;
  /* Matches .bz-chart__inner's own padding: absolute offsets resolve
     against the padding box, so this has to restate it explicitly to
     land on the same inset content area as the percentage-based years,
     labels and bars. */
  left: 28px;
  right: 28px;
  pointer-events: none;
}

.bz-chart__grid span {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 1px;
  background: currentColor;
  opacity: 0.14;
}

.bz-row {
  position: relative;
  margin-bottom: 1.5rem;
  display: flow-root;
}

.bz-row__label {
  position: absolute;
  top: 0;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.9rem;
  white-space: nowrap;
}

.bz-row__track {
  position: relative;
  height: 30px;
  margin-top: 1.35rem;
}

.bz-row__bar {
  position: absolute;
  top: 0;
  height: 100%;
  /* Gold, chosen over the chapter's own magenta accent after comparing both.
     Magenta values, for reference: #9C3E6B (this was var(--chapter-eyebrow)). */
  background: #C79A3E;
  border-radius: 3px;
}

.bz-row__bar--accessory {
  /* Magenta value, for reference: #C99BB2. */
  background: #DBBD82;
}

/* For a bar whose real start or end lies outside the chart's date range:
   fades the cut edge to transparent so it reads as "continues beyond
   this view" instead of a hard, misleading edge. */
.bz-row__bar--fade-start {
  -webkit-mask-image: linear-gradient(to right, transparent, black 40px);
  mask-image: linear-gradient(to right, transparent, black 40px);
}

.bz-row__bar--fade-end {
  -webkit-mask-image: linear-gradient(to left, transparent, black 40px);
  mask-image: linear-gradient(to left, transparent, black 40px);
}

