@font-face { font-family: "JetBrains Mono"; src: url(fonts/jetbrains-mono-400.woff2) format("woff2"); font-display: block; }
@font-face { font-family: "Cormorant"; src: url(fonts/cormorant-500.woff2) format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Cormorant"; src: url(fonts/cormorant-500-italic.woff2) format("woff2"); font-weight: 500; font-style: italic; font-display: swap; }

:root {
  --bg: #0b0a09;
  --ink: #ece6da;
  --dim: rgba(236, 230, 218, 0.52);
  --line: rgba(236, 230, 218, 0.14);
  --gold: #d9a54a;
  --pad: clamp(16px, 4vw, 48px);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --schein: drop-shadow(0 0 2px rgba(255, 214, 140, 0.95)) drop-shadow(0 0 7px rgba(232, 176, 82, 0.7)) drop-shadow(0 0 18px rgba(217, 165, 74, 0.45));
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--ink); overflow: hidden; }
body { font: 13px/1.6 "JetBrains Mono", ui-monospace, monospace; -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
:focus-visible { outline: 1px solid var(--gold); outline-offset: 4px; }

#gl { position: fixed; inset: 0; width: 100%; height: 100%; display: block; }

.kicker { margin: 0; color: var(--dim); font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase; }

/* ---- Funke zwischen den Fingern ---- */
.spark {
  position: fixed; z-index: 2; left: var(--sx); top: var(--sy);
  width: 80px; height: 80px; margin: -40px 0 0 -40px; border-radius: 50%;
  opacity: 0;
}
/* feiner Lichtstrich statt Block: heller Kern, weich auslaufende Enden, mehrstufiger Schein */
.caret {
  position: absolute; left: 50%; top: 50%;
  width: 2px; height: calc(var(--cell) * 1.7); translate: -50% -50%; border-radius: 2px;
  background: linear-gradient(transparent, #fff3d6 22%, #ffe7b0 50%, #fff3d6 78%, transparent);
  filter: var(--schein);
  transition: height 0.5s var(--ease);
}
.spark:hover .caret, .spark:focus-visible .caret { height: calc(var(--cell) * 2.4); }
/* Kein Wort nötig: passiert 8 Sekunden lang nichts, klopft der Funke mit einem sanften Lichtring an */
.spark::before {
  content: ""; position: absolute; inset: 50%; width: 0; height: 0; border-radius: 50%; pointer-events: none;
  border: 1px solid rgba(255, 214, 140, 0.55); box-shadow: 0 0 12px rgba(217, 165, 74, 0.35); opacity: 0;
}
.lit .spark::before { animation: anklopfen 4.4s 8s cubic-bezier(0.2, 0.6, 0.3, 1) infinite; }
@keyframes anklopfen {
  0% { inset: 50%; opacity: 0; }
  8% { opacity: 0.9; }
  45% { inset: -60%; opacity: 0; }
  100% { inset: -60%; opacity: 0; }
}
/* kleiner, heller Kern statt flacher Scheibe – den Rest macht das Licht auf den Zeichen */
.glow {
  position: fixed; z-index: 1; left: var(--sx); top: var(--sy);
  width: 120px; height: 120px; margin: -60px 0 0 -60px; border-radius: 50%; pointer-events: none;
  background: radial-gradient(closest-side, rgba(255, 220, 150, 0.22), rgba(217, 165, 74, 0.07) 40%, transparent 72%);
  mix-blend-mode: screen; opacity: 0; transition: opacity 1.6s, transform 1.4s var(--ease);
}
.lit .spark, .lit .glow { opacity: 1; }
/* Blitz beim Zünden: heller Kern und ein feiner Lichtstreif, nur um die Lücke */
.flash { position: fixed; z-index: 1; left: var(--sx); top: var(--sy); pointer-events: none; mix-blend-mode: screen; opacity: 0; }
.flash::before {
  content: ""; position: absolute; width: 320px; height: 320px; left: -160px; top: -160px; border-radius: 50%;
  background: radial-gradient(closest-side, rgba(255, 252, 240, 0.95), rgba(255, 214, 140, 0.45) 22%, rgba(217, 165, 74, 0.12) 50%, transparent);
}
.flash i {
  position: absolute; width: min(70vw, 900px); height: 2px; left: 0; top: -1px; translate: -50% 0;
  background: linear-gradient(90deg, transparent, rgba(255, 226, 170, 0.85) 40%, #fffaf0 50%, rgba(255, 226, 170, 0.85) 60%, transparent);
  box-shadow: 0 0 10px 1px rgba(255, 210, 130, 0.6);
}
.lit .flash { animation: blitz 1.2s cubic-bezier(0.2, 0.7, 0.3, 1) forwards; }
.lit .flash i { animation: streif 1.2s cubic-bezier(0.1, 0.8, 0.2, 1) forwards; }
@keyframes blitz { 0% { opacity: 0; scale: 0.25; } 5% { opacity: 1; scale: 1; } 100% { opacity: 0; scale: 1.5; } }
@keyframes streif { 0% { scale: 0.05 1; } 100% { scale: 1 0.5; } }
.flying .flash { visibility: hidden; }
.unsichtbar { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* Beim Hineinfliegen verschwindet der Funke im Licht */
.flying .spark { opacity: 0 !important; transition: opacity 0.4s !important; pointer-events: none; }
.flying .glow { opacity: 0; transform: scale(9); transition: opacity 1.3s, transform 1.4s cubic-bezier(0.5, 0, 0.75, 0); }

/* ---- Werk: Bild aus Zeichen links, Text rechts ---- */
/* ---- Akt 1: Werkwand ---- */
#wand, #kontakt { position: fixed; inset: 0; z-index: 2; pointer-events: none; }
#wand > *, #kontakt .formular > * { opacity: 0; transition: opacity 0.35s; }
.akt-1 #wand > *, .akt-2 #kontakt .formular > * { opacity: 1; transition: opacity 1.2s var(--ease); }
.titel { position: absolute; top: calc(var(--pad) * 0.7); left: 50%; translate: -50% 0; margin: 0;
  font-size: 11px; letter-spacing: 0.3em; text-transform: uppercase; color: var(--dim); }
.kacheln { position: absolute; inset: 0; }
.kachel { position: absolute; pointer-events: auto; color: inherit; outline: none; }
.kachel .unter { position: absolute; top: calc(100% + 12px); left: 50%; translate: -50% 0; display: grid; justify-items: center; gap: 6px; }
.kachel span { white-space: nowrap; transition: color 0.4s, opacity 0.4s; }
.kachel .name { font: 500 clamp(17px, 1.5vw, 22px)/1.3 "Cormorant", Georgia, serif; }
.kachel .art { font-size: 9px; line-height: 1; letter-spacing: 0.2em; text-transform: uppercase; color: var(--dim); }
.zeigt .kachel .unter > span { opacity: 0.35; }
.zeigt .kachel:hover .unter > span, .zeigt .kachel:focus-visible .unter > span { opacity: 1; }
.kachel:hover .name, .kachel:focus-visible .name { color: var(--gold); }
/* ---- Akt 3: Kontakt – Überschrift links in der Schrift des Fußbereichs, Formular rechts ---- */
.formular {
  position: absolute; top: var(--kontakt-oben); left: 58%; width: min(30rem, 34vw);
  display: grid; grid-template-columns: 1fr; gap: 18px; pointer-events: auto;
}
.akt-2 #kontakt .formular > :nth-child(2) { transition-delay: 0.1s; }
.akt-2 #kontakt .formular > :nth-child(3) { transition-delay: 0.2s; }
.akt-2 #kontakt .formular > :nth-child(4) { transition-delay: 0.3s; }
.formular label { display: grid; gap: 4px; }
.formular .breit { grid-column: 1 / -1; }
.formular label span { font-size: 10px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--dim); transition: color 0.3s; }
.formular label:focus-within span { color: var(--gold); }
.formular input, .formular textarea {
  font: 14px/1.5 "JetBrains Mono", ui-monospace, monospace; color: var(--ink); background: none; border: 0; border-radius: 0;
  border-bottom: 1px solid var(--line); padding: 6px 0; resize: none; outline: none;
  caret-color: var(--gold);   /* der Funke wird zum Cursor */
  transition: border-color 0.3s;
}
.formular input:focus, .formular textarea:focus { border-bottom-color: rgba(217, 165, 74, 0.7); }
.senden { grid-column: 1 / -1; display: flex; align-items: baseline; gap: 22px; flex-wrap: wrap; }
.senden button { font-size: 12px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--gold);
  border-bottom: 1px solid rgba(217, 165, 74, 0.5); padding-bottom: 3px; }
.senden button span { display: inline-block; transition: transform 0.4s var(--ease); }
.sendet .senden button { pointer-events: none; }
/* Glanz: ein Lichtschimmer läuft einmal durch die Buchstaben von „Abschicken“ */
.senden button.glanz {
  color: transparent; -webkit-background-clip: text; background-clip: text;
  background-image: linear-gradient(105deg, var(--gold) 35%, #fff8e6 50%, var(--gold) 65%); background-size: 300% 100%;
  animation: glanz 1s cubic-bezier(0.3, 0, 0.2, 1) forwards;
}
@keyframes glanz { from { background-position: 100% 0; } to { background-position: 0 0; } }
.status { margin: 0; font-size: 11px; color: var(--dim); }
.status a { color: var(--gold); border-bottom: 1px solid rgba(217, 165, 74, 0.4); }
.falle { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
/* nach dem Abschicken: Felder weichen, der Dank blendet ruhig ein */
.danke { position: absolute; top: 0; left: 0; margin: 0; font-size: 12px; letter-spacing: 0.3em; text-transform: uppercase;
  color: var(--ink); opacity: 0 !important; pointer-events: none; transition: opacity 0.4s !important; }
.formular.fertig > :not(.danke) { opacity: 0 !important; pointer-events: none; transition: opacity 0.6s !important; }
.akt-2 .formular.fertig .danke { opacity: 1 !important; transition: opacity 2.4s ease 0.6s !important; }   /* geht mit dem Akt */
.senden button:hover span { transform: translateX(5px); }
.kontakt-titel {
  position: absolute; top: var(--kontakt-oben); left: 8vw; max-width: 40vw; margin: 0;
  font: 400 clamp(16px, 1.6vw, 24px)/1.8 "JetBrains Mono", ui-monospace, monospace;
  letter-spacing: 0.24em; text-transform: uppercase; color: var(--ink);   /* dieselbe Schrift wie Impressum · Datenschutz */
  opacity: 0; transition: opacity 0.4s;
}
.akt-2 .kontakt-titel { opacity: 1; transition: opacity 3s ease 0.4s; }   /* langsam, wie Impressum und Datenschutz */
.kontakt-titel em { font-style: normal; color: var(--gold); }

/* Cursor hinter dem Satz: zündet mit einem kleinen Blitz, sobald der Satz da ist, und steht dann ruhig */
.cursor-funke {
  position: relative; display: inline-block; width: 2px; height: 1em; margin-left: 0.2em; vertical-align: -0.16em;
  background: linear-gradient(transparent, #fff3d6 18%, #ffe7b0 50%, #fff3d6 82%, transparent);
  filter: var(--schein); opacity: 0;
}
.cursor-funke::before, .cursor-funke::after { content: ""; position: absolute; left: 50%; top: 50%; pointer-events: none; opacity: 0; }
.cursor-funke::before {   /* heller Kern */
  width: 2.4em; height: 2.4em; translate: -50% -50%; border-radius: 50%;
  background: radial-gradient(closest-side, rgba(255, 252, 240, 0.95), rgba(255, 214, 140, 0.4) 30%, transparent);
}
.cursor-funke::after {    /* feiner Lichtstreif zur Seite */
  width: 9em; height: 1px; translate: -50% -50%;
  background: linear-gradient(90deg, transparent, rgba(255, 226, 170, 0.9) 45%, #fffaf0 50%, rgba(255, 226, 170, 0.9) 55%, transparent);
}
.akt-2 .cursor-funke { animation: da 0.01s 2.6s forwards; }
.akt-2 .cursor-funke::before { animation: kern 1s 2.6s cubic-bezier(0.2, 0.7, 0.3, 1); }
.akt-2 .cursor-funke::after { animation: streif-klein 1s 2.6s cubic-bezier(0.1, 0.8, 0.2, 1); }
/* beim Abschicken zündet er noch einmal (eigene Namen, damit die Animation neu startet) */
.akt-2.gesendet .cursor-funke::before { animation: kern-2 1s cubic-bezier(0.2, 0.7, 0.3, 1); }
.akt-2.gesendet .cursor-funke::after { animation: streif-klein-2 1s cubic-bezier(0.1, 0.8, 0.2, 1); }
@keyframes da { to { opacity: 1; } }
@keyframes kern { 0% { opacity: 0; scale: 0.3; } 6% { opacity: 1; scale: 1; } 100% { opacity: 0; scale: 1.4; } }
@keyframes kern-2 { 0% { opacity: 0; scale: 0.3; } 6% { opacity: 1; scale: 1; } 100% { opacity: 0; scale: 1.4; } }
@keyframes streif-klein { 0% { opacity: 1; scale: 0.05 1; } 100% { opacity: 0; scale: 1 1; } }
@keyframes streif-klein-2 { 0% { opacity: 1; scale: 0.05 1; } 100% { opacity: 0; scale: 1 1; } }

/* ---- Impressum · Datenschutz: ganz unten, blendet lange nach dem Funken sanft ein ---- */
.fuss {
  position: fixed; z-index: 3; left: 50%; bottom: max(14px, env(safe-area-inset-bottom)); translate: -50% 0;
  display: flex; gap: 10px; font-size: 10px; letter-spacing: 0.16em; text-transform: uppercase;
  color: rgba(236, 230, 218, 0.3); opacity: 0; transition: opacity 3s 3s;
}
.fuss a { transition: color 0.3s; }
.fuss a:hover { color: var(--ink); }
.lit .fuss { opacity: 1; }
/* nur während die Zeichen fließen weg, in allen Akten sichtbar */
.flying:not(.akt-1):not(.akt-2) .fuss { opacity: 0; pointer-events: none; transition: opacity 0.4s; }
.akt-2 .zum-kontakt { color: var(--gold); pointer-events: none; }
.akt-1 .fuss, .akt-2 .fuss { transition: opacity 1.2s 0.4s; }

/* Handy: Formular einspaltig, Pfeile unten rechts */
@media (max-aspect-ratio: 9/10) {
  .formular { top: calc(var(--kontakt-oben) + 96px); left: var(--pad); right: var(--pad); width: auto; gap: 12px; }
  .kontakt-titel { left: var(--pad); right: var(--pad); max-width: none; text-align: center; font-size: 17px; }
}

.no-gl .spark, .no-gl .glow { display: none; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition-duration: 0.01s !important; transition-delay: 0s !important; }
}
