/* Structure, motion and interaction patterns adapted from Portfolio-Showcase-Website
   by Muhammad Hammas Rasheed (MIT), see THIRD_PARTY_LICENSES.md.

   Colors are "R G B" triplets used as rgb(var(--x) / alpha). Light is the bare :root.
   Dark is Moonshine's night palette: deep slate ground, warm nacre text, sea-blue
   accent. Same three-state pattern as Moonshine: no data-theme = follow the OS,
   an explicit data-theme always wins. */

:root {
  color-scheme: light;
  --bg: 244 242 237;
  --bg-elevated: 252 251 248;
  --bg-elevated-2: 235 232 225;
  --text: 30 40 50;
  --text-dim: 74 84 95;
  --text-dimmer: 96 104 113;
  --accent: 31 102 132;
  --on-accent: 252 251 248;
  --glow: 110 147 173;
  --success: 63 107 69;
  --error: 176 74 63;
  --line: 30 40 50;
  --grain: 0;
  --show-sun: none;
  --show-moon: block;

  --font-display: 'Bricolage Grotesque', system-ui, sans-serif;
  --font-body: 'Inter', system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', Consolas, monospace;

  --fs-hero: clamp(3rem, min(9vw, 14vh), 8rem);
  --fs-h1: clamp(2.2rem, min(5vw, 8vh), 4.25rem);
  --fs-h2: clamp(1.7rem, min(3.2vw, 5.6vh), 2.9rem);
  --fs-h3: clamp(1.15rem, 1.7vw, 1.55rem);
  --fs-lg: clamp(1.02rem, min(1.25vw, 2.2vh), 1.25rem);
  --fs-body: 1rem;
  --fs-sm: 0.875rem;
  --fs-xs: 0.75rem;

  --space-3xs: 0.25rem;
  --space-2xs: 0.5rem;
  --space-xs: 0.75rem;
  --space-sm: 1rem;
  --space-md: 1.5rem;
  --space-lg: 2.5rem;
  --space-xl: 4rem;
  --space-2xl: 6rem;
  --space-3xl: 9rem;

  --container-max: 1400px;
  --container-pad: clamp(1.25rem, 5vw, 4rem);
  --header-h: 84px;
  --radius-sm: 8px;
  --radius-md: 16px;
  --radius-lg: 28px;
  --radius-full: 999px;

  --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-out-quart: cubic-bezier(0.25, 1, 0.5, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --ease-smooth: cubic-bezier(0.65, 0.05, 0.36, 1);
  --dur-fast: 0.25s;
  --dur-base: 0.5s;
  --dur-slow: 0.9s;
  --ease-press: cubic-bezier(0.2, 0, 0, 1);
  --dur-press: 150ms;
  --ease-exit: cubic-bezier(0.32, 0, 0.67, 0);
  --dur-exit: 200ms;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: 23 29 36;
    --bg-elevated: 31 38 46;
    --bg-elevated-2: 38 47 57;
    --text: 236 230 218;
    --text-dim: 176 184 192;
    --text-dimmer: 150 160 170;
    --accent: 143 178 201;
    --on-accent: 23 29 36;
    --glow: 156 192 214;
    --success: 111 161 115;
    --error: 217 123 109;
    --line: 236 230 218;
    --grain: 0.035;
    --show-sun: block;
    --show-moon: none;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: 23 29 36;
  --bg-elevated: 31 38 46;
  --bg-elevated-2: 38 47 57;
  --text: 236 230 218;
  --text-dim: 176 184 192;
  --text-dimmer: 150 160 170;
  --accent: 143 178 201;
  --on-accent: 23 29 36;
  --glow: 156 192 214;
  --success: 111 161 115;
  --error: 217 123 109;
  --line: 236 230 218;
  --grain: 0.035;
  --show-sun: block;
  --show-moon: none;
}

@media (prefers-reduced-motion: reduce) {
  :root { --dur-fast: 0.01s; --dur-base: 0.01s; --dur-slow: 0.01s; }
}

/* ---- Reset ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body { line-height: 1.5; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; overflow-x: clip; }
img, picture, svg, video, canvas { display: block; max-width: 100%; }
input, button, textarea, select { font: inherit; color: inherit; }
button { background: none; border: none; cursor: pointer; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }
h1, h2, h3, h4 { font-weight: inherit; font-size: inherit; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ---- Base ---- */
body {
  background-color: rgb(var(--bg));
  color: rgb(var(--text));
  font-family: var(--font-body);
  font-size: var(--fs-body);
  transition: background-color var(--dur-base) ease, color var(--dur-base) ease;
}

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

::-webkit-scrollbar { width: 10px; }
::-webkit-scrollbar-track { background: rgb(var(--bg)); }
::-webkit-scrollbar-thumb { background: rgb(var(--bg-elevated-2)); border-radius: var(--radius-full); border: 2px solid rgb(var(--bg)); }

h1, h2, h3, h4 { font-family: var(--font-display); letter-spacing: -0.02em; line-height: 1.05; text-wrap: balance; }
p { color: rgb(var(--text-dim)); }

.container { width: 100%; max-width: var(--container-max); margin-inline: auto; padding-inline: var(--container-pad); }

.page { position: relative; padding-block: var(--space-3xl); background: rgb(var(--bg)); }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2xs);
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgb(var(--accent));
  margin-bottom: var(--space-sm);
}
.eyebrow::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgb(var(--accent));
  box-shadow: 0 0 12px 2px rgb(var(--accent) / 0.8);
}

.section-heading { font-size: var(--fs-h2); font-weight: 600; max-width: 20ch; }

.split-line { overflow: hidden; display: inline-block; vertical-align: top; }
.split-word, .split-char { display: inline-block; will-change: transform; }
.reveal { opacity: 1; }

.skip-link {
  position: fixed;
  top: -100px;
  left: var(--space-md);
  z-index: 10000;
  background: rgb(var(--accent));
  color: rgb(var(--on-accent));
  padding: var(--space-2xs) var(--space-sm);
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: var(--fs-sm);
  transition: top var(--dur-press) var(--ease-press);
}
.skip-link:focus { top: var(--space-md); }

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

/* ---- Scroll progress + grain ---- */
.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: rgb(var(--accent));
  transform: scaleX(0);
  transform-origin: left center;
  z-index: 950;
  pointer-events: none;
  box-shadow: 0 0 12px 1px rgb(var(--accent) / 0.4);
}

.grain-overlay {
  position: fixed;
  inset: 0;
  z-index: 5000;
  pointer-events: none;
  opacity: var(--grain);
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ---- Header / nav ---- */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 800;
  height: var(--header-h);
  display: flex;
  align-items: center;
  transition: transform var(--dur-base) var(--ease-out-quart);
}
/* Frosted fill on a pseudo-element: backdrop-filter on the header itself would
   become the containing block of the fixed mobile menu inside it. */
.site-header::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  opacity: 0;
  background: rgb(var(--bg) / 0.78);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid rgb(var(--line) / 0.09);
  transition: opacity var(--dur-base) var(--ease-out-quart);
}
.site-header.is-scrolled::before { opacity: 1; }
.site-header.is-hidden { transform: translateY(-100%); }

.site-header__inner { display: flex; align-items: center; justify-content: space-between; gap: var(--space-md); }
.site-header__actions { display: flex; align-items: center; gap: var(--space-xs); }

.logo { font-family: var(--font-display); font-weight: 600; font-size: 1.2rem; letter-spacing: -0.02em; display: flex; align-items: center; gap: 0.5em; white-space: nowrap; }
.logo__dot { width: 8px; height: 8px; border-radius: 50%; background: rgb(var(--accent)); box-shadow: 0 0 10px 2px rgb(var(--accent) / 0.8); }

.nav-list { display: flex; gap: clamp(1rem, 2.2vw, 2.5rem); align-items: center; }
.nav-list a { font-family: var(--font-mono); font-size: var(--fs-sm); color: rgb(var(--text-dim)); position: relative; padding-block: 4px; white-space: nowrap; }
.nav-list a::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 1px;
  background: rgb(var(--accent));
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform var(--dur-press) var(--ease-press);
}
.nav-list a:hover, .nav-list a:focus-visible, .nav-list a.is-active { color: rgb(var(--text)); }
.nav-list a:hover::after, .nav-list a:focus-visible::after, .nav-list a.is-active::after { transform: scaleX(1); }

.theme-toggle {
  width: 2.75em;
  height: 2.75em;
  border-radius: 50%;
  border: 1px solid rgb(var(--line) / 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgb(var(--text));
  transition: border-color var(--dur-press), background-color var(--dur-press);
}
.theme-toggle:hover { border-color: rgb(var(--accent)); }
.theme-toggle__sun { display: var(--show-sun); }
.theme-toggle__moon { display: var(--show-moon); }

.nav-toggle { display: none; flex-direction: column; gap: 5px; padding: 10px; z-index: 900; }
.nav-toggle span { width: 22px; height: 2px; background: rgb(var(--text)); transition: transform var(--dur-press) var(--ease-press), opacity var(--dur-press); }
.nav-toggle.is-open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle.is-open span:nth-child(2) { opacity: 0; }
.nav-toggle.is-open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Below 1024px the inline links give way to the toggle and the full-screen menu (end of file). */
@media (max-width: 1023px) {
  .nav-toggle { display: flex; }
  .nav-list { display: none; }
}
@media (max-width: 559px) {
  .site-header .nav-cta { display: none; }
}

.no-scroll { overflow: hidden; }

/* ---- Buttons ---- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2xs);
  font-family: var(--font-mono);
  font-size: var(--fs-sm);
  letter-spacing: 0.02em;
  padding: 0.9em 1.7em;
  border-radius: var(--radius-full);
  position: relative;
  white-space: nowrap;
  transition: transform var(--dur-press) var(--ease-press), background-color var(--dur-press), border-color var(--dur-press), color var(--dur-press);
}
.btn:active { transform: scale(0.95); }
.btn-primary { background: rgb(var(--accent)); color: rgb(var(--on-accent)); font-weight: 600; }
.btn-primary:hover { background: rgb(var(--text)); color: rgb(var(--bg)); }
.btn-ghost { border: 1px solid rgb(var(--line) / 0.2); color: rgb(var(--text)); }
.btn-ghost:hover { border-color: rgb(var(--accent)); color: rgb(var(--accent)); }

.scroll-top-btn {
  position: fixed;
  right: var(--space-md);
  bottom: var(--space-md);
  z-index: 800;
  width: 3em;
  height: 3em;
  border-radius: 50%;
  background: rgb(var(--bg-elevated));
  border: 1px solid rgb(var(--line) / 0.2);
  color: rgb(var(--text));
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none;
  transition: opacity var(--dur-base) var(--ease-out-quart), transform var(--dur-base) var(--ease-out-quart), border-color var(--dur-press);
}
.scroll-top-btn.is-visible { opacity: 1; transform: translateY(0); pointer-events: auto; }
.scroll-top-btn:hover { border-color: rgb(var(--accent)); }

/* ---- Preloader (once per session, see script.js) ---- */
.preloader { display: none; }
.js .preloader {
  position: fixed;
  inset: 0;
  z-index: 9000;
  background: rgb(var(--bg-elevated));
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: var(--space-md);
  /* Failsafe: never trap the page if script.js fails to run. */
  animation: preloader-failsafe 0s linear 6s forwards;
}
@keyframes preloader-failsafe { to { visibility: hidden; } }
.preloader__mark { font-family: var(--font-display); font-weight: 700; font-size: clamp(1.5rem, 4vw, 2.5rem); letter-spacing: -0.02em; }
.preloader__counter { font-family: var(--font-mono); font-size: var(--fs-sm); color: rgb(var(--text-dim)); min-width: 4ch; text-align: center; }
.preloader__bar-track { width: min(280px, 60vw); height: 2px; background: rgb(var(--line) / 0.2); overflow: hidden; border-radius: var(--radius-full); }
.preloader__bar-fill { height: 100%; width: 0%; background: rgb(var(--accent)); }

/* ---- Hero ---- */
.hero {
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding-block: calc(var(--header-h) + var(--space-md)) var(--space-2xl);
  overflow: hidden;
}
.hero__canvas-wrap { position: absolute; inset: 0; z-index: 0; }
#hero-canvas { width: 100%; height: 100%; }
.hero::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 80% 60% at 50% 40%, transparent 0%, rgb(var(--bg)) 78%);
  pointer-events: none;
  z-index: 1;
}
.hero__content { position: relative; z-index: 10; display: flex; flex-direction: column; align-items: flex-start; gap: var(--space-xl); }
@media (min-width: 900px) {
  .hero__content { flex-direction: row; justify-content: space-between; align-items: center; }
}
.hero__text { min-width: 0; }

.hero__eyebrow { display: flex; align-items: center; gap: var(--space-sm); margin-bottom: var(--space-md); font-family: var(--font-mono); font-size: var(--fs-sm); color: rgb(var(--text-dim)); }
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: rgb(var(--success)); box-shadow: 0 0 10px 2px rgb(var(--success) / 0.7); animation: pulse-dot 2s ease-in-out infinite; }
@keyframes pulse-dot { 0%, 100% { opacity: 1; } 50% { opacity: 0.4; } }

.hero__title { font-size: var(--fs-hero); font-weight: 600; text-transform: uppercase; line-height: 1; }
.hero__title .line { display: block; }
/* Stroke under a fill in the page color: only its outer half shows, so the variable font's
   overlapping contours don't draw lines through the letters. */
.hero__title .line--accent { -webkit-text-stroke: 3px rgb(var(--text)); color: rgb(var(--bg)); paint-order: stroke fill; }

.hero__subtitle { margin-top: var(--space-md); max-width: 44ch; font-size: var(--fs-lg); }

.hero__meta { display: flex; flex-wrap: wrap; gap: var(--space-md) var(--space-lg); margin-top: var(--space-md); }
.hero__meta-item { font-family: var(--font-mono); font-size: var(--fs-xs); color: rgb(var(--text-dimmer)); text-transform: uppercase; letter-spacing: 0.08em; }
.hero__meta-item strong { display: block; font-family: var(--font-display); font-size: var(--fs-h3); font-weight: 600; color: rgb(var(--text)); text-transform: none; letter-spacing: -0.01em; margin-top: 4px; }

.hero__actions { display: flex; gap: var(--space-sm); margin-top: var(--space-md); flex-wrap: wrap; }

.hero__photo { position: relative; flex-shrink: 0; align-self: center; aspect-ratio: 3 / 4; height: clamp(240px, 42vh, 360px); }
@media (min-width: 900px) {
  .hero__photo { height: clamp(260px, 56vh, 540px); }
}
.hero__photo-glow {
  position: absolute;
  inset: -16%;
  background: radial-gradient(circle, rgb(var(--glow) / 0.35) 0%, transparent 70%);
  filter: blur(28px);
  z-index: 0;
  pointer-events: none;
}
.hero__photo-frame { position: relative; z-index: 1; height: 100%; border-radius: var(--radius-lg); overflow: hidden; border: 1px solid rgb(var(--line) / 0.2); }
.hero__photo-frame img { width: 100%; height: 100%; object-fit: cover; }

.hero__scroll-cue {
  position: absolute;
  bottom: var(--space-md);
  left: 50%;
  transform: translateX(-50%);
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-2xs);
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  color: rgb(var(--text-dimmer));
  text-transform: uppercase;
  letter-spacing: 0.1em;
}
.hero__scroll-cue-line { width: 1px; height: 40px; background: rgb(var(--text-dimmer) / 0.5); position: relative; overflow: hidden; }
.hero__scroll-cue-line::after {
  content: '';
  position: absolute;
  top: -100%;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgb(var(--accent));
  animation: scroll-cue-flow 1.8s ease-in-out infinite;
}
@keyframes scroll-cue-flow { 0% { top: -100%; } 60%, 100% { top: 100%; } }

/* ---- Ambient blobs (static until script.js drifts them) ---- */
.ambient-blob, .contact__blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  pointer-events: none;
  z-index: 0;
}
.ambient-blob { width: min(38vw, 420px); height: min(38vw, 420px); opacity: 0.14; }
.ambient-blob--a { background: rgb(var(--glow)); top: -6%; right: -8%; }
.ambient-blob--b { background: rgb(var(--accent)); bottom: -14%; left: -10%; }
.about .container, .skills .container, .timeline .container, .education .container { position: relative; z-index: 1; }

/* ---- About ---- */
.about { overflow: hidden; }
.about__grid { display: grid; grid-template-columns: 1fr; gap: var(--space-xl); }
@media (min-width: 960px) {
  .about__grid { grid-template-columns: 0.85fr 1.15fr; align-items: center; }
}
.about__facts { display: grid; gap: var(--space-sm); margin-top: var(--space-lg); padding-top: var(--space-md); border-top: 1px solid rgb(var(--line) / 0.09); }
.about__facts dt { font-family: var(--font-mono); font-size: var(--fs-xs); color: rgb(var(--accent)); text-transform: uppercase; letter-spacing: 0.1em; }
.about__facts dd { color: rgb(var(--text-dim)); margin-top: 2px; }
.about__body p { font-size: var(--fs-lg); line-height: 1.6; color: rgb(var(--text)); max-width: 58ch; margin-bottom: var(--space-sm); }

.about__stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--space-md); margin-top: var(--space-lg); padding-top: var(--space-md); border-top: 1px solid rgb(var(--line) / 0.09); }
@media (min-width: 1200px) {
  .about__stats { grid-template-columns: repeat(4, 1fr); }
}
.stat-number { font-family: var(--font-display); font-size: var(--fs-h1); font-weight: 600; line-height: 1; display: flex; align-items: baseline; gap: 2px; }
.stat-number > span:not(.odometer) { color: rgb(var(--accent)); }
.stat-label { font-family: var(--font-mono); font-size: var(--fs-xs); color: rgb(var(--text-dimmer)); text-transform: uppercase; letter-spacing: 0.08em; margin-top: var(--space-2xs); }

/* Odometer counters: one clipped digit reel per digit, sized in em. */
.odometer { display: inline-flex; }
.odometer__digit { position: relative; overflow: hidden; height: 1em; width: 0.62em; }
.odometer__strip { position: absolute; top: 0; left: 0; display: flex; flex-direction: column; }
.odometer__strip span { height: 1em; line-height: 1; display: flex; align-items: baseline; justify-content: center; }

/* ---- Skills constellation ---- */
.skills { overflow: hidden; }
.skills__header { display: flex; justify-content: space-between; align-items: flex-end; flex-wrap: wrap; gap: var(--space-md); margin-bottom: var(--space-lg); }
.skills__note { max-width: 40ch; }
.skills__constellation {
  position: relative;
  height: clamp(420px, 58vh, 600px);
  border: 1px solid rgb(var(--line) / 0.09);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background:
    radial-gradient(circle at 20% 20%, rgb(var(--glow) / 0.08), transparent 45%),
    radial-gradient(circle at 80% 75%, rgb(var(--accent) / 0.06), transparent 45%);
}
.skills__constellation-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgb(var(--line) / 0.07) 1px, transparent 1px),
    linear-gradient(90deg, rgb(var(--line) / 0.07) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(circle at center, black 0%, transparent 75%);
}
.skills__lines { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.skills__line { stroke: rgb(var(--accent)); stroke-width: 0.15; opacity: 0.45; }

/* The node is a zero-size anchor at its left/top point; scaling it scales around the dot. */
.skill-node { position: absolute; width: 0; height: 0; transform-origin: 0 0; }
.skill-node__inner {
  position: absolute;
  left: 0;
  top: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  transform: translate(-50%, calc(var(--node-size, 58px) / -2));
}
.skill-node__dot {
  width: var(--node-size, 58px);
  height: var(--node-size, 58px);
  border-radius: 50%;
  background: rgb(var(--bg-elevated));
  border: 1px solid rgb(var(--line) / 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.85rem;
  color: rgb(var(--text));
}
.skill-node[data-tier="core"] .skill-node__dot { border-color: rgb(var(--accent)); box-shadow: 0 0 24px -4px rgb(var(--accent) / 0.45); }
.skill-node__label { font-family: var(--font-mono); font-size: var(--fs-xs); color: rgb(var(--text-dim)); white-space: nowrap; background: rgb(var(--bg) / 0.72); padding: 1px 8px; border-radius: var(--radius-full); }

.skills__grid-fallback { display: none; grid-template-columns: repeat(2, 1fr); gap: var(--space-sm); }
@media (max-width: 899px) {
  .skills__constellation { display: none; }
  .skills__grid-fallback { display: grid; }
}
@media (min-width: 520px) and (max-width: 899px) {
  .skills__grid-fallback { grid-template-columns: repeat(3, 1fr); }
}
.skill-chip { border: 1px solid rgb(var(--line) / 0.09); border-radius: var(--radius-md); padding: var(--space-md) var(--space-sm); text-align: center; }
.skill-chip[data-tier="core"] { border-color: rgb(var(--accent)); }
.skill-chip__name { font-family: var(--font-display); font-weight: 600; }
.skill-chip__cat { display: block; font-family: var(--font-mono); font-size: var(--fs-xs); color: rgb(var(--text-dimmer)); margin-top: 4px; }

/* ---- Work ---- */
.projects__header { display: flex; justify-content: space-between; align-items: flex-end; flex-wrap: wrap; gap: var(--space-md); margin-bottom: var(--space-xl); }
.projects__count { font-family: var(--font-mono); font-size: var(--fs-sm); color: rgb(var(--text-dimmer)); }
.project-list { display: grid; grid-template-columns: 1fr; gap: var(--space-lg); }
@media (min-width: 640px) {
  .project-list { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 1100px) {
  .project-list { grid-template-columns: repeat(3, 1fr); }
}
.project-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
  padding: var(--space-md);
  border: 1px solid rgb(var(--line) / 0.09);
  border-radius: var(--radius-lg);
  background: rgb(var(--bg-elevated));
  cursor: pointer;
  transition: border-color var(--dur-press) var(--ease-press);
}
.project-card:hover, .project-card:focus-visible { border-color: rgb(var(--accent) / 0.6); }
.project-card__media { position: relative; aspect-ratio: 16 / 10; border-radius: var(--radius-md); overflow: hidden; background: rgb(var(--bg)); border: 1px solid rgb(var(--line) / 0.07); }
.project-card__index { position: absolute; top: var(--space-sm); right: var(--space-sm); z-index: 2; font-family: var(--font-mono); font-size: var(--fs-xs); color: rgb(var(--text)); background: rgb(var(--bg-elevated) / 0.85); padding: 4px 10px; border-radius: var(--radius-full); }
.project-card__body { display: flex; flex-direction: column; gap: var(--space-xs); flex: 1; }
.project-card__tags, .project-detail__stack { display: flex; gap: var(--space-2xs); flex-wrap: wrap; }
.project-card__tags span { font-family: var(--font-mono); font-size: var(--fs-xs); color: rgb(var(--accent)); border: 1px solid rgb(var(--accent) / 0.35); padding: 3px 10px; border-radius: var(--radius-full); }
.project-card__title { font-size: var(--fs-h3); font-weight: 600; display: flex; align-items: flex-start; justify-content: space-between; gap: var(--space-sm); }
.project-card__arrow { flex-shrink: 0; display: inline-flex; color: rgb(var(--accent)); transition: transform var(--dur-press) var(--ease-press); }
.project-card:hover .project-card__arrow { transform: translate(4px, -4px); }
.project-card__desc { flex: 1; font-size: var(--fs-sm); line-height: 1.55; }
.project-card__footer { display: flex; gap: var(--space-sm); flex-wrap: wrap; padding-top: var(--space-xs); border-top: 1px solid rgb(var(--line) / 0.09); font-family: var(--font-mono); font-size: var(--fs-xs); color: rgb(var(--text-dimmer)); text-transform: uppercase; letter-spacing: 0.06em; }

/* Data visuals drawn by script.js from data.js (real numbers, to scale). */
.viz { width: 100%; height: 100%; }
.viz text { font-family: var(--font-mono); }
.viz__caption { fill: rgb(var(--text-dimmer)); font-size: 11px; letter-spacing: 0.08em; }
.viz__label { fill: rgb(var(--text-dim)); font-size: 12px; }
.viz__value { fill: rgb(var(--text)); font-size: 13px; font-weight: 500; }
.viz__big { fill: rgb(var(--accent)); font-size: 32px; font-weight: 600; }
.viz text.viz__big { font-family: var(--font-display); }
.viz__track { fill: rgb(var(--line) / 0.08); }
.viz__bar { fill: rgb(var(--accent)); }
.viz__bar--before { fill: rgb(var(--text-dimmer) / 0.6); }
.viz__box { fill: rgb(var(--bg-elevated)); stroke: rgb(var(--line) / 0.25); stroke-width: 1; }
.viz__box--accent { stroke: rgb(var(--accent)); }
.viz__box-text { fill: rgb(var(--text)); font-size: 12px; }
.viz__link { fill: none; stroke: rgb(var(--accent) / 0.55); stroke-width: 1.2; }

/* ---- Case study overlay ---- */
.project-detail { position: fixed; inset: 0; z-index: 850; background: rgb(var(--bg)); overflow-y: auto; overscroll-behavior: contain; visibility: hidden; opacity: 0; }
.project-detail.is-open { visibility: visible; opacity: 1; }
.project-detail__close { position: fixed; top: var(--space-md); right: var(--space-md); z-index: 10; width: 3.2em; height: 3.2em; border-radius: 50%; background: rgb(var(--bg-elevated)); border: 1px solid rgb(var(--line) / 0.2); display: flex; align-items: center; justify-content: center; }
.project-detail__close:hover { border-color: rgb(var(--accent)); }
.project-detail__hero { height: 50vh; min-height: 300px; background: rgb(var(--bg-elevated)); border-bottom: 1px solid rgb(var(--line) / 0.09); display: flex; align-items: center; justify-content: center; padding: var(--space-lg) var(--container-pad); }
.project-detail__hero .viz { max-width: 880px; }
.project-detail__intro { padding-block: var(--space-xl) var(--space-lg); }
.project-detail__eyebrow-row { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: var(--space-sm); margin-bottom: var(--space-md); }
.project-detail__title { font-size: var(--fs-h1); font-weight: 600; max-width: 22ch; }
.project-detail__summary { font-size: var(--fs-lg); max-width: 62ch; margin-top: var(--space-md); }
.project-detail__meta { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: var(--space-lg); margin-top: var(--space-xl); padding-top: var(--space-lg); border-top: 1px solid rgb(var(--line) / 0.09); }
.project-detail__meta dt { font-family: var(--font-mono); font-size: var(--fs-xs); color: rgb(var(--text-dimmer)); text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 6px; }
.project-detail__meta dd { font-family: var(--font-display); font-size: 1.05rem; }
.project-detail__section { padding-block: var(--space-lg); border-top: 1px solid rgb(var(--line) / 0.09); display: grid; gap: var(--space-md); }
@media (min-width: 860px) {
  .project-detail__section { grid-template-columns: 240px 1fr; }
}
.project-detail__section-label { font-family: var(--font-mono); font-size: var(--fs-sm); color: rgb(var(--accent)); }
.project-detail__section-body p { max-width: 68ch; line-height: 1.65; }
.project-detail__stack span { font-family: var(--font-mono); font-size: var(--fs-xs); border: 1px solid rgb(var(--line) / 0.2); padding: 6px 12px; border-radius: var(--radius-full); }
.project-detail__actions { padding-block: var(--space-xl); display: flex; gap: var(--space-md); flex-wrap: wrap; }

/* ---- Experience timeline (vertical; horizontal in paged mode) ---- */
.timeline { overflow: hidden; }
.timeline__track { position: relative; margin-top: var(--space-xl); padding-left: var(--space-lg); }
.timeline__line { position: absolute; left: 0; top: 0; bottom: 0; width: 2px; background: rgb(var(--line) / 0.09); }
.timeline__line-fill { position: absolute; inset: 0; background: rgb(var(--accent)); transform: scaleY(0); transform-origin: top; }
.timeline__item { position: relative; padding: 0 0 var(--space-xl) var(--space-md); }
.timeline__item:last-child { padding-bottom: 0; }
.timeline__dot {
  position: absolute;
  left: calc(-1 * var(--space-lg) - 5px);
  top: 4px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: rgb(var(--bg));
  border: 2px solid rgb(var(--text-dimmer));
  transition: border-color var(--dur-base), background-color var(--dur-base), box-shadow var(--dur-base);
}
.timeline__item.is-active .timeline__dot { border-color: rgb(var(--accent)); background: rgb(var(--accent)); box-shadow: 0 0 16px 2px rgb(var(--accent) / 0.5); }
.timeline__period { font-family: var(--font-mono); font-size: var(--fs-xs); color: rgb(var(--text-dimmer)); text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: var(--space-2xs); }
.timeline__role { font-size: var(--fs-h3); font-weight: 600; }
.timeline__org { display: block; margin-top: 6px; font-family: var(--font-mono); font-size: var(--fs-sm); font-weight: 400; letter-spacing: 0; color: rgb(var(--accent)); }
.timeline__desc { max-width: 60ch; margin-top: var(--space-xs); font-size: var(--fs-sm); line-height: 1.6; }
.timeline__tags { display: flex; gap: var(--space-2xs); flex-wrap: wrap; margin-top: var(--space-sm); }
.timeline__tags span { font-family: var(--font-mono); font-size: var(--fs-xs); color: rgb(var(--text-dim)); border: 1px solid rgb(var(--line) / 0.12); padding: 3px 10px; border-radius: var(--radius-full); }

/* ---- Education ---- */
.education { overflow: hidden; }
.education__grid { display: grid; grid-template-columns: 1fr; gap: var(--space-lg); margin-top: var(--space-xl); }
@media (min-width: 860px) {
  .education__grid { grid-template-columns: 0.9fr 1.1fr; align-items: start; }
}
.education__degree { border: 1px solid rgb(var(--line) / 0.09); border-radius: var(--radius-lg); padding: var(--space-lg); background: rgb(var(--bg-elevated)); }
.education__period { font-family: var(--font-mono); font-size: var(--fs-xs); color: rgb(var(--accent)); text-transform: uppercase; letter-spacing: 0.08em; }
.education__title { font-size: var(--fs-h3); font-weight: 600; margin-top: var(--space-sm); }
.education__school { margin-top: var(--space-2xs); }
.education__langs { display: flex; flex-wrap: wrap; gap: var(--space-md) var(--space-lg); margin-top: var(--space-lg); padding-top: var(--space-md); border-top: 1px solid rgb(var(--line) / 0.09); }
.education__langs dt { font-family: var(--font-mono); font-size: var(--fs-xs); color: rgb(var(--text-dimmer)); text-transform: uppercase; letter-spacing: 0.08em; }
.education__langs dd { font-size: var(--fs-sm); margin-top: 2px; }
.education__certs-label { font-family: var(--font-mono); font-size: var(--fs-sm); color: rgb(var(--text-dimmer)); text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: var(--space-md); }
.cert-list { display: flex; flex-direction: column; gap: var(--space-sm); }
.cert-item { display: flex; align-items: center; gap: var(--space-md); padding: var(--space-md); border: 1px solid rgb(var(--line) / 0.09); border-radius: var(--radius-md); background: rgb(var(--bg) / 0.6); }
.cert-item__icon { flex-shrink: 0; width: 40px; height: 40px; border-radius: 50%; background: rgb(var(--accent) / 0.1); border: 1px solid rgb(var(--accent) / 0.35); display: flex; align-items: center; justify-content: center; color: rgb(var(--accent)); }
.cert-item__title { font-family: var(--font-display); font-weight: 600; font-size: 1.05rem; }
.cert-item__issuer { display: block; font-family: var(--font-mono); font-size: var(--fs-xs); color: rgb(var(--text-dimmer)); margin-top: 4px; }

/* ---- Contact ---- */
.contact { overflow: hidden; }
.contact__blob { width: min(46vw, 480px); height: min(46vw, 480px); opacity: 0.2; }
.contact__blob--a { background: rgb(var(--glow)); top: -8%; left: -8%; }
.contact__blob--b { background: rgb(var(--accent)); bottom: -12%; right: -6%; }
.contact__grid { position: relative; z-index: 1; display: grid; grid-template-columns: 1fr; gap: var(--space-xl); }
@media (min-width: 960px) {
  .contact__grid { grid-template-columns: 1fr 1fr; align-items: center; }
}
.contact__title { font-size: var(--fs-h1); font-weight: 600; max-width: 14ch; }
.contact__desc { margin-top: var(--space-md); max-width: 44ch; font-size: var(--fs-lg); }
.contact__direct { margin-top: var(--space-lg); }
.contact__direct a { font-family: var(--font-display); font-size: var(--fs-h3); position: relative; overflow-wrap: anywhere; }
.contact__direct a::after { content: ''; position: absolute; left: 0; bottom: -2px; width: 100%; height: 1px; background: rgb(var(--text-dimmer)); transition: background-color var(--dur-press); }
.contact__direct a:hover { color: rgb(var(--accent)); }
.contact__direct a:hover::after { background: rgb(var(--accent)); }
.contact__socials { display: flex; gap: var(--space-sm); margin-top: var(--space-lg); flex-wrap: wrap; }
.social-link { min-width: 3.2em; height: 3.2em; border-radius: var(--radius-full); border: 1px solid rgb(var(--line) / 0.2); display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2xs); transition: border-color var(--dur-press), color var(--dur-press); }
.social-link--wide { padding-inline: 1.2em; font-family: var(--font-mono); font-size: var(--fs-sm); }
.social-link:hover { border-color: rgb(var(--accent)); color: rgb(var(--accent)); }

.contact-form { display: flex; flex-direction: column; gap: var(--space-lg); }
.form-field { position: relative; }
.form-field label { position: absolute; left: 0; top: 0.9em; font-family: var(--font-mono); font-size: var(--fs-body); color: rgb(var(--text-dimmer)); pointer-events: none; transform-origin: left top; transition: transform var(--dur-press) var(--ease-press), color var(--dur-press); }
.form-field input, .form-field textarea { width: 100%; background: transparent; border: none; border-bottom: 1px solid rgb(var(--line) / 0.25); padding-block: 0.9em; font-size: var(--fs-body); color: rgb(var(--text)); border-radius: 0; }
.form-field textarea { resize: vertical; min-height: 90px; }
.form-field input:focus, .form-field textarea:focus { outline: none; border-color: rgb(var(--accent)); }
.form-field.is-filled label, .form-field input:focus + label, .form-field textarea:focus + label { transform: translateY(-1.6em) scale(0.8); color: rgb(var(--accent)); }
.form-field__underline { position: absolute; bottom: 0; left: 0; height: 1px; width: 0%; background: rgb(var(--accent)); transition: width var(--dur-base) var(--ease-out-quart); }
.form-field input:focus ~ .form-field__underline, .form-field textarea:focus ~ .form-field__underline { width: 100%; }
.form-field__error { display: block; height: 0; overflow: hidden; opacity: 0; margin-top: 6px; font-family: var(--font-mono); font-size: var(--fs-xs); color: rgb(var(--error)); transition: opacity var(--dur-press); }
.form-field.has-error input, .form-field.has-error textarea { border-color: rgb(var(--error)); }
.form-field.has-error .form-field__error { height: auto; opacity: 1; }
.contact-form__submit { align-self: flex-start; }
.contact-form__submit-check { display: none; stroke-dasharray: 26; stroke-dashoffset: 26; }
.contact-form__submit.is-success .contact-form__submit-text { display: none; }
.contact-form__submit.is-success .contact-form__submit-check { display: block; animation: draw-check 0.45s ease forwards 0.05s; }
@keyframes draw-check { to { stroke-dashoffset: 0; } }
.contact-form__status { font-family: var(--font-mono); font-size: var(--fs-sm); min-height: 1.5em; }
.contact-form__status[data-state="success"] { color: rgb(var(--success)); }
.contact-form__status[data-state="error"] { color: rgb(var(--error)); }

/* ---- Footer ---- */
.site-footer { position: relative; z-index: 2; background: rgb(var(--bg)); border-top: 1px solid rgb(var(--line) / 0.09); padding-block: 0 var(--space-lg); }
.marquee { overflow: hidden; white-space: nowrap; }
.marquee__track { display: inline-flex; will-change: transform; }
.footer-marquee { border-bottom: 1px solid rgb(var(--line) / 0.09); padding-block: var(--space-md); mask-image: linear-gradient(to right, transparent, black 8%, black 92%, transparent); }
.footer-marquee__track { align-items: center; gap: var(--space-lg); padding-right: var(--space-lg); }
.footer-marquee__track span:not(.footer-marquee__dot) { font-family: var(--font-display); font-size: clamp(1.4rem, 3vw, 2.2rem); font-weight: 600; color: rgb(var(--text-dimmer)); }
.footer-marquee__dot { color: rgb(var(--accent)); font-size: 0.7rem; }
.footer-top { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: var(--space-lg); padding-block: var(--space-xl); }
.footer-cta { font-size: var(--fs-h1); font-weight: 600; max-width: 14ch; }
.footer-links { display: flex; gap: var(--space-sm); flex-wrap: wrap; }
.footer-links a { font-family: var(--font-mono); font-size: var(--fs-sm); color: rgb(var(--text-dim)); border: 1px solid rgb(var(--line) / 0.12); padding: 0.6em 1.1em; border-radius: var(--radius-full); transition: color var(--dur-press), border-color var(--dur-press); }
.footer-links a:hover { color: rgb(var(--accent)); border-color: rgb(var(--accent)); }
.footer-bottom { display: flex; justify-content: space-between; flex-wrap: wrap; gap: var(--space-sm); padding-top: var(--space-lg); border-top: 1px solid rgb(var(--line) / 0.09); font-family: var(--font-mono); font-size: var(--fs-xs); color: rgb(var(--text-dimmer)); }
.back-to-top { color: rgb(var(--text-dim)); }

/* ---- Paged mode: script.js adds .is-paged on wide, tall-enough screens.
   The stage is pinned and the pages are stacked: each new page slides in over the
   previous one while that one recedes and dims (script.js initStage). ---- */
.is-paged .stage { position: sticky; top: 0; height: 100vh; height: 100svh; overflow: hidden; container-type: inline-size; }
.is-paged .track { position: relative; height: 100%; }
.is-paged .page {
  position: absolute;
  inset: 0;
  min-height: 0;
  padding-block: calc(var(--header-h) + var(--space-sm)) var(--space-lg);
  display: flex;
  flex-direction: column;
  justify-content: center;
  overflow: hidden;
  transform-origin: 30% 50%;
}
/* Taller than the screen: start at the top; script.js scrolls the content up after the page arrives. */
.is-paged .page.is-tall { justify-content: flex-start; }
.page-dim { position: absolute; inset: 0; z-index: 40; background: rgb(var(--bg)); opacity: 0; pointer-events: none; }
.is-paged .work__inner { display: flex; align-items: center; gap: var(--space-xl); width: max-content; max-width: none; margin: 0; }
.is-paged .projects__header { flex-direction: column; align-items: flex-start; justify-content: center; flex: none; width: min(34cqw, 460px); margin: 0; }
.is-paged .projects__tools { flex-direction: column; align-items: flex-start; }
.is-paged .project-list { display: flex; gap: var(--space-lg); }
.is-paged .project-card { flex: none; width: clamp(300px, 26cqw, 380px); }
.is-paged .scroll-progress { display: none; }
.is-paged .hero__scroll-cue { bottom: calc(var(--space-lg) + 28px); }

/* Wide screens: roles side by side on a horizontal line. Narrow screens keep the vertical timeline. */
@media (min-width: 900px) {
  .is-paged .timeline__track { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--space-lg); padding: var(--space-lg) 0 0; }
  .is-paged .timeline__line { right: 0; bottom: auto; width: auto; top: 5px; height: 2px; }
  .is-paged .timeline__line-fill { transform: scaleX(0); transform-origin: left; }
  .is-paged .timeline__item { padding: 0; }
  .is-paged .timeline__dot { left: 0; top: calc(-1 * var(--space-lg)); }
}

/* Narrow screens in paged mode: the Work heading becomes the first panel of its sliding row,
   pages leave room above the rail, and the rail spans the width (it replaces the top button). */
@media (max-width: 899px) {
  .is-paged .page { padding-bottom: calc(var(--space-lg) + 24px); }
  .is-paged .work__inner { gap: var(--space-lg); }
  .is-paged .projects__header { width: min(80cqw, 460px); }
  .is-paged .scroll-top-btn { display: none; }
  .page-rail { width: calc(100vw - 32px); gap: var(--space-sm); }
  .page-rail__label { min-width: 0; }
}

@media (max-height: 820px) {
  .is-paged .about__body p:nth-of-type(3) { display: none; }
  .is-paged .skills__note { display: none; }
  /* German headings run longer; keep Education clear of the header and the rail. */
  .is-paged .education__grid { margin-top: var(--space-md); gap: var(--space-md); }
  .is-paged .education__degree { padding: var(--space-md); }
  .is-paged .cert-item { padding: var(--space-xs) var(--space-md); }
}

/* Short windows (laptops at 100% zoom, phones held sideways): Work cards shorten so they fit
   between the header and the rail. The full text is one click away in the case study. */
@media (max-height: 700px) {
  .is-paged .project-card__media { aspect-ratio: 16 / 8; }
  .is-paged .project-card__desc { flex: none; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
  .is-paged .project-card__footer { display: none; }
}

@media (max-width: 720px) {
  .page { padding-block: var(--space-2xl); }
  .hero { padding-bottom: var(--space-2xl); }
}


/* ---- Data in motion: shared pieces ---- */
.stat-number, .viz text, .timeline__period, .projects__count, .page-rail__label { font-variant-numeric: tabular-nums; }

.chip {
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  padding: 0.5em 1em;
  border-radius: var(--radius-full);
  border: 1px solid rgb(var(--line) / 0.2);
  color: rgb(var(--text-dim));
  transition: border-color var(--dur-press) var(--ease-press), color var(--dur-press) var(--ease-press), background-color var(--dur-press) var(--ease-press);
}
.chip:hover { border-color: rgb(var(--accent)); color: rgb(var(--text)); }
.chip[aria-pressed="true"] { background: rgb(var(--accent)); border-color: rgb(var(--accent)); color: rgb(var(--on-accent)); }

.projects__tools { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-sm) var(--space-md); }
.work-filter { display: flex; flex-wrap: wrap; gap: var(--space-2xs); }
.project-card { transition: border-color var(--dur-press) var(--ease-press), opacity var(--dur-exit) var(--ease-exit); }
.project-card.is-dim { opacity: 0.35; }

.viz-packet { fill: rgb(var(--accent)); }
.skills__packet { position: absolute; left: 0; top: 0; width: 6px; height: 6px; margin: -3px 0 0 -3px; border-radius: 50%; background: rgb(var(--accent)); box-shadow: 0 0 8px rgb(var(--accent) / 0.7); pointer-events: none; }
.timeline__head { position: absolute; left: 50%; top: 0; width: 10px; height: 10px; margin: -5px 0 0 -5px; border-radius: 50%; background: rgb(var(--accent)); box-shadow: 0 0 12px 2px rgb(var(--accent) / 0.6); opacity: 0; pointer-events: none; }
@media (min-width: 900px) {
  .is-paged .timeline__head { left: 0; top: 50%; }
}

/* Skills with evidence are buttons. */
.skill-node__dot { transition: background-color var(--dur-press) var(--ease-press), border-color var(--dur-press) var(--ease-press), color var(--dur-press) var(--ease-press); }
button.skill-node__inner { cursor: pointer; }
button.skill-node__inner:hover .skill-node__dot { border-color: rgb(var(--accent)); color: rgb(var(--accent)); }
button.skill-node__inner:focus-visible { outline: none; }
button.skill-node__inner:focus-visible .skill-node__dot { outline: 2px solid rgb(var(--accent)); outline-offset: 3px; }
button.skill-node__inner[aria-pressed="true"] .skill-node__dot { background: rgb(var(--accent)); border-color: rgb(var(--accent)); color: rgb(var(--on-accent)); }
.skill-chip__btn { display: block; width: 100%; cursor: pointer; text-align: center; }
.skill-chip { transition: border-color var(--dur-press) var(--ease-press), background-color var(--dur-press) var(--ease-press); }
.skill-chip.is-selected { border-color: rgb(var(--accent)); background: rgb(var(--accent) / 0.1); }

.skill-panel {
  margin-top: var(--space-sm);
  max-width: 460px;
  padding: var(--space-sm) var(--space-md);
  border: 1px solid rgb(var(--line) / 0.12);
  border-radius: var(--radius-md);
  background: rgb(var(--bg-elevated));
  box-shadow: 0 16px 40px -24px rgb(0 0 0 / 0.45);
}
.is-paged .skill-panel { position: absolute; z-index: 5; left: calc(var(--container-pad) + var(--space-sm)); bottom: var(--space-sm); margin: 0; }
.skill-panel__head { display: flex; align-items: baseline; justify-content: space-between; gap: var(--space-sm); }
.skill-panel__title { font-family: var(--font-mono); font-size: var(--fs-xs); color: rgb(var(--accent)); text-transform: uppercase; letter-spacing: 0.08em; }
.skill-panel__close { font-family: var(--font-mono); font-size: var(--fs-xs); color: rgb(var(--text-dim)); padding: 4px 6px; transition: color var(--dur-press) var(--ease-press); }
.skill-panel__close:hover { color: rgb(var(--text)); }
.skill-panel__list { display: flex; flex-wrap: wrap; gap: var(--space-2xs); margin-top: var(--space-xs); }
.skill-panel__item { font-size: var(--fs-sm); line-height: 1.3; padding: 0.45em 0.9em; border-radius: var(--radius-md); border: 1px solid rgb(var(--line) / 0.2); color: rgb(var(--text)); text-align: left; transition: border-color var(--dur-press) var(--ease-press), color var(--dur-press) var(--ease-press); }
.skill-panel__item[data-type="case"] { border-color: rgb(var(--accent) / 0.5); }
.skill-panel__item:hover { border-color: rgb(var(--accent)); color: rgb(var(--accent)); }
.skill-panel__kind { display: block; font-family: var(--font-mono); font-size: 10px; color: rgb(var(--text-dimmer)); text-transform: uppercase; letter-spacing: 0.08em; }

/* Pipeline rail: paged mode only (script.js removes [hidden]). */
.page-rail {
  position: fixed;
  left: 50%;
  bottom: calc(10px + env(safe-area-inset-bottom, 0px));
  z-index: 790;
  display: flex;
  align-items: center;
  gap: var(--space-md);
  width: min(620px, 60vw);
  padding: 6px 16px;
  border: 1px solid rgb(var(--line) / 0.08);
  border-radius: var(--radius-full);
  background: rgb(var(--bg) / 0.92); /* keeps the rail readable over content scrolling beneath it */
  transform: translateX(-50%);
}
.page-rail[hidden] { display: none; }
.page-rail__label { flex: none; min-width: 14ch; font-family: var(--font-mono); font-size: var(--fs-xs); color: rgb(var(--text-dim)); white-space: nowrap; }
.page-rail__track { position: relative; flex: 1; height: 2px; background: rgb(var(--line) / 0.15); }
.page-rail__stop { position: absolute; top: 50%; width: 24px; height: 24px; margin: -12px 0 0 -12px; border-radius: 50%; display: grid; place-items: center; }
.page-rail__stop::before { content: ''; width: 8px; height: 8px; border-radius: 50%; border: 1.5px solid rgb(var(--text-dimmer)); background: rgb(var(--bg)); transition: border-color var(--dur-press) var(--ease-press), background-color var(--dur-press) var(--ease-press); }
.page-rail__stop:hover::before { border-color: rgb(var(--accent)); }
.page-rail__stop.is-passed::before { border-color: rgb(var(--accent)); background: rgb(var(--accent)); }
.page-rail__packet { position: absolute; top: 50%; left: 0; width: 10px; height: 10px; margin: -5px 0 0 -5px; border-radius: 50%; background: rgb(var(--accent)); box-shadow: 0 0 10px 2px rgb(var(--accent) / 0.6); pointer-events: none; }

/* No native scrolling underneath while Lenis is stopped (case-study overlay, mobile menu). */
html.lenis-stopped { overflow: clip; }

/* ---- Language: EN/DE switch; German pages stay hidden for the instant lang-de.js needs ---- */
.i18n-pending body { visibility: hidden; animation: i18n-failsafe 0s linear 1.5s forwards; }
@keyframes i18n-failsafe { to { visibility: visible; } }
.lang-switch { display: inline-flex; padding: 3px; border-radius: var(--radius-full); border: 1px solid rgb(var(--line) / 0.2); }
.lang-switch__btn { font-family: var(--font-mono); font-size: var(--fs-xs); letter-spacing: 0.06em; padding: 0.35em 0.7em; border-radius: var(--radius-full); color: rgb(var(--text-dim)); transition: background-color var(--dur-press) var(--ease-press), color var(--dur-press) var(--ease-press); }
.lang-switch__btn:hover { color: rgb(var(--text)); }
.lang-switch__btn[aria-pressed="true"] { background: rgb(var(--accent)); color: rgb(var(--on-accent)); }
/* Phones: the switch collapses to one button naming the other language, so the header fits. */
@media (max-width: 480px) {
  .lang-switch { padding: 0; border: 0; }
  .lang-switch__btn[aria-pressed="true"] { display: none; }
  .lang-switch__btn { padding: 0.55em 0.8em; border: 1px solid rgb(var(--line) / 0.2); }
  .site-header__actions { gap: var(--space-2xs); }
}
@media (max-width: 400px) {
  .logo { font-size: 1rem; }
}

/* ---- Menu: section names in big type over a slow particle field ---- */
.site-menu { position: fixed; inset: 0; z-index: 820; overflow: hidden; background: rgb(var(--bg)); }
.site-menu:focus { outline: none; }
.menu-open .site-header { z-index: 830; }
.menu-open .site-header::before { opacity: 0; }
.menu-open .scroll-progress { visibility: hidden; }
.site-menu__field { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.site-menu__inner {
  position: relative;
  height: 100%;
  overflow-y: auto;
  overscroll-behavior: contain;
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
  padding-block: calc(var(--header-h) + var(--space-xs)) calc(var(--space-md) + env(safe-area-inset-bottom, 0px));
}
.site-menu__list { display: flex; flex-direction: column; gap: clamp(0.25rem, 1.4vh, 0.9rem); }
.site-menu__link { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; }
.site-menu__mask { display: block; overflow: hidden; padding-block: 0.08em 0.02em; }
.site-menu__word {
  display: block;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.9rem, min(11vw, 7vh), 4.5rem);
  line-height: 1;
  letter-spacing: -0.02em;
  text-transform: uppercase;
  color: rgb(var(--text));
  transition: color var(--dur-press) var(--ease-press), -webkit-text-stroke-color var(--dur-press) var(--ease-press);
}
/* Alternating solid and outlined, like the hero title. The stroke sits under a fill in the page color,
   so only its outer half shows and the variable font's overlapping contours stay hidden. */
.site-menu__list :where(li:nth-child(even)) .site-menu__word { color: rgb(var(--bg)); -webkit-text-stroke: 3px rgb(var(--text)); paint-order: stroke fill; }
.site-menu__link:hover .site-menu__word,
.site-menu__link:focus-visible .site-menu__word,
.site-menu__link.is-picked .site-menu__word { color: rgb(var(--accent)); -webkit-text-stroke-color: rgb(var(--accent)); }
.site-menu__fact { display: flex; align-items: center; gap: var(--space-2xs); font-family: var(--font-mono); font-size: var(--fs-xs); color: rgb(var(--accent)); }
.site-menu__link.is-active .site-menu__fact::before { content: ''; flex: none; width: 6px; height: 6px; border-radius: 50%; background: rgb(var(--accent)); box-shadow: 0 0 10px 2px rgb(var(--accent) / 0.7); }
.site-menu__quick { display: flex; flex-wrap: wrap; gap: var(--space-2xs); margin-top: auto; }
.site-menu__quick a { font-family: var(--font-mono); font-size: var(--fs-xs); padding: 0.6em 1.1em; border-radius: var(--radius-full); border: 1px solid rgb(var(--line) / 0.2); background: rgb(var(--bg) / 0.85); transition: border-color var(--dur-press) var(--ease-press), color var(--dur-press) var(--ease-press); }
.site-menu__quick a:hover { border-color: rgb(var(--accent)); color: rgb(var(--accent)); }
