/* ---------- Schriften (lokal, Teilmengen) ---------- */
@font-face { font-family: "Jakarta"; src: url("fonts/jakarta.woff2") format("woff2"); font-weight: 500 800; font-display: swap; }
@font-face { font-family: "Literata"; src: url("fonts/literata.woff2") format("woff2"); font-weight: 400 600; font-style: normal; font-display: swap; }
@font-face { font-family: "Literata"; src: url("fonts/literata-italic.woff2") format("woff2"); font-weight: 400 500; font-style: italic; font-display: swap; }
@font-face { font-family: "Gowun Batang"; src: url("fonts/gowun-regular.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Gowun Batang"; src: url("fonts/gowun-bold.woff2") format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Noto Sans KR"; src: url("fonts/notosanskr.woff2") format("woff2"); font-weight: 500 800; font-display: swap; }

/* ---------- Farben ---------- */
:root {
  color-scheme: light dark;
  --sans: "Jakarta", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  --serif: "Literata", Georgia, "Times New Roman", serif;

  --bg: oklch(0.975 0.008 62);
  --surface: oklch(0.993 0.004 70);
  --text: oklch(0.27 0.02 40);
  --strong: oklch(0.2 0.03 40);
  --muted: oklch(0.49 0.02 45);
  --hair: oklch(0.89 0.012 50);
  --coral: oklch(0.64 0.19 25);
  --knot: url("knot.webp");

  --accent-l: 0.64; --accent-c: 0.16;
  --ink-l: 0.43;   --ink-c: 0.12;
  --band-l: 0.925; --band-c: 0.05;
  --wash-l: 0.988; --wash-c: 0.008;
  --rule-l: 0.88;  --rule-c: 0.04;
  --btn-l: 0.72;   --btn-c: 0.15;
  --title-l: 0.27;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: oklch(0.2 0.012 40);
    --surface: oklch(0.235 0.014 40);
    --text: oklch(0.92 0.012 60);
    --strong: oklch(0.99 0.01 60);
    --muted: oklch(0.72 0.016 50);
    --hair: oklch(0.33 0.014 40);
    --coral: oklch(0.72 0.16 28);

    --accent-l: 0.76; --accent-c: 0.14;
    --ink-l: 0.82;   --ink-c: 0.09;
    --band-l: 0.3;   --band-c: 0.06;
    --wash-l: 0.215; --wash-c: 0.014;
    --rule-l: 0.38;  --rule-c: 0.045;
    --btn-l: 0.76;   --btn-c: 0.13;
    --title-l: 0.96;
  }
}

/* Farbsatz eines Schritts, abgeleitet aus dem Farbton --h */
#app, [style*="--h"] {
  --accent: oklch(var(--accent-l) var(--accent-c) var(--h));
  --ink: oklch(var(--ink-l) var(--ink-c) var(--h));
  --band: oklch(var(--band-l) var(--band-c) var(--h));
  --wash: oklch(var(--wash-l) var(--wash-c) var(--h));
  --rule: oklch(var(--rule-l) var(--rule-c) var(--h));
  --btn: oklch(var(--btn-l) var(--btn-c) var(--h));
  --on-btn: oklch(0.22 0.05 var(--h));
}

/* ---------- Grundlagen ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; background: var(--bg); }
body {
  margin: 0;
  min-height: 100dvh;
  font-family: var(--sans);
  font-size: 1rem;
  line-height: 1.45;
  color: var(--text);
  background: var(--bg);
  -webkit-tap-highlight-color: transparent;
}
:lang(ko) body, body:lang(ko) {
  --sans: "Jakarta", "Noto Sans KR", "Apple SD Gothic Neo", system-ui, sans-serif;
  --serif: "Gowun Batang", "AppleMyungjo", serif;
  word-break: keep-all;
  overflow-wrap: break-word;
}
a { color: inherit; }
h1, h2, h3, p, ol, ul, dl, dd, blockquote { margin: 0; }
ol, ul { padding: 0; list-style: none; }
svg { width: 1.25em; height: 1.25em; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
:focus-visible { outline: 2.5px solid var(--btn); outline-offset: 3px; border-radius: 6px; }
[tabindex="-1"]:focus { outline: none; }

.knot { display: inline-block; width: 28px; height: 26px; background: var(--knot) center / contain no-repeat; flex-shrink: 0; }
.knot.big { width: 64px; height: 59px; }

.eyebrow {
  display: block;
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}
:lang(ko) .eyebrow, :lang(ko) .kicker { letter-spacing: 0.02em; font-size: 0.8125rem; }

/* ---------- Gerüst ---------- */
#app { min-height: 100dvh; }
.side { display: none; }
.pane { min-height: 100dvh; display: flex; flex-direction: column; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 3;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: calc(env(safe-area-inset-top) + 6px) 8px 6px;
  background: color-mix(in oklch, var(--bg) 88%, transparent);
  -webkit-backdrop-filter: saturate(1.4) blur(12px);
  backdrop-filter: saturate(1.4) blur(12px);
}
.topbar .roles { margin: 0 auto; }

/* Rollenschalter Zuhörer/Sprecher */
.roles {
  display: flex;
  padding: 3px;
  border-radius: 12px;
  background: color-mix(in oklch, var(--hair) 70%, var(--bg));
}
.roles a {
  flex: 1;
  display: grid;
  place-items: center;
  min-height: 38px;
  padding: 0 14px;
  border-radius: 9px;
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--muted);
  text-decoration: none;
  white-space: nowrap;
  transition: background-color 160ms, color 160ms;
}
.roles a[aria-current] {
  background: var(--surface);
  color: var(--strong);
  box-shadow: 0 1px 2px oklch(0.3 0.02 40 / 0.14);
}
.icon-btn {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  color: var(--text);
  text-decoration: none;
}
.icon-btn:active { background: var(--hair); }
.icon-btn.spacer { visibility: hidden; }

.trail {
  display: flex;
  gap: 6px;
  padding: 0 20px 10px;
  position: sticky;
  top: calc(env(safe-area-inset-top) + 56px);
  z-index: 2;
  background: color-mix(in oklch, var(--bg) 88%, transparent);
}
.trail a {
  flex: 1;
  height: 5px;
  border-radius: 3px;
  background: oklch(var(--accent-l) var(--accent-c) var(--h));
  opacity: 0.22;
  position: relative;
}
.trail a::after { content: ""; position: absolute; inset: -12px 0; } /* größere Tippfläche */
.trail a.done { opacity: 0.55; }
.trail a.now { opacity: 1; }
.trail a.end { --h: 28; flex: 0.5; }

.main { flex: 1; width: 100%; max-width: 680px; margin: 0 auto; display: flex; flex-direction: column; }
.view { flex: 1; padding: 8px 20px 24px; }
.main { touch-action: pan-y; }
.swipe-hint {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 28px;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--muted);
}
.swipe-hint svg { width: 1em; height: 1em; opacity: 0.7; }

/* ---------- Aktionsleiste ---------- */
.actions {
  position: sticky;
  bottom: 0;
  z-index: 2;
  display: flex;
  gap: 10px;
  padding: 12px 16px calc(env(safe-area-inset-bottom) + 12px);
  background: linear-gradient(to top, var(--bg) 70%, color-mix(in oklch, var(--bg) 0%, transparent));
}
.btn {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 52px;
  padding: 0 18px;
  border-radius: 14px;
  font-size: 1rem;
  font-weight: 700;
  text-decoration: none;
  text-align: center;
  transition: transform 160ms cubic-bezier(0.25, 1, 0.5, 1), background-color 160ms;
}
.btn:active { transform: scale(0.97); }
.btn.primary { flex: 1.6; background: var(--btn); color: var(--on-btn); }
.btn.ghost { background: var(--surface); color: var(--text); box-shadow: inset 0 0 0 1px var(--hair); }
[data-view="start"] .actions { flex-direction: column; }
[data-view="start"] .btn { flex: none; }

/* ---------- Übersicht ---------- */
.start { display: flex; flex-direction: column; align-items: stretch; }
.cover-logo { display: block; width: min(52vw, 220px); height: auto; margin: 4px auto 18px; }
.start h1 {
  text-align: center;
  font-size: 1.625rem;
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.015em;
  color: var(--strong);
  margin-bottom: 28px;
}
.start .eyebrow { margin-bottom: 10px; }
.rules { margin-bottom: 30px; }
.rules li { position: relative; padding: 0 0 0 20px; font-size: 1.0625rem; line-height: 1.4; }
.rules li + li { margin-top: 8px; }
.rules li::before {
  content: "";
  position: absolute; left: 2px; top: 0.5em;
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--coral);
}
.step-list { display: grid; gap: 8px; margin-bottom: 24px; }
.step-list a {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 56px;
  padding: 8px 14px 8px 10px;
  border-radius: 14px;
  background: var(--wash);
  box-shadow: inset 0 0 0 1px var(--rule);
  text-decoration: none;
  font-weight: 700;
}
.step-list .t { flex: 1; }
.step-list svg { color: var(--ink); }
.num {
  display: grid;
  place-items: center;
  width: 34px; height: 34px;
  border-radius: 50%;
  background: var(--btn);
  color: var(--on-btn);
  font-weight: 800;
  font-size: 0.9375rem;
  flex-shrink: 0;
}
.variants-link {
  align-self: center;
  padding: 12px;
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--muted);
  text-underline-offset: 3px;
}

/* ---------- Schritt ---------- */
.band {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  column-gap: 16px;
  margin: 0 -20px 22px;
  padding: 18px 20px 20px;
  background: var(--band);
}
.step-no {
  font-size: 4rem;
  font-weight: 800;
  line-height: 0.85;
  color: var(--accent);
  font-variant-numeric: lining-nums;
}
.kicker {
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink);
}
.band h1 {
  margin-top: 4px;
  font-size: 1.625rem;
  font-weight: 800;
  line-height: 1.12;
  letter-spacing: -0.015em;
  color: oklch(var(--title-l) 0.05 var(--h));
}
.goal {
  font-size: 1.125rem;
  font-weight: 600;
  line-height: 1.38;
  color: var(--strong);
  padding-bottom: 20px;
  margin-bottom: 18px;
  border-bottom: 1px solid var(--rule);
}
.goal .eyebrow { color: var(--ink); margin-bottom: 4px; }

.group + .group { margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--rule); }
.group .eyebrow { margin-bottom: 6px; }
.lines > div { padding: 10px 0; }
.lines > div + div { border-top: 1px dotted var(--rule); }
.lines dt { font-size: 0.875rem; font-weight: 700; color: var(--ink); margin-bottom: 2px; }
.lines dd {
  font-family: var(--serif);
  font-size: 1.3125rem;
  line-height: 1.42;
  color: var(--text);
}
.lines dd + dd { margin-top: 8px; }
:lang(ko) .lines dd { line-height: 1.6; font-size: 1.25rem; }
strong { font-weight: 600; color: var(--strong); }
:lang(ko) strong { font-weight: 700; }
.blank {
  display: inline-block;
  width: 2.4em;
  border-bottom: 1.5px solid var(--accent);
  transform: translateY(-0.2em);
}

.tip {
  margin-top: 18px;
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--band);
  font-size: 0.9375rem;
  font-weight: 600;
  line-height: 1.4;
  color: oklch(var(--title-l) 0.05 var(--h));
}
.feelings-link {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 14px;
  min-height: 56px;
  padding: 10px 16px;
  border-radius: 14px;
  background: var(--wash);
  box-shadow: inset 0 0 0 1.5px var(--rule);
  color: oklch(var(--title-l) 0.05 var(--h));
  font-weight: 700;
  text-decoration: none;
}
.feelings-link span { flex: 1; }
.feelings-link svg:first-child { color: var(--accent); }

/* ---------- Gefühle ---------- */
.intro { font-size: 1.0625rem; margin-bottom: 20px; color: var(--strong); }
.chip-group + .chip-group { margin-top: 18px; }
.chip-group .eyebrow { margin-bottom: 8px; }
.chip-group.fears { margin-top: 26px; padding-top: 20px; border-top: 1px solid var(--rule); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  min-height: 44px;
  padding: 8px 15px;
  border: 0;
  border-radius: 999px;
  background: var(--surface);
  box-shadow: inset 0 0 0 1px var(--rule);
  font: inherit;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  transition: background-color 160ms, color 160ms, transform 160ms cubic-bezier(0.25, 1, 0.5, 1);
}
.chip:active { transform: scale(0.96); }
.chip[aria-pressed="true"] { background: var(--btn); color: var(--on-btn); box-shadow: none; }
.clear {
  margin-top: 14px;
  padding: 10px 0;
  border: 0;
  background: none;
  font: inherit;
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--muted);
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}
.swap-note { margin-top: 26px; font-size: 0.9375rem; color: var(--muted); }
.closing .swap-note { max-width: 22rem; }

/* ---------- Abschluss ---------- */
.closing { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 0; padding-top: 32px; }
.closing .knot { margin-bottom: 14px; }
.closing h1 { font-size: 1.625rem; font-weight: 800; color: var(--strong); margin-bottom: 18px; }
.verse p { font-family: var(--serif); font-style: italic; font-size: 1.375rem; line-height: 1.45; max-width: 24em; }
:lang(ko) .verse p { font-style: normal; }
.verse cite {
  display: block;
  margin-top: 8px;
  font-style: normal;
  font-size: 0.8125rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--coral);
}
.closing .eyebrow { margin-top: 32px; padding-top: 22px; border-top: 1px solid var(--hair); width: min(100%, 22rem); margin-bottom: 8px; }
.question { font-family: var(--serif); font-size: 1.3125rem; line-height: 1.45; max-width: 22em; }

/* ---------- Übergang ---------- */
@keyframes in-next { from { opacity: 0; transform: translateX(18px); } }
@keyframes in-prev { from { opacity: 0; transform: translateX(-18px); } }
.enter-next .view { animation: in-next 240ms cubic-bezier(0.25, 1, 0.5, 1); }
.enter-prev .view { animation: in-prev 240ms cubic-bezier(0.25, 1, 0.5, 1); }

/* ---------- Tablet ---------- */
@media (min-width: 700px) {
  .view { padding: 16px 32px 32px; }
  .band { margin: 0 0 28px; padding: 24px 28px; border-radius: 20px; column-gap: 22px; }
  .step-no { font-size: 5rem; }
  .band h1, .start h1, .closing h1 { font-size: 2rem; }
  .goal { font-size: 1.25rem; }
  .lines dd { font-size: 1.5rem; }
  .verse p, .question { font-size: 1.5rem; }
  .trail { padding: 0 32px 12px; max-width: 680px; margin: 0 auto; width: 100%; }
  .actions { max-width: 680px; margin: 0 auto; width: 100%; padding-left: 32px; padding-right: 32px; }
  .step-list { grid-template-columns: 1fr 1fr; }
  .chip { font-size: 1.0625rem; }
}

@media (min-width: 1000px) {
  #app { display: grid; grid-template-columns: 300px 1fr; }
  .side {
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100dvh;
    padding: 28px 18px 20px;
    border-right: 1px solid var(--hair);
    background: var(--surface);
  }
  .side-brand {
    display: flex; align-items: center; gap: 12px;
    padding: 8px 10px 22px;
    text-decoration: none;
    font-weight: 800;
    line-height: 1.25;
  }
  .side-brand .knot { width: 36px; height: 33px; }
  .side-brand small { display: block; font-size: 0.8125rem; font-weight: 600; color: var(--muted); }
  .side .roles { margin: 0 4px 18px; }
  .side-steps { display: grid; gap: 4px; }
  .side-steps a {
    display: flex; align-items: center; gap: 12px;
    min-height: 48px;
    padding: 6px 10px;
    border-radius: 12px;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9375rem;
  }
  .side-steps a:hover { background: var(--bg); }
  .side-steps a[aria-current] { background: var(--band); color: oklch(var(--title-l) 0.05 var(--h)); font-weight: 800; }
  .side-steps .num { width: 30px; height: 30px; font-size: 0.875rem; }
  .side-end { --h: 28; }
  .num.end { background: var(--knot) center / 22px no-repeat, var(--bg); box-shadow: inset 0 0 0 1px var(--hair); }
  .side-variants { margin-top: auto; padding: 10px; font-size: 0.875rem; font-weight: 600; color: var(--muted); text-underline-offset: 3px; }
  .side-brand[aria-current] { color: var(--strong); }

  .topbar { display: none; }
  .trail { top: 0; padding-top: 20px; }
  [data-view="start"] .main { padding-top: 24px; }
  .start .variants-link { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .enter-next .view, .enter-prev .view { animation: none; }
  .btn { transition: none; }
}
