/* =============================================================
   iconiclab – Startseite
   Vanilla CSS, kein Build. Farben/Theme via CSS-Custom-Properties.
   px-Vorgaben als clamp()-Korridore (gleiche Proportionen, kleinere
   Untergrenze auf schmalen Screens).
   ============================================================= */

/* ---------- Theme-Variablen ---------- */
:root {
  --bg: #cef6ff;          /* Light-Hintergrund */
  --fg: #142024;          /* Text/Icons dunkel */
  --fg-dim: #3a4a4f;      /* zurückhaltender Text (Footer etc.) */
  --rule: rgba(20, 32, 36, 0.25);
  --overlay-bg: #ffffff;
  --overlay-fg: #142024;
  --overlay-rule: rgba(20, 32, 36, 0.18);
  --scrim: transparent;   /* Hintergrund wird bei aktivem Overlay nicht abgedunkelt */
  --accent: #ffffff;      /* aktiver Menüpunkt = heller/weiß */

  --space: clamp(16px, 3vw, 40px);
  --maxw-intro: 36ch;
}

[data-theme="dark"] {
  --bg: #0f1719;          /* dunkler, zurückhaltender BG */
  --fg: #e8f4f7;          /* helle Schrift/Icons */
  --fg-dim: #9bb0b6;
  --rule: rgba(232, 244, 247, 0.22);
  --overlay-bg: #15201f;  /* Overlay bleibt eigenständig, aber dunkel */
  --overlay-fg: #e8f4f7;
  --overlay-rule: rgba(232, 244, 247, 0.18);
  --scrim: transparent;
  --accent: #ffffff;
}

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

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
}

body {
  background: var(--bg);
  color: var(--fg);
  font-family: "IBM Plex Sans", system-ui, sans-serif;
  font-weight: 300;
  -webkit-font-smoothing: antialiased;
  /* Auf großen Screens passt alles in den Viewport (nicht scrollbar);
     reicht die Höhe nicht, darf die Seite scrollen, damit Logo/Footer
     niemals abgeschnitten werden. */
  min-height: 100%;
  transition: background-color 0.3s ease, color 0.3s ease;
}

a { color: inherit; text-decoration: none; }

button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  cursor: pointer;
  padding: 0;
}

.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  margin: -1px; padding: 0; border: 0;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  overflow: hidden; white-space: nowrap;
}

/* Sichtbare Fokus-States (Barrierearmut) */
:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 3px;
  border-radius: 2px;
}

/* ---------- Vier-Ecken-Raster ----------
   Menü links (über zwei Reihen), Controls + Intro rechts, Logo & Footer unten.
   min-height statt fester Höhe: passt alles, bleibt es bei vier Ecken im
   Viewport; sonst wächst die Seite und scrollt (nichts wird abgeschnitten). */
.screen {
  position: relative;
  width: 100%;
  min-height: 100vh;
  min-height: 100dvh;
  padding: var(--space);
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-rows: auto 1fr auto;
  grid-template-areas:
    "menu      controls"
    "menu      intro"
    "logo      footer";
  gap: clamp(12px, 2vh, 28px) var(--space);
}

.menu     { grid-area: menu;     align-self: start; }
.controls { grid-area: controls; justify-self: end; align-self: start; }
.intro    { grid-area: intro;    justify-self: end; align-self: start; text-align: right; }
.logo     { grid-area: logo;     align-self: end;   justify-self: start; }
.footer   { grid-area: footer;   align-self: end;   justify-self: end; }

/* =============================================================
   Menü (oben links)
   ============================================================= */
.menu {
  grid-area: menu;
  display: flex;
  flex-direction: column;
  gap: clamp(4px, 1vh, 12px);
  align-self: start;
}

.menu__row {
  display: flex;
  align-items: center;
  gap: clamp(12px, 2vw, 28px);
  background: none;
  text-align: left;
  width: max-content;
  max-width: 100%;
}

.menu__word {
  font-family: "IBM Plex Sans", sans-serif;
  font-weight: 700;
  /* zusätzlich höhenabhängig (min(... ,13vh)), damit das 5-zeilige Menü auf
     niedrigen Fenstern nicht zu hoch wird und die Ecken sichtbar bleiben */
  font-size: clamp(36px, min(9vw, 13vh), 100px);
  line-height: 1;
  letter-spacing: -0.01em;
  flex: none;
  transition: opacity 0.2s ease;
}

/* Icon-Reihe einer Menüzeile */
.menu__icons {
  display: flex;
  gap: clamp(4px, 0.6vw, 10px);
  flex: none;
}

/* Ein Icon-„Slot" = Fenster, in dem die Walze läuft.
   Desktop bleibt bei 70px (5.5vw erreicht 70px ab ~1273px Breite),
   darunter skalieren die Icons mit – wichtig fürs Mobile-Layout. */
.icon-slot {
  --slot: clamp(28px, 5.5vw, 70px);
  width: var(--slot);
  height: var(--slot);
  overflow: hidden;
  position: relative;
  flex: none;
}

/* Die Walze: vertikaler Stapel identischer/variierender Icons */
.icon-reel {
  display: flex;
  flex-direction: column;
  will-change: transform;
  transform: translateY(0);
}

.icon-reel svg {
  width: var(--slot);
  height: var(--slot);
  display: block;
  fill: currentColor;
  flex: none;
}

/* Hover/Focus: Walze läuft einmal durch und hält wieder beim eigenen Icon.
   Geschwindigkeit/Endzeitpunkt variieren je Slot über CSS-Variablen,
   die JS pro Slot setzt (--dur, --reel-shift, --ease). */
.menu__row:hover .icon-reel,
.menu__row:focus-visible .icon-reel {
  transform: translateY(var(--reel-shift, 0));
  transition: transform var(--dur, 700ms) var(--ease, cubic-bezier(0.2, 0.7, 0.2, 1));
}

/* Hover hebt das Wort leicht hervor */
.menu__row:hover .menu__word,
.menu__row:focus-visible .menu__word { opacity: 0.7; }

/* Aktiver Menüpunkt (Overlay offen): die übrigen Zeilen treten zurück,
   der aktive Punkt bleibt voll sichtbar. Funktioniert auf hellem wie dunklem
   Hintergrund (kein Abdunkeln des Hintergrunds). */
.menu:has(.is-active) .menu__row:not(.is-active) { opacity: 0.35; }
.menu__row.is-active .menu__word { opacity: 1; }

/* =============================================================
   Controls (oben rechts)
   ============================================================= */
.controls {
  display: flex;
  align-items: center;
  gap: clamp(12px, 1.5vw, 20px);
}

.lang {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: "IBM Plex Mono", monospace;
  font-weight: 700;
  font-size: 14px;
}
.lang__btn { opacity: 0.45; transition: opacity 0.2s ease; }
.lang__btn[aria-pressed="true"] { opacity: 1; }
.lang__btn:hover { opacity: 0.8; }
.lang__sep { opacity: 0.4; }

.theme-toggle {
  width: 28px; height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.theme-toggle__icon { display: inline-flex; }
.theme-toggle__icon svg { width: 24px; height: 24px; fill: currentColor; display: block; }
/* Nur das jeweils passende Icon zeigen */
[data-theme="light"] .theme-toggle [data-icon-light] { display: none; }
[data-theme="dark"]  .theme-toggle [data-icon-dark]  { display: none; }

/* Startseiten-Copy */
.intro {
  font-family: "IBM Plex Sans", sans-serif;
  font-weight: 300;
  /* etwas kleinerer Korridor, damit die rechte Spalte das Vier-Ecken-Raster
     nicht über die Fensterhöhe wachsen lässt */
  font-size: clamp(18px, 2vw, 30px);
  line-height: 1.25;
  max-width: var(--maxw-intro);
}
.intro p { margin: 0 0 0.6em; }
.intro p:last-child { margin-bottom: 0; }

/* =============================================================
   Logo (unten links) + Footer (unten rechts)
   ============================================================= */
.logo { display: inline-flex; align-items: flex-end; max-width: 100%; }
.logo svg {
  height: clamp(34px, 6vw, 70px);   /* skaliert mit – v. a. auf Mobile */
  width: auto;
  max-width: 100%;
  fill: currentColor;
  display: block;
}

.footer {
  display: flex;
  gap: clamp(10px, 1.4vw, 20px);
  align-items: center;
  font-family: "IBM Plex Mono", monospace;
  font-weight: 700;
  font-size: 14px;
  color: var(--fg-dim);
  flex-wrap: wrap;
  justify-content: flex-end;
}
.footer a { transition: color 0.2s ease; }
.footer a:hover { color: var(--fg); }
.footer__sep { opacity: 0.5; }

/* =============================================================
   Overlay
   ============================================================= */
.overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  background: var(--scrim);
}
.overlay[hidden] { display: none; }

/* Linke Spalte spiegelt das Menü; das Panel ist rechts.
   Auf Desktop: Panel nimmt den rechten Teil ein, links bleibt der Screen
   durchscheinend sichtbar (das echte Menü bleibt im Hintergrund stehen). */
.overlay__panel {
  margin-left: auto;
  width: 50vw;            /* Overlay nimmt die rechte Hälfte des Fensters ein */
  height: 100%;
  background: var(--overlay-bg);
  color: var(--overlay-fg);
  --pad: clamp(20px, 4vw, 56px);
  padding: var(--pad);
  overflow-y: auto;             /* Overlay ist grundsätzlich scrollbar */
  display: flex;
  flex-direction: column;
  box-shadow: -8px 0 40px rgba(0, 0, 0, 0.15);
}

.overlay__bar {
  display: flex;
  align-items: center;
  gap: 16px;
}
.overlay__title {
  font-family: "IBM Plex Sans", sans-serif;
  font-weight: 700;                       /* Schriftschnitt bleibt Bold */
  font-size: clamp(20px, 2.4vw, 28px);    /* Größe wie Copy-Text */
  line-height: 1.25;
  margin: 0;
  flex: 1;
}
.overlay__back { margin-right: 4px; display: inline-flex; }
.overlay__back[hidden] { display: none; }
.overlay__close { margin-left: auto; display: inline-flex; }
.overlay__back:hover, .overlay__close:hover { opacity: 0.6; }

.overlay__rule {
  border: 0;
  border-top: 1px solid var(--overlay-rule);
  width: 100%;
  margin: clamp(16px, 2.5vw, 28px) 0;
}

.overlay__copy {
  font-family: "IBM Plex Sans", sans-serif;
  font-weight: 300;
  font-size: clamp(20px, 2.4vw, 28px);
  line-height: 1.357;           /* 38/28 */
}
.overlay__copy p { margin: 0 0 0.7em; }

/* Kompakt-Variante: Beschreibungstexte um 33% kleiner (z. B. Bereich Play).
   Überschriften und der erste (Intro-)Absatz bleiben in Normalgröße.
   Zeilenhöhen sind einheitenlos und skalieren automatisch mit. */
.overlay__copy.ov-compact { font-size: calc(clamp(20px, 2.4vw, 28px) * 0.67); }
.overlay__copy.ov-compact > p:first-of-type { font-size: clamp(20px, 2.4vw, 28px); }

/* Zwischenüberschrift im Overlay */
.ov-h {
  font-family: "IBM Plex Sans", sans-serif;
  font-weight: 700;
  font-size: clamp(22px, 2.6vw, 32px);
  line-height: 1.15;
  margin: 1.2em 0 0.4em;
}
.ov-h:first-child { margin-top: 0; }

/* Bilder & Video: volle Breite des Overlays (randlos bis an die Panel-Kanten) */
.ov-media {
  margin: clamp(16px, 2.5vw, 28px) calc(-1 * var(--pad, 0px));
  width: calc(100% + 2 * var(--pad, 0px));
}
.ov-media img,
.ov-media video {
  display: block;
  width: 100%;
  height: auto;
}
.ov-media figcaption {
  font-family: "IBM Plex Mono", monospace;
  font-size: 13px;
  opacity: 0.6;
  padding: 8px var(--pad, 0px) 0;
}
/* Inline-SVG-Grafik: im Textspalten-Maß (nicht randlos), folgt dem Theme */
.ov-media--svg {
  margin: clamp(16px, 2.5vw, 28px) 0;
  width: 100%;
}
.ov-media--svg svg {
  display: block;
  width: 100%;
  height: auto;
}
.ov-media--svg figcaption { padding: 8px 0 0; }

/* Call-to-Action-Link (z. B. „get the book“) */
.ov-cta {
  align-self: flex-start;
  display: inline-block;
  margin-top: clamp(12px, 2vw, 20px);
  padding: 12px 22px;
  border: 1px solid currentColor;
  border-radius: 999px;
  font-family: "IBM Plex Mono", monospace;
  font-size: clamp(15px, 1.5vw, 18px);
  transition: background-color 0.2s ease, color 0.2s ease;
}
.ov-cta:hover {
  background: var(--overlay-fg);
  color: var(--overlay-bg);
}

/* ---- Hero / Lead ---- */
.ov-lead { margin: 0 0 clamp(20px, 3vw, 36px); }
.ov-lead__q {
  font-family: "IBM Plex Sans", sans-serif;
  font-weight: 700;
  font-size: clamp(26px, 3.4vw, 44px);
  line-height: 1.1;
  letter-spacing: -0.01em;
  margin: 0 0 0.5em;
}
.ov-lead__sub {
  font-style: italic;
  opacity: 0.7;
  font-size: clamp(17px, 1.8vw, 22px);
  line-height: 1.5;
  margin: 0;
  max-width: 40ch;
}

/* ---- Kicker-Label über Überschriften ---- */
.ov-label {
  font-family: "IBM Plex Mono", monospace;
  font-size: 12px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  opacity: 0.55;
  margin: 1.6em 0 0.6em;
}
.ov-label:first-child { margin-top: 0; }

/* ---- Aufzählungspunkt (Dash + Titel + Text) ---- */
.ov-point {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0 16px;
  margin: 1em 0;
}
.ov-point__dash { opacity: 0.6; }
.ov-point__title {
  font-family: "IBM Plex Sans", sans-serif;
  font-weight: 700;
  font-size: clamp(17px, 1.8vw, 20px);
  margin: 0 0 0.25em;
  line-height: 1.3;
}
.ov-point p { margin: 0; }

/* ---- Pull-Quote ---- */
.ov-pull {
  margin: 1.6em 0;
  padding: 0.6em 0 0.6em 1.1em;
  border-left: 2px solid currentColor;
  font-family: "IBM Plex Sans", sans-serif;
  font-weight: 700;
  font-size: clamp(19px, 2vw, 26px);
  line-height: 1.3;
  letter-spacing: -0.01em;
}

/* ---- Callout (kursiv, gedämpft) ---- */
.ov-callout {
  margin: 1.4em 0;
  padding-top: 1em;
  border-top: 1px solid var(--overlay-rule);
  font-style: italic;
  opacity: 0.7;
  line-height: 1.5;
}

/* ---- Schluss-Statement ---- */
.ov-closing {
  margin: clamp(28px, 5vw, 56px) 0 0;
  padding: clamp(20px, 4vw, 36px) 0;
  border-top: 1px solid currentColor;
  border-bottom: 1px solid currentColor;
  font-family: "IBM Plex Sans", sans-serif;
  font-weight: 700;
  font-size: clamp(24px, 3vw, 40px);
  line-height: 1.18;
  letter-spacing: -0.015em;
}

/* ---- Fußnote ---- */
.ov-note {
  margin: clamp(20px, 3vw, 32px) 0 0;
  font-family: "IBM Plex Mono", monospace;
  font-size: 13px;
  line-height: 1.6;
  opacity: 0.55;
}

/* ---- Bild-Platzhalter (seitenbreit, grau) ---- */
.ov-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: clamp(160px, 28vw, 320px);
  background: repeating-linear-gradient(
    45deg, var(--overlay-rule) 0 2px, transparent 2px 14px
  ), rgba(127, 127, 127, 0.12);
  border: 1px dashed var(--overlay-rule);
}
.ov-placeholder span {
  font-family: "IBM Plex Mono", monospace;
  font-size: 13px;
  letter-spacing: 0.04em;
  opacity: 0.6;
  padding: 0 16px;
  text-align: center;
}

/* ---- Dimensions-Matrix (statische Regler, nicht interaktiv) ---- */
.ov-matrix { margin: 1.6em 0; }
.ov-dim {
  padding: 1.4em 0;
  border-top: 1px solid var(--overlay-rule);
}
.ov-dim:first-child { border-top: none; }
.ov-dim__top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 20px;
  margin-bottom: 1em;
}
.ov-dim__name {
  font-family: "IBM Plex Sans", sans-serif;
  font-weight: 700;
  font-size: clamp(16px, 1.7vw, 19px);
  white-space: nowrap;
}
.ov-dim__q {
  font-style: italic;
  opacity: 0.55;
  font-size: clamp(13px, 1.3vw, 15px);
  text-align: right;
  line-height: 1.4;
}
.ov-track {
  position: relative;
  height: 24px;
  margin: 0 7px 0.7em;
}
.ov-track__line {
  position: absolute;
  top: 50%; left: 0; right: 0;
  height: 1px;
  background: var(--overlay-rule);
  transform: translateY(-50%);
}
.ov-track__tick {
  position: absolute;
  top: 50%;
  width: 1px; height: 9px;
  background: var(--overlay-rule);
  transform: translate(-50%, -50%);
}
.ov-track__tick.t0 { left: 0; }
.ov-track__tick.t1 { left: 50%; }
.ov-track__tick.t2 { left: 100%; }
.ov-track__knob {
  position: absolute;
  top: 50%;
  left: calc(var(--pos, 1) * 50%);
  width: 15px; height: 15px;
  background: currentColor;   /* quadratisch wie im Original */
  transform: translate(-50%, -50%);
}
.ov-steps {
  display: flex;
  justify-content: space-between;
  font-family: "IBM Plex Mono", monospace;
  font-size: clamp(12px, 1.2vw, 14px);
  opacity: 0.9;
}
.ov-steps span { flex: 1; opacity: 0.5; }
.ov-steps span:nth-child(1) { text-align: left; }
.ov-steps span:nth-child(2) { text-align: center; }
.ov-steps span:nth-child(3) { text-align: right; }
.ov-steps span.on { opacity: 1; font-weight: 700; }

.overlay__submenu {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-family: "IBM Plex Mono", monospace;
  font-size: clamp(16px, 1.6vw, 20px);
  line-height: 1.6;             /* 32/20 */
}
.overlay__submenu:empty { display: none; }

/* Klickbare Untermenü-Einträge (eine Ebene tiefer) */
.overlay__sublink {
  font: inherit;
  color: inherit;
  text-align: left;
  cursor: pointer;
  display: inline-flex;
  align-items: baseline;
  gap: 0;
  transition: opacity 0.2s ease;
}
.overlay__sublink::before { content: "\2013\00a0"; opacity: 0.5; }
.overlay__sublink:hover { opacity: 0.6; }
.overlay__sublink:hover::before { opacity: 1; }

/* =============================================================
   Responsive: gestapeltes Layout
   Greift, wenn das Vier-Ecken-Raster nicht komfortabel passt – also auf
   schmalen ODER niedrigen Fenstern. Dann rutscht die Copy unter das Menü.
   ============================================================= */
@media (max-width: 1024px), (max-height: 800px) {
  .screen {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto auto auto auto;
    grid-template-areas:
      "controls"
      "menu"
      "intro"
      "logo"
      "footer";
  }
  .controls { justify-self: end; }
  .intro {
    justify-self: start;
    text-align: left;
    max-width: 60ch;
  }
  .logo   { justify-self: start; align-self: start; }
  .footer { justify-self: start; align-self: start; justify-content: flex-start; }
}

/* Overlay auf schmalen Screens vollflächig */
@media (max-width: 760px) {
  .overlay__panel { width: 100%; }
}

/* =============================================================
   Reduced Motion: Slot-Animation deaktivieren
   ============================================================= */
@media (prefers-reduced-motion: reduce) {
  .menu__row:hover .icon-reel,
  .menu__row:focus-visible .icon-reel {
    transform: translateY(0);
    transition: none;
  }
  body { transition: none; }
}
