@font-face { font-family: "Inter"; font-style: normal; font-weight: 400; font-display: swap; src: url("/assets/fonts/inter-400.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 500; font-display: swap; src: url("/assets/fonts/inter-500.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 600; font-display: swap; src: url("/assets/fonts/inter-600.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 700; font-display: swap; src: url("/assets/fonts/inter-700.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 800; font-display: swap; src: url("/assets/fonts/inter-800.woff2") format("woff2"); }

:root {
  --ink: #102c3f;
  --text: #243b4a;
  --muted: #627b8d;
  --blue-900: #003d66;
  --blue-800: #004b76;
  --blue-700: #005f96;
  --blue-100: #eaf7ff;
  --blue-050: #f4fbff;
  --teal: #138779;
  --teal-soft: #d9f4ef;
  --orange: #f6a23a;
  --line: #c9ddeb;
  --line-soft: #e2edf5;
  --surface: #ffffff;
  --surface-muted: #f3f5f7;
  --focus: var(--orange);
  --shadow: 0 12px 32px rgba(0, 61, 102, 0.08);
  --radius-card: 8px;
  --radius-button: 4px;
  --container: min(1180px, calc(100vw - 40px));
  --dur-press: 100ms;
  --dur-state: 150ms;
  --ease-out: cubic-bezier(0.22, 0.61, 0.36, 1);
  --header-height: 4.5rem;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-height) + 0.75rem); }

body {
  margin: 0;
  color: var(--text);
  background: var(--surface);
  font-family: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 1rem;
  line-height: 1.6;
}

button, input, output { font: inherit; color: inherit; }
button, a, input { -webkit-tap-highlight-color: transparent; }
a { color: var(--blue-700); text-underline-offset: 0.18em; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }

.container { width: var(--container); margin: 0 auto; }

.skip-link { position: absolute; left: 1rem; top: -8rem; z-index: 30; padding: 0.6rem 0.9rem; color: #fff; background: var(--blue-900); border-radius: var(--radius-button); }
.skip-link:focus { top: 1rem; }

/* Werkzeugkopf mit Stationen */
.tool-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(16px) saturate(160%);
  border-bottom: 1px solid var(--line-soft);
}
.tool-header__grid { display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; min-height: var(--header-height); }
.brand { display: inline-flex; gap: 0.75rem; align-items: center; color: var(--ink); text-decoration: none; }
.brand__mark { display: grid; width: 2.75rem; height: 2.75rem; place-items: center; color: #fff; background: var(--blue-800); border-radius: 6px; font-size: 0.95rem; font-weight: 800; letter-spacing: 0.04em; }
.brand strong, .brand small { display: block; line-height: 1.1; }
.brand strong { font-weight: 800; }
.brand small { margin-top: 0.2rem; color: var(--muted); font-weight: 700; font-size: 0.78rem; letter-spacing: 0.01em; }

.station-nav { display: flex; gap: 0.25rem; flex-wrap: wrap; justify-content: flex-end; }
.station-nav a { display: inline-flex; align-items: center; gap: 0.45rem; padding: 0.55rem 0.7rem; color: var(--ink); border-radius: var(--radius-button); font-weight: 600; font-size: 0.92rem; text-decoration: none; white-space: nowrap; }
.station-nav a:hover { color: var(--blue-800); background: var(--blue-050); }
.station-nav a[aria-current="true"] { color: var(--blue-800); box-shadow: inset 0 -2px 0 var(--blue-700); }
.station-nav__num { display: grid; place-items: center; width: 1.4rem; height: 1.4rem; border-radius: 50%; background: var(--blue-050); color: var(--blue-700); font-size: 0.74rem; font-weight: 800; }
.station-nav a[aria-current="true"] .station-nav__num { background: var(--blue-800); color: #fff; }

/* Abschnitte */
.section { padding: 5.25rem 0; }
.hero-tool {
  padding: 4.5rem 0 5rem;
  background: linear-gradient(135deg, rgba(234, 247, 255, 0.96), rgba(255, 255, 255, 0.92)), var(--blue-100);
  border-bottom: 1px solid var(--line-soft);
}
.hero-tool__grid { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr); gap: 3rem; align-items: center; }

.eyebrow { margin: 0 0 0.75rem; color: var(--blue-800); font-size: 0.8rem; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; }
h1, h2, h3, p { margin-top: 0; }
h1, h2, h3 { color: var(--ink); line-height: 1.1; }
h1 { max-width: 40rem; margin-bottom: 1.25rem; font-size: clamp(2.2rem, 4.6vw, 3.6rem); font-weight: 800; letter-spacing: -0.02em; }
h2 { margin-bottom: 1rem; font-size: clamp(1.7rem, 2.8vw, 2.4rem); font-weight: 800; letter-spacing: -0.015em; }
h3 { margin-bottom: 0.6rem; font-size: 1.15rem; font-weight: 800; letter-spacing: -0.01em; }
.lead { max-width: 38rem; margin-bottom: 1.75rem; color: #29485c; font-size: 1.12rem; }

.fact-strip { display: grid; gap: 0.85rem; margin: 0; }
.fact-strip div { padding: 1.1rem 1.2rem; background: rgba(255, 255, 255, 0.88); border: 1px solid rgba(0, 75, 118, 0.16); border-radius: var(--radius-card); box-shadow: var(--shadow); }
.fact-strip dt { color: var(--blue-800); font-size: 1.05rem; font-weight: 800; }
.fact-strip dd { margin: 0.25rem 0 0; color: var(--muted); font-size: 0.95rem; }

.cta-group { display: flex; flex-wrap: wrap; gap: 0.75rem; }
.cta-group--center { justify-content: center; margin-top: 2.5rem; }

/* Stationen */
.station--alt { background: var(--blue-050); border-top: 1px solid var(--line-soft); border-bottom: 1px solid var(--line-soft); }
.station__grid { display: grid; grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr); gap: 3rem; align-items: start; }
.station__copy { position: sticky; top: calc(var(--header-height) + 1.5rem); }
.station__copy p { max-width: 34rem; }
.takeaway { margin-top: 1.25rem; padding: 0.9rem 1.1rem; background: var(--teal-soft); border-left: 3px solid var(--teal); border-radius: 0 var(--radius-button) var(--radius-button) 0; color: var(--ink); }

.panel { padding: 1.5rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-card); box-shadow: var(--shadow); }
.panel__label { margin: 1.25rem 0 0.5rem; color: var(--ink); font-size: 0.82rem; font-weight: 700; letter-spacing: 0.01em; }
.panel__label:first-child { margin-top: 0; }
.panel__hint, .panel__note { margin: 0.6rem 0 0; color: var(--muted); font-size: 0.9rem; letter-spacing: 0.01em; }
.panel__foot { margin: 1.5rem 0 0; padding-top: 1rem; border-top: 1px solid var(--line-soft); color: var(--muted); font-size: 0.86rem; letter-spacing: 0.01em; }

.field { display: grid; gap: 0.4rem; }
.field span { color: var(--ink); font-size: 0.82rem; font-weight: 700; letter-spacing: 0.01em; }
.field input { width: 100%; min-height: 3rem; padding: 0.6rem 0.9rem; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-button); font-size: 1rem; }
.field input:focus { border-color: var(--blue-700); }

/* Buttons */
.button { display: inline-flex; align-items: center; justify-content: center; min-height: 3rem; padding: 0.65rem 1.2rem; border-radius: var(--radius-button); font-weight: 800; text-decoration: none; cursor: pointer; border: 1px solid transparent; transition: transform var(--dur-press) ease-out; }
.button:active { transform: scale(0.98); }
.button--primary { color: #fff; background: var(--blue-800); }
.button--primary:hover { background: var(--blue-900); }
.button--secondary, .button--ghost { color: var(--blue-800); background: var(--surface); border-color: var(--blue-700); }
.button--secondary:hover, .button--ghost:hover { background: var(--blue-050); }
.button--ghost { font-weight: 700; }
.button-row { display: flex; flex-wrap: wrap; gap: 0.6rem; margin-top: 1rem; }
.button-col { display: grid; gap: 0.6rem; margin-top: 1rem; }

.chip-row { display: flex; flex-wrap: wrap; gap: 0.45rem; margin-top: 0.75rem; }
.chip { padding: 0.4rem 0.75rem; color: var(--blue-800); background: var(--blue-050); border: 1px solid var(--line); border-radius: var(--radius-button); font-size: 0.88rem; font-weight: 600; cursor: pointer; transition: transform var(--dur-press) ease-out; }
.chip:hover { border-color: var(--blue-700); }
.chip:active { transform: scale(0.98); }

.segmented { display: flex; border: 1px solid var(--line); border-radius: var(--radius-button); overflow: hidden; }
.segmented button { display: inline-flex; flex: 1 1 auto; align-items: center; justify-content: center; gap: 0.4rem; min-height: 2.6rem; padding: 0.4rem 0.6rem; color: var(--ink); background: var(--surface); border: 0; border-right: 1px solid var(--line); font-weight: 600; font-size: 0.86rem; white-space: nowrap; cursor: pointer; }
.segmented button:last-child { border-right: 0; }
.segmented button:hover { background: var(--blue-050); }
.segmented button[aria-pressed="true"] { color: #fff; background: var(--blue-800); }
.segmented button:focus-visible { outline-offset: -3px; }
.dot { width: 0.7rem; height: 0.7rem; border-radius: 50%; }
.dot--a { background: var(--blue-800); }
.dot--b { background: var(--teal); }
.segmented button[aria-pressed="true"] .dot { box-shadow: 0 0 0 2px #fff; }

/* Schieberegler */
.slider { display: grid; gap: 0.35rem; margin-top: 0.85rem; }
.slider__head { display: flex; justify-content: space-between; align-items: baseline; font-size: 0.86rem; font-weight: 600; color: var(--ink); letter-spacing: 0.01em; }
.slider__head output { font-variant-numeric: tabular-nums; color: var(--blue-700); font-weight: 800; }
.slider__scale { display: flex; justify-content: space-between; color: var(--muted); font-size: 0.78rem; letter-spacing: 0.01em; }
.slider input[type="range"] { width: 100%; height: 2rem; margin: 0; accent-color: var(--blue-800); cursor: pointer; }

/* Station 1: Tokens und Einbettung */
.token-row { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.75rem; }
.token { display: inline-flex; flex-direction: column; align-items: flex-start; gap: 0.15rem; padding: 0.45rem 0.65rem; color: var(--ink); background: var(--blue-050); border: 1px solid var(--line); border-radius: var(--radius-button); cursor: pointer; text-align: left; transition: transform var(--dur-press) ease-out; }
.token:hover { border-color: var(--blue-700); }
.token:active { transform: scale(0.98); }
.token[aria-pressed="true"] { background: var(--blue-800); border-color: var(--blue-800); color: #fff; }
.token__text { font-weight: 700; font-size: 0.98rem; white-space: pre; }
.token__text .piece + .piece::before { content: "·"; margin: 0 0.15rem; opacity: 0.55; font-weight: 400; }
.token__id { font-size: 0.72rem; font-variant-numeric: tabular-nums; opacity: 0.8; letter-spacing: 0.02em; }
.token--punct { background: var(--surface-muted); }
.token--split { border-style: dashed; }

.embedding { margin-top: 1.25rem; padding-top: 1rem; border-top: 1px solid var(--line-soft); }
.embedding__head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 0.5rem; }
.embedding__head .panel__label { margin: 0; }
.embedding__head .panel__note { margin: 0; }
.embedding__cells { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 0.35rem; margin-top: 0.6rem; }
.cell { display: grid; grid-template-rows: 3.5rem auto; gap: 0.3rem; }
.cell__bar { position: relative; background: var(--surface-muted); border-radius: var(--radius-button); overflow: hidden; }
.cell__bar::before { content: ""; position: absolute; left: 0; right: 0; top: 50%; height: 1px; background: var(--line); }
.cell__fill { position: absolute; left: 0; right: 0; background: var(--blue-700); }
.cell__fill--neg { background: var(--teal); }
.cell__value { text-align: center; font-size: 0.74rem; font-variant-numeric: tabular-nums; color: var(--muted); }
.neighbors { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 0; padding: 0; list-style: none; }
.neighbors li { padding: 0.35rem 0.65rem; background: var(--teal-soft); border-radius: var(--radius-button); color: var(--ink); font-size: 0.9rem; font-weight: 600; }
.neighbors li span { margin-left: 0.35rem; color: var(--teal); font-variant-numeric: tabular-nums; font-weight: 700; }
.neighbors__empty { color: var(--muted); font-size: 0.9rem; font-weight: 500 !important; background: var(--surface-muted) !important; }

/* Station 2: Neuron */
.neuron-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 1.5rem; align-items: start; }
.neuron-view { position: sticky; top: calc(var(--header-height) + 1.5rem); }
#neuronSvg { width: 100%; height: auto; display: block; }
#neuronSvg line { stroke: var(--blue-700); stroke-linecap: round; }
#neuronSvg line.is-negative { stroke: var(--teal); stroke-dasharray: 6 5; }
#neuronSvg .n-in { fill: var(--blue-050); stroke: var(--blue-700); stroke-width: 2; }
#neuronSvg .n-core { fill: var(--blue-800); }
#neuronSvg .n-label { fill: var(--ink); font-size: 12px; font-weight: 700; font-family: inherit; }
#neuronSvg .n-core-label { fill: #fff; font-size: 18px; font-weight: 800; font-family: inherit; }
#neuronSvg .n-core-sub { fill: #cfe6f7; font-size: 11px; font-weight: 700; font-family: inherit; }
#neuronSvg .n-out-line { stroke: var(--line); stroke-width: 2; }
#neuronSvg .n-bar-bg { fill: var(--surface-muted); }
#neuronSvg .n-bar { fill: var(--blue-800); }
.neuron-result { display: flex; justify-content: space-between; align-items: baseline; margin: 0.75rem 0 0; padding: 0.75rem 1rem; background: var(--blue-050); border-radius: var(--radius-button); font-weight: 600; }
.neuron-result strong { color: var(--blue-800); font-size: 1.5rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.formula { margin: 0.75rem 0 0; color: var(--muted); font-size: 0.86rem; font-variant-numeric: tabular-nums; letter-spacing: 0.01em; }

/* Station 3: Training */
.training-layout { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(15rem, 0.9fr); gap: 1.5rem; align-items: start; }
.training-canvas-wrap { display: grid; grid-template-columns: auto minmax(0, 1fr); grid-template-rows: auto auto; gap: 0.5rem; align-items: center; }
.training-canvas { grid-column: 2; grid-row: 1; width: 100%; aspect-ratio: 1; display: block; background: var(--surface-muted); border: 1px solid var(--line); border-radius: var(--radius-card); cursor: crosshair; touch-action: manipulation; }
.axis-label { color: var(--muted); font-size: 0.78rem; letter-spacing: 0.01em; }
.axis-label--y { grid-column: 1; grid-row: 1; writing-mode: vertical-rl; transform: rotate(180deg); text-align: center; }
.axis-label--x { grid-column: 2; grid-row: 2; text-align: center; }
.readout { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.6rem; margin: 1rem 0 0; }
.readout div { padding: 0.6rem 0.75rem; background: var(--blue-050); border-radius: var(--radius-button); }
.readout dt { color: var(--muted); font-size: 0.74rem; font-weight: 700; letter-spacing: 0.02em; text-transform: uppercase; }
.readout dd { margin: 0.15rem 0 0; color: var(--blue-800); font-size: 1.15rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.loss-canvas { width: 100%; height: 3.5rem; display: block; background: var(--surface-muted); border: 1px solid var(--line-soft); border-radius: var(--radius-button); }

/* Station 4: Aufmerksamkeit */
.attention-stage { position: relative; margin-top: 0.75rem; padding-top: 5.5rem; }
.attention-arcs { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; }
.attention-arcs path { fill: none; stroke: var(--blue-700); stroke-linecap: round; }
.attention-arcs text { fill: var(--blue-800); font-size: 0.72rem; font-weight: 700; font-family: inherit; }
.token-row--attention { position: relative; gap: 0.55rem 0.5rem; }
.token--weighted { background: color-mix(in srgb, var(--blue-700) var(--w, 0%), var(--blue-050)); border-color: color-mix(in srgb, var(--blue-700) var(--w, 0%), var(--line)); }
.token--weighted.token--strong { color: #fff; }
.token__weight { font-size: 0.72rem; font-variant-numeric: tabular-nums; opacity: 0.85; }
.token--future { opacity: 0.45; }

/* Station 5: Nächstes Wort */
.lm-layout { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(15rem, 0.9fr); gap: 1.5rem; align-items: start; margin-top: 1.25rem; }
.candidates { display: grid; gap: 0.45rem; margin: 0; padding: 0; list-style: none; counter-reset: cand; }
.candidates li { display: grid; grid-template-columns: 1.4rem minmax(0, 1fr) 3.5rem; align-items: center; gap: 0.6rem; }
.candidates li::before { counter-increment: cand; content: counter(cand); color: var(--muted); font-size: 0.8rem; font-weight: 700; text-align: right; }
.cand__bar { position: relative; height: 2.1rem; background: var(--surface-muted); border-radius: var(--radius-button); overflow: hidden; }
.cand__fill { position: absolute; inset: 0 auto 0 0; background: var(--blue-050); border-right: 2px solid var(--blue-700); transition: transform var(--dur-state) var(--ease-out); transform-origin: left; }
.candidates li:first-child .cand__fill { background: var(--blue-100); border-right-color: var(--blue-800); }
.cand__word { position: relative; display: block; padding: 0 0.7rem; line-height: 2.1rem; color: var(--ink); font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cand__pct { color: var(--blue-800); font-weight: 800; font-variant-numeric: tabular-nums; text-align: right; font-size: 0.92rem; }
.context-badge { margin: 0.75rem 0 0; padding: 0.5rem 0.75rem; background: var(--surface-muted); border-radius: var(--radius-button); color: var(--ink); font-size: 0.86rem; letter-spacing: 0.01em; }
.context-badge.is-unknown { background: #fff3df; }

/* Praxis */
.section-heading { max-width: 44rem; margin-bottom: 2rem; }
.practice-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem; }
.practice-card { padding: 1.25rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-card); box-shadow: var(--shadow); }
.practice-card p { margin-bottom: 0; font-size: 0.95rem; }
.card-kicker { margin: 0 0 0.5rem; color: var(--teal); font-size: 0.78rem; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; }

.privacy-section { padding: 3.5rem 0; background: var(--blue-050); border-top: 1px solid var(--line-soft); }
.privacy-section__inner { max-width: 44rem; }
.privacy-section p:last-child { margin-bottom: 0; }

/* Breakpoints */
@media (max-width: 1020px) {
  .hero-tool__grid, .station__grid { grid-template-columns: minmax(0, 1fr); gap: 2rem; }
  .station__copy { position: static; }
  .neuron-view { position: static; }
  .practice-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .fact-strip { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 820px) {
  :root { --container: min(100vw - 28px, 1180px); --header-height: 4rem; }
  .section { padding: 4.25rem 0; }
  .hero-tool { padding: 3.25rem 0 3.75rem; }
  .tool-header__grid { flex-direction: column; align-items: stretch; gap: 0.5rem; padding: 0.6rem 0; }
  .brand { align-self: flex-start; }
  .station-nav { justify-content: flex-start; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin: 0 -0.25rem; padding: 0 0.25rem 0.25rem; }
  .station-nav::-webkit-scrollbar { display: none; }
  .station-nav a { padding: 0.45rem 0.6rem; font-size: 0.86rem; }
  .neuron-layout, .training-layout, .lm-layout { grid-template-columns: minmax(0, 1fr); }
  .fact-strip { grid-template-columns: minmax(0, 1fr); }
  .embedding__cells { gap: 0.25rem; }
}

@media (max-width: 520px) {
  .panel { padding: 1.1rem; }
  .practice-grid { grid-template-columns: minmax(0, 1fr); }
  .cta-group .button, .button-row .button { width: 100%; }
  .readout { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.4rem; }
  .readout dd { font-size: 1rem; }
  .attention-stage { padding-top: 4.5rem; }
}

/* Barrierefreiheit: die drei Medienabfragen */
@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; }
  html { scroll-behavior: auto !important; }
}

@media (prefers-reduced-transparency: reduce) {
  .tool-header { background: var(--surface); backdrop-filter: none; }
}

@media (prefers-contrast: more) {
  .tool-header { background: var(--surface); border-bottom: 1px solid var(--ink); }
  .panel, .practice-card, .fact-strip div { border-color: var(--ink); }
}
