/* Schriften liegen lokal, nichts wird extern geladen. */
@font-face {
  font-family: "Archivo Black";
  font-weight: 400;
  font-display: swap;
  src: url("/fonts/archivo-black-400.woff2") format("woff2");
}
@font-face {
  font-family: "Space Mono";
  font-weight: 400;
  font-display: swap;
  src: url("/fonts/space-mono-400.woff2") format("woff2");
}
@font-face {
  font-family: "Space Mono";
  font-weight: 700;
  font-display: swap;
  src: url("/fonts/space-mono-700.woff2") format("woff2");
}

/* Warnschild-Brutalismus: eine Optik für alle, bewusst ohne Dark Mode. */
:root {
  --gelb: #FFE600;
  --schwarz: #0A0A0A;
  --alarm: #FF3B1F;
  --papier: #FFFDF0;
  --rost: #7A1200;
  color-scheme: light;
}

html { scroll-behavior: smooth; }
body { background: var(--papier); color: var(--schwarz); font-family: "Space Mono", ui-monospace, monospace; }

h1, h2, h3 { text-wrap: balance; }
.uppercase.text-xs, .uppercase.text-sm { letter-spacing: .05em; }

.brut { border: 4px solid var(--schwarz); box-shadow: 8px 8px 0 var(--schwarz); }
.brut-sm { border: 3px solid var(--schwarz); box-shadow: 4px 4px 0 var(--schwarz); }
.brut-alarm { box-shadow: 8px 8px 0 var(--alarm); }
.brut-gelb { box-shadow: 10px 10px 0 var(--gelb); }

/* Buttons sinken beim Hovern nach unten. Natürlich. */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  font-family: "Archivo Black", Impact, sans-serif; text-transform: uppercase; letter-spacing: .02em;
  border: 4px solid var(--schwarz); box-shadow: 6px 6px 0 var(--schwarz);
  padding: .9rem 1.4rem; transition: transform .12s, box-shadow .12s; cursor: pointer;
}
.btn:hover { transform: translate(6px, 10px); box-shadow: 0 0 0 var(--schwarz); }
.btn:active { transform: translate(6px, 16px); }
.btn[disabled] { opacity: .6; cursor: wait; }
.btn-on-dark { border-color: var(--gelb); box-shadow: 6px 6px 0 var(--gelb); }
.btn:focus-visible, a:focus-visible, input:focus-visible, summary:focus-visible { outline: 4px dashed var(--alarm); outline-offset: 4px; }

.stripes { background: repeating-linear-gradient(-45deg, var(--gelb) 0 22px, var(--schwarz) 22px 44px); }

.blink { animation: blink 1s steps(2) infinite; }
@keyframes blink { 50% { opacity: 0; } }

.card { transition: transform .15s, box-shadow .15s; }
.card:hover { transform: translateY(8px) rotate(-.6deg); box-shadow: 2px 2px 0 var(--schwarz); }

/* Status-Zeile, die gerade ausgetauscht wurde */
.flash { animation: flash .6s steps(3); }
@keyframes flash { 0%, 66% { background: var(--gelb); } }

.meter-fill { transition: width .06s linear; }

.msg-bot, .msg-user { max-width: 85%; padding: .75rem 1rem; border: 3px solid var(--schwarz); overflow-wrap: anywhere; }
.msg-bot { background: var(--schwarz); color: var(--gelb); box-shadow: 4px 4px 0 var(--alarm); }
.msg-user { margin-left: auto; background: var(--gelb); text-align: right; box-shadow: 4px 4px 0 var(--schwarz); }

details > summary { list-style: none; cursor: pointer; }
details > summary::-webkit-details-marker { display: none; }
details[open] .plus { transform: rotate(45deg); }

.unten-zone { background: linear-gradient(var(--schwarz) 0%, #3A2A00 15%, var(--alarm) 45%, var(--rost) 70%, #000 100%); }

/* Feste Elemente halten Abstand zu Notch und Home-Leiste. */
#up-btn {
  right: calc(1rem + env(safe-area-inset-right, 0px));
  bottom: calc(1rem + env(safe-area-inset-bottom, 0px));
}
#cookie {
  left: calc(1rem + env(safe-area-inset-left, 0px));
  bottom: calc(1rem + env(safe-area-inset-bottom, 0px));
}
#depth-meter {
  left: calc(1rem + env(safe-area-inset-left, 0px));
  top: calc(1rem + env(safe-area-inset-top, 0px));
}
#toast { top: calc(1rem + env(safe-area-inset-top, 0px)); }

/* Am Handy liegt der Cookie-Banner über dem „Nach oben“-Button statt darauf. */
@media (max-width: 639px) {
  #cookie {
    right: calc(1rem + env(safe-area-inset-right, 0px));
    bottom: calc(5rem + env(safe-area-inset-bottom, 0px));
  }
}

/* Sanfte Bewegung. Animiert werden nur opacity, translate und scale,
   damit Hover-Transforms und die Tailwind-Rotationen unberührt bleiben. */
@media (prefers-reduced-motion: no-preference) {
  /* Hero baut sich beim Laden kurz nacheinander auf. */
  .rise { animation: rise .9s cubic-bezier(.16, 1, .3, 1) both; animation-delay: var(--d, 0s); }
  @keyframes rise { from { opacity: 0; translate: 0 28px; } }

  .stop-gag { animation: rise .6s cubic-bezier(.16, 1, .3, 1) both; }

  /* Beim Scrollen gleiten Inhalte herein. Ohne Browser-Support ist einfach alles sofort da. */
  @supports (animation-timeline: view()) {
    .reveal {
      animation: reveal linear both;
      animation-timeline: view();
      animation-range: entry 0% entry 70%;
    }
    @keyframes reveal { from { opacity: 0; translate: 0 56px; scale: .97; } }

    .reveal-head {
      animation: reveal-head linear both;
      animation-timeline: view();
      animation-range: entry 0% cover 35%;
    }
    @keyframes reveal-head { from { opacity: 0; translate: 0 40px; scale: .92; } }
  }
}

@media (prefers-reduced-motion: reduce) {
  .blink, .flash { animation: none; }
  .card:hover, .btn:hover, .btn:active { transform: none; }
  html { scroll-behavior: auto; }
}
