/* Alrik-GmbH – alrik-gmbh.de
   Handgeschrieben, ohne Framework. Schriften lokal (SIL Open Font License). */

@font-face { font-family: "Space Grotesk"; src: url("/assets/fonts/space-grotesk.woff2") format("woff2"); font-weight: 300 700; font-display: swap; }
@font-face { font-family: "Inter"; src: url("/assets/fonts/inter.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }
@font-face { font-family: "JetBrains Mono"; src: url("/assets/fonts/jetbrains-mono.woff2") format("woff2"); font-weight: 100 800; font-display: swap; }

/* ---------- Tokens ---------- */
:root {
  --bg: #f5f4ef;
  --bg-2: #ecebe4;
  --surface: #ffffff;
  --surface-2: #f9f8f4;
  --fg: #10141c;
  --fg-2: #3a4252;
  --muted: #6a7282;
  --line: #dddbd2;
  --line-2: #cfccc1;
  --accent: #0b7d6e;
  --accent-2: #b8650a;
  --accent-ink: #ffffff;
  --accent-soft: rgba(11, 125, 110, .1);
  --glow: rgba(11, 125, 110, .16);
  --field: 11, 125, 110;
  --shadow: 0 1px 2px rgba(16, 20, 28, .04), 0 12px 32px -12px rgba(16, 20, 28, .12);

  --font-display: "Space Grotesk", "Inter", system-ui, sans-serif;
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;

  --radius: 18px;
  --radius-sm: 10px;
  --wrap: 1180px;
  --gutter: clamp(16px, 4vw, 40px);
  --ease: cubic-bezier(.2, .7, .2, 1);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0a0d12;
    --bg-2: #0e1219;
    --surface: #11161e;
    --surface-2: #0d1118;
    --fg: #e9edf3;
    --fg-2: #b4bccb;
    --muted: #7e8899;
    --line: #1d2430;
    --line-2: #2a3342;
    --accent: #3fe0c5;
    --accent-2: #ffb547;
    --accent-ink: #04110f;
    --accent-soft: rgba(63, 224, 197, .1);
    --glow: rgba(63, 224, 197, .14);
    --field: 63, 224, 197;
    --shadow: 0 1px 0 rgba(255, 255, 255, .03) inset, 0 20px 40px -20px rgba(0, 0, 0, .6);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0a0d12;
  --bg-2: #0e1219;
  --surface: #11161e;
  --surface-2: #0d1118;
  --fg: #e9edf3;
  --fg-2: #b4bccb;
  --muted: #7e8899;
  --line: #1d2430;
  --line-2: #2a3342;
  --accent: #3fe0c5;
  --accent-2: #ffb547;
  --accent-ink: #04110f;
  --accent-soft: rgba(63, 224, 197, .1);
  --glow: rgba(63, 224, 197, .14);
  --field: 63, 224, 197;
  --shadow: 0 1px 0 rgba(255, 255, 255, .03) inset, 0 20px 40px -20px rgba(0, 0, 0, .6);
  color-scheme: dark;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 84px; -webkit-text-size-adjust: 100%; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
  transition: background-color .4s var(--ease), color .4s var(--ease);
}
body::before { /* feines Raster im Hintergrund */
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 64px 64px;
  opacity: .35;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, #000 0%, transparent 70%);
  -webkit-mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, #000 0%, transparent 70%);
}
::selection { background: var(--accent); color: var(--accent-ink); }

h1, h2, h3 { font-family: var(--font-display); font-weight: 600; letter-spacing: -.025em; line-height: 1.08; margin: 0; }
p { margin: 0 0 1rem; }
a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
svg { display: block; }
kbd {
  font-family: var(--font-mono);
  font-size: .72rem;
  padding: .1rem .38rem;
  border: 1px solid var(--line-2);
  border-bottom-width: 2px;
  border-radius: 6px;
  background: var(--surface);
  color: var(--fg-2);
}
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }

.skip { position: absolute; left: -999px; top: 8px; z-index: 100; background: var(--accent); color: var(--accent-ink); padding: .5rem 1rem; border-radius: 8px; }
.skip:focus { left: 8px; }
.muted { color: var(--muted); }

/* ---------- Buttons ---------- */
.btn {
  --b: var(--line-2);
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: .55rem;
  padding: .85rem 1.3rem;
  border-radius: 999px;
  border: 1px solid var(--b);
  font: 600 .95rem/1 var(--font-body);
  color: var(--fg);
  background: transparent;
  text-decoration: none;
  cursor: pointer;
  transition: transform .25s var(--ease), background-color .25s, border-color .25s, box-shadow .25s;
  will-change: transform;
}
.btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; transition: transform .25s var(--ease); }
.btn:hover svg { transform: translateX(3px); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); box-shadow: 0 8px 30px -10px var(--accent); }
.btn-primary:hover { box-shadow: 0 10px 40px -8px var(--accent); }
.btn-ghost:hover { border-color: var(--fg-2); background: var(--surface); }
.btn-small { padding: .55rem 1rem; font-size: .85rem; }

/* ---------- Navigation ---------- */
.nav {
  position: fixed;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 50;
  width: min(calc(100% - 24px), var(--wrap));
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: .55rem .6rem .55rem 1.1rem;
  border: 1px solid transparent;
  border-radius: 999px;
  transition: background-color .35s, border-color .35s, box-shadow .35s;
}
.nav.scrolled {
  background: color-mix(in srgb, var(--bg) 94%, transparent);
  border-color: var(--line);
  box-shadow: var(--shadow);
}
.brand { display: inline-flex; align-items: center; gap: .55rem; color: var(--fg); text-decoration: none; }
.brand-mark { width: 28px; height: 28px; }
.brand-mark path { fill: none; stroke: var(--fg); stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.brand-mark circle { fill: var(--accent); }
.brand-name { font: 700 1.2rem/1 var(--font-display); letter-spacing: -.03em; }
.brand-suffix { color: var(--muted); font-weight: 500; }
.nav-links { display: flex; gap: .25rem; margin-left: auto; }
.nav-links a { color: var(--fg-2); text-decoration: none; font-size: .92rem; font-weight: 500; padding: .45rem .8rem; border-radius: 999px; transition: color .2s, background-color .2s; }
.nav-links a:hover, .nav-links a.active { color: var(--fg); background: var(--accent-soft); }
.nav-tools { display: flex; align-items: center; gap: .5rem; }
.kbd-hint { display: inline-flex; gap: .2rem; background: none; border: 0; padding: .3rem; cursor: pointer; }
.kbd-hint:hover kbd { border-color: var(--accent); color: var(--accent); }
.theme-toggle {
  width: 38px; height: 38px; display: grid; place-items: center;
  border-radius: 999px; border: 1px solid var(--line-2); background: transparent; color: var(--fg); cursor: pointer;
  transition: transform .5s var(--ease), border-color .2s;
}
.theme-toggle:hover { border-color: var(--fg-2); transform: rotate(90deg); }
.theme-toggle svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  min-height: 100svh;
  display: flex;
  align-items: center;
  padding: 120px var(--gutter) 120px;
  overflow: hidden;
  isolation: isolate;
}
.hero-canvas { position: absolute; inset: 0; width: 100%; height: 100%; z-index: -1; }
.hero::after { /* Verlauf nach unten */
  content: ""; position: absolute; inset: auto 0 0 0; height: 30%; z-index: -1; pointer-events: none;
  background: linear-gradient(to bottom, transparent, var(--bg));
}
.hero-inner { width: 100%; max-width: var(--wrap); margin: 0 auto; }
.eyebrow {
  display: inline-flex; align-items: center; gap: .6rem;
  font: 500 .8rem/1 var(--font-mono); letter-spacing: .06em; text-transform: uppercase; color: var(--fg-2);
  padding: .5rem .85rem; border: 1px solid var(--line-2); border-radius: 999px;
  background: var(--bg);
  margin-bottom: 1.8rem;
}
.pulse { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 0 var(--accent); animation: pulse 2.2s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 60%, transparent); } 70%, 100% { box-shadow: 0 0 0 10px transparent; } }
.hero h1 { font-size: clamp(2.5rem, 5.8vw, 5.4rem); line-height: 1; letter-spacing: -.045em; }
.hero h1 .muted { font-weight: 400; }
.scramble { color: var(--accent); white-space: nowrap; }
.scramble .glyph { color: var(--fg-2); opacity: .7; }
.lead { font-size: clamp(1.05rem, 1.5vw, 1.25rem); color: var(--fg-2); max-width: 38rem; margin: 1.8rem 0 2.2rem; }
.hero-cta { display: flex; flex-wrap: wrap; gap: .75rem; }
.hero-note { margin: 1.5rem 0 0; font-size: .92rem; color: var(--muted); display: flex; align-items: center; gap: .5rem; }
.check { display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); font-size: .75rem; font-weight: 700; }
.hero-ticker {
  position: absolute; left: 50%; bottom: 28px; transform: translateX(-50%);
  width: min(calc(100% - 2 * var(--gutter)), var(--wrap));
  display: flex; flex-wrap: wrap; gap: .4rem 1.1rem; align-items: center;
  font: 400 .75rem/1 var(--font-mono); color: var(--muted); letter-spacing: .04em;
}
.hero-ticker b { font-weight: 500; color: var(--fg-2); margin-right: .6rem; }
.hero-ticker b.ok { color: var(--accent); }
.hero-ticker b.ok::before { content: "● "; }

/* ---------- Marquee ---------- */
.marquee {
  border-block: 1px solid var(--line);
  overflow: hidden;
  padding: 1.05rem 0;
  mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent);
}
.marquee-track { display: flex; width: max-content; animation: marquee 48s linear infinite; }
.marquee:hover .marquee-track { animation-play-state: paused; }
.marquee span { font: 500 .95rem/1 var(--font-display); color: var(--fg-2); padding: 0 1.4rem; white-space: nowrap; display: inline-flex; align-items: center; gap: 2.8rem; }
.marquee span::after { content: "◆"; font-size: .5rem; color: var(--accent); position: relative; left: 1.4rem; margin-left: -1.4rem; }
@keyframes marquee { to { transform: translateX(-50%); } }

/* ---------- Sections ---------- */
.section { position: relative; max-width: var(--wrap); margin: 0 auto; padding: clamp(80px, 12vw, 150px) var(--gutter) 0; }
.section-head { max-width: 46rem; margin-bottom: clamp(2.5rem, 5vw, 4rem); }
.section-index { font: 500 .8rem/1 var(--font-mono); letter-spacing: .08em; text-transform: uppercase; color: var(--accent); margin-bottom: 1.2rem; }
.section h2 { font-size: clamp(2.1rem, 5vw, 3.8rem); letter-spacing: -.04em; }
.section-lead { font-size: 1.12rem; color: var(--fg-2); margin: 1.4rem 0 0; }

/* ---------- Cards / Spotlight ---------- */
.grid { display: grid; gap: 1rem; }
.duo { grid-template-columns: repeat(2, 1fr); margin-top: 1rem; }
.card, .project {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  isolation: isolate;
}
.card { padding: 1.8rem 1.6rem 1.6rem; }
.spot::before { /* Lichtkegel folgt der Maus */
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: radial-gradient(420px circle at var(--mx, -500px) var(--my, -500px), var(--glow), transparent 45%);
  opacity: 0; transition: opacity .35s;
}
.spot::after { /* leuchtender Rand */
  content: ""; position: absolute; inset: 0; border-radius: inherit; padding: 1px; pointer-events: none;
  background: radial-gradient(260px circle at var(--mx, -500px) var(--my, -500px), var(--accent), transparent 60%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
  opacity: 0; transition: opacity .35s;
}
.spot:hover::before, .spot:hover::after { opacity: 1; }
.card-icon { width: 46px; height: 46px; display: grid; place-items: center; border-radius: 12px; background: var(--accent-soft); color: var(--accent); margin-bottom: 1.4rem; }
.card-icon svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.card h3 { font-size: 1.28rem; margin-bottom: .7rem; }
.card p { color: var(--fg-2); font-size: .97rem; margin: 0; }

/* ---------- Projects ---------- */
.projects { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1rem; }
.project { display: flex; flex-direction: column; }
.project-visual {
  position: relative; height: 230px; overflow: hidden;
  border-bottom: 1px solid var(--line);
  background:
    radial-gradient(circle at 1px 1px, var(--line-2) 1px, transparent 0) 0 0 / 18px 18px,
    var(--surface-2);
}
.project-body { padding: 1.7rem 1.7rem 1.8rem; display: flex; flex-direction: column; flex: 1; }
.project-tag { font: 500 .74rem/1.4 var(--font-mono); letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin-bottom: .9rem; }
.project h3 { font-size: clamp(1.35rem, 2.2vw, 1.65rem); margin-bottom: .9rem; }
.project-body > p:not(.project-tag) { color: var(--fg-2); font-size: .98rem; }
.facts { list-style: none; padding: 0; margin: auto 0 0; display: flex; flex-wrap: wrap; gap: .45rem; padding-top: .6rem; }
.facts li { font: 500 .78rem/1 var(--font-mono); padding: .45rem .7rem; border-radius: 999px; border: 1px solid var(--line-2); color: var(--fg-2); }
.viz-counter {
  position: absolute; right: 14px; bottom: 14px;
  font: 500 .75rem/1 var(--font-mono); color: var(--fg-2);
  padding: .45rem .65rem; border-radius: 8px; border: 1px solid var(--line-2);
  background: var(--surface);
}
.viz-counter span { color: var(--accent); font-variant-numeric: tabular-nums; }

/* Visual: Bericht */
.viz-report .doc {
  position: absolute; left: 50%; top: 34px; width: 170px; height: 220px; margin-left: -85px;
  background: var(--surface); border: 1px solid var(--line-2); border-radius: 10px; padding: 16px;
  box-shadow: var(--shadow); z-index: 3;
  animation: docIn 4.8s var(--ease) infinite;
}
.viz-report .doc-back { z-index: 2; transform: translate(14px, -10px) rotate(4deg); opacity: .7; animation: none; }
.viz-report .doc-back2 { z-index: 1; transform: translate(-16px, -6px) rotate(-5deg); opacity: .45; animation: none; }
.doc-head i { display: block; height: 7px; border-radius: 4px; background: var(--fg-2); opacity: .8; width: 60%; margin-bottom: 6px; }
.doc-head i + i { width: 38%; opacity: .35; }
.doc-bars { display: flex; align-items: flex-end; gap: 6px; height: 70px; margin: 16px 0 14px; border-bottom: 1px solid var(--line-2); }
.doc-bars b { flex: 1; border-radius: 3px 3px 0 0; background: var(--accent); transform-origin: bottom; animation: bar 4.8s var(--ease) infinite; }
.doc-bars b:nth-child(1) { height: 40%; animation-delay: .1s; }
.doc-bars b:nth-child(2) { height: 65%; animation-delay: .18s; }
.doc-bars b:nth-child(3) { height: 30%; animation-delay: .26s; background: var(--accent-2); }
.doc-bars b:nth-child(4) { height: 85%; animation-delay: .34s; }
.doc-bars b:nth-child(5) { height: 55%; animation-delay: .42s; }
.doc-bars b:nth-child(6) { height: 20%; animation-delay: .5s; background: var(--accent-2); }
.doc-bars b:nth-child(7) { height: 95%; animation-delay: .58s; }
.doc-lines i { display: block; height: 5px; border-radius: 3px; background: var(--line-2); margin-bottom: 7px; }
.doc-lines i:nth-child(2) { width: 85%; } .doc-lines i:nth-child(3) { width: 60%; }
@keyframes bar { 0%, 8% { transform: scaleY(0); } 30%, 85% { transform: scaleY(1); } 100% { transform: scaleY(0); } }
@keyframes docIn { 0% { transform: translateY(30px); opacity: 0; } 10%, 88% { transform: none; opacity: 1; } 100% { transform: translateY(-20px); opacity: 0; } }

/* Visual: Pipeline */
.viz-pipe { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 10px; padding: 0 18px; }
.pipe-col { min-width: 0; font: 400 .68rem/1.75 var(--font-mono); height: 190px; overflow: hidden; position: relative; mask-image: linear-gradient(transparent, #000 18%, #000 82%, transparent); -webkit-mask-image: linear-gradient(transparent, #000 18%, #000 82%, transparent); }
.pipe-col div { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; animation: rowIn .5s var(--ease); }
.pipe-raw { color: var(--muted); }
.pipe-raw .bad { color: var(--accent-2); }
.pipe-clean div { display: grid; grid-template-columns: 4.6em minmax(0, 1fr) auto; gap: 8px; color: var(--fg-2); }
.pipe-clean div span { overflow: hidden; text-overflow: ellipsis; }
.pipe-clean div b { font-weight: 500; color: var(--accent); text-align: right; }
.pipe-arrow { display: grid; justify-items: center; gap: 4px; font: 500 .62rem/1 var(--font-mono); color: var(--accent); letter-spacing: .06em; }
.pipe-arrow svg { width: 46px; fill: none; stroke: var(--accent); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 4 4; animation: dash 1s linear infinite; }
@keyframes dash { to { stroke-dashoffset: -8; } }
@keyframes rowIn { from { opacity: 0; transform: translateY(8px); } }

/* Visual: Netz */
.viz-net { display: grid; place-items: center; }
.net { width: min(100%, 360px); height: auto; overflow: visible; }
.net-arc { fill: none; stroke: var(--accent); stroke-width: 1.5; stroke-dasharray: 3 6; opacity: .7; }
.net-arc-2 { stroke: var(--line-2); opacity: 1; }
.net-packet { fill: var(--accent); filter: drop-shadow(0 0 6px var(--accent)); }
.net-packet.p2 { fill: var(--accent-2); filter: drop-shadow(0 0 6px var(--accent-2)); }
.net-node circle { fill: var(--surface); stroke: var(--fg-2); stroke-width: 1.5; }
.net-node text { font: 600 10px var(--font-mono); fill: var(--fg); text-anchor: middle; }

/* Visual: Portal */
.viz-portal { display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 20px; padding: 0 22px; }
.otp { display: flex; align-items: center; gap: 14px; padding: 16px 18px; background: var(--surface); border: 1px solid var(--line-2); border-radius: 14px; box-shadow: var(--shadow); }
.otp-ring { width: 44px; height: 44px; transform: rotate(-90deg); }
.otp-ring circle { fill: none; stroke: var(--line-2); stroke-width: 3; }
.otp-ring .otp-progress { stroke: var(--accent); stroke-linecap: round; stroke-dasharray: 119.4; stroke-dashoffset: 0; }
.otp-label { font: 500 .66rem/1 var(--font-mono); text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin-bottom: 6px; }
.otp-code { font: 600 1.5rem/1 var(--font-mono); letter-spacing: .06em; color: var(--fg); font-variant-numeric: tabular-nums; }
.portal-log { font: 400 .66rem/1.8 var(--font-mono); color: var(--muted); height: 150px; overflow: hidden; mask-image: linear-gradient(transparent, #000 25%); -webkit-mask-image: linear-gradient(transparent, #000 25%); display: flex; flex-direction: column; justify-content: flex-end; }
.portal-log div { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; animation: rowIn .4s var(--ease); }
.portal-log .ok { color: var(--accent); }
.portal-log .warn { color: var(--accent-2); }

/* CTA-Karte */
.project-cta { grid-column: 1 / -1; text-decoration: none; color: inherit; background: linear-gradient(135deg, var(--surface), var(--surface-2)); }
.project-cta-inner { padding: clamp(2rem, 5vw, 3.4rem); max-width: 44rem; }
.project-cta h3 { font-size: clamp(1.8rem, 4vw, 2.8rem); }
.project-cta p:not(.project-tag) { color: var(--fg-2); margin-bottom: 1.8rem; }
.grad { background: linear-gradient(90deg, var(--accent), var(--accent-2)); -webkit-background-clip: text; background-clip: text; color: transparent; }


/* ---------- Prinzip: Chat & Rollen ---------- */
.principle { display: grid; grid-template-columns: 1.05fr 1fr; gap: 1rem; align-items: stretch; }
.chat { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.chat-bar { display: flex; align-items: center; gap: .6rem; padding: .85rem 1.1rem; border-bottom: 1px solid var(--line); font: 500 .78rem/1 var(--font-mono); letter-spacing: .05em; text-transform: uppercase; color: var(--fg-2); }
.chat-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); animation: pulse 2.2s infinite; }
.chat-free { margin-left: auto; font-size: .66rem; padding: .3rem .5rem; border-radius: 6px; background: var(--accent-soft); color: var(--accent); }
.chat-body { flex: 1; min-height: 360px; padding: 1.2rem; display: flex; flex-direction: column; justify-content: flex-end; gap: .6rem; overflow: hidden; }
.bubble { max-width: 82%; padding: .7rem .95rem; border-radius: 16px; font-size: .95rem; line-height: 1.5; animation: bubbleIn .45s var(--ease); }
.bubble small { display: block; font: 500 .68rem/1 var(--font-mono); letter-spacing: .05em; text-transform: uppercase; opacity: .7; margin-bottom: .35rem; }
.bubble.you { align-self: flex-start; background: var(--bg-2); color: var(--fg); border-bottom-left-radius: 5px; }
.bubble.us { align-self: flex-end; background: var(--accent); color: var(--accent-ink); border-bottom-right-radius: 5px; }
.bubble.sys { align-self: center; max-width: 100%; background: none; border: 1px dashed var(--line-2); color: var(--fg-2); font: 500 .78rem/1.4 var(--font-mono); border-radius: 999px; padding: .5rem .9rem; }
.bubble.typing { display: inline-flex; gap: 4px; padding: .85rem .95rem; }
.bubble.typing i { width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .5; animation: typing 1s infinite; }
.bubble.typing i:nth-child(2) { animation-delay: .15s; } .bubble.typing i:nth-child(3) { animation-delay: .3s; }
@keyframes typing { 0%, 60%, 100% { transform: none; opacity: .35; } 30% { transform: translateY(-3px); opacity: .9; } }
@keyframes bubbleIn { from { opacity: 0; transform: translateY(10px) scale(.97); } }

.roles { display: grid; grid-template-rows: auto 1fr; gap: 1rem; }
.role { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.5rem 1.6rem; box-shadow: var(--shadow); }
.role-label { font: 500 .76rem/1 var(--font-mono); letter-spacing: .07em; text-transform: uppercase; color: var(--muted); margin-bottom: 1.1rem; }
.role-label span { text-transform: none; letter-spacing: 0; }
.role-you { list-style: none; margin: 0; padding: 0; display: grid; gap: .75rem; }
.role-you li { display: flex; align-items: center; gap: .8rem; font: 600 1.15rem/1.3 var(--font-display); letter-spacing: -.01em; }
.role-num { flex: none; display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; border: 1.5px solid var(--fg-2); font: 600 .8rem/1 var(--font-mono); }
.role-us { background: linear-gradient(160deg, var(--surface), var(--surface-2)); }
.role-chips { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: .5rem; }
.role-chips li { font-size: .9rem; padding: .5rem .85rem; border-radius: 999px; border: 1px solid var(--line-2); color: var(--fg-2); transition: background-color .4s, color .4s, border-color .4s; }
.role-chips li.on { background: var(--accent-soft); border-color: var(--accent); color: var(--fg); }
.role-chips li.on::before { content: "✓ "; color: var(--accent); font-weight: 700; }

/* ---------- Hinweis Interactive Brokers ---------- */
.ib-note { grid-column: 1 / -1; display: grid; grid-template-columns: auto 1fr; gap: 1.4rem; align-items: center; padding: 1.5rem 1.7rem; background: var(--surface); border: 1px dashed var(--line-2); border-radius: var(--radius); }
.ib-icon { width: 52px; height: 52px; display: grid; place-items: center; border-radius: 14px; background: var(--accent-soft); color: var(--accent); }
.ib-icon svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.ib-note .project-tag { margin-bottom: .4rem; }
.ib-text { margin: 0; color: var(--fg-2); max-width: 62rem; }
.ib-text strong { color: var(--fg); font-weight: 600; }

/* ---------- Ablauf innerhalb Arbeitsweise ---------- */
.process { margin-top: clamp(4rem, 8vw, 6.5rem); }
.subhead { font-size: clamp(1.7rem, 3.6vw, 2.6rem); letter-spacing: -.035em; }

/* ---------- Kontakt: niedrige Schwelle ---------- */
.assurances { list-style: none; padding: 0; margin: 1.6rem 0 0; display: flex; flex-wrap: wrap; gap: .5rem 1.4rem; }
.assurances li { display: flex; align-items: center; gap: .5rem; font-weight: 500; color: var(--fg); }
.assurances li::before { content: "✓"; display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); font-size: .75rem; font-weight: 700; }
.contact-how { margin: 1.4rem 0 0; color: var(--muted); font-size: .97rem; }
.chips .chip-feature span { border-color: var(--accent); color: var(--fg); font-weight: 600; background: var(--accent-soft); padding: .65rem 1.1rem; }

/* ---------- Arbeitsweise / Terminal ---------- */
.split { display: grid; grid-template-columns: 1fr 1.05fr; gap: clamp(2rem, 5vw, 5rem); align-items: center; }
.principles { list-style: none; padding: 0; margin: 2.4rem 0 0; display: grid; gap: 1.6rem; }
.principles li { padding-left: 1.4rem; border-left: 2px solid var(--line-2); transition: border-color .3s; }
.principles li:hover { border-color: var(--accent); }
.principles h3 { font-size: 1.15rem; margin-bottom: .4rem; }
.principles p { color: var(--fg-2); margin: 0; font-size: .97rem; }
.terminal {
  border-radius: var(--radius); overflow: hidden;
  background: #0b0f15; border: 1px solid #1f2733;
  box-shadow: 0 40px 80px -30px rgba(0, 0, 0, .55), 0 0 0 1px rgba(255, 255, 255, .02) inset;
  color: #c9d3e0;
}
.terminal-bar { display: flex; align-items: center; gap: 7px; padding: 12px 14px; border-bottom: 1px solid #1a212c; background: #0e131b; }
.terminal-bar i { width: 11px; height: 11px; border-radius: 50%; background: #2a3342; }
.terminal-bar i:nth-child(1) { background: #ff5f57; } .terminal-bar i:nth-child(2) { background: #febc2e; } .terminal-bar i:nth-child(3) { background: #28c840; }
.terminal-bar span { margin-left: auto; margin-right: auto; font: 500 .75rem/1 var(--font-mono); color: #6b7689; transform: translateX(-20px); }
.terminal-body { margin: 0; padding: 18px 20px 22px; height: 330px; overflow: hidden; font: 400 .8rem/1.7 var(--font-mono); white-space: pre-wrap; word-break: break-word; }
.terminal-body .p { color: #3fe0c5; }
.terminal-body .c { color: #e9edf3; }
.terminal-body .d { color: #6b7689; }
.terminal-body .o { color: #3fe0c5; }
.terminal-body .w { color: #ffb547; }
.terminal-body .cursor { display: inline-block; width: .6em; height: 1.1em; vertical-align: -2px; background: #3fe0c5; animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }

/* ---------- Timeline ---------- */
.timeline { list-style: none; margin: 0; padding: 0; position: relative; display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; }
.timeline::before, .timeline::after { content: ""; position: absolute; top: 27px; left: 28px; right: 28px; height: 2px; background: var(--line-2); }
.timeline::after { background: linear-gradient(90deg, var(--accent), var(--accent-2)); transform-origin: left; transform: scaleX(var(--progress, 0)); transition: transform .2s linear; }
.step { position: relative; z-index: 1; }
.step-num {
  display: grid; place-items: center; width: 56px; height: 56px; border-radius: 50%;
  background: var(--bg); border: 2px solid var(--line-2); color: var(--fg-2);
  font: 600 .95rem/1 var(--font-mono); margin-bottom: 1.4rem; transition: border-color .4s, color .4s, box-shadow .4s;
}
.step.lit .step-num { border-color: var(--accent); color: var(--accent); box-shadow: 0 0 0 6px var(--accent-soft); }
.step h3 { font-size: 1.22rem; margin-bottom: .6rem; display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; }
.step p { color: var(--fg-2); font-size: .96rem; margin: 0; padding-right: .5rem; }
.free { font: 600 .66rem/1 var(--font-mono); text-transform: uppercase; letter-spacing: .08em; padding: .35rem .5rem; border-radius: 6px; background: var(--accent-soft); color: var(--accent); }

/* ---------- Kontakt ---------- */
.contact { padding-bottom: clamp(80px, 10vw, 140px); }
.contact-glow { position: absolute; inset: 20% 0 auto; height: 60%; z-index: -1; pointer-events: none; background: radial-gradient(ellipse at center, var(--glow), transparent 65%); filter: blur(20px); }
.composer { display: grid; grid-template-columns: 1.1fr 1fr; gap: 1rem; background: var(--surface); border: 1px solid var(--line); border-radius: calc(var(--radius) + 6px); padding: clamp(1.2rem, 3vw, 2rem); box-shadow: var(--shadow); }
.composer-inputs { display: grid; gap: 1.5rem; align-content: start; padding: .4rem; }
fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
legend em { font-style: normal; text-transform: none; letter-spacing: 0; opacity: .8; }
legend, .field > span { display: block; font: 500 .76rem/1 var(--font-mono); letter-spacing: .07em; text-transform: uppercase; color: var(--muted); margin-bottom: .8rem; padding: 0; }
.field em { font-style: normal; text-transform: none; letter-spacing: 0; opacity: .8; }
.chips { display: flex; flex-wrap: wrap; gap: .5rem; }
.chips label { position: relative; cursor: pointer; }
.chips input { position: absolute; opacity: 0; pointer-events: none; }
.chips span {
  display: inline-block; padding: .55rem .9rem; border-radius: 999px; border: 1px solid var(--line-2);
  font-size: .9rem; color: var(--fg-2); transition: all .2s var(--ease); user-select: none;
}
.chips label:hover span { border-color: var(--fg-2); color: var(--fg); }
.chips input:checked + span { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); transform: translateY(-1px); }
.chips input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.field { display: block; }
textarea, input[type="text"] {
  width: 100%; font: inherit; font-size: .97rem; color: var(--fg); background: var(--surface-2);
  border: 1px solid var(--line-2); border-radius: var(--radius-sm); padding: .8rem .95rem; resize: vertical;
  transition: border-color .2s, box-shadow .2s;
}
textarea:focus, input[type="text"]:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.composer-preview { display: flex; flex-direction: column; gap: 1rem; background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.2rem; }
.mail { flex: 1; display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; min-height: 280px; }
.mail-row { display: flex; gap: .8rem; padding: .7rem 1rem; border-bottom: 1px solid var(--line); font-size: .88rem; color: var(--fg-2); }
.mail-row span { width: 4.2rem; flex: none; font: 500 .72rem/1.9 var(--font-mono); text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.mail-row b { font-weight: 600; color: var(--fg); }
.mail-body { margin: 0; padding: 1rem; flex: 1; font: 400 .84rem/1.65 var(--font-mono); color: var(--fg-2); white-space: pre-wrap; word-break: break-word; }
.mail-body .hl { color: var(--accent); }
.composer-actions { display: flex; flex-wrap: wrap; gap: .6rem; }
.privacy-note { display: flex; gap: .55rem; align-items: flex-start; font-size: .83rem; color: var(--muted); margin: 0; }
.privacy-note svg { width: 16px; height: 16px; flex: none; margin-top: 2px; fill: none; stroke: var(--accent); stroke-width: 2; stroke-linecap: round; }

/* ---------- Footer ---------- */
.footer { border-top: 1px solid var(--line); padding: 2.6rem var(--gutter) 2.4rem; }
.footer-inner { max-width: var(--wrap); margin: 0 auto; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 2rem; align-items: flex-end; }
.footer-address { margin: 1rem 0 0; color: var(--muted); font-size: .92rem; }
.footer-address a { color: var(--fg-2); }
.footer-meta { text-align: right; }
.footer-stats { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: .4rem; margin-bottom: 1rem; }
.footer-stats span { font: 400 .72rem/1 var(--font-mono); color: var(--muted); padding: .4rem .6rem; border: 1px solid var(--line); border-radius: 6px; }
.footer-stats span b { color: var(--accent); font-weight: 500; }
.footer-links { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 1.2rem; margin: 0; font-size: .9rem; color: var(--muted); }
.footer-links a { color: var(--fg-2); text-decoration: none; }
.footer-links a:hover { color: var(--accent); }

/* ---------- Befehlspalette ---------- */
.palette { position: fixed; inset: 0; z-index: 90; display: grid; justify-items: center; align-items: start; padding: 14vh 16px 16px; }
.palette[hidden] { display: none; }
.palette-backdrop { position: absolute; inset: 0; background: color-mix(in srgb, var(--bg) 80%, transparent); animation: fade .2s; }
.palette-box { position: relative; width: min(100%, 560px); background: var(--surface); border: 1px solid var(--line-2); border-radius: 16px; box-shadow: 0 30px 80px -20px rgba(0, 0, 0, .45); overflow: hidden; animation: pop .25s var(--ease); }
.palette-input { width: 100%; border: 0; border-bottom: 1px solid var(--line); background: transparent; color: var(--fg); font: 400 1.05rem var(--font-body); padding: 1.1rem 1.2rem; outline: none; }
.palette-input:focus-visible { outline: none; }
.palette-list { list-style: none; margin: 0; padding: .4rem; max-height: 50vh; overflow-y: auto; }
.palette-list li { display: flex; align-items: center; gap: .8rem; padding: .7rem .8rem; border-radius: 10px; cursor: pointer; color: var(--fg-2); }
.palette-list li .pi { font: 500 .7rem/1 var(--font-mono); color: var(--muted); width: 4.2rem; text-transform: uppercase; letter-spacing: .05em; }
.palette-list li[aria-selected="true"] { background: var(--accent-soft); color: var(--fg); }
.palette-list li[aria-selected="true"] .pi { color: var(--accent); }
.palette-list .empty { cursor: default; color: var(--muted); }
.palette-foot { display: flex; gap: 1rem; padding: .7rem 1rem; border-top: 1px solid var(--line); font-size: .76rem; color: var(--muted); }
.palette-foot kbd { margin-right: .15rem; }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: translateY(-8px) scale(.98); } }

/* ---------- Toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: 24px; z-index: 95; transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  background: var(--fg); color: var(--bg); padding: .7rem 1.1rem; border-radius: 999px; font-size: .9rem; font-weight: 500;
  transition: opacity .25s, transform .25s var(--ease);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- Reveal ---------- */
.js .reveal { opacity: 0; transform: translateY(26px); transition: opacity .9s var(--ease), transform .9s var(--ease); transition-delay: var(--d, 0s); }
.js .reveal.in { opacity: 1; transform: none; }

/* ---------- Unterseiten (Impressum, Datenschutz) ---------- */
.page { max-width: 46rem; margin: 0 auto; padding: 140px var(--gutter) 100px; }
.page h1 { font-size: clamp(2.4rem, 6vw, 3.8rem); letter-spacing: -.04em; margin-bottom: 2.4rem; }
.page h2 { font-size: 1.2rem; letter-spacing: -.01em; margin: 2.4rem 0 .6rem; }
.page p, .page li { color: var(--fg-2); }
.page .back { display: inline-flex; align-items: center; gap: .4rem; font: 500 .8rem/1 var(--font-mono); text-transform: uppercase; letter-spacing: .07em; text-decoration: none; margin-bottom: 1.4rem; }
.page .back:hover { text-decoration: underline; }
.page-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: clamp(1.4rem, 4vw, 2.4rem); box-shadow: var(--shadow); }
.page-card h2:first-child { margin-top: 0; }

/* ---------- Responsive ---------- */
@media (max-width: 1020px) {
  .principle { grid-template-columns: 1fr; }
  .split { grid-template-columns: 1fr; }
  .timeline { grid-template-columns: repeat(2, 1fr); row-gap: 2.6rem; }
  .timeline::before, .timeline::after { display: none; }
  .composer { grid-template-columns: 1fr; }
}
@media (max-width: 820px) {
  .nav-links, .kbd-hint { display: none; }
  .nav-tools { margin-left: auto; }
  .projects { grid-template-columns: 1fr; }
}
@media (max-width: 620px) {
  body { font-size: 16px; }
  .duo { grid-template-columns: 1fr; }
  .ib-note { grid-template-columns: 1fr; }
  .timeline { grid-template-columns: 1fr; }
  .hero { padding-top: 110px; padding-bottom: 110px; }
  .hero-ticker span:nth-of-type(n+3), .hero-ticker b:nth-of-type(n+3) { display: none; }
  .scramble { white-space: normal; }
  .viz-portal { grid-template-columns: 1fr; padding-top: 18px; }
  .chat-body { min-height: 300px; }
  .portal-log { height: 70px; }
  .pipe-col { font-size: .6rem; }
  .viz-pipe { padding: 0 12px; gap: 6px; }
  .pipe-arrow span { display: none; }
  .pipe-arrow svg { width: 26px; }
  .footer-meta, .footer-stats, .footer-links { text-align: left; justify-content: flex-start; }
  .terminal-body { height: 320px; font-size: .72rem; }
}

@media (max-width: 420px) {
  .hero h1 { font-size: 8vw; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
  html { scroll-behavior: auto; }
  .marquee-track { animation: none; }
  .viz-report .doc, .doc-bars b { animation: none !important; }
  .bubble { animation: none !important; }
}
