/* Portfolio prototype, Mayssa Ben Romdhane.
   Brand kept from her contact page: the sky-blue hero gradient, Outfit, and Instrument Serif italic
   for the role line and the closing line. Everything else follows flat colour and tone steps. */

/* ---------- Palettes (from the mood board) ---------- */
:root,
[data-theme="a"] { /* A · Sky glow */
  --bg: #ffffff;
  --surface: #ffffff;
  --tint: #e8f3ff;
  --ink: #081a33;
  --muted: #3d5270;
  --accent: #3fa2ff;
  --accent-soft: #9dd2ff;
  --link: #1268cf;
  --btn: #081a33;
  --btn-ink: #ffffff;
  --band: #081a33;
  --band-2: #12294a;
  --band-ink: #eaf3ff;
  --band-muted: #b6c9e2;
  --line: rgba(8, 26, 51, 0.1);
  --glow: #3fa2ff;
  --glow-o: 1;
  --glass: rgba(255, 255, 255, 0.9);
  --shadow: 0 18px 40px -16px rgba(8, 26, 51, 0.35);
}
[data-theme="n"] { /* N · Sky x navy */
  --bg: #eef3fa;
  --surface: #ffffff;
  --tint: #dcebfb;
  --ink: #081a33;
  --muted: #3f4d63;
  --accent: #3fa2ff;
  --accent-soft: #9dd2ff;
  --link: #1268cf;
  --btn: #081a33;
  --btn-ink: #ffffff;
  --band: #0a2971;
  --band-2: #173a8c;
  --band-ink: #eef3fa;
  --band-muted: #c2d0ee;
  --line: rgba(8, 26, 51, 0.1);
  --glow: #3fa2ff;
  --glow-o: 0.95;
  --glass: rgba(255, 255, 255, 0.9);
  --shadow: 0 18px 40px -16px rgba(10, 41, 113, 0.35);
}
[data-theme="m"] { /* M · Electric indigo */
  --bg: #eef0f6;
  --surface: #ffffff;
  --tint: #e0e3ee;
  --ink: #111318;
  --muted: #4a4e5c;
  --accent: #4361ee;
  --accent-soft: #a9b6ff;
  --link: #3348d6;
  --btn: #111318;
  --btn-ink: #ffffff;
  --band: #0a2971;
  --band-2: #1b3b8f;
  --band-ink: #eef0f6;
  --band-muted: #c0c9eb;
  --band-hot: #a9b6ff;
  --line: rgba(17, 19, 24, 0.1);
  --glow: #8f9cf5;
  --glow-o: 0.7;
  --glass: rgba(255, 255, 255, 0.9);
  --shadow: 0 18px 40px -16px rgba(17, 19, 24, 0.35);
}
[data-theme="c"] { /* C · Midnight lab */
  --bg: #060e1a;
  --surface: #0f1f35;
  --tint: #0f1f35;
  --ink: #eaf3ff;
  --muted: #a9bdd6;
  --accent: #3fa2ff;
  --accent-soft: #1f4a80;
  --link: #9dd2ff;
  --btn: #eaf3ff;
  --btn-ink: #060e1a;
  --band: #0b1830;
  --band-2: #13284a;
  --band-ink: #eaf3ff;
  --band-muted: #a9bdd6;
  --line: rgba(234, 243, 255, 0.1);
  --glow: #2f7fd6;
  --glow-o: 0.5;
  --glass: rgba(15, 31, 53, 0.92);
  --shadow: 0 18px 40px -16px rgba(0, 0, 0, 0.8);
  --logo-filter: brightness(0) invert(1);
  --logo-hover: brightness(0) invert(1);
  color-scheme: dark;
}

:root {
  --sans: "Outfit", system-ui, -apple-system, "Segoe UI", sans-serif;
  --serif: "Instrument Serif", "Times New Roman", serif;
  --gutter: clamp(20px, 4vw, 56px);
  --max: 1240px;
  --pad-x: max(var(--gutter), calc((100% - var(--max)) / 2));
  --gap-section: clamp(96px, 11vw, 176px);
  --radius: 24px;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);

  /* Five sizes */
  --fs-display: clamp(44px, 6.4vw, 96px);
  --fs-h2: clamp(36px, 4.4vw, 60px);
  --fs-h3: clamp(22px, 2vw, 28px);
  --fs-lead: clamp(18px, 1.5vw, 21px);
  --fs-small: 14px;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; scroll-padding-top: 80px; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 17px/1.55 var(--sans);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img, video { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
h1, h2, h3 { margin: 0; font-weight: 500; letter-spacing: -0.03em; text-wrap: balance; }
h2 { font-size: var(--fs-h2); line-height: 1.02; }
h3 { font-size: var(--fs-h3); line-height: 1.12; letter-spacing: -0.02em; }
p { margin: 0; text-wrap: pretty; }
em { font-family: var(--serif); font-style: italic; font-weight: 400; letter-spacing: -0.01em; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--link); outline-offset: 3px; border-radius: 6px; }
.lead { font-size: var(--fs-lead); line-height: 1.45; color: var(--ink); max-width: 46ch; }
.row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 24px; }

/* Buttons: flat pill, one fill */
.btn {
  display: inline-flex;
  align-items: center;
  height: 50px;
  padding: 0 26px;
  border-radius: 999px;
  font-size: 16px;
  font-weight: 500;
  white-space: nowrap;
  transition: transform 0.25s var(--ease), background-color 0.25s;
}
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0) scale(0.98); }
.btn-ink { background: var(--btn); color: var(--btn-ink); }
.btn-ink:hover { background: var(--link); color: #fff; }
.btn-sm { height: 40px; padding: 0 18px; font-size: 14px; }
.text-link {
  font-weight: 500;
  color: var(--link);
  text-decoration: underline;
  text-decoration-thickness: 1.5px;
  text-underline-offset: 4px;
  transition: text-underline-offset 0.2s;
}
.text-link:hover { text-underline-offset: 7px; }

/* Citation marker: the page's recurring device */
.cite {
  display: inline-grid;
  place-items: center;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  margin-left: 4px;
  border-radius: 999px;
  background: var(--accent);
  color: #081a33;
  font: 600 13px/1 var(--sans);
  letter-spacing: 0;
  vertical-align: super;
  transition: transform 0.2s var(--ease);
}
.cite:hover { transform: translateY(-2px) scale(1.08); }

/* ---------- Nav ---------- */
.nav {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 12px 20px;
  padding: 14px var(--pad-x);
  transition: background-color 0.3s, transform 0.35s var(--ease);
}
.nav.scrolled {
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}
.nav.hide { transform: translateY(-100%); }
.wordmark { font-family: var(--serif); font-style: italic; font-size: 24px; letter-spacing: -0.01em; white-space: nowrap; }
.nav-links { display: flex; gap: 28px; margin: 0 auto; }
.nav-links a { font-size: 16px; color: var(--ink); padding: 6px 0; position: relative; }
.nav-links a::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 2px; background: currentColor; transform: scaleX(0); transform-origin: left; transition: transform 0.3s var(--ease); }
.nav-links a:hover::after { transform: scaleX(1); }

/* Palette switcher (prototype tool) */
.pal {
  position: relative;
  flex: none;
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 3px;
  border-radius: 999px;
  background: var(--glass);
  color: var(--ink);
}
.pal-step, .pal-btn { border: 0; background: transparent; cursor: pointer; color: inherit; border-radius: 999px; }
.pal-step { width: 32px; height: 32px; font-size: 17px; line-height: 1; }
.pal-btn { display: flex; align-items: center; gap: 8px; height: 32px; padding: 0 10px; font-size: 14px; white-space: nowrap; }
.pal-step:hover, .pal-btn:hover, .pal-btn[aria-expanded="true"] { background: var(--tint); }
.pal-dots, .pal-strip { display: inline-flex; padding-left: 4px; }
.pal-dots i, .pal-strip i { width: 13px; height: 13px; margin-left: -4px; border-radius: 50%; outline: 1.5px solid var(--surface); }
.pal-name b { font-weight: 600; margin-right: 4px; }
.pal-caret { font-size: 10px; opacity: 0.6; }
.pal-pop {
  position: absolute;
  z-index: 50;
  top: calc(100% + 8px);
  right: 0;
  width: 310px;
  padding: 6px;
  border-radius: 16px;
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow); /* taste-skill-ignore: a floating menu */
}
.pal-pop[hidden] { display: none; }
.pal-menu { max-height: min(62vh, 560px); overflow: auto; margin: 0; padding: 0; list-style: none; }
.pal-extra { display: grid; gap: 6px; margin-top: 6px; padding: 12px 10px 8px; border-radius: 10px; background: var(--tint); font-size: 14px; }
.pal-toggle { display: flex; align-items: center; gap: 8px; cursor: pointer; }
.pal-legend { color: var(--muted); }
.pal-menu li { display: grid; grid-template-columns: 22px minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 10px; cursor: pointer; font-size: 14px; }
.pal-menu li:hover, .pal-menu li:focus, .pal-menu li.on { background: var(--tint); outline: none; }
.pal-menu li.on { font-weight: 500; }
.pal-letter { font-weight: 600; font-size: 14px; color: var(--muted); }
.pal-strip i { width: 15px; height: 15px; }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  isolation: isolate;
  background: var(--bg);
  overflow: hidden;
  padding: 112px var(--pad-x) 0;
  display: grid;
  justify-items: center;
}
/* The glow: two blurred ellipses of the brand colour behind the headline, fading to the page colour
   at the top and bottom, so the portrait and the logo strip sit on clean ground. */
.hero-glow { position: absolute; inset: 0; z-index: -1; pointer-events: none; opacity: var(--glow-o, 1); }
.hero-glow i { position: absolute; display: block; border-radius: 50%; background: var(--glow); }
.hero-glow i:nth-child(1) { left: -25%; right: -25%; top: clamp(170px, 16vw, 240px); height: clamp(360px, 36vw, 540px); filter: blur(clamp(56px, 6.5vw, 96px)); opacity: 0.8; }
.hero-glow i:nth-child(2) { left: -5%; right: -5%; top: clamp(250px, 23vw, 350px); height: clamp(180px, 17vw, 260px); filter: blur(clamp(40px, 4.5vw, 64px)); }
.hero-intro { position: relative; z-index: 3; text-align: center; display: grid; justify-items: center; }
.hero h1 { display: flex; flex-direction: column; align-items: center; }
.hero .hi { font-size: var(--fs-display); font-weight: 500; line-height: 1; letter-spacing: -0.045em; }
.hero .role { font-family: var(--serif); font-style: italic; font-weight: 400; font-size: clamp(64px, 10vw, 150px); line-height: 0.95; letter-spacing: -0.02em; }
.hero-lede { margin-top: 32px; font-size: var(--fs-lead); line-height: 1.45; max-width: 48ch; }
.hero-actions { margin-top: 28px; justify-content: center; }
.hero .text-link { color: var(--ink); } /* sits on the glow: the ink keeps it readable on every palette */

.hero-stage {
  position: relative;
  z-index: 2;
  width: min(420px, 74vw);
  margin-top: 24px;
}
.arch {
  position: absolute;
  left: 6%;
  right: 6%;
  bottom: 0;
  height: 84%;
  border-radius: 999px 999px 0 0;
  background: var(--link);
}
.portrait {
  position: relative;
  width: 100%;
  height: auto;
  filter: grayscale(1) contrast(1.05);
}
/* Arch and portrait fade out together, as one picture, so the arch never shows through her. */
.hero-figure {
  position: relative;
  -webkit-mask-image: linear-gradient(180deg, #000 74%, transparent 99%); /* taste-skill-ignore: fade mask */
  mask-image: linear-gradient(180deg, #000 74%, transparent 99%); /* taste-skill-ignore: fade mask */
}
.float-chip {
  position: absolute;
  z-index: 3;
  padding: 10px 20px;
  border-radius: 999px;
  background: #ffffff;
  color: #081a33;
  font-size: 16px;
  font-weight: 500;
  white-space: nowrap;
  transition: transform 0.3s var(--ease), background-color 0.3s;
}
.float-chip:hover { background: #081a33; color: #fff; }
.fc-1 { left: -30%; top: 26%; rotate: -6deg; }
.fc-2 { right: -30%; top: 16%; rotate: 7deg; }
.fc-3 { left: -40%; top: 58%; rotate: 3deg; }
.hero-stat {
  position: absolute;
  z-index: 4;
  right: var(--pad-x);
  bottom: 48px;
  width: 260px;
  padding: 20px 22px;
  border-radius: 20px;
  background: var(--glass);
  color: var(--muted);
  font-size: 14px;
  line-height: 1.4;
}
.hero-stat b { display: block; font-size: 36px; font-weight: 500; line-height: 1; letter-spacing: -0.04em; color: var(--ink); margin-bottom: 8px; }

/* ---------- Where I've built ---------- */
.strip {
  display: flex;
  align-items: center;
  gap: 40px;
  padding: 32px var(--pad-x);
  background: var(--tint);
}
.strip-title { flex: none; font-size: 16px; font-weight: 500; letter-spacing: 0; color: var(--muted); }
.marquee {
  overflow: hidden;
  flex: 1;
  min-width: 0;
  max-width: 100%;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent); /* taste-skill-ignore: brand hero gradient (contact page) or a fade mask */
  mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent); /* taste-skill-ignore: brand hero gradient (contact page) or a fade mask */
}
.marquee-track { display: flex; width: max-content; }
.marquee-track.is-running { animation: marquee var(--marquee-duration, 30s) linear infinite; }
.marquee:hover .marquee-track { animation-play-state: paused; }
@keyframes marquee { to { transform: translateX(-50%); } }
.marquee-group { flex: none; display: flex; align-items: center; gap: 72px; margin: 0; padding: 0 72px 0 0; list-style: none; }
.logo-item { flex: none; display: flex; align-items: center; gap: 10px; color: var(--ink); opacity: 0.6; transition: opacity 0.3s; }
.logo-item:hover { opacity: 1; }
.logo-img { width: auto; max-width: none; filter: var(--logo-filter, brightness(0)); transition: filter 0.3s; }
.logo-item:hover .logo-img { filter: var(--logo-hover, none); }
.logo-cross { width: 26px; height: 26px; fill: currentColor; }
.logo-text { font-size: 14px; font-weight: 600; line-height: 1.05; white-space: nowrap; }

/* ---------- Generic sections ---------- */
.section, .band { position: relative; padding: var(--gap-section) var(--pad-x); }
.band { background: var(--band); color: var(--band-ink); }
.band .lead { color: var(--band-ink); }
.section-head { margin-bottom: clamp(40px, 5vw, 72px); display: grid; gap: 18px; }

/* ---------- Ask (live thing) ---------- */
.ask { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: clamp(32px, 5vw, 80px); align-items: start; }
.ask-intro { display: grid; gap: 22px; }
.ask-questions { display: grid; gap: 10px; margin-top: 12px; }
.q {
  text-align: left;
  border: 0;
  border-radius: 18px;
  padding: 16px 20px;
  background: var(--tint);
  color: var(--ink);
  font-size: 16px;
  line-height: 1.35;
  cursor: pointer;
  transition: background-color 0.25s, color 0.25s, transform 0.25s var(--ease);
}
.q:hover { transform: translateX(4px); }
.q.is-on { background: var(--btn); color: var(--btn-ink); }
.answer {
  position: sticky;
  top: 96px;
  background: var(--band);
  color: var(--band-ink);
  border-radius: 28px;
  padding: clamp(28px, 4vw, 48px);
  min-height: 420px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}
.answer {
  --hot: var(--band-hot, var(--accent));
  --dim: color-mix(in srgb, var(--band-ink) 42%, var(--band));
  --well: color-mix(in srgb, var(--band-2) 70%, var(--band));
}
.answer-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 10px 20px; }
.answer-q { font-size: 16px; color: var(--band-muted); }
.answer-text { font-size: clamp(19px, 1.6vw, 23px); line-height: 1.4; letter-spacing: -0.01em; }

/* Retrieval steps: they tick on before the answer arrives */
.answer-steps { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 14px; white-space: nowrap; font-size: 14px; color: var(--band-muted); }
.answer-steps li { display: inline-flex; align-items: center; gap: 7px; opacity: 0.45; transition: opacity 0.25s; }
.answer-steps li::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--dim); transition: background-color 0.25s; }
.answer-steps li.done, .answer-steps li.busy { opacity: 1; }
.answer-steps li.done::before { background: var(--hot); }
.answer-steps li.busy::before { animation: blink 0.5s ease-in-out infinite alternate; }
@keyframes blink { to { transform: scale(0.5); } }

/* ---------- Exhibits: one picture per answer ---------- */
.exhibit { margin: 0; padding: clamp(18px, 2.4vw, 26px); border-radius: 20px; background: var(--well); display: grid; gap: 16px; min-height: 262px; align-content: space-between; }
.exhibit figcaption { font-size: var(--fs-small); color: var(--band-muted); }
.exhibit > div { animation: exin 0.5s var(--ease) both; }
@keyframes exin { from { opacity: 0; transform: translateY(10px); } }

/* HCI: one stack wired to ten platforms */
.ex-hci { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(48px, 1fr) 30px; align-items: stretch; min-height: 190px; }
.ex-stack { display: grid; grid-template-rows: repeat(3, 1fr); gap: 8px; }
.ex-stack span { display: flex; align-items: center; padding: 0 16px; border-radius: 12px; background: var(--band); color: var(--band-ink); font-size: 15px; line-height: 1.2; animation: exin 0.5s var(--ease) both; animation-delay: 0.3s; }
.ex-stack span:nth-child(1) { background: var(--hot); color: #081a33; font-weight: 500; animation-delay: 0.6s; }
.ex-stack span:nth-child(2) { animation-delay: 0.45s; }
.ex-wires { width: 100%; height: 100%; overflow: visible; }
.ex-wires path { fill: none; vector-effect: non-scaling-stroke; }
.ex-wires .base path { stroke: var(--dim); stroke-width: 1.5; stroke-dasharray: 1; animation: draw 0.9s var(--ease) both; animation-delay: 0.7s; }
.ex-wires .flow path { stroke: var(--hot); stroke-width: 2.5; stroke-linecap: round; stroke-dasharray: 0.6 3.4; animation: flow 1.6s linear infinite; }
.ex-wires .flow path:nth-child(2n) { animation-duration: 2.1s; }
@keyframes draw { from { stroke-dashoffset: 1; } }
@keyframes flow { to { stroke-dashoffset: -4; } }
.ex-platforms { list-style: none; margin: 0; padding: 0; display: grid; grid-template-rows: repeat(10, 1fr); align-items: center; }
.ex-platforms li { height: 12px; border-radius: 4px; background: var(--dim); animation: ping 3s ease-in-out infinite; }
.ex-platforms li:nth-child(2) { animation-delay: 0.3s; } .ex-platforms li:nth-child(3) { animation-delay: 0.6s; }
.ex-platforms li:nth-child(4) { animation-delay: 0.9s; } .ex-platforms li:nth-child(5) { animation-delay: 1.2s; }
.ex-platforms li:nth-child(6) { animation-delay: 1.5s; } .ex-platforms li:nth-child(7) { animation-delay: 1.8s; }
.ex-platforms li:nth-child(8) { animation-delay: 2.1s; } .ex-platforms li:nth-child(9) { animation-delay: 2.4s; }
.ex-platforms li:nth-child(10) { animation-delay: 2.7s; }
@keyframes ping { 0%, 70%, 100% { background: var(--dim); } 15% { background: var(--hot); } }

/* Eval: indexed bars, before vs after */
.ex-eval { display: grid; gap: 18px; }
.ex-legend { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 14px; color: var(--band-muted); }
.ex-legend span { display: inline-flex; align-items: center; gap: 8px; }
.ex-legend span::before { content: ""; width: 14px; height: 8px; border-radius: 2px; background: var(--dim); }
.ex-legend .k-after::before { background: var(--hot); }
.ex-bars { --lab: 92px; position: relative; display: grid; gap: 16px; }
.ex-bars::before { content: ""; position: absolute; top: -4px; bottom: 22px; left: calc(var(--lab) + 12px + (100% - var(--lab) - 12px) * 0.624); width: 2px; transform: translateX(-1px); background: color-mix(in srgb, var(--band-ink) 30%, transparent); }
.ex-row { display: grid; grid-template-columns: var(--lab) minmax(0, 1fr); align-items: center; gap: 12px; }
.ex-lab { font-size: 15px; color: var(--band-ink); }
.ex-track { display: grid; gap: 3px; }
.ex-track i { display: block; height: 14px; width: calc(var(--v) / 125 * 78%); border-radius: 0 4px 4px 0; background: var(--dim); transform-origin: left; animation: grow 0.9s var(--ease) both; }
.ex-track i.a { position: relative; background: var(--hot); animation-delay: 0.3s; }
.ex-track i.a::after { content: attr(data-v); position: absolute; left: calc(100% + 10px); top: 50%; transform: translateY(-50%); font-size: 15px; font-weight: 600; color: var(--band-ink); white-space: nowrap; }
@keyframes grow { from { transform: scaleX(0); } }
.ex-axis { position: relative; height: 18px; font-size: 13px; color: var(--band-muted); }
.ex-axis span { position: absolute; top: 0; left: calc(var(--lab, 92px) + 12px + (100% - var(--lab, 92px) - 12px) * 0.624); transform: translateX(-50%); white-space: nowrap; }
.ex-loop { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; font-size: 14px; }
.ex-loop li { padding: 6px 12px; border-radius: 999px; background: var(--band); color: var(--band-ink); animation: tick 4s steps(1) infinite; }
.ex-loop li:nth-child(2) { animation-delay: 1s; } .ex-loop li:nth-child(3) { animation-delay: 2s; } .ex-loop li:nth-child(4) { animation-delay: 3s; }
@keyframes tick { 0% { background: var(--hot); color: #081a33; } 25%, 100% { background: var(--band); color: var(--band-ink); } }

/* Computer vision: footage with its mask, two meters */
.ex-cv { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 22px; align-items: center; }
.ex-thumb { border-radius: 14px; }
.ex-thumb .seg-label { left: 10px; top: 10px; font-size: 13px; padding: 4px 10px; }
.ex-meters { display: grid; gap: 20px; }
.ex-meter p { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 8px; font-size: 15px; line-height: 1.25; }
.ex-meter b { font-size: 26px; font-weight: 500; letter-spacing: -0.02em; }
.ex-gauge { height: 10px; border-radius: 4px; background: var(--dim); overflow: hidden; }
.ex-gauge i { display: block; height: 100%; width: calc(var(--v) * 1%); border-radius: 0 4px 4px 0; background: var(--hot); transform-origin: left; animation: grow 1.1s var(--ease) both; animation-delay: 0.2s; }
.ex-meter.cut .ex-gauge i { animation: cut 1.4s var(--ease) both; animation-delay: 0.6s; }
@keyframes cut { from { width: 100%; } }

/* Agents: a run that stops for a person */
.ex-agents { display: grid; gap: 18px; }
.ex-steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); }
.ex-steps li { position: relative; display: grid; justify-items: center; align-content: start; gap: 10px; text-align: center; font-size: 14px; line-height: 1.25; color: var(--band-muted); transition: color 0.3s; }
.ex-steps li:not(:last-child)::after { content: ""; position: absolute; top: 9px; left: calc(50% + 14px); right: calc(-50% + 14px); height: 2px; background: var(--dim); transition: background-color 0.3s; }
.ex-steps li.done:not(:last-child)::after { background: var(--band-ink); }
.ex-steps b { position: relative; z-index: 1; width: 20px; height: 20px; border-radius: 50%; background: var(--dim); outline: 2px solid transparent; transition: background-color 0.3s, transform 0.3s var(--ease); }
.ex-steps .gate b { border-radius: 6px; }
.ex-steps li.done, .ex-steps li.on { color: var(--band-ink); }
.ex-steps li.done b { background: var(--band-ink); }
.ex-steps li.on b { background: var(--hot); transform: scale(1.15); animation: ring 1.2s ease-out infinite; }
.ex-steps li.fail b { background: transparent; outline-color: var(--hot); outline-offset: -2px; animation: none; }
@keyframes ring { from { outline-color: var(--hot); outline-offset: 0; } to { outline-color: transparent; outline-offset: 9px; } }
.ex-status { min-height: 1.4em; font-size: 16px; color: var(--band-ink); }
.ex-trace { display: grid; grid-template-columns: auto repeat(5, minmax(0, 1fr)); align-items: center; gap: 3px; font-size: 13px; color: var(--band-muted); }
.ex-trace span { margin-right: 10px; }
.ex-trace i { height: 8px; border-radius: 2px; background: var(--dim); transition: background-color 0.3s; }
.ex-trace i.on { background: var(--hot); }

/* Where: the map and the languages */
.ex-where { display: grid; grid-template-columns: 128px minmax(0, 1fr); gap: clamp(20px, 3vw, 40px); align-items: center; }
.ex-map { width: 100%; height: auto; max-height: 230px; overflow: visible; }
.ex-map path { fill: color-mix(in srgb, var(--band-ink) 22%, var(--well)); }
.ex-map .pin { fill: var(--hot); stroke: var(--band); stroke-width: 2.5; }
.ex-map .ring { fill: none; stroke: var(--hot); stroke-width: 2; transform-box: fill-box; transform-origin: center; animation: pulse 2s ease-out infinite; }
@keyframes pulse { from { transform: scale(1); opacity: 1; } to { transform: scale(3.2); opacity: 0; } }
.ex-map text { fill: var(--band-ink); font: 600 17px var(--sans); paint-order: stroke; stroke: color-mix(in srgb, var(--band-ink) 22%, var(--well)); stroke-width: 4px; }
.ex-langs { display: grid; gap: 12px; }
.ex-scale, .ex-lang { display: grid; grid-template-columns: 70px repeat(6, minmax(0, 1fr)) 64px; align-items: center; gap: 4px; }
.ex-scale i { font-style: normal; font-size: 13px; color: var(--band-muted); text-align: center; }
.ex-lang span { font-size: 15px; }
.ex-lang b { height: 14px; border-radius: 3px; background: var(--dim); }
.ex-lang b.on { background: var(--hot); animation: exin 0.4s var(--ease) both; }
.ex-lang b:nth-of-type(2) { animation-delay: 0.08s; } .ex-lang b:nth-of-type(3) { animation-delay: 0.16s; }
.ex-lang b:nth-of-type(4) { animation-delay: 0.24s; } .ex-lang b:nth-of-type(5) { animation-delay: 0.32s; }
.ex-lang b:nth-of-type(6) { animation-delay: 0.4s; }
.ex-lang em { font-style: normal; font-size: 14px; font-weight: 600; padding-left: 8px; }
.answer-text .w { opacity: 0; transition: opacity 0.18s; }
.answer-text .w.on { opacity: 1; }
.answer-sources { margin: 0; padding: 0; list-style: none; display: grid; gap: 8px; counter-reset: src; }
.answer-sources li { counter-increment: src; display: flex; gap: 10px; align-items: center; font-size: 16px; }
.answer-sources li::before { content: counter(src); display: inline-grid; place-items: center; min-width: 22px; height: 22px; border-radius: 999px; background: var(--accent); color: #081a33; font-size: 13px; font-weight: 600; }
.answer-sources a { color: var(--band-ink); text-decoration: underline; text-decoration-color: color-mix(in srgb, var(--band-ink) 40%, transparent); text-underline-offset: 4px; }
.answer-sources a:hover { text-decoration-color: currentColor; }
.answer-foot { margin-top: auto; font-size: 14px; color: var(--band-muted); }
.flash { animation: flash 1.4s var(--ease); }
@keyframes flash { 0%, 100% { background-color: transparent; } 20% { background-color: color-mix(in srgb, var(--accent) 22%, transparent); } }

/* ---------- About ---------- */
.about { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: clamp(32px, 5vw, 80px); align-items: center; }
.about-text { display: grid; gap: 28px; }
.statement { font-size: clamp(24px, 2.4vw, 34px); line-height: 1.25; letter-spacing: -0.02em; max-width: 38ch; }
.body { font-size: 17px; max-width: 58ch; }
.about-photo { margin: 0; display: grid; gap: 12px; }
.about-photo img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: var(--radius); }
.about-photo figcaption { font-size: var(--fs-small); color: var(--muted); }
.figures {
  grid-column: 1 / -1;
  margin: clamp(24px, 4vw, 48px) 0 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 24px;
  padding: clamp(28px, 4vw, 48px);
  border-radius: var(--radius);
  background: var(--tint);
}
.figures div { display: flex; flex-direction: column-reverse; justify-content: flex-end; gap: 10px; }
.figures dt { font-size: 16px; color: var(--muted); max-width: 22ch; }
.figures dd { margin: 0; font-size: clamp(44px, 5vw, 60px); font-weight: 500; line-height: 1; letter-spacing: -0.045em; }
.figures .cite { vertical-align: top; margin-left: 6px; }

/* ---------- Work ---------- */
.project {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: clamp(28px, 4vw, 64px);
  align-items: center;
  padding: clamp(24px, 3vw, 40px);
  border-radius: 32px;
  background: var(--tint);
  margin-bottom: 24px;
}
.project.flip { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); }
.project.flip .project-text { order: 2; }
.project-text { display: grid; gap: 16px; align-content: start; padding: 8px; }
.project h3 { font-size: clamp(28px, 2.8vw, 40px); line-height: 1.05; letter-spacing: -0.03em; }
.meta { font-size: 14px; color: var(--muted); }
.project-text > p:not(.meta):not(.tools) { max-width: 46ch; }
.metrics { display: flex; flex-wrap: wrap; gap: 12px 32px; margin: 6px 0 0; }
.metrics div { display: flex; flex-direction: column; }
.metrics dd { margin: 0; font-size: 36px; font-weight: 500; letter-spacing: -0.04em; line-height: 1.05; }
.metrics dt { font-size: 14px; color: var(--muted); }
.tools { font-size: 14px; color: var(--muted); }
.viz { margin: 0; display: grid; gap: 10px; }
.viz figcaption { font-size: var(--fs-small); color: var(--muted); }

/* Interface fragments (a product's own chrome: borders and small labels are allowed here) */
.ui {
  background: #ffffff;
  color: #081a33;
  border-radius: 20px;
  padding: 20px;
  display: grid;
  gap: 14px;
  font-size: 14px;
  border: 1px solid rgba(8, 26, 51, 0.1);
  min-height: 340px;
  align-content: start;
}
.ui-bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; font-weight: 500; }
.ui-badge { padding: 4px 10px; border-radius: 999px; background: #e3f1ff; color: #1268cf; font-size: 13px; font-weight: 500; white-space: nowrap; }
.ui-badge.warn { background: #fff1d6; color: #8a5a00; }
.ui-q { justify-self: end; max-width: 80%; padding: 12px 16px; border-radius: 16px 16px 4px 16px; background: #081a33; color: #fff; }
.ui-a { padding: 16px; border-radius: 16px 16px 16px 4px; background: #f2f6fb; display: grid; gap: 12px; line-height: 1.5; }
.ui-a sup { color: #1268cf; font-weight: 600; font-size: 13px; }
.ui-sources { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; font-size: 14px; color: #3d5270; }
.ui-sources b { display: inline-grid; place-items: center; width: 20px; height: 20px; margin-right: 8px; border-radius: 6px; background: #3fa2ff; color: #081a33; font-size: 13px; }
.ui-foot { display: flex; justify-content: space-between; font-size: 13px; color: #3d5270; margin-top: auto; }
.trace { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.trace li { display: grid; grid-template-columns: 110px 1fr auto; gap: 10px; align-items: center; padding: 10px 12px; border-radius: 12px; background: #f2f6fb; }
.trace li b { font-weight: 600; }
.trace li span { color: #3d5270; }
.trace time { font-size: 13px; color: #3d5270; }
.trace li b::before { content: ""; display: inline-block; width: 8px; height: 8px; margin-right: 8px; border-radius: 50%; vertical-align: 1px; background: #1a8a5a; }
.trace li.retry b::before { background: #d08a00; }
.trace li.wait b::before { background: #3fa2ff; }
.trace li.wait { background: #081a33; color: #fff; grid-template-columns: 110px 1fr; }
.trace li.wait > span:not(.trace-actions) { color: #c9d8ec; }
.trace-actions { grid-column: 1 / -1; display: flex; gap: 8px; }
.ui-btn { padding: 8px 16px; border-radius: 999px; background: #3fa2ff; color: #081a33; font-weight: 600; font-size: 14px; }
.trace .ui-btn { color: #081a33; }
.trace .ui-btn.ghost { color: #fff; }
.ui-btn.ghost { background: transparent; color: #fff; border: 1px solid rgba(255, 255, 255, 0.4); }
.ui-prompt { padding: 12px 16px; border-radius: 12px; background: #f2f6fb; color: #3d5270; }
.gen-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.gen-grid i { aspect-ratio: 1; border-radius: 12px; background: #d9e6f5; }
.gen-grid i:nth-child(2) { background: #c3d7ee; }
.gen-grid i:nth-child(3) { background: #cfe0f3; }
.gen-grid i:nth-child(4) { background: #b8cfe9; }

/* Segmentation clip with a drawn road mask */
.seg { position: relative; border-radius: 20px; overflow: hidden; aspect-ratio: 16 / 9; background: #1b2633; }
.seg-video { width: 100%; height: 100%; object-fit: cover; }
.seg-mask {
  position: absolute;
  inset: 0;
  background: #3fa2ff;
  opacity: 0.45;
  clip-path: polygon(46% 60%, 58% 60%, 100% 96%, 100% 100%, 8% 100%);
  mix-blend-mode: screen;
  animation: maskpulse 4s ease-in-out infinite;
}
@keyframes maskpulse { 50% { opacity: 0.3; } }
.seg-label { position: absolute; left: 16px; top: 16px; padding: 6px 12px; border-radius: 999px; background: #3fa2ff; color: #081a33; font-size: 14px; font-weight: 600; }

.more-work { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: clamp(28px, 4vw, 64px); margin-top: clamp(48px, 6vw, 80px); padding: 0 clamp(24px, 3vw, 40px); }
.more-work ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 22px; }
.more-work li { display: grid; gap: 2px; }
.more-work li b { font-weight: 500; font-size: 20px; }
.more-work li span { color: var(--muted); }

/* ---------- How I build (band) ---------- */
.pipeline { margin: 0 0 clamp(48px, 6vw, 80px); }
.pipeline svg { width: 100%; height: auto; overflow: visible; }
.p-node rect { fill: var(--band-2); rx: 18; }
.p-node.hot rect { fill: var(--accent); }
.p-node.out rect { fill: var(--band-ink); }
.pipeline text { fill: var(--band-ink); font: 500 19px var(--sans); text-anchor: middle; }
.pipeline text.sub { font-size: 14px; font-weight: 400; fill: var(--band-muted); }
.p-node.hot text, .p-node.hot text.sub, .p-node.out text, .p-node.out text.sub { fill: #081a33; }
.p-arrows path { stroke: var(--band-muted); stroke-width: 2; fill: none; marker-end: none; }
.p-loop path { stroke: var(--accent); stroke-width: 2; fill: none; stroke-dasharray: 6 6; animation: dash 1.2s linear infinite; }
@keyframes dash { to { stroke-dashoffset: -12; } }
.p-loop rect { fill: var(--band); stroke: var(--accent); stroke-width: 2; rx: 25; }
.p-loop text { font-size: 16px; }
.stages { list-style: none; margin: 0 0 clamp(56px, 7vw, 96px); padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(24px, 4vw, 56px); }
.stages h3 { margin-bottom: 12px; }
.stages p { color: var(--band-ink); opacity: 0.86; }
.toolset { margin: 0; display: grid; gap: 4px; }
.toolset div { display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 8fr); gap: 24px; padding: 18px 24px; border-radius: 16px; transition: background-color 0.25s; }
.toolset div:nth-child(odd) { background: var(--band-2); }
.toolset dt { font-size: 20px; font-weight: 500; }
.toolset dd { margin: 0; color: var(--band-ink); opacity: 0.86; font-size: 17px; }

/* ---------- Experience ---------- */
.timeline { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.timeline li { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 9fr); gap: 24px; padding: 28px 24px; border-radius: 20px; transition: background-color 0.3s; }
.timeline li:first-child { background: var(--tint); }
.timeline li:hover { background: var(--tint); }
.timeline time { font-size: 16px; color: var(--muted); padding-top: 6px; font-variant-numeric: tabular-nums; }
.timeline .org { color: var(--link); margin: 4px 0 8px; font-weight: 500; }
.timeline li p:last-child { max-width: 64ch; }
.edu { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 9fr); gap: 8px 24px; margin-top: clamp(40px, 5vw, 64px); padding: 0 24px; }
.edu h3 { grid-row: span 2; }
.edu p { display: grid; gap: 2px; margin-bottom: 14px; }
.edu b { font-weight: 500; font-size: 20px; }
.edu span { color: var(--muted); }

/* ---------- Notes ---------- */
.note-grid { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); grid-template-rows: auto auto; gap: 24px clamp(24px, 3vw, 40px); }
.note { display: grid; gap: 12px; align-content: start; }
.note-big { grid-row: span 2; }
.note img { width: 100%; object-fit: cover; border-radius: var(--radius); aspect-ratio: 16 / 10; transition: transform 0.6s var(--ease); }
.note-big img { aspect-ratio: 4 / 3.4; }
.note { overflow: hidden; }
.note:hover img { transform: scale(1.03); }
.note h3 { margin-top: 6px; }
.note p { color: var(--muted); max-width: 48ch; }

/* ---------- CV ---------- */
.cv { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 40px; align-items: center; background: var(--tint); }
.cv-text { display: grid; gap: 22px; }
.fan { position: relative; height: 440px; }
.fan .page { position: absolute; top: 0; width: 54%; border-radius: 6px; background: #fff; transition: transform 0.5s var(--ease); }
.p-fr { left: 8%; transform: rotate(-7deg); }
.p-en { left: 38%; transform: rotate(5deg) translateY(16px); }
.fan:hover .p-fr { transform: rotate(-10deg) translateX(-16px); }
.fan:hover .p-en { transform: rotate(8deg) translate(16px, 8px); }

/* ---------- FAQ ---------- */
.faq { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 20px; align-items: stretch; }
.faq-cta {
  border-radius: 32px;
  padding: clamp(32px, 4vw, 52px);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-end;
  gap: 18px;
  min-height: 380px;
  background: var(--band);
  color: var(--band-ink);
}
.faq-cta .btn-ink { background: var(--band-ink); color: var(--band); }
.faq-list { display: grid; gap: 10px; align-content: start; }
.faq details { background: var(--tint); border-radius: 20px; padding: 20px 24px; transition: background-color 0.25s; }
.faq summary { cursor: pointer; font-weight: 500; font-size: 17px; list-style: none; display: flex; justify-content: space-between; gap: 16px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font-size: 22px; line-height: 1; transition: transform 0.25s var(--ease); }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details p { margin-top: 12px; max-width: 60ch; }

/* ---------- Footer ---------- */
.footer { padding-bottom: 32px; overflow: hidden; }
.footer-top { display: grid; grid-template-columns: minmax(0, 6fr) minmax(0, 6fr); gap: 40px; align-items: end; }
.footer-title { font-size: clamp(48px, 6.4vw, 96px); line-height: 0.98; letter-spacing: -0.045em; }
.contact-rows { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.contact-rows a { display: grid; grid-template-columns: 110px 1fr; gap: 16px; align-items: baseline; padding: 14px 20px; border-radius: 16px; font-size: clamp(17px, 1.5vw, 21px); overflow-wrap: anywhere; transition: background-color 0.25s, transform 0.25s var(--ease); }
.contact-rows a:hover { background: var(--band-2); transform: translateX(4px); }
.contact-rows span { font-size: 14px; color: var(--band-muted); }
.giant {
  margin: clamp(56px, 8vw, 112px) 0 0;
  font-size: min(8.4vw, 190px);
  font-weight: 500;
  line-height: 0.85;
  letter-spacing: -0.05em;
  white-space: nowrap;
  color: var(--band-2);
}
.footer-bottom { display: grid; grid-template-columns: auto 1fr; gap: 24px; margin-top: 28px; font-size: 14px; color: var(--band-ink); }
.credits { margin: 0; justify-self: end; max-width: 80ch; text-align: right; opacity: 0.85; }
.credits a { text-decoration: underline; text-underline-offset: 3px; }

/* ---------- Placeholders + prototype layer ---------- */
.ph { text-decoration: underline dashed color-mix(in srgb, currentColor 55%, transparent); text-underline-offset: 5px; }
.ph-block { outline: 2px dashed color-mix(in srgb, #081a33 30%, transparent); outline-offset: 4px; border-radius: 12px; }
.show-labels [data-label] { outline: 2px dashed rgba(229, 0, 126, 0.55); outline-offset: -2px; }
.show-labels [data-label]::before {
  content: attr(data-label);
  position: absolute;
  z-index: 30;
  top: 12px;
  left: 12px;
  padding: 4px 10px;
  border-radius: 6px;
  background: #e5007e;
  color: #fff;
  font: 500 13px/1.4 var(--sans);
  pointer-events: none;
}
.show-labels .hero[data-label]::before { top: 80px; }

/* ---------- Entrances (only when site.js is running) ---------- */
.reveal-ready [data-reveal] { opacity: 0; transform: translateY(24px); transition: opacity 0.7s var(--ease), transform 0.7s var(--ease); transition-delay: var(--d, 0ms); }
.reveal-ready [data-reveal].in { opacity: 1; transform: none; }
.float-chip { animation: bob 6s ease-in-out infinite; }
.fc-2 { animation-delay: -2s; }
.fc-3 { animation-delay: -4s; }
@keyframes bob { 50% { translate: 0 -8px; } }

/* ---------- Responsive ---------- */
@media (max-width: 1080px) {
  .nav-links { display: none; }
  .wordmark { margin-right: auto; }
  .hero-stat { position: relative; right: auto; bottom: auto; width: auto; margin: -8px 0 40px; text-align: center; }
  .ask, .about, .project, .project.flip, .more-work, .footer-top { grid-template-columns: 1fr; }
  .project.flip .project-text { order: 0; }
  .answer { position: relative; top: 0; }
  .figures { grid-template-columns: 1fr 1fr; }
  .pal-long { display: none; }
}
@media (max-width: 760px) {
  .stages, .note-grid, .cv, .faq, .toolset div, .timeline li, .edu { grid-template-columns: 1fr; }
  .note-big { grid-row: auto; }
  .timeline li { gap: 4px; padding: 22px 18px; }
  .edu { padding: 0 18px; }
  .edu h3 { grid-row: auto; margin-bottom: 8px; }
  .toolset div { gap: 4px; }
  .strip { flex-direction: column; align-items: stretch; gap: 16px; }
  .fan { height: 320px; }
  .faq-cta { min-height: 0; justify-content: flex-start; }
  .fc-1 { left: -10%; }
  .fc-2 { right: -10%; }
  .fc-3 { left: -12%; }
  .trace li { grid-template-columns: 90px 1fr; }
  .trace time { display: none; }
  .contact-rows a { grid-template-columns: 1fr; gap: 2px; }
  .footer-bottom { grid-template-columns: 1fr; }
  .credits { justify-self: start; text-align: left; }
  @media (max-width: 560px) {
  .nav-cta { display: none; }
  .figures { grid-template-columns: 1fr 1fr; padding: 24px; gap: 28px 16px; }
  .wordmark { font-size: 20px; }
  .float-chip { font-size: 14px; padding: 8px 14px; }
}

@media (max-width: 560px) {
  .answer-steps { gap: 10px; font-size: 13px; }
  .exhibit { min-height: 0; }
  .ex-hci { grid-template-columns: minmax(0, 1.6fr) minmax(32px, 1fr) 22px; min-height: 176px; }
  .ex-stack span { font-size: 13px; padding: 0 12px; }
  .ex-bars { --lab: 78px; }
  .ex-axis span { left: calc(78px + 12px + (100% - 90px) * 0.624); }
  .ex-cv { grid-template-columns: 1fr; gap: 18px; }
  .ex-steps li { font-size: 12px; }
  .ex-where { grid-template-columns: 1fr; gap: 18px; }
  .ex-map { max-height: 150px; justify-self: center; width: auto; }
  .ex-map text { font-size: 22px; }
  .ex-scale, .ex-lang { grid-template-columns: 54px repeat(6, minmax(0, 1fr)) 46px; gap: 3px; }
  .ex-scale i { font-size: 11px; }
  .ex-lang span { font-size: 14px; }
  .ex-lang em { padding-left: 4px; font-size: 13px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  html { scroll-behavior: auto; }
  .reveal-ready [data-reveal] { opacity: 1; transform: none; }
}
