/* ==========================================================================
   base.css — reset, typography and layout primitives
   Uses only variables from tokens.css.
   ========================================================================== */

/* ---- Reset -------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + var(--space-6)); }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
img, svg, canvas, video { display: block; max-width: 100%; }
img { height: auto; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; }
ul, ol { list-style: none; }
table { border-collapse: collapse; border-spacing: 0; }
[hidden] { display: none !important; }

/* ---- Document ----------------------------------------------------------- */
body {
  font-family: var(--font-sans);
  font-size: var(--step-0);
  line-height: var(--lh-body);
  font-weight: var(--fw-regular);
  color: var(--c-text);
  background: var(--c-white);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
main { flex: 1 0 auto; }

::selection { background: var(--c-accent); color: var(--c-on-accent); }

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

/* ---- Typography --------------------------------------------------------- */
h1, h2, h3, h4 { font-family: var(--font-display); font-weight: var(--fw-light); line-height: var(--lh-snug); letter-spacing: var(--tracking-tight); text-wrap: balance; }
h1, .t-h1 { font-size: var(--step-5); line-height: var(--lh-tight); }
h2, .t-h2 { font-size: var(--step-4); line-height: var(--lh-tight); }
h3, .t-h3 { font-size: var(--step-2); }
h4, .t-h4 { font-size: var(--step-1); font-weight: var(--fw-regular); letter-spacing: 0; }
.t-display { font-size: var(--step-7); font-weight: var(--fw-light); line-height: 1.02; letter-spacing: -0.03em; }
.t-display-2 { font-size: var(--step-6); font-weight: var(--fw-light); line-height: var(--lh-tight); letter-spacing: -0.028em; }
.t-lead { font-size: var(--step-1); line-height: 1.45; color: var(--c-text-2); font-weight: var(--fw-light); }
.t-body { font-size: var(--step-0); }
.t-small { font-size: var(--step--1); }
.t-micro { font-size: var(--step--2); }
.t-muted { color: var(--c-text-2); }
.t-strong { font-weight: var(--fw-semibold); }
.t-num { font-variant-numeric: tabular-nums; }
p { text-wrap: pretty; }
p + p { margin-top: var(--space-4); }
strong, b { font-weight: var(--fw-semibold); }

a { color: var(--c-link); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 0.2em; }

/* Eyebrow: small uppercase label with the DLR yellow bar */
.eyebrow {
  display: inline-flex; align-items: center; gap: var(--space-3);
  font-size: var(--step--1); font-weight: var(--fw-semibold);
  letter-spacing: var(--tracking-wide); text-transform: uppercase;
  color: var(--c-text-2);
}
.eyebrow::before { content: ""; width: var(--space-5); height: 3px; border-radius: 2px; background: var(--c-accent); }

/* Prose: long legal / text pages */
.prose { max-width: var(--container-narrow); }
.prose h1 { margin-bottom: var(--space-6); }
.prose h2 { font-size: var(--step-2); margin: var(--space-8) 0 var(--space-4); }
.prose h3 { font-size: var(--step-1); font-weight: var(--fw-medium); letter-spacing: 0; margin: var(--space-6) 0 var(--space-3); }
.prose p, .prose li, .prose dd, .prose dt { color: var(--c-text-2); }
.prose p + p { margin-top: var(--space-4); }
.prose ul { list-style: disc; padding-left: var(--space-5); margin: var(--space-4) 0; }
.prose ol { list-style: decimal; padding-left: var(--space-5); margin: var(--space-4) 0; }
.prose li + li { margin-top: var(--space-2); }
.prose dl { display: grid; grid-template-columns: max-content 1fr; gap: var(--space-1) var(--space-4); margin: var(--space-4) 0; }
.prose dt { font-weight: var(--fw-semibold); color: var(--c-text); }
.prose .address { margin: var(--space-4) 0; }
.prose a { word-break: break-word; }

/* ---- Layout ------------------------------------------------------------- */
.container { width: 100%; max-width: calc(var(--container) + 2 * var(--gutter)); margin-inline: auto; padding-inline: var(--gutter); }
.container--narrow { max-width: calc(var(--container-narrow) + 2 * var(--gutter)); }
.container--wide { max-width: calc(var(--container-wide) + 2 * var(--gutter)); }

.section { padding-block: var(--section-y); position: relative; }
.section--tight { padding-block: var(--space-8); }
.section--paper { background: var(--c-paper); }
.section--dark { background: var(--c-ink); color: var(--c-on-dark); }

/* Section heading block: eyebrow + title + lead */
.section-head { display: grid; gap: var(--space-4); max-width: 46rem; margin-bottom: var(--space-8); }
.section-head--center { margin-inline: auto; text-align: center; justify-items: center; }
.section-head .t-lead { max-width: 40rem; }

.stack > * + * { margin-top: var(--space-4); }
.stack-lg > * + * { margin-top: var(--space-6); }
.cluster { display: flex; flex-wrap: wrap; gap: var(--space-3); align-items: center; }

.grid { display: grid; gap: var(--space-5); }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 1024px) { .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 680px) { .grid-2, .grid-3, .grid-4 { grid-template-columns: minmax(0, 1fr); } }

.split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--space-8); align-items: center; }
@media (max-width: 900px) { .split { grid-template-columns: minmax(0, 1fr); gap: var(--space-6); } }

/* ---- Dark context: re-map text colors ---------------------------------- */
.section--dark .t-lead, .on-dark .t-lead,
.section--dark .t-muted, .on-dark .t-muted { color: var(--c-on-dark-2); }
.section--dark .eyebrow, .on-dark .eyebrow { color: var(--c-on-dark-2); }
.section--dark a:not(.btn), .on-dark a:not(.btn) { color: var(--c-link-dark); }

/* ---- Accessibility helpers --------------------------------------------- */
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; }
.skip-link { position: absolute; left: var(--space-4); top: -100px; z-index: calc(var(--z-header) + 1); background: var(--c-accent); color: var(--c-on-accent); padding: var(--space-2) var(--space-4); border-radius: var(--r-pill); font-weight: var(--fw-semibold); }
.skip-link:focus { top: var(--space-3); }

/* ---- Scroll reveal (activated by js/site.js) ----------------------------- */
.js [data-reveal] { opacity: 0; transform: translateY(24px); transition: opacity var(--dur-3) var(--ease-out), transform var(--dur-3) var(--ease-out); }
.js [data-reveal].is-visible { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .js [data-reveal] { opacity: 1; transform: none; } }

/* ---- Language (see js/i18n.js) ------------------------------------------ */
/* hide English texts for a moment until the German ones are in place */
.lang-de:not(.i18n-done) [data-de] { visibility: hidden; }
.legal-note { padding: var(--space-3) var(--space-4); margin-bottom: var(--space-6); border-radius: var(--r-sm); background: var(--c-accent-soft); color: var(--c-text) !important; font-size: var(--step--1); }

/* ---- Phones: one consistent, calmer type scale ---------------------------- */
@media (max-width: 600px) {
  .t-lead { font-size: var(--step-0); line-height: var(--lh-body); }
  .section-head { margin-bottom: var(--space-7); }
  .statement { margin-bottom: var(--space-8); }
}
