/* ==========================================================
   Levanh – Designsystem
   Alle Farben, Größen, Abstände und Radien nur über :root.
   ========================================================== */

/* ---------- Schriften (lokal gehostet) ---------- */
@font-face {
  font-family: "Lora";
  src: url("fonts/lora-400.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Lora";
  src: url("fonts/lora-400-italic.woff2") format("woff2");
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: "Inter";
  src: url("fonts/inter-400.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Inter";
  src: url("fonts/inter-600.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

/* ---------- Tokens ---------- */
:root {
  /* Farben – Hell */
  --bg: #F9F7F3;
  --surface: #FFFFFF;
  --tint: #F1EEE8;
  --text: #2B2622;
  --muted: #6A6159;
  --accent: #627863;          /* Flächen: Balken, Markierungen */
  --accent-text: #52664F;     /* Text und Links, mind. 5:1 auf allen Flächen */
  --accent-soft: #E4EBE2;
  --crust: #9A5B3A;           /* Braun, sparsam: Hinweis „Hungrig“ */
  --crust-soft: #F8EEE7;
  --line: rgba(43, 38, 34, 0.09);
  --line-strong: rgba(43, 38, 34, 0.2);

  /* Schrift */
  --serif: "Lora", Georgia, "Times New Roman", serif;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;

  /* Modulare Skala 1,25 – Basis 16 px */
  --step--2: 0.75rem;
  --step--1: 0.875rem;
  --step-0: 1rem;
  --step-1: 1.25rem;
  --step-2: 1.563rem;
  --step-3: 1.953rem;
  --step-4: 2.441rem;
  --step-5: 3.052rem;
  --step-6: 3.815rem;
  --step-7: 4.768rem;

  /* 8-px-Raster */
  --space-1: 0.5rem;
  --space-2: 1rem;
  --space-3: 1.5rem;
  --space-4: 2rem;
  --space-6: 3rem;
  --space-8: 4rem;
  --space-12: 6rem;
  --space-16: 8rem;

  /* Maße */
  --measure: 62ch;
  --page: 72rem;
  --gutter: var(--space-3);
  --header-h: 4.5rem;
  --target: 2.75rem;          /* 44 px Klickfläche */
  --radius-card: 1.5rem;      /* Karten wie in der App */
  --radius-pill: 999px;
  --focus: 2px solid var(--accent-text);

  /* Bewegung */
  --ease: cubic-bezier(0.2, 0.6, 0.2, 1);
  --dur: 320ms;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #171513;
    --surface: #211E1B;
    --tint: #1D1B18;
    --text: #EFEBE5;
    --muted: #ADA59B;
    --accent: #9DB59E;
    --accent-text: #9DB59E;
    --accent-soft: #2B352C;
    --crust: #D9A27E;
    --crust-soft: #3A2A20;
    --line: rgba(239, 235, 229, 0.1);
    --line-strong: rgba(239, 235, 229, 0.24);
  }
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + var(--space-3)); /* Fokus nie unter dem Header */
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: var(--step-0);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3 {
  font-family: var(--serif);
  font-weight: 400;
  line-height: 1.1;
  letter-spacing: -0.015em;
  margin: 0 0 var(--space-3);
  text-wrap: balance;
}
h1 { font-size: clamp(2.75rem, 1.4rem + 5.6vw, var(--step-7)); line-height: 1.02; letter-spacing: -0.025em; }
h2 { font-size: clamp(var(--step-4), 1.6rem + 2.4vw, var(--step-5)); }
h3 { font-size: var(--step-2); letter-spacing: -0.01em; }

em { font-style: italic; }
h1 em { color: var(--accent-text); }

p { margin: 0 0 var(--space-2); max-width: var(--measure); }

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

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

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

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

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

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

/* Kleines Label über Überschriften – nur kurze Wörter, daher Versalien erlaubt */
.label {
  margin: 0 0 var(--space-3);
  font-size: var(--step--2);
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent-text);
}

/* ---------- Skip-Link ---------- */
.skip {
  position: absolute;
  left: var(--space-2);
  top: var(--space-1);
  z-index: 100;
  padding: var(--space-1) var(--space-2);
  background: var(--text);
  color: var(--bg);
  font-weight: 600;
  transform: translateY(-200%);
}
.skip:focus { transform: none; }

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--bg);
}

.bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  min-height: var(--header-h);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  min-height: var(--target);
  font-family: var(--serif);
  font-size: var(--step-1);
  letter-spacing: -0.01em;
  color: var(--text);
  text-decoration: none;
}
.brand img { width: 1.5rem; height: auto; }

.nav { display: flex; gap: var(--space-3); }
.nav a {
  display: inline-flex;
  align-items: center;
  min-height: var(--target);
  color: var(--muted);
  text-decoration: none;
  font-size: var(--step--1);
  letter-spacing: 0.02em;
}
.nav a:hover { color: var(--text); }

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

.section-head { margin-bottom: var(--space-8); max-width: 40rem; }
.section-head p:not(.label) { color: var(--muted); font-size: var(--step-1); line-height: 1.55; }

/* ---------- Hero ---------- */
.hero { padding-block: var(--space-6) var(--space-12); }

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

.lead {
  font-size: var(--step-1);
  line-height: 1.55;
  color: var(--muted);
  max-width: 30ch;
  margin-top: var(--space-4);
}

.hero-figure { margin: 0; justify-self: center; width: min(100%, 24rem); }
.hero-figure .stage-card { width: 100%; }

/* ---------- Karte (wie in der App) ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  padding: var(--space-3);
}

/* ---------- Badge ---------- */
.badge {
  display: inline-block;
  margin: 0;
  padding: 0.3rem 0.75rem;
  border-radius: var(--radius-pill);
  background: var(--accent-soft);
  color: var(--accent-text);
  font-size: var(--step--2);
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  line-height: 1.4;
}
.badge-crust { background: var(--crust-soft); color: var(--crust); }

/* ---------- Countdown ---------- */
.countdown { margin: 0; display: grid; gap: 0.15rem; }
.countdown-kicker { color: var(--muted); font-size: var(--step--1); }
.countdown-big {
  font-family: var(--serif);
  font-size: var(--step-3);
  line-height: 1.1;
  letter-spacing: -0.01em;
  color: var(--text);
}

/* ---------- Peak-Balken mit Fenster (wie in der App) ----------
   Peak liegt bei 80 %, das Fenster reicht von 70 bis 90 %. */
.peakbar {
  position: relative;
  height: 6px;
  border-radius: var(--radius-pill);
  background: var(--tint);
  box-shadow: inset 0 0 0 1px var(--line);
}
.peakbar-window {
  position: absolute;
  top: -3px;
  bottom: -3px;
  left: 70%;
  width: 20%;
  border-radius: var(--radius-pill);
  background: var(--accent-soft);
}
.peakbar-fill {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: var(--accent);
  transform-origin: left center;
  transform: scaleX(var(--value, 0));
}
.peakbar-tick {
  position: absolute;
  top: -5px;
  bottom: -5px;
  left: 80%;
  width: 2px;
  margin-left: -1px;
  background: var(--text);
  border-radius: 1px;
}
.peakbar-labels {
  position: relative;
  margin: var(--space-1) 0 0;
  min-height: 1.5em;
  font-size: var(--step--1);
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.peakbar-peak { position: absolute; left: 80%; transform: translateX(-50%); white-space: nowrap; }

/* ---------- Geschichte: Ein Tag mit deinem Starter ---------- */
.story { padding-top: var(--space-8); }

.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-12); }

.step .step-time {
  margin: 0 0 var(--space-1);
  font-family: var(--serif);
  font-style: italic;
  font-size: var(--step-1);
  color: var(--accent-text);
}
.step h3 { margin-bottom: var(--space-1); }
.step > p { color: var(--muted); }

/* Mini-Karte in jedem Schritt (Handy und ohne JavaScript) */
.mini {
  display: grid;
  grid-template-columns: 4.5rem 1fr;
  gap: var(--space-2) var(--space-3);
  align-items: center;
  max-width: 26rem;
  margin-top: var(--space-3);
}
.mini-avatar img { width: 4.5rem; }
.mini-info { display: grid; gap: var(--space-1); justify-items: start; }
.mini .peakbar,
.mini .peakbar-labels { grid-column: 1 / -1; }
.mini .peakbar { margin-top: var(--space-1); }

/* Bühne – nur sichtbar, wenn JavaScript aktiv ist und Platz da ist */
.stage { display: none; }

@media (min-width: 60rem) {
  .story-live .story-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-12);
    align-items: start;
  }
  .story-live .stage {
    display: grid;
    position: sticky;
    top: calc(var(--header-h) + var(--space-3));
    min-height: calc(100vh - var(--header-h) - var(--space-6));
    align-content: center;
  }
  .story-live .steps { gap: 0; }
  .story-live .step {
    min-height: 75vh;
    display: grid;
    align-content: center;
    padding-left: var(--space-4);
  }
  /* kleiner Punkt an der Uhrzeit als Markierung */
  .story-live .step .step-time { position: relative; }
  .story-live .step .step-time::before {
    content: "";
    position: absolute;
    left: calc(-1 * var(--space-4));
    top: 50%;
    width: 7px;
    height: 7px;
    margin-top: -3.5px;
    border-radius: 50%;
    background: var(--line-strong);
    transition: background-color var(--dur) var(--ease), transform var(--dur) var(--ease);
  }
  .story-live .step.is-active .step-time::before { background: var(--accent); transform: scale(1.6); }
  .story-live .mini { display: none; }
}

/* Die Bühne ist eine Dashboard-Karte wie in der App */
.stage-card {
  display: grid;
  gap: var(--space-3);
  width: min(100%, 26rem);
  justify-self: center;
  padding: var(--space-4);
}
.stage-head { text-align: center; }
.stage-name { margin: 0; font-family: var(--serif); font-size: var(--step-3); line-height: 1.1; }
.stage-meta { margin: 0.25rem auto 0; font-size: var(--step--1); color: var(--muted); }

.stage-pics { position: relative; aspect-ratio: 1; width: 62%; justify-self: center; }
.stage-pics picture { position: absolute; inset: 0; opacity: 0; transition: opacity var(--dur) var(--ease); }
.stage-pics picture.is-active { opacity: 1; }
.stage-pics img { width: 100%; height: 100%; }

.stage-info { display: flex; justify-content: space-between; align-items: flex-start; gap: var(--space-2); }
.stage .peakbar-fill { transition: transform 700ms var(--ease); }

#funktionen { padding-top: 0; }

/* ---------- Funktionen: App-Screens ----------
   Handy: seitlich wischen (Scroll-Snap). Ab 48rem: drei Spalten nebeneinander. */
.screens {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: min(72%, 17rem);
  gap: var(--space-3);
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding-bottom: var(--space-2);
  margin-inline: calc(-1 * var(--gutter));
  padding-inline: var(--gutter);
  scroll-padding-inline: var(--gutter);
}
.screens:focus-visible { outline-offset: -2px; }
.screen { margin: 0; scroll-snap-align: start; }
.screen img {
  width: 100%;
  height: auto;
  border-radius: var(--radius-card);
  border: 1px solid var(--line);
  background: var(--surface);
}

/* Video – Platz ist vorbereitet, Inhalt folgt */
.video { margin: var(--space-6) 0 0; display: grid; gap: var(--space-2); justify-items: start; }
.video video { width: 100%; height: auto; background: var(--tint); }
.video figcaption { color: var(--muted); font-size: var(--step--1); }

/* ---------- Haltung: ein großer, ruhiger Moment ---------- */
.promise-section { padding-block: var(--space-16); }
.promise { text-align: center; display: grid; justify-items: center; }
.promise-statement {
  font-size: clamp(var(--step-5), 1.6rem + 4.4vw, var(--step-7));
  line-height: 1.04;
  letter-spacing: -0.025em;
  max-width: 14ch;
  margin: 0 auto var(--space-4);
}
.promise p { color: var(--muted); margin-inline: auto; max-width: 40ch; }

/* ---------- Fotos – Platz ist vorbereitet, Inhalt folgt ---------- */
.photo { margin: 0; }
.photo img { width: 100%; height: auto; border-radius: var(--radius-card); }
.photo figcaption { margin-top: var(--space-2); font-size: var(--step--1); color: var(--muted); }

/* ---------- Button (für das Video) ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: var(--target);
  padding: 0 var(--space-3);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-pill);
  background: transparent;
  color: var(--text);
  font: 600 var(--step--1) / 1 var(--sans);
  letter-spacing: 0.02em;
  cursor: pointer;
}
.btn:hover { border-color: var(--text); }
.btn:active { transform: translateY(1px); }

/* Primärer Button – dunkel wie „I fed my starter“ in der App */
.btn-primary {
  background: var(--text);
  border-color: var(--text);
  color: var(--bg);
  min-height: 3rem;
  padding-inline: var(--space-4);
}
.btn-primary:hover { background: var(--accent-text); border-color: var(--accent-text); color: var(--bg); }

/* ---------- Kontakt ---------- */
.contact-section { padding-top: 0; }
.contact { display: grid; justify-items: center; text-align: center; }
.contact h2 { font-size: clamp(var(--step-3), 1.4rem + 1.6vw, var(--step-4)); }
.contact p { color: var(--muted); margin-inline: auto; }
.contact .mail {
  display: inline-flex;
  align-items: center;
  min-height: var(--target);
  font-family: var(--serif);
  font-size: var(--step-2);
  word-break: break-word;
}

/* ---------- Footer ---------- */
.site-footer { padding-block: var(--space-4); font-size: var(--step--1); color: var(--muted); }
.foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-1) var(--space-3);
}
.foot::before { content: ""; flex-basis: 100%; height: 1px; margin-bottom: var(--space-2); background: var(--line); }
.foot nav { display: flex; flex-wrap: wrap; gap: 0 var(--space-3); }
.foot a { display: inline-flex; align-items: center; min-height: var(--target); color: var(--muted); text-decoration: none; }
.foot a:hover { color: var(--text); text-decoration: underline; }
.foot p { margin: 0; }

/* ---------- Rechtliche Seiten ---------- */
.legal { max-width: calc(var(--measure) + 2 * var(--gutter)); padding-block: var(--space-8) var(--space-12); }
.legal h1 { font-size: clamp(var(--step-4), 1.6rem + 2.6vw, var(--step-5)); }
.legal h2 { font-size: var(--step-2); margin-top: var(--space-8); }
.legal .meta { color: var(--muted); font-size: var(--step--1); }
.legal h1 { hyphens: auto; overflow-wrap: break-word; }
.legal h1 span { display: block; margin-top: var(--space-1); font-size: 0.55em; color: var(--muted); }
.legal h3 { font-size: var(--step-1); margin-top: var(--space-6); margin-bottom: var(--space-2); }
.legal h4 { font-family: var(--sans); font-size: var(--step-0); font-weight: 600; letter-spacing: 0; margin: var(--space-4) 0 var(--space-1); }
.legal ul { padding-left: 1.25rem; margin: 0 0 var(--space-2); max-width: var(--measure); }
.legal li { margin-bottom: var(--space-1); }
.legal section { margin-top: var(--space-8); padding-top: var(--space-4); border-top: 1px solid var(--line); }
.legal section > h2 { margin-top: 0; }
.legal-lang { display: flex; gap: var(--space-3); margin-top: var(--space-2); }
.legal-lang a { display: inline-flex; align-items: center; min-height: var(--target); }

/* ---------- Feedback (nur Testphase) ---------- */
.feedback { max-width: calc(42.5rem + 2 * var(--gutter)); padding-block: var(--space-8) var(--space-12); }
.feedback h1 { font-size: clamp(var(--step-4), 1.6rem + 2.6vw, var(--step-5)); }
.feedback .lead { margin: 0 0 var(--space-6); max-width: none; }

.embed { padding: var(--space-4); }
.embed-consent { display: grid; gap: var(--space-3); justify-items: start; }
.embed-consent p { margin: 0; color: var(--muted); }
.embed-alt { font-size: var(--step--1); line-height: 1.9; }

/* Tally zeichnet seinen eigenen hellen Hintergrund – deshalb bleibt das Formular in beiden Modi lesbar */
.embed-frame {
  display: block;
  width: 100%;
  height: min(46rem, 80vh);
  border: 0;
  border-radius: calc(var(--radius-card) - var(--space-2));
  background: var(--surface);
}
.embed-status { margin: 0; color: var(--muted); font-size: var(--step--1); }
.embed.is-loading .embed-status { margin-bottom: var(--space-2); }
.embed:not(.is-loading) .embed-status {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* ---------- 404 ---------- */
.notfound {
  display: grid;
  justify-items: center;
  text-align: center;
  padding-block: var(--space-8) var(--space-16);
}
.notfound img { width: 9rem; margin-bottom: var(--space-4); }
.notfound h1 { font-size: clamp(var(--step-4), 1.6rem + 2.6vw, var(--step-5)); max-width: 16ch; }
.notfound p:not(.label) { color: var(--muted); max-width: 44ch; }

/* ---------- Größere Bildschirme ---------- */
@media (min-width: 48rem) {
  :root { --gutter: var(--space-6); }
  .section { padding-block: var(--space-16); }
  .hero { min-height: calc(100svh - var(--header-h)); display: grid; align-items: center; padding-block: var(--space-8); }
  .promise-section { padding-block: calc(var(--space-16) * 1.5); }
  .hero-grid { grid-template-columns: 7fr 5fr; }
  .screens { grid-auto-flow: row; grid-template-columns: repeat(3, 1fr); gap: var(--space-6); overflow: visible; margin-inline: 0; padding-inline: 0; }
}

/* ---------- Weniger Bewegung ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}
