/* Reset, the magenta frame with its tiles, typography and small helpers. */

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-padding-top: calc(var(--header-h) + 24px);
}

body {
  margin: 0;
  background: var(--sand);
  color: var(--schrift);
  font-family: var(--font-body);
  font-size: 18px;
  line-height: 1.5;
}

h1, h2, h3, p, ul, ol, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }
p { text-wrap: pretty; }

a {
  color: inherit;
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}
/* Areas that are links (start page cards, closing band) keep their own text colour. */
a:where(:not(.tile)):hover { color: var(--accent); }

img { display: block; max-width: 100%; height: auto; }

input, textarea, select, button { font: inherit; }

[hidden] { display: none !important; }

:focus-visible {
  outline: 3px solid var(--accent, var(--magenta));
  outline-offset: 3px;
}
/* Around an area the ring would sit in the magenta joint and vanish: it goes inside. */
a.tile:focus-visible { outline-offset: -9px; }

.skip-link {
  position: absolute;
  left: 16px;
  top: -100px;
  z-index: 100;
  padding: 10px 20px;
  border-radius: var(--radius-button);
  background: var(--magenta);
  color: var(--weiss);
  font-family: var(--font-display);
  font-weight: 800;
}
.skip-link:focus { top: 12px; color: var(--weiss); }

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

/* --- Frame: the whole page sits in a magenta frame; the joints (Fugen) between its
   areas are the magenta background showing through a 6 px gap.
   The frame is the query container for every breakpoint ("@container frame"), so the
   layout also reflows when the reading aid enlarges the text (zoom on .frame, see
   a11y.css). The breakpoints are the former viewport widths minus the frame border
   (12 px) and, from 1100 px, the body padding (48 px). --- */

.frame {
  container: frame / inline-size;
  --accent: var(--magenta);
  display: flex;
  flex-direction: column;
  gap: var(--fuge);
  max-width: var(--frame-max);
  min-height: 100vh;
  margin-inline: auto;
  border: var(--fuge) solid var(--magenta);
  background: var(--magenta);
}

@media (min-width: 1100px) {
  body { padding: 24px; }
  .frame { min-height: calc(100vh - 48px); }
}

.frame__main {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: var(--fuge);
}
.frame__main:focus { outline: none; }

/* Areas side by side; they stack on narrow screens. */
.row {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--fuge);
}
@container frame (min-width: 888px) {
  .row--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .row--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .row--2-3 { grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); }
  .row--3-2 { grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); }
  .row--head { grid-template-columns: minmax(0, 7fr) minmax(0, 3fr); }
}
.row--4 { gap: var(--fuge); }
@container frame (min-width: 588px) {
  .row--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@container frame (min-width: 1040px) {
  .row--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

/* One area. Its colour also sets the accent for kickers, links, icons and lines. */
.tile {
  --accent: var(--magenta);
  --icon-bg: var(--magenta);
  --icon-fg: var(--weiss);
  --dots: var(--schrift);
  position: relative;
  isolation: isolate;
  display: flex;
  flex-direction: column;
  gap: 32px;
  min-width: 0;
  padding: var(--tile-pad-y) var(--tile-pad-x);
  background: var(--hellsand);
  color: var(--schrift);
}
.tile--hellsand { background: var(--hellsand); }
.tile--sand { background: var(--sand); }
.tile--weiss { background: var(--weiss); }
.tile--anthrazit,
.tile--pflaume {
  --accent: var(--magenta-hell);
  --icon-bg: var(--pflaume);
  --icon-fg: var(--magenta-hell);
  --dots: var(--magenta-hell);
  color: var(--weiss);
}
.tile--anthrazit { background: var(--anthrazit); }
.tile--pflaume { background: var(--pflaume); }
/* Around magenta boxes the joint is pflaume (CI p. 13). */
.tile--magenta {
  --accent: var(--weiss);
  --icon-bg: var(--pflaume);
  --icon-fg: var(--magenta-hell);
  --dots: var(--weiss);
  z-index: 1;
  background: var(--magenta);
  color: var(--weiss);
  box-shadow: 0 0 0 var(--fuge) var(--pflaume);
}
.tile--compact { padding-block: clamp(28px, calc(4 * var(--vw)), 56px); }
.tile--flush { padding: 0; overflow: hidden; }
.tile--center { align-items: center; text-align: center; }

/* --- Typography --- */

/* Kicker: IBM Plex Mono, versal, tracking 0.08 em (CI p. 16) */
.kicker {
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: clamp(14px, calc(1.2 * var(--vw)), 16px);
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--accent);
}
.kicker--ink { color: inherit; }

/* Kicker between two lines, centred over the poster headline */
.kicker-lines {
  display: flex;
  gap: 20px;
  align-items: center;
  text-align: center;
}
.kicker-lines::before,
.kicker-lines::after {
  content: "";
  flex: 1;
  height: 3px;
  background: var(--accent);
  transform-origin: center;
}

/* Headlines: Exo 2 Black, versal, tracking -0.03 em. H2 48–72 px per the CI; below
   48 px on phones, where long German words would not fit otherwise. Line height .96
   instead of the CI's .9: at .9 the dots of Ä/Ö/Ü touch the line above. */
.h-section,
.h-sub,
.h-card {
  font-family: var(--font-display);
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: -.03em;
  line-height: .96;
  overflow-wrap: break-word;
  hyphens: auto;
  text-wrap: balance;
}
.h-section { font-size: clamp(34px, calc(5 * var(--vw)), 72px); }
.h-sub { font-size: clamp(30px, calc(4 * var(--vw)), 56px); }
.h-card { font-size: clamp(24px, calc(2.2 * var(--vw)), 30px); line-height: .95; }
.accent { display: block; color: var(--accent); }

.lead {
  max-width: 70ch;
  font-size: clamp(18px, calc(1.5 * var(--vw)), 20px);
  line-height: 1.5;
}

/* Large paragraph in Exo 2 (Warum, Erfolgsgeschichten) */
.statement {
  max-width: 34ch;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(24px, calc(2.6 * var(--vw)), 36px);
  line-height: 1.2;
  text-wrap: pretty;
}

.measure { max-width: 70ch; }

.footnote { font-size: 15px; }

/* Gepunktete Linie: separates rows and frames numbers (CI p. 19) */
.dotted { border-top: 2px dotted var(--dots); }

/* --- Layout helpers --- */

.stack { display: flex; flex-direction: column; }
.stack--8 { gap: 8px; }
.stack--16 { gap: 16px; }
.stack--24 { gap: 24px; }
.stack--32 { gap: 32px; }
.stack--fuge { gap: var(--fuge); }

/* Two columns that wrap to one when there is no room for both. */
.split {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, var(--split-min, 360px)), 1fr));
  gap: var(--split-gap, 24px 72px);
}
.split--top { align-items: start; }
.split--bottom { align-items: end; }

.cover {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
