/* THE LIFE COMPASS — Ebene 3: Seite und Ablauf
 *
 * Mobil ist die Hauptansicht, nicht die verkleinerte Desktopseite:
 * eigene Reihenfolge, eigener Bildausschnitt, Bedienung in der Daumenzone.
 * Ab 900px wird dieselbe Struktur breiter, sie wird nicht umgebaut.
 */

.shell {
  width: 100%;
  max-width: 640px;
  margin-inline: auto;
  padding-inline: var(--space-5);
}

/* ---------------------------------------------------------------- Topbar */

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  min-height: 56px;
  padding-top: env(safe-area-inset-top);
}

/* Die Wortmarke ist der Heimweg — dort sucht man ihn. Als Knopf braucht sie
   die Browservorgaben zurückgesetzt, sonst erbt sie Rahmen und Systemschrift. */
.brand {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  min-height: 44px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--foreground);
  font-family: inherit;
  font-size: .8125rem;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  cursor: pointer;
}
.brand:hover .brand__dot { box-shadow: 0 0 0 6px var(--accent); }
.brand__dot { transition: box-shadow var(--exit); }
.brand__dot {
  width: 9px; height: 9px;
  border-radius: var(--radius-full);
  background: var(--primary);
  box-shadow: 0 0 0 4px var(--accent);
}

.topbar__note {
  max-width: 15ch;
  color: var(--muted-foreground);
  font-size: .6875rem;
  line-height: 1.3;
  text-align: right;
}

/* ------------------------------------------------------------------ View */

.view { animation: rise var(--enter) both; }
@keyframes rise {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: none; }
}

/* ------------------------------------------------------------- Startseite */

.hero {
  position: relative;
  margin-top: var(--space-3);
  border-radius: var(--radius-xl);
  overflow: hidden;
  background: var(--muted);
}

.hero img {
  width: 100%;
  aspect-ratio: 4 / 3;         /* Platz reserviert, kein Nachrücken beim Laden */
  object-fit: cover;
  object-position: 50% 62%;    /* Boot und offene Fläche im Bild halten */
}

/* Das Bild läuft nach unten weich in den Seitengrund aus,
   damit die Überschrift auf ruhiger Fläche steht statt auf Wasser. */
.hero::after {
  content: "";
  position: absolute;
  inset: auto 0 0 0;
  height: 52%;
  background: linear-gradient(
    to bottom,
    rgba(246, 251, 250, 0) 0%,
    rgba(246, 251, 250, .88) 58%,
    var(--background) 100%
  );
  pointer-events: none;
}

.hero__badge {
  position: absolute;
  top: var(--space-3);
  left: var(--space-3);
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, .9);
  color: var(--foreground);
  font-size: .6875rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.start__copy { margin-top: calc(-1 * var(--space-6)); position: relative; z-index: 1; }

.start h1 {
  font-size: clamp(2rem, 8.5vw, 2.75rem);
  line-height: 1.08;
}

.start__lead {
  margin-top: var(--space-3);
  font-size: 1.0625rem;
  line-height: 1.55;
}

.start__meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-top: var(--space-4);
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-1) var(--space-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  background: var(--card);
  color: var(--muted-foreground);
  font-size: .8125rem;
}

.gate { display: grid; gap: var(--space-4); margin-top: var(--space-6); }

.consent {
  display: grid;
  grid-template-columns: 22px 1fr;
  gap: var(--space-3);
  align-items: start;
  color: var(--muted-foreground);
  font-size: .875rem;
  line-height: 1.45;
  cursor: pointer;
}
.consent input {
  width: 22px; height: 22px;
  margin: 1px 0 0;
  accent-color: var(--ring);
}

/* -------------------------------------------------------- Frage-Bildschirm */

.stage { display: flex; flex-direction: column; min-height: 100svh; }

/* Schmales Bildband: gleiche Datei, anderer Ausschnitt je Phase.
   Gibt jeder Phase ein eigenes Gesicht, ohne zusätzliche Ladezeit. */
.band {
  height: 72px;
  margin-top: var(--space-2);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--muted);
}
.band img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: object-position 600ms var(--ease);
}
.band[data-phase="1"] img { object-position: 50% 78%; }
.band[data-phase="2"] img { object-position: 12% 30%; }
.band[data-phase="3"] img { object-position: 62% 22%; }

.stage__head { margin-top: var(--space-4); display: grid; gap: var(--space-3); }

.stage__meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  color: var(--muted-foreground);
  font-size: .75rem;
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
}
.stage__phase { color: var(--ring); }

.mirror {
  margin-top: var(--space-5);
  padding-left: var(--space-4);
  border-left: 2px solid var(--primary);
  color: var(--body);
  font-size: 1rem;
  line-height: 1.6;
}

.question {
  margin-top: var(--space-5);
  font-size: clamp(1.375rem, 5.8vw, 1.875rem);
  line-height: 1.24;
}

.stage__body { margin-top: var(--space-6); display: grid; gap: var(--space-4); }

/* Freiraum unter dem Inhalt, damit die klebende Leiste am Ende des Scrollens
   nichts verdeckt. Der Wert liegt über der Höhe der Leiste. */
.stage__spacer { flex: 1; min-height: 112px; }

/* Bedienung in der Daumenzone. Sie klebt unten, bleibt aber Teil des Flusses. */
.actionbar {
  position: sticky;
  bottom: 0;
  z-index: 20;
  margin-inline: calc(-1 * var(--space-5));
  padding: var(--space-3) var(--space-5)
           calc(var(--space-3) + env(safe-area-inset-bottom));
  border-top: 1px solid var(--border);
  background: color-mix(in srgb, var(--background) 88%, transparent);
  backdrop-filter: blur(12px);
}

/* Zurück links, Hauptaktion rechts daneben — spart eine Zeile in der
   Daumenzone und hält die Reihenfolge zwischen den Schritten stabil. */
.actionbar__row {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: var(--space-2);
  align-items: center;
}
/* Im ersten Schritt gibt es kein Zurück — dann füllt die Aktion die Breite. */
.actionbar__row:has(> [hidden]) { grid-template-columns: 1fr; }

.actionbar__hint {
  display: none;               /* Tastaturkürzel nur, wo es eine Tastatur gibt */
  color: var(--muted-foreground);
  font-size: .75rem;
  text-align: center;
}
@media (hover: hover) and (pointer: fine) {
  .actionbar__hint:not([hidden]) { display: block; }
}

/* Leiser Ausstieg. Muss auffindbar sein, damit auf einem geteilten Gerät
   niemand im Gespräch eines anderen landet — und leise genug, dass er
   niemanden aus dem Gespräch zieht. */
.actionbar__reset {
  display: block;
  margin: var(--space-2) auto 0;
  padding: var(--space-1) var(--space-3);
  min-height: 32px;
  border: 0;
  background: none;
  color: var(--muted-foreground);
  font-size: .75rem;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}
.actionbar__reset:hover { color: var(--foreground); }

.counter { color: var(--muted-foreground); font-size: .75rem; text-align: right; }

/* --------------------------------------------------------------- Ergebnis */

.result { padding-bottom: var(--space-16); }

.result__head { margin-top: var(--space-5); display: grid; gap: var(--space-3); }
.result h1 { font-size: clamp(1.75rem, 7vw, 2.5rem); line-height: 1.12; }

.report {
  margin-top: var(--space-6);
  padding: var(--space-2) var(--space-5) var(--space-6);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  background: var(--card);
  box-shadow: var(--shadow-md);
}

.report h2 {
  margin: var(--space-8) 0 var(--space-3);
  color: var(--ring);
  font-family: var(--font-sans);
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.report p, .report li {
  color: var(--body);
  font-family: var(--font-serif);
  font-size: 1.0625rem;
  line-height: 1.65;
}
.report p + p { margin-top: var(--space-3); }
.report ol { margin: 0; padding-left: 1.25em; }
.report li { margin-bottom: var(--space-3); padding-left: var(--space-1); }

/* Die eine Frage ist der Höhepunkt und wird als einziger Block hervorgehoben. */
.report .keystone {
  margin-top: var(--space-3);
  padding: var(--space-5);
  border-radius: var(--radius-lg);
  background: var(--accent);
  color: var(--accent-foreground);
  font-family: var(--font-serif);
  font-size: clamp(1.25rem, 5.5vw, 1.625rem);
  line-height: 1.3;
}

.legal { margin-top: var(--space-8); color: var(--muted-foreground); font-size: .8125rem; }

/* ----------------------------------------------------------------- Footer */

.footer {
  margin-top: var(--space-12);
  padding: var(--space-5) 0 calc(var(--space-6) + env(safe-area-inset-bottom));
  border-top: 1px solid var(--border);
  color: var(--muted-foreground);
  font-size: .75rem;
}
.footer__inner { display: grid; gap: var(--space-2); }
.footer a { color: inherit; }

/* ------------------------------------------------------------ Ab Tablet */

@media (min-width: 720px) {
  .shell { max-width: 720px; padding-inline: var(--space-8); }
  .hero img { aspect-ratio: 16 / 9; }
  .band { height: 120px; }
  .start h1 { font-size: 3rem; }
  .question { font-size: 2.25rem; }
  .report { padding: var(--space-3) var(--space-10) var(--space-10); }
  .report p, .report li { font-size: 1.125rem; }
}

/* ------------------------------------------------------------ Ab Desktop */

@media (min-width: 1024px) {
  .shell { max-width: 960px; }

  /* Auf breiten Schirmen steht das Bild neben dem Text statt darüber. */
  .start__grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-12);
    align-items: center;
    margin-top: var(--space-8);
  }
  .hero { margin-top: 0; }
  .hero img { aspect-ratio: 3 / 4; }
  .hero::after { display: none; }
  .start__copy { margin-top: 0; }
  .start h1 { font-size: 3.25rem; }

  .stage { max-width: 720px; margin-inline: auto; }

  /* Auf dem Desktop gibt es keine Daumenzone: die Leiste löst sich. */
  .actionbar {
    position: static;
    margin-inline: 0;
    padding: var(--space-6) 0 0;
    border-top: 0;
    background: transparent;
    backdrop-filter: none;
  }
  .actionbar__row { grid-template-columns: 1fr auto; align-items: center; }
  .actionbar .btn--ghost { justify-self: start; }
  .actionbar .btn--block { width: auto; min-width: 220px; justify-self: end; }
  /* Auf der Startseite bleibt der Knopf links an der Textkante. */
  .gate .btn--block { width: auto; min-width: 240px; justify-self: start; }
}
