/* Self-hosted fonts (variable files, latin + latin-ext subsets) — no requests to Google. */
@font-face {
  font-family: "DM Sans";
  font-style: normal;
  font-weight: 400 600;
  font-display: swap;
  src: url("../fonts/dm-sans-latin-ext.woff2") format("woff2");
  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: "DM Sans";
  font-style: normal;
  font-weight: 400 600;
  font-display: swap;
  src: url("../fonts/dm-sans-latin.woff2") format("woff2");
  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: "Manrope";
  font-style: normal;
  font-weight: 500 800;
  font-display: swap;
  src: url("../fonts/manrope-latin-ext.woff2") format("woff2");
  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: "Manrope";
  font-style: normal;
  font-weight: 500 800;
  font-display: swap;
  src: url("../fonts/manrope-latin.woff2") format("woff2");
  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;
}

:root {
  --ink: #0b1020;
  --paper: #f5f2eb;
  --paper2: #eae6dc;
  --white: #fff;
  --text: #1b2234;
  --muted: #555e70;          /* ≥5.2:1 on both paper tones */
  --line: rgba(11, 16, 32, .14);
  --blue: #2f54eb;           /* ≥5.2:1 with white and on paper (was #496dff, ~4.3:1) */
  --blue-glow: rgba(73, 109, 255, .25);
  --blue2: #9fb1ff;
  --green: #a8ffcf;
  --on-dark-soft: rgba(255, 255, 255, .66);
  --display: "Manrope", "Segoe UI", system-ui, -apple-system, sans-serif;
  --body: "DM Sans", "Segoe UI", system-ui, -apple-system, sans-serif;
  --shell: min(1180px, calc(100% - 48px));
  /* Theme-dependent roles for the light sections (hero, experience, contact and footer stay dark in both). */
  --surface: #fff;
  --body-text: #4a5366;
  --accent: var(--blue);     /* accent text/icons on paper; filled blue surfaces keep --blue */
  --accent-line: rgba(47, 84, 235, .35);
  --featured: var(--ink);
  color-scheme: light;
}

:root[data-theme="dark"] {
  --paper: #10172c;
  --paper2: #141c34;
  --surface: #0d1325;
  --text: #e8ebf3;
  --muted: #a7aec0;          /* ≥7:1 on the dark paper tones */
  --body-text: #bcc3d2;
  --line: rgba(255, 255, 255, .12);
  --accent: var(--blue2);    /* #2f54eb is too dark to read on dark paper */
  --accent-line: rgba(159, 177, 255, .4);
  --featured: #1a2448;
  color-scheme: dark;
}

/* Base */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 90px; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--text);
  font: 17px/1.65 var(--body);
  overflow-x: hidden;
}
img { display: block; max-width: 100%; }
a { color: inherit; }
.shell { width: var(--shell); margin-inline: auto; }
.icon { width: 1em; height: 1em; flex: none; }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.skip-link {
  position: fixed;
  left: 16px;
  top: -60px;
  z-index: 1000;
  padding: 10px 16px;
  background: #fff;
  color: var(--ink);
}
.skip-link:focus { top: 16px; }

/* Focus: blue on light sections, green on dark and blue ones so it never disappears. */
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
.site-header :focus-visible,
.hero :focus-visible,
.experience-section :focus-visible,
.contact-section :focus-visible,
.site-footer :focus-visible { outline-color: var(--green); }

/* Header & navigation */
.site-header {
  position: fixed;
  inset: 0 0 auto;
  z-index: 100;
  color: #fff;
  border-bottom: 1px solid rgba(255, 255, 255, .09);
  transition: background-color .25s, box-shadow .25s;
}
.site-header.scrolled {
  background: rgba(11, 16, 32, .92);
  -webkit-backdrop-filter: blur(18px);
  backdrop-filter: blur(18px);
  box-shadow: 0 10px 35px rgba(0, 0, 0, .12);
}
.nav-wrap { min-height: 78px; display: flex; align-items: center; justify-content: space-between; }
.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-family: var(--display);
  font-weight: 700;
  text-decoration: none;
}
.brand-mark {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  background: var(--blue);
  color: #fff;
  font-size: 12px;
  letter-spacing: .04em;
}
.site-nav { display: flex; align-items: center; gap: 30px; font-size: 14px; }
.site-nav a { color: rgba(255, 255, 255, .78); text-decoration: none; transition: color .2s; }
.site-nav a:hover { color: #fff; }
.site-nav .nav-cta { padding: 9px 16px; color: #fff; border: 1px solid rgba(255, 255, 255, .35); }
.menu-toggle { display: none; width: 44px; height: 44px; padding: 10px; border: 0; background: transparent; cursor: pointer; }
.menu-toggle span:not(.sr-only) { display: block; height: 2px; margin: 5px; background: #fff; }

/* Hero */
.hero { position: relative; overflow: hidden; padding: 170px 0 0; color: #fff; background: var(--ink); }
/* Data-flow diagram (drawn by js/flow.js). Dimmed behind the text column so the copy stays readable. */
.hero-flow {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  -webkit-mask-image: linear-gradient(90deg, #000, rgba(0, 0, 0, .4) 20%, rgba(0, 0, 0, .3) 50%, #000 72%);
  mask-image: linear-gradient(90deg, #000, rgba(0, 0, 0, .4) 20%, rgba(0, 0, 0, .3) 50%, #000 72%);
}
/* 3D version (js/flow3d.js): a WebGL canvas plus HTML labels positioned over its nodes. */
.hero-flow-3d canvas { display: block; width: 100%; height: 100%; }
/* The 3D canvases stay invisible until their shaders are compiled, then fade in. */
.hero-flow-3d, .contact-orb3d, .journey-path3d { opacity: 0; transition: opacity .8s; }
.has-3d .hero-flow-3d, .has-orb3d .contact-orb3d, .has-path3d .journey-path3d { opacity: 1; }
/* The 3D scene paints its own aurora and key light, so the CSS glow would double it. */
.hero.has-3d::after { display: none; }
.hero-flow-labels { position: absolute; inset: 0; overflow: hidden; }
.hero-flow-label {
  position: absolute;
  top: 0;
  left: 0;
  font: 600 10px/1 "DM Sans", system-ui, sans-serif;
  letter-spacing: .12em;
  text-transform: uppercase;
  white-space: nowrap;
  text-shadow: 0 0 6px #0b1020, 0 0 2px #0b1020;
  opacity: 0;
  transition: opacity .3s;
  will-change: transform;
}
.hero::after {
  content: "";
  position: absolute;
  width: 650px;
  height: 650px;
  top: -230px;
  right: -130px;
  border-radius: 50%;
  background: var(--blue-glow);
  filter: blur(110px);
}
.hero-layout {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1.45fr .55fr;
  gap: 72px;
  align-items: center;
}
.eyebrow,
.section-kicker {
  margin: 0 0 22px;
  text-transform: uppercase;
  letter-spacing: .16em;
  font-size: 12px;
  font-weight: 600;
}
.eyebrow { color: var(--blue2); display: flex; align-items: center; gap: 10px; }
.eyebrow > span { width: 28px; height: 1px; background: currentColor; }
.hero h1 {
  margin: 0;
  max-width: 830px;
  font: 800 clamp(50px, 6.2vw, 88px)/.98 var(--display);
  letter-spacing: -.055em;
}
.hero h1 em { color: var(--blue2); font-style: normal; }
.hero-intro { max-width: 720px; margin: 34px 0 0; color: rgba(255, 255, 255, .74); font-size: clamp(18px, 2vw, 22px); }

/* Buttons */
.hero-actions,
.contact-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 38px; }
.button {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 52px;
  padding: 13px 20px;
  border: 1px solid transparent;
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  transition: transform .2s, background-color .2s, border-color .2s, translate .35s var(--ease-out);
}
.button:hover { transform: translateY(-2px); }
.button-primary { background: var(--blue); }
.button-primary:hover { background: #2446d6; }
.button-ghost { border-color: rgba(255, 255, 255, .3); }
.button-ghost:hover { border-color: rgba(255, 255, 255, .6); }
.button-light { background: #fff; color: var(--blue); }
.button-outline-light { border-color: rgba(255, 255, 255, .55); }
.button-outline-light:hover { border-color: #fff; }

/* Portrait — kept perfectly circular regardless of source dimensions. */
/* Capped near the source's 210px so the photo isn't visibly upscaled. */
.portrait-wrap { position: relative; justify-self: center; width: min(100%, 230px); aspect-ratio: 1; }
.portrait-wrap picture { display: block; width: 100%; height: 100%; }
.portrait {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  filter: saturate(.7);
  border: 8px solid rgba(255, 255, 255, .08);
  border-radius: 50%;
  clip-path: circle(50%);
}
.portrait-accent { position: absolute; inset: -18px; border: 1px solid rgba(159, 177, 255, .45); border-radius: 50%; }

/* Proof row */
.proof-row {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  margin-top: 92px;
  border-top: 1px solid rgba(255, 255, 255, .12);
}
.proof-row > div { display: flex; align-items: center; gap: 16px; padding: 28px 0; border-right: 1px solid rgba(255, 255, 255, .12); }
.proof-row > div + div { padding-left: 28px; }
.proof-row > div:last-child { border: 0; }
.proof-row strong { font: 700 27px var(--display); color: var(--green); }
.proof-row span { max-width: 150px; color: rgba(255, 255, 255, .66); font-size: 13px; line-height: 1.35; }

/* Shared section styles */
.section { padding: 130px 0; }
.section-kicker { color: var(--accent); }
.section h2,
.contact-section h2 {
  margin: 0;
  font: 700 clamp(38px, 4.5vw, 64px)/1.08 var(--display);
  letter-spacing: -.045em;
}
.split-layout { display: grid; grid-template-columns: .82fr 1.18fr; gap: clamp(50px, 10vw, 140px); }
.section-heading { display: flex; justify-content: space-between; align-items: end; gap: 60px; margin-bottom: 56px; }
.section-heading > div { max-width: 700px; }
.section-heading > p { max-width: 360px; margin: 0; color: var(--muted); }
.section-heading.light > p { color: var(--on-dark-soft); }

/* About */
.prose { max-width: 680px; }
.prose p { margin: 0 0 20px; color: var(--body-text); }
.prose .lead { color: var(--text); font-size: 24px; line-height: 1.5; }
.text-link {
  display: inline-flex;
  gap: 10px;
  margin-top: 10px;
  color: var(--accent);
  font-weight: 600;
  text-decoration: none;
  border-bottom: 1px solid var(--accent-line);
  transition: border-color .2s;
}
.text-link:hover { border-color: var(--accent); }

/* Focus cards */
.focus-section { background: var(--paper2); }
.focus-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
}
.focus-card { position: relative; min-height: 440px; padding: 34px; background: var(--paper); }
.focus-card-featured { background: var(--featured); color: #fff; }
.card-number { position: absolute; top: 28px; right: 28px; color: var(--muted); font-size: 12px; }
.focus-card-featured .card-number { color: var(--on-dark-soft); }
.card-icon {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  margin-bottom: 88px;
  border: 1px solid var(--line);
  color: var(--accent);
}
.card-icon svg { width: 24px; height: 24px; }
.focus-card-featured .card-icon { border-color: rgba(255, 255, 255, .18); color: var(--green); }
.focus-card h3 { max-width: 260px; margin: 0 0 16px; font: 700 28px/1.18 var(--display); letter-spacing: -.03em; }
.focus-card p { min-height: 86px; color: var(--muted); font-size: 15px; }
.focus-card-featured p { color: rgba(255, 255, 255, .7); }
.focus-card ul { display: flex; flex-wrap: wrap; gap: 7px; padding: 0; margin: 24px 0 0; list-style: none; }
.focus-card li { padding: 4px 9px; border: 1px solid var(--line); color: var(--muted); font-size: 12px; }
.focus-card-featured li { border-color: rgba(255, 255, 255, .18); color: rgba(255, 255, 255, .7); }

/* Experience timeline */
.experience-section { background: var(--ink); color: #fff; }
.journey { margin-top: 72px; }
/* WebGL timeline (js/path3d.js) draws the line and markers itself; the CSS ones keep their space for layout. */
@media screen {
  .experience-section { position: relative; }
  .experience-section > .shell { position: relative; z-index: 1; }
  .journey-path3d { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
  .has-path3d .journey-marker::after { display: none; }
  .has-path3d .journey-marker span { visibility: hidden; }
}
.journey-item { display: grid; grid-template-columns: 170px 42px 1fr; border-top: 1px solid rgba(255, 255, 255, .14); }
.journey-when { padding-top: 36px; color: var(--on-dark-soft); font-size: 13px; }
.journey-marker { position: relative; display: flex; justify-content: center; }
.journey-marker::after { content: ""; position: absolute; inset: 0 auto; width: 1px; background: rgba(255, 255, 255, .18); }
.journey-marker span {
  position: relative;
  z-index: 1;
  width: 11px;
  height: 11px;
  margin-top: 42px;
  border: 3px solid var(--ink);
  border-radius: 50%;
  background: var(--blue2);
  box-shadow: 0 0 0 1px var(--blue2);
}
.current .journey-marker span { background: var(--green); box-shadow: 0 0 0 1px var(--green), 0 0 22px rgba(168, 255, 207, .45); }
.journey-content { max-width: 760px; padding: 34px 0 46px 48px; }
.company { margin: 0 0 6px; color: var(--blue2); text-transform: uppercase; letter-spacing: .12em; font-size: 12px; }
.journey-content h3 { margin: 0 0 15px; font: 700 clamp(25px, 3vw, 38px)/1.2 var(--display); letter-spacing: -.03em; }
.journey-content p:not(.company) { margin: 0; color: rgba(255, 255, 255, .7); }
.tags,
.personal-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 20px; }
.tags span { padding: 4px 10px; background: rgba(255, 255, 255, .06); color: rgba(255, 255, 255, .72); font-size: 12px; }

.earlier-details { border-block: 1px solid rgba(255, 255, 255, .14); }
.earlier-details summary {
  display: flex;
  justify-content: space-between;
  padding: 25px 0;
  color: rgba(255, 255, 255, .8);
  cursor: pointer;
  list-style: none;
}
.earlier-details summary::-webkit-details-marker { display: none; }
.earlier-details summary span { font-size: 24px; transition: transform .2s; }
.earlier-details[open] summary span { transform: rotate(45deg); }
.earlier-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 38px; padding: 24px 0 44px; }
.earlier-grid h3 { margin: 5px 0 10px; font: 600 19px var(--display); }
.earlier-grid p { color: var(--on-dark-soft); font-size: 14px; }
.earlier-grid .detail-label { color: var(--blue2); text-transform: uppercase; letter-spacing: .12em; font-size: 12px; }

/* Capabilities */
.capability-intro { max-width: 500px; margin-top: 28px; color: var(--muted); }
.capability-list { border-top: 1px solid var(--line); }
.capability-item { display: grid; grid-template-columns: 45px 1fr; gap: 18px; padding: 25px 0; border-bottom: 1px solid var(--line); }
.capability-item > span { padding-top: 4px; color: var(--accent); font-size: 12px; }
.capability-item h3 { margin: 0 0 5px; font: 700 22px var(--display); }
.capability-item p { margin: 0; color: var(--muted); font-size: 14px; }

/* Beyond work */
.personal-section { background: var(--surface); }
.personal-layout { display: grid; grid-template-columns: .45fr 1.1fr .75fr; gap: 50px; }
.personal-layout blockquote { margin: 0; font: 600 clamp(28px, 3.3vw, 45px)/1.25 var(--display); letter-spacing: -.035em; }
.personal-copy p { margin-top: 4px; color: var(--muted); }
.personal-tags span { padding: 5px 10px; background: var(--paper); color: var(--muted); font-size: 12px; }

/* Contact */
.contact-section { position: relative; overflow: hidden; padding: 130px 0; background: var(--blue); color: #fff; }
.contact-inner { position: relative; z-index: 1; }
.contact-section .section-kicker { color: var(--green); }
.contact-section h2 { max-width: 900px; font-size: clamp(44px, 6vw, 76px); }
.contact-section p:not(.section-kicker) { max-width: 650px; margin: 28px 0 0; color: #fff; font-size: 19px; }
.contact-orb {
  position: absolute;
  width: 560px;
  height: 560px;
  right: -150px;
  top: -210px;
  border: 1px solid rgba(255, 255, 255, .22);
  border-radius: 50%;
}
.contact-orb::before,
.contact-orb::after { content: ""; position: absolute; inset: 70px; border: 1px solid rgba(255, 255, 255, .17); border-radius: 50%; }
.contact-orb::after { inset: 140px; }
/* 3D orb (js/orb3d.js) replaces the CSS rings; the form turns to frosted glass where the orb passes behind it. */
.contact-orb3d { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.has-orb3d .contact-orb { display: none; }
.has-orb3d .contact-form {
  background: rgba(11, 16, 32, .3);
  -webkit-backdrop-filter: blur(18px) saturate(1.2);
  backdrop-filter: blur(18px) saturate(1.2);
}

/* Footer */
.site-footer { padding: 30px 0; background: var(--ink); color: #fff; }
.footer-inner { display: grid; grid-template-columns: auto minmax(260px, 1fr) auto; gap: 40px; align-items: center; }
.footer-inner p { margin: 0; color: var(--on-dark-soft); font-size: 12px; }
.footer-disclaimer { max-width: 620px; justify-self: center; text-align: center; }
.footer-meta { display: flex; gap: 18px; align-items: center; }
.footer-meta a { color: var(--on-dark-soft); text-decoration: none; }
.footer-meta a:hover { color: #fff; text-decoration: underline; }

/* Legal / sub pages */
.legal-page { padding: 150px 0 110px; }
.legal-page .shell { max-width: 760px; }
.legal-page h1 { margin: 0 0 32px; font: 700 clamp(38px, 4.5vw, 56px)/1.1 var(--display); letter-spacing: -.04em; }
.legal-page h2 { margin: 40px 0 10px; font: 700 22px var(--display); }
.legal-page p,
.legal-page li { color: var(--body-text); }
.legal-page a { color: var(--accent); }

/* ---------- Motion ---------- */
:root { --ease-out: cubic-bezier(.16, 1, .3, 1); }

@keyframes rise { from { opacity: 0; transform: translateY(28px); filter: blur(8px); } to { opacity: 1; transform: none; filter: none; } }
@keyframes pop-in { from { opacity: 0; transform: scale(.82) rotate(-6deg); } to { opacity: 1; transform: none; } }
@keyframes drop-in { from { transform: translateY(-100%); } to { transform: none; } }
@keyframes grow-x { from { transform: scaleX(0); } to { transform: none; } }
@keyframes shimmer { to { background-position: 200% center; } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes drift { 0%, 100% { transform: translate(0, 0) scale(1); } 50% { transform: translate(-60px, 50px) scale(1.12); } }
@keyframes ripple { from { transform: scale(1); opacity: .8; } to { transform: scale(3.2); opacity: 0; } }
@keyframes breathe { 0%, 100% { transform: scale(1); opacity: 1; } 50% { transform: scale(1.06); opacity: .55; } }

/* Hero entrance — runs on load, staggered top to bottom. */
.site-header { animation: drop-in .8s var(--ease-out) both; }
.hero h1 .line { display: block; animation: rise 1s var(--ease-out) both; }
.hero h1 .line:nth-child(1) { animation-delay: .15s; }
.hero h1 .line:nth-child(2) { animation-delay: .28s; }
.hero h1 .line:nth-child(3) { animation-delay: .41s; }
.eyebrow { animation: rise .9s var(--ease-out) .05s both; }
.eyebrow > span { transform-origin: left; animation: grow-x .9s var(--ease-out) .35s both; }
.hero-intro { animation: rise 1s var(--ease-out) .6s both; }
.hero-actions { animation: rise 1s var(--ease-out) .72s both; }
.portrait-wrap { animation: pop-in 1.1s var(--ease-out) .3s both; }
.proof-row { border-top-color: transparent; }
.proof-row::before {
  content: "";
  position: absolute;
  inset: -1px 0 auto;
  height: 1px;
  background: rgba(255, 255, 255, .12);
  transform-origin: left;
  animation: grow-x 1.4s var(--ease-out) .8s both;
}
.proof-row > div { animation: rise .9s var(--ease-out) both; }
.proof-row > div:nth-child(1) { animation-delay: .9s; }
.proof-row > div:nth-child(2) { animation-delay: 1.02s; }
.proof-row > div:nth-child(3) { animation-delay: 1.14s; }
.proof-row strong { font-variant-numeric: tabular-nums; }

/* Gradient sweep across the accent line of the headline. */
.hero h1 em {
  background: linear-gradient(90deg, var(--blue2), var(--green), var(--blue2)) 0 center / 200% auto;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: shimmer 6s linear 1.4s infinite;
}

/* Ambient hero glow. */
.hero::after { animation: drift 16s ease-in-out infinite; will-change: transform; }

/* Portrait: accent ring slowly orbits a small green satellite. */
.portrait-accent { animation: spin 18s linear infinite; }
.portrait-accent::before {
  content: "";
  position: absolute;
  top: 50%;
  left: -4px;
  width: 8px;
  height: 8px;
  margin-top: -4px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 14px var(--green);
}

/* Header scroll progress */
.scroll-progress {
  position: absolute;
  inset: auto 0 -1px;
  height: 2px;
  background: linear-gradient(90deg, var(--blue2), var(--green));
  transform: scaleX(var(--progress, 0));
  transform-origin: left;
}
.site-nav a:not(.nav-cta) { position: relative; }
.site-nav a:not(.nav-cta)::after {
  content: "";
  position: absolute;
  inset: auto 0 -6px;
  height: 1px;
  background: var(--green);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform .3s var(--ease-out);
}
.site-nav .nav-cta { transition: color .2s, background-color .25s, border-color .25s, translate .35s var(--ease-out); }

/* Buttons & links: arrows nudge in their pointing direction. */
.button > span[aria-hidden],
.button > .icon,
.text-link > span { transition: transform .3s var(--ease-out); }
.button-primary { box-shadow: 0 0 0 0 var(--blue-glow); transition: transform .2s, background-color .2s, border-color .2s, box-shadow .3s, translate .35s var(--ease-out); }

/* Scroll reveal: only hidden when JS is running (html.js), so content never vanishes without it.
   --i staggers sibling reveals; delay is scoped to opacity/transform so hover transitions stay instant. */
.js [data-reveal] {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity .9s var(--ease-out) calc(var(--i, 0) * 120ms), transform .9s var(--ease-out) calc(var(--i, 0) * 120ms);
}
.js [data-reveal].visible { opacity: 1; transform: none; }
.js [data-stagger] > * {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity .7s var(--ease-out) calc(var(--n, 0) * 110ms + 150ms), transform .7s var(--ease-out) calc(var(--n, 0) * 110ms + 150ms);
}
.js [data-stagger].visible > * { opacity: 1; transform: none; }

/* Focus cards: underline sweep, icon lift and a soft wash on hover. */
.focus-card { overflow: hidden; isolation: isolate; }
.focus-card::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: radial-gradient(500px circle at 0 100%, rgba(73, 109, 255, .1), transparent 60%);
  opacity: 0;
  transition: opacity .4s;
}
.focus-card::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 3px;
  background: linear-gradient(90deg, var(--blue), var(--blue2));
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .5s var(--ease-out);
}
.focus-card-featured::after { background: linear-gradient(90deg, var(--green), var(--blue2)); }
.card-icon { transition: transform .4s var(--ease-out), border-color .3s, background-color .3s; }
.card-icon svg { transition: transform .6s var(--ease-out); }
.focus-card h3 { transition: transform .4s var(--ease-out); }
.focus-card li { transition: border-color .25s, color .25s; }

/* Timeline: the rail draws itself downward as items reveal; the current role pulses. */
.js .journey-marker::after { transform: scaleY(0); transform-origin: top; transition: transform 1s var(--ease-out) calc(var(--n, 0) * 110ms + 250ms); }
.js .journey.visible .journey-marker::after { transform: none; }
.current .journey-marker span::after {
  content: "";
  position: absolute;
  inset: -4px;
  border: 1px solid var(--green);
  border-radius: 50%;
  animation: ripple 2.2s ease-out infinite;
}
.journey-content h3 { transition: color .3s; }
.journey-marker span { transition: transform .3s var(--ease-out); }
.tags span { transition: background-color .25s, color .25s; }
.earlier-details[open] .earlier-grid > div { animation: rise .6s var(--ease-out) both; }
.earlier-details[open] .earlier-grid > div:nth-child(2) { animation-delay: .08s; }
.earlier-details[open] .earlier-grid > div:nth-child(3) { animation-delay: .16s; }

/* Capabilities */
.capability-item { position: relative; }
.capability-item::after {
  content: "";
  position: absolute;
  inset: auto 0 -1px;
  height: 1px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .5s var(--ease-out);
}
.capability-item > span,
.capability-item > div { transition: transform .4s var(--ease-out); }

/* Beyond work */
.personal-tags span { transition: background-color .25s, color .25s, transform .25s var(--ease-out); }

/* Contact: the concentric rings breathe out of phase. */
.contact-orb { animation: breathe 7s ease-in-out infinite; }
.contact-orb::before { animation: breathe 7s ease-in-out -2.3s infinite; }
.contact-orb::after { animation: breathe 7s ease-in-out -4.6s infinite; }
.button-light { transition: transform .2s, background-color .2s, box-shadow .3s, translate .35s var(--ease-out); }
.brand-mark { transition: transform .4s var(--ease-out); }

/* Looping animations pause while their section is offscreen (class toggled by fs.js).
   !important because the more specific `animation` shorthands would otherwise reset play-state. */
.offscreen, .offscreen *, .offscreen *::before, .offscreen *::after, .offscreen::before, .offscreen::after { animation-play-state: paused !important; }

/* Hover effects only where hover is real, so taps on touch screens don't leave them stuck. */
@media (hover: hover) {
  .site-nav a:not(.nav-cta):hover::after { transform: scaleX(1); transform-origin: left; }
  .site-nav .nav-cta:hover { background: #fff; color: var(--ink); border-color: #fff; }
  .hero-actions .button-primary:hover > span { transform: translate(3px, 3px); }
  .contact-actions .button:hover > span[aria-hidden] { transform: translate(3px, -3px); }
  .contact-actions .button:hover > .icon { transform: rotate(-8deg) scale(1.1); }
  .text-link:hover > span { transform: translateX(5px); }
  .button-primary:hover { box-shadow: 0 12px 30px -8px rgba(73, 109, 255, .7); }
  .focus-card:hover::before { opacity: 1; }
  .focus-card:hover::after { transform: none; }
  .focus-card:hover .card-icon { transform: translateY(-6px); border-color: currentColor; }
  .focus-card:hover .card-icon svg { transform: rotate(-12deg) scale(1.12); }
  .focus-card:hover h3 { transform: translateX(4px); }
  .focus-card:hover li { border-color: var(--accent-line); }
  .focus-card-featured:hover li { border-color: rgba(168, 255, 207, .4); }
  .journey-item:hover .journey-content h3 { color: var(--blue2); }
  .journey-item:hover .journey-marker span { transform: scale(1.35); }
  .journey-item:hover .tags span { background: rgba(159, 177, 255, .14); color: #fff; }
  .capability-item:hover::after { transform: none; }
  .capability-item:hover > span { transform: scale(1.25); }
  .capability-item:hover > div { transform: translateX(8px); }
  .personal-tags span:hover { background: var(--blue); color: #fff; transform: translateY(-3px); }
  .button-light:hover { box-shadow: 0 14px 30px -10px rgba(11, 16, 32, .5); }
  .brand:hover .brand-mark { transform: rotate(-8deg) scale(1.06); }
}

/* ---------- Theme toggle, page transitions, cursor, timeline details ---------- */
.brand { margin-right: auto; }
.site-nav { order: 2; }
.menu-toggle { order: 4; }
.theme-toggle {
  order: 3;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  margin-left: 22px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, .22);
  background: transparent;
  color: #fff;
  cursor: pointer;
  transition: border-color .25s, background-color .25s, translate .35s var(--ease-out);
}
.theme-toggle .icon { grid-area: 1 / 1; width: 18px; height: 18px; transition: transform .5s var(--ease-out), opacity .3s; }
.theme-toggle .icon-sun { opacity: 0; transform: rotate(-90deg) scale(.5); }
[data-theme="dark"] .theme-toggle .icon-moon { opacity: 0; transform: rotate(90deg) scale(.5); }
[data-theme="dark"] .theme-toggle .icon-sun { opacity: 1; transform: none; }

/* Cross-document transitions between pages; the header is captured separately so it stays put. */
@media (prefers-reduced-motion: no-preference) {
  @view-transition { navigation: auto; }
}
@keyframes vt-out { to { opacity: 0; transform: translateY(-14px); } }
@keyframes vt-in { from { opacity: 0; transform: translateY(18px); } }
.site-header { view-transition-name: site-header; }
::view-transition-old(root) { animation: vt-out .3s var(--ease-out) both; }
::view-transition-new(root) { animation: vt-in .55s var(--ease-out) both; }
.vt-arrival .site-header { animation: none; }
/* Theme switches use a circular reveal driven from fs.js instead of the page fade. */
html.theme-switching::view-transition-old(root),
html.theme-switching::view-transition-new(root) { animation: none; mix-blend-mode: normal; }

/* Trailing cursor ring (fine pointers only, created by fs.js). Difference blending keeps it visible on any section. */
.cursor-ring {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 9999;
  width: 30px;
  height: 30px;
  margin: -15px 0 0 -15px;
  border: 1.5px solid #fff;
  border-radius: 50%;
  pointer-events: none;
  mix-blend-mode: difference;
  opacity: 0;
  transition: opacity .3s, width .35s var(--ease-out), height .35s var(--ease-out), margin .35s var(--ease-out), background-color .35s;
}
.cursor-ring.is-visible { opacity: .85; }
.cursor-ring.is-active { width: 54px; height: 54px; margin: -27px 0 0 -27px; background: rgba(255, 255, 255, .1); }
.cursor-ring.is-down { width: 22px; height: 22px; margin: -11px 0 0 -11px; }

/* Timeline details: fs.js wraps each role's description and tags in a collapsible panel.
   Without JS nothing is wrapped, so everything stays visible. */
.journey-ready .journey-content h3 { margin: 0; }
/* Toggle spans the full row so its +/× lines up with the "earlier experience" summary; text keeps its measure. */
.journey-ready .journey-content { max-width: none; }
.journey-ready .journey-content .company,
.journey-ready .journey-panel > div { max-width: 760px; }
.journey-toggle {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 20px;
  width: 100%;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  letter-spacing: inherit;
  text-align: left;
  cursor: pointer;
}
.journey-toggle::after {
  content: "+";
  flex: none;
  margin-top: .05em;
  color: var(--on-dark-soft);
  font: 300 30px/1 var(--body);
  transition: transform .4s var(--ease-out), color .25s;
}
.journey-item.open .journey-toggle::after { transform: rotate(45deg); color: var(--green); }
.journey-panel { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .55s var(--ease-out); }
.journey-panel > div { min-height: 0; overflow: hidden; visibility: hidden; transition: visibility 0s .55s; }
.journey-panel > div > * { opacity: 0; transform: translateY(-8px); transition: opacity .4s, transform .5s var(--ease-out); }
.journey-panel > div > p:first-child { margin-top: 15px; }
.journey-item.open .journey-panel { grid-template-rows: 1fr; }
.journey-item.open .journey-panel > div { visibility: visible; transition-delay: 0s; }
.journey-item.open .journey-panel > div > * { opacity: 1; transform: none; transition-delay: .12s; }
.journey-item.open .journey-panel > div > .tags { transition-delay: .2s; }

/* ---------- Reference architecture (Capabilities, driven by js/arch.js) ---------- */
.arch { margin-top: 110px; }
.arch-head,
.arch-info { display: grid; grid-template-columns: .82fr 1.18fr; column-gap: clamp(50px, 10vw, 140px); }
.arch-head { align-items: end; margin-bottom: 40px; }
.arch-head h3 { margin: 0; font: 700 clamp(26px, 3vw, 36px)/1.2 var(--display); letter-spacing: -.03em; }
.arch-head > p { margin: 0; color: var(--muted); }
.arch-kicker,
.arch-label { margin: 0; text-transform: uppercase; letter-spacing: .14em; font-size: 11px; font-weight: 600; color: var(--muted); }
.arch-kicker { margin-bottom: 14px; color: var(--accent); letter-spacing: .16em; font-size: 12px; }

.arch-diagram { --gap: 36px; padding: 22px; border: 1px dashed var(--accent-line); }
.arch-band { display: flex; align-items: center; gap: 22px; margin-bottom: 26px; padding-bottom: 22px; border-bottom: 1px dashed var(--line); }
.arch-band-nodes { display: grid; flex: 1; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.arch-flow { display: grid; grid-template-columns: 1fr 1fr 2.5fr 1fr 1fr; gap: var(--gap); }
.arch-col { position: relative; display: flex; flex-direction: column; gap: 10px; }
.arch-col > .arch-label { line-height: 16px; }
/* Connector: dashes flow toward the next column (offset by half the label + gap so it meets the blocks' middle). */
.arch-col:not(:last-child)::after,
.arch-col:not(:last-child)::before { content: ""; position: absolute; top: calc(50% + 13px); left: 100%; }
.arch-col:not(:last-child)::after {
  width: var(--gap);
  height: 2px;
  margin-top: -1px;
  background: linear-gradient(90deg, var(--accent) 50%, transparent 0) 0 0 / 8px 2px repeat-x;
  opacity: .6;
  animation: arch-flow .9s linear infinite;
}
.arch-col:not(:last-child)::before {
  left: calc(100% + var(--gap) - 9px);
  width: 7px;
  height: 7px;
  margin-top: -4px;
  border-top: 2px solid var(--accent);
  border-right: 2px solid var(--accent);
  opacity: .6;
  transform: rotate(45deg);
}
@keyframes arch-flow { to { background-position: 8px 0; } }

.arch-node {
  display: flex;
  flex: 1;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  min-width: 0;
  min-height: 56px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  font: 700 15px/1.25 var(--display);
  text-align: left;
  cursor: pointer;
  transition: border-color .25s, background-color .25s, box-shadow .25s, opacity .3s, transform .3s var(--ease-out);
}
.arch-node small { color: var(--muted); font: 400 12px/1.35 var(--body); }
.arch-band-nodes .arch-node { min-height: 44px; padding: 10px 12px; align-items: center; text-align: center; }
.arch-node.is-active { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 9%, var(--surface)); box-shadow: inset 0 0 0 1px var(--accent); }
.arch-node.is-linked { border-color: var(--accent); }
.has-active .arch-node:not(.is-active, .is-linked) { opacity: .45; }

.arch-tiers {
  display: grid;
  flex: 1;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--line);
  background: color-mix(in srgb, var(--accent) 5%, transparent);
}
.arch-swatch { width: 20px; height: 3px; margin-bottom: 6px; background: var(--tier); }
[data-node="bronze"] { --tier: #b87333; }
[data-node="silver"] { --tier: #9aa3b5; }
[data-node="gold"] { --tier: #d4a72c; }

.arch-details { margin-top: 30px; }
.arch-info { grid-template-rows: auto auto 1fr; align-items: start; row-gap: 10px; padding: 28px 0; border-top: 1px solid var(--line); }
.arch-info > .arch-label { grid-column: 1; }
.arch-info h4 { grid-column: 1; margin: 0; font: 700 24px/1.3 var(--display); letter-spacing: -.02em; }
.arch-info-body { grid-column: 2; grid-row: 1 / 4; }
.arch-info-body p { margin: 0 0 12px; color: var(--body-text); }
.arch-info-body strong { color: var(--text); }
.arch-tags { display: flex; flex-wrap: wrap; gap: 8px; margin: 18px 0 0; padding: 0; list-style: none; }
.arch-tags li { padding: 4px 10px; border: 1px solid var(--line); color: var(--muted); font-size: 12px; }
/* With JS only the selected explanation shows; a min-height keeps the page from jumping between them. */
.arch-ready .arch-details { min-height: 230px; }
.arch-ready .arch-info:not(.is-active) { display: none; }
.arch-ready .arch-info.is-active { animation: arch-in .45s var(--ease-out) both; }
@keyframes arch-in { from { opacity: 0; transform: translateY(8px); } }

/* ---------- Language switch (header) ---------- */
.lang-switch { order: 3; display: flex; margin-left: 22px; }
.lang-switch a {
  display: grid;
  place-items: center;
  min-width: 32px;
  height: 40px;
  color: var(--on-dark-soft);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .08em;
  text-decoration: none;
  transition: color .2s;
}
.lang-switch a[aria-current] { color: #fff; text-decoration: underline; text-decoration-color: var(--green); text-underline-offset: 6px; text-decoration-thickness: 2px; }
.lang-switch a:hover { color: #fff; }
.lang-switch + .theme-toggle { margin-left: 10px; }

/* ---------- Contact form (on the blue contact section; sent by js/contact.js to contact.php) ---------- */
.contact-inner { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(40px, 7vw, 100px); align-items: start; }
.contact-copy h2 { font-size: clamp(40px, 4.8vw, 64px); }
.contact-form { display: grid; gap: 16px; padding: 30px; background: rgba(11, 16, 32, .22); border: 1px solid rgba(255, 255, 255, .22); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.field { display: grid; gap: 7px; }
.field label { font-size: 13px; font-weight: 600; }
.field input,
.field textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid rgba(255, 255, 255, .4);
  border-radius: 0;
  background: rgba(255, 255, 255, .08);
  color: #fff;
  font: inherit;
  font-size: 16px;
  transition: border-color .2s, background-color .2s;
}
.field textarea { min-height: 140px; resize: vertical; }
.field input:focus,
.field textarea:focus { border-color: #fff; background: rgba(255, 255, 255, .14); }
.form-trap { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.form-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 20px; }
.form-foot .button { border: 0; cursor: pointer; font-family: inherit; }
.form-foot .button:disabled { opacity: .6; cursor: progress; }
.contact-section p.form-note { margin: 0; font-size: 13px; color: rgba(255, 255, 255, .85); }
.form-note a { color: #fff; }
.contact-section p.form-status { margin: 0; font-size: 15px; font-weight: 600; }
.form-status:empty { display: none; }
.form-status[data-state="ok"] { color: var(--green); }
.form-status[data-state="error"]::before { content: "! "; }

@media (max-width: 980px) {
  .contact-inner { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .contact-form { padding: 20px; }
  .form-row { grid-template-columns: 1fr; }
}

@media (hover: hover) {
  .arch-node:hover { transform: translateY(-2px); border-color: var(--accent); }
}

@media (max-width: 980px) {
  .arch { margin-top: 80px; }
  .arch-head,
  .arch-info { grid-template-columns: 1fr; }
  .arch-head > p { margin-top: 22px; }
  .arch-info-body { grid-column: 1; grid-row: auto; margin-top: 8px; }
  /* Columns stack; connectors turn vertical and point down. */
  .arch-flow { grid-template-columns: 1fr; --gap: 30px; }
  .arch-col { flex-flow: row wrap; }
  .arch-col > .arch-label { flex-basis: 100%; }
  .arch-col:not(:last-child)::after,
  .arch-col:not(:last-child)::before { top: 100%; left: 50%; }
  .arch-col:not(:last-child)::after {
    width: 2px;
    height: var(--gap);
    margin: 0 0 0 -1px;
    background: linear-gradient(180deg, var(--accent) 50%, transparent 0) 0 0 / 2px 8px repeat-y;
    animation-name: arch-flow-down;
  }
  .arch-col:not(:last-child)::before { top: calc(100% + var(--gap) - 9px); margin: 0 0 0 -4px; transform: rotate(135deg); }
  .arch-ready .arch-details { min-height: 0; }
}
@keyframes arch-flow-down { to { background-position: 0 8px; } }

@media (max-width: 760px) {
  .arch-diagram { padding: 14px; }
  .arch-band { flex-direction: column; align-items: stretch; gap: 12px; }
  .arch-band-nodes { gap: 8px; }
  .arch-band-nodes .arch-node { padding: 10px 6px; font-size: 13px; }
  .arch-tiers { gap: 8px; padding: 8px; }
  .arch-node { padding: 11px 12px; font-size: 14px; }
}

@media (hover: hover) {
  .theme-toggle:hover { border-color: rgba(255, 255, 255, .6); background: rgba(255, 255, 255, .06); }
  .journey-toggle:hover::after { color: #fff; }
}

@media (max-width: 980px) {
  /* Between tablet and phone the translated nav labels are longer; tighten so DE/FR still fit on one line. */
  .site-nav { gap: 18px; font-size: 13px; }
  .site-nav .nav-cta { padding: 8px 12px; }
  .lang-switch { margin-left: 12px; }
  .hero-layout { grid-template-columns: 1fr; gap: 36px; }
  .portrait-wrap { order: -1; justify-self: start; width: 120px; margin-left: 9px; }
  .portrait { border-width: 4px; }
  .portrait-accent { inset: -9px; }
  .split-layout,
  .personal-layout { grid-template-columns: 1fr; gap: 40px; }
  .focus-grid { grid-template-columns: 1fr; }
  .focus-card { min-height: auto; }
  .card-icon { margin-bottom: 45px; }
  .focus-card p { min-height: 0; }
  .earlier-grid { grid-template-columns: 1fr; }
  .section-heading { display: block; }
  .section-heading > p { margin-top: 22px; }
}

@media (max-width: 760px) {
  :root { --shell: min(calc(100% - 32px), 1180px); }
  body { font-size: 16px; }
  .site-header { background: rgba(11, 16, 32, .94); }
  .menu-toggle { display: block; }
  .site-nav {
    position: absolute;
    inset: 78px 0 auto;
    display: none;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 14px 16px 20px;
    background: var(--ink);
    border-top: 1px solid rgba(255, 255, 255, .1);
  }
  .site-nav.open { display: flex; }
  .site-nav.nav-simple { position: static; display: flex; padding: 0; background: none; border: 0; }
  .site-nav a { padding: 13px 8px; }
  .site-nav .nav-cta { margin-top: 8px; text-align: center; }
  .site-nav a::after { display: none; }
  .theme-toggle { margin: 0 6px 0 0; }
  .lang-switch { margin-left: 0; }
  .lang-switch a { min-width: 28px; }
  .lang-switch + .theme-toggle { margin-left: 6px; }
  .hero { padding-top: 120px; }
  .portrait-wrap { width: 96px; }
  .hero h1 { font-size: clamp(42px, 12.5vw, 64px); }
  .hero-intro { font-size: 18px; }
  .hero-actions,
  .contact-actions { flex-direction: column; }
  .proof-row { grid-template-columns: 1fr; margin-top: 64px; }
  .proof-row > div,
  .proof-row > div + div { padding: 18px 0; border-right: 0; border-bottom: 1px solid rgba(255, 255, 255, .12); }
  .section { padding: 88px 0; }
  .focus-card { padding: 28px; }
  .journey-item { grid-template-columns: 96px 24px 1fr; }
  .journey-content { padding: 28px 0 36px 20px; }
  .journey-when { padding-top: 31px; font-size: 12px; }
  .journey-marker span { margin-top: 35px; }
  .journey-content h3 { font-size: 25px; }
  .contact-section { padding: 90px 0; }
  .footer-inner { grid-template-columns: 1fr; gap: 12px; }
  .footer-disclaimer { justify-self: start; text-align: left; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    transition-duration: .01ms !important;
    transition-delay: 0s !important;
    animation-duration: .01ms !important;
    animation-delay: 0s !important;
    animation-iteration-count: 1 !important;
  }
  .js [data-reveal],
  .js [data-stagger] > * { opacity: 1; transform: none; }
  .js .journey-marker::after { transform: none; }
  .cursor-ring { display: none; }
}

@media print {
  .js [data-reveal],
  .js [data-stagger] > * { opacity: 1 !important; transform: none !important; }
  *, *::before, *::after { animation: none !important; }
  .site-header { position: static; }
  .menu-toggle, .skip-link, .hero-flow, .contact-orb, .contact-orb3d, .journey-path3d, .theme-toggle, .cursor-ring, .hoops-ball, .hoops-hoop, .hoops-toast { display: none; }
  .journey-panel { grid-template-rows: 1fr !important; }
  .journey-panel > div { visibility: visible !important; }
  .journey-toggle::after { display: none; }
  .arch-ready .arch-info { display: grid !important; animation: none; }
  .arch-node { opacity: 1 !important; }
}

/* ---------- Basketball easter egg (js/hoops.js) ---------- */
/* The trigger looks exactly like its sibling tags; only the hover hints that it does something. */
.egg-tag { padding: 5px 10px; border: 0; background: var(--paper); color: var(--muted); font: inherit; font-size: 12px; cursor: pointer; transition: background-color .25s, color .25s, transform .25s var(--ease-out); }
.egg-tag[aria-pressed="true"] { background: #e8742a; color: #fff; }
@media (hover: hover) {
  .egg-tag:hover { background: #e8742a; color: #fff; animation: dribble .5s var(--ease-out); }
}
@keyframes dribble { 40% { transform: translateY(-5px); } 70% { transform: translateY(1px); } }

.hoops-ball { position: fixed; top: 0; left: 0; z-index: 9001; width: 44px; height: 44px; cursor: grab; touch-action: none; will-change: transform; filter: drop-shadow(0 6px 8px rgba(11, 16, 32, .3)); }
.hoops-ball svg { display: block; width: 100%; height: 100%; }
.hoops-ball.is-held { cursor: grabbing; }
.hoops-ball.is-out { opacity: 0; transition: opacity .35s; }
.hoops-hoop { position: fixed; z-index: 9000; width: 126px; color: var(--text); opacity: 0; transform: translateX(60px); transition: opacity .4s, transform .5s var(--ease-out); }
.hoops-hoop.is-in { opacity: 1; transform: none; }
.hoops-hoop svg { display: block; width: 126px; height: 150px; }
.hoops-score { position: absolute; top: -30px; left: 10px; width: 80px; text-align: center; font: 800 20px var(--display); color: #e8742a; }
.hoops-close { position: absolute; top: -34px; right: 0; width: 30px; height: 30px; border: 1px solid var(--line); background: var(--surface); color: var(--text); font-size: 18px; line-height: 1; cursor: pointer; }
.hoops-hoop.is-score .hoops-net { animation: swish .45s var(--ease-out); transform-origin: 50px 70px; }
.hoops-hoop.is-score .hoops-score { animation: pop-in .4s var(--ease-out); }
@keyframes swish { 40% { transform: scaleY(1.18) scaleX(.9); } }
.hoops-toast { position: fixed; z-index: 9002; translate: -50% 0; padding: 6px 12px; background: var(--ink); color: #fff; font: 700 15px var(--display); pointer-events: none; max-width: min(90vw, 420px); text-align: center; animation: hoops-toast 1.4s var(--ease-out) forwards; }
@keyframes hoops-toast { 0% { opacity: 0; transform: translateY(10px); } 15%, 70% { opacity: 1; transform: none; } 100% { opacity: 0; transform: translateY(-24px); } }
@media (prefers-reduced-motion: reduce) {
  /* The calm-mode message still needs to stay readable long enough. */
  .hoops-toast { animation: none; transition: none; }
}

/* ---------- Narrow-screen fixes for translated text ---------- */
/* Long German compounds ("Architektonisches") must break on small phones instead of widening the page. */
h1, h2, h3, h4 { overflow-wrap: break-word; }
:lang(de) h1, :lang(de) h2, :lang(de) h3 { hyphens: auto; }
.journey-content { min-width: 0; }
@media (min-width: 761px) and (max-width: 860px) {
  /* The FS mark alone links home while the longer DE/FR nav needs the room. */
  .site-header .brand > span:not(.brand-mark) { display: none; }
}
@media (max-width: 520px) {
  /* The brand already links home; the language switch and theme toggle need the space on legal pages. */
  .site-nav.nav-simple { display: none; }
}
@media (max-width: 380px) {
  /* Smallest phones: narrower date column so role titles plus the +/× toggle still fit. */
  .journey-item { grid-template-columns: 70px 20px 1fr; }
  .journey-content { padding-left: 14px; }
  .journey-content h3 { font-size: 21px; }
  .journey-toggle { gap: 10px; }
}
@media (max-width: 760px) {
  /* Stacked diagram rows: blocks wrap onto a second line rather than squeezing long (German) labels. */
  .arch-col > .arch-node { flex: 1 1 110px; }
}
