/* ==========================================================================
   KAG Vertretungsplan – Support-Website
   Designsystem „Stundenraster“. Reines CSS, kein JavaScript.
   Schriften selbst gehostet unter /fonts (SIL Open Font License).
   ========================================================================== */

@font-face {
  font-family: "Instrument Sans";
  src: url("/fonts/instrument-sans.woff2") format("woff2");
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Source Serif 4";
  src: url("/fonts/source-serif-4.woff2") format("woff2");
  font-weight: 200 900;
  font-style: normal;
  font-display: swap;
}

/* --------------------------------------------------------------------------
   1. Tokens
   -------------------------------------------------------------------------- */

:root {
  color-scheme: light dark;

  /* Farbe – hell */
  --paper: #f5efe2;          /* Seite, wie der Hintergrund der App */
  --paper-raised: #fbf8f1;   /* erhöhte Flächen */
  --ink: #172126;            /* Text */
  --ink-muted: #56646a;      /* Nebentext */
  --petrol: #1f6b67;         /* Links, Akzent */
  --petrol-deep: #0f4b49;    /* Hover, Hauptknopf */
  --mint: #d8ece8;           /* zarter Akzent */
  --signal: #9a4a0b;         /* sehr sparsam: Hervorhebung wie „noch offen“ */
  --line: rgba(23, 33, 38, 0.1);
  --line-strong: rgba(23, 33, 38, 0.2);
  --raster: rgba(23, 33, 38, 0.06);

  --on-accent: #ffffff;      /* Text auf Hauptknopf */
  --band: #172126;           /* dunkles Band */
  --band-ink: #eef2f1;
  --band-muted: #a9b6ba;
  --band-accent: #8fd3cb;

  --bezel: #0e1416;          /* Handyrahmen */
  --focus: #0f4b49;

  /* Schrift */
  --font-sans: "Instrument Sans", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --font-serif: "Source Serif 4", "Iowan Old Style", "Palatino Linotype", Georgia, serif;

  --step--1: 0.875rem;
  --step-0: 1.0625rem;
  --step-1: clamp(1.125rem, 1.05rem + 0.35vw, 1.3125rem);
  --step-2: clamp(1.375rem, 1.2rem + 0.8vw, 1.75rem);
  --step-3: clamp(1.75rem, 1.35rem + 1.7vw, 2.75rem);
  --step-4: clamp(2.25rem, 1.5rem + 3.4vw, 4.5rem);
  --step-5: clamp(2.5rem, 1.4rem + 5.2vw, 6.25rem);

  /* Abstände */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.5rem;
  --space-6: 2rem;
  --space-7: 3rem;
  --space-8: clamp(3.5rem, 2.5rem + 4vw, 6rem);
  --space-9: clamp(5rem, 3rem + 8vw, 10rem);

  /* Radien */
  --radius-s: 6px;
  --radius-m: 14px;
  --radius-l: 28px;
  --radius-pill: 999px;
  --radius-phone: 2.9rem;

  /* Schatten */
  --shadow-1: 0 1px 2px rgba(23, 33, 38, 0.06), 0 6px 18px rgba(23, 33, 38, 0.06);
  --shadow-device: 0 2px 4px rgba(23, 33, 38, 0.08), 0 30px 60px -20px rgba(23, 33, 38, 0.35), 0 60px 120px -40px rgba(15, 75, 73, 0.25);

  /* Raster */
  --page: 76rem;
  --measure: 38rem;
  --gutter: clamp(1rem, 4vw, 2.5rem);
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #12191b;
    --paper-raised: #182225;
    --ink: #e6ecec;
    --ink-muted: #9cabb0;
    --petrol: #8fd3cb;
    --petrol-deep: #b5e6df;
    --mint: #1d3634;
    --signal: #f0a35e;
    --line: rgba(255, 255, 255, 0.1);
    --line-strong: rgba(255, 255, 255, 0.2);
    --raster: rgba(255, 255, 255, 0.05);

    --on-accent: #0b1213;
    --band: #0a0f10;
    --band-ink: #e6ecec;
    --band-muted: #9cabb0;
    --band-accent: #8fd3cb;

    --bezel: #2a3336;
    --focus: #8fd3cb;

    --shadow-1: 0 1px 2px rgba(0, 0, 0, 0.4), 0 6px 18px rgba(0, 0, 0, 0.3);
    --shadow-device: 0 2px 4px rgba(0, 0, 0, 0.4), 0 30px 60px -20px rgba(0, 0, 0, 0.7), 0 60px 120px -40px rgba(143, 211, 203, 0.12);
  }
}

/* --------------------------------------------------------------------------
   2. Grundlagen
   -------------------------------------------------------------------------- */

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: 5rem;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: var(--step-0);
  line-height: 1.6;
  font-kerning: normal;
  overflow-wrap: break-word;
  overflow-x: clip;
}

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

img {
  max-width: 100%;
  height: auto;
}

a {
  color: var(--petrol);
  text-decoration-line: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
}

a:hover {
  color: var(--petrol-deep);
  text-decoration-thickness: 2px;
}

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

h1,
h2,
h3 {
  margin: 0;
  text-wrap: balance;
}

h1,
h2 {
  font-family: var(--font-sans);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.02;
}

h1 {
  font-size: var(--step-4);
  hyphens: auto;
}

h2 {
  font-size: var(--step-3);
  line-height: 1.08;
}

h3 {
  font-size: var(--step-1);
  font-weight: 650;
  letter-spacing: -0.01em;
  line-height: 1.3;
}

p,
ul,
ol,
dl,
address {
  margin: 0;
}

* + p,
* + ul,
* + ol,
* + dl,
* + address,
* + .table {
  margin-top: 0.9em;
}

ul,
ol {
  padding-left: 1.25em;
}

li + li {
  margin-top: 0.35em;
}

li::marker {
  color: var(--ink-muted);
}

address {
  font-style: normal;
}

strong {
  font-weight: 650;
}

code {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.9em;
}

.muted {
  color: var(--ink-muted);
}

.small {
  font-size: 0.9375rem;
}

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

.eyebrow {
  margin: 0 0 var(--space-4);
  color: var(--petrol);
  font-size: var(--step--1);
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.lead {
  font-family: var(--font-serif);
  font-size: var(--step-1);
  line-height: 1.5;
}

.meta {
  margin-top: var(--space-3);
  color: var(--ink-muted);
  font-size: 0.9375rem;
}

.wrap {
  max-width: var(--page);
  margin: 0 auto;
  padding-left: var(--gutter);
  padding-right: var(--gutter);
}

/* --------------------------------------------------------------------------
   3. Komponenten
   -------------------------------------------------------------------------- */

/* Sprunglink */
.skip-link {
  position: absolute;
  left: 1rem;
  top: -4rem;
  padding: 0.5rem 0.9rem;
  background: var(--paper-raised);
  color: var(--petrol-deep);
  font-weight: 600;
  z-index: 20;
}

.skip-link:focus {
  top: 1rem;
}

/* Navigation */
.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--paper);
  border-bottom: 1px solid var(--line);
}

.site-header .wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2) var(--space-6);
  min-height: 3.5rem;
  padding-top: var(--space-2);
  padding-bottom: var(--space-2);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  color: var(--ink);
  font-weight: 650;
  letter-spacing: -0.01em;
  text-decoration: none;
}

.brand:hover {
  color: var(--ink);
}

.brand img {
  display: block;
  width: 1.5rem;
  height: 1.5rem;
}

.site-nav {
  margin-left: auto;
}

.site-nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.15rem 1.1rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.site-nav li + li {
  margin-top: 0;
}

.site-nav a {
  display: inline-block;
  padding: 0.3rem 0;
  color: var(--ink);
  font-size: 0.9375rem;
  text-decoration: none;
}

.site-nav a:hover {
  color: var(--petrol-deep);
  text-decoration: underline;
}

.site-nav a[aria-current="page"] {
  color: var(--petrol);
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 0.4em;
}

.header-cta {
  padding: 0.35rem 0.85rem;
  font-size: 0.875rem;
}

/* Menü-Knopf (nur auf dem Handy und nur mit JavaScript sichtbar) */
.menu-button {
  display: none;
  flex: none;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  padding: 0;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
}

.menu-button:hover {
  border-color: var(--ink-muted);
}

.menu-icon,
.menu-icon::before,
.menu-icon::after {
  display: block;
  width: 1.05rem;
  height: 2px;
  border-radius: 2px;
  background: currentColor;
}

.menu-icon {
  position: relative;
  background: transparent;
}

.menu-icon::before,
.menu-icon::after {
  content: "";
  position: absolute;
  left: 0;
}

.menu-icon::before {
  top: -3px;
}

.menu-icon::after {
  top: 3px;
}

.menu-open .menu-icon::before {
  top: 0;
  transform: rotate(45deg);
}

.menu-open .menu-icon::after {
  top: 0;
  transform: rotate(-45deg);
}

@media (max-width: 47.99rem) {
  .site-header {
    position: relative;
  }
  .site-header .wrap {
    flex-wrap: nowrap;
    gap: var(--space-2);
  }
  .brand {
    min-width: 0;
    margin-right: auto;
    gap: 0.4rem;
    font-size: 0.9375rem;
    letter-spacing: -0.015em;
    white-space: nowrap;
  }
  .brand-name {
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .header-cta {
    flex: none;
    order: 1;
    padding: 0.4rem 0.75rem;
    font-size: 0.8125rem;
  }
  .menu-button {
    order: 2;
  }

  /* ohne JavaScript: Links in einer eigenen Zeile wie bisher */
  html:not(.js-nav) .site-header .wrap {
    flex-wrap: wrap;
  }
  html:not(.js-nav) .site-nav {
    order: 3;
    flex-basis: 100%;
    margin-left: 0;
  }

  /* mit JavaScript: aufklappbares Menü */
  .js-nav .menu-button {
    display: inline-flex;
    width: 2.5rem;
    height: 2.5rem;
  }
  /* schmale Geräte: Logo-Symbol weglassen, damit der Name ganz hineinpasst */
  @media (max-width: 24.37rem) {
    .js-nav .brand img {
      display: none;
    }
  }
  /* sehr schmale Geräte: oben nur Schriftzug und Menü, „App öffnen“ steht groß im Inhalt */
  @media (max-width: 22.37rem) {
    .js-nav .header-cta {
      display: none;
    }
  }
  .js-nav .site-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 9;
    margin: 0;
    padding: var(--space-2) var(--gutter) var(--space-6);
    background: var(--paper);
    border-bottom: 1px solid var(--line);
    box-shadow: 0 24px 40px -24px rgba(0, 0, 0, 0.35);
  }
  .js-nav .menu-open .site-nav {
    display: block;
  }
  .js-nav .site-nav ul {
    display: block;
  }
  .js-nav .site-nav li + li {
    border-top: 1px solid var(--line);
  }
  .js-nav .site-nav a {
    display: block;
    padding: 0.9rem 0;
    font-size: var(--step-2);
    font-weight: 650;
    letter-spacing: -0.02em;
    text-decoration: none;
  }
  .js-nav .site-nav a[aria-current="page"] {
    color: var(--petrol);
    text-decoration: none;
  }
  .js-nav .site-nav a[aria-current="page"]::after {
    content: " ·";
  }
}

/* Knöpfe */
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4em;
  padding: 0.8rem 1.4rem;
  border-radius: var(--radius-pill);
  background: var(--petrol-deep);
  color: var(--on-accent);
  font-weight: 650;
  line-height: 1.2;
  text-decoration: none;
}

.button:hover {
  background: var(--petrol);
  color: var(--on-accent);
}

@media (prefers-color-scheme: dark) {
  .button {
    background: var(--petrol);
  }
  .button:hover {
    background: var(--petrol-deep);
  }
}

.button--large {
  padding: 1rem 1.75rem;
  font-size: var(--step-1);
}

.link-arrow {
  font-weight: 600;
  text-decoration: none;
}

.link-arrow::after {
  content: " ›";
}

.link-arrow:hover {
  text-decoration: underline;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-4) var(--space-6);
  margin-top: var(--space-6);
}

/* Karte (sparsam: Installations-Anleitung) */
.card {
  padding: var(--space-5);
  border-radius: var(--radius-l);
  background: var(--paper-raised);
  border: 1px solid var(--line);
}

/* Hinweisbox */
.notice,
.note {
  padding: var(--space-4) var(--space-5);
  border-left: 3px solid var(--petrol);
  border-radius: 0 var(--radius-m) var(--radius-m) 0;
  background: var(--paper-raised);
}

/* Akkordeon (ohne JavaScript) */
.faq {
  border-top: 1px solid var(--line-strong);
}

.faq details {
  border-bottom: 1px solid var(--line);
}

.faq summary {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: var(--space-4);
  padding: var(--space-4) 0;
  cursor: pointer;
  list-style: none;
  font-size: var(--step-1);
  font-weight: 600;
  letter-spacing: -0.01em;
}

.faq summary::-webkit-details-marker {
  display: none;
}

.faq summary::after {
  content: "+";
  flex: none;
  color: var(--petrol);
  font-size: 1.5rem;
  font-weight: 400;
  line-height: 1;
}

.faq details[open] summary::after {
  content: "–";
}

.faq summary:hover {
  color: var(--petrol-deep);
}

.faq .answer {
  max-width: var(--measure);
  padding-bottom: var(--space-5);
  color: var(--ink);
}

/* Geräte */
.phone {
  position: relative;
  width: var(--phone-w, 17.5rem);
  padding: 0.6rem;
  border-radius: var(--radius-phone);
  background: var(--bezel);
  box-shadow: var(--shadow-device), inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.phone picture,
.phone img {
  display: block;
  width: 100%;
  border-radius: calc(var(--radius-phone) - 0.6rem);
  background: var(--paper-raised);
}

.browser {
  overflow: hidden;
  border-radius: var(--radius-m);
  background: var(--paper-raised);
  border: 1px solid var(--line-strong);
  box-shadow: var(--shadow-device);
}

.browser-bar {
  padding: 0.45rem 1rem;
  border-bottom: 1px solid var(--line);
  color: var(--ink-muted);
  font-size: 0.8125rem;
  text-align: center;
}

.browser picture,
.browser img {
  display: block;
  width: 100%;
  background: var(--paper);
}

/* Stundenmarke wie in der App */
.lesson {
  display: inline-grid;
  place-items: center;
  width: 4.25rem;
  height: 4.25rem;
  border-radius: var(--radius-m);
  background: var(--mint);
  color: var(--petrol-deep);
  line-height: 1;
}

.lesson small {
  font-size: 0.6875rem;
  font-weight: 650;
  letter-spacing: 0.14em;
}

.lesson span {
  margin-top: -0.6rem;
  font-family: var(--font-serif);
  font-size: 2rem;
  font-weight: 600;
}

/* Fuß */
.site-footer {
  border-top: 1px solid var(--line);
  color: var(--ink-muted);
  font-size: 0.9375rem;
}

.site-footer .wrap {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: var(--space-3) var(--space-6);
  padding-top: var(--space-6);
  padding-bottom: var(--space-7);
}

.site-footer p {
  max-width: 34rem;
}

.site-footer ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.25rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.site-footer li + li {
  margin-top: 0;
}

.site-footer a {
  color: var(--ink-muted);
}

.site-footer a:hover {
  color: var(--ink);
}

/* --------------------------------------------------------------------------
   4. Startseite
   -------------------------------------------------------------------------- */

/* Einstieg mit Stundenraster im Hintergrund */
.hero {
  position: relative;
  overflow-x: clip;
  padding-top: var(--space-8);
  padding-bottom: var(--space-8);
  background-image:
    linear-gradient(to bottom, var(--raster) 1px, transparent 1px);
  background-size: 100% 4.5rem;
  background-position: 0 2.25rem;
}

.hero::before {
  /* Zeitachse links, wie die Stundenspalte im Plan */
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: max(var(--gutter), calc((100% - var(--page)) / 2 + var(--gutter)));
  width: 1px;
  background: var(--line);
  pointer-events: none;
}

.hero-grid {
  position: relative;
  display: grid;
  gap: var(--space-8) var(--space-6);
}

.hero-text {
  padding-left: clamp(0rem, 2vw, 1.5rem);
}

.hero h1 {
  font-size: clamp(2.4rem, 1rem + 4.6vw, 4.6rem);
  letter-spacing: -0.04em;
  line-height: 0.98;
  hyphens: manual;
}

.hero h1 .continue {
  display: block;
  color: var(--ink-muted);
}

.hero .lead {
  margin-top: var(--space-6);
  max-width: 32rem;
}

.hero-facts {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2) var(--space-5);
  margin-top: var(--space-6);
  padding: 0;
  list-style: none;
  color: var(--ink-muted);
  font-size: 0.9375rem;
}

.hero-facts li + li {
  margin-top: 0;
}

.hero-facts li::before {
  content: "";
  display: inline-block;
  width: 0.45rem;
  height: 0.45rem;
  margin-right: 0.5rem;
  border-radius: 50%;
  background: var(--petrol);
  vertical-align: 0.1em;
}

.hero-stage {
  position: relative;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  min-height: 30rem;
  perspective: 1800px;
}

.hero-stage .phone {
  --phone-w: clamp(10.5rem, 44vw, 18rem);
}

.hero-stage .phone--back {
  position: absolute;
  top: 0;
  left: 47%;
  transform: translateX(-2%) translateY(-1.5rem) rotateY(-24deg) rotateX(6deg) rotateZ(4deg);
  opacity: 0.96;
}

.hero-stage .phone--front {
  position: relative;
  margin-top: 3.5rem;
  transform: translateX(-28%) rotateY(18deg) rotateX(4deg) rotateZ(-3deg);
}

@media (min-width: 62rem) {
  .hero-grid {
    grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
    align-items: center;
  }
  .hero-stage {
    min-height: 40rem;
  }
}

/* Abschnitte */
.section {
  padding-top: var(--space-9);
  padding-bottom: var(--space-9);
}

.section + .section {
  border-top: 1px solid var(--line);
}

.section-head {
  max-width: 44rem;
  margin-bottom: var(--space-8);
}

.section-head .lead {
  margin-top: var(--space-5);
  color: var(--ink-muted);
}

/* Schritte: Stunde für Stunde */
.steps {
  margin: 0;
  padding: 0;
  list-style: none;
}

.step {
  display: grid;
  gap: var(--space-7);
  align-items: center;
}

.step + .step {
  margin-top: var(--space-9);
}

.step-text {
  max-width: 30rem;
}

.step-text h3 {
  margin-top: var(--space-5);
  font-size: var(--step-3);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.05;
}

.step-text p {
  margin-top: var(--space-4);
  font-size: var(--step-1);
  line-height: 1.5;
  color: var(--ink-muted);
}

.step-text p strong {
  color: var(--ink);
}

.step-media {
  display: flex;
  justify-content: center;
  perspective: 1600px;
}

.step-media .phone {
  --phone-w: clamp(14rem, 60vw, 19rem);
  transform: rotateY(var(--ry-end, -8deg)) rotateX(3deg);
}

.step:nth-child(even) .step-media .phone {
  --ry-end: 8deg;
}

@media (min-width: 56rem) {
  .step {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: var(--space-8);
  }
  .step:nth-child(even) .step-text {
    order: 2;
  }
  .step:nth-child(odd) .step-text {
    justify-self: end;
  }
}

/* Dunkles Band (Desktop-Schritt) */
.band {
  margin-top: var(--space-9);
  padding: var(--space-9) 0;
  background: var(--band);
  color: var(--band-ink);
}

.band .lesson {
  background: rgba(143, 211, 203, 0.16);
  color: var(--band-accent);
}

.band .step-text {
  max-width: 40rem;
}

.band .step-text p {
  color: var(--band-muted);
}

.band .step-text p strong {
  color: var(--band-ink);
}

.band .step-media {
  margin-top: var(--space-8);
  perspective: 2400px;
}

.band .browser {
  width: min(100%, 64rem);
  transform: rotateX(12deg);
  transform-origin: 50% 100%;
}

.band + .wrap {
  padding-top: var(--space-9);
}

/* Installation */
.install {
  display: grid;
  gap: var(--space-4);
  margin: 0;
  padding: 0;
  list-style: none;
}

.install > li + li {
  margin-top: 0;
}

.install h3 {
  font-size: var(--step-2);
  font-weight: 700;
  letter-spacing: -0.02em;
}

.install ol {
  margin-top: var(--space-4);
  padding-left: 1.2em;
}

@media (min-width: 56rem) {
  .install {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .install > li:first-child {
    grid-row: span 1;
  }
}

/* FAQ und Kontakt nebeneinander */
.split {
  display: grid;
  gap: var(--space-8);
}

@media (min-width: 62rem) {
  .split {
    grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr);
    column-gap: var(--space-8);
  }
}

.contact h2 {
  font-size: var(--step-2);
  letter-spacing: -0.02em;
}

.contact > * + h2 {
  margin-top: var(--space-7);
}

.contact .mail {
  display: inline-block;
  margin-top: var(--space-3);
  font-size: var(--step-1);
  font-weight: 600;
}

/* --------------------------------------------------------------------------
   5. Bewegung – nur wenn erlaubt und vom Browser unterstützt
   -------------------------------------------------------------------------- */

@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }

  a,
  .button,
  .faq summary {
    transition: color 0.15s ease, background-color 0.15s ease, text-decoration-thickness 0.15s ease;
  }

  .menu-icon::before,
  .menu-icon::after {
    transition: transform 0.2s ease, top 0.2s ease;
  }

  .js-nav .menu-open .site-nav {
    animation: menu-in 0.18s ease-out;
  }

  @keyframes menu-in {
    from {
      opacity: 0;
      transform: translateY(-0.5rem);
    }
  }

  @supports (animation-timeline: view()) {
    .hero-stage .phone--front {
      animation: hero-front linear both;
      animation-timeline: scroll(root);
      animation-range: 0 80vh;
    }

    .hero-stage .phone--back {
      animation: hero-back linear both;
      animation-timeline: scroll(root);
      animation-range: 0 80vh;
    }

    .step-media .phone {
      animation: settle linear both;
      animation-timeline: view();
      animation-range: entry 0% cover 45%;
    }

    .band .browser {
      animation: unfold linear both;
      animation-timeline: view();
      animation-range: entry 0% cover 50%;
    }
  }
}

/* Dasselbe für Browser ohne CSS-Scroll-Animationen: motion.js setzt --p (0 bis 1) */
@media (prefers-reduced-motion: no-preference) {
  .js-motion .hero-stage .phone--front {
    transform:
      translateX(calc(-28% - 2% * var(--p, 0)))
      translateY(calc(-1rem * var(--p, 0)))
      rotateY(calc(18deg - 14deg * var(--p, 0)))
      rotateX(calc(4deg - 4deg * var(--p, 0)))
      rotateZ(calc(-3deg + 2deg * var(--p, 0)));
  }

  .js-motion .hero-stage .phone--back {
    transform:
      translateX(calc(-2% + 6% * var(--p, 0)))
      translateY(calc(-1.5rem - 1.5rem * var(--p, 0)))
      rotateY(calc(-24deg + 16deg * var(--p, 0)))
      rotateX(calc(6deg - 4deg * var(--p, 0)))
      rotateZ(calc(4deg - 2deg * var(--p, 0)));
  }

  .js-motion .step-media .phone {
    transform:
      translateY(calc(3rem * (1 - var(--p, 1))))
      rotateY(calc(var(--ry-end, -8deg) * (3 - 2 * var(--p, 1))))
      rotateX(calc(14deg - 11deg * var(--p, 1)));
    will-change: transform;
  }

  .js-motion .band .browser {
    transform: rotateX(calc(38deg * (1 - var(--p, 1)))) scale(calc(0.92 + 0.08 * var(--p, 1)));
    will-change: transform;
  }
}

@keyframes hero-front {
  to {
    transform: translateX(-30%) translateY(-1rem) rotateY(4deg) rotateX(0deg) rotateZ(-1deg);
  }
}

@keyframes hero-back {
  to {
    transform: translateX(4%) translateY(-3rem) rotateY(-8deg) rotateX(2deg) rotateZ(2deg);
  }
}

@keyframes settle {
  from {
    transform: translateY(3rem) rotateY(calc(var(--ry-end, -8deg) * 3)) rotateX(14deg);
  }
  to {
    transform: rotateY(var(--ry-end, -8deg)) rotateX(3deg);
  }
}

@keyframes unfold {
  from {
    transform: rotateX(38deg) scale(0.92);
  }
  to {
    transform: rotateX(0deg) scale(1);
  }
}

/* Bewegung reduziert: alles flach und ruhig */
@media (prefers-reduced-motion: reduce) {
  .hero-stage .phone--back,
  .hero-stage .phone--front,
  .step-media .phone,
  .band .browser {
    transform: none;
  }
  .hero-stage .phone--front {
    transform: translateX(-24%);
  }
  .hero-stage .phone--back {
    transform: translateX(4%) translateY(-2rem);
  }
}

/* --------------------------------------------------------------------------
   6. Textseiten (Hilfe, Datenschutz, Impressum)
   -------------------------------------------------------------------------- */

.page {
  max-width: var(--page);
  margin: 0 auto;
  padding: var(--space-8) var(--gutter) var(--space-9);
}

.page-head {
  max-width: 46rem;
}

.page-head h1 {
  font-size: var(--step-4);
}

.page-head .lead {
  margin-top: var(--space-5);
}

.page-head + .prose,
.page-head + .actions {
  margin-top: var(--space-7);
}

.prose {
  max-width: var(--measure);
}

.prose > section {
  margin-top: var(--space-7);
  padding-top: var(--space-7);
  border-top: 1px solid var(--line);
}

.prose > :first-child {
  margin-top: 0;
}

.prose h2 {
  font-size: var(--step-2);
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.prose h2 + *,
.prose h3 + * {
  margin-top: 0.6rem;
}

.prose h3 {
  font-size: var(--step-0);
}

.prose * + h3 {
  margin-top: 1.75rem;
}

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

.prose * + .note {
  margin-top: 1.1em;
}

.section-no {
  display: block;
  margin-bottom: 0.35rem;
  color: var(--petrol);
  font-family: var(--font-serif);
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0;
}

.summary {
  padding: var(--space-5);
  border-radius: var(--radius-l);
  background: var(--paper-raised);
  border: 1px solid var(--line);
}

.prose > section.summary {
  border-top: 1px solid var(--line);
}

.terms dt {
  font-weight: 650;
}

.terms dd {
  margin: 0.15rem 0 0;
}

.terms dd + dt {
  margin-top: 0.9rem;
}

/* Seiten mit Inhaltsverzeichnis */
.with-toc {
  margin-top: var(--space-7);
}

.toc {
  padding: var(--space-5) 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  font-size: 0.9375rem;
}

.toc h2 {
  font-size: var(--step--1);
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--petrol);
}

.toc ol {
  margin-top: var(--space-3);
  padding: 0;
  list-style: none;
  columns: 2 12rem;
  column-gap: var(--space-6);
}

.toc li {
  break-inside: avoid;
}

.toc li + li {
  margin-top: 0.1rem;
}

.toc a {
  display: inline-block;
  padding: 0.2rem 0;
  color: var(--ink);
  line-height: 1.4;
  text-decoration: none;
}

.toc a:hover {
  color: var(--petrol-deep);
  text-decoration: underline;
}

.with-toc .prose {
  margin-top: var(--space-7);
}

.with-toc .prose > section:first-child {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}

.with-toc .prose > section.summary:first-child {
  padding-top: var(--space-5);
  border-top: 1px solid var(--line);
}

@media (min-width: 62rem) {
  .with-toc {
    display: grid;
    grid-template-columns: 15rem minmax(0, var(--measure));
    column-gap: clamp(3rem, 7vw, 7rem);
    align-items: start;
  }

  .toc {
    position: sticky;
    top: 5rem;
    max-height: calc(100vh - 6rem);
    overflow-y: auto;
    padding: 0;
    border: 0;
  }

  .toc ol {
    columns: auto;
    padding-left: var(--space-4);
    border-left: 1px solid var(--line);
  }

  .with-toc .prose {
    margin-top: 0;
  }
}

/* Tabelle (Datenschutz) */
.table table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9375rem;
  line-height: 1.5;
}

.table caption {
  padding-bottom: 0.5rem;
  color: var(--ink-muted);
  text-align: left;
}

.table th,
.table td {
  padding: 0.6rem 0.75rem 0.6rem 0;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.table thead th {
  font-weight: 650;
  border-bottom-color: var(--line-strong);
}

@media (max-width: 40rem) {
  .table thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
  }
  .table caption {
    display: block;
  }
  .table table,
  .table tbody,
  .table tr,
  .table td {
    display: block;
  }
  .table tr {
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--line);
  }
  .table td {
    padding: 0.1rem 0;
    border: 0;
  }
  .table td:first-child {
    font-weight: 650;
  }
  .table td[data-label]:not(:first-child)::before {
    content: attr(data-label) ": ";
    color: var(--ink-muted);
  }
}

/* Platzhalter für künftige Lücken (sollte im veröffentlichten Text nicht vorkommen) */
.ph {
  background: #ffe9a8;
  color: #4a3500;
}

/* --------------------------------------------------------------------------
   7. Druck
   -------------------------------------------------------------------------- */

@media print {
  .site-header,
  .skip-link,
  .toc,
  .actions,
  .hero-stage,
  .step-media {
    display: none;
  }
  body {
    background: #fff;
    color: #000;
    font-size: 11pt;
  }
  a {
    color: #000;
  }
  .with-toc,
  .split,
  .step {
    display: block;
  }
  .band {
    background: none;
    color: #000;
  }
}

.page-head + .summary {
  max-width: 46rem;
  margin-top: var(--space-6);
}

/* --------------------------------------------------------------------------
   8. Kontaktseite
   -------------------------------------------------------------------------- */

.badge {
  display: inline-block;
  padding: 0.2rem 0.65rem;
  border-radius: var(--radius-pill);
  background: var(--mint);
  color: var(--petrol-deep);
  font-size: 0.8125rem;
  font-weight: 650;
  letter-spacing: 0.02em;
}

.contact-app {
  display: grid;
  gap: var(--space-7);
  margin-top: var(--space-7);
  padding: clamp(1.5rem, 4vw, 3.5rem) clamp(1.25rem, 4vw, 3.5rem) 0;
  overflow: hidden;
  border-radius: calc(var(--radius-l) * 1.3);
  background: var(--paper-raised);
  border: 1px solid var(--line);
}

.contact-app-text {
  max-width: 34rem;
  padding-bottom: 0;
}

.contact-app-text h2 {
  margin-top: var(--space-4);
}

.contact-app-text > p {
  margin-top: var(--space-4);
  font-size: var(--step-1);
  line-height: 1.5;
  color: var(--ink-muted);
}

.path {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2) var(--space-3);
  margin-top: var(--space-5);
  padding: 0;
  list-style: none;
  counter-reset: path;
}

.path li {
  counter-increment: path;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0;
  font-weight: 600;
}

.path li::before {
  content: counter(path);
  display: inline-grid;
  place-items: center;
  width: 1.6rem;
  height: 1.6rem;
  border-radius: 50%;
  background: var(--petrol-deep);
  color: var(--on-accent);
  font-size: 0.8125rem;
}

@media (prefers-color-scheme: dark) {
  .path li::before {
    background: var(--petrol);
  }
}

.path li + li::after {
  content: none;
}

.path li:not(:last-child)::after {
  content: "→";
  margin-left: 0.25rem;
  color: var(--ink-muted);
  font-weight: 400;
}

.contact-app-media {
  display: flex;
  justify-content: center;
  align-items: flex-end;
}

.contact-app-media .phone {
  --phone-w: clamp(13rem, 60vw, 17rem);
  margin-bottom: -6rem;
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
}

.contact-app-text .actions {
  margin-bottom: var(--space-2);
}

@media (min-width: 56rem) {
  .contact-app {
    grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr);
    align-items: center;
  }
  .contact-app-text {
    padding-bottom: clamp(1.5rem, 4vw, 3.5rem);
  }
  .contact-app-media {
    align-self: end;
  }
}

/* Formular */
.contact-form {
  display: grid;
  gap: var(--space-6);
  margin-top: var(--space-8);
  padding-top: var(--space-8);
  border-top: 1px solid var(--line);
}

.contact-form-intro {
  max-width: 26rem;
}

.contact-form-intro p {
  margin-top: var(--space-4);
}

@media (min-width: 56rem) {
  .contact-form {
    grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.4fr);
    column-gap: var(--space-8);
    align-items: start;
  }
  .contact-form .form-status {
    grid-column: 2;
  }
}

.form {
  display: grid;
  gap: var(--space-5);
  max-width: 40rem;
}

.form label,
.choice legend {
  display: block;
  font-weight: 650;
}

.choice {
  margin: 0;
  padding: 0;
  border: 0;
  min-width: 0;
}

.choice legend {
  padding: 0;
  margin-bottom: var(--space-3);
}

.choice-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-2);
}

.choice-options label {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.75rem 0.9rem;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-m);
  background: var(--paper-raised);
  font-weight: 550;
  line-height: 1.3;
  cursor: pointer;
}

.choice-options label:hover {
  border-color: var(--petrol);
}

.choice-options label:has(input:checked) {
  border-color: var(--petrol);
  background: var(--mint);
}

.choice-options input,
.form input[type="checkbox"] {
  flex: none;
  width: 1.1rem;
  height: 1.1rem;
  margin: 0;
  accent-color: var(--petrol-deep);
}

@media (prefers-color-scheme: dark) {
  .choice-options input {
    accent-color: var(--petrol);
  }
}

.field label {
  margin-bottom: var(--space-2);
}

.optional {
  color: var(--ink-muted);
  font-weight: 400;
}

.field input,
.field textarea {
  display: block;
  width: 100%;
  padding: 0.8rem 1rem;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-m);
  background: var(--paper-raised);
  color: var(--ink);
  font: inherit;
  line-height: 1.5;
}

.field textarea {
  min-height: 9rem;
  resize: vertical;
}

.field input:hover,
.field textarea:hover {
  border-color: var(--ink-muted);
}

.field input:focus-visible,
.field textarea:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 1px;
  border-color: var(--focus);
}

.field-hint,
.form-note {
  margin-top: var(--space-2);
  color: var(--ink-muted);
  font-size: 0.875rem;
  line-height: 1.5;
}

.form-note {
  margin-top: 0;
}

.form .button {
  justify-self: start;
  border: 0;
  cursor: pointer;
  font-family: inherit;
}

.form .button:disabled {
  opacity: 0.6;
  cursor: progress;
}

.honeypot {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.form-status {
  max-width: 40rem;
  margin: 0;
}

.form-status:empty {
  display: none;
}

.form-status--info {
  color: var(--ink-muted);
}

.form-status--ok,
.form-status--error {
  padding: var(--space-4) var(--space-5);
  border-radius: var(--radius-m);
  font-weight: 550;
}

.form-status--ok {
  background: var(--mint);
  color: var(--ink);
  border-left: 3px solid var(--petrol);
}

.form-status--error {
  background: var(--paper-raised);
  color: var(--ink);
  border-left: 3px solid var(--signal);
}
