/* ==========================================================================
   Interactive Design Showcase — style.css
   Palette: Off-White-Flächen, Salbeigrün + warmes Sand als Akzente.
   Glassmorphism (.glass) + Neomorphism (.neo) gezielt gemischt.
   ========================================================================== */

:root {
  --bg: #faf9f5;
  --bg-2: #f2f0e9;
  --ink: #262b22;
  --ink-soft: #5c6355;
  --green: #6b8f71;
  --green-deep: #48664e;
  --green-soft: #b9ccb4;
  --sand: #c9a37c;
  --sand-soft: #ead9c3;
  --white: #ffffff;

  --glass-bg: rgba(255, 255, 255, 0.55);
  --glass-border: rgba(255, 255, 255, 0.75);
  --glass-shadow: 0 18px 45px rgba(70, 80, 60, 0.10);

  --neo-light: rgba(255, 255, 255, 0.95);
  --neo-dark: rgba(178, 172, 152, 0.42);

  --radius-lg: 28px;
  --radius-md: 18px;
  --radius-sm: 12px;

  --font-display: "Fraunces", Georgia, serif;
  --font-body: "Inter", system-ui, -apple-system, sans-serif;
  --font-flex: "Roboto Flex", "Inter", sans-serif;

  --container: 1100px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: 96px;
}

body {
  font-family: var(--font-body);
  font-weight: 380;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.65;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }
a { color: inherit; }

::selection { background: var(--green-soft); color: var(--ink); }

/* ---------- Utility: Glass & Neo ---------- */

.glass {
  background: var(--glass-bg);
  -webkit-backdrop-filter: blur(18px) saturate(1.5);
  backdrop-filter: blur(18px) saturate(1.5);
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-shadow);
}

.neo {
  background: linear-gradient(145deg, #fbfaf6, #efede5);
  box-shadow:
    9px 9px 22px var(--neo-dark),
    -9px -9px 22px var(--neo-light);
  border: 1px solid rgba(255, 255, 255, 0.6);
}

/* ---------- Scroll-Reveal ---------- */

.reveal {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity 0.8s ease, transform 0.8s cubic-bezier(0.2, 0.7, 0.2, 1);
}
.reveal.is-visible { opacity: 1; transform: none; }

/* ---------- Buttons ---------- */

.btn {
  display: inline-block;
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 550;
  text-decoration: none;
  border: none;
  cursor: pointer;
  padding: 0.85em 1.9em;
  border-radius: 999px;
  transition: transform 0.25s ease, box-shadow 0.25s ease, background 0.25s ease;
}
.btn:active { transform: scale(0.97); }

.btn-primary {
  background: var(--green);
  color: #fff;
  box-shadow: 0 10px 24px rgba(107, 143, 113, 0.35);
}
.btn-primary:hover {
  background: var(--green-deep);
  transform: translateY(-2px);
  box-shadow: 0 14px 30px rgba(107, 143, 113, 0.4);
}

.btn-ghost {
  background: rgba(255, 255, 255, 0.6);
  color: var(--ink);
  border: 1px solid rgba(38, 43, 34, 0.12);
}
.btn-ghost:hover {
  background: #fff;
  transform: translateY(-2px);
  box-shadow: 0 10px 22px rgba(70, 80, 60, 0.12);
}

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

/* ---------- Typo-Bausteine ---------- */

.eyebrow {
  font-size: 0.78rem;
  font-weight: 620;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--green);
  margin-bottom: 1rem;
}

.section-title {
  font-family: var(--font-display);
  font-weight: 480;
  font-size: clamp(2rem, 4.6vw, 3.2rem);
  line-height: 1.12;
  letter-spacing: -0.01em;
  margin-bottom: 1rem;
}

.section-sub {
  color: var(--ink-soft);
  font-size: 1.05rem;
  max-width: 46ch;
  margin-inline: auto;
}

/* ---------- Layout ---------- */

.container {
  width: min(var(--container), calc(100% - 3rem));
  margin-inline: auto;
}

.section { padding: clamp(6rem, 12vh, 9rem) 0; }

.section-tinted {
  background: linear-gradient(180deg, var(--bg) 0%, var(--bg-2) 18%, var(--bg-2) 82%, var(--bg) 100%);
}

.section-head {
  text-align: center;
  margin-bottom: clamp(3rem, 7vh, 5rem);
}

/* ---------- Navigation ---------- */

.site-nav {
  position: fixed;
  top: 18px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 100;
  display: flex;
  align-items: center;
  gap: 2.2rem;
  padding: 0.6rem 1.6rem;
  border-radius: 999px;
  transition: box-shadow 0.3s ease, background 0.3s ease;
}
.site-nav.is-scrolled {
  background: rgba(255, 255, 255, 0.78);
  box-shadow: 0 12px 32px rgba(70, 80, 60, 0.16);
}

.nav-brand {
  display: flex;
  align-items: center;
  font-family: var(--font-display);
  font-weight: 560;
  font-size: 1.05rem;
  line-height: 1;           /* Fraunces hat asymmetrisches Leading — line-height:1 zentriert die Ink optisch statt nur die Font-Box */
  text-decoration: none;
  letter-spacing: 0.01em;
  color: var(--ink);
}

.nav-links { display: flex; align-items: center; gap: 1.5rem; }
.nav-links a {
  font-size: 0.9rem;
  font-weight: 500;
  line-height: 1;
  text-decoration: none;
  color: var(--ink-soft);
  transition: color 0.2s ease;
}
.nav-links a:hover { color: var(--ink); }

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 34px;
  height: 34px;
  padding: 0;
  border-radius: 50%;
  cursor: pointer;
}
.nav-toggle-bar {
  display: block;
  width: 18px;
  height: 1.5px;
  border-radius: 2px;
  background: var(--ink);
  transition: transform 0.3s ease, opacity 0.25s ease;
}
.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ==========================================================================
   1 · HERO + IMAGE TRAIL
   ========================================================================== */

.hero {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: var(--bg);
  cursor: crosshair;
  --hero-gradient-blend-mode: normal;
  --hero-gradient-blur: 56px;
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(at 83.5% 28.7%, rgba(125, 179, 125, 0.22) 0px, transparent 50%),
    radial-gradient(at 35.7% 54.7%, rgba(255, 255, 255, 0.55) 0px, transparent 50%),
    radial-gradient(at 68.2% 72.8%, rgba(110, 143, 109, 0.20) 0px, transparent 50%),
    radial-gradient(at 24.4% 25.3%, rgba(87, 138, 87, 0.20) 0px, transparent 50%),
    radial-gradient(at 46.6% 71.6%, rgba(94, 145, 94, 0.16) 0px, transparent 50%)
    var(--bg);
  mix-blend-mode: var(--hero-gradient-blend-mode);
}

.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: linear-gradient(to bottom, transparent 0%, transparent 78%, var(--bg) 100%);
  backdrop-filter: blur(var(--hero-gradient-blur)) contrast(100%) brightness(100%);
  -webkit-backdrop-filter: blur(var(--hero-gradient-blur)) contrast(100%) brightness(100%);
}

.trail-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 1;
}

.trail-tile {
  position: absolute;
  width: clamp(80px, 9vw, 118px);
  aspect-ratio: 3 / 4;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 16px 36px rgba(60, 70, 50, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.65);
  will-change: transform, opacity;
}
.trail-tile svg { width: 58%; height: auto; }

.tt-1 { background: linear-gradient(160deg, #dbe7d4, #a9c4a2); color: #3c5a42; }
.tt-2 { background: linear-gradient(160deg, #fdfcf8, #ece7da); color: #6b8f71; }
.tt-3 { background: linear-gradient(160deg, #ead9c3, #d5b58d); color: #7d5f3d; }
.tt-4 { background: linear-gradient(160deg, #edf0ea, #d7ddd2); color: #56715b; }
.tt-5 { background: linear-gradient(160deg, #6b8f71, #48664e); color: #eaf2e6; }
.tt-6 { background: linear-gradient(160deg, #fbf7ef, #eadfcb); color: #b08a5a; }
.tt-7 { background: linear-gradient(160deg, #cfdcc9, #eef1e9); color: #48664e; }
.tt-8 { background: linear-gradient(160deg, #f4efe4, #dccdb2); color: #8a6f4a; }

/* Spawn-/Fade-Zustände (per JS gesetzt) */
.trail-layer .trail-tile {
  opacity: 0;
  transform: translate(-50%, -50%) scale(0.35) rotate(var(--rot, 0deg));
  transition: transform 0.45s cubic-bezier(0.18, 1.25, 0.35, 1), opacity 0.35s ease;
}
.trail-layer .trail-tile.is-in {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1) rotate(var(--rot, 0deg));
}
.trail-layer .trail-tile.is-out {
  opacity: 0;
  transform: translate(-50%, calc(-50% + 36px)) scale(0.85) rotate(var(--rot, 0deg));
  transition: transform 0.6s ease, opacity 0.55s ease;
}

.hero-panel {
  position: relative;
  z-index: 2;
  text-align: center;
  padding: clamp(2.4rem, 5vw, 4rem) clamp(2rem, 6vw, 5rem);
  border-radius: var(--radius-lg);
  max-width: 620px;
  pointer-events: none;
}
.hero-panel .btn { pointer-events: auto; }

.hero-panel h1 {
  font-family: var(--font-display);
  font-weight: 460;
  font-size: clamp(2.6rem, 6.5vw, 4.4rem);
  line-height: 1.06;
  letter-spacing: -0.015em;
  margin-bottom: 1.1rem;
}
.hero-panel h1 em {
  font-style: italic;
  font-weight: 560;
  color: var(--green-deep);
}

.hero-sub {
  color: var(--ink-soft);
  font-size: 1.05rem;
  margin-bottom: 2rem;
}

.hero-hint {
  position: absolute;
  bottom: 26px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
  font-size: 0.8rem;
  letter-spacing: 0.12em;
  color: var(--ink-soft);
  opacity: 0.7;
}

/* ==========================================================================
   ABOUT
   ========================================================================== */

.about-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: clamp(2rem, 6vw, 5rem);
  align-items: center;
}

.about-text p { max-width: 52ch; margin-bottom: 1.2rem; color: var(--ink-soft); }
.about-text p:first-of-type { color: var(--ink); }

.skill-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.9rem;
  margin-top: 2rem;
}

.chip {
  padding: 0.6em 1.4em;
  border-radius: 999px;
  font-size: 0.88rem;
  font-weight: 550;
  color: var(--green-deep);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.chip:hover {
  transform: translateY(-3px);
  box-shadow:
    12px 12px 26px var(--neo-dark),
    -10px -10px 24px var(--neo-light);
}

/* ==========================================================================
   2 · COMET CARD
   ========================================================================== */

.comet-wrap {
  display: flex;
  justify-content: center;
  perspective: 1100px;
}

.comet-frame {
  position: relative;
  width: min(400px, 100%);
  border-radius: calc(var(--radius-lg) + 2px);
  padding: 2px;                 /* Rahmenstärke, durch die der Komet scheint */
  overflow: hidden;
  transform-style: preserve-3d;
  will-change: transform;
  isolation: isolate;
}

/* Rotierender Lichtstreif hinter der Karte (nur am 2px-Rand sichtbar) — weich & gedeckt */
.comet-beam {
  position: absolute;
  inset: -55%;
  z-index: 0;
  background: conic-gradient(
    from 0deg,
    transparent 0deg,
    transparent 250deg,
    rgba(107, 143, 113, 0.10) 292deg,
    rgba(107, 143, 113, 0.30) 322deg,
    rgba(234, 217, 195, 0.45) 344deg,
    rgba(107, 143, 113, 0.12) 359deg,
    transparent 360deg
  );
  animation: beam-spin 9s linear infinite;
}
@keyframes beam-spin { to { transform: rotate(360deg); } }

.comet-card {
  position: relative;
  z-index: 1;
  border-radius: var(--radius-lg);
  background: rgba(252, 251, 247, 0.92);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  padding: 2.2rem;
  overflow: hidden;
}

.comet-glare {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(
    circle 260px at var(--gx, 50%) var(--gy, 50%),
    rgba(255, 255, 255, 0.32) 0%,
    transparent 72%
  );
  opacity: 0;
  transition: opacity 0.4s ease;
}
.comet-frame:hover .comet-glare { opacity: 1; }

.comet-card-top {
  display: flex;
  align-items: center;
  margin-bottom: 1.4rem;
}
.comet-image {
  width: 100%;
  aspect-ratio: 4 / 3;
  border-radius: var(--radius-md);
  overflow: hidden;
  margin-bottom: 1.4rem;
  box-shadow: inset 0 0 0 1px rgba(38, 43, 34, 0.06);
}
.comet-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.comet-tag {
  font-size: 0.72rem;
  font-weight: 620;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--sand);
  border: 1px solid var(--sand-soft);
  border-radius: 999px;
  padding: 0.4em 1em;
}

.comet-card h3 {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 1.8rem;
  line-height: 1.15;
  margin-bottom: 0.8rem;
}
.comet-card > p { color: var(--ink-soft); font-size: 0.95rem; margin-bottom: 1.8rem; }

.comet-meta {
  display: flex;
  gap: 1.6rem;
  border-top: 1px solid rgba(38, 43, 34, 0.08);
  padding-top: 1.4rem;
}
.comet-meta div { display: flex; flex-direction: column; }
.comet-meta strong {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 560;
  color: var(--green-deep);
}
.comet-meta span { font-size: 0.75rem; color: var(--ink-soft); }

/* ==========================================================================
   ÜBERLEITUNG ZU DEN EXPERIMENTEN
   ========================================================================== */

.transition-section { padding: clamp(3.5rem, 7vh, 5.5rem) 0; }

.transition-panel {
  max-width: 640px;
  margin-inline: auto;
  text-align: center;
  padding: clamp(2.2rem, 5vw, 3.2rem);
  border-radius: var(--radius-lg);
}
.transition-panel .section-title { font-size: clamp(1.5rem, 3.4vw, 2.1rem); margin-bottom: 1rem; }
.transition-panel p:not(.eyebrow) { color: var(--ink-soft); max-width: 52ch; margin-inline: auto; }

/* ==========================================================================
   3 · MAC KEYBOARD
   ========================================================================== */

.kb-wrap {
  max-width: 760px;
  margin-inline: auto;
  display: flex;
  flex-direction: column;
  gap: 1.6rem;
}

.kb-display {
  min-height: 72px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  padding: 1rem 1.6rem;
  font-family: var(--font-display);
  font-size: clamp(1.15rem, 2.6vw, 1.6rem);
  font-weight: 480;
  overflow: hidden;
  white-space: nowrap;
}

.kb-caret {
  display: inline-block;
  width: 2px;
  height: 1.2em;
  margin-left: 3px;
  background: var(--green);
  animation: caret-blink 1.1s steps(1) infinite;
}
@keyframes caret-blink { 50% { opacity: 0; } }

.mac-keyboard {
  --k: clamp(30px, 5.6vw, 52px);
  border-radius: var(--radius-lg);
  padding: clamp(0.6rem, 1.6vw, 1.1rem);
  display: flex;
  flex-direction: column;
  gap: clamp(4px, 0.8vw, 8px);
  user-select: none;
}

.kb-row { display: flex; gap: clamp(4px, 0.8vw, 8px); justify-content: center; }

.kb-key {
  height: var(--k);
  min-width: var(--k);
  flex: var(--kw, 1) 1 0;
  border: 1px solid rgba(255, 255, 255, 0.8);
  border-radius: clamp(6px, 1vw, 10px);
  background: rgba(255, 255, 255, 0.62);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  box-shadow:
    0 3px 0 rgba(178, 172, 152, 0.55),
    0 6px 12px rgba(70, 80, 60, 0.10);
  font-family: var(--font-body);
  font-size: clamp(0.62rem, 1.4vw, 0.85rem);
  font-weight: 500;
  color: var(--ink-soft);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.09s ease, box-shadow 0.09s ease, background 0.15s ease, color 0.15s ease;
}
.kb-key:hover { background: rgba(255, 255, 255, 0.9); color: var(--ink); }
.kb-key.is-pressed,
.kb-key:active {
  transform: translateY(3px);
  box-shadow:
    0 0 0 rgba(178, 172, 152, 0.55),
    0 2px 6px rgba(70, 80, 60, 0.12),
    0 0 18px rgba(107, 143, 113, 0.55);
  background: #eef4ec;
  color: var(--green-deep);
}
.kb-key.is-locked { background: #e3ecdf; color: var(--green-deep); }

.kb-actions { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; }

/* ==========================================================================
   4 · IMAGE GRID HERO
   ========================================================================== */

/* 3 Spalten, jede Kachel behält ihr eigenes Seitenverhältnis (aspect-ratio) —
   robuster als feste vh-Zeilen: Hochformat-Poster bleiben hoch, unabhängig
   von Viewport-Höhe. Nur die Sponsoring-Kachel ist bewusst querformatig. */
.grid-hero {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

.grid-tile {
  position: relative;
  border: none;
  border-radius: var(--radius-md);
  overflow: hidden;
  cursor: pointer;
  padding: 0;
  background: none;
  aspect-ratio: 3 / 4;
  transition: transform 0.2s ease-out;
  will-change: transform;
}
.grid-tile.tile-wide {
  grid-column: 1 / -1;
  aspect-ratio: 3 / 2;
}

.tile-bg {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  transform: scale(1.01);
  transition: transform 0.7s cubic-bezier(0.2, 0.8, 0.2, 1), filter 0.5s ease;
}
.grid-tile:hover .tile-bg,
.grid-tile.is-active .tile-bg { transform: scale(1.12); }

/* Echte Portfolio-Fotos: dunkler Verlauf unten sorgt für lesbare Labels.
   Background-Position je Bild so gewählt, dass der wichtigste Ausschnitt
   (Fahrzeug, Gesicht, Wortmarke) sichtbar bleibt. */
.gt-a .tile-bg { background: linear-gradient(0deg, rgba(10,10,10,0.55) 0%, transparent 45%), url("assets/portfolio/sponsoring-cover.jpg") center / cover no-repeat; }
.gt-b .tile-bg { background: linear-gradient(0deg, rgba(10,10,10,0.62) 0%, transparent 50%), url("assets/portfolio/dignity.jpg") center / cover no-repeat; }
.gt-c .tile-bg { background: linear-gradient(0deg, rgba(10,10,10,0.62) 0%, transparent 50%), url("assets/portfolio/abyss.jpg") center / cover no-repeat; }
.gt-d .tile-bg { background: linear-gradient(0deg, rgba(10,10,10,0.62) 0%, transparent 50%), url("assets/portfolio/purity.jpg") center 42% / cover no-repeat; }
.gt-e .tile-bg { background: linear-gradient(0deg, rgba(10,10,10,0.62) 0%, transparent 50%), url("assets/portfolio/sponsoring-win.jpg") 32% 38% / cover no-repeat; }
.gt-f .tile-bg { background: linear-gradient(0deg, rgba(10,10,10,0.62) 0%, transparent 50%), url("assets/portfolio/918spyder.jpg") center 55% / cover no-repeat; }
.gt-g .tile-bg { background: linear-gradient(0deg, rgba(10,10,10,0.62) 0%, transparent 50%), url("assets/portfolio/gt3rs.jpg") center 56% / cover no-repeat; }

.tile-label {
  position: absolute;
  left: 14px;
  bottom: 14px;
  z-index: 1;
  color: #fff;
  background: rgba(10, 10, 10, 0.5);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 620;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 0.55em 1.1em;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.35s ease, transform 0.45s cubic-bezier(0.2, 1, 0.3, 1);
}
.grid-tile:hover .tile-label,
.grid-tile:focus-visible .tile-label,
.grid-tile.is-active .tile-label { opacity: 1; transform: translateY(0); }

/* ==========================================================================
   6 · TEXT CURSOR PROXIMITY
   ========================================================================== */

.proximity-stage {
  display: flex;
  justify-content: center;
  padding: clamp(2rem, 6vh, 4rem) 0;
  cursor: default;
}

.proximity-title {
  font-family: var(--font-display);
  font-size: clamp(2.2rem, 7.5vw, 5.4rem);
  font-weight: 340;
  font-variation-settings: "wght" 340;
  line-height: 1.15;
  text-align: center;
  letter-spacing: 0.01em;
  color: var(--ink);
  max-width: 16ch;
}
.proximity-title .pl {
  display: inline-block;
  will-change: transform, font-variation-settings;
}

/* ==========================================================================
   7 · VARIABLE FONT & CURSOR
   ========================================================================== */

.flex-stage {
  position: relative;
  border-radius: var(--radius-lg);
  min-height: 420px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  cursor: none;
}
.flex-stage.no-fancy { cursor: default; }

.flex-text {
  font-family: var(--font-flex);
  font-size: clamp(2.4rem, 7vw, 5rem);
  line-height: 1.05;
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 0.01em;
  color: var(--ink);
  font-variation-settings: "wght" 400, "wdth" 100;
  will-change: font-variation-settings;
}

.flex-readout {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.8rem;
  font-weight: 550;
  letter-spacing: 0.08em;
  color: var(--ink-soft);
  padding: 0.5em 1.2em;
  border-radius: 999px;
  font-variant-numeric: tabular-nums;
}

.flex-cursor {
  position: absolute;
  top: 0;
  left: 0;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 6px rgba(107, 143, 113, 0.18);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.25s ease;
  will-change: transform;
}
.flex-stage:hover .flex-cursor { opacity: 1; }
.flex-stage.is-touching .flex-cursor { opacity: 1; }
.flex-stage.no-fancy .flex-cursor { display: none; }

/* ==========================================================================
   8 · GRAVITY
   ========================================================================== */

.gravity-stage {
  position: relative;
  height: 440px;
  border-radius: var(--radius-lg);
  background: linear-gradient(160deg, #f5f3ec, #ebe8de);
  box-shadow:
    inset 7px 7px 18px rgba(178, 172, 152, 0.35),
    inset -7px -7px 18px rgba(255, 255, 255, 0.9);
  overflow: hidden;
  /* Fallback-Layout (reduced motion / vor Physik-Start) */
  display: flex;
  flex-wrap: wrap;
  align-content: flex-end;
  justify-content: center;
  gap: 12px;
  padding: 24px;
}

.g-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.7em 1.5em;
  border-radius: 999px;
  font-size: 0.92rem;
  font-weight: 560;
  cursor: grab;
  user-select: none;
  touch-action: none;
  white-space: nowrap;
  border: 1px solid rgba(255, 255, 255, 0.8);
  box-shadow: 0 10px 24px rgba(60, 70, 50, 0.14);
  will-change: transform;
}
.g-badge:active { cursor: grabbing; }

.gb-1 { background: rgba(255, 255, 255, 0.85); color: var(--ink); }
.gb-2 { background: linear-gradient(150deg, #7d9d82, #5a7d61); color: #fff; }
.gb-3 { background: linear-gradient(150deg, #ead9c3, #d9bd97); color: #6e5334; }

.gravity-stage.is-physics { display: block; padding: 0; }
.gravity-stage.is-physics .g-badge {
  position: absolute;
  top: 0;
  left: 0;
  margin: 0;
}

.gravity-actions { text-align: center; margin-top: 1.8rem; }

/* ==========================================================================
   FOOTER
   ========================================================================== */

.footer {
  padding: clamp(5rem, 10vh, 8rem) 0 2.5rem;
  background:
    radial-gradient(55% 60% at 50% 100%, rgba(185, 204, 180, 0.3) 0%, transparent 75%),
    var(--bg);
}

.footer-card {
  text-align: center;
  border-radius: var(--radius-lg);
  padding: clamp(2.5rem, 6vw, 4.5rem);
  margin-bottom: 2.5rem;
}

.footer-title {
  font-family: var(--font-display);
  font-weight: 480;
  font-size: clamp(1.7rem, 4vw, 2.6rem);
  margin-bottom: 0.6rem;
}
.footer-sub { color: var(--ink-soft); margin-bottom: 2rem; }

.footer-links {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

.footer-note {
  text-align: center;
  font-size: 0.82rem;
  color: var(--ink-soft);
}
.footer-note a { color: var(--green-deep); }

.footer-legal {
  display: flex;
  gap: 1.4rem;
  justify-content: center;
  margin-bottom: 1rem;
}
.footer-legal-link {
  background: none;
  border: none;
  cursor: pointer;
  font-family: var(--font-body);
  font-size: 0.78rem;
  letter-spacing: 0.03em;
  color: var(--ink-soft);
  padding: 0.2em 0;
  transition: color 0.2s ease;
}
.footer-legal-link:hover { color: var(--green-deep); }

/* ==========================================================================
   LEGAL MODALS
   ========================================================================== */

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  background: rgba(38, 43, 34, 0.45);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}
.modal-overlay.is-active { opacity: 1; pointer-events: auto; }

.modal-panel {
  position: relative;
  width: 100%;
  max-width: 640px;
  max-height: 82vh;
  overflow-y: auto;
  border-radius: var(--radius-lg);
  padding: clamp(2rem, 5vw, 3rem);
  transform: translateY(16px) scale(0.98);
  opacity: 0;
  transition: transform 0.35s ease, opacity 0.35s ease;
  scrollbar-width: thin;
  background: rgba(250, 249, 245, 0.98);
  scrollbar-color: var(--green-soft) transparent;
}
.modal-overlay.is-active .modal-panel { transform: translateY(0) scale(1); opacity: 1; }
.modal-panel:focus { outline: none; }

.modal-close {
  position: absolute;
  top: 1.2rem;
  right: 1.4rem;
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: none;
  background: rgba(38, 43, 34, 0.06);
  color: var(--ink-soft);
  font-size: 1.2rem;
  line-height: 1;
  cursor: pointer;
  transition: color 0.2s ease, transform 0.25s ease, background 0.2s ease;
}
.modal-close:hover { color: var(--ink); background: rgba(38, 43, 34, 0.1); transform: rotate(90deg); }

.modal-panel h2 {
  font-family: var(--font-display);
  font-weight: 520;
  font-size: clamp(1.4rem, 3vw, 1.8rem);
  margin-bottom: 1.6rem;
  color: var(--ink);
  padding-right: 2rem;
}
.modal-panel h3 {
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 650;
  letter-spacing: 0.02em;
  color: var(--green-deep);
  margin-bottom: 0.3rem;
}
.modal-panel p {
  font-size: 0.92rem;
  line-height: 1.6;
  color: var(--ink-soft);
  margin-bottom: 1.1rem;
}
.modal-panel a { color: var(--green-deep); }
.modal-section { margin-bottom: 1.4rem; }
.modal-section:last-child { margin-bottom: 0; }

body.modal-open { overflow: hidden; }

/* ==========================================================================
   RESPONSIVE
   ========================================================================== */

@media (max-width: 860px) {
  .grid-hero { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 640px) {
  .site-nav { gap: 1.4rem; padding: 0.55rem 1.3rem; }
  .nav-toggle { display: flex; }
  .nav-links {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0.15rem;
    width: min(220px, calc(100vw - 2.4rem));
    padding: 0.8rem;
    border-radius: var(--radius-md);
    background: rgba(250, 249, 245, 0.97);
    -webkit-backdrop-filter: blur(18px) saturate(1.5);
    backdrop-filter: blur(18px) saturate(1.5);
    border: 1px solid var(--glass-border);
    box-shadow: var(--glass-shadow);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(-6px);
    transition: opacity 0.22s ease, transform 0.22s ease, visibility 0.22s;
  }
  .site-nav.is-open .nav-links {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(0);
  }
  .nav-links a { padding: 0.6rem 0.5rem; font-size: 0.98rem; }
  .gravity-stage { height: 360px; }

  /* Hero auf Mobile: kein Glass-Kästchen, dominantere gestapelte Headline, kein Maus-Hinweis */
  .hero-panel.glass {
    background: none;
    border: none;
    box-shadow: none;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }
  .hero-panel {
    padding: 0 1.4rem;
    max-width: 100%;
  }
  .hero-panel h1 {
    font-size: clamp(2.9rem, 13vw, 4.2rem);
    line-height: 1.03;
    letter-spacing: -0.02em;
  }
  .hero-hint { display: none; }

  /* Mehr Charakter ohne Effekte: vertiefte Aurora, editorialere Typografie */
  .hero::before {
    background:
      radial-gradient(at 83.5% 20%, rgba(107, 143, 113, 0.36) 0%, transparent 55%),
      radial-gradient(at 30% 58%, rgba(255, 255, 255, 0.5) 0%, transparent 55%),
      radial-gradient(at 72% 88%, rgba(72, 102, 78, 0.30) 0%, transparent 60%),
      radial-gradient(at 16% 18%, rgba(87, 138, 87, 0.30) 0%, transparent 55%)
      var(--bg);
  }

  .hero-panel .eyebrow {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.7rem;
    font-size: 0.7rem;
    letter-spacing: 0.32em;
    color: var(--green-deep);
  }
  .hero-panel .eyebrow::before,
  .hero-panel .eyebrow::after {
    content: "";
    width: 26px;
    height: 1px;
    background: var(--green-deep);
    opacity: 0.4;
  }

  .hero-sub {
    max-width: 30ch;
    margin-inline: auto;
  }

  .hero-panel .btn-primary {
    text-transform: uppercase;
    letter-spacing: 0.14em;
    font-size: 0.8rem;
    padding: 1em 2.3em;
    background: rgba(255, 255, 255, 0.22);
    color: var(--ink);
    border: 1px solid rgba(255, 255, 255, 0.5);
    -webkit-backdrop-filter: blur(14px) saturate(1.4);
    backdrop-filter: blur(14px) saturate(1.4);
    box-shadow: 0 8px 24px rgba(70, 80, 60, 0.14);
  }
  .hero-panel .btn-primary:hover {
    background: rgba(255, 255, 255, 0.34);
    box-shadow: 0 10px 28px rgba(70, 80, 60, 0.18);
  }
}

@media (max-width: 480px) {
  .section { padding: clamp(3.5rem, 9vh, 5.5rem) 0; }
  .grid-hero { grid-template-columns: 1fr; }
  .grid-tile.tile-wide { aspect-ratio: 3 / 2.2; }
  .grid-tile { aspect-ratio: 16 / 10; }

  .mac-keyboard { --k: clamp(20px, 6.4vw, 40px); padding: 0.5rem; gap: 3px; }
  .kb-row { gap: 3px; }
  .kb-display { padding: 0.85rem 1.1rem; }

  .comet-meta { gap: 1rem; flex-wrap: wrap; }
}

/* ==========================================================================
   REDUCED MOTION
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .comet-beam { animation: none; opacity: 0.5; }
  .kb-caret { animation: none; }
  .tile-bg, .tile-label, .btn, .chip { transition-duration: 0.01s; }
  .flex-stage { cursor: default; }
  .flex-cursor { display: none; }
  .modal-overlay, .modal-panel { transition-duration: 0.01s; }
}
