/* ==========================================================================
   Basis: Reset, Typografie, Layout-Raster, Browser-Oberflächen
   ========================================================================== */

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: calc(var(--header-h) + var(--space-4));
  scrollbar-color: var(--concrete-600) var(--paper);
}
@media (prefers-reduced-motion: no-preference) {
  html:not(.reduce-motion) { scroll-behavior: smooth; }
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--color-surface);
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: var(--step-0);
  font-weight: 400;
  line-height: var(--lh-body);
  font-kerning: normal;
  font-feature-settings: "kern", "liga";
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: clip;
}

img, svg, video, picture { display: block; max-width: 100%; }
img, video { height: auto; }
button, input, select, textarea { font: inherit; color: inherit; }
a, button, label, summary { -webkit-tap-highlight-color: hsl(var(--abbruch-mark-hsl) / .15); }
button { cursor: pointer; }
:where(ul, ol)[role="list"], .list-plain { list-style: none; margin: 0; padding: 0; }
address { font-style: normal; }
table { border-collapse: collapse; }

::selection { background: var(--abbruch); color: var(--on-abbruch); }
input, textarea { caret-color: var(--abbruch-strong); }
.surface-dark input, .surface-dark textarea { caret-color: var(--abbruch); }

::-webkit-scrollbar { width: 12px; height: 12px; }
::-webkit-scrollbar-track { background: var(--paper); }
::-webkit-scrollbar-thumb { background: var(--concrete-600); border: 3px solid var(--paper); border-radius: 2px; }
::-webkit-scrollbar-thumb:hover { background: var(--ink); }

/* Fokus: immer sichtbar – dunkle Kontur plus blauer Ring */
:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
  box-shadow: 0 0 0 5px var(--focus-ring);
  border-radius: var(--radius-1);
}
.surface-dark :focus-visible { outline-color: var(--abbruch); box-shadow: 0 0 0 5px var(--focus-ring); }

/* ---------- Typografie ---------- */
h1, h2, h3, h4 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 750;
  font-stretch: 72%;
  line-height: var(--lh-heading);
  letter-spacing: var(--track-display);
  text-wrap: balance;
}
.h-display {
  font-size: var(--step-5);
  line-height: var(--lh-tight);
  text-transform: uppercase;
  font-weight: 800;
  font-stretch: 64%;
  letter-spacing: -0.015em;
}
.h-1 { font-size: var(--step-4); line-height: 0.98; text-transform: uppercase; font-weight: 800; font-stretch: 66%; }
.h-2 { font-size: var(--step-3); line-height: 1.02; }
.h-3 { font-size: var(--step-2); line-height: 1.1; font-stretch: 78%; }
.h-4 { font-size: var(--step-1); line-height: 1.2; font-stretch: 85%; font-weight: 700; letter-spacing: -0.01em; }

p { margin: 0; text-wrap: pretty; }
.lead { font-size: var(--step-1); font-weight: 300; line-height: 1.45; max-width: 52ch; }
.prose { max-width: var(--measure); }
.prose > * + * { margin-top: var(--space-4); }
.prose h2 { margin-top: var(--space-12); font-size: var(--step-2); }
.prose h3 { margin-top: var(--space-8); font-size: var(--step-1); font-stretch: 85%; }
.prose ul { padding-left: 1.2em; }
.prose li + li { margin-top: var(--space-2); }
.muted { color: var(--color-text-muted); }
strong, b { font-weight: 600; }

.mono, .label, code, kbd {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}
.label {
  font-size: var(--step--1);
  font-weight: 500;
  letter-spacing: var(--track-label);
  text-transform: uppercase;
  line-height: 1.3;
}
.num { font-variant-numeric: tabular-nums lining-nums; }

a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 0.22em; text-decoration-color: var(--color-border-strong); transition: text-decoration-color var(--dur-xs) var(--ease-out); }
a:hover { text-decoration-color: var(--color-accent-line); text-decoration-thickness: 2px; }
.prose a, .link { text-decoration-line: underline; }

/* ---------- Layout ---------- */
.container { width: min(100% - 2 * var(--gutter), var(--container)); margin-inline: auto; }
.container-wide { width: min(100% - 2 * var(--gutter), var(--container-wide)); margin-inline: auto; }
.section { padding-block: var(--section-y); position: relative; }
.section--tight { padding-block: calc(var(--section-y) * .6); }

.grid-12 {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: var(--gutter);
  row-gap: var(--space-8);
}
@media (max-width: 63.99rem) {
  .grid-12 { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .grid-12 > * { grid-column: 1 / -1; }
}

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

/* ---------- Hilfsklassen ---------- */
.visually-hidden:not(:focus):not(:active) {
  clip: rect(0 0 0 0); clip-path: inset(50%);
  height: 1px; width: 1px; overflow: hidden; position: absolute; white-space: nowrap;
}
.skip-link {
  position: absolute; left: var(--space-4); top: -100px; z-index: 1000;
  background: var(--abbruch); color: var(--on-abbruch); padding: var(--space-3) var(--space-4);
  font-weight: 600; text-decoration: none; border-radius: var(--radius-2);
}
.skip-link:focus { top: var(--space-4); }

/* Platzhalter für Kundendaten – deutlich sichtbar, damit nichts versehentlich live geht */
.ph {
  font-family: var(--font-mono);
  font-size: 0.85em;
  background: hsl(50 100% 60% / .35);
  outline: 1px dashed hsl(45 90% 35%);
  padding: 0 .25em;
  border-radius: var(--radius-1);
  color: inherit;
}
.surface-dark .ph { background: hsl(50 100% 60% / .22); outline-color: hsl(50 100% 60%); }

.img-missing { display: grid; place-items: center; aspect-ratio: 4 / 3; background: var(--concrete-200); font-family: var(--font-mono); font-size: var(--step--1); padding: var(--space-4); text-align: center; }

/* Eigenfotos einheitlich graden */
.photo img, img.photo { filter: var(--photo-grade); }

@media print {
  html body .site-header, html body .site-footer, html body .mobile-bar, html body [data-print-hide] { display: none; }
  body { background: #fff; color: #000; }
}
.js .nojs-only { display: none; }
