/* Studio Kaldi – Intro-Seite.
   Weiß, groß, eine Schrift (Amatic SC Bold, selbst gehostet), keine externen Requests. */

@font-face {
  font-family: "Amatic SC";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("fonts/amatic-sc-700-latin.woff2") format("woff2");
}

:root {
  --ink: #17212B;
  --ink-soft: #4A5562;
  --paper: #FFFFFF;
  --accent: #215ADB;
  --hand: "Amatic SC", "Amatic", "Comic Neue", "Chalkboard SE", cursive;
  --ui: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --logo: min(56vmin, 440px);
  --out: cubic-bezier(.16, 1, .3, 1); /* exponentielles Ease-out */
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; height: 100%; }
body {
  margin: 0; min-height: 100%; min-height: 100svh;
  background: var(--paper); color: var(--ink);
  font: 400 1rem/1.5 var(--ui);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
::selection { background: var(--ink); color: var(--paper); }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 4px; border-radius: 4px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* Bühne: alles mittig, ein Bildschirm */
.stage {
  position: relative; min-height: 100vh; min-height: 100svh;
  display: grid; place-items: center;
  padding: max(24px, env(safe-area-inset-top)) 16px max(88px, calc(env(safe-area-inset-bottom) + 72px));
}
.stage > * { grid-area: 1 / 1; }

/* Akt 1 – die Botschaft */
.claim {
  margin: 0; text-align: center; pointer-events: none;
  font-family: var(--hand); font-weight: 700;
  font-size: clamp(4.2rem, 17vw, 12.5rem);
  line-height: .86; letter-spacing: -.01em; text-transform: none;
  display: none;
}
.claim .line { display: block; }
.claim .w { display: inline-block; will-change: transform, opacity, filter; }

/* Akt 2 + 3 */
.finale { display: grid; justify-items: center; text-align: center; }
.stack { position: relative; width: var(--logo); aspect-ratio: 1; }
.stack img {
  position: absolute; inset: 0; width: 100%; height: 100%;
  opacity: 0; user-select: none; -webkit-user-drag: none;
}
.stack img.final { opacity: 1; }
.name {
  margin: clamp(-28px, -3vmin, -12px) 0 0;
  font-family: var(--hand); font-weight: 700;
  font-size: clamp(3.6rem, 12vw, 7rem); line-height: 1; letter-spacing: .01em;
}
.contact { margin: clamp(16px, 3vh, 28px) 0 0; display: grid; gap: 2px; justify-items: center; }
.contact-label {
  font-family: var(--hand); font-weight: 700; font-size: 1.6rem; line-height: 1; color: var(--ink-soft);
}
.contact a {
  font-family: var(--hand); font-weight: 700; font-size: clamp(1.9rem, 6vw, 2.6rem); line-height: 1.1;
  text-decoration-line: underline; text-decoration-thickness: 2px; text-underline-offset: 6px;
  text-decoration-color: rgba(23, 33, 43, .25);
  transition: text-decoration-color .25s ease;
  overflow-wrap: anywhere;
}
.contact a:hover { text-decoration-color: var(--ink); }

/* Bedienelemente: leise, unten */
.controls {
  position: fixed; right: max(16px, env(safe-area-inset-right)); bottom: max(16px, env(safe-area-inset-bottom));
  display: flex; gap: 8px; z-index: 2;
}
.ctl {
  display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 16px 0 12px;
  border: 1px solid rgba(23, 33, 43, .14); border-radius: 999px;
  background: rgba(255, 255, 255, .78);
  -webkit-backdrop-filter: blur(12px) saturate(160%); backdrop-filter: blur(12px) saturate(160%);
  color: var(--ink); font: 600 .875rem/1 var(--ui); letter-spacing: .01em; cursor: pointer;
  transition: transform .1s ease-out, background-color .2s ease, opacity .5s var(--out);
  -webkit-tap-highlight-color: transparent;
}
.ctl:hover { background: #fff; }
.ctl:active { transform: scale(.96); }
.ctl svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.ctl svg path:first-child { fill: currentColor; stroke-linejoin: round; }
#replay svg path:first-child { fill: none; }
.ctl .wave { display: none; }
.ctl[aria-pressed="true"] .wave { display: inline; }
.ctl[aria-pressed="true"] .mute { display: none; }
.ctl[hidden] { display: none; }

.legal-links {
  position: fixed; left: max(16px, env(safe-area-inset-left)); bottom: max(16px, env(safe-area-inset-bottom));
  display: flex; gap: 16px; align-items: center; min-height: 44px; z-index: 2;
  font-size: .8125rem; color: var(--ink-soft);
}
.legal-links a { text-decoration: none; padding: 12px 0; }
.legal-links a:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 4px; }

/* ===== Zustände, gesteuert von intro.js über data-phase am <html> ===== */
.js .claim { display: block; }
.js .claim .w { opacity: 0; }
.js .stack img.final { opacity: 0; }
.js .name, .js .contact, .js .legal-links { opacity: 0; transform: translateY(14px); }
.js .name, .js .contact, .js .legal-links {
  transition: opacity .9s var(--out), transform 1.1s var(--out), filter .9s var(--out);
}
.js[data-phase="flicker"] .claim,
.js[data-phase="end"] .claim { display: none; }

.js[data-phase="end"] .stack img.final { opacity: 1; }
.js[data-phase="end"] .name { opacity: 1; transform: none; }
.js[data-phase="end"] .contact { opacity: 1; transform: none; transition-delay: .35s; }
.js[data-phase="end"] .legal-links { opacity: 1; transform: none; transition-delay: .8s; }
/* Name „schärft“ sich ein */
.js .name { filter: blur(10px); }
.js[data-phase="end"] .name { filter: blur(0); }

/* Ohne JS: Endzustand (wie oben im Basis-CSS), Bedienelemente aus */
html:not(.js) .controls { display: none; }

/* Ruhige Variante: keine Wörter-Show, kein Flackern – sanft überblenden */
@media (prefers-reduced-motion: reduce) {
  .js .name, .js .contact, .js .legal-links { transform: none !important; filter: none !important; transition: opacity .6s ease; }
}

@media (max-width: 520px) {
  .ctl { padding: 0 12px; }
  .ctl-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .legal-links { gap: 14px; }
}
@media (max-height: 560px) and (orientation: landscape) {
  :root { --logo: min(48vmin, 320px); }
  .name { font-size: clamp(2.6rem, 9vh, 4rem); }
}

/* ===== Rechtstexte ===== */
.legal-page { min-height: 100svh; }
.legal-page .back {
  display: inline-flex; align-items: center; gap: 10px; text-decoration: none;
  font-family: var(--hand); font-weight: 700; font-size: 1.9rem; line-height: 1;
  padding: 20px clamp(16px, 4vw, 40px);
}
.legal-page .back img { width: 40px; height: 40px; }
.legal {
  max-width: 68ch; margin: 0 auto; padding: clamp(16px, 4vw, 40px) 16px 96px;
  font-size: 1.0625rem; line-height: 1.6;
}
.legal h1 { font-family: var(--hand); font-weight: 700; font-size: clamp(3rem, 10vw, 4.5rem); line-height: 1; margin: 0 0 32px; }
.legal h2 { font-size: 1.0625rem; font-weight: 700; margin: 40px 0 8px; }
.legal p { margin: 0 0 12px; }
.legal .ph { background: #FFF1C2; padding: 0 4px; border-radius: 4px; }
.legal-page .legal-links { position: static; padding: 0 16px 32px; justify-content: center; }
