/*
  SCHWARZWERK — Presswerk für Schallplatten
  Mika UX Library: MXL-147 „The Monolith Project“ (CSS-/DOM-Forensik)
  — Choreographed interactive experience, dark (rein, keine Mischung)

  Die Vorlage gibt ungewöhnlich konkrete Werte vor, und genau die tragen
  diese Seite: reines Schwarz als Fläche, ein einziges Rot als Signal, zwei
  Cremetöne als Stützfarben, Baloo 2 als Display-Stimme, eine schmale Spalte
  von 975px, Radien von 0 bis 4px und ein rot getönter Schein
  (0 4px 74px #7e2d2d87) als einzige Tiefe.

  Übersetzt in ein Presswerk: Schwarz ist die Platte, Creme das Label, Rot
  der Aufdruck. Bewegung ist hier Navigation — der Stationswechsel ist der
  Weg durch die Fertigung, nicht seine Dekoration.
*/

@import url("fonts/fonts.css");

*, *::before, *::after { box-sizing: border-box; }

:root {
  /* MXL-147 Farbrollen, unverändert übernommen */
  --canvas: #000000;
  --surface: #383a3e;
  --ink: #ffffff;
  --signal: #ff002f;
  --creme: #fff6df;
  --amber: #ffebbc;
  --grau: #797b7b;

  --hair: #2a2c2f;
  --hair-hell: #45484c;

  /* MXL-147 Spacing: 4 · 8 · 16 · 24 · 32 · 48 · 72 · 96 */
  --sp-1: 4px;  --sp-2: 8px;  --sp-3: 16px; --sp-4: 24px;
  --sp-5: 32px; --sp-6: 48px; --sp-7: 72px; --sp-8: 96px;

  /* MXL-147 Radien: 0 · .25rem · 4px — sonst nichts */
  --r-0: 0;
  --r-1: .25rem;

  /* Der eine Schatten der Vorlage */
  --schein: 0 4px 74px #7e2d2d87;

  --font-display: 'Baloo 2', system-ui, sans-serif;
  --font-ui: 'Inter Tight', ui-sans-serif, system-ui, -apple-system, sans-serif;

  --ease: cubic-bezier(.2, .8, .2, 1);
  color-scheme: dark;
}

html { background: var(--canvas); }

body {
  margin: 0;
  background: var(--canvas);
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: 17px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

img, svg { max-width: 100%; }

/* ── Typografie ───────────────────────────────────────────────────────── */

/* Baloo 2 ist rund und laut — sie trägt jede Überschrift, nie den Fließtext. */
.h1 { margin: 0; font-family: var(--font-display); font-size: clamp(40px, 8vw, 64px); font-weight: 800; letter-spacing: -.02em; line-height: 1.02; text-wrap: balance; hyphens: auto; overflow-wrap: break-word; }
.h2 { margin: 0; font-family: var(--font-display); font-size: clamp(28px, 4.6vw, 40px); font-weight: 700; letter-spacing: -.015em; line-height: 1.1; hyphens: auto; overflow-wrap: break-word; }
.h3 { margin: 0; font-family: var(--font-display); font-size: clamp(20px, 2.4vw, 24px); font-weight: 600; line-height: 1.2; }

.lead { max-width: 46ch; margin: 0; font-size: clamp(18px, 2vw, 21px); line-height: 1.5; }
.prose { max-width: 62ch; }
.prose p { margin: 0 0 var(--sp-3); color: #d6d6d4; }
.muted { color: var(--grau); }
.creme { color: var(--creme); }

.label {
  display: inline-block;
  margin: 0;
  color: var(--grau);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .14em;
  line-height: 1.2;
  text-transform: uppercase;
}

.zahl { font-variant-numeric: tabular-nums; }

a { color: var(--creme); text-underline-offset: 3px; }
a:hover { color: var(--ink); }

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

.skip {
  position: fixed;
  z-index: 90;
  top: var(--sp-2);
  left: var(--sp-2);
  padding: var(--sp-3) var(--sp-4);
  transform: translateY(-160%);
  background: var(--signal);
  color: var(--ink);
  font-weight: 700;
  text-decoration: none;
}

.skip:focus { transform: translateY(0); }

/* ── Spalte: 975px, wie erfasst ───────────────────────────────────────── */

.spalte { max-width: 975px; margin-inline: auto; padding-inline: var(--sp-3); }

.bahn { padding-block: var(--sp-7); }
.bahn--eng { padding-block: var(--sp-6); }
.bahn--linie { border-top: 1px solid var(--hair); }

/* ── Kopf ─────────────────────────────────────────────────────────────── */

.kopf { border-bottom: 1px solid var(--hair); }

.kopf__reihe {
  display: flex;
  gap: var(--sp-3);
  align-items: center;
  justify-content: space-between;
  max-width: 975px;
  margin-inline: auto;
  padding: var(--sp-2) var(--sp-3);
}

.marke {
  display: inline-flex;
  min-height: 44px;
  gap: var(--sp-2);
  align-items: center;
  font-family: var(--font-display);
  font-size: 21px;
  font-weight: 800;
  letter-spacing: -.01em;
  text-decoration: none;
  color: var(--ink);
}

.marke:hover { color: var(--ink); }
.marke svg { width: 26px; height: 26px; flex: none; }

.menue { display: flex; gap: var(--sp-1); align-items: center; }

.menue a {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  padding: 0 var(--sp-3);
  border-bottom: 3px solid transparent;
  color: var(--grau);
  font-size: 15px;
  font-weight: 500;
  text-decoration: none;
  transition: color 180ms var(--ease), border-color 180ms var(--ease);
}

.menue a:hover { color: var(--ink); }
.menue a[aria-current="page"] { border-bottom-color: var(--signal); color: var(--ink); }

.menuetaste {
  display: none;
  min-height: 44px;
  padding: 0 var(--sp-3);
  border: 1px solid var(--hair-hell);
  border-radius: var(--r-0);
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

/* ── Aktionen ─────────────────────────────────────────────────────────── */

.taste {
  display: inline-flex;
  min-height: 48px;
  gap: var(--sp-2);
  align-items: center;
  padding: 0 var(--sp-4);
  border: 1px solid var(--signal);
  border-radius: var(--r-1);
  background: var(--signal);
  color: var(--ink);
  font: inherit;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 180ms var(--ease), color 180ms var(--ease);
}

.taste:hover { background: transparent; color: var(--signal); }

.taste--still { border-color: var(--hair-hell); background: transparent; color: var(--ink); }
.taste--still:hover { border-color: var(--ink); background: transparent; color: var(--ink); }

/* ── Der Aufmacher: die Platte ────────────────────────────────────────── */

.auf { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 300px); gap: var(--sp-6); align-items: center; padding-block: var(--sp-7); }
.auf > * { min-width: 0; }
.auf__tat { display: flex; gap: var(--sp-2); margin-top: var(--sp-5); flex-wrap: wrap; }

/*
  Die Platte: schwarze Scheibe, Rillen aus repeating-conic wäre falsch —
  Rillen laufen konzentrisch, also repeating-radial-gradient. In der Mitte
  das Label in Creme mit rotem Aufdruck, darunter der rote Schein der Vorlage.
*/
.platte {
  position: relative;
  aspect-ratio: 1;
  width: 100%;
  border-radius: 50%;
  background:
    repeating-radial-gradient(circle at 50% 50%,
      #0b0b0b 0, #0b0b0b 2px, #141414 2px, #141414 4px),
    #0b0b0b;
  box-shadow: var(--schein);
}

/* Der Lichtreflex läuft schräg über die Rillen. */
.platte::before {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: linear-gradient(118deg, rgba(255, 255, 255, .16) 0%, rgba(255, 255, 255, 0) 28%, rgba(255, 255, 255, 0) 66%, rgba(255, 255, 255, .09) 88%, rgba(255, 255, 255, 0) 100%);
  content: "";
}

.platte__label {
  position: absolute;
  top: 50%;
  left: 50%;
  display: grid;
  width: 38%;
  aspect-ratio: 1;
  translate: -50% -50%;
  place-content: center;
  /* Das Mittelloch bleibt frei: Wortmarke oben, Drehzahl unten. */
  gap: 26%;
  border-radius: 50%;
  background: var(--creme);
  color: #16120c;
  text-align: center;
}

.platte__label b { font-family: var(--font-display); font-size: clamp(13px, 1.5vw, 18px); font-weight: 800; letter-spacing: -.01em; line-height: 1; }
.platte__label span { color: var(--signal); font-size: clamp(8px, .85vw, 10px); font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }

.platte__loch {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 4.4%;
  aspect-ratio: 1;
  translate: -50% -50%;
  border-radius: 50%;
  background: var(--canvas);
}

/*
  Bewegung ist hier Navigation, nicht Kulisse: Bei jedem Stationswechsel
  macht die Platte genau eine Umdrehung und steht danach wieder still —
  das Label bleibt also lesbar, und es gibt keine Dauerbewegung, die man
  anhalten müsste.
*/
.platte { rotate: var(--dreh, 0deg); transition: rotate 760ms cubic-bezier(.4, 0, .1, 1); }

/* ── Stationen: Bewegung als Navigation ───────────────────────────────── */

.stationen { display: grid; gap: var(--sp-4); }

.stationen__wahl { display: flex; gap: var(--sp-1); overflow-x: auto; border-bottom: 1px solid var(--hair); }

.stationen__wahl button {
  position: relative;
  min-height: 52px;
  padding: 0 var(--sp-3);
  border: 0;
  border-bottom: 3px solid transparent;
  background: transparent;
  color: var(--grau);
  font: inherit;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  transition: color 180ms var(--ease), border-color 180ms var(--ease);
}

.stationen__wahl button:hover { color: var(--ink); }
.stationen__wahl button[aria-selected="true"] { border-bottom-color: var(--signal); color: var(--ink); }

.stationen__wahl b { color: var(--signal); font-family: var(--font-display); font-size: 15px; margin-right: 6px; }

/* Der Wechsel selbst ist die Choreografie: die Tafel kommt von unten
   herein und die Werte zählen sichtbar mit. */
.station {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
  gap: var(--sp-5);
  padding: var(--sp-5) 0;
}

.station > * { min-width: 0; }
.station[hidden] { display: none; }

.station--laeuft { animation: einfahren 420ms var(--ease) both; }

@keyframes einfahren {
  from { transform: translateY(14px); opacity: 0; }
  to   { transform: none; opacity: 1; }
}

.station p { margin: var(--sp-3) 0 0; color: #d6d6d4; }

.station__daten { display: grid; gap: 1px; align-content: start; background: var(--hair); border: 1px solid var(--hair); }
.station__daten > div { display: flex; gap: var(--sp-3); justify-content: space-between; padding: var(--sp-3); background: var(--canvas); }
.station__daten dt, .station__daten span:first-child { color: var(--grau); font-size: 14px; }
.station__daten b { color: var(--amber); font-variant-numeric: tabular-nums; white-space: nowrap; }

/* ── Rechner ──────────────────────────────────────────────────────────── */

.rechner { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 340px); gap: var(--sp-6); align-items: start; }
.rechner > * { min-width: 0; }

.feld { display: grid; gap: var(--sp-2); margin-bottom: var(--sp-5); }
.feld > label, .feld > span { font-weight: 600; }

.feld select,
.feld input[type="number"] {
  width: 100%;
  min-height: 48px;
  padding: 0 var(--sp-3);
  border: 1px solid var(--hair-hell);
  border-radius: var(--r-1);
  background: var(--canvas);
  color: var(--ink);
  font: inherit;
}

.feld .hinweis { margin: 0; color: var(--grau); font-size: 14px; }

.knopfreihe { display: flex; gap: var(--sp-2); flex-wrap: wrap; }

.knopfreihe button {
  min-height: 48px;
  padding: 0 var(--sp-4);
  border: 1px solid var(--hair-hell);
  border-radius: var(--r-1);
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 180ms var(--ease), background-color 180ms var(--ease), color 180ms var(--ease);
}

.knopfreihe button[aria-pressed="true"] { border-color: var(--signal); background: var(--signal); color: var(--ink); }

/* Der Befund: die Cremefläche ist der Label-Aufkleber des Ergebnisses. */
.befund {
  display: grid;
  gap: var(--sp-3);
  padding: var(--sp-4);
  border-radius: var(--r-1);
  background: var(--creme);
  color: #16120c;
}

.befund__stand { font-family: var(--font-display); font-size: clamp(24px, 3.4vw, 32px); font-weight: 800; line-height: 1.05; }
.befund[data-lage="knapp"] .befund__stand { color: #8a4a00; }
.befund[data-lage="drueber"] .befund__stand { color: var(--signal); }

.befund dl { display: grid; grid-template-columns: auto 1fr; gap: var(--sp-2) var(--sp-3); margin: 0; }
.befund dt { color: #5c554a; font-size: 13px; }
.befund dd { margin: 0; font-weight: 700; text-align: right; font-variant-numeric: tabular-nums; }
.befund p { margin: 0; font-size: 15px; }

/* Der Rillenbalken zeigt die Auslastung der Seite. */
.rille { height: 10px; overflow: hidden; background: #e2d9c2; }
.rille span { display: block; height: 100%; background: #16120c; transition: width 320ms var(--ease); }
.befund[data-lage="knapp"] .rille span { background: #8a4a00; }
.befund[data-lage="drueber"] .rille span { background: var(--signal); }

/* ── Tafeln, Karten ───────────────────────────────────────────────────── */

.rolle { overflow-x: auto; }
.rolle .tafel { min-width: 30rem; }

.tafel { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.tafel caption { margin-bottom: var(--sp-3); color: var(--grau); font-size: 14px; text-align: left; }
.tafel th, .tafel td { padding: var(--sp-3); border-bottom: 1px solid var(--hair); text-align: left; vertical-align: top; }
.tafel thead th { border-bottom: 1px solid var(--hair-hell); color: var(--grau); font-size: 13px; font-weight: 600; }
.tafel td:last-child, .tafel th:last-child { text-align: right; }
.tafel .hell { color: var(--amber); }

.karten { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: var(--sp-3); }
.karten > * { min-width: 0; }
.karte { display: grid; gap: var(--sp-2); align-content: start; padding: var(--sp-4); border: 1px solid var(--hair); }
.karte p { margin: 0; color: var(--grau); font-size: 15px; }

.merk { padding: var(--sp-4); border-left: 4px solid var(--signal); background: #121213; }
.merk p { margin: 0 0 var(--sp-2); }
.merk p:last-child { margin-bottom: 0; }

/* ── Fuß ──────────────────────────────────────────────────────────────── */

.fuss { padding-block: var(--sp-7) var(--sp-5); border-top: 1px solid var(--hair); }
.fuss__mitte { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: var(--sp-5); }
.fuss h2 { margin: 0 0 var(--sp-3); color: var(--grau); font-family: var(--font-ui); font-size: 12px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; }
.fuss ul { margin: 0; padding: 0; list-style: none; }
.fuss li { margin-bottom: var(--sp-2); }
.fuss address { font-style: normal; }
.fuss__demo { margin-top: var(--sp-6); padding-top: var(--sp-4); border-top: 1px solid var(--hair); color: var(--grau); font-size: 14px; }

/* ── Rechtsseiten ─────────────────────────────────────────────────────── */

.recht h2 { margin: var(--sp-6) 0 var(--sp-2); font-family: var(--font-display); font-size: clamp(21px, 2.4vw, 26px); font-weight: 700; }
.recht h3 { margin: var(--sp-4) 0 var(--sp-2); font-size: 17px; }
.recht p, .recht li { color: #d6d6d4; }
.recht ul { padding-left: var(--sp-4); }

/* ── Responsive: 975/976 ist der Umbruch der Vorlage ──────────────────── */

@media (max-width: 975px) {
  .auf, .rechner, .station { grid-template-columns: 1fr; }

  /* Auf schmalen Viewports steht die Platte über dem Text und wird kleiner —
     sie bleibt die Aussage, nimmt aber nicht mehr die halbe Seite ein. */
  .auf { gap: var(--sp-5); }
  .auf > div:last-child { order: -1; max-width: 220px; }

  .menuetaste { display: inline-flex; align-items: center; }

  .menue {
    display: none;
    width: 100%;
    flex-direction: column;
    align-items: stretch;
    padding-bottom: var(--sp-2);
  }

  .kopf__reihe { flex-wrap: wrap; }
  .menue[data-offen] { display: flex; }
  .menue a { border-bottom: 1px solid var(--hair); border-left: 3px solid transparent; }
  .menue a[aria-current="page"] { border-bottom-color: var(--hair); border-left-color: var(--signal); }
}

@media (max-width: 40rem) {
  body { font-size: 16px; }
  .bahn { padding-block: var(--sp-6); }
  .karte, .befund { padding: var(--sp-3); }
}

/*
  Reduced Motion: die Platte steht still, der Stationswechsel geschieht ohne
  Einfahren. Die Navigation bleibt vollständig erhalten — sie war nie an die
  Bewegung gebunden.
*/
@media (prefers-reduced-motion: reduce) {
  .platte { rotate: 0deg; }
  *, *::before, *::after {
    transition-duration: .01ms !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
  }
}
