/* ==========================================================================
   kurz.dev — die Website
   Dunkler Aubergine-Grund, Aurora aus Cyan, Magenta und Gold.
   Ein orchestrierter Ladeauftritt, ein Übergang beim Kürzen, Glow am Feld.
   ========================================================================== */

@font-face {
  font-family: 'Archivo';
  src: url('schriften/Archivo.woff2') format('woff2');
  font-weight: 100 900;
  font-display: swap;
}
@font-face {
  font-family: 'JetBrains Mono';
  src: url('schriften/JetBrainsMono.woff2') format('woff2');
  font-weight: 100 800;
  font-display: swap;
}

:root {
  /* Grund — tiefes Aubergine statt Standard-Nachtblau */
  --nacht: #140B24;
  --nacht-tief: #0C0618;
  --flaeche: #1E1233;
  --flaeche-hoch: #291845;

  /* Aurora — die drei Lichter */
  --cyan: #00E5FF;
  --magenta: #FF3D9A;
  --gold: #FFB800;

  /* Text */
  --hell: #F4EEFF;
  --leise: #A996C4;

  --rand: #3B2A5C;

  --anzeige: 'Archivo', system-ui, sans-serif;
  --daten: 'JetBrains Mono', ui-monospace, Consolas, monospace;
  --text: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;

  --verlauf: linear-gradient(100deg, var(--cyan), var(--magenta) 55%, var(--gold));
  --radius: 18px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--nacht);
  color: var(--hell);
  font-family: var(--text);
  font-size: 17px;
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-text-size-adjust: 100%;
}

/* --- Aurora: drei langsam driftende Lichtflächen ------------------------- */
.aurora {
  position: fixed;
  inset: -30vmax;
  z-index: 0;
  pointer-events: none;
  filter: blur(120px);
  /* Bewusst gedämpft: Bei höherer Deckung sitzt der Text auf hellem statt auf
     dunklem Grund, und die Seite wird unlesbar. Die Aurora ist Atmosphäre,
     nicht Fläche. */
  opacity: 0.34;
}
.aurora span {
  position: absolute;
  display: block;
  width: 46vmax;
  height: 46vmax;
  border-radius: 50%;
  mix-blend-mode: screen;
}

/* Dunkelzone unter dem Inhalt: Sie holt den Kontrast zurück, ohne die Aurora
   an den Rändern zu beschneiden. */
.tiefe {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    radial-gradient(ellipse 90% 60% at 50% 32%, rgba(12,6,24,0.88), rgba(12,6,24,0.45) 55%, transparent 78%),
    linear-gradient(180deg, rgba(12,6,24,0.55), transparent 22%, transparent 70%, rgba(12,6,24,0.75));
}
.aurora .a1 { background: var(--cyan);    top: 8%;  left: 4%;  animation: drift1 22s ease-in-out infinite; }
.aurora .a2 { background: var(--magenta); top: 34%; left: 46%; animation: drift2 27s ease-in-out infinite; }
.aurora .a3 { background: var(--gold);    top: 60%; left: 16%; animation: drift3 31s ease-in-out infinite; opacity: 0.7; }

@keyframes drift1 {
  0%,100% { transform: translate3d(0,0,0) scale(1); }
  50%     { transform: translate3d(14vmax,10vmax,0) scale(1.18); }
}
@keyframes drift2 {
  0%,100% { transform: translate3d(0,0,0) scale(1.1); }
  50%     { transform: translate3d(-16vmax,8vmax,0) scale(0.9); }
}
@keyframes drift3 {
  0%,100% { transform: translate3d(0,0,0) scale(0.95); }
  50%     { transform: translate3d(10vmax,-12vmax,0) scale(1.2); }
}

/* Feines Korn über der Aurora — nimmt dem Verlauf das Banding */
.koernung {
  position: fixed;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)'/%3E%3C/svg%3E");
}

.buehne { position: relative; z-index: 3; }

/* --- Auftritt beim Laden ------------------------------------------------- */
[data-auftritt] {
  opacity: 0;
  transform: translateY(22px);
  animation: auftritt 0.85s cubic-bezier(.16,1,.3,1) forwards;
}
[data-auftritt="1"] { animation-delay: 0.05s; }
[data-auftritt="2"] { animation-delay: 0.16s; }
[data-auftritt="3"] { animation-delay: 0.27s; }
[data-auftritt="4"] { animation-delay: 0.38s; }
[data-auftritt="5"] { animation-delay: 0.49s; }
[data-auftritt="6"] { animation-delay: 0.60s; }

@keyframes auftritt {
  to { opacity: 1; transform: none; }
}

/* --- Kopf ---------------------------------------------------------------- */
.kopf {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  max-width: 74rem;
  margin: 0 auto;
  padding: 1.6rem 1.5rem 0;
}
.marke {
  font-family: var(--anzeige);
  font-weight: 800;
  font-size: 1.35rem;
  letter-spacing: -0.035em;
  margin: 0;
}
.marke b {
  font-weight: 800;
  background: var(--verlauf);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.kopf-nav { display: flex; gap: 1.4rem; font-size: 0.9rem; }
.kopf-nav a { color: var(--leise); text-decoration: none; transition: color 0.25s; }
.kopf-nav a:hover { color: var(--hell); }

/* --- Held ---------------------------------------------------------------- */
.held {
  max-width: 54rem;
  margin: 0 auto;
  padding: clamp(3rem, 9vw, 6.5rem) 1.5rem 3rem;
  text-align: center;
}

.wimpel {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-size: 0.8rem;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--leise);
  border: 1px solid var(--rand);
  border-radius: 999px;
  padding: 0.42rem 1rem;
  background: rgba(30,18,51,0.6);
  backdrop-filter: blur(8px);
  margin-bottom: 1.6rem;
}
.punkt {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 0 0 rgba(0,229,255,0.7);
  animation: puls 2.4s ease-out infinite;
}
@keyframes puls {
  0%   { box-shadow: 0 0 0 0 rgba(0,229,255,0.65); }
  70%  { box-shadow: 0 0 0 11px rgba(0,229,255,0); }
  100% { box-shadow: 0 0 0 0 rgba(0,229,255,0); }
}

.held h1 {
  font-family: var(--anzeige);
  font-weight: 800;
  font-size: clamp(2.6rem, 8.5vw, 5.5rem);
  line-height: 0.98;
  letter-spacing: -0.045em;
  margin: 0 0 1.1rem;
}
.leuchtet {
  background: var(--verlauf);
  background-size: 220% auto;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: wandern 7s linear infinite;
}
@keyframes wandern {
  to { background-position: 220% center; }
}

.held-text {
  color: var(--leise);
  font-size: clamp(1rem, 2.4vw, 1.2rem);
  max-width: 34rem;
  margin: 0 auto;
}

/* --- Das Feld: der Held der Seite ---------------------------------------- */
.werkbank {
  max-width: 46rem;
  margin: 2.6rem auto 0;
  padding: 0 1.5rem;
  position: relative;
}

.feldrahmen {
  position: relative;
  border-radius: var(--radius);
  padding: 2px;
  background: linear-gradient(120deg, var(--rand), var(--rand));
  transition: background 0.45s ease;
}
/* Der Verlaufsring erscheint bei Fokus — und wandert */
.feldrahmen::before {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: calc(var(--radius) + 1px);
  background: var(--verlauf);
  background-size: 200% auto;
  opacity: 0;
  transition: opacity 0.4s ease;
  animation: wandern 5s linear infinite;
  z-index: 0;
}
.feldrahmen:focus-within::before { opacity: 1; }
.feldrahmen:focus-within { box-shadow: 0 0 46px -8px rgba(255,61,154,0.5); }

.feldinhalt {
  position: relative;
  z-index: 1;
  display: flex;
  gap: 0.6rem;
  align-items: center;
  background: #17102A;
  border-radius: calc(var(--radius) - 2px);
  padding: 0.6rem 0.6rem 0.6rem 1.2rem;
}

.feldinhalt input {
  flex: 1;
  min-width: 0;
  background: none;
  border: 0;
  outline: none;
  color: var(--hell);
  font-family: var(--daten);
  font-size: 1.03rem;
  padding: 0.95rem 0;
}
.feldinhalt input::placeholder { color: #6E5B90; }

/* --- Knopf --------------------------------------------------------------- */
.knopf {
  position: relative;
  overflow: hidden;
  border: 0;
  border-radius: calc(var(--radius) - 4px);
  padding: 1rem 1.7rem;
  font-family: var(--anzeige);
  font-weight: 800;
  font-size: 1rem;
  letter-spacing: -0.01em;
  color: #12071F;
  background: var(--verlauf);
  background-size: 200% auto;
  cursor: pointer;
  white-space: nowrap;
  transition: transform 0.18s cubic-bezier(.34,1.56,.64,1), box-shadow 0.3s;
  box-shadow: 0 10px 30px -10px rgba(255,61,154,0.65);
}
.knopf:hover { transform: translateY(-2px) scale(1.02); background-position: 100% center; box-shadow: 0 16px 40px -10px rgba(0,229,255,0.6); }
.knopf:active { transform: translateY(0) scale(0.99); }
.knopf[disabled] { opacity: 0.6; cursor: progress; transform: none; }

/* Lichtstreif beim Überfahren */
.knopf::after {
  content: "";
  position: absolute;
  top: 0; left: -120%;
  width: 60%; height: 100%;
  background: linear-gradient(100deg, transparent, rgba(255,255,255,0.45), transparent);
  transition: left 0.6s ease;
}
.knopf:hover::after { left: 130%; }

.unterfeld {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.4rem;
  justify-content: center;
  margin-top: 1.1rem;
  font-size: 0.85rem;
  color: var(--leise);
}
.unterfeld span { display: inline-flex; align-items: center; gap: 0.4rem; }
.haken { color: var(--cyan); font-weight: 700; }

/* --- Optionen ------------------------------------------------------------ */
.optionen {
  margin-top: 1.2rem;
  border-radius: 14px;
  border: 1px solid var(--rand);
  background: rgba(30,18,51,0.5);
  backdrop-filter: blur(10px);
  overflow: hidden;
}
.optionen > summary {
  cursor: pointer;
  padding: 0.85rem 1.2rem;
  font-size: 0.92rem;
  color: var(--leise);
  list-style: none;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  transition: color 0.25s, background 0.25s;
  min-height: 44px;
}
.optionen > summary::-webkit-details-marker { display: none; }
.optionen > summary:hover { color: var(--hell); background: rgba(255,255,255,0.03); }
.pfeil { transition: transform 0.3s cubic-bezier(.16,1,.3,1); }
.optionen[open] .pfeil { transform: rotate(90deg); }

.optionen-raster {
  display: grid;
  gap: 1rem;
  padding: 0.3rem 1.2rem 1.3rem;
  grid-template-columns: 1fr;
}
@media (min-width: 34rem) { .optionen-raster { grid-template-columns: 1fr 1fr; } }

.opt label { display: block; font-size: 0.8rem; color: var(--leise); margin-bottom: 0.35rem; }
.opt input {
  width: 100%;
  background: #17102A;
  border: 1px solid var(--rand);
  border-radius: 10px;
  color: var(--hell);
  font-family: var(--daten);
  font-size: 0.95rem;
  padding: 0.7rem 0.85rem;
  min-height: 44px;
  transition: border-color 0.25s, box-shadow 0.25s;
}
.opt input:focus {
  outline: none;
  border-color: var(--cyan);
  box-shadow: 0 0 0 3px rgba(0,229,255,0.18);
}
.opt .affix { display: flex; align-items: center; }
.opt .affix .vor {
  font-family: var(--daten);
  font-size: 0.9rem;
  color: var(--leise);
  background: #17102A;
  border: 1px solid var(--rand);
  border-right: 0;
  border-radius: 10px 0 0 10px;
  padding: 0 0.7rem;
  height: 44px;
  display: flex;
  align-items: center;
}
.opt .affix input { border-radius: 0 10px 10px 0; }

/* --- Fehler -------------------------------------------------------------- */
.fehler {
  display: none;
  align-items: flex-start;
  gap: 0.6rem;
  margin-top: 0.9rem;
  padding: 0.85rem 1.1rem;
  border-radius: 12px;
  border: 1px solid rgba(255,61,154,0.45);
  background: rgba(255,61,154,0.09);
  color: #FFC2DE;
  font-size: 0.92rem;
  animation: ruckeln 0.4s;
}
.fehler.sichtbar { display: flex; }
@keyframes ruckeln {
  10%,90% { transform: translateX(-1px); }
  20%,80% { transform: translateX(2px); }
  30%,50%,70% { transform: translateX(-4px); }
  40%,60% { transform: translateX(4px); }
}

/* --- Ergebnis ------------------------------------------------------------ */
.ergebnis { display: none; }
.ergebnis.sichtbar { display: block; }

.treffer {
  position: relative;
  border-radius: var(--radius);
  padding: 2px;
  background: var(--verlauf);
  background-size: 200% auto;
  animation: wandern 6s linear infinite;
  box-shadow: 0 24px 70px -22px rgba(0,229,255,0.55);
}
.treffer-innen {
  background: #17102A;
  border-radius: calc(var(--radius) - 2px);
  padding: 1.6rem;
}

.treffer-etikett {
  font-size: 0.74rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--leise);
  margin: 0 0 0.6rem;
}

.kurzlink {
  font-family: var(--daten);
  font-weight: 700;
  font-size: clamp(1.3rem, 5.2vw, 2.1rem);
  margin: 0;
  word-break: normal;
  overflow-wrap: break-word;
  line-height: 1.25;
}
.kurzlink a { color: var(--hell); text-decoration: none; }
.kurzlink a:hover { background: var(--verlauf); -webkit-background-clip: text; background-clip: text; color: transparent; }
.kurzlink .proto { font-size: 0.6em; font-weight: 400; color: var(--leise); }

.treffer-zeile { display: flex; flex-wrap: wrap; gap: 0.7rem; align-items: center; margin-top: 1.2rem; }

.kopierknopf {
  border: 0;
  border-radius: 11px;
  padding: 0.8rem 1.3rem;
  font-family: var(--anzeige);
  font-weight: 700;
  font-size: 0.95rem;
  color: #12071F;
  background: var(--hell);
  cursor: pointer;
  min-height: 44px;
  transition: background 0.3s, color 0.3s, transform 0.16s cubic-bezier(.34,1.56,.64,1);
}
.kopierknopf:hover { transform: translateY(-2px); }
.kopierknopf.fertig { background: var(--cyan); color: #04202A; }

.geist {
  border: 1px solid var(--rand);
  background: transparent;
  color: var(--leise);
  border-radius: 11px;
  padding: 0.8rem 1.1rem;
  font-size: 0.9rem;
  cursor: pointer;
  min-height: 44px;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  transition: border-color 0.25s, color 0.25s, transform 0.16s;
}
.geist:hover { border-color: var(--cyan); color: var(--hell); transform: translateY(-2px); }

.status { font-size: 0.86rem; color: var(--cyan); margin: 0; }

/* QR */
.qr-feld {
  display: flex;
  gap: 1.3rem;
  align-items: center;
  flex-wrap: wrap;
  margin-top: 1.6rem;
  padding-top: 1.4rem;
  border-top: 1px solid var(--rand);
}
.qr-kachel {
  background: #fff;
  border-radius: 12px;
  padding: 10px;
  line-height: 0;
  animation: qrRein 0.7s cubic-bezier(.16,1,.3,1) both;
  animation-delay: 0.25s;
}
.qr-kachel svg { display: block; width: 118px; height: 118px; }
@keyframes qrRein {
  from { opacity: 0; transform: scale(0.82) rotate(-6deg); }
  to   { opacity: 1; transform: none; }
}
.qr-text { font-size: 0.88rem; color: var(--leise); margin: 0; }

/* Verwaltungslink */
.verwaltung {
  margin-top: 1.2rem;
  border-radius: 14px;
  border: 1px solid rgba(255,184,0,0.4);
  background: rgba(255,184,0,0.07);
  padding: 1.2rem;
}
.verwaltung h3 {
  font-family: var(--anzeige);
  font-weight: 800;
  font-size: 1.02rem;
  margin: 0 0 0.5rem;
  color: var(--gold);
}
.verwaltung p { font-size: 0.9rem; color: #E8D9B8; margin: 0 0 0.8rem; }
.verwaltung code {
  display: block;
  font-family: var(--daten);
  font-size: 0.82rem;
  background: #17102A;
  border: 1px solid var(--rand);
  border-radius: 10px;
  padding: 0.75rem;
  overflow-wrap: anywhere;
  color: var(--hell);
  margin-bottom: 0.8rem;
}

/* --- Abschnitte ---------------------------------------------------------- */
.abschnitt { max-width: 74rem; margin: 0 auto; padding: clamp(4rem, 11vw, 7rem) 1.5rem; }
.abschnitt h2 {
  font-family: var(--anzeige);
  font-weight: 800;
  font-size: clamp(1.9rem, 5vw, 3rem);
  letter-spacing: -0.035em;
  margin: 0 0 0.7rem;
  text-align: center;
}
.abschnitt-text { color: var(--leise); text-align: center; max-width: 36rem; margin: 0 auto 3rem; }

.karten { display: grid; gap: 1.2rem; grid-template-columns: 1fr; }
@media (min-width: 46rem) { .karten { grid-template-columns: repeat(3, 1fr); } }

.karte {
  position: relative;
  border-radius: 16px;
  border: 1px solid var(--rand);
  background: rgba(30,18,51,0.55);
  backdrop-filter: blur(12px);
  padding: 1.6rem;
  overflow: hidden;
  transition: transform 0.35s cubic-bezier(.16,1,.3,1), border-color 0.35s;
}
.karte:hover { transform: translateY(-6px); border-color: rgba(0,229,255,0.5); }
/* Lichtsaum, der dem Zeiger folgt */
.karte::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(220px circle at var(--mx, 50%) var(--my, 0%), rgba(0,229,255,0.16), transparent 65%);
  opacity: 0;
  transition: opacity 0.35s;
  pointer-events: none;
}
.karte:hover::before { opacity: 1; }
.karte h3 { font-family: var(--anzeige); font-weight: 800; font-size: 1.12rem; margin: 0.9rem 0 0.5rem; }
.karte p { font-size: 0.94rem; color: var(--leise); margin: 0; }
.karte-zahl {
  font-family: var(--daten);
  font-size: 0.78rem;
  color: var(--cyan);
  letter-spacing: 0.1em;
}

/* Sanftes Einblenden beim Scrollen */
.reveal { opacity: 0; transform: translateY(26px); transition: opacity 0.75s cubic-bezier(.16,1,.3,1), transform 0.75s cubic-bezier(.16,1,.3,1); }
.reveal.da { opacity: 1; transform: none; }

/* --- Fuß ----------------------------------------------------------------- */
.fuss {
  border-top: 1px solid var(--rand);
  padding: 2.2rem 1.5rem 3rem;
  text-align: center;
  color: var(--leise);
  font-size: 0.88rem;
}
.fuss nav { display: flex; flex-wrap: wrap; gap: 0.6rem 1.5rem; justify-content: center; margin-bottom: 1rem; }
.fuss a { color: var(--leise); text-decoration: none; transition: color 0.25s; min-height: 24px; display: inline-flex; align-items: center; }
.fuss a:hover { color: var(--cyan); }

/* --- Fokus, sichtbar und schön ------------------------------------------- */
:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 3px;
  border-radius: 6px;
}
@media (forced-colors: active) {
  :focus-visible { outline: 3px solid Highlight; }
}

/* --- Wer weniger Bewegung will, bekommt weniger Bewegung ----------------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  [data-auftritt] { opacity: 1; transform: none; }
  .reveal { opacity: 1; transform: none; }
}
