/*
 * Daysi – Platzhalter für daysi.studio (Apex) und 404-Seite.
 * Strikte CSP: keine Inline-Styles, alles hier. Keine externen Requests.
 * Motiv: der Daysi-Torbogen als Ort. Die Sonne geht darin auf, die Zettel
 * des Tages ordnen sich zu einer Spalte, am Ende steht das Logo selbst da.
 * Animiert werden nur transform und opacity.
 */

@font-face {
  font-family: 'Fraunces';
  src: url('/wartend/assets/fonts/fraunces-latin-400-normal.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Inter';
  src: url('/wartend/assets/fonts/inter-latin-400-normal.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Inter';
  src: url('/wartend/assets/fonts/inter-latin-600-normal.woff2') format('woff2');
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

/* ---------- Tokens: Morgengrau (hell) ---------- */
:root {
  color-scheme: light dark;
  --bg: #e6e9ea;
  --bg-warm: #f1e3c2;
  --ink: #282319;
  --ink-soft: #4b463d;
  --gold: #f5cb69;
  --gold-hover: #e4bb58;
  --gold-border: #ae8615;
  --on-gold: #1c1505;
  --focus: #6c5100;

  --sky-top: #b9c8d3;
  --sky-mid: #ecdcb8;
  --sky-low: #f8d887;
  --sun-core: #fff3cf;
  --sun-edge: #f5cb69;
  --glow: #f5cb69;
  --glow-a: 0.55;
  --ray: #fff6dc;
  --ray-a: 0.35;
  --floor-top: #d8c79f;
  --floor-low: #c7b78f;
  --ground-top: #d6d6cf;
  --ground-low: #e6e9ea;
  --beam-a: 0.45;
  --arch: #282319;
  --arch-depth: #b8b2a4;
  --arch-rim: #f5cb69;
  --slip: #fdfcf9;
  --slip-line: #282319;
  --slip-edge: rgba(40, 35, 25, 0.16);
  --slip-shadow: rgba(40, 35, 25, 0.1);
  --mote: #ae8615;

  --font-ui: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --font-display: 'Fraunces', Georgia, 'Times New Roman', serif;
  --ease-settle: cubic-bezier(0.18, 0.84, 0.22, 1);
}

/* ---------- Tokens: Nacht vor dem Morgen (dunkel) ---------- */
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #14151b;
    --bg-warm: #3a2b17;
    --ink: #f1e8d6;
    --ink-soft: #c4bcab;
    --focus: #f5cb69;

    --sky-top: #161b2b;
    --sky-mid: #3a2f3a;
    --sky-low: #9a6630;
    --sun-core: #ffe6a6;
    --sun-edge: #e9a94a;
    --glow: #e9a94a;
    --glow-a: 0.42;
    --ray: #ffd98a;
    --ray-a: 0.14;
    --floor-top: #3a2d1c;
    --floor-low: #261e14;
    --ground-top: #221f1b;
    --ground-low: #14151b;
    --beam-a: 0.28;
    --arch: #f1e8d6;
    --arch-depth: #3c372e;
    --arch-rim: #f5cb69;
    --slip: #24221e;
    --slip-line: #f1e8d6;
    --slip-edge: rgba(241, 232, 214, 0.14);
    --slip-shadow: rgba(0, 0, 0, 0.35);
    --mote: #f5cb69;
  }
}

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

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100svh;
  background-color: var(--bg);
  background-image:
    radial-gradient(ellipse 70% 60% at 72% 62%, color-mix(in srgb, var(--bg-warm) 70%, transparent), transparent 70%);
  background-repeat: no-repeat;
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: 1.0625rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

a { color: inherit; }

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

/* ---------- Seitenraster ---------- */
.page {
  min-height: 100vh;
  min-height: 100svh;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-areas:
    'brand'
    'stage'
    'copy'
    'foot';
  grid-template-rows: auto auto 1fr auto;
  padding: 20px 16px 16px;
  max-width: 1360px;
  margin: 0 auto;
}

.brand { grid-area: brand; }
.copy  { grid-area: copy; }
.stage { grid-area: stage; }
.foot  { grid-area: foot; }

@media (min-width: 960px) {
  .page {
    grid-template-columns: minmax(24rem, 0.9fr) minmax(0, 1.1fr);
    grid-template-areas:
      'brand stage'
      'copy  stage'
      'foot  foot';
    grid-template-rows: auto 1fr auto;
    column-gap: clamp(24px, 4vw, 72px);
    padding: 32px clamp(24px, 4vw, 56px) 24px;
  }
}

/* ---------- Marke ---------- */
.brand-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  padding: 4px 6px 4px 0;
}

.logo {
  width: 34px;
  height: 34px;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.logo-arch { stroke: var(--ink); }
.logo-sun { stroke: var(--gold-border); }
@media (prefers-color-scheme: dark) {
  .logo-sun { stroke: var(--gold); }
}

.brand-name {
  font-family: var(--font-display);
  font-size: 1.6rem;
  line-height: 1;
  letter-spacing: 0.01em;
}

/* ---------- Text ---------- */
.copy {
  align-self: center;
  max-width: 34rem;
  padding: 8px 0 32px;
}

.title {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(2.25rem, 1.4rem + 3.6vw, 4.4rem);
  line-height: 1.04;
  letter-spacing: -0.015em;
  margin: 0 0 0.5em;
  text-wrap: balance;
}

.lead {
  font-size: clamp(1.0625rem, 1rem + 0.3vw, 1.25rem);
  line-height: 1.6;
  margin: 0 0 1em;
  max-width: 32em;
}

.sub {
  color: var(--ink-soft);
  margin: 0 0 1.8em;
  max-width: 32em;
}

.is-lost .lead { margin-bottom: 1.8em; }

.actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px 24px;
  margin: 0;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  padding: 0 32px;
  border-radius: 999px;
  border: 1px solid var(--gold-border);
  background: var(--gold);
  color: var(--on-gold);
  font-weight: 600;
  font-size: 1.0625rem;
  text-decoration: none;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.5) inset, 0 10px 24px -10px rgba(174, 134, 21, 0.75);
  transition: background-color 0.18s ease, transform 0.18s ease;
}
.btn:hover { background: var(--gold-hover); transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn:focus-visible { border-radius: 999px; }

.btn-quiet {
  color: var(--ink);
  font-weight: 600;
  text-underline-offset: 0.25em;
  text-decoration-thickness: 1px;
  padding: 12px 2px;
}
.btn-quiet:hover { text-decoration-thickness: 2px; }

/* ---------- Fuß ---------- */
.foot {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 8px 24px;
  padding-top: 20px;
  font-size: 0.9375rem;
  color: var(--ink-soft);
}

.foot-links {
  display: flex;
  gap: 4px 22px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.foot-links a {
  display: inline-block;
  padding: 8px 0;
  text-underline-offset: 0.25em;
}
.foot-links a:hover { color: var(--ink); }

.foot-copy { margin: 0; }

/* ---------- Bühne ---------- */
.stage {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 4px -16px 0;
  min-width: 0;
  pointer-events: none;
}

.scene {
  display: block;
  width: 100%;
  height: auto;
  max-height: 56svh;
  overflow: visible;
}

@media (min-width: 960px) {
  .stage { margin: 0; }
  .scene { max-height: min(88vh, 860px); }
}

/* Farben im SVG (Verläufe über Klassen, keine Inline-Styles) */
.st-sky-top { stop-color: var(--sky-top); }
.st-sky-mid { stop-color: var(--sky-mid); }
.st-sky-low { stop-color: var(--sky-low); }
.st-sun-core { stop-color: var(--sun-core); }
.st-sun-edge { stop-color: var(--sun-edge); }
.st-glow-in { stop-color: var(--glow); stop-opacity: var(--glow-a); }
.st-glow-out { stop-color: var(--glow); stop-opacity: 0; }
.st-floor-top { stop-color: var(--floor-top); }
.st-floor-low { stop-color: var(--floor-low); }
.st-beam-in { stop-color: var(--glow); stop-opacity: var(--beam-a); }
.st-beam-out { stop-color: var(--glow); stop-opacity: 0; }
.st-ground-top { stop-color: var(--ground-top); }
.st-ground-low { stop-color: var(--ground-low); stop-opacity: 0; }

.layer { will-change: transform; }

.mote { fill: var(--mote); opacity: 0.5; }
.rays path { fill: var(--ray); }
.rays { opacity: var(--ray-a); transform-box: view-box; transform-origin: 320px 600px; }
.horizon { stroke: var(--arch); stroke-opacity: 0.25; stroke-width: 1.5; }

.arch,
.arch-depth,
.arch-rim,
.sun-arc {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.arch-depth { stroke: var(--arch-depth); stroke-width: 22; transform: translate(10px, 6px); }
.arch { stroke: var(--arch); stroke-width: 18; }
.arch-rim { stroke: var(--arch-rim); stroke-width: 2; stroke-opacity: 0.6; }
.sun-arc { stroke: var(--gold); stroke-width: 18; }

.slip-shadow { fill: var(--slip-shadow); }
.slip-card { fill: var(--slip); stroke: var(--slip-edge); stroke-width: 1; }
.ln { fill: var(--slip-line); opacity: 0.72; }
.ln2 { opacity: 0.32; }
.mark-you { fill: none; stroke: var(--slip-line); stroke-width: 1.8; opacity: 0.8; }
.mark-ki { fill: var(--gold-border); }
@media (prefers-color-scheme: dark) { .mark-ki { fill: var(--gold); } }
.done circle { fill: var(--gold); }
.done path { fill: none; stroke: var(--on-gold); stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }

.timeline circle { fill: var(--arch); opacity: 0.35; }
.tl-line { stroke: var(--arch); stroke-opacity: 0.25; stroke-width: 1.5; stroke-dasharray: 2 5; stroke-linecap: round; }

.cursor { fill: var(--ink); stroke: var(--bg); stroke-width: 2; stroke-linejoin: round; }
.spark { fill: var(--gold); }
.spark-sm { opacity: 0.8; }

/* Zettel drehen sich um ihre eigene Mitte */
.slip,
.buddy,
.sunrise {
  transform-box: fill-box;
  transform-origin: 50% 50%;
}

/* 404: ein Zettel ist aus dem Bogen gefallen und liegt auf dem Boden */
.scene--lost .s6 { transform: translate(176px, 196px) rotate(-11deg); }
.scene--lost .s6 .slip-card { stroke: var(--gold-border); stroke-dasharray: 4 4; }

/* ---------- Bewegung (nur ohne „Bewegung reduzieren“) ---------- */
@media (prefers-reduced-motion: no-preference) {
  .sunrise { animation: rise 3s cubic-bezier(0.2, 0.7, 0.1, 1) 0.15s backwards; }
  .sun-arc { animation: fade-in 1.2s ease 2.6s backwards; }
  .rays {
    animation:
      rays-in 2.4s ease 1.2s backwards,
      spin 220s linear 0s infinite;
  }
  .aura { animation: breathe 9s ease-in-out 3s infinite alternate; transform-box: fill-box; transform-origin: 50% 50%; }

  .slip { animation: settle 1.8s var(--ease-settle) backwards; }
  .s1 { --from: translate(-200px, -130px) rotate(-18deg); animation-delay: 0.9s; }
  .s2 { --from: translate(190px, -160px) rotate(15deg);   animation-delay: 1.05s; }
  .s3 { --from: translate(-230px, 30px) rotate(10deg);    animation-delay: 1.2s; }
  .s4 { --from: translate(215px, 20px) rotate(-12deg);    animation-delay: 1.35s; }
  .s5 { --from: translate(-190px, 190px) rotate(-8deg);   animation-delay: 1.5s; }
  .s6 { --from: translate(200px, 200px) rotate(17deg);    animation-delay: 1.65s; }
  .scene--lost .s6 { --from: translate(40px, -140px) rotate(6deg); animation-duration: 2.6s; animation-delay: 1.9s; }

  .timeline { animation: fade-in 1.4s ease 2.7s backwards; }
  .s1 .done { animation: pop 0.5s cubic-bezier(0.3, 1.6, 0.5, 1) 3.4s backwards; }
  .s3 .done { animation: pop 0.5s cubic-bezier(0.3, 1.6, 0.5, 1) 3.9s backwards; }
  .done { transform-box: fill-box; transform-origin: 50% 50%; }

  .buddy-you { animation: fade-in 1.2s ease 2.9s backwards, bob 7s ease-in-out 4s infinite; }
  .buddy-ki { animation: fade-in 1.2s ease 3.1s backwards, bob 6s ease-in-out 4.2s infinite reverse; }
  .spark-glow { animation: twinkle 3.6s ease-in-out infinite alternate; }

  .mote { animation: twinkle 5s ease-in-out infinite alternate; }
  .m2 { animation-duration: 7s; animation-delay: -2s; }
  .m3 { animation-duration: 6s; animation-delay: -4s; }
  .m4 { animation-duration: 8s; animation-delay: -1s; }
  .m5 { animation-duration: 5.5s; animation-delay: -3s; }
  .m6 { animation-duration: 9s; animation-delay: -5s; }
  .m7 { animation-duration: 6.5s; animation-delay: -2.5s; }
  .m8 { animation-duration: 7.5s; animation-delay: -6s; }

  .copy > * { animation: fade-in 0.9s ease backwards; }
  .copy > :nth-child(2) { animation-delay: 0.12s; }
  .copy > :nth-child(3) { animation-delay: 0.24s; }
  .copy > :nth-child(4) { animation-delay: 0.36s; }
}

@keyframes rise {
  from { transform: translateY(150px); opacity: 0.25; }
}
@keyframes settle {
  from { transform: var(--from); opacity: 0; }
  35% { opacity: 1; }
}
@keyframes fade-in {
  from { opacity: 0; }
}
@keyframes rays-in {
  from { opacity: 0; }
}
@keyframes spin {
  to { transform: rotate(360deg); }
}
@keyframes breathe {
  from { transform: scale(0.96); opacity: 0.85; }
  to { transform: scale(1.04); opacity: 1; }
}
@keyframes pop {
  from { transform: scale(0.2); opacity: 0; }
}
@keyframes bob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}
@keyframes twinkle {
  from { opacity: 0.15; }
  to { opacity: 0.85; }
}

/* ---------- Schmale Geräte ---------- */
@media (max-width: 420px) {
  .page { padding-top: 16px; }
  .brand-name { font-size: 1.45rem; }
  .btn { width: 100%; }
  .foot { flex-direction: column; align-items: flex-start; }
}
