/* =========================================================================
   Tamos Consulting – Basis
   Reset, Body, Typografie, Raster, Grundbausteine, Reveal-Hilfen.
   Werte nur aus tokens.css. Kein `transition: all`.
   ========================================================================= */

/* ---- Reset ------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; }
body, h1, h2, h3, h4, p, ul, ol, figure, blockquote, dl, dd { margin: 0; }
ul[role="list"], ol[role="list"], .list-reset { list-style: none; padding: 0; margin: 0; }
img, svg, video, canvas { display: block; max-width: 100%; }
img, video { height: auto; }
input, button, textarea, select { font: inherit; color: inherit; letter-spacing: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
a { color: inherit; text-decoration: none; }
[hidden] { display: none !important; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + var(--space-4));
}

body {
  min-height: 100svh;
  background: var(--c-bg);
  color: var(--c-ink);
  font-family: var(--font-text);
  font-size: var(--fs-body);
  font-weight: 400;
  line-height: var(--lh-text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  font-feature-settings: "kern" 1;
  overflow-x: clip;
}

main:focus { outline: none; }

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

/* ---- Raster ------------------------------------------------------------ */
.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  column-gap: var(--grid-gap);
  row-gap: var(--space-7);
}
@media (min-width: 768px) {
  .grid { grid-template-columns: repeat(12, minmax(0, 1fr)); }
}

/* Sektionen */
.section {
  position: relative;
  padding-block: var(--section-pad);
  background: var(--c-bg);
  color: var(--c-ink);
}

/* Invertierte Sektion: setzt die lokalen Farbrollen um, damit Kinder
   einfach --c-ink / --c-muted / --c-line weiterverwenden können. */
.section--invert {
  --c-bg: var(--c-invert-bg);
  --c-ink: var(--c-invert-ink);
  --c-muted: var(--c-invert-muted);
  --c-line: var(--c-invert-line);
  --c-surface: var(--c-invert-surface);
  --c-surface-2: var(--c-invert-surface-2);
  --c-accent-text: var(--c-accent);
  --c-accent-2: var(--c-accent-2-bright);
  --c-accent-2-ink: var(--c-invert-bg);
  --c-warn: var(--c-warn-bright);
  background: var(--c-bg);
  color: var(--c-ink);
}
.section--invert ::selection { background: var(--c-accent); color: var(--c-accent-ink); }

/* Sektionskopf: Eyebrow, h2, Lead – Abstand zum Inhalt */
.section-head { display: grid; gap: var(--space-5); margin-bottom: var(--head-gap); max-width: 52rem; }

/* ---- Typografie -------------------------------------------------------- */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: var(--space-3);
  font-family: var(--font-mono);
  font-size: var(--fs-micro);
  font-weight: 500;
  line-height: 1.3;
  letter-spacing: var(--ls-mono);
  color: var(--c-muted);
}
/* Nummer der Sektion vorn, z. B. <span class="eyebrow__num">02</span> */
.eyebrow__num { color: var(--c-ink); font-variant-numeric: tabular-nums; }
.eyebrow::before {
  content: "";
  width: 8px; height: 8px;
  border-radius: var(--radius-pill);
  background: var(--c-accent);
  flex: none;
}

.h-hero, .h1, .h2, .h3 {
  font-family: var(--font-display);
  font-stretch: var(--wdth-display);
  color: var(--c-ink);
  text-wrap: balance;
  hyphens: manual;
  overflow-wrap: break-word;
}
.h-hero {
  font-size: var(--fs-hero);
  font-weight: 700;
  line-height: var(--lh-tight);
  letter-spacing: var(--ls-hero);
  font-variation-settings: "opsz" 96;
}
.h1 {
  font-size: var(--fs-h1);
  font-weight: 650;
  line-height: var(--lh-head);
  letter-spacing: var(--ls-head);
  font-variation-settings: "opsz" 96;
}
.h2 {
  font-size: var(--fs-h2);
  font-weight: 650;
  line-height: var(--lh-head);
  letter-spacing: var(--ls-head);
  font-variation-settings: "opsz" 72;
}
.h3 {
  font-size: var(--fs-h3);
  font-weight: 600;
  line-height: var(--lh-snug);
  letter-spacing: var(--ls-h3);
  font-stretch: 100%;
  font-variation-settings: "opsz" 24;
}
/* Grauer Nachsatz in Überschriften: <h2 class="h2">Satz. <span class="muted">Nachsatz.</span></h2> */
.h-hero .muted, .h1 .muted, .h2 .muted { color: var(--c-muted); }

.lead {
  font-size: var(--fs-lead);
  line-height: 1.5;
  font-weight: 400;
  color: var(--c-ink);
  max-width: var(--measure);
  text-wrap: pretty;
}
p { max-width: var(--measure); text-wrap: pretty; }
.small { font-size: var(--fs-small); line-height: 1.5; }
.muted { color: var(--c-muted); }
.mono {
  font-family: var(--font-mono);
  font-size: var(--fs-micro);
  letter-spacing: var(--ls-mono);
  font-variant-numeric: tabular-nums;
}
.num { font-variant-numeric: tabular-nums; }
.stat {
  font-family: var(--font-display);
  font-size: var(--fs-stat);
  font-weight: 650;
  line-height: 1;
  letter-spacing: var(--ls-head);
  font-variant-numeric: tabular-nums;
}
.nowrap { white-space: nowrap; }

/* Listen mit Strich-Markierung */
.ticks { list-style: none; padding: 0; display: grid; gap: var(--space-3); }
.ticks > li { position: relative; padding-left: var(--space-6); }
.ticks > li::before {
  content: "";
  position: absolute; left: 0; top: 0.8em;
  width: 16px; height: 1px;
  background: var(--c-accent);
}

/* ---- Logo (Platzhalter-Schriftzug, zentral in partials/logo.html) ------ */
.logo {
  display: inline-flex;
  align-items: baseline;
  gap: 0.4em;
  padding-block: 10px; /* ergibt mit 24px Schrift ~44px Tap-Ziel */
  color: var(--c-ink);
  line-height: 1;
  white-space: nowrap;
}
.logo__mark {
  font-family: var(--font-display);
  font-stretch: 82%;
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.05em;
  font-variation-settings: "opsz" 48;
  position: relative;
  padding-right: 0.32em; /* Platz für den Signalpunkt */
}
/* Signalpunkt: der einzige Akzent im Schriftzug */
.logo__mark::after {
  content: "";
  position: absolute;
  right: 0; bottom: 0.08em;
  width: 0.2em; height: 0.2em;
  border-radius: var(--radius-pill);
  background: var(--c-accent);
}
.logo__sub {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--c-muted);
}
.section--invert .logo__sub, .logo--invert .logo__sub { color: var(--c-invert-muted); }

/* ---- Buttons ----------------------------------------------------------- */
.btn {
  --btn-bg: transparent;
  --btn-fg: var(--c-ink);
  --btn-bd: var(--c-ink);
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-3);
  min-height: var(--btn-h);
  padding: 0 var(--space-5);
  border: 1px solid var(--btn-bd);
  border-radius: var(--radius-s);
  background: var(--btn-bg);
  color: var(--btn-fg);
  font-family: var(--font-text);
  font-size: 1rem;
  font-weight: 600;
  line-height: 1;
  letter-spacing: -0.005em;
  white-space: nowrap;
  text-decoration: none;
  cursor: pointer;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  transition:
    transform var(--dur-press) var(--ease-out),
    background-color var(--dur-ui) var(--ease-hover),
    color var(--dur-ui) var(--ease-hover),
    border-color var(--dur-ui) var(--ease-hover);
}
.btn:active { transform: scale(0.97); }
.btn[disabled], .btn[aria-disabled="true"] { opacity: 0.45; cursor: not-allowed; transform: none; }

/* Pfeil im Button: <svg class="btn__arrow" …> als letztes Kind */
.btn__arrow {
  width: 16px; height: 16px; flex: none;
  transition: transform var(--dur-ui) var(--ease-out);
}

/* Primär: Signalorange, schwarze Schrift – nur für „Erstgespräch anfragen“ */
.btn--primary {
  --btn-bg: var(--c-accent);
  --btn-fg: var(--c-accent-ink);
  --btn-bd: var(--c-accent);
}
/* Sekundär: Kontur */
.btn--ghost {
  --btn-bg: transparent;
  --btn-fg: var(--c-ink);
  --btn-bd: var(--c-line);
}
/* Auf dunklen Flächen: helle Kontur (Sekundäraktion) */
.btn--invert {
  --btn-bg: transparent;
  --btn-fg: var(--c-invert-ink);
  --btn-bd: var(--c-invert-line);
}

@media (hover: hover) and (pointer: fine) {
  .btn--primary:hover { --btn-bg: var(--c-ink); --btn-fg: var(--c-bg); --btn-bd: var(--c-ink); }
  .section--invert .btn--primary:hover { --btn-bg: var(--c-invert-ink); --btn-fg: var(--c-invert-bg); --btn-bd: var(--c-invert-ink); }
  .btn--ghost:hover { --btn-bd: var(--c-ink); }
  .btn--invert:hover { --btn-bd: var(--c-invert-ink); }
  .btn:hover .btn__arrow { transform: translateX(3px); }
}

.btn-row { display: flex; flex-wrap: wrap; gap: var(--space-3); }
@media (max-width: 767px) {
  .btn-row { flex-direction: column; align-items: stretch; }
  .btn-row .btn { width: 100%; }
}

/* ---- Textlinks: Unterstrich zeichnet sich von links ------------------- */
.link {
  position: relative;
  display: inline;
  color: var(--c-ink);
  font-weight: 500;
  text-decoration: none;
  background-image: linear-gradient(currentColor, currentColor), linear-gradient(var(--c-line), var(--c-line));
  background-repeat: no-repeat;
  background-position: 0 100%, 0 100%;
  background-size: 0% 1px, 100% 1px;
  padding-bottom: 2px;
  transition: background-size var(--dur-ui) var(--ease-out), color var(--dur-ui) var(--ease-hover);
}
@media (hover: hover) and (pointer: fine) {
  .link:hover { background-size: 100% 1px, 100% 1px; }
}

/* ---- Fokus ------------------------------------------------------------- */
:focus-visible {
  outline: 2px solid var(--c-accent);
  outline-offset: 3px;
  border-radius: var(--radius-s);
}
:focus:not(:focus-visible) { outline: none; }

/* ---- Barrierefreiheit -------------------------------------------------- */
.sr-only {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}
.skip-link {
  position: absolute;
  top: var(--space-3); left: var(--space-3);
  z-index: var(--z-skip);
  padding: var(--space-3) var(--space-4);
  background: var(--c-ink);
  color: var(--c-bg);
  font-weight: 600;
  border-radius: var(--radius-s);
  transform: translateY(-200%);
  transition: transform var(--dur-ui) var(--ease-out);
}
.skip-link:focus, .skip-link:focus-visible { transform: translateY(0); }

/* ---- Formular-Grundlagen (Feinschliff in kontakt.css) ----------------- */
.field { display: grid; gap: var(--space-2); }
.field__label { font-size: var(--fs-micro); font-weight: 500; font-family: var(--font-mono); color: var(--c-muted); }
.field__input {
  width: 100%;
  min-height: 52px;
  padding: var(--space-3) var(--space-4);
  font-size: 1rem; /* nie unter 16px – kein Zoom auf iOS */
  background: var(--c-surface);
  /* Feldrand mit mind. 3:1 Kontrast (WCAG 1.4.11) – hell wie invertiert, da --c-ink umgeschaltet wird */
  border: 1px solid color-mix(in srgb, var(--c-ink) 48%, transparent);
  border-radius: var(--radius-s);
  transition: border-color var(--dur-ui) var(--ease-hover), background-color var(--dur-ui) var(--ease-hover);
}
.field__input:focus-visible { outline: none; border-color: var(--c-accent); background: var(--c-surface-2); }
.field__input[aria-invalid="true"] { border-color: var(--c-warn); }
/* Fehlerhaftes Feld im Fokus: roter Rand bleibt, dazu der übliche orange Fokusring */
.field__input[aria-invalid="true"]:focus-visible { outline: 2px solid var(--c-accent); outline-offset: 3px; }
.field__error { font-size: var(--fs-small); color: var(--c-warn); min-height: 1.25em; }

/* Status-Punkt (Akzent 2) */
.dot { display: inline-block; width: 8px; height: 8px; border-radius: var(--radius-pill); background: var(--c-accent-2); flex: none; }
.dot--signal { background: var(--c-accent); }
.dot--warn { background: var(--c-warn); }

/* ---- Reveal-Hilfen ----------------------------------------------------- */
/* Nur mit JS versteckt; ohne JS ist alles sichtbar. */
html.js [data-reveal] {
  opacity: 0;
  transform: translateY(var(--reveal-y));
  transition:
    opacity var(--dur-reveal) var(--ease-out),
    transform var(--dur-reveal) var(--ease-out);
  transition-delay: calc(var(--i, 0) * var(--stagger));
}
html.js [data-reveal].is-in { opacity: 1; transform: none; }
html.js [data-reveal="fade"] { transform: none; }
/* Linie, die sich von links zeichnet */
html.js [data-reveal="line"] {
  opacity: 1;
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform var(--dur-scene) var(--ease-in-out);
}
html.js [data-reveal="line"].is-in { transform: scaleX(1); }
/* Maske: Zeile steigt aus einer Kante (Überschriften) – Kind .mask__in */
html.js [data-reveal="mask"] { opacity: 1; transform: none; overflow: clip; }
html.js [data-reveal="mask"] > .mask__in {
  display: inline-block;
  transform: translateY(105%);
  transition: transform var(--dur-scene) var(--ease-out);
  transition-delay: calc(var(--i, 0) * var(--stagger));
}
html.js [data-reveal="mask"].is-in > .mask__in { transform: none; }

/* Stagger per Attribut: data-reveal-delay="1".."8" */
[data-reveal-delay="1"] { --i: 1; }
[data-reveal-delay="2"] { --i: 2; }
[data-reveal-delay="3"] { --i: 3; }
[data-reveal-delay="4"] { --i: 4; }
[data-reveal-delay="5"] { --i: 5; }
[data-reveal-delay="6"] { --i: 6; }
[data-reveal-delay="7"] { --i: 7; }
[data-reveal-delay="8"] { --i: 8; }

/* Pausieren: inaktiver Tab oder außerhalb des Bildes */
html.is-paused *, .is-offscreen * { animation-play-state: paused !important; }

/* ---- Reduzierte Bewegung ---------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  html.js [data-reveal],
  html.js [data-reveal="line"],
  html.js [data-reveal="mask"] > .mask__in {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .btn:active { transform: none; }
}
