/* Denksportwerk – Layout und Komponenten (dunkles Design). Farben nur über Rollen aus tokens.css. */

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

html { -webkit-text-size-adjust: 100%; scroll-padding-top: 1rem; background: var(--bg); }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 var(--s-0) / var(--lh) var(--font);
  overflow-wrap: break-word;
}

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

h1, h2, h3 {
  color: var(--heading);
  line-height: var(--lh-tight);
  letter-spacing: -0.01em;
  margin: 0 0 0.5em;
  text-wrap: balance;
  overflow-wrap: break-word;
  hyphens: auto;
}
h1 { font-size: var(--s-4); font-weight: 800; }
h2 { font-size: var(--s-3); font-weight: 800; }
h3 { font-size: var(--s-2); font-weight: 700; }

p, ul, ol, dl { margin: 0 0 1em; }

a { color: var(--accent); text-underline-offset: 0.2em; text-decoration-thickness: 1px; overflow-wrap: anywhere; }
a:hover { text-decoration-thickness: 2px; }

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
  border-radius: 4px;
}

.wrap {
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

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

.skip {
  position: absolute;
  left: var(--gutter);
  top: -4rem;
  z-index: 10;
  background: var(--accent);
  color: var(--on-accent);
  padding: 0.6rem 1rem;
  border-radius: var(--radius);
  font-weight: 700;
}
.skip:focus { top: 0.75rem; }

/* Buttons */
.btns { display: flex; flex-wrap: wrap; gap: 0.75rem; }

.btn {
  display: inline-block;
  padding: 0.8rem 1.35rem;
  border: 2px solid var(--accent);
  border-radius: var(--radius);
  font: inherit;
  font-weight: 700;
  line-height: 1.3;
  text-decoration: none;
  cursor: pointer;
}
.btn--primary { background: var(--accent); color: var(--on-accent); }
.btn--secondary { background: transparent; color: var(--text); border-color: var(--text); }
.btn:hover { text-decoration: underline; text-underline-offset: 0.2em; }

/* Kopf */
.site-header__inner {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  padding-block: 1.25rem;
}
.logo { flex: none; margin-right: auto; }
.logo img { height: 5rem; width: auto; }

.nav { display: flex; gap: 1.75rem; list-style: none; margin: 0; padding: 0; font-weight: 500; }
.nav a { color: var(--text); text-decoration: none; }
.nav a:hover,
.nav a[aria-current] { text-decoration: underline; text-decoration-color: var(--accent); text-decoration-thickness: 3px; }
.nav a[aria-current] { color: var(--heading); }

.header-tel { color: var(--accent); font-weight: 700; text-decoration: none; white-space: nowrap; }

.menu-toggle { display: none; }

/* Startseite: Kopf liegt transparent über dem Hero */
.is-home .site-header { position: absolute; inset: 0 0 auto; z-index: 3; }

@media (max-width: 52rem) {
  .site-header__inner { flex-wrap: wrap; gap: 0.75rem 1rem; }
  .logo img { height: 3.75rem; }
  .header-tel { order: 1; }
  .js .menu-toggle {
    display: inline-block;
    order: 2;
    padding: 0.45rem 0.9rem;
    border: 2px solid var(--text);
    border-radius: var(--radius);
    background: transparent;
    color: var(--text);
    font: inherit;
    font-weight: 700;
    cursor: pointer;
  }
  .site-nav { order: 3; flex-basis: 100%; }
  .nav {
    flex-direction: column;
    gap: 0;
    border-top: 2px solid var(--accent);
    background: var(--bg);
  }
  .nav a { display: block; padding: 0.8rem 0; border-bottom: 1px solid var(--line); }
  .js .site-nav:not(.is-open) { display: none; }
}
@media (max-width: 26rem) {
  .header-tel .tel-number { display: none; }
}
@media (min-width: 26.01rem) {
  .header-tel .tel-label { display: none; }
}

/* Abschnitte */
.section { padding-block: var(--space-section); }
.section--surface { background: var(--surface); }
.section > .wrap > :last-child { margin-bottom: 0; }

.lead { font-size: var(--s-1); line-height: 1.5; max-width: 38ch; }

/* Hero: volle Höhe mit Hintergrundbild, Suchszene darüber */
.hero {
  position: relative;
  isolation: isolate;
  display: grid;
  align-items: center;
  min-height: 100vh;
  min-height: 100svh;
  padding-block: calc(var(--header-h) + 1rem) 4rem;
  background:
    radial-gradient(circle at 78% 28%, rgb(245 150 150 / 0.16), transparent 38%),
    radial-gradient(circle at 15% 85%, #1a4a44, transparent 55%),
    var(--bg);
}
.hero__media {
  position: absolute;
  inset: 0;
  z-index: -2;
}
.hero__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.hero__media:has(img)::after {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--hero-overlay);
}
.hero__inner {
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  gap: 3.5rem;
  align-items: center;
  width: 100%;
}
.hero__inner > * { min-width: 0; }
.hero h1 { font-size: var(--s-hero); max-width: 13ch; }
.hero .lead { margin-bottom: 2rem; }

@media (max-width: 52rem) {
  .hero { align-items: start; }
  .hero__inner { grid-template-columns: minmax(0, 1fr); gap: 2.5rem; }
  .hero__media:has(img)::after { background: rgb(11 37 34 / 0.82); }
}

.scene {
  position: relative;
  isolation: isolate;
  margin: 0;
  background: var(--surface-strong);
  color: var(--text);
  border: 1px solid rgb(255 255 255 / 0.12);
  border-radius: var(--radius-scene);
  padding: 1.75rem;
}
.scene::before {
  content: "";
  position: absolute;
  inset: -14px auto auto -14px;
  z-index: -1;
  width: 5.5rem;
  height: 5.5rem;
  border-radius: 50%;
  background: var(--accent);
}
.scene__query {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: var(--c-weiss);
  color: var(--c-schiefer);
  border-radius: 999px;
  padding: 0.8rem 1.2rem;
  font-weight: 500;
}
.scene__query svg { flex: none; }
.scene__typed {
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  white-space: nowrap;
  border-right: 2px solid var(--c-schiefer);
}
.scene__answer { margin-top: 1.25rem; line-height: 1.55; }
.scene__answer p { margin: 0 0 0.75rem; }
.scene__result {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  background: rgb(255 255 255 / 0.08);
  border: 1px solid rgb(255 255 255 / 0.18);
  border-radius: 16px;
  padding: 0.9rem 1rem;
}
.scene__result strong { display: block; color: var(--accent); font-size: var(--s-1); }
.scene__result small { display: block; color: var(--text-muted); font-size: var(--s--1); }
.scene__dot { flex: none; width: 2.75rem; height: 2.75rem; border-radius: 50%; background: var(--accent); }
.scene figcaption { margin-top: 1rem; font-size: 0.9rem; color: var(--text-muted); }

@media (prefers-reduced-motion: no-preference) {
  .scene__typed { animation: scene-type 1.8s steps(24) 0.4s both, scene-caret 0.8s step-end 6; }
  .scene__answer { animation: scene-show 0.5s ease 2.4s both; }
}
@keyframes scene-type { from { width: 0; } to { width: 24.5ch; } }
@keyframes scene-caret { 50% { border-color: transparent; } }
@keyframes scene-show { from { opacity: 0; } to { opacity: 1; } }

/* Leistungen als Zeilen */
.services {
  list-style: none;
  margin: 2rem 0 0;
  padding: 0;
  border-top: 2px solid var(--line-strong);
}
.services a {
  display: grid;
  grid-template-columns: minmax(0, 22rem) minmax(0, 1fr) auto;
  gap: 2rem;
  align-items: baseline;
  padding-block: 1.5rem;
  border-bottom: 1px solid var(--line);
  color: inherit;
  text-decoration: none;
}
.services h2,
.services h3 { margin: 0; font-size: var(--s-2); font-weight: 700; }
.services p { margin: 0; max-width: 52ch; color: var(--text-muted); }
.services .more { color: var(--accent); font-weight: 700; text-decoration: underline; }
.services a:hover :is(h2, h3) {
  text-decoration: underline;
  text-decoration-color: var(--accent);
  text-decoration-thickness: 4px;
  text-underline-offset: 0.15em;
}
@media (max-width: 52rem) {
  .services a { grid-template-columns: minmax(0, 1fr); gap: 0.4rem; }
}

/* Ablauf: echte Reihenfolge, daher nummeriert */
.steps {
  list-style: none;
  counter-reset: step;
  margin: 2rem 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr));
  gap: 2rem;
}
.steps li { counter-increment: step; }
.steps li::before {
  content: counter(step);
  display: grid;
  place-items: center;
  width: 2.6rem;
  height: 2.6rem;
  margin-bottom: 0.9rem;
  border-radius: 50%;
  background: var(--accent);
  color: var(--on-accent);
  font-weight: 800;
}
.steps h3 { font-size: var(--s-1); margin-bottom: 0.3em; }
.steps p { margin: 0; color: var(--text-muted); }

/* Über-mich-Teaser und Über-mich-Seite */
.person:has(> img) {
  display: grid;
  grid-template-columns: minmax(0, 18rem) minmax(0, 1fr);
  gap: 3rem;
  align-items: start;
}
.person img { border-radius: var(--radius-scene); }
.person__text { max-width: var(--measure); }
@media (max-width: 40rem) {
  .person:has(> img) { grid-template-columns: minmax(0, 1fr); gap: 1.5rem; }
  .person img { max-width: 14rem; }
}

/* Kontaktband */
.cta-band { background: var(--surface-strong); }
.cta-band p { max-width: 52ch; }

/* Unterseiten */
.page-head { padding-block: 2.5rem 1rem; }
.page-head + .section { padding-top: 1.5rem; }
.page-head .lead { max-width: 46ch; }
.page-head nav { margin-bottom: 0.75rem; font-weight: 500; }
.page-head nav a::before { content: "‹ "; }

.prose > * { max-width: var(--measure); }
.prose h2 { font-size: var(--s-2); margin-top: 1.75em; }
.prose h3 { font-size: var(--s-1); margin-top: 1.5em; }
.prose > :first-child { margin-top: 0; }
.prose li + li { margin-top: 0.35em; }
.prose figure { margin: 2rem 0; }
.prose figure img { border-radius: var(--radius); }
.prose figcaption { margin-top: 0.5rem; color: var(--text-muted); font-size: var(--s--1); }
.prose blockquote {
  margin: 2rem 0;
  padding: 1rem 1.25rem;
  background: var(--surface);
  border-left: 4px solid var(--accent);
  border-radius: var(--radius);
}

.checklist-wrap ul { list-style: none; padding: 0; }
.checklist-wrap li { position: relative; padding-left: 1.75rem; }
.checklist-wrap li + li { margin-top: 0.5em; }
.checklist-wrap li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.45em;
  width: 0.8rem;
  height: 0.8rem;
  border-radius: 50%;
  background: var(--accent);
}

/* Häufige Fragen */
.faq { max-width: var(--measure); border-top: 2px solid var(--line-strong); }
.faq details { border-bottom: 1px solid var(--line); }
.faq summary {
  padding: 1.1rem 2.5rem 1.1rem 0;
  position: relative;
  color: var(--heading);
  font-weight: 700;
  cursor: pointer;
  list-style: none;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+";
  position: absolute;
  right: 0.25rem;
  top: 0.9rem;
  color: var(--accent);
  font-size: 1.5rem;
  line-height: 1;
}
.faq details[open] summary::after { content: "–"; }
.faq .faq__answer { padding-bottom: 1rem; }
.faq .faq__answer > :last-child { margin-bottom: 0; }

/* Kontakt */
.contact-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  gap: 4rem;
  align-items: start;
}
@media (max-width: 52rem) {
  .contact-grid { grid-template-columns: minmax(0, 1fr); gap: 3rem; }
}
.contact-ways { list-style: none; padding: 0; margin: 0; }
.contact-ways li { padding-block: 1rem; border-bottom: 1px solid var(--line); }
.contact-ways li:first-child { border-top: 2px solid var(--line-strong); }
.contact-ways strong { display: block; color: var(--heading); }
.contact-ways a { font-size: var(--s-1); font-weight: 700; }

.form { display: grid; gap: 1.25rem; max-width: 40rem; }
.field label { display: block; margin-bottom: 0.35rem; font-weight: 700; color: var(--heading); }
.field .hint { display: block; margin-top: -0.2rem; margin-bottom: 0.35rem; color: var(--text-muted); font-size: var(--s--1); }
.field input,
.field textarea {
  width: 100%;
  padding: 0.75rem 0.9rem;
  border: 2px solid var(--field-border);
  border-radius: var(--radius);
  background: var(--field-bg);
  color: var(--text);
  font: inherit;
}
.field textarea { min-height: 10rem; resize: vertical; }
.field input:focus-visible,
.field textarea:focus-visible { border-color: var(--accent); outline-offset: 1px; }
.field [aria-invalid="true"] { border-color: var(--error); }
.form > .hint { margin: 0; color: var(--text-muted); font-size: var(--s--1); }
.field__error { margin: 0.35rem 0 0; color: var(--error); font-weight: 700; font-size: var(--s--1); }
.field--hp { position: absolute; left: -9999px; }

.notice {
  padding: 1rem 1.25rem;
  border-radius: var(--radius);
  background: var(--surface);
  max-width: 40rem;
}
.notice--success { border-left: 6px solid var(--accent); }
.notice--error { border-left: 6px solid var(--error); }
.notice > :last-child { margin-bottom: 0; }

/* Fuß */
.site-footer { background: var(--footer-bg); color: var(--text-muted); padding-block: 3rem; font-size: var(--s--1); }
.site-footer strong { color: var(--text); }
.site-footer__inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 2rem;
}
.site-footer address { font-style: normal; }
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer li + li { margin-top: 0.4rem; }
.site-footer .copyright { flex-basis: 100%; margin: 0; }
