/* ═══════════════════════════════════════════════════════════════════════════
   deepblue AI — design system
   Self-hosted fonts · light/dark tokens · scroll-driven animations with
   IntersectionObserver fallback · prefers-reduced-motion respected
   ═══════════════════════════════════════════════════════════════════════════ */

@font-face { font-family: "Inter"; src: url("/assets/fonts/inter-latin-wght.woff2") format("woff2"); font-weight: 100 900; font-display: swap; unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Inter"; src: url("/assets/fonts/inter-latin-ext-wght.woff2") format("woff2"); font-weight: 100 900; font-display: swap; unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Space Grotesk"; src: url("/assets/fonts/space-grotesk-latin-wght.woff2") format("woff2"); font-weight: 300 700; font-display: swap; }
@font-face { font-family: "JetBrains Mono"; src: url("/assets/fonts/jetbrains-mono-latin-wght.woff2") format("woff2"); font-weight: 100 800; font-display: swap; }

/* ── Tokens ─────────────────────────────────────────────────────────────── */
:root {
  --font-sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-display: "Space Grotesk", "Inter", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  --bg: #f5f7fc;
  --bg-2: #eaf0fa;
  --surface: #ffffff;
  --surface-2: #f1f5fc;
  --surface-glass: rgba(255, 255, 255, 0.72);
  --surface-solid: #f7f9fd;
  --border: rgba(16, 42, 92, 0.12);
  --border-strong: rgba(16, 42, 92, 0.22);
  --text: #0a1530;
  --text-2: #24324f;
  --muted: #55658a;
  --accent: #0369a1;
  --accent-2: #4f46e5;
  --accent-soft: rgba(3, 105, 161, 0.1);
  --on-accent: #ffffff;
  --grad: linear-gradient(120deg, #0284c7, #4f46e5 60%, #9333ea);
  --glow: rgba(56, 189, 248, 0.25);
  --shadow: 0 1px 2px rgba(10, 21, 48, 0.06), 0 8px 28px -12px rgba(10, 21, 48, 0.18);
  --shadow-lg: 0 30px 80px -30px rgba(10, 21, 48, 0.35);
  --code-bg: #0b1430;
  --code-text: #dbe7ff;
  --heat-0: #f1f5fc;
  --heat-1: #0284c7;

  --sec-ki-verstehen: #0284c7;
  --sec-ki-im-alltag: #059669;
  --sec-mit-ki-arbeiten: #d97706;
  --sec-nerd-corner: #7c3aed;
  --sec-news-radar: #e11d48;
  --sec-marvin: #475569;

  --radius: 18px;
  --radius-sm: 10px;
  --container: 1200px;
  --narrow: 780px;
  --gutter: clamp(16px, 4vw, 32px);
  --header-h: 68px;
  --ease: cubic-bezier(.2, .7, .2, 1);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) { --_dark: 1; }
}
:root[data-theme="dark"] { --_dark: 1; }

/* dark tokens (duplicated for the media query and the explicit attribute) */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #040b1c; --bg-2: #071431; --surface: #0b1834; --surface-2: #10213f; --surface-glass: rgba(8, 20, 45, 0.7); --surface-solid: #060f22;
    --border: rgba(140, 175, 255, 0.13); --border-strong: rgba(140, 175, 255, 0.26);
    --text: #e8eefb; --text-2: #c7d3ea; --muted: #8fa2c4;
    --accent: #38bdf8; --accent-2: #818cf8; --accent-soft: rgba(56, 189, 248, 0.12); --on-accent: #04101f;
    --grad: linear-gradient(120deg, #38bdf8, #818cf8 55%, #c084fc);
    --glow: rgba(56, 189, 248, 0.35);
    --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 10px 30px -12px rgba(0, 0, 0, .6);
    --shadow-lg: 0 40px 90px -30px rgba(0, 0, 0, .8);
    --code-bg: #020817; --heat-0: #0d1a36; --heat-1: #38bdf8;
    --sec-ki-verstehen: #38bdf8; --sec-ki-im-alltag: #34d399; --sec-mit-ki-arbeiten: #fbbf24;
    --sec-nerd-corner: #a78bfa; --sec-news-radar: #fb7185; --sec-marvin: #94a3b8;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #040b1c; --bg-2: #071431; --surface: #0b1834; --surface-2: #10213f; --surface-glass: rgba(8, 20, 45, 0.7); --surface-solid: #060f22;
  --border: rgba(140, 175, 255, 0.13); --border-strong: rgba(140, 175, 255, 0.26);
  --text: #e8eefb; --text-2: #c7d3ea; --muted: #8fa2c4;
  --accent: #38bdf8; --accent-2: #818cf8; --accent-soft: rgba(56, 189, 248, 0.12); --on-accent: #04101f;
  --grad: linear-gradient(120deg, #38bdf8, #818cf8 55%, #c084fc);
  --glow: rgba(56, 189, 248, 0.35);
  --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 10px 30px -12px rgba(0, 0, 0, .6);
  --shadow-lg: 0 40px 90px -30px rgba(0, 0, 0, .8);
  --code-bg: #020817; --heat-0: #0d1a36; --heat-1: #38bdf8;
  --sec-ki-verstehen: #38bdf8; --sec-ki-im-alltag: #34d399; --sec-mit-ki-arbeiten: #fbbf24;
  --sec-nerd-corner: #a78bfa; --sec-news-radar: #fb7185; --sec-marvin: #94a3b8;
  color-scheme: dark;
}

.sec-ki-verstehen { --sec: var(--sec-ki-verstehen); }
.sec-ki-im-alltag { --sec: var(--sec-ki-im-alltag); }
.sec-mit-ki-arbeiten { --sec: var(--sec-mit-ki-arbeiten); }
.sec-nerd-corner { --sec: var(--sec-nerd-corner); }
.sec-news-radar { --sec: var(--sec-news-radar); }
.sec-marvin { --sec: var(--sec-marvin); }

/* ── Base ───────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 16px); }
body {
  margin: 0; min-height: 100vh; overflow-x: hidden;
  background: var(--bg); color: var(--text);
  font: 400 17px/1.65 var(--font-sans);
  font-feature-settings: "cv11", "ss01";
  -webkit-font-smoothing: antialiased;
  transition: background-color .4s var(--ease), color .4s var(--ease);
}
img, svg, canvas { display: block; max-width: 100%; }
img { height: auto; }
a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
h1, h2, h3, h4 { font-family: var(--font-display); line-height: 1.12; letter-spacing: -0.02em; margin: 0 0 .5em; color: var(--text); text-wrap: balance; }
h1 { font-size: clamp(2.2rem, 5vw + 1rem, 4.2rem); font-weight: 700; }
h2 { font-size: clamp(1.7rem, 2.4vw + 1rem, 2.7rem); font-weight: 650; }
h3 { font-size: clamp(1.15rem, .5vw + 1rem, 1.35rem); font-weight: 600; }
p { margin: 0 0 1em; text-wrap: pretty; }
button, input, select, textarea { font: inherit; color: inherit; }
::selection { background: var(--accent); color: var(--on-accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link { position: fixed; left: 16px; top: -60px; z-index: 100; background: var(--accent); color: var(--on-accent); padding: 10px 16px; border-radius: 10px; transition: top .2s; }
.skip-link:focus { top: 12px; }
.noscript { padding: 16px; text-align: center; }

.container { width: 100%; max-width: calc(var(--container) + 2 * var(--gutter)); margin-inline: auto; padding-inline: var(--gutter); }
.container.narrow, .narrow { max-width: calc(var(--narrow) + 2 * var(--gutter)); }
.center { text-align: center; }
.center .cta-row, .cta-row.center { justify-content: center; }
.grid-2 { display: grid; gap: clamp(28px, 5vw, 72px); grid-template-columns: 1fr; }
@media (min-width: 900px) { .grid-2 { grid-template-columns: 1fr 1fr; } }
.align-center { align-items: center; }

.section { padding-block: clamp(64px, 9vw, 128px); position: relative; }
.section + .section { padding-top: clamp(24px, 4vw, 56px); }
.section-head { max-width: 760px; margin-bottom: clamp(24px, 3vw, 44px); }
.center .section-head, .section-head.center { margin-inline: auto; }
.section-intro { color: var(--muted); font-size: 1.08rem; }
.kicker {
  display: inline-flex; align-items: center; gap: .5em; margin: 0 0 .9em;
  font: 600 .78rem/1.2 var(--font-mono); letter-spacing: .12em; text-transform: uppercase;
  color: var(--sec, var(--accent)); text-decoration: none;
}
.kicker::before { content: ""; width: 22px; height: 2px; background: currentColor; border-radius: 2px; opacity: .8; }
.lead { font-size: clamp(1.08rem, .6vw + 1rem, 1.3rem); color: var(--text-2); max-width: 62ch; }

/* ── Buttons & chips ───────────────────────────────────────────────────── */
.cta-row { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }
.btn {
  --b: var(--accent);
  position: relative; display: inline-flex; align-items: center; gap: .55em;
  padding: .8em 1.3em; border-radius: 999px; font-weight: 600; font-size: .98rem; text-decoration: none;
  border: 1px solid transparent; cursor: pointer; isolation: isolate; overflow: hidden;
  transition: transform .25s var(--ease), box-shadow .25s var(--ease), background-color .25s, color .25s, border-color .25s;
}
.btn svg { width: 18px; height: 18px; }
.btn-primary { background: var(--grad); color: #fff; box-shadow: 0 10px 30px -10px var(--glow); }
.btn-primary::after { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(120deg, transparent 20%, rgba(255,255,255,.35) 50%, transparent 80%); transform: translateX(-120%); transition: transform .7s var(--ease); }
.btn-primary:hover::after { transform: translateX(120%); }
.btn-ghost { background: var(--surface-glass); color: var(--text); border-color: var(--border-strong); }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }
.btn:hover { transform: translateY(-2px); text-decoration: none; }
.btn-arrow { transition: transform .25s var(--ease); }
.btn:hover .btn-arrow { transform: translateX(4px); }
.btn-sm { padding: .5em 1em; font-size: .88rem; }

.chip {
  display: inline-flex; align-items: center; gap: .45em; padding: .38em .85em; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--border); color: var(--text-2);
  font-size: .88rem; font-weight: 500; line-height: 1.3; text-decoration: none; white-space: nowrap;
  transition: border-color .2s, color .2s, background-color .2s, transform .2s;
}
button.chip { cursor: pointer; }
a.chip:hover, button.chip:hover { border-color: var(--sec, var(--accent)); color: var(--sec, var(--accent)); }
.chip.is-active { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
.chip small { opacity: .65; font-size: .8em; }
.chip-lg { font-size: 1rem; padding: .55em 1.1em; }
.chip-sm { font-size: .78rem; padding: .25em .65em; }
.badge { display: inline-block; padding: .3em .7em; border-radius: 999px; font: 600 .72rem/1 var(--font-mono); letter-spacing: .06em; }
.badge-toy { background: var(--accent-soft); color: var(--accent); }
.badge-real { background: rgba(251, 113, 133, .14); color: var(--sec-news-radar); }
.badge-sim { background: rgba(168, 85, 247, .14); color: #a855f7; }
.blk { scroll-margin-top: calc(var(--header-h) + 64px); }
.sec-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--sec, var(--accent)); display: inline-block; flex: none; box-shadow: 0 0 0 3px color-mix(in srgb, var(--sec, var(--accent)) 22%, transparent); }

/* ── Cards ─────────────────────────────────────────────────────────────── */
.card {
  position: relative; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); transition: transform .35s var(--ease), box-shadow .35s var(--ease), border-color .35s;
  --mx: 50%; --my: 50%;
}
.card::before { /* cursor glow */
  content: ""; position: absolute; inset: -1px; border-radius: inherit; pointer-events: none; opacity: 0; transition: opacity .3s;
  background: radial-gradient(420px circle at var(--mx) var(--my), color-mix(in srgb, var(--sec, var(--accent)) 16%, transparent), transparent 45%);
}
.card:hover::before { opacity: 1; }
.card:hover { border-color: color-mix(in srgb, var(--sec, var(--accent)) 45%, var(--border)); box-shadow: var(--shadow-lg); }
/* 3-D tilt only while hovered – a permanent 3-D transform would promote every card to its own GPU layer */
@media (hover: hover) and (pointer: fine) {
  [data-tilt]:hover { transform: perspective(900px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)) translateY(-4px); }
}

.card-grid { display: grid; gap: 22px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); }
.post-card { display: flex; }
.card-link { display: flex; flex-direction: column; width: 100%; color: inherit; text-decoration: none; border-radius: inherit; }
.card-link:hover { text-decoration: none; }
.card-media { aspect-ratio: 16 / 9; overflow: hidden; border-radius: calc(var(--radius) - 1px) calc(var(--radius) - 1px) 0 0; background: var(--surface-2); }
.card-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .8s var(--ease); }
.post-card:hover .card-media img { transform: scale(1.05); }
.card-body { padding: 22px 22px 20px; display: flex; flex-direction: column; flex: 1; }
.card-kicker { display: flex; align-items: center; gap: .5em; margin: 0 0 .7em; font: 500 .78rem/1.3 var(--font-mono); color: var(--muted); letter-spacing: .02em; }
.card-title { font-size: 1.2rem; margin-bottom: .5em; }
.card-text { color: var(--muted); font-size: .96rem; margin-bottom: 1em; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.card-more { margin-top: auto; font-weight: 600; font-size: .9rem; color: var(--sec, var(--accent)); }
.card-more span { display: inline-block; transition: transform .25s var(--ease); }
.card:hover .card-more span { transform: translateX(4px); }
.card-featured .card-link { display: grid; grid-template-columns: 1fr; }
@media (min-width: 900px) {
  .card-featured .card-link { grid-template-columns: 1.15fr 1fr; }
  .card-featured .card-media { aspect-ratio: auto; height: 100%; min-height: 320px; border-radius: calc(var(--radius) - 1px) 0 0 calc(var(--radius) - 1px); }
  .card-featured .card-body { padding: 40px; justify-content: center; }
  .card-featured .card-title { font-size: clamp(1.5rem, 1.4vw + 1rem, 2.1rem); }
  .card-featured .card-text { -webkit-line-clamp: 5; font-size: 1.05rem; }
}
.card-featured:not(:has(.card-media)) .card-link { grid-template-columns: 1fr; }
.featured { margin-bottom: 24px; }
.card-compact .card-media { display: none; }
.card-compact .card-body { padding: 18px 20px; }
.card-compact .card-text { -webkit-line-clamp: 2; }

/* ── Header ─────────────────────────────────────────────────────────────── */
.site-header {
  position: sticky; top: 0; z-index: 50; height: var(--header-h);
  background: transparent; border-bottom: 1px solid transparent;
  transition: background-color .3s, border-color .3s;
}
.site-header.is-scrolled, .site-header:has(.main-nav.is-open) { background: var(--surface-solid); border-bottom-color: var(--border); }
.header-inner { height: 100%; display: flex; align-items: center; gap: 24px; }
.logo { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); flex: none; }
.logo:hover { text-decoration: none; }
.logo-mark { width: 34px; height: 34px; }
.logo:hover .logo-needle { transform: rotate(25deg); }
.logo-needle { transform-origin: 20px 20px; transition: transform .6s var(--ease); }
.logo-word { font: 600 1.25rem/1 var(--font-display); letter-spacing: -0.03em; }
.logo-word b { font-weight: 700; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.logo-word small { font: 700 .62rem/1 var(--font-mono); margin-left: 4px; padding: 2px 5px; border-radius: 5px; border: 1px solid var(--border-strong); vertical-align: 3px; color: var(--muted); letter-spacing: .05em; }
.main-nav { margin-left: auto; }
.main-nav ul { list-style: none; margin: 0; padding: 0; display: flex; gap: 2px; }
.main-nav a {
  position: relative; display: block; padding: 8px 13px; border-radius: 999px; color: var(--text-2);
  text-decoration: none; font-weight: 500; font-size: .95rem; transition: color .2s, background-color .2s;
}
.main-nav a:hover { color: var(--text); background: var(--accent-soft); }
.main-nav a[aria-current="page"] { color: var(--accent); }
.main-nav a[aria-current="page"]::after { content: ""; position: absolute; left: 50%; bottom: 2px; width: 5px; height: 5px; margin-left: -2.5px; border-radius: 50%; background: var(--accent); }
.header-tools { display: flex; align-items: center; gap: 8px; }
.lang-switch { display: flex; padding: 3px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface-glass); }
.lang-switch a { padding: 4px 9px; border-radius: 999px; font: 600 .74rem/1.2 var(--font-mono); color: var(--muted); text-decoration: none; }
.lang-switch a[aria-current="true"] { background: var(--accent); color: var(--on-accent); }
.icon-btn { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 50%; border: 1px solid var(--border); background: var(--surface-glass); cursor: pointer; color: var(--text-2); transition: border-color .2s, color .2s, transform .3s var(--ease); }
.icon-btn:hover { color: var(--accent); border-color: var(--accent); }
.icon-btn svg { width: 20px; height: 20px; }
.theme-toggle .moon, .theme-toggle .rays, .theme-toggle .sun { transition: opacity .3s, transform .5s var(--ease); transform-origin: 12px 12px; }
.theme-toggle .moon { opacity: 0; transform: rotate(-40deg) scale(.6); }
:root[data-theme="dark"] .theme-toggle .moon { opacity: 1; transform: none; }
:root[data-theme="dark"] .theme-toggle .sun, :root[data-theme="dark"] .theme-toggle .rays { opacity: 0; transform: rotate(60deg) scale(.4); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) .theme-toggle .moon { opacity: 1; transform: none; }
  :root:not([data-theme]) .theme-toggle .sun, :root:not([data-theme]) .theme-toggle .rays { opacity: 0; transform: rotate(60deg) scale(.4); }
}
.menu-toggle { display: none; gap: 4px; flex-direction: column; }
.menu-toggle span { width: 16px; height: 2px; border-radius: 2px; background: currentColor; transition: transform .3s var(--ease), opacity .2s; }
.menu-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.menu-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.menu-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

@media (max-width: 1180px) {
  .menu-toggle { display: grid; place-content: center; }
  .main-nav {
    position: fixed; inset: var(--header-h) 0 auto 0; margin: 0; padding: 12px var(--gutter) 24px;
    background: var(--surface-solid);
    border-bottom: 1px solid var(--border); transform: translateY(-110%); opacity: 0; visibility: hidden;
    transition: transform .4s var(--ease), opacity .3s, visibility .4s;
  }
  .main-nav.is-open { transform: none; opacity: 1; visibility: visible; }
  .main-nav ul { flex-direction: column; }
  .main-nav a { font-size: 1.15rem; padding: 12px 8px; border-radius: 10px; }
  .main-nav a[aria-current="page"]::after { left: auto; right: 12px; top: 50%; bottom: auto; margin-top: -2.5px; }
  .header-inner { gap: 12px; }
  .header-tools { margin-left: auto; }
}
@media (max-width: 420px) { .logo-word small { display: none; } .lang-switch a { padding: 4px 7px; } }

/* scroll progress */
.scroll-progress { position: fixed; inset: 0 0 auto 0; height: 3px; z-index: 60; background: var(--grad); transform-origin: 0 50%; transform: scaleX(var(--scroll, 0)); pointer-events: none; }
@supports (animation-timeline: scroll()) {
  .scroll-progress { animation: progress linear both; animation-timeline: scroll(root block); }
  @keyframes progress { from { transform: scaleX(0); } to { transform: scaleX(1); } }
}

/* ── Load / reveal animations ──────────────────────────────────────────── */
@keyframes rise { from { opacity: 0; transform: translateY(26px); } to { opacity: 1; transform: none; } }
.reveal-load { animation: rise .9s var(--ease) both; }
.reveal-load:nth-child(2) { animation-delay: .08s; } .reveal-load:nth-child(3) { animation-delay: .16s; }
.reveal-load:nth-child(4) { animation-delay: .24s; } .reveal-load:nth-child(5) { animation-delay: .32s; } .reveal-load:nth-child(6) { animation-delay: .4s; }
html.js .reveal { opacity: 0; transform: translateY(30px); transition: opacity .9s var(--ease), transform .9s var(--ease); transition-delay: calc(min(var(--i, 0), 8) * 70ms); }
html.js .reveal.is-in { opacity: 1; transform: none; }
html.js .reveal[data-tilt].is-in { transition: opacity .9s var(--ease), transform .35s var(--ease), box-shadow .35s, border-color .35s; }
@media (hover: hover) and (pointer: fine) {
  html.js .reveal[data-tilt].is-in:hover { transform: perspective(900px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)) translateY(-4px); }
}

/* ── Home hero ─────────────────────────────────────────────────────────── */
.hero-home { position: relative; min-height: min(100svh, 980px); display: grid; align-items: center; padding: calc(var(--header-h) + 24px) 0 120px; margin-top: calc(-1 * var(--header-h)); overflow: hidden; isolation: isolate; }
.hero-canvas { position: absolute; inset: 0; width: 100%; height: 100%; z-index: -2; }
.hero-home::after { content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none; background: radial-gradient(ellipse 55% 50% at 32% 52%, color-mix(in srgb, var(--bg) 78%, transparent), transparent 72%); }
.hero-glow { position: absolute; inset: auto -10% -30% -10%; height: 70%; z-index: -3; background: radial-gradient(60% 60% at 30% 60%, color-mix(in srgb, var(--accent) 22%, transparent), transparent 70%), radial-gradient(50% 50% at 75% 40%, color-mix(in srgb, var(--accent-2) 22%, transparent), transparent 70%); }
.hero-inner { max-width: 1000px; }
.display { font-size: clamp(2.6rem, 7vw + .5rem, 6.2rem); line-height: 1.02; letter-spacing: -0.045em; margin-bottom: .35em; }
.ink-accent { position: relative; white-space: nowrap; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.ink-stroke { position: absolute; left: -2%; bottom: -0.12em; width: 104%; height: .32em; overflow: visible; }
.ink-stroke path { fill: none; stroke: var(--accent); stroke-width: 6; stroke-linecap: round; stroke-dasharray: 420; stroke-dashoffset: 420; animation: ink-draw 1.4s .6s var(--ease) forwards; opacity: .85; }
@keyframes ink-draw { to { stroke-dashoffset: 0; } }
.scroll-hint { position: absolute; left: 50%; bottom: 28px; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: 8px; color: var(--muted); font: 500 .72rem/1 var(--font-mono); letter-spacing: .14em; text-transform: uppercase; text-decoration: none; }
.mouse { width: 24px; height: 38px; border: 2px solid currentColor; border-radius: 14px; position: relative; }
.mouse::after { content: ""; position: absolute; left: 50%; top: 7px; 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; } 70% { transform: translateY(12px); opacity: 0; } 100% { opacity: 0; } }
@supports (animation-timeline: view()) {
  .hero-home { view-timeline: --hero block; }
  .hero-home .hero-inner, .hero-home .scroll-hint { animation: hero-out linear both; animation-timeline: --hero; animation-range: exit 0% exit 90%; }
  @keyframes hero-out { to { opacity: 0; transform: translateY(-90px) scale(.97); } }
}

/* ── Page heroes ───────────────────────────────────────────────────────── */
.page-hero, .post-hero { position: relative; padding: clamp(64px, 10vw, 140px) 0 clamp(40px, 6vw, 80px); overflow: hidden; isolation: isolate; }
.page-hero h1 { max-width: 18ch; }
.page-hero-bg { position: absolute; inset: 0; z-index: -1; overflow: hidden; }
.page-hero-bg span { position: absolute; border-radius: 50%; opacity: .55; animation: drift 18s ease-in-out infinite alternate; }
.page-hero-bg span:nth-child(1) { width: 46vw; height: 46vw; left: -10vw; top: -20vw; background: radial-gradient(closest-side, color-mix(in srgb, var(--sec, var(--accent)) 38%, transparent), transparent); }
.page-hero-bg span:nth-child(2) { width: 36vw; height: 36vw; right: -8vw; top: -6vw; background: radial-gradient(closest-side, color-mix(in srgb, var(--accent-2) 32%, transparent), transparent); animation-duration: 22s; }
.page-hero-bg span:nth-child(3) { width: 26vw; height: 26vw; left: 40vw; top: 10vw; background: radial-gradient(closest-side, color-mix(in srgb, var(--accent) 22%, transparent), transparent); animation-duration: 26s; }
@keyframes drift { from { transform: translate(0, 0) scale(1); } to { transform: translate(6vw, 4vw) scale(1.15); } }
.page-hero::after, .post-hero::after { content: ""; position: absolute; inset: 0; z-index: -1; background-image: radial-gradient(var(--border) 1px, transparent 1px); background-size: 26px 26px; mask-image: linear-gradient(to bottom, #000, transparent 85%); -webkit-mask-image: linear-gradient(to bottom, #000, transparent 85%); }

/* ── Intro / portrait ──────────────────────────────────────────────────── */
.portrait { position: relative; margin: 0 auto; width: min(100%, 460px); aspect-ratio: 1; }
.portrait img { width: 100%; height: 100%; object-fit: cover; border-radius: 32px; position: relative; z-index: 1; box-shadow: var(--shadow-lg); background: var(--surface-2); }
.portrait-ring { position: absolute; inset: -18px; border-radius: 44px; background: radial-gradient(closest-side, color-mix(in srgb, var(--accent) 45%, transparent), transparent); opacity: .7; animation: pulse 6s ease-in-out infinite alternate; }
@keyframes pulse { to { opacity: .2; transform: scale(.97); } }
.portrait-ink { position: absolute; right: -40px; bottom: -30px; width: 46%; z-index: 2; overflow: visible; }
.portrait-ink path { fill: none; stroke: var(--accent); stroke-width: 4; stroke-linecap: round; stroke-dasharray: 600; stroke-dashoffset: 600; transition: stroke-dashoffset 2.2s .3s var(--ease); }
.portrait.is-in .portrait-ink path, html:not(.js) .portrait-ink path { stroke-dashoffset: 0; }

.stats { display: grid; gap: 18px; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.stats-inline { margin-top: 28px; }
.stat { padding: 18px 20px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); }
.stat-value { display: block; font: 700 clamp(1.6rem, 2vw + 1rem, 2.4rem)/1.1 var(--font-display); background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; font-variant-numeric: tabular-nums; }
.stat-label { display: block; margin-top: 6px; color: var(--muted); font-size: .9rem; }

/* ── Statement (word-by-word on scroll) ────────────────────────────────── */
.statement { overflow: hidden; }
.statement-text { font: 600 clamp(1.5rem, 2.6vw + .8rem, 2.9rem)/1.28 var(--font-display); letter-spacing: -0.02em; }
html.js .statement-text .w { opacity: calc(.14 + .86 * clamp(0, (var(--p, 1) * var(--n, 40) - var(--i)) , 1)); transition: opacity .15s linear; }
.marquee { margin-top: clamp(40px, 6vw, 72px); overflow: hidden; 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; gap: 14px; width: max-content; animation: marquee 38s linear infinite; }
.marquee:hover .marquee-track { animation-play-state: paused; }
@keyframes marquee { to { transform: translateX(calc(-50% - 7px)); } }

/* ── Pillars ───────────────────────────────────────────────────────────── */
.pillar-grid { display: grid; gap: 22px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 250px), 1fr)); }
.pillar { padding: 30px 26px 26px; color: inherit; text-decoration: none; display: flex; flex-direction: column; overflow: hidden; min-height: 280px; }
.pillar:hover { text-decoration: none; }
.pillar p { color: var(--muted); }
.pillar-icon { font-size: 2rem; width: 58px; height: 58px; display: grid; place-items: center; border-radius: 16px; background: var(--accent-soft); margin-bottom: 20px; transition: transform .5s var(--ease); }
.card:hover .pillar-icon { transform: rotate(-8deg) scale(1.08); }
.pillar-num { position: absolute; right: 18px; top: 10px; font: 700 4.5rem/1 var(--font-display); color: var(--text); opacity: .05; }
.section-cards { display: grid; gap: 22px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr)); }
.section-card { padding: 30px; text-decoration: none; color: inherit; display: flex; flex-direction: column; }
.section-card:hover { text-decoration: none; }
.section-card p:not(.kicker) { color: var(--muted); }
.section-card .pillar-icon { background: color-mix(in srgb, var(--sec) 14%, transparent); }

/* ── Horizontal scroll (latest posts) ──────────────────────────────────── */
.hscroll-viewport { overflow-x: auto; scroll-snap-type: x mandatory; padding: 8px var(--gutter) 28px; scrollbar-width: thin; }
.hscroll-track { display: flex; gap: 22px; width: max-content; padding-inline: max(0px, calc((100vw - var(--container)) / 2 - var(--gutter))); }
.hscroll-track .post-card { width: min(78vw, 380px); scroll-snap-align: start; }
.latest.is-pinned { height: var(--hscroll-h, auto); padding-block: 0; }
.latest.is-pinned .hscroll-sticky { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; justify-content: center; overflow: hidden; }
.latest.is-pinned .hscroll-viewport { overflow: visible; scroll-snap-type: none; }
.latest.is-pinned .hscroll-track { transform: translateX(var(--hx, 0px)); will-change: transform; }

/* ── Lab teaser ────────────────────────────────────────────────────────── */
.lab-teaser { background: linear-gradient(180deg, transparent, var(--bg-2) 30%, var(--bg-2) 70%, transparent); }

/* ── Marvin teaser + page ──────────────────────────────────────────────── */
.marvin-teaser-img, .marvin-figure { margin: 0; border-radius: 28px; overflow: hidden; box-shadow: var(--shadow-lg); background: var(--surface-2); }
.marvin-teaser-img img, .marvin-figure img { width: 100%; height: 100%; object-fit: cover; }
.marvin-figure figcaption { padding: 12px 18px; font-size: .85rem; color: var(--muted); background: var(--surface); }
@supports (animation-timeline: view()) {
  [data-clip-reveal] { animation: card-in linear both; animation-timeline: view(); animation-range: entry 0% cover 30%; }
  @keyframes card-in { from { opacity: .2; transform: scale(.88) translateY(40px); } to { opacity: 1; transform: none; } }
  [data-clip-reveal] img { animation: img-settle linear both; animation-timeline: view(); animation-range: entry 0% cover 50%; }
  @keyframes img-settle { from { transform: scale(1.25); } to { transform: scale(1); } }
}
.marvin-hero { position: relative; padding: clamp(56px, 8vw, 110px) 0; overflow: hidden; background: radial-gradient(80% 60% at 80% 20%, color-mix(in srgb, var(--sec-marvin) 22%, transparent), transparent 70%); }
.marvin-scanlines { position: absolute; inset: 0; pointer-events: none; opacity: .35; background: repeating-linear-gradient(0deg, transparent 0 3px, color-mix(in srgb, var(--text) 4%, transparent) 3px 4px); }
.marvin-hero h1 { font-size: clamp(2rem, 3.4vw + 1rem, 3.6rem); }
.typewriter { position: relative; }
.tw-ghost { visibility: hidden; }
.tw-typed { position: absolute; inset: 0; }
.typewriter .tw-caret { display: inline-block; width: .08em; height: .9em; margin-left: .06em; background: var(--accent); vertical-align: -.08em; animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.mood { display: flex; gap: 18px; align-items: center; margin-top: 32px; padding: 18px 22px; max-width: 460px; }
.mood-gauge svg { width: 120px; height: 70px; overflow: visible; }
.gauge-track, .gauge-fill { fill: none; stroke-width: 10; stroke-linecap: round; }
.gauge-track { stroke: var(--surface-2); }
.gauge-fill { stroke: var(--sec-news-radar); stroke-dasharray: 100; stroke-dashoffset: calc(100 - 100 * var(--level)); animation: gauge-fill 2s .4s var(--ease) backwards; }
@keyframes gauge-fill { from { stroke-dashoffset: 100; } }
.gauge-needle { stroke: var(--text); stroke-width: 3; stroke-linecap: round; transform-origin: 60px 62px; transform: rotate(calc(-90deg + 180deg * var(--level))); animation: needle 2.4s .4s var(--ease) backwards; }
@keyframes needle { 0% { transform: rotate(60deg); } 40% { transform: rotate(-75deg); } 60% { transform: rotate(-50deg); } }
.mood-gauge circle { fill: var(--text); }
.mood p { margin: 0; }
.mood-label { font: 500 .74rem/1.3 var(--font-mono); text-transform: uppercase; letter-spacing: .1em; color: var(--muted); }
.mood-value { font: 700 1.5rem/1.2 var(--font-display); }
.mood-note { font-size: .9rem; color: var(--muted); }
.big-quote { margin: 0 0 32px; padding: 0 0 0 26px; border-left: 4px solid var(--sec, var(--accent)); font: 500 clamp(1.3rem, 1.4vw + 1rem, 1.9rem)/1.35 var(--font-display); color: var(--text); }
.big-quote p { margin: 0; }
.feature-grid { display: grid; gap: 22px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); }
.feature { padding: 28px; }
.feature p { color: var(--muted); margin: 0; }
.post-marvin .post-body { font-family: var(--font-sans); }

/* ── About ─────────────────────────────────────────────────────────────── */
.about-hero { position: relative; padding-bottom: 24px; }
.about-banner { height: clamp(220px, 34vw, 420px); position: relative; overflow: hidden; background: var(--grad); }
.about-banner::before { content: ""; position: absolute; inset: -12% 0; background: var(--banner) center / cover no-repeat; }
.about-banner::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 30%, var(--bg)); }
@supports (animation-timeline: view()) {
  .about-banner::before { animation: banner-par linear both; animation-timeline: view(); animation-range: exit 0% exit 100%; }
  @keyframes banner-par { to { transform: translateY(10%); } }
}
.about-head { display: flex; gap: clamp(20px, 4vw, 44px); align-items: flex-end; margin-top: clamp(-120px, -9vw, -60px); position: relative; flex-wrap: wrap; }
.about-photo { margin: 0; width: clamp(140px, 18vw, 220px); aspect-ratio: 1; border-radius: 50%; overflow: hidden; border: 5px solid var(--bg); box-shadow: var(--shadow-lg); background: var(--surface-2); flex: none; }
.about-photo img { width: 100%; height: 100%; object-fit: cover; }
.about-id h1 { margin-bottom: .15em; }
.about-role { font-size: 1.15rem; color: var(--text-2); margin-bottom: .6em; }
.about-meta { display: flex; flex-wrap: wrap; gap: 18px; color: var(--muted); margin: 0; }
.about-meta > * { display: inline-flex; align-items: center; gap: 6px; }
.about-meta svg { width: 18px; height: 18px; }
.prose-lg { font-size: 1.15rem; }

.timeline { list-style: none; margin: 0; padding: 0 0 0 34px; position: relative; display: grid; gap: 24px; }
.tl-line { position: absolute; left: 9px; top: 6px; bottom: 6px; width: 3px; border-radius: 3px; background: var(--border); overflow: hidden; }
.tl-line-fill { position: absolute; inset: 0; background: var(--grad); transform-origin: top; }
@supports (animation-timeline: view()) {
  .timeline { view-timeline: --tl block; }
  .tl-line-fill { animation: grow-y linear both; animation-timeline: --tl; animation-range: entry 30% cover 70%; }
  @keyframes grow-y { from { transform: scaleY(0); } to { transform: scaleY(1); } }
}
.tl-item { position: relative; }
.tl-dot { position: absolute; left: -32px; top: 26px; width: 17px; height: 17px; border-radius: 50%; background: var(--bg); border: 3px solid var(--accent); box-shadow: 0 0 0 6px var(--accent-soft); transition: transform .5s var(--ease); }
.tl-item.is-in .tl-dot { transform: scale(1.15); }
.tl-card { padding: 22px 26px; }
.tl-card p:last-child { margin-bottom: 0; }
.tl-period { font: 600 .8rem/1.3 var(--font-mono); color: var(--accent); margin-bottom: .5em; }
.tl-org { color: var(--muted); font-weight: 500; }
@media (min-width: 900px) {
  .timeline { padding-left: 0; }
  .tl-line { left: 50%; margin-left: -1.5px; }
  .tl-item { width: calc(50% - 36px); }
  .tl-item:nth-child(odd) { margin-left: auto; }
  .tl-item:nth-child(even) .tl-dot { left: auto; right: -45px; }
  .tl-item:nth-child(odd) .tl-dot { left: -45px; }
}
.edu-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 14px; }
.edu-item { display: grid; gap: 2px; padding: 18px 20px; border-left: 3px solid var(--accent); background: var(--surface); border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }
.edu-period { font: 600 .78rem/1.3 var(--font-mono); color: var(--accent); }
.edu-item span:not(.edu-period), .edu-item small { color: var(--muted); }
.award-grid { display: grid; gap: 16px; }
.award { padding: 22px 24px; }
.award-icon { font-size: 1.8rem; display: block; margin-bottom: 10px; }
.award p { color: var(--muted); margin: 0; }
.chip-cloud { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 10px; }
.chip-cloud .chip { font-size: 1rem; padding: .55em 1.1em; }
html.js .chip-cloud .chip.reveal { transform: translateY(16px) scale(.9); }
html.js .chip-cloud .chip.reveal.is-in { transform: none; }
.contact-card { padding: clamp(28px, 5vw, 56px); text-align: center; background: radial-gradient(120% 120% at 50% 0%, var(--accent-soft), transparent 60%), var(--surface); }
.contact-card .cta-row { justify-content: center; }

/* ── Scrollytelling ────────────────────────────────────────────────────── */
.scrolly { display: grid; gap: 32px; grid-template-columns: 1fr; }
@media (min-width: 960px) { .scrolly { grid-template-columns: 1.1fr .9fr; gap: 56px; } }
.scrolly-stage-wrap { position: sticky; top: calc(var(--header-h) + 16px); align-self: start; z-index: 2; }
@media (max-width: 959px) { .scrolly-stage-wrap { top: calc(var(--header-h) + 8px); } }
.scrolly-stage { min-height: clamp(300px, 46vh, 480px); padding: clamp(18px, 3vw, 32px); display: flex; flex-direction: column; justify-content: center; overflow: hidden; background: radial-gradient(100% 80% at 50% 0%, var(--accent-soft), transparent 70%), var(--surface); }
@media (max-width: 959px) { .scrolly-stage { min-height: 260px; } }
.stage-prompt { font: 500 clamp(1.2rem, 1.5vw + .8rem, 1.8rem)/1.4 var(--font-mono); margin: 0; }
.caret { color: var(--accent); animation: blink 1s steps(1) infinite; }
.scrolly-steps { display: grid; gap: 0; }
.step { min-height: 72vh; display: flex; flex-direction: column; justify-content: center; padding: 24px 0; opacity: .28; transition: opacity .5s var(--ease); }
.step.is-active { opacity: 1; }
.step h3 { font-size: clamp(1.3rem, 1vw + 1rem, 1.7rem); }
.step p { color: var(--text-2); font-size: 1.08rem; }
@media (max-width: 959px) {
  .step { min-height: 60vh; padding: 20px; margin-inline: -4px; }
  .step > * { position: relative; }
  .step.is-active { background: var(--surface-solid); border-radius: var(--radius); }
}
.scrolly-stage { position: relative; }
.stage-dots { position: absolute; left: 50%; bottom: 16px; transform: translateX(-50%); display: flex; gap: 8px; }
.stage-dots i { width: 8px; height: 8px; border-radius: 50%; background: var(--border-strong); transition: all .4s var(--ease); }
.stage-dots i.done { background: color-mix(in srgb, var(--accent) 50%, transparent); }
.stage-dots i.on { width: 26px; border-radius: 4px; background: var(--accent); }
.stage-label { font: 600 .72rem/1 var(--font-mono); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin-bottom: 14px; }
.stage-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-end; }
.s-tok { position: relative; font: 500 clamp(.95rem, .6vw + .7rem, 1.2rem)/1 var(--font-mono); padding: 10px 12px; border-radius: 10px; border: 1px solid var(--border-strong); background: var(--surface-2); white-space: pre; transition: all .6s var(--ease); }
.s-tok small { position: absolute; left: 50%; top: calc(100% + 6px); transform: translateX(-50%); font-size: .68rem; color: var(--muted); }
.s-vec { display: grid; grid-template-rows: repeat(8, 8px); gap: 2px; margin-top: 8px; }
.s-vec i { display: block; width: 100%; border-radius: 2px; transition: background-color .6s, opacity .6s; }
.s-arcs { width: 100%; height: 120px; overflow: visible; }
.s-arcs path { fill: none; stroke: var(--accent); stroke-linecap: round; transition: stroke-width .6s, opacity .6s; }
.s-layers { display: grid; gap: 8px; }
.s-layer { height: 22px; border-radius: 8px; background: linear-gradient(90deg, color-mix(in srgb, var(--accent) 50%, transparent), color-mix(in srgb, var(--accent-2) 50%, transparent)); transform-origin: left; animation: layer-in .6s var(--ease) both; display: flex; align-items: center; padding-left: 10px; font: 600 .7rem/1 var(--font-mono); color: #fff; }
@keyframes layer-in { from { transform: scaleX(0); opacity: 0; } }
.s-bars { display: grid; gap: 10px; }
.s-bar { display: grid; grid-template-columns: 90px 1fr 48px; align-items: center; gap: 10px; font: 500 .95rem/1 var(--font-mono); }
.s-bar span:nth-child(2) { height: 16px; border-radius: 6px; background: var(--grad); transform-origin: left; transform: scaleX(var(--v)); transition: transform .9s var(--ease); }
.s-bar em { font-style: normal; color: var(--muted); text-align: right; }
.s-new { color: var(--accent); border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); animation: pop .6s var(--ease); }
@keyframes pop { from { transform: scale(.6); opacity: 0; } }

/* ── Filter bar / search ───────────────────────────────────────────────── */
.filter-bar { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 28px; }
.search-box { display: block; max-width: 520px; margin-bottom: 40px; }
.search-box input { width: 100%; padding: 14px 20px 14px 46px; border-radius: 999px; border: 1px solid var(--border-strong); background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238fa2c4' stroke-width='2'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-3.5-3.5'/%3E%3C/svg%3E") 16px 50% / 20px no-repeat; outline: none; transition: border-color .2s, box-shadow .2s; }
.search-box input:focus { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.no-results { color: var(--muted); padding: 24px 0; }
[data-hidden] { display: none !important; }

.link-group { margin-bottom: 56px; }
.link-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr)); }
.link-card { padding: 22px; text-decoration: none; color: inherit; display: flex; flex-direction: column; gap: 8px; }
.link-card:hover { text-decoration: none; }
.link-card .chip { align-self: flex-start; }
.link-card h3 { margin: 0; font-size: 1.1rem; }
.link-card p { color: var(--muted); font-size: .93rem; margin: 0; }
.link-host { margin-top: auto; font: 500 .78rem/1 var(--font-mono); color: var(--accent); padding-top: 8px; }
.ext-arrow { display: inline-block; transition: transform .25s var(--ease); color: var(--accent); }
.link-card:hover .ext-arrow { transform: translate(3px, -3px); }

/* ── Post ──────────────────────────────────────────────────────────────── */
.post-hero h1 { font-size: clamp(2rem, 3.2vw + 1rem, 3.5rem); }
.post-hero .lead { margin-bottom: 1.2em; }
.post-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 22px; color: var(--muted); font-size: .92rem; }
.author { display: inline-flex; align-items: center; gap: 10px; color: var(--text); font-weight: 600; text-decoration: none; }
.author img { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; background: var(--surface-2); border: 2px solid var(--border); }
.tag-list { list-style: none; padding: 0; margin: 18px 0 0; display: flex; flex-wrap: wrap; gap: 8px; }
.post-cover { margin-top: 36px; }
.post-cover img { width: 100%; border-radius: var(--radius); box-shadow: var(--shadow-lg); }
@supports (animation-timeline: view()) {
  [data-zoom] { overflow: hidden; border-radius: var(--radius); }
  [data-zoom] img { animation: zoom-settle linear both; animation-timeline: view(); animation-range: entry 0% cover 60%; }
  @keyframes zoom-settle { from { transform: scale(1.12); } to { transform: scale(1); } }
}
.notice { padding: 14px 18px; border-radius: var(--radius-sm); background: var(--accent-soft); border: 1px solid var(--border); color: var(--text-2); }
@media (min-width: 1180px) {
  .post.has-toc .post-hero > .container, .post.has-toc > .notice, .post.has-toc > .related-labs, .post.has-toc > .post-nav { position: relative; left: 150px; }
}
.post-layout { display: grid; gap: 40px; grid-template-columns: minmax(0, 1fr); max-width: calc(var(--narrow) + 2 * var(--gutter)); padding-bottom: 40px; }
@media (min-width: 1180px) {
  .post-layout.has-toc { max-width: calc(var(--narrow) + 300px + 2 * var(--gutter)); grid-template-columns: 240px minmax(0, var(--narrow)); gap: 60px; }
}
.toc { display: none; }
@media (min-width: 1180px) {
  .toc { display: block; position: sticky; top: calc(var(--header-h) + 24px); align-self: start; max-height: calc(100vh - var(--header-h) - 48px); overflow: auto; font-size: .88rem; }
}
.toc-title { font: 600 .74rem/1 var(--font-mono); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.toc ol { list-style: none; padding: 0; margin: 0; border-left: 2px solid var(--border); }
.toc li a { display: block; padding: 6px 0 6px 14px; margin-left: -2px; border-left: 2px solid transparent; color: var(--muted); text-decoration: none; line-height: 1.35; transition: color .2s, border-color .2s; }
.toc li.toc-l3 a { padding-left: 26px; font-size: .84rem; }
.toc li a:hover { color: var(--text); }
.toc li a.is-active { color: var(--sec, var(--accent)); border-left-color: var(--sec, var(--accent)); }
.reading-mode { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 6px; margin-bottom: 28px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); width: fit-content; max-width: 100%; position: sticky; top: calc(var(--header-h) + 10px); z-index: 5; box-shadow: var(--shadow); }
.reading-mode-label { font: 600 .7rem/1 var(--font-mono); text-transform: uppercase; letter-spacing: .1em; color: var(--muted); padding: 0 8px; }
.reading-mode button { border: 0; background: transparent; padding: 7px 14px; border-radius: 999px; cursor: pointer; font-size: .88rem; font-weight: 500; color: var(--text-2); }
.reading-mode button[aria-checked="true"] { background: var(--accent); color: var(--on-accent); }
.post-body[data-reading-mode="everyone"] [data-audience="nerds"],
.post-body[data-reading-mode="nerds"] [data-audience="everyone"] { display: none; }
.related-labs { margin-block: 24px 8px; }
.post-nav { display: grid; gap: 16px; grid-template-columns: 1fr; padding-block: 32px 80px; }
@media (min-width: 700px) { .post-nav { grid-template-columns: 1fr 1fr; } }
.post-nav-link { padding: 20px 22px; text-decoration: none; color: inherit; display: grid; gap: 6px; }
.post-nav-link:hover { text-decoration: none; }
.post-nav-link small { color: var(--muted); font-weight: 600; }
.post-nav-link.next { text-align: right; }

/* ── Prose ─────────────────────────────────────────────────────────────── */
.prose { font-size: 1.07rem; color: var(--text-2); }
.prose > :first-child { margin-top: 0; }
.prose h2 { margin: 2.2em 0 .7em; font-size: clamp(1.5rem, 1.2vw + 1rem, 2rem); }
.prose h3 { margin: 1.8em 0 .6em; }
.prose h2, .prose h3 { position: relative; scroll-margin-top: calc(var(--header-h) + 70px); }
.prose .anchor { position: absolute; left: -1.1em; color: var(--muted); opacity: 0; text-decoration: none; transition: opacity .2s; font-weight: 400; }
.prose h2:hover .anchor, .prose h3:hover .anchor { opacity: .6; }
.prose strong { color: var(--text); }
.prose ul, .prose ol { padding-left: 1.3em; }
.prose li { margin: .35em 0; }
.prose li::marker { color: var(--sec, var(--accent)); }
.prose blockquote { margin: 1.6em 0; padding: .4em 0 .4em 1.2em; border-left: 3px solid var(--sec, var(--accent)); color: var(--text); font-style: italic; }
.prose hr { border: 0; height: 1px; background: var(--border); margin: 2.5em 0; }
.prose img { border-radius: var(--radius-sm); }
.prose code { font: .88em var(--font-mono); padding: .15em .4em; border-radius: 6px; background: var(--accent-soft); color: var(--text); }
.md-figure { margin: 2em 0; }
.md-figure img { margin-inline: auto; box-shadow: var(--shadow); }
.md-figure figcaption { margin-top: 10px; text-align: center; color: var(--muted); font-size: .9rem; }
.img-missing { display: grid; place-items: center; min-height: 160px; border-radius: var(--radius-sm); border: 1px dashed var(--border-strong); background: var(--surface-2); color: var(--muted); font-size: .85rem; }
.img-missing img { display: none; }
.code-block { position: relative; margin: 1.6em 0; border-radius: var(--radius-sm); background: var(--code-bg); border: 1px solid var(--border); overflow: hidden; }
.code-block[data-lang]::before { content: attr(data-lang); position: absolute; top: 8px; left: 14px; font: 600 .68rem/1 var(--font-mono); text-transform: uppercase; letter-spacing: .1em; color: #7f93bd; }
.code-block pre { margin: 0; padding: 34px 18px 18px; overflow-x: auto; }
.code-block code { font: .9rem/1.6 var(--font-mono); color: var(--code-text); background: none; padding: 0; }
.copy-btn { position: absolute; top: 6px; right: 8px; padding: 4px 10px; border-radius: 6px; border: 1px solid rgba(255,255,255,.15); background: rgba(255,255,255,.06); color: #b9c8e8; font: 500 .72rem/1.2 var(--font-mono); cursor: pointer; opacity: 0; transition: opacity .2s; }
.code-block:hover .copy-btn, .copy-btn:focus { opacity: 1; }
.table-wrap { overflow-x: auto; margin: 1.6em 0; border: 1px solid var(--border); border-radius: var(--radius-sm); }
.table-wrap table { border-collapse: collapse; width: 100%; font-size: .95rem; }
.table-wrap th, .table-wrap td { padding: 10px 14px; text-align: left; border-bottom: 1px solid var(--border); vertical-align: top; }
.table-wrap th { background: var(--surface-2); color: var(--text); font-weight: 600; }
.table-wrap tr:last-child td { border-bottom: 0; }

.callout { margin: 1.8em 0; padding: 20px 22px; border-radius: var(--radius); border: 1px solid var(--border); background: var(--surface); position: relative; }
.callout-body > :last-child { margin-bottom: 0; }
.callout-title { display: flex; align-items: center; gap: 10px; margin: 0 0 .8em; font: 600 .8rem/1.2 var(--font-mono); text-transform: uppercase; letter-spacing: .1em; color: var(--muted); }
.callout-icon { font-size: 1.1rem; }
.callout-tldr { border-left: 4px solid var(--accent); background: linear-gradient(90deg, var(--accent-soft), transparent 70%), var(--surface); font-size: 1.05rem; }
.callout-note { border-left: 4px solid var(--accent-2); }
.callout-tip { border-left: 4px solid var(--sec-ki-im-alltag); }
.callout-warning { border-left: 4px solid var(--sec-mit-ki-arbeiten); }
.callout-quote { border-left: 4px solid var(--sec-marvin); font-style: italic; }
.callout[data-audience] { padding: 0; border: 0; background: none; margin: 2.4em 0; }
.callout[data-audience] > .callout-title { display: inline-flex; padding: 6px 14px; border-radius: 999px; margin-bottom: 1.2em; }
.callout[data-audience="everyone"] > .callout-title { background: color-mix(in srgb, var(--sec-mit-ki-arbeiten) 16%, transparent); color: var(--text); }
.callout[data-audience="nerds"] > .callout-title { background: color-mix(in srgb, var(--sec-nerd-corner) 18%, transparent); color: var(--text); }
.callout[data-audience] > .callout-body { padding-left: clamp(0px, 2vw, 22px); border-left: 2px dashed var(--border-strong); }
.callout[data-audience] .callout-body h2:first-child { margin-top: 0; }

/* ── Lab: shared UI ────────────────────────────────────────────────────── */
.lab-embed { margin: 2em 0; }
.lab-placeholder { display: flex; gap: 12px; align-items: center; padding: 22px; border-radius: var(--radius); border: 1px dashed var(--border-strong); color: var(--muted); background: var(--surface-2); font-size: .92rem; }
.lab-placeholder-icon { font-size: 1.4rem; }
.lab { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: clamp(16px, 2.5vw, 28px); box-shadow: var(--shadow); color: var(--text); font-size: .95rem; position: relative; }
.lab-section .lab { box-shadow: var(--shadow-lg); }
.lab-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 16px; }
.lab-title { font: 600 1rem/1.3 var(--font-display); margin: 0; }
.lab-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 14px; }
.lab-grow { flex: 1 1 260px; min-width: 0; }
.lab label.field { display: grid; gap: 6px; font: 600 .72rem/1.2 var(--font-mono); text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.lab input[type="text"], .lab input[type="search"], .lab textarea, .lab select {
  width: 100%; padding: 11px 14px; border-radius: 12px; border: 1px solid var(--border-strong); background: var(--bg);
  font: 500 .98rem/1.4 var(--font-mono); text-transform: none; letter-spacing: 0; color: var(--text); outline: none; transition: border-color .2s, box-shadow .2s;
}
.lab textarea { resize: vertical; min-height: 84px; }
.lab input:focus, .lab textarea:focus, .lab select:focus { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.lab-btn { display: inline-flex; align-items: center; gap: 8px; padding: 9px 16px; border-radius: 999px; border: 1px solid var(--border-strong); background: var(--surface-2); color: var(--text); font-weight: 600; font-size: .88rem; cursor: pointer; transition: border-color .2s, color .2s, background-color .2s, transform .2s; }
.lab-btn:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); }
.lab-btn:active:not(:disabled) { transform: scale(.97); }
.lab-btn:disabled { opacity: .45; cursor: not-allowed; }
.lab-btn.primary { background: var(--grad); color: #fff; border-color: transparent; }
.lab-btn.primary:hover:not(:disabled) { color: #fff; filter: brightness(1.1); }
.seg { display: inline-flex; padding: 3px; border-radius: 999px; border: 1px solid var(--border); background: var(--bg); flex-wrap: wrap; }
.seg button { border: 0; background: none; padding: 6px 12px; border-radius: 999px; cursor: pointer; font-size: .84rem; font-weight: 500; color: var(--muted); }
.seg button[aria-pressed="true"] { background: var(--accent); color: var(--on-accent); }
.slider { display: grid; grid-template-columns: auto 1fr 3.5em; gap: 12px; align-items: center; font: 500 .82rem/1.2 var(--font-mono); color: var(--muted); }
.slider output { text-align: right; color: var(--text); font-weight: 600; }
.lab input[type="range"] { width: 100%; accent-color: var(--accent); height: 22px; }
.lab-note { font-size: .84rem; color: var(--muted); margin: 10px 0 0; }
.lab-mono { font-family: var(--font-mono); }
.lab-presets { display: flex; flex-wrap: wrap; gap: 6px; }
.lab-presets .chip { font-size: .8rem; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.lab-panel { border-radius: 14px; background: var(--bg); border: 1px solid var(--border); padding: 14px; overflow: auto; }
.lab-split { display: grid; gap: 16px; grid-template-columns: 1fr; }
@media (min-width: 860px) { .lab-split { grid-template-columns: 1.2fr 1fr; } }
.lab-stats { display: flex; flex-wrap: wrap; gap: 18px; margin: 12px 0 0; font: 500 .82rem/1.2 var(--font-mono); color: var(--muted); }
.lab-stats b { color: var(--text); font-size: 1.1rem; margin-right: 4px; }
.lab-explain { margin-top: 22px; max-width: 860px; }
.lab-explain p { color: var(--muted); }
.lab-consent { display: grid; gap: 14px; padding: 22px; border-radius: 14px; border: 1px dashed var(--border-strong); background: var(--bg); text-align: left; }
.lab-consent p { margin: 0; font-size: .9rem; color: var(--muted); }
.lab-progress { height: 8px; border-radius: 8px; background: var(--surface-2); overflow: hidden; }
.lab-progress span { display: block; height: 100%; width: calc(var(--p, 0) * 100%); background: var(--grad); transition: width .2s; }
.lab-status { font: 500 .8rem/1.3 var(--font-mono); color: var(--muted); }
.lab-nav { position: sticky; top: var(--header-h); z-index: 20; background: var(--surface-solid); border-block: 1px solid var(--border); }
.lab-nav-inner { display: flex; gap: 8px; overflow-x: auto; padding-block: 10px; scrollbar-width: none; }
.lab-nav-inner::-webkit-scrollbar { display: none; }
.lab-nav .chip.is-active { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
.lab-section { scroll-margin-top: calc(var(--header-h) + 64px); padding-block: clamp(40px, 6vw, 84px); }
.lab-section + .lab-section { padding-top: clamp(24px, 3vw, 40px); }
.lab-real { background: linear-gradient(180deg, transparent, color-mix(in srgb, var(--sec-news-radar) 5%, transparent) 40%, transparent); }

/* tokens */
.tok-list { display: flex; flex-wrap: wrap; gap: 6px 4px; line-height: 1; }
.tok { --h: 200; display: inline-flex; flex-direction: column; align-items: center; gap: 4px; padding: 7px 8px 6px; border-radius: 8px; font: 500 .95rem/1 var(--font-mono); white-space: pre; background: hsl(var(--h) 80% 60% / .16); border: 1px solid hsl(var(--h) 80% 60% / .45); color: var(--text); animation: pop .35s var(--ease) both; animation-delay: calc(var(--i, 0) * 18ms); }
.tok small { font-size: .66rem; color: var(--muted); }
.tok .sp { color: var(--muted); opacity: .7; }

/* heatmaps / matrices */
.heat { border-collapse: separate; border-spacing: 2px; font: 500 .72rem/1 var(--font-mono); }
.heat th { font-weight: 500; color: var(--muted); padding: 4px; white-space: pre; max-width: 90px; overflow: hidden; text-overflow: ellipsis; }
.heat th.row { text-align: right; }
.heat td { width: 34px; height: 30px; min-width: 28px; text-align: center; border-radius: 5px; color: var(--text); transition: background-color .3s; cursor: default; }
.heat td.masked { background: repeating-linear-gradient(45deg, var(--surface-2) 0 4px, transparent 4px 8px); color: transparent; }
.heat td.hl, .heat tr.hl th { outline: 2px solid var(--accent); }
.heat-scroll { overflow-x: auto; }
.vec { display: inline-grid; grid-auto-flow: column; gap: 2px; vertical-align: middle; }
.vec i { width: 12px; height: 22px; border-radius: 3px; display: block; }
.vec.vec-sm i { width: 8px; height: 14px; }

/* attention arcs */
.attn-view { position: relative; }
.attn-svg { width: 100%; overflow: visible; display: block; }
.attn-svg path { fill: none; stroke: var(--accent); stroke-linecap: round; transition: opacity .25s; }
.attn-tokens { display: flex; flex-wrap: wrap; gap: 6px; position: relative; }
.attn-tok { padding: 8px 10px; border-radius: 9px; border: 1px solid var(--border-strong); background: var(--surface-2); font: 500 .92rem/1 var(--font-mono); cursor: pointer; transition: background-color .2s, border-color .2s, transform .2s; white-space: pre; user-select: none; }
.attn-tok.is-focus { border-color: var(--accent); background: var(--accent); color: var(--on-accent); transform: translateY(-2px); }
.attn-tok[style*="--w"] { background: color-mix(in srgb, var(--accent) calc(var(--w) * 70%), var(--surface-2)); }
.head-desc { font-size: .88rem; color: var(--muted); margin: 8px 0 14px; min-height: 2.6em; }
.math-table { width: 100%; border-collapse: collapse; font: 500 .82rem/1.3 var(--font-mono); }
.math-table th, .math-table td { padding: 7px 8px; border-bottom: 1px solid var(--border); text-align: right; white-space: nowrap; }
.math-table th:first-child, .math-table td:first-child { text-align: left; }
.math-table td .bar { display: inline-block; height: 8px; border-radius: 4px; background: var(--grad); vertical-align: middle; margin-right: 6px; }

/* probability bars */
.prob-list { display: grid; gap: 7px; }
.prob { display: grid; grid-template-columns: minmax(70px, 140px) 1fr 4.2em; gap: 10px; align-items: center; font: 500 .88rem/1.2 var(--font-mono); padding: 3px 6px; margin: 0 -6px; border-radius: 8px; transition: opacity .3s, background-color .2s; }
button.prob { border: 0; background: none; text-align: left; cursor: pointer; color: inherit; width: calc(100% + 12px); }
button.prob:hover { background: var(--accent-soft); }
.prob .lbl { overflow: hidden; text-overflow: ellipsis; white-space: pre; }
.prob .track { height: 14px; border-radius: 7px; background: var(--surface-2); overflow: hidden; position: relative; }
.prob .fill { position: absolute; inset: 0 auto 0 0; width: calc(var(--v, 0) * 100%); border-radius: 7px; background: var(--grad); transition: width .45s var(--ease); }
.prob .val { text-align: right; color: var(--muted); }
.prob.cut { opacity: .35; }
.prob.cut .fill { background: var(--muted); }
.prob.picked .lbl { color: var(--accent); font-weight: 700; }
.drawn-tok { display: inline-block; padding: 8px 14px; border-radius: 10px; background: var(--accent); color: var(--on-accent); font: 700 1.05rem/1 var(--font-mono); animation: pop .4s var(--ease); }
.hist { display: flex; align-items: flex-end; gap: 4px; height: 80px; }
.hist div { flex: 1; background: var(--grad); border-radius: 4px 4px 0 0; min-height: 2px; transition: height .4s var(--ease); position: relative; }

/* embedding map */
.emb-canvas { width: 100%; aspect-ratio: 4 / 3; border-radius: 14px; background: var(--bg); border: 1px solid var(--border); touch-action: none; cursor: crosshair; }
.emb-arith { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font: 600 1rem/1 var(--font-mono); }
.emb-arith select { width: auto; min-width: 120px; padding: 8px 10px; }
.emb-result { padding: 8px 14px; border-radius: 10px; background: var(--accent); color: var(--on-accent); }

/* pipeline stepper */
.pipe-steps { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 6px; margin-bottom: 16px; scrollbar-width: thin; }
.pipe-steps button { flex: none; display: flex; align-items: center; gap: 8px; padding: 8px 12px; border-radius: 999px; border: 1px solid var(--border); background: var(--bg); cursor: pointer; font-size: .84rem; font-weight: 500; color: var(--muted); }
.pipe-steps button b { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--surface-2); font: 700 .72rem/1 var(--font-mono); }
.pipe-steps button[aria-current="step"] { border-color: var(--accent); color: var(--text); }
.pipe-steps button[aria-current="step"] b { background: var(--accent); color: var(--on-accent); }
.pipe-steps button.done b { background: color-mix(in srgb, var(--accent) 35%, var(--surface-2)); }
.pipe-stage { min-height: 260px; }
.pipe-stage h4 { font: 600 1.1rem/1.3 var(--font-display); margin: 0 0 6px; }
.pipe-stage > p { color: var(--muted); margin-bottom: 14px; }
.pipe-flow { display: grid; gap: 10px; }
.pipe-rowlabel { font: 500 .78rem/1 var(--font-mono); color: var(--muted); white-space: pre; min-width: 90px; }
.pipe-line { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.formula { font: 500 .9rem/1.5 var(--font-mono); padding: 10px 14px; border-radius: 10px; background: var(--accent-soft); color: var(--text); display: inline-block; margin-bottom: 12px; }

/* scatter map (semantic search) */
.sem-grid { display: grid; gap: 16px; grid-template-columns: 1fr; }
@media (min-width: 900px) { .sem-grid { grid-template-columns: 1fr 1fr; } }
.sem-list { display: grid; gap: 6px; }
.sem-item { display: grid; grid-template-columns: 3.6em 1fr; gap: 10px; align-items: center; font-size: .9rem; padding: 6px 8px; border-radius: 8px; }
.sem-item .score { font: 600 .82rem/1 var(--font-mono); text-align: right; color: var(--accent); }
.sem-item .bar { grid-column: 2; height: 4px; border-radius: 2px; background: var(--grad); transform-origin: left; transform: scaleX(var(--v, 0)); transition: transform .5s var(--ease); }
.sem-item.top { background: var(--accent-soft); }
.sem-canvas { width: 100%; aspect-ratio: 1; border-radius: 14px; background: var(--bg); border: 1px solid var(--border); }
.sentence-list { display: grid; gap: 4px; margin: 0; padding: 0; list-style: none; font-size: .86rem; }
.sentence-list li { display: flex; gap: 8px; align-items: baseline; color: var(--text-2); }
.sentence-list li b { font: 700 .72rem/1 var(--font-mono); color: var(--accent); min-width: 1.6em; }
.gen-output { font: 500 1.05rem/1.6 var(--font-mono); padding: 16px; border-radius: 12px; background: var(--bg); border: 1px solid var(--border); min-height: 3.4em; word-break: break-word; }
.gen-output .new { color: var(--accent); background: var(--accent-soft); border-radius: 4px; animation: pop .35s var(--ease); }

/* ── Footer ────────────────────────────────────────────────────────────── */
.site-footer { position: relative; margin-top: 40px; background: var(--bg-2); color: var(--text-2); font-size: .94rem; }
.footer-wave { position: absolute; left: 0; right: 0; top: -59px; height: 60px; color: var(--bg-2); }
.footer-wave svg { width: 100%; height: 100%; }
.footer-wave path { fill: currentColor; }
.footer-inner { display: grid; gap: 36px; grid-template-columns: 1fr; padding-block: 56px 32px; }
@media (min-width: 800px) { .footer-inner { grid-template-columns: 2fr 1fr 1fr; } }
.footer-brand p { color: var(--muted); max-width: 46ch; margin-top: 16px; }
.footer-note { font-size: .85rem; }
.footer-links { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.footer-links a { color: var(--text-2); text-decoration: none; }
.footer-links a:hover { color: var(--accent); }
.footer-bottom { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px; padding-block: 20px 32px; border-top: 1px solid var(--border); color: var(--muted); font-size: .85rem; }
.footer-bottom a { color: var(--muted); text-decoration: none; }

/* ── View transitions (SPA navigation) ─────────────────────────────────── */
@view-transition { navigation: auto; }
::view-transition-old(root) { animation: vt-out .28s var(--ease) both; }
::view-transition-new(root) { animation: vt-in .45s var(--ease) both; }
@keyframes vt-out { to { opacity: 0; transform: translateY(-12px); } }
@keyframes vt-in { from { opacity: 0; transform: translateY(16px); } }

/* ── Reduced motion ────────────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
  html.js .reveal { opacity: 1; transform: none; }
  .marquee-track { animation: none; flex-wrap: wrap; width: auto; }
  .marquee-track > :nth-child(n + 8) { display: none; }
  html.js .statement-text .w { opacity: 1; }
  .ink-stroke path { stroke-dashoffset: 0; }
  .hero-home .hero-inner, .hero-home .scroll-hint { animation: none !important; }
}

/* ── Print ─────────────────────────────────────────────────────────────── */
@media print {
  .site-header, .site-footer, .scroll-progress, .reading-mode, .toc, .post-nav, .lab-embed, .hero-canvas { display: none !important; }
  body { background: #fff; color: #000; }
  html.js .reveal { opacity: 1; transform: none; }
}

/* ═══ Agents page: generic blocks ═══════════════════════════════════════ */
.blk-steps { display: grid; gap: 18px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); counter-reset: step; position: relative; }
.blk-step { position: relative; padding: 26px 22px 22px; }
.blk-step::after { content: "→"; position: absolute; right: -16px; top: 50%; transform: translateY(-50%); color: var(--accent); font-size: 1.3rem; z-index: 2; }
.blk-step:last-child::after { content: "↺"; right: 14px; top: 14px; transform: none; font-size: 1.2rem; opacity: .7; }
@media (max-width: 960px) { .blk-step::after { display: none; } }
.blk-step .pillar-icon { width: 48px; height: 48px; font-size: 1.5rem; margin-bottom: 14px; }
.blk-step-num { position: absolute; right: 18px; bottom: 10px; font: 700 3rem/1 var(--font-display); opacity: .06; }
.blk-step p { color: var(--muted); margin: 0; }
.blk-cards { display: grid; gap: 20px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); }
.blk-card { padding: 26px; }
.blk-card p { color: var(--muted); margin: 0; }
.blk-compare { display: grid; gap: 22px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); }
.blk-col { padding: 26px 28px; }
.blk-col.is-highlight { border-color: color-mix(in srgb, var(--accent) 55%, var(--border)); background: linear-gradient(160deg, var(--accent-soft), transparent 60%), var(--surface); }
.blk-col ul { list-style: none; padding: 0; margin: 14px 0 0; display: grid; gap: 10px; }
.blk-col li { position: relative; padding-left: 28px; color: var(--text-2); }
.blk-col li::before { content: "–"; position: absolute; left: 6px; color: var(--muted); }
.blk-col.is-highlight li::before { content: "✓"; color: var(--accent); font-weight: 700; }
.blk-note { margin-top: 22px; color: var(--muted); max-width: 860px; }
.blk-prose .table-wrap td:first-child { white-space: nowrap; }

/* ═══ Lab 8: agent flow ═══════════════════════════════════════════════ */
.af-question { display: flex; gap: 10px; align-items: flex-start; padding: 12px 16px; border-radius: 14px; background: var(--accent-soft); font-weight: 500; margin-bottom: 14px; }
.af-q-icon { font-size: 1.2rem; line-height: 1.2; }
.af-stage { border-radius: 16px; background: var(--bg); border: 1px solid var(--border); padding: 8px; }
@media (max-width: 640px) { .af-stage { padding: 2px; margin-inline: -6px; } .lab { padding: 14px; } .af-controls .lab-btn { padding: 8px 12px; } }
.af-svg { width: 100%; height: auto; overflow: visible; font-family: var(--font-sans); }
.af-band { fill: color-mix(in srgb, #a855f7 6%, transparent); stroke: color-mix(in srgb, #a855f7 45%, transparent); stroke-dasharray: 6 6; stroke-width: 1.5; }
.af-band-label { fill: #a855f7; font: 600 11px var(--font-mono); letter-spacing: .08em; text-transform: uppercase; }
.af-edge { fill: none; stroke: var(--border-strong); stroke-width: 2; stroke-dasharray: 5 6; transition: stroke .3s, stroke-width .3s; }
.af-edge.is-active { stroke: var(--c, var(--accent)); stroke-width: 3.5; stroke-dasharray: none; }
.af-box { fill: var(--surface); stroke: var(--border-strong); stroke-width: 1.5; transition: stroke .3s, fill .3s; }
.af-halo { fill: none; stroke: var(--accent); stroke-width: 2; opacity: 0; transition: opacity .3s; }
.af-node.is-active .af-halo { opacity: .55; animation: af-halo 1.6s ease-in-out infinite; }
.af-node.is-active .af-box { stroke: var(--accent); stroke-width: 2.2; }
@keyframes af-halo { 50% { opacity: .15; } }
.af-sub .af-box { fill: color-mix(in srgb, #f59e0b 7%, var(--surface)); }
.af-mcp .af-box { fill: color-mix(in srgb, #a855f7 7%, var(--surface)); }
[data-node="skill"] .af-box { fill: color-mix(in srgb, #f43f5e 7%, var(--surface)); }
[data-node="orch"] .af-box { fill: color-mix(in srgb, var(--accent) 9%, var(--surface)); }
.af-icon { font-size: 18px; }
.af-label { fill: var(--text); font-weight: 650; font-family: var(--font-display); }
.af-sub, .af-subtxt { fill: var(--muted); }
.af-subtxt { font-family: var(--font-mono); }
.af-subbar-bg { fill: var(--surface-2); }
.af-subbar { fill: #f59e0b; transition: width .7s var(--ease), fill .4s; }
.af-subbar.is-done { fill: var(--muted); opacity: .5; }
.af-kg-edge { stroke: var(--border-strong); stroke-width: 1.2; transition: opacity .4s; }
.af-kg-node { fill: var(--muted); transition: fill .3s, r .3s, opacity .4s; }
.af-kg-node.is-mem { fill: #14b8a6; }
.af-kg-node.is-hit { fill: #22c55e; }
.af-kg-node.is-new, .af-kg-edge.is-new { opacity: 0; }
.af-kg-node.is-new.is-shown, .af-kg-edge.is-new.is-shown { opacity: 1; }
.af-kg-node.is-new.is-shown { fill: #14b8a6; }
.af-kg-node.is-pulse { animation: af-pulse 1s ease-in-out 3; }
@keyframes af-pulse { 50% { r: 8; } }
.af-packet circle { fill: var(--c, var(--accent)); stroke: var(--bg); stroke-width: 2.5; }
.af-packet-pill { fill: var(--c, var(--accent)); }
.af-packet-text { fill: #fff; font-weight: 600; }
.af-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 14px 0 6px; }
.af-progress { display: flex; gap: 4px; margin-left: auto; flex-wrap: wrap; }
.af-progress i { width: 10px; height: 10px; border-radius: 50%; background: var(--border-strong); cursor: pointer; transition: background .3s, transform .3s; }
.af-progress i.done { background: color-mix(in srgb, var(--accent) 55%, transparent); }
.af-progress i.on { background: var(--accent); transform: scale(1.35); }
.af-caption { min-height: 92px; padding: 14px 16px; border-radius: 14px; border: 1px solid var(--border); background: var(--bg); }
.af-cap-head { display: flex; gap: 10px; align-items: center; margin-bottom: 6px; }
.af-step { font: 600 .72rem/1 var(--font-mono); color: var(--muted); text-transform: uppercase; letter-spacing: .08em; }
.af-tag { display: inline-block; padding: 4px 10px; border-radius: 999px; font: 600 .74rem/1.2 var(--font-mono); color: var(--c); background: color-mix(in srgb, var(--c) 14%, transparent); border: 1px solid color-mix(in srgb, var(--c) 40%, transparent); white-space: nowrap; }
.af-cap-text { margin: 0; color: var(--text-2); }
.af-msg { margin-top: 10px; }
.af-msg summary { cursor: pointer; font: 600 .78rem/1.2 var(--font-mono); color: var(--muted); }
.af-msg pre, .cw-example { margin: 8px 0 0; padding: 12px 14px; border-radius: 10px; background: var(--code-bg); color: var(--code-text); font: .8rem/1.55 var(--font-mono); white-space: pre-wrap; word-break: break-word; overflow-x: auto; }
.af-ctx { margin-top: 16px; }
.af-ctx-head { display: flex; justify-content: space-between; gap: 10px; font: 600 .76rem/1.2 var(--font-mono); color: var(--muted); text-transform: uppercase; letter-spacing: .06em; margin-bottom: 8px; }
.af-ctx-bar { display: flex; height: 30px; border-radius: 9px; background: var(--surface-2); overflow: hidden; border: 1px solid var(--border); }
.af-ctx-bar span { display: flex; align-items: center; overflow: hidden; height: 100%; transition: width .8s var(--ease); border-right: 1px solid rgba(0,0,0,.25); }
.af-ctx-bar span em { font: 600 .68rem/1 var(--font-sans); font-style: normal; color: #fff; white-space: nowrap; padding: 0 6px; text-shadow: 0 1px 2px rgba(0,0,0,.35); }
.af-ctx-bar span.is-new { animation: af-flash 1.2s ease-in-out 2; }
@keyframes af-flash { 50% { filter: brightness(1.35); } }
.af-ctx-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 8px; font-size: .78rem; color: var(--muted); }
.af-ctx-legend span { display: inline-flex; align-items: center; gap: 6px; }
.af-ctx-legend span.is-new { color: var(--text); font-weight: 600; }
.af-ctx-legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.af-ctx-legend small { font-family: var(--font-mono); opacity: .8; }
.af-log { list-style: none; counter-reset: log; margin: 16px 0 0; padding: 0; display: grid; gap: 6px; max-height: 260px; overflow: auto; }
.af-log li { counter-increment: log; display: flex; align-items: center; gap: 10px; padding: 6px 10px; border-radius: 10px; font-size: .86rem; color: var(--muted); cursor: pointer; }
.af-log li::before { content: counter(log); font: 600 .72rem/1 var(--font-mono); width: 1.6em; text-align: right; }
.af-log li:hover { background: var(--accent-soft); }
.af-log li.is-current { background: var(--accent-soft); color: var(--text); }

/* ═══ Lab 9: context window ═══════════════════════════════════════════ */
.cw-gauge-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 12px; margin-bottom: 10px; }
.cw-limit select { min-width: 210px; }
.cw-total { font: 500 .9rem/1.3 var(--font-mono); color: var(--muted); }
.cw-total b { color: var(--text); font-size: 1.1rem; }
.cw-bad { color: var(--sec-news-radar); font-weight: 700; }
.cw-gauge { position: relative; height: 54px; border-radius: 12px; background: repeating-linear-gradient(90deg, var(--surface-2) 0 calc(10% - 1px), var(--border) calc(10% - 1px) 10%); border: 1px solid var(--border-strong); overflow: hidden; }
.cw-gauge.is-over { border-color: var(--sec-news-radar); box-shadow: 0 0 0 3px color-mix(in srgb, var(--sec-news-radar) 25%, transparent); }
.cw-gauge-fill { display: flex; height: 100%; }
.cw-gauge-fill button { all: unset; box-sizing: border-box; height: 100%; display: flex; align-items: center; overflow: hidden; cursor: pointer; transition: width .6s var(--ease), filter .2s; border-right: 1px solid rgba(0,0,0,.25); }
.cw-gauge-fill button span { color: #fff; font: 600 .7rem/1.1 var(--font-sans); padding: 0 6px; white-space: nowrap; text-shadow: 0 1px 2px rgba(0,0,0,.35); }
.cw-gauge-fill button.is-narrow span { display: none; }
.cw-gauge-fill button:hover, .cw-gauge-fill button.is-sel { filter: brightness(1.18); box-shadow: inset 0 0 0 2px #fff; }
.cw-overflow { position: absolute; right: 0; top: 0; bottom: 0; display: grid; place-items: center; padding: 0 12px; background: repeating-linear-gradient(45deg, var(--sec-news-radar) 0 8px, color-mix(in srgb, var(--sec-news-radar) 70%, #000) 8px 16px); color: #fff; font: 700 .8rem/1 var(--font-mono); }
.cw-cache { position: relative; height: 26px; margin-top: 4px; }
.cw-cache::before { content: ""; position: absolute; left: 0; top: 2px; width: var(--w, 0%); height: 8px; border: 2px solid #64748b; border-top: 0; border-radius: 0 0 8px 8px; transition: width .6s var(--ease); }
.cw-cache span { position: absolute; left: 0; top: 10px; font: 600 .68rem/1.4 var(--font-mono); color: var(--muted); white-space: nowrap; }
.cw-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 22px; margin: 10px 0 16px; }
.cw-turns { flex: 1 1 260px; }
.cw-buttons { display: flex; gap: 8px; flex-wrap: wrap; }
.cw-switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-size: .9rem; font-weight: 500; }
.cw-switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.cw-knob { width: 42px; height: 24px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border-strong); position: relative; flex: none; transition: background .2s; }
.cw-knob::after { content: ""; position: absolute; left: 3px; top: 3px; width: 16px; height: 16px; border-radius: 50%; background: var(--muted); transition: transform .25s var(--ease), background .2s; }
.cw-switch input:checked + .cw-knob { background: var(--accent); border-color: var(--accent); }
.cw-switch input:checked + .cw-knob::after { transform: translateX(18px); background: #fff; }
.cw-switch input:focus-visible + .cw-knob { outline: 2px solid var(--accent); outline-offset: 2px; }
.cw-switch small { display: block; font-size: .74rem; color: var(--muted); font-weight: 400; }
.cw-alert { padding: 14px 16px; margin-bottom: 16px; border-radius: 12px; border: 1px solid color-mix(in srgb, var(--sec-news-radar) 50%, transparent); background: color-mix(in srgb, var(--sec-news-radar) 10%, transparent); }
.cw-alert p { margin: 6px 0 0; color: var(--text-2); font-size: .9rem; }
.cw-main { display: grid; gap: 16px; grid-template-columns: 1fr; }
@media (min-width: 860px) { .cw-main { grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); } .cw-preview { position: sticky; top: calc(var(--header-h) + 70px); align-self: start; } }
.cw-stack { display: grid; gap: 12px; }
.cw-group { position: relative; padding: 8px 10px 10px; border-radius: 14px; border: 1px dashed var(--border-strong); }
.cw-group.is-static { border-color: #64748b; background: color-mix(in srgb, #64748b 6%, transparent); }
.cw-group-label { margin: 0 0 6px 4px; font: 600 .7rem/1 var(--font-mono); text-transform: uppercase; letter-spacing: .1em; color: var(--muted); }
.cw-block { display: flex; align-items: stretch; gap: 6px; margin-top: 6px; min-height: var(--h, 40px); border-radius: 10px; background: color-mix(in srgb, var(--c) 16%, var(--surface)); border: 1px solid color-mix(in srgb, var(--c) 45%, transparent); border-left: 6px solid var(--c); transition: min-height .5s var(--ease), opacity .3s, filter .3s; overflow: hidden; }
.cw-block.is-off { opacity: .38; filter: grayscale(.8); min-height: 34px; }
.cw-block.is-sel { box-shadow: 0 0 0 2px var(--c); }
.cw-block-main { all: unset; box-sizing: border-box; flex: 1; display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 8px 10px; cursor: pointer; }
.cw-block-main:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.cw-block-label { font-weight: 600; font-size: .9rem; color: var(--text); }
.cw-block-tok { font: 500 .76rem/1 var(--font-mono); color: var(--muted); white-space: nowrap; }
.cw-lock { display: grid; place-items: center; padding: 0 10px; font-size: .8rem; opacity: .6; }
.cw-toggle { display: grid; place-items: center; padding: 0 10px; cursor: pointer; }
.cw-toggle input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.cw-toggle span[aria-hidden] { width: 34px; height: 20px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border-strong); position: relative; }
.cw-toggle span[aria-hidden]::after { content: ""; position: absolute; left: 2px; top: 2px; width: 14px; height: 14px; border-radius: 50%; background: var(--muted); transition: transform .2s; }
.cw-toggle input:checked + span[aria-hidden] { background: var(--c); border-color: var(--c); }
.cw-toggle input:checked + span[aria-hidden]::after { transform: translateX(14px); background: #fff; }
.cw-toggle input:focus-visible + span[aria-hidden] { outline: 2px solid var(--accent); outline-offset: 2px; }
.cw-prev-head { display: flex; align-items: center; gap: 10px; margin: 0 0 4px; font-size: 1.05rem; }
.cw-prev-head i { width: 14px; height: 14px; border-radius: 4px; }
.cw-prev-meta { font: 500 .78rem/1.4 var(--font-mono); color: var(--muted); margin-bottom: 10px; }

/* ═══ "Frag Marvin" chat ═══════════════════════════════════════════════ */
.mc-fab { position: fixed; right: max(16px, env(safe-area-inset-right)); bottom: max(16px, env(safe-area-inset-bottom)); z-index: 70; display: inline-flex; align-items: center; gap: 10px; padding: 6px 18px 6px 6px; border-radius: 999px; border: 1px solid var(--border-strong); background: var(--surface-solid); color: var(--text); font-weight: 600; font-size: .95rem; cursor: pointer; box-shadow: var(--shadow-lg); transition: transform .25s var(--ease), border-color .2s; }
.mc-fab:hover { transform: translateY(-2px); border-color: var(--accent); }
.mc-fab img { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; object-position: 50% 20%; background: var(--surface-2); }
.mc-fab.is-open { transform: scale(.92); opacity: .0; pointer-events: none; }
@media (max-width: 640px) { .mc-fab { padding: 5px; } .mc-fab-label { display: none; } }
.mc-panel { position: fixed; right: max(16px, env(safe-area-inset-right)); bottom: max(16px, env(safe-area-inset-bottom)); z-index: 71; width: min(420px, calc(100vw - 32px)); height: min(640px, calc(100vh - 100px)); display: flex; flex-direction: column; border-radius: 20px; border: 1px solid var(--border-strong); background: var(--surface-solid); box-shadow: var(--shadow-lg); overflow: hidden; opacity: 0; transform: translateY(16px) scale(.98); transform-origin: bottom right; transition: opacity .22s var(--ease), transform .22s var(--ease); }
.mc-panel.is-open { opacity: 1; transform: none; }
@media (max-width: 640px) { .mc-panel { inset: 0; width: 100%; height: 100%; height: 100dvh; border-radius: 0; border: 0; } }
.mc-head { display: flex; align-items: center; gap: 12px; padding: 12px 12px 12px 14px; border-bottom: 1px solid var(--border); background: linear-gradient(120deg, color-mix(in srgb, var(--sec-marvin) 22%, transparent), transparent 70%); }
.mc-avatar { width: 42px; height: 42px; border-radius: 50%; object-fit: cover; object-position: 50% 20%; flex: none; }
.mc-id { flex: 1; min-width: 0; display: grid; }
.mc-id strong { font-family: var(--font-display); font-size: 1.05rem; }
.mc-id small { color: var(--muted); font-size: .8rem; }
.mc-icon { width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--border); background: transparent; color: var(--text-2); cursor: pointer; font-size: .95rem; }
.mc-icon:hover { border-color: var(--accent); color: var(--accent); }
.mc-log { flex: 1; overflow-y: auto; padding: 16px 14px; display: flex; flex-direction: column; gap: 12px; overscroll-behavior: contain; }
.mc-msg { display: flex; gap: 8px; align-items: flex-end; max-width: 100%; }
.mc-msg img { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; object-position: 50% 20%; flex: none; }
.mc-bubble { padding: 10px 14px; border-radius: 16px; font-size: .93rem; line-height: 1.55; max-width: 85%; overflow-wrap: anywhere; }
.mc-bubble p { margin: 0 0 .6em; } .mc-bubble p:last-child { margin-bottom: 0; }
.mc-bubble ul, .mc-bubble ol { margin: .2em 0 .6em; padding-left: 1.2em; }
.mc-bubble code { font: .85em var(--font-mono); background: var(--accent-soft); padding: .1em .35em; border-radius: 5px; }
.mc-bubble pre { background: var(--code-bg); color: var(--code-text); padding: 10px; border-radius: 10px; overflow-x: auto; }
.mc-bubble pre code { background: none; padding: 0; }
.mc-assistant .mc-bubble { background: var(--surface-2); border: 1px solid var(--border); border-bottom-left-radius: 4px; }
.mc-user { justify-content: flex-end; }
.mc-user .mc-bubble { background: var(--accent); color: var(--on-accent); border-bottom-right-radius: 4px; }
.mc-msg.is-error .mc-bubble { border-color: color-mix(in srgb, var(--sec-news-radar) 55%, transparent); background: color-mix(in srgb, var(--sec-news-radar) 10%, var(--surface-2)); }
.mc-thinking { color: var(--muted); font-style: italic; animation: mc-pulse 1.4s ease-in-out infinite; }
@keyframes mc-pulse { 50% { opacity: .45; } }
.mc-caret { display: inline-block; width: .5em; height: 1em; margin-left: 2px; vertical-align: -.15em; background: var(--accent); animation: blink 1s steps(1) infinite; }
.mc-notice { margin: 0 14px 12px; padding: 14px; border-radius: 14px; border: 1px dashed var(--border-strong); background: var(--bg); font-size: .86rem; color: var(--text-2); display: grid; gap: 12px; }
.mc-notice p { margin: 0; }
.mc-suggest { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 14px 10px; }
.mc-suggest .chip { font-size: .8rem; text-align: left; white-space: normal; }
.mc-form { display: flex; align-items: flex-end; gap: 8px; padding: 10px 12px; border-top: 1px solid var(--border); }
.mc-form textarea { flex: 1; resize: none; max-height: 140px; padding: 10px 14px; border-radius: 16px; border: 1px solid var(--border-strong); background: var(--bg); color: var(--text); font: inherit; font-size: .95rem; line-height: 1.4; outline: none; }
.mc-form textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.mc-send { width: 42px; height: 42px; flex: none; border-radius: 50%; border: 0; background: var(--grad); color: #fff; font-size: 1rem; cursor: pointer; }
.mc-send.is-stop { background: var(--sec-news-radar); }
.mc-foot { margin: 0; padding: 0 14px 10px; font-size: .72rem; color: var(--muted); text-align: center; }
@media print { .mc-fab, .mc-panel { display: none !important; } }
.mc-panel[hidden], .mc-panel [hidden] { display: none !important; }
