/* ==========================================================================
   Die Coderei – Stylesheet
   ========================================================================== */

:root {
  --bg: #0a0e14;
  --bg-2: #0d131c;
  --surface: rgba(17, 24, 35, 0.72);
  --surface-solid: #111823;
  --border: #1f2b3c;
  --border-hi: #2c3d55;
  --text: #e6edf3;
  --muted: #a2afc0;
  --accent: #3dffa8;
  --accent-2: #5cc8ff;
  --accent-3: #a78bfa;
  --danger: #ff6b6b;
  --glow: 0 0 24px rgba(61, 255, 168, 0.35);

  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "Cascadia Code", "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;

  --radius: 16px;
  --gutter: clamp(16px, 4vw, 40px);
  --max: 1180px;
  --ease: cubic-bezier(.2, .8, .2, 1);
}

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

html { scroll-behavior: smooth; scroll-padding-top: 84px; -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: clamp(16px, 1.05vw, 17.5px);
  line-height: 1.65;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

body::before { /* sanfte Farbflecken im Hintergrund */
  content: "";
  position: fixed;
  inset: -20vmax;
  z-index: -2;
  background:
    radial-gradient(40vmax 40vmax at 15% 10%, rgba(61, 255, 168, .08), transparent 60%),
    radial-gradient(35vmax 35vmax at 90% 30%, rgba(92, 200, 255, .07), transparent 60%),
    radial-gradient(40vmax 40vmax at 50% 100%, rgba(167, 139, 250, .07), transparent 60%);
  animation: drift 24s ease-in-out infinite alternate;
}

@keyframes drift {
  to { transform: translate3d(3vmax, -2vmax, 0) rotate(4deg); }
}

#bg-net {
  position: fixed;
  inset: 0;
  z-index: -1;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.noise {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: .035;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }

::selection { background: var(--accent); color: var(--bg); }

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

.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;
}

code {
  font-family: var(--mono);
  font-size: .88em;
  padding: .12em .42em;
  border-radius: 6px;
  background: rgba(61, 255, 168, .08);
  border: 1px solid rgba(61, 255, 168, .18);
  color: var(--accent);
  white-space: nowrap;
}

h1, h2, h3 { line-height: 1.12; margin: 0; letter-spacing: -.02em; }

/* ---------- Buttons ---------- */
.btn {
  --b: var(--accent);
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5em;
  padding: .85em 1.5em;
  border: 1px solid var(--b);
  border-radius: 999px;
  background: var(--b);
  color: var(--bg);
  font: 600 1rem/1 var(--font);
  cursor: pointer;
  overflow: hidden;
  isolation: isolate;
  transition: transform .25s var(--ease), box-shadow .25s var(--ease);
}
.btn::after { /* Glanz-Streifen */
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(110deg, transparent 30%, rgba(255, 255, 255, .55) 50%, transparent 70%);
  transform: translateX(-120%);
  transition: transform .7s var(--ease);
}
.btn:hover { text-decoration: none; transform: translateY(-2px); box-shadow: var(--glow); }
.btn:hover::after { transform: translateX(120%); }
.btn:active { transform: translateY(0); }

.btn-ghost { background: transparent; color: var(--text); border-color: var(--border-hi); }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }
.btn-sm { padding: .6em 1.1em; font-size: .9rem; }
.btn-block { width: 100%; }

/* ---------- Navigation ---------- */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 18px var(--gutter);
  transition: background .3s, padding .3s, border-color .3s;
  border-bottom: 1px solid transparent;
}
.nav.is-scrolled {
  padding-top: 12px;
  padding-bottom: 12px;
  background: rgba(10, 14, 20, .72);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  border-bottom-color: var(--border);
}

.logo {
  font-family: var(--mono);
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--text);
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
}
.logo:hover { text-decoration: none; }
.logo-br { color: var(--muted); }
.logo-slash { color: var(--accent); }
.logo-sm { font-size: .95rem; color: var(--muted); }
.cursor {
  display: inline-block;
  width: .55em;
  height: 1.1em;
  margin-left: 4px;
  background: var(--accent);
  animation: blink 1.05s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0; } }

.menu { display: flex; align-items: center; gap: clamp(1rem, 2.5vw, 2rem); }
.menu a:not(.btn) {
  position: relative;
  color: var(--muted);
  font-size: .95rem;
  transition: color .2s;
}
.menu a:not(.btn)::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -4px;
  height: 2px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform .3s var(--ease);
}
.menu a:not(.btn):hover, .menu a.is-current { color: var(--text); text-decoration: none; }
.menu a:not(.btn):hover::after, .menu a.is-current::after { transform: scaleX(1); transform-origin: left; }

.burger {
  display: none;
  width: 44px; height: 44px;
  padding: 10px;
  background: transparent;
  border: 1px solid var(--border-hi);
  border-radius: 12px;
  cursor: pointer;
  position: relative;
  z-index: 60;
}
.burger span {
  display: block;
  height: 2px;
  margin: 5px 0;
  background: var(--text);
  border-radius: 2px;
  transition: transform .35s var(--ease), opacity .2s;
}
.burger[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.burger[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.burger[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  min-height: 100svh;
  max-width: var(--max);
  margin: 0 auto;
  padding: 120px var(--gutter) 90px;
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  align-items: center;
  gap: clamp(2rem, 5vw, 4rem);
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: .6em;
  margin: 0 0 1.4rem;
  padding: .4em .9em;
  border: 1px solid var(--border-hi);
  border-radius: 999px;
  background: var(--surface);
  font-family: var(--mono);
  font-size: .8rem;
  color: var(--muted);
}
.dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 0 rgba(61, 255, 168, .6);
  animation: pulse 2s infinite;
}
@keyframes pulse {
  70% { box-shadow: 0 0 0 10px rgba(61, 255, 168, 0); }
  100% { box-shadow: 0 0 0 0 rgba(61, 255, 168, 0); }
}

h1 { font-size: clamp(2.6rem, 6.4vw, 4.8rem); font-weight: 800; }

.grad {
  background: linear-gradient(100deg, var(--accent) 0%, var(--accent-2) 45%, var(--accent-3) 90%);
  background-size: 200% auto;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: shine 6s linear infinite;
}
@keyframes shine { to { background-position: 200% center; } }

.hero-q {
  margin: 1.6rem 0 0;
  min-height: 1.7em;
  font-family: var(--mono);
  font-size: clamp(1rem, 1.6vw, 1.2rem);
  color: var(--text);
}
.prompt { color: var(--accent); font-weight: 700; margin-right: .3em; }
.caret {
  display: inline-block;
  width: 2px; height: 1.15em;
  margin-left: 2px;
  vertical-align: -.2em;
  background: var(--accent);
  animation: blink 1s steps(1) infinite;
}

.lead { margin: 1.2rem 0 0; max-width: 34em; color: var(--muted); font-size: 1.08em; }

.hero-search, .search {
  position: relative;
  display: flex;
  align-items: center;
  gap: .5rem;
  border: 1px solid var(--border-hi);
  border-radius: 999px;
  background: var(--surface);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: border-color .25s, box-shadow .25s;
}
.hero-search { margin-top: 2rem; max-width: 30rem; padding: 6px 6px 6px 1.1rem; }
.hero-search:focus-within, .search:focus-within { border-color: var(--accent); box-shadow: var(--glow); }
.hs-icon { color: var(--accent); font-size: 1.25rem; line-height: 1; }
.hero-search input, .search input {
  flex: 1;
  min-width: 0;
  padding: .55em 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  font: inherit;
}
.hero-search input::placeholder, .search input::placeholder { color: var(--muted); }
input[type="search"]::-webkit-search-cancel-button { filter: invert(1) hue-rotate(110deg); }

/* Terminal */
.terminal {
  position: relative;
  border: 1px solid var(--border-hi);
  border-radius: var(--radius);
  background: rgba(8, 12, 18, .85);
  box-shadow: 0 30px 80px -20px rgba(0, 0, 0, .8), 0 0 0 1px rgba(61, 255, 168, .05), 0 0 60px -10px rgba(61, 255, 168, .15);
  overflow: hidden;
  transform: perspective(1200px) rotateY(-8deg) rotateX(4deg);
  transition: transform .6s var(--ease);
}
.terminal:hover { transform: perspective(1200px) rotateY(0) rotateX(0); }
.term-bar {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  background: rgba(255, 255, 255, .02);
}
.tdot { width: 11px; height: 11px; border-radius: 50%; }
.tdot.r { background: #ff5f57; } .tdot.y { background: #febc2e; } .tdot.g { background: #28c840; }
.term-title { margin-left: auto; margin-right: auto; font-family: var(--mono); font-size: .78rem; color: var(--muted); }
.term-body {
  margin: 0;
  padding: 18px 20px 22px;
  min-height: 300px;
  font-family: var(--mono);
  font-size: .86rem;
  line-height: 1.75;
  color: var(--text);
  white-space: pre-wrap;
  word-break: break-word;
}
.term-body .c-p { color: var(--accent); }
.term-body .c-m { color: var(--muted); }
.term-body .c-k { color: var(--accent-2); }
.term-body .c-v { color: var(--accent-3); }
.term-body .t-caret {
  display: inline-block;
  width: .55em; height: 1.05em;
  vertical-align: -.15em;
  background: var(--accent);
  animation: blink 1s steps(1) infinite;
}

.scroll-hint {
  position: absolute;
  left: 50%; bottom: 26px;
  width: 26px; height: 42px;
  margin-left: -13px;
  border: 2px solid var(--border-hi);
  border-radius: 14px;
}
.scroll-hint span {
  position: absolute;
  left: 50%; top: 8px;
  width: 4px; height: 8px;
  margin-left: -2px;
  border-radius: 2px;
  background: var(--accent);
  animation: wheel 1.8s var(--ease) infinite;
}
@keyframes wheel {
  0% { transform: translateY(0); opacity: 1; }
  80% { transform: translateY(14px); opacity: 0; }
  100% { opacity: 0; }
}

/* ---------- Marquee ---------- */
.marquee {
  overflow: hidden;
  padding: 1.1rem 0;
  border-block: 1px solid var(--border);
  background: rgba(13, 19, 28, .6);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent);
}
.marquee-track {
  display: flex;
  width: max-content;
  gap: 2.4rem;
  animation: marquee 70s linear infinite;
}
.marquee:hover .marquee-track { animation-play-state: paused; }
.marquee span {
  font-family: var(--mono);
  font-size: clamp(1rem, 2vw, 1.35rem);
  color: var(--muted);
  white-space: nowrap;
}
.marquee span::before { content: "#"; color: var(--accent); margin-right: .2em; }
@keyframes marquee { to { transform: translateX(calc(-50% - 1.2rem)); } }

/* ---------- Sections ---------- */
.section {
  max-width: var(--max);
  margin: 0 auto;
  padding: clamp(80px, 12vw, 140px) var(--gutter) 0;
}
.sec-head { max-width: 42rem; margin-bottom: clamp(2rem, 4vw, 3rem); }
.sec-tag { margin: 0 0 .8rem; font-family: var(--mono); font-size: .85rem; color: var(--accent); }
.sec-head h2, .contact h2 { font-size: clamp(2rem, 4.4vw, 3.2rem); font-weight: 800; }
.sec-sub { margin: .9rem 0 0; color: var(--muted); }

/* ---------- Lexikon ---------- */
.lex-tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem 1.5rem;
  margin-bottom: 1.8rem;
}
.search { flex: 1 1 260px; max-width: 26rem; padding: 4px 1.1rem; }
.filters { display: flex; flex-wrap: wrap; gap: .5rem; }
.chip {
  padding: .5em 1em;
  border: 1px solid var(--border-hi);
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font: 500 .88rem/1 var(--font);
  cursor: pointer;
  transition: all .25s var(--ease);
}
.chip:hover { color: var(--text); border-color: var(--muted); }
.chip.is-active { background: var(--accent); border-color: var(--accent); color: var(--bg); box-shadow: var(--glow); }
.az {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  width: 100%;
}
.az-btn {
  width: 34px; height: 34px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(8, 12, 18, .5);
  color: var(--text);
  font: 600 .85rem/1 var(--mono);
  cursor: pointer;
  transition: all .2s var(--ease);
}
.az-btn:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); transform: translateY(-2px); }
.az-btn.is-active { background: var(--accent); border-color: var(--accent); color: var(--bg); box-shadow: var(--glow); }
.az-btn:disabled { opacity: .25; cursor: default; }
.lex-count { margin: 0 0 0 auto; font-family: var(--mono); font-size: .82rem; color: var(--muted); }

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr));
  gap: 1rem;
  align-items: start;
}

.card {
  --mx: 50%; --my: 50%;
  position: relative;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  overflow: hidden;
  transition: border-color .3s, transform .35s var(--ease), box-shadow .35s var(--ease);
  transform-style: preserve-3d;
}
.card::before { /* Licht folgt dem Cursor */
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(380px circle at var(--mx) var(--my), rgba(61, 255, 168, .12), transparent 45%);
  opacity: 0;
  transition: opacity .35s;
}
.card:hover { border-color: var(--border-hi); box-shadow: 0 20px 50px -25px rgba(0, 0, 0, .9); }
.card:hover::before { opacity: 1; }
.card.is-open { border-color: rgba(61, 255, 168, .45); box-shadow: 0 0 0 1px rgba(61, 255, 168, .15), 0 20px 50px -20px rgba(61, 255, 168, .2); }
.card.is-target { animation: target 1.6s var(--ease); }
@keyframes target {
  0%, 40% { box-shadow: 0 0 0 3px var(--accent), var(--glow); }
}
.card.is-hidden { display: none; }

.card-head {
  position: relative;
  display: grid;
  grid-template-columns: auto 1fr auto;
  grid-template-areas: "icon meta toggle" "icon title toggle";
  align-items: center;
  column-gap: 1rem;
  width: 100%;
  padding: 1.2rem 1.3rem;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.card-icon {
  grid-area: icon;
  display: grid;
  place-items: center;
  width: 46px; height: 46px;
  border: 1px solid var(--border-hi);
  border-radius: 12px;
  background: linear-gradient(145deg, rgba(61, 255, 168, .1), rgba(92, 200, 255, .05));
  font-family: var(--mono);
  font-size: 1.3rem;
  font-weight: 700;
  letter-spacing: -.04em;
  white-space: nowrap;
  color: var(--accent);
  transition: transform .45s var(--ease);
}
.card:hover .card-icon, .card.is-open .card-icon { transform: rotate(-8deg) scale(1.08); }
.card-meta { grid-area: meta; font-family: var(--mono); font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.card-h { margin: 0; font-size: inherit; }
.card-title { grid-area: title; font-size: 1.12rem; font-weight: 700; line-height: 1.25; }
.card-toggle {
  grid-area: toggle;
  position: relative;
  width: 28px; height: 28px;
  border: 1px solid var(--border-hi);
  border-radius: 50%;
  transition: transform .4s var(--ease), border-color .3s, background .3s;
}
.card-toggle::before, .card-toggle::after {
  content: "";
  position: absolute;
  left: 50%; top: 50%;
  width: 11px; height: 2px;
  margin: -1px 0 0 -5.5px;
  background: var(--text);
  border-radius: 2px;
}
.card-toggle::after { transform: rotate(90deg); transition: transform .4s var(--ease); }
.card.is-open .card-toggle { transform: rotate(180deg); border-color: var(--accent); background: var(--accent); }
.card.is-open .card-toggle::before, .card.is-open .card-toggle::after { background: var(--bg); }
.card.is-open .card-toggle::after { transform: rotate(0); }

.card-body { /* Grid-Trick für Höhen-Animation */
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows .45s var(--ease);
}
.card-body > div {
  overflow: hidden;
  padding: 0 1.3rem;
  color: #c5d0dc;
  font-size: .97rem;
}
.card.is-open .card-body { grid-template-rows: 1fr; }
.card.is-open .card-body > div { padding-bottom: 1.3rem; }
.card-body p { margin: 0 0 .8rem; }
.card-body ul { margin: 0 0 .8rem; padding-left: 1.2rem; }
.card-body li { margin-bottom: .3rem; }
.card-body li::marker { color: var(--accent); }
.card-body .tip {
  margin-bottom: 0;
  padding: .8rem 1rem;
  border-left: 3px solid var(--accent);
  border-radius: 0 10px 10px 0;
  background: rgba(61, 255, 168, .06);
  font-size: .93rem;
}

.empty {
  grid-column: 1 / -1;
  padding: 2rem;
  border: 1px dashed var(--border-hi);
  border-radius: var(--radius);
  text-align: center;
  color: var(--muted);
}

mark { background: rgba(61, 255, 168, .25); color: inherit; border-radius: 3px; padding: 0 2px; }

/* ---------- Timeline ---------- */
.timeline {
  --progress: 0;
  position: relative;
  max-width: 820px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.timeline::before, .timeline::after {
  content: "";
  position: absolute;
  top: 6px; bottom: 6px;
  left: 76px;
  width: 2px;
  border-radius: 2px;
}
.timeline::before { background: var(--border); }
.timeline::after {
  background: linear-gradient(var(--accent), var(--accent-2));
  box-shadow: 0 0 12px var(--accent);
  transform-origin: top;
  transform: scaleY(var(--progress));
}
.tl-item {
  position: relative;
  display: grid;
  grid-template-columns: 60px 1fr;
  gap: 2.2rem;
  padding-bottom: 1.6rem;
}
.tl-item time {
  padding-top: 1.15rem;
  font-family: var(--mono);
  font-size: .9rem;
  color: var(--accent);
  text-align: right;
}
.tl-item::before { /* Knoten auf der Linie */
  content: "";
  position: absolute;
  left: 71px; top: 1.4rem;
  z-index: 1;
  width: 12px; height: 12px;
  border: 2px solid var(--accent);
  border-radius: 50%;
  background: var(--bg);
  transition: background .4s, box-shadow .4s;
}
.tl-item.is-visible::before { background: var(--accent); box-shadow: var(--glow); }
.tl-card {
  padding: 1.1rem 1.3rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  transition: border-color .3s, transform .3s var(--ease);
}
.tl-card:hover { border-color: var(--border-hi); transform: translateX(6px); }
.tl-card h3 { font-size: 1.1rem; margin-bottom: .4rem; }
.tl-card p { margin: 0; color: var(--muted); font-size: .97rem; }
.tl-link { display: inline-block; margin-top: .6rem; font-family: var(--mono); font-size: .85rem; }

/* ---------- Stats ---------- */
.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
}
.stat {
  padding: 1.8rem 1.4rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  text-align: center;
  transition: transform .35s var(--ease), border-color .3s;
}
.stat:hover { transform: translateY(-4px); border-color: var(--border-hi); }
.stat-num {
  display: block;
  font-family: var(--mono);
  font-size: clamp(2rem, 4vw, 2.8rem);
  font-weight: 700;
  background: linear-gradient(120deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  white-space: nowrap;
}
.stat-label { display: block; margin-top: .4rem; color: var(--muted); font-size: .92rem; }

/* ---------- Kontakt ---------- */
.contact {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1.1fr;
  gap: clamp(2rem, 5vw, 4rem);
  padding: clamp(1.6rem, 4vw, 3.2rem);
  border: 1px solid var(--border-hi);
  border-radius: calc(var(--radius) * 1.5);
  background:
    radial-gradient(600px circle at 0% 0%, rgba(61, 255, 168, .1), transparent 50%),
    radial-gradient(500px circle at 100% 100%, rgba(167, 139, 250, .1), transparent 50%),
    var(--surface);
  overflow: hidden;
}
.contact-text p:not(.sec-tag) { color: var(--muted); margin: 1rem 0 1.4rem; }
.mail-link {
  font-family: var(--mono);
  font-size: clamp(1rem, 2vw, 1.2rem);
  word-break: break-all;
}

.form { display: grid; gap: 1rem; }
.field { position: relative; }
.field input, .field textarea {
  width: 100%;
  padding: 1.35rem 1rem .55rem;
  border: 1px solid var(--border-hi);
  border-radius: 12px;
  background: rgba(8, 12, 18, .6);
  color: var(--text);
  font: inherit;
  resize: vertical;
  transition: border-color .25s, box-shadow .25s;
}
.field input:focus, .field textarea:focus { outline: 0; border-color: var(--accent); box-shadow: var(--glow); }
.field label {
  position: absolute;
  left: 1rem; top: 1rem;
  color: var(--muted);
  pointer-events: none;
  transform-origin: left top;
  transition: transform .25s var(--ease), color .25s;
}
.field input:focus + label, .field input:not(:placeholder-shown) + label,
.field textarea:focus + label, .field textarea:not(:placeholder-shown) + label {
  transform: translateY(-.62rem) scale(.75);
  color: var(--accent);
}
.field.is-invalid input, .field.is-invalid textarea { border-color: var(--danger); }
.form-note { margin: 0; font-size: .82rem; color: var(--muted); }
.form-note.is-ok { color: var(--accent); }

/* ---------- Footer ---------- */
.footer {
  max-width: var(--max);
  margin: clamp(80px, 10vw, 120px) auto 0;
  padding: 2rem var(--gutter) 2.4rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: .9rem;
}
.foot-links { display: flex; gap: 1.4rem; }
.foot-links a { color: var(--muted); }
.foot-links a:hover { color: var(--accent); }

/* ---------- Scroll-Reveal ---------- */
.js .reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity .8s var(--ease), transform .8s var(--ease);
  transition-delay: var(--d, 0s);
}
.js .reveal.is-visible { opacity: 1; transform: none; }
.js .terminal.reveal { transform: perspective(1200px) rotateY(-8deg) rotateX(4deg) translateY(40px); }
.js .terminal.reveal.is-visible { transform: perspective(1200px) rotateY(-8deg) rotateX(4deg); }
.js .terminal.reveal.is-visible:hover { transform: perspective(1200px) rotateY(0) rotateX(0); }

.card-more { margin: .9rem 0 0; font-family: var(--mono); font-size: .85rem; }

/* ---------- Begriffsseiten ---------- */
.term-page {
  max-width: 820px;
  margin: 0 auto;
  padding: 120px var(--gutter) 0;
}
.crumbs {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  margin-bottom: 2.4rem;
  font-family: var(--mono);
  font-size: .82rem;
  color: var(--muted);
}
.crumbs a { color: var(--muted); }
.crumbs a:hover { color: var(--accent); }
.crumbs [aria-current] { color: var(--text); }
.term-hero { margin-bottom: 1.8rem; }
.term-icon { width: 64px; height: 64px; margin-bottom: 1.2rem; font-size: 1.8rem; border-radius: 16px; }
.term-hero h1 { font-size: clamp(2.2rem, 5.5vw, 3.6rem); }
.def-box {
  padding: 1.4rem 1.6rem;
  border: 1px solid rgba(61, 255, 168, .35);
  border-radius: var(--radius);
  background: linear-gradient(135deg, rgba(61, 255, 168, .09), rgba(92, 200, 255, .04));
  box-shadow: 0 0 40px -18px rgba(61, 255, 168, .5);
}
.def-label { margin: 0 0 .4rem; font-family: var(--mono); font-size: .78rem; text-transform: uppercase; letter-spacing: .1em; color: var(--accent); }
.def-text { margin: 0; font-size: clamp(1.08rem, 1.8vw, 1.25rem); line-height: 1.55; color: var(--text); }
.article-body { margin-top: 2.6rem; color: #c5d0dc; font-size: 1.05rem; }
.article-body h2 { font-size: 1.5rem; margin-bottom: 1rem; color: var(--text); }
.article-body p { margin: 0 0 1rem; }
.article-body ul { margin: 0 0 1rem; padding-left: 1.3rem; }
.article-body li { margin-bottom: .4rem; }
.article-body li::marker { color: var(--accent); }
.article-body .tip {
  padding: 1rem 1.2rem;
  border-left: 3px solid var(--accent);
  border-radius: 0 12px 12px 0;
  background: rgba(61, 255, 168, .06);
}
.article-body .term-updated { margin-top: 1.6rem; font-family: var(--mono); font-size: .8rem; color: var(--muted); }
.related { margin-top: 3.4rem; }
.related h2 { font-size: 1.3rem; margin-bottom: 1rem; }
.related-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr)); gap: .8rem; }
.rel-card {
  display: flex;
  align-items: center;
  gap: .9rem;
  padding: .9rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  transition: border-color .25s, transform .3s var(--ease);
}
.rel-card:hover { text-decoration: none; border-color: var(--accent); transform: translateY(-3px); }
.rel-card .card-icon { width: 40px; height: 40px; font-size: 1.1rem; flex-shrink: 0; }
.rel-card .card-meta { display: block; }
.rel-title { display: block; font-weight: 700; }
.term-cta {
  margin-top: 3.4rem;
  padding: 1.6rem;
  border: 1px solid var(--border-hi);
  border-radius: var(--radius);
  background: var(--surface);
}
.term-cta p { margin: 0 0 1.2rem; color: var(--muted); }
.term-cta strong { display: block; margin-bottom: .3rem; font-size: 1.15rem; color: var(--text); }
.term-cta-btns { display: flex; flex-wrap: wrap; gap: .8rem; }

/* Langversion */
.article-body h2 + p, .article-body h3 + p { margin-top: 0; }
.article-body > h2:not(:first-child) { margin-top: 2.4rem; }
.article-body .faq-q {
  margin: 1.4rem 0 .4rem;
  font-size: 1.08rem;
  color: var(--text);
}
.article-body .faq-q::before { content: "? "; color: var(--accent); font-family: var(--mono); }

.byline {
  display: flex;
  align-items: center;
  gap: .7rem;
  margin: 1.2rem 0 0;
  font-size: .92rem;
  color: var(--muted);
}
.byline img { width: 32px; height: 32px; border-radius: 50%; border: 1px solid var(--border-hi); }
.byline a { color: var(--text); }

.sources { margin-top: 3rem; }
.sources h2 { font-size: 1.3rem; margin-bottom: .8rem; }
.sources ul { margin: 0; padding-left: 1.2rem; color: var(--muted); }
.sources li { margin-bottom: .35rem; }
.sources li::marker { color: var(--accent); }
.sources a { word-break: break-word; }

.author {
  display: flex;
  gap: 1.3rem;
  align-items: flex-start;
  margin-top: 3rem;
  padding: 1.4rem;
  border: 1px solid var(--border-hi);
  border-radius: var(--radius);
  background: var(--surface);
}
.author img { width: 88px; height: 88px; border-radius: 50%; border: 2px solid var(--accent); flex-shrink: 0; object-fit: cover; }
.author p { margin: 0; }
.author-label { font-family: var(--mono); font-size: .78rem; text-transform: uppercase; letter-spacing: .08em; color: var(--accent); }
.author-name { font-size: 1.2rem; font-weight: 700; margin-top: .15rem !important; }
.author-job { color: var(--muted); margin: .3rem 0 .8rem !important; }

.social { display: flex; flex-wrap: wrap; gap: .6rem; }
.social a {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  padding: .45em .9em;
  border: 1px solid var(--border-hi);
  border-radius: 999px;
  color: var(--text);
  font-size: .9rem;
  transition: border-color .25s, color .25s, transform .25s var(--ease);
}
.social a:hover { text-decoration: none; border-color: var(--accent); color: var(--accent); transform: translateY(-2px); }

/* Über mich (Startseite) */
.about {
  display: grid;
  grid-template-columns: minmax(200px, 320px) 1fr;
  gap: clamp(1.6rem, 5vw, 3.6rem);
  align-items: center;
}
.about-photo { position: relative; }
.about-photo::before {
  content: "";
  position: absolute;
  inset: -10px;
  border-radius: 28px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2), var(--accent-3));
  opacity: .35;
  filter: blur(18px);
}
.about-photo img {
  position: relative;
  display: block;
  width: 100%;
  height: auto;
  border-radius: 24px;
  border: 1px solid var(--border-hi);
}
/* Foto: 8-Bit-Version beim Darüberfahren, Aufbau aus Blöcken (Canvas, per JS) */
.about-photo .about-pixel {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity .45s var(--ease);
}
.about-photo:hover .about-pixel { opacity: 1; }
.about-badge {
  position: absolute;
  right: 12px; bottom: 12px;
  z-index: 3;
  padding: .25em .6em;
  border-radius: 6px;
  background: rgba(10, 14, 20, .8);
  color: var(--accent);
  font: 700 .72rem/1 var(--mono);
  letter-spacing: .08em;
  text-transform: uppercase;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity .3s, transform .3s var(--ease);
}
.about-photo:hover .about-badge { opacity: 1; transform: none; }
.about-photo.is-building .about-real,
.about-photo.is-building .about-pixel { opacity: 0; transition: none; }
.about-canvas {
  position: absolute;
  inset: 0;
  z-index: 2;
  width: 100%;
  height: 100%;
  border-radius: 24px;
  transition: opacity .5s var(--ease);
}
.about-canvas.is-done { opacity: 0; }
.about-text h2 { font-size: clamp(2rem, 4.4vw, 3rem); font-weight: 800; }
.about-role { margin: .5rem 0 1.2rem; font-family: var(--mono); color: var(--accent); }
.about-text p:not(.sec-tag):not(.about-role):not(.social) { color: #c5d0dc; }
.about .social { margin-top: 1.4rem; }

.copy-mail { margin-top: 1rem; }
.copy-mail.is-ok { border-color: var(--accent); color: var(--accent); }

/* Zufalls-Kachel mit laufendem Rahmen */
@property --angle {
  syntax: '<angle>';
  initial-value: 0deg;
  inherits: false;
}
.stat-random {
  position: relative;
  padding: 2px;
  border: 0;
  background: var(--border);
  isolation: isolate;
  overflow: hidden;
  transition: transform .35s var(--ease), box-shadow .6s var(--ease);
}
.stat-random::before { /* der laufende Lichtstreifen */
  content: "";
  position: absolute;
  inset: -60%;
  z-index: -1;
  background: conic-gradient(from var(--angle), transparent 0deg 240deg, var(--accent-3) 285deg, var(--accent-2) 320deg, var(--accent) 352deg, transparent 360deg);
  animation: run-border 4.5s linear infinite;
}
@keyframes run-border { to { --angle: 360deg; } }
.stat-random.is-focus { box-shadow: 0 0 0 1px rgba(61, 255, 168, .3), 0 0 50px -8px rgba(61, 255, 168, .55); transform: translateY(-4px) scale(1.03); }
.stat-random.is-focus::before { animation-duration: 1.4s; }
.stat-random-inner {
  display: flex;
  flex-direction: column;
  justify-content: center;
  height: 100%;
  padding: 1.6rem 1.2rem 1.2rem;
  border-radius: calc(var(--radius) - 2px);
  background: var(--surface-solid);
}
.stat-random .stat-num, .stat-random .stat-label { transition: opacity .3s var(--ease), filter .3s var(--ease); }
.stat-random.is-out .stat-num, .stat-random.is-out .stat-label { opacity: 0; filter: blur(6px); }
.random-next {
  align-self: center;
  margin-top: .7rem;
  padding: .3em .8em;
  border: 1px solid var(--border-hi);
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font: 500 .78rem/1 var(--mono);
  cursor: pointer;
  transition: color .2s, border-color .2s;
}
.random-next:hover { color: var(--accent); border-color: var(--accent); }

/* ---------- Unterseiten (Impressum) ---------- */
.page {
  max-width: 760px;
  margin: 0 auto;
  padding: 130px var(--gutter) 0;
}
.page h1 { font-size: clamp(2.2rem, 5vw, 3.2rem); margin-bottom: 2rem; }
.page h2 { font-size: 1.4rem; margin: 2.4rem 0 .8rem; color: var(--accent); }
.page p, .page li { color: #c5d0dc; }
.todo { padding: .1em .4em; border-radius: 4px; background: rgba(255, 107, 107, .15); color: var(--danger); font-family: var(--mono); font-size: .9em; }

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
  .hero { grid-template-columns: 1fr; padding-top: 110px; min-height: auto; }
  .terminal, .js .terminal.reveal, .js .terminal.reveal.is-visible { transform: none; }
  .scroll-hint { display: none; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .contact { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
  .burger { display: block; }
  .menu {
    position: fixed;
    inset: 0;
    flex-direction: column;
    justify-content: center;
    gap: 1.8rem;
    background: rgba(10, 14, 20, .96);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    clip-path: circle(0 at calc(100% - 42px) 40px);
    transition: clip-path .6s var(--ease);
    visibility: hidden;
  }
  .menu.is-open { clip-path: circle(150% at calc(100% - 42px) 40px); visibility: visible; }
  .menu a:not(.btn) { font-size: 1.6rem; color: var(--text); }
  .menu .btn { font-size: 1.05rem; padding: .9em 1.6em; }
  body.menu-open { overflow: hidden; }

  .lex-count { margin-left: 0; width: 100%; }
  .search { max-width: none; }
  .filters { flex-wrap: nowrap; overflow-x: auto; width: 100%; padding-bottom: 4px; scrollbar-width: none; }
  .filters::-webkit-scrollbar { display: none; }
  .chip { flex-shrink: 0; }
  .az { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }
  .filters, .az { -webkit-mask-image: linear-gradient(90deg, #000 85%, transparent); mask-image: linear-gradient(90deg, #000 85%, transparent); padding-right: 24px; }
  .az::-webkit-scrollbar { display: none; }
  .az-btn { flex-shrink: 0; width: 38px; height: 38px; }

  .timeline::before, .timeline::after { left: 6px; }
  .tl-item { grid-template-columns: 1fr; gap: .4rem; padding-left: 32px; }
  .tl-item::before { left: 1px; top: .3rem; }
  .tl-item time { padding-top: 0; text-align: left; }

  .term-body { min-height: 250px; font-size: .8rem; }
  .footer { flex-direction: column; text-align: center; }
  .foot-links { flex-wrap: wrap; justify-content: center; gap: .8rem 1.4rem; }

  .about { grid-template-columns: 1fr; }
  .about-photo { max-width: 240px; }
  .author { flex-direction: column; }
}

@media (max-width: 420px) {
  .stats { grid-template-columns: 1fr; }
  .hero-search .btn { display: none; }
  .hero-search { padding-right: 1.1rem; }
}

@media (hover: none) {
  .card::before { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
  html { scroll-behavior: auto; }
  .js .reveal { opacity: 1; transform: none; }
  .marquee-track { animation: none; }
}
