@font-face {
  font-family: "GU5 Block";
  src: url("fonts/gu5-block.woff") format("woff");
  font-display: swap;
}

:root {
  --yellow: #FCF514;
  --black: #0F0F0F;
  --speed: 70s;    /* Tempo: wird in boot.js gesetzt (SPEED) */
  --fade: 0.8s;    /* Einblenden nach dem Laden */
}

* {
  box-sizing: border-box;
  margin: 0;
}

html {
  scroll-behavior: smooth;
  -webkit-tap-highlight-color: transparent;
}

body {
  min-height: 100vh;
  background: var(--yellow);
  color: var(--black);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

/* Markierte Schrift überall gelb hinterlegen */
::selection {
  background: var(--yellow);
  color: var(--black);
}

/* Startseite: gar nichts markierbar (gilt auch nach Seitenwechsel ohne Neuladen) */
body:has(main.home) {
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}

/* ---------------------------------------------------------------------------
   Hintergrund: steht fest, nur der Inhalt scrollt darüber.
   Die innere Ebene ist eine Kachel größer als der Bildschirm und wandert
   genau eine Kachel nach rechts unten. Da sich das Muster danach exakt
   wiederholt, ist der Neustart der Schleife unsichtbar.

   Flüssiges Scrollen:
   - Bewegung in ganzen Pixel-Schritten (steps) -> der Browser muss nur
     ~14x pro Sekunde neu zusammensetzen statt 60x, und nichts verschwimmt.
   - Feste Werte in den Keyframes, damit die Grafikkarte die Animation
     komplett allein übernimmt.
   - Feste Höhe (lvh): ändert sich nicht, wenn am Handy die Adressleiste
     beim Scrollen ein-/ausfährt.
   Kachelgröße 960 px (Handy 640 px) muss zu pattern.svg passen. */
.bg {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  height: 100lvh;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
  contain: strict;
}

.bg__layer {
  position: absolute;
  top: -960px;
  left: -960px;
  width: calc(100% + 960px);
  height: calc(100% + 960px);
  background: url("pattern.svg") 0 0 / 960px 960px repeat;
  animation: drift var(--speed) steps(960) var(--drift-delay, 0s) infinite;
  will-change: transform;
  backface-visibility: hidden;
}

/* Seitenwechsel: nur der Inhalt blendet kurz über, der Hintergrund bleibt */
main {
  transition: opacity 0.2s ease;
}

main.is-leaving,
main.is-entering {
  opacity: 0;
}

@keyframes drift {
  from { transform: translate3d(0, 0, 0); }
  to   { transform: translate3d(960px, 960px, 0); }
}

@keyframes drift-sm {
  from { transform: translate3d(0, 0, 0); }
  to   { transform: translate3d(640px, 640px, 0); }
}

/* Beim Laden: erst nur Gelb, dann Icons und Logo sanft einblenden */
.js .bg {
  opacity: 0;
  transition: opacity var(--fade) ease;
}

.js .hero .logo {
  opacity: 0;
  transform: scale(0.97);
  transition: opacity 0.7s ease 0.1s, transform 0.9s cubic-bezier(0.2, 0.8, 0.2, 1) 0.1s;
}

.js.is-ready .bg,
.js.is-ready .hero .logo {
  opacity: 1;
  transform: none;
}

/* ---------------------------------------------------------------------------
   Startbereich mit Logo */
.hero {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  display: grid;
  place-items: center;
  padding: 24px 16px;
}

.logo {
  display: block;
  width: min(clamp(280px, 36vw, 680px), calc(70vh * 1.134));
  height: auto;
  user-select: none;
  -webkit-user-drag: none;
}

/* ---------------------------------------------------------------------------
   Großer Satz in der Logo-Schrift */
.teaser {
  min-height: 100vh;
  min-height: 100svh;
  display: grid;
  place-items: center;
  padding: 12vh 16px;
}

.big {
  display: grid;
  max-width: 13ch;
  font-family: "GU5 Block", Impact, sans-serif;
  font-weight: normal;
  font-size: clamp(46px, 9vw, 156px);
  line-height: 1.04;
  text-align: center;
  text-wrap: balance;
}

/* Drei Ebenen exakt übereinander (ohne teure Filter):
   schwarze 3D-Kante, weißer Sticker-Rand, eigentlicher Text. */
.big > span {
  grid-area: 1 / 1;
  position: relative;
}

.big__shadow,
.big__outline {
  -webkit-text-stroke: 0.12em currentColor;
  user-select: none;
}

.big__shadow {
  top: 0.05em;
  left: 0.05em;
  color: var(--black);
}

.big__outline {
  color: #fff;
}

.big__text {
  color: var(--black);
}

.js .reveal {
  opacity: 0;
  transform: translateY(40px) scale(0.98);
  transition: opacity 0.8s ease, transform 1s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.js .reveal.is-visible {
  opacity: 1;
  transform: none;
}

/* ---------------------------------------------------------------------------
   Unterseiten (Impressum, Datenschutz) */
.page {
  min-height: calc(100vh - 120px);
  display: grid;
  place-items: center;
  padding: 48px 16px;
}

.card {
  width: min(100%, 680px);
  padding: clamp(24px, 5vw, 44px);
  background: #fff;
  border: 4px solid var(--black);
  border-radius: 18px;
  box-shadow: 10px 10px 0 var(--black);
}

.card h1 {
  font-family: "GU5 Block", Impact, sans-serif;
  font-weight: normal;
  font-size: clamp(40px, 7vw, 64px);
  line-height: 1;
  margin-bottom: 20px;
}

.card p {
  font-size: 18px;
  line-height: 1.6;
}

.card p + p {
  margin-top: 12px;
}

.card .back {
  display: inline-block;
  margin-top: 24px;
  font-weight: 700;
  color: var(--black);
  text-decoration: none;
  user-select: none;
  outline: none;
  border-radius: 4px;
}

.card .back:focus-visible {
  outline: 3px solid var(--black);
  outline-offset: 4px;
}

@media (hover: hover) and (pointer: fine) {
  .card .back:hover {
    text-decoration: underline;
    text-decoration-thickness: 2px;
    text-underline-offset: 5px;
  }
}

/* ---------------------------------------------------------------------------
   Footer – Links werden nur beim echten Drüberfahren mit der Maus markiert:
   kein Tipp-Leuchten am Handy, kein hängenbleibender Fokus nach dem Klick
   (nur Tastatur-Nutzer sehen einen Rahmen), kein Markieren beim Klicken. */
.footer {
  background: var(--black);
  color: rgba(255, 255, 255, 0.78);
  font-size: 15px;
  font-weight: 600;
}

.footer__inner {
  max-width: 1120px;
  margin: 0 auto;
  padding: 28px 16px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px 32px;
}

.footer__brand {
  font-family: "GU5 Block", Impact, sans-serif;
  font-weight: normal;
  font-size: 24px;
  color: var(--yellow);
}

.footer__nav {
  display: flex;
  gap: 8px 24px;
  flex-wrap: wrap;
}

.footer__copy {
  color: rgba(255, 255, 255, 0.5);
}

.footer a {
  color: inherit;
  text-decoration: none;
  border-radius: 4px;
  outline: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}

.footer a.footer__brand {
  color: var(--yellow);
}

.footer a:focus-visible {
  outline: 2px solid var(--yellow);
  outline-offset: 4px;
}

@media (hover: hover) and (pointer: fine) {
  .footer__nav a:hover {
    color: var(--yellow);
    text-decoration: underline;
    text-decoration-thickness: 2px;
    text-underline-offset: 5px;
  }

  .footer a.footer__brand:hover {
    color: #fff;
  }
}

/* --------------------------------------------------------------------------- */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

@media (max-width: 700px) {
  .bg__layer {
    top: -640px;
    left: -640px;
    width: calc(100% + 640px);
    height: calc(100% + 640px);
    background-size: 640px 640px;
    animation-name: drift-sm;
    animation-timing-function: steps(640);
  }
  .logo { width: min(82vw, calc(64vh * 1.134)); }
  .footer__inner { flex-direction: column; text-align: center; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .bg__layer { animation: none; }
  .js .hero .logo,
  .js .reveal { transform: none; transition: opacity 0.4s ease; }
}
