/* Komponenten JBG Lab. tokens.css wird in jeder Seite als eigenes <link>
   davor geladen, nicht per @import — ein @import würde erst entdeckt, wenn
   diese Datei da ist, und kettet damit zwei Roundtrips hintereinander. */

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--void);
  color: var(--signal);
  font: 400 var(--step-0)/1.65 var(--font-body);
  /* zwei sehr weite, sehr dunkle Lichter geben dem Glas etwas zu brechen */
  background-image:
    radial-gradient(60rem 40rem at 15% -10%, rgba(62, 155, 255, 0.07), transparent 60%),
    radial-gradient(50rem 35rem at 95% 15%, rgba(107, 122, 153, 0.09), transparent 60%);
  background-attachment: fixed;
}

h1, h2, h3 { font-family: var(--font-display); font-weight: 700; line-height: 1.08;
             letter-spacing: -0.02em; margin: 0; }
h1 { font-size: var(--step-3); }
h2 { font-size: var(--step-2); }
h3 { font-size: var(--step-1); font-weight: 500; }
p { margin: 0; }
a { color: inherit; }

code, kbd, samp, pre, .mono { font-family: var(--font-mono); font-size: 0.92em; }

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

.wrap { width: min(100% - 2.5rem, 76rem); margin-inline: auto; }

/* Für Screenreader da, im Layout nicht. Nicht display:none — das nähme die
   Beschriftung auch dem Screenreader weg. */
.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.glass {
  background: var(--glass);
  border: var(--edge);
  border-radius: var(--radius);
  backdrop-filter: blur(20px) saturate(1.15);
  -webkit-backdrop-filter: blur(20px) saturate(1.15);
}

.eyebrow {
  font-family: var(--font-mono);
  font-size: var(--step--1);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--index);
  margin: 0 0 0.9rem;
}

.lead { color: var(--muted); font-size: var(--step-1); max-width: 46ch; }

/* ---------- Topbar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; padding: 0.85rem clamp(1.25rem, 4vw, 2.5rem);
  background: rgba(7, 9, 14, 0.72);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: var(--edge);
}
.topbar a { text-decoration: none; }
.brand { display: inline-flex; align-items: center; gap: 0.6rem;
         font-family: var(--font-display); font-weight: 700; letter-spacing: -0.01em; }
.brand-mark {
  display: grid; place-items: center; width: 1.65rem; height: 1.65rem;
  border-radius: 6px; border: 1px solid var(--index);
  color: var(--index); font-family: var(--font-mono); font-size: 0.8rem;
}
.topbar nav { display: flex; gap: clamp(0.75rem, 2vw, 1.5rem);
              font-size: var(--step--1); color: var(--muted); }
.topbar nav a:hover { color: var(--signal); }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  min-height: min(88svh, 46rem);
  display: grid; align-items: center;
  padding: clamp(3rem, 8vh, 6rem) 0;
  overflow: clip;
}
#prism-canvas {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  display: block;
}
/* Statischer Hero-Hintergrund. Sichtbar, solange die WebGL-Szene nicht
   übernommen hat — und damit auch der endgültige Zustand auf allen Geräten,
   die sie nicht bekommen. */
.hero-code {
  position: absolute; inset: 0;
  display: grid; place-items: center;
  padding: 2rem;
  font-family: var(--font-mono);
  font-size: clamp(0.62rem, 0.45rem + 0.9vw, 0.95rem);
  line-height: 1.85;
  color: var(--muted);
  white-space: pre;
  overflow: hidden;
  mask-image: radial-gradient(80% 70% at 50% 45%, #000 40%, transparent 100%);
  -webkit-mask-image: radial-gradient(80% 70% at 50% 45%, #000 40%, transparent 100%);
}
.hero-code b { color: var(--signal); font-weight: 400; }
.hero-code i { color: var(--index); font-style: normal; }
.hero[data-prism="on"] .hero-code { display: none; }

/* Ab der Breite, in der die Glasplatte links steht, rückt der Head-Block nach
   rechts daneben. Sonst liegt er hinter der Platte und wirkt abgeschnitten
   statt gebrochen. */
@media (min-width: 841px) {
  .hero-code { padding-left: 40rem; }
}

.hero-panel {
  position: relative; z-index: 2;
  justify-self: start;
  max-width: 34rem;
  padding: clamp(1.5rem, 3vw, 2.5rem);
}
.hero-panel .lead { margin-top: 1rem; }
.hero-meta {
  display: flex; flex-wrap: wrap; gap: 0.5rem;
  margin-top: 1.75rem;
}
.pill {
  font-family: var(--font-mono); font-size: var(--step--1);
  padding: 0.3rem 0.7rem; border-radius: 999px;
  border: var(--edge); color: var(--muted);
}
.pill--index { color: var(--index); border-color: rgba(62, 155, 255, 0.35); }

/* ---------- Bento ---------- */
.section { padding: clamp(3rem, 9vh, 6rem) 0; }
.section-head {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 1rem; margin-bottom: var(--gap); padding-bottom: 0.9rem;
  border-bottom: var(--edge);
}
.section-head span { font-family: var(--font-mono); font-size: var(--step--1); color: var(--muted); }

.bento { display: grid; gap: var(--gap); grid-template-columns: repeat(3, 1fr); }
/* Fläche = Nutzungshäufigkeit. Die SERP-Vorschau ist das Werkzeug, das man
   am häufigsten öffnet, also bekommt sie die größte Karte. */
.card--lead { grid-column: span 2; grid-row: span 2; }

.card {
  display: flex; flex-direction: column; gap: 0.7rem;
  padding: clamp(1.1rem, 2.2vw, 1.75rem);
  background: var(--glass);
  border: var(--edge);
  border-radius: var(--radius);
  backdrop-filter: blur(20px) saturate(1.15);
  -webkit-backdrop-filter: blur(20px) saturate(1.15);
  text-decoration: none;
  transition: border-color 200ms ease, transform 200ms ease, background 200ms ease;
}
a.card:hover {
  border-color: rgba(62, 155, 255, 0.45);
  background: rgba(232, 237, 247, 0.085);
  transform: translateY(-3px);
}
.card p { color: var(--muted); font-size: var(--step-0); }
.card--lead h3 { font-size: var(--step-2); font-weight: 700; }

/* Miniatur des Ergebnisses in der Leitkarte. Zeigt, was das Werkzeug tut,
   statt es zu behaupten — und füllt die zwei Zeilen mit Inhalt statt Luft. */
.card-demo {
  margin-top: 0.4rem;
  padding: 1rem 1.1rem;
  background: #fff;
  border-radius: 10px;
  display: grid;
  gap: 0.15rem;
}
.demo-url { font: 400 12px/1.4 Arial, sans-serif; color: #4d5156; }
.demo-title { font: 400 17px/1.3 Arial, sans-serif; color: #1a0dab; }
.demo-desc { font: 400 12.5px/1.5 Arial, sans-serif; color: #4d5156; }
.demo-desc s { color: #bdc1c6; text-decoration: none; }
/* Beide Felder mit ihrer Messung: eines besteht, eines reißt die Grenze.
   Blau und Rot tragen hier Bedeutung, nicht Stimmung — und sind bei
   Rot-Grün-Blindheit besser zu unterscheiden als die üblichen Grün/Rot. */
.demo-rows {
  margin-top: 0.85rem; padding-top: 0.8rem;
  border-top: 1px solid #e4e7ea;
  display: grid; gap: 0.55rem;
}
.demo-row {
  display: grid; grid-template-columns: 5.5rem 1fr auto;
  align-items: center; gap: 0.7rem;
  font: 400 10.5px/1.4 var(--font-mono); letter-spacing: 0.04em;
}
.demo-label { color: #5f6368; }
.demo-row b { font-weight: 400; color: #0B5ED7; white-space: nowrap; }
.demo-row b.over { color: #c5283d; }
.demo-ruler {
  height: 4px; border-radius: 2px;
  background: #e4e7ea; overflow: hidden; display: block;
}
.demo-ruler i { display: block; height: 100%; background: #2E80E8; }
.demo-ruler.over i { background: #d93a52; }
.card-kicker {
  font-family: var(--font-mono); font-size: var(--step--1);
  letter-spacing: 0.12em; text-transform: uppercase; color: var(--index);
}
.card--soon { opacity: 0.5; }
.card--soon .card-kicker { color: var(--muted); }
.card-go { margin-top: auto; font-family: var(--font-mono); font-size: var(--step--1);
           color: var(--index); }
.card--soon .card-go { color: var(--muted); }

/* ---------- Formulare und Werkzeug-Layout ---------- */
.tool-grid { display: grid; gap: var(--gap); grid-template-columns: 1fr 1fr; align-items: start; }
/* Grid-Kinder haben min-width: auto und schrumpfen nicht unter ihre
   Inhaltsbreite. Ohne min-width: 0 sprengt eine lange Zeile in pre.out die
   Spalte, statt im Block selbst zu scrollen. */
.tool-grid > * { min-width: 0; }

.field { display: block; margin-bottom: 1.1rem; }
.field > span {
  display: flex; align-items: baseline; justify-content: space-between; gap: 0.75rem;
  font-family: var(--font-mono); font-size: var(--step--1);
  letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted);
  margin-bottom: 0.4rem;
}
.field input, .field textarea, .field select {
  width: 100%; padding: 0.7rem 0.85rem;
  background: rgba(7, 9, 14, 0.55);
  border: var(--edge); border-radius: 9px;
  color: var(--signal); font: inherit;
}
.field textarea { resize: vertical; min-height: 5.5rem; }
.field input:focus, .field textarea:focus, .field select:focus {
  border-color: rgba(62, 155, 255, 0.5); outline: none;
}

.readout { font-family: var(--font-mono); font-size: var(--step--1); }
.status--ok { color: var(--index); }
.status--bad { color: var(--blocked); }

.btn {
  display: inline-flex; align-items: center; gap: 0.5rem;
  padding: 0.6rem 1rem; border-radius: 9px;
  border: 1px solid rgba(62, 155, 255, 0.4);
  background: rgba(62, 155, 255, 0.1);
  color: var(--index);
  font: 500 var(--step--1)/1 var(--font-mono);
  letter-spacing: 0.06em; text-transform: uppercase;
  cursor: pointer;
}
.btn:hover { background: rgba(62, 155, 255, 0.18); }

pre.out {
  margin: 0; padding: 1rem;
  background: rgba(7, 9, 14, 0.6);
  border: var(--edge); border-radius: 9px;
  overflow-x: auto; white-space: pre; tab-size: 2;
  color: var(--signal);
}

.notes { list-style: none; margin: 1rem 0 0; padding: 0; display: grid; gap: 0.5rem; }
.notes li { font-size: var(--step--1); padding-left: 1.1rem; position: relative; color: var(--muted); }
.notes li::before { content: '›'; position: absolute; left: 0; font-family: var(--font-mono); }
.notes li[data-level="error"] { color: var(--blocked); }
.notes li[data-level="error"]::before { content: '×'; }
.notes li[data-level="ok"] { color: var(--index); }
.notes li[data-level="ok"]::before { content: '✓'; }

footer.foot {
  padding: 2.5rem 0 3.5rem;
  border-top: var(--edge);
  color: var(--muted); font-size: var(--step--1);
  display: flex; flex-wrap: wrap; gap: 0.75rem 1.5rem; justify-content: space-between;
}
/* Impressum und Datenschutz müssen von jeder Seite erreichbar sein
   (§ 5 DDG: leicht erkennbar, unmittelbar erreichbar, ständig verfügbar). */
.foot a { color: inherit; text-decoration: none; border-bottom: 1px solid rgba(232, 237, 247, 0.2); }
.foot a:hover { color: var(--signal); border-bottom-color: var(--index); }

@media (max-width: 840px) {
  .bento { grid-template-columns: 1fr; }
  .card--lead { grid-column: auto; grid-row: auto; }
  .tool-grid { grid-template-columns: 1fr; }
  .hero-panel { justify-self: stretch; }
}

@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;
  }
  a.card:hover { transform: none; }
}
