/* ---------- Design tokens ---------- */
:root {
  /* ---------- Brand color palette (PERSPEKTIVA) ---------- */
  --color-dark: #2C2C2A;     /* Dunkelgrau – Hintergründe, Logobasis, Überschriften */
  --color-cream: #F5F0E8;    /* Cremeweiß – Fließtext, Schriftzug „PERSPEKTIVA" */
  --color-beige: #E8DCC8;    /* Warmbeige – Akzentfarbe, Schriftzug „COACHING" */
  --color-graywarm: #C8C6BE; /* Warmgrau – Trennelemente, Claim */

  /* ---------- Semantic tokens (mapped to palette, WCAG 2.1 AA safe) ---------- */
  /* Helle Flächen tragen dunklen Text; die dunkle Fläche trägt hellen Text. */
  --bg: var(--color-cream);
  --bg-alt: var(--color-beige);
  --surface: var(--color-cream);
  /* Etwas dunklerer Kartenhintergrund, hebt Karten von der Fläche ab */
  --surface-card: color-mix(in srgb, var(--color-cream) 65%, var(--color-graywarm));
  --ink: var(--color-dark);
  --ink-soft: var(--color-dark);
  --accent: var(--color-beige);
  --accent-dark: var(--color-dark);
  --line: var(--color-graywarm);
  /* Gedämpfter, palettentreuer Grauton für Sekundärtext (z. B. Claim) */
  --color-muted: color-mix(in srgb, var(--color-dark) 55%, var(--color-cream));
  --shadow: 0 12px 30px color-mix(in srgb, var(--color-dark) 10%, transparent);
  --radius: 16px;
  /* Layoutbreite: ab 1024px zentriert, maximal 1280px (Req 4.2) */
  --maxw: 1280px;
  --space: clamp(3.5rem, 8vw, 6rem);
  --font-head: "Playfair Display", Georgia, serif;
  --font-body: "Montserrat", "Lato", "Open Sans", system-ui, sans-serif;
}

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

html {
  scroll-behavior: smooth;
  /* Mindestschriftgröße 16px für Fließtext (Req 4.3) */
  font-size: 100%;
  /* Verhindert horizontales Scrollen im Mobilbereich (Req 4.1, 4.6) */
  overflow-x: hidden;
}

body {
  margin: 0;
  font-family: var(--font-body);
  /* Fließtext mindestens 16px mit Zeilenabstand >= 1,5 (Req 4.3) */
  font-size: 1rem;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  /* Lange Wörter/URLs umbrechen, statt die Viewport-Breite zu sprengen (Req 4.6) */
  overflow-wrap: break-word;
  word-break: break-word;
}

h1,
h2,
h3 {
  font-family: var(--font-head);
  font-weight: 600;
  line-height: 1.15;
  margin: 0;
}

p {
  margin: 0;
}

a {
  color: inherit;
  text-decoration: none;
}

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

.container {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: 1.5rem;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--color-dark);
  margin-bottom: 0.75rem;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-block;
  padding: 0.85rem 1.6rem;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.98rem;
  transition: transform 0.15s ease, background-color 0.2s ease, color 0.2s ease;
}

.btn:hover {
  transform: translateY(-2px);
}

.btn-primary {
  background: var(--color-dark);
  color: var(--color-cream);
}

.btn-primary:hover {
  background: var(--color-beige);
  color: var(--color-dark);
}

.btn-ghost {
  border: 1px solid var(--line);
  color: var(--ink);
  background: transparent;
}

.btn-ghost:hover {
  border-color: var(--color-dark);
  color: var(--color-dark);
}

.btn-ghost-light {
  border-color: color-mix(in srgb, var(--color-cream) 50%, transparent);
  color: var(--color-cream);
}

.btn-ghost-light:hover {
  border-color: var(--color-cream);
  background: color-mix(in srgb, var(--color-cream) 12%, transparent);
  color: var(--color-cream);
}

/* ---------- Header / Nav ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--color-cream) 85%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 72px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  font-weight: 600;
}

.brand-logo {
  height: 44px;
  width: 44px;
  flex: none;
  object-fit: contain;
  padding: 4px;
  border-radius: 10px;
  background: var(--color-dark);
}

.brand-name {
  font-family: var(--font-head);
  font-size: 1.05rem;
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.brand-tagline {
  font-size: 0.7rem;
  font-weight: 400;
  letter-spacing: 0.05em;
  color: var(--color-muted);
}

.footer-brand .brand-name {
  font-family: var(--font-head);
  font-size: 1.05rem;
}

.primary-nav ul {
  display: flex;
  align-items: center;
  gap: 1.75rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.primary-nav a {
  font-weight: 500;
  color: var(--ink-soft);
  transition: color 0.2s ease;
}

.primary-nav a:hover {
  color: var(--ink);
}

.primary-nav .nav-cta {
  padding: 0.55rem 1.2rem;
  border-radius: 999px;
  background: var(--ink);
  color: var(--color-cream);
}

.primary-nav .nav-cta:hover {
  background: var(--color-beige);
  color: var(--color-dark);
}

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  padding: 0;
  border: none;
  background: transparent;
  cursor: pointer;
}

.nav-toggle-bar {
  display: block;
  width: 24px;
  height: 2px;
  margin-inline: auto;
  background: var(--ink);
  transition: transform 0.25s ease, opacity 0.2s ease;
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  isolation: isolate;
  padding-block: clamp(5rem, 14vw, 9rem);
  color: var(--color-cream);
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  inset: 0;
  z-index: -1;
  background-image:
    linear-gradient(
      105deg,
      color-mix(in srgb, var(--color-dark) 92%, transparent) 0%,
      color-mix(in srgb, var(--color-dark) 78%, transparent) 42%,
      color-mix(in srgb, var(--color-dark) 45%, transparent) 100%
    ),
    url("images/hero-portrait.webp");
  background-size: cover, contain;
  background-repeat: no-repeat, no-repeat;
  background-position: center, right center;
  background-color: var(--color-dark);
}

.hero-inner {
  max-width: 720px;
}

.hero .eyebrow {
  color: var(--color-beige);
}

.hero h1 {
  font-size: clamp(2.5rem, 6vw, 4rem);
  margin-bottom: 1.25rem;
}

.hero-lead {
  font-size: 1.2rem;
  color: var(--color-cream);
  max-width: 56ch;
  margin-bottom: 2rem;
}

/* Show the full lead by default (desktop), hide the short variant */
.hero-lead-short {
  display: none;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

/* ---------- Sections ---------- */
.section {
  padding-block: var(--space);
}

.section-alt {
  background: var(--bg-alt);
}

.section-head {
  max-width: 620px;
  margin: 0 auto 3rem;
  text-align: center;
}

.section-head .section-sub {
  text-align: justify;
}

.section-head h2 {
  font-size: clamp(1.9rem, 4vw, 2.6rem);
  margin-bottom: 0.75rem;
}

.section-sub {
  color: var(--ink-soft);
  font-size: 1.1rem;
  text-align: justify;
}

.prose {
  max-width: 720px;
  margin: 0 auto;
}

.prose p {
  font-size: 1.075rem;
  line-height: 1.7;
  text-align: justify;
}

.prose p + p {
  margin-top: 1.25rem;
}

/* Abstand, wenn Karten direkt auf einen Fließtext folgen (z. B. MSA-Sektion) */
.prose + .cards {
  margin-top: 3rem;
}

/* ---------- Service cards ---------- */
.cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

.card {
  text-align: center;
  background: var(--surface-card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 2rem 1.75rem;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow);
}

.card-image {
  width: 150px;
  height: 150px;
  margin: 0 auto 1.25rem;
}

.card-image img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.card h3 {
  font-size: 1.35rem;
  margin-bottom: 0.6rem;
  text-align: center;
}

.card p {
  color: var(--ink-soft);
  margin-bottom: 1.25rem;
  text-align: center;
}

.card-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.5rem;
}

.card-list li {
  position: relative;
  padding-left: 1.4rem;
  font-size: 1rem;
  color: var(--ink-soft);
}

.card-list li::before {
  content: "✓";
  position: absolute;
  left: 0;
  color: var(--color-dark);
  font-weight: 700;
}

/* ---------- MSA® Zertifizierungs-Badge ---------- */
.msa-cert {
  margin-top: 3rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  text-align: center;
}

.msa-cert-logo {
  width: auto;
  height: auto;
  max-width: 300px;
  filter: drop-shadow(0 8px 20px color-mix(in srgb, var(--color-dark) 14%, transparent));
}

.msa-cert-caption {
  max-width: 42ch;
  color: var(--ink-soft);
  font-size: 0.95rem;
  letter-spacing: 0.01em;
}

/* ---------- Ablauf / Phasen ---------- */
.phases {
  list-style: none;
  margin: 0 auto;
  padding: 0;
  max-width: 760px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  /* Platz für die Pfeile zwischen den Karten */
  gap: 2.6rem;
}

.phase {
  position: relative;
  background: var(--surface-card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  transition: background-color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.phase.is-open {
  background: var(--surface);
  border-color: var(--color-dark);
  box-shadow: var(--shadow);
}

/* Verbindungslinie nach unten zwischen den Phasen */
.phase:not(:last-child)::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 100%;
  transform: translateX(-50%);
  width: 2px;
  height: 1.55rem;
  background: var(--color-graywarm);
}

/* Pfeilspitze am unteren Ende der Linie */
.phase:not(:last-child)::after {
  content: "";
  position: absolute;
  left: 50%;
  top: calc(100% + 1.35rem);
  transform: translateX(-50%) rotate(45deg);
  width: 10px;
  height: 10px;
  border-right: 2px solid var(--color-graywarm);
  border-bottom: 2px solid var(--color-graywarm);
}

.phase-toggle {
  display: flex;
  align-items: center;
  gap: 1rem;
  width: 100%;
  padding: 1.1rem 1.25rem;
  border: none;
  border-radius: var(--radius);
  background: transparent;
  text-align: left;
  cursor: pointer;
  font: inherit;
  color: var(--ink);
  transition: background-color 0.2s ease;
}

/* Bei geöffneter Phase die unteren Ecken des Buttons gerade lassen */
.phase.is-open .phase-toggle {
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
}

.phase-toggle:hover {
  background: color-mix(in srgb, var(--color-beige) 35%, transparent);
}

.phase-toggle:focus-visible {
  outline: 2px solid var(--color-dark);
  outline-offset: -2px;
}

.phase-marker {
  display: grid;
  place-items: center;
  flex: none;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--color-dark);
  color: var(--color-cream);
  font-family: var(--font-head);
  font-size: 1.1rem;
  font-weight: 600;
}

.phase-final .phase-marker {
  background: var(--color-beige);
  color: var(--color-dark);
}

.phase-heading {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  flex: 1;
}

.phase-title {
  font-family: var(--font-head);
  font-size: 1.2rem;
  font-weight: 600;
  line-height: 1.2;
}

.phase-subtitle {
  font-size: 0.95rem;
  color: var(--ink-soft);
}

.phase-chevron {
  flex: none;
  width: 12px;
  height: 12px;
  border-right: 2px solid var(--color-dark);
  border-bottom: 2px solid var(--color-dark);
  transform: rotate(45deg);
  transition: transform 0.25s ease;
  margin-right: 0.35rem;
}

.phase-toggle[aria-expanded="true"] .phase-chevron {
  transform: rotate(-135deg);
}

.phase-panel {
  padding: 0 1.25rem 1.25rem;
}

.phase-panel p {
  margin: 0;
  padding-left: calc(44px + 1rem);
  color: var(--ink-soft);
  font-size: 1.03rem;
  line-height: 1.7;
  text-align: justify;
}

@media (max-width: 560px) {
  .phase-panel p {
    padding-left: 0;
  }

  /* Blocksatz auf schmalen Viewports vermeiden (unschöne Wortabstände) */
  .section-sub,
  .section-head .section-sub,
  .prose p,
  .phase-panel p,
  .about-text p {
    text-align: left;
  }
}

/* ---------- About ---------- */
.about-inner {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: clamp(2rem, 5vw, 4rem);
  align-items: start;
}

.about-photo {
  width: 100%;
  aspect-ratio: 2 / 3;
  object-fit: cover;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  /* Bild beim Scrollen oben sichtbar halten, da der Text deutlich länger ist */
  position: sticky;
  top: 96px;
}

.about-text h2 {
  font-size: clamp(1.9rem, 4vw, 2.6rem);
  margin-bottom: 0.35rem;
}

.about-role {
  font-family: var(--font-head);
  font-size: 1.1rem;
  color: var(--ink-soft);
  margin: 0 0 1.25rem;
}

.about-lead {
  font-family: var(--font-head);
  font-size: 1.3rem;
  line-height: 1.4;
  color: var(--ink);
  margin-bottom: 1.25rem;
}

.about-text p {
  color: var(--ink-soft);
  margin-bottom: 1rem;
  text-align: justify;
}

.about-text h3 {
  font-size: 1.4rem;
  margin: 2rem 0 0.75rem;
}

.about-quote {
  margin: 1.75rem 0;
  padding: 0.25rem 0 0.25rem 1.25rem;
  border-left: 3px solid var(--color-beige);
  font-family: var(--font-head);
  font-size: 1.2rem;
  font-style: italic;
  line-height: 1.5;
  color: var(--ink);
}

/* ---------- Kontakt ---------- */
.contact-grid {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: clamp(2rem, 5vw, 3.5rem);
  align-items: start;
}

.contact-details h3,
.contact-form-wrap h3 {
  font-size: 1.35rem;
  margin-bottom: 1.25rem;
}

.contact-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 1.25rem;
}

.contact-label {
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-dark);
  margin-bottom: 0.25rem;
}

.contact-value {
  font-size: 1.05rem;
  font-style: normal;
  color: var(--ink);
}

a.contact-value:hover {
  color: var(--color-dark);
  text-decoration: underline;
}

.contact-form-wrap {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: clamp(1.5rem, 4vw, 2.25rem);
}

.contact-form {
  display: grid;
  gap: 1.25rem;
}

.form-field {
  display: grid;
  gap: 0.4rem;
}

.form-field label {
  font-weight: 600;
  color: var(--ink);
}

.form-field input,
.form-field textarea {
  width: 100%;
  min-height: 44px;
  padding: 0.65rem 0.85rem;
  font: inherit;
  color: var(--ink);
  background: var(--color-cream);
  border: 1px solid var(--color-graywarm);
  border-radius: 10px;
}

.form-field textarea {
  resize: vertical;
}

.form-field input:focus,
.form-field textarea:focus,
.consent-label input:focus-visible {
  outline: 2px solid var(--color-dark);
  outline-offset: 2px;
}

.form-field-consent {
  gap: 0.5rem;
}

.consent-label {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.6rem;
  align-items: start;
  font-weight: 400;
  line-height: 1.5;
  color: var(--ink);
}

.consent-label input {
  width: 22px;
  height: 22px;
  margin-top: 0.15rem;
  accent-color: var(--color-dark);
}

.consent-label a {
  color: var(--color-dark);
  text-decoration: underline;
}

.field-error {
  margin: 0;
  min-height: 1.2em;
  font-size: 0.88rem;
  color: var(--color-dark);
}

.field-error:empty {
  min-height: 0;
}

.form-status {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.85rem 1rem;
  margin-bottom: 1.25rem;
  color: var(--ink);
}

.form-status.is-success {
  background: var(--color-beige);
  border-color: var(--color-dark);
}

.form-status.is-error {
  background: var(--color-graywarm);
  border-color: var(--color-dark);
}

/* ---------- Footer ---------- */
.site-footer {
  background: var(--ink);
  color: var(--color-graywarm);
  padding-block: 2.5rem;
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  font-family: var(--font-head);
}

.footer-nav {
  display: flex;
  gap: 1.5rem;
}

.footer-nav a:hover {
  color: var(--color-cream);
}

.footer-copy {
  font-size: 0.85rem;
  color: var(--color-graywarm);
}

/* ---------- Legal pages ---------- */
.legal {
  padding-block: var(--space);
}

.legal .container {
  max-width: 760px;
}

.legal h1 {
  font-size: clamp(2rem, 5vw, 2.8rem);
  margin-bottom: 1.5rem;
}

.legal h2 {
  font-size: 1.3rem;
  margin: 2rem 0 0.5rem;
}

.legal p,
.legal address {
  color: var(--ink-soft);
  font-style: normal;
  margin-bottom: 0.75rem;
}

.back-link {
  display: inline-block;
  margin-top: 2.5rem;
  color: var(--color-dark);
  font-weight: 600;
}

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
  .cards {
    grid-template-columns: 1fr;
    max-width: 460px;
    margin-inline: auto;
  }

  .about-inner {
    grid-template-columns: 1fr;
  }

  .about-photo {
    position: static;
  }

  .about-media {
    max-width: 360px;
  }

  .contact-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 767px) {
  .nav-toggle {
    display: flex;
  }

  /* Swap to the shortened hero lead on mobile */
  .hero-lead-full {
    display: none;
  }

  .hero-lead-short {
    display: inline;
  }

  .primary-nav {
    position: absolute;
    top: 72px;
    left: 0;
    right: 0;
    background: var(--bg);
    border-bottom: 1px solid var(--line);
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
  }

  .primary-nav.open {
    max-height: min(80vh, 600px);
    overflow-y: auto;
  }

  .primary-nav ul {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 0.5rem 1.5rem 1.25rem;
  }

  .primary-nav li {
    border-bottom: 1px solid var(--line);
  }

  .primary-nav li:last-child {
    border-bottom: none;
  }

  .primary-nav a {
    display: flex;
    align-items: center;
    /* Touch-Ziel mindestens 44px hoch (Req 4.5) */
    min-height: 44px;
    padding: 0.9rem 0;
  }

  .primary-nav .nav-cta {
    margin-top: 0.75rem;
    justify-content: center;
    text-align: center;
  }

  .nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
  }

  .nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(2) {
    opacity: 0;
  }

  .nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
  }
}
