/* muhammad-ahmed.com
   One hue (274, the violet the site has always used) drives the palette, with a
   cyan counterpoint for data-ish accents. Dark is the default; light is a toggle
   and shares its localStorage key with /blog. */

/*=============== TOKENS ===============*/
:root {
  --hue: 274;
  --font-sans: "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono: "Geist Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --container: 1180px;
  --gutter: 16px;
  --radius: 20px;
  --radius-sm: 12px;
  --header-h: 68px;
  --ease: cubic-bezier(.2, .7, .2, 1);
}

:root,
[data-theme="dark"] {
  color-scheme: dark;
  --bg: #07060c;
  --surface: rgba(24, 19, 38, .55);
  --surface-solid: #110e1b;
  --surface-hover: rgba(36, 29, 56, .62);
  --input: rgba(0, 0, 0, .28);
  --line: rgba(205, 190, 255, .09);
  --line-strong: rgba(205, 190, 255, .2);
  --text: #f4f1fb;
  --text-2: #bcb5cc;
  --text-3: #948ea7;
  --accent: hsl(var(--hue) 92% 72%);
  --accent-strong: hsl(var(--hue) 88% 60%);
  --accent-2: hsl(188 88% 62%);
  --accent-soft: hsla(var(--hue), 90%, 65%, .13);
  --grad: linear-gradient(100deg, hsl(var(--hue) 95% 74%) 0%, hsl(236 92% 74%) 48%, hsl(188 90% 64%) 100%);
  --btn: linear-gradient(135deg, hsl(var(--hue) 88% 58%), hsl(248 84% 60%));
  --grid-line: rgba(205, 190, 255, .055);
  --glow-a: hsla(var(--hue), 92%, 58%, .22);
  --glow-b: hsla(190, 92%, 55%, .12);
  --shadow: 0 30px 80px -32px rgba(0, 0, 0, .7);
  --gold: #f3c54b;
  --silver: #c9d2de;
  --bronze: #dc9660;
  --gold-ink: var(--gold);
  --silver-ink: var(--silver);
  --bronze-ink: var(--bronze);
  --ok: #4ade80;
  --err: #fb7185;
  --code-key: #c4b5fd;
  --code-str: #7ee6f5;
  --code-num: #f9a8d4;
  --code-punc: #6d6784;
}

[data-theme="light"] {
  color-scheme: light;
  --bg: #fbfaff;
  --surface: rgba(255, 255, 255, .72);
  --surface-solid: #ffffff;
  --surface-hover: rgba(255, 255, 255, .96);
  --input: #ffffff;
  --line: rgba(60, 30, 110, .1);
  --line-strong: rgba(90, 40, 170, .2);
  --text: #15111e;
  --text-2: #4a4458;
  --text-3: #686280;
  --accent: hsl(var(--hue) 82% 50%);
  --accent-strong: hsl(var(--hue) 86% 50%);
  --accent-2: hsl(192 88% 27%);
  --accent-soft: hsla(var(--hue), 85%, 55%, .09);
  --grad: linear-gradient(100deg, hsl(var(--hue) 86% 50%) 0%, hsl(238 78% 54%) 50%, hsl(194 90% 36%) 100%);
  --grid-line: rgba(80, 40, 160, .06);
  --glow-a: hsla(var(--hue), 90%, 65%, .16);
  --glow-b: hsla(190, 90%, 55%, .1);
  --shadow: 0 24px 60px -32px rgba(40, 20, 80, .28);
  --gold: #a17600;
  --silver: #8994a4;
  --bronze: #b76a33;
  /* The medal colours are too light to carry small text on white. */
  --gold-ink: #7a5a00;
  --silver-ink: #525c6b;
  --bronze-ink: #8a4a1c;
  --ok: #15803d;
  --err: #e11d48;
  --code-key: #6d28d9;
  --code-str: #0e7490;
  --code-num: #be185d;
  --code-punc: #9d97ab;
}

/*=============== BASE ===============*/
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 12px); overflow-x: clip; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 16px/1.65 var(--font-sans);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
  transition: background-color .3s, color .3s;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; }
h1, h2, h3, p { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
button { font: inherit; color: inherit; }
[hidden] { display: none !important; }
.sr-only {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
::selection { background: hsla(var(--hue), 90%, 60%, .35); color: var(--text); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }

.container { width: min(100% - 2 * var(--gutter), var(--container)); margin-inline: auto; }
.mono { font-family: var(--font-mono); }
.muted { color: var(--text-2); }
.grad {
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.ic {
  width: 1.15em; height: 1.15em; flex: none;
  fill: none; stroke: currentColor; stroke-width: 1.8;
  stroke-linecap: round; stroke-linejoin: round;
}
/* Brand marks are solid shapes; everything else is a stroke icon. */
path.fill { fill: currentColor; stroke: none; }

.skip {
  position: absolute; left: 12px; top: -60px; z-index: 100;
  padding: .6rem 1rem; border-radius: 10px;
  background: var(--accent-strong); color: #fff; text-decoration: none;
}
.skip:focus { top: 12px; }

@media (min-width: 640px) { :root { --gutter: 24px; } }

/*=============== BUTTONS & SMALL PARTS ===============*/
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .55rem;
  height: 48px; padding: 0 1.3rem; border-radius: 999px;
  font: 500 .95rem/1 var(--font-sans); letter-spacing: -.005em;
  text-decoration: none; white-space: nowrap; cursor: pointer;
  border: 1px solid transparent;
  transition: transform .25s var(--ease), box-shadow .25s, background-color .25s, border-color .25s, opacity .2s;
}
.btn--primary {
  color: #fff;
  background: var(--btn);
  box-shadow: 0 12px 32px -12px hsla(var(--hue), 90%, 55%, .75), inset 0 1px 0 rgba(255, 255, 255, .22);
}
.btn--primary:hover { transform: translateY(-2px); box-shadow: 0 18px 40px -12px hsla(var(--hue), 90%, 55%, .9), inset 0 1px 0 rgba(255, 255, 255, .3); }
.btn--ghost {
  color: var(--text); background: var(--surface); border-color: var(--line-strong);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
}
.btn--ghost:hover { border-color: var(--accent); background: var(--surface-hover); transform: translateY(-2px); }
.btn--sm { height: 38px; padding: 0 1rem; font-size: .875rem; }
.btn .ic { transition: transform .25s var(--ease); }
.btn:hover .ic { transform: translateX(2px); }
.btn:disabled { opacity: .6; cursor: progress; transform: none; }

.icon-btn {
  width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center;
  border: 1px solid var(--line); background: var(--surface); color: var(--text);
  cursor: pointer; transition: border-color .2s, background-color .2s;
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
}
.icon-btn:hover { border-color: var(--line-strong); background: var(--surface-hover); }
.icon-btn .ic { width: 18px; height: 18px; }
[data-theme="dark"] .ic--moon, [data-theme="light"] .ic--sun { display: none; }

.tag {
  display: inline-flex; align-items: center; height: 22px; padding: 0 .5rem; border-radius: 6px;
  font: 500 .7rem/1 var(--font-mono); letter-spacing: .02em;
  color: var(--text-2); background: var(--accent-soft); border: 1px solid var(--line);
}
.tag--accent { color: var(--accent); border-color: var(--line-strong); }

.pulse {
  position: relative; display: inline-block; width: 8px; height: 8px; border-radius: 50%;
  background: var(--ok); flex: none;
}
.pulse::after {
  content: ""; position: absolute; inset: 0; border-radius: 50%; background: var(--ok);
  animation: ping 2s cubic-bezier(0, 0, .2, 1) infinite;
}
@keyframes ping { 75%, 100% { transform: scale(2.6); opacity: 0; } }

.medal {
  --c: var(--gold);
  display: inline-block; width: 12px; height: 12px; border-radius: 50%; flex: none;
  background: radial-gradient(circle at 32% 30%, rgba(255, 255, 255, .75), transparent 45%), var(--c);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--c) 18%, transparent), 0 0 14px -2px var(--c);
}
.medal--gold { --c: var(--gold); }
.medal--silver { --c: var(--silver); }
.medal--bronze { --c: var(--bronze); }

/*=============== FREE PALESTINE BAR ===============*/
.ps-bar {
  position: relative; z-index: 60;
  display: flex; justify-content: center; align-items: center; gap: .35rem; flex-wrap: wrap;
  min-height: 38px; padding: .4rem 1rem;
  background: #1e7748; color: #fff; font-size: .88rem; line-height: 1.35; text-align: center;
}
.ps-bar a { color: #fff; text-decoration: none; }
.ps-bar a:hover, .ps-bar a:focus-visible { text-decoration: underline; text-underline-offset: 3px; }
.ps-bar a:focus-visible { outline-color: #fff; }
.ps-bar__flag { display: inline; }
.ps-bar__left { display: none; }
@media (min-width: 640px) {
  .ps-bar { font-size: .95rem; }
  .ps-bar__left { display: inline; }
  .ps-bar__flag { display: none; }
}

/*=============== BACKDROP ===============*/
.backdrop {
  position: absolute; left: 0; right: 0; top: 0; z-index: -1;
  height: min(1080px, calc(100svh + 160px));
  overflow: hidden; pointer-events: none;
  -webkit-mask-image: linear-gradient(to bottom, #000 55%, transparent);
  mask-image: linear-gradient(to bottom, #000 55%, transparent);
}
.backdrop::before {
  content: ""; position: absolute; inset: 0;
  background-image:
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 64px 64px;
  background-position: center top;
  -webkit-mask-image: radial-gradient(ellipse 75% 70% at 60% 30%, #000 20%, transparent 75%);
  mask-image: radial-gradient(ellipse 75% 70% at 60% 30%, #000 20%, transparent 75%);
}
.backdrop::after {
  content: ""; position: absolute; inset: 0;
  background:
    radial-gradient(42% 48% at 18% 22%, var(--glow-a), transparent 70%),
    radial-gradient(38% 44% at 82% 18%, var(--glow-b), transparent 70%),
    radial-gradient(30% 30% at 70% 70%, var(--glow-a), transparent 70%);
}
#latent { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 1; }
@media (min-width: 901px) {
  /* Keep the cloud out from behind the headline. */
  #latent {
    -webkit-mask-image: linear-gradient(90deg, transparent 18%, rgba(0, 0, 0, .35) 42%, #000 62%);
    mask-image: linear-gradient(90deg, transparent 18%, rgba(0, 0, 0, .35) 42%, #000 62%);
  }
}

/*=============== HEADER ===============*/
.header {
  position: sticky; top: 0; z-index: 50;
  border-bottom: 1px solid transparent;
  transition: background-color .3s, border-color .3s, -webkit-backdrop-filter .3s, backdrop-filter .3s;
}
.header.scrolled, .header.open {
  background: color-mix(in srgb, var(--bg) 74%, transparent);
  -webkit-backdrop-filter: blur(18px) saturate(150%);
  backdrop-filter: blur(18px) saturate(150%);
  border-bottom-color: var(--line);
}
.nav { height: var(--header-h); display: flex; align-items: center; justify-content: space-between; gap: 1rem; }

.brand { display: inline-flex; align-items: center; gap: .65rem; text-decoration: none; color: var(--text); }
.brand__mark {
  width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center;
  font: 600 .78rem/1 var(--font-mono); letter-spacing: .02em; color: #fff;
  background: linear-gradient(135deg, hsl(var(--hue) 88% 58%), hsl(205 90% 50%));
  box-shadow: 0 8px 22px -8px hsla(var(--hue), 90%, 55%, .9), inset 0 1px 0 rgba(255, 255, 255, .25);
}
.brand__name { font-weight: 600; font-size: 1rem; letter-spacing: -.01em; }

.nav__list {
  display: flex; gap: .15rem; padding: .3rem;
  border: 1px solid var(--line); border-radius: 999px;
  background: var(--surface);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
}
.nav__link {
  display: flex; align-items: center; gap: .35rem;
  padding: .45rem .85rem; border-radius: 999px;
  color: var(--text-2); text-decoration: none; font-size: .9rem; font-weight: 500;
  transition: color .2s, background-color .2s;
}
.nav__link:hover { color: var(--text); }
.nav__link.active { color: var(--text); background: var(--accent-soft); box-shadow: inset 0 0 0 1px var(--line-strong); }
.nav__badge {
  font: 500 .6rem/1 var(--font-mono); padding: .2rem .35rem; border-radius: 5px;
  color: #fff; background: var(--accent-strong); letter-spacing: .03em;
}
.nav__actions { display: flex; align-items: center; gap: .5rem; }
.nav__toggle { display: none; }
.nav__toggle .ic--close { display: none; }
.header.open .nav__toggle .ic--open { display: none; }
.header.open .nav__toggle .ic--close { display: block; }

@media (max-width: 1080px) {
  .nav__toggle { display: grid; }
  .nav__menu {
    position: absolute; left: 0; right: 0; top: 100%;
    padding: .5rem var(--gutter) 1rem;
    visibility: hidden; opacity: 0; transform: translateY(-8px);
    transition: opacity .2s, transform .2s var(--ease), visibility 0s .2s;
  }
  .header.open .nav__menu { visibility: visible; opacity: 1; transform: none; transition: opacity .2s, transform .2s var(--ease); }
  .nav__list {
    flex-direction: column; gap: .15rem; padding: .5rem; border-radius: 18px;
    background: var(--surface-solid); box-shadow: var(--shadow);
  }
  .nav__link { padding: .8rem 1rem; border-radius: 12px; font-size: 1rem; }
}
@media (max-width: 480px) {
  .nav__cta { display: none; }
  .brand__name { font-size: .95rem; }
}

/*=============== HERO ===============*/
.hero { position: relative; padding: clamp(2.5rem, 7vh, 5rem) 0 clamp(3.5rem, 8vh, 6rem); }
.hero__inner {
  display: grid; grid-template-columns: minmax(0, 1.12fr) minmax(0, .88fr);
  gap: clamp(2rem, 5vw, 4.5rem); align-items: center;
  min-height: min(680px, calc(100svh - var(--header-h) - 150px));
}
.status {
  display: inline-flex; align-items: center; gap: .6rem;
  padding: .4rem .85rem .4rem .7rem; border-radius: 999px;
  font-size: .85rem; color: var(--text-2);
  border: 1px solid var(--line-strong); background: var(--surface);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
}
.status__sep { color: var(--text-3); }
.hero__title {
  margin-top: 1.4rem;
  font-size: clamp(2.9rem, 5.6vw + .4rem, 5.4rem);
  line-height: 1; letter-spacing: -.05em; font-weight: 600;
}
.hero__role {
  display: block; margin-top: .6rem; padding-bottom: .08em;
  font-size: .56em; line-height: 1.1; letter-spacing: -.04em;
}
.hero__typed {
  margin-top: 1.1rem; font-size: clamp(.88rem, .5vw + .75rem, 1rem); color: var(--text-3);
  min-height: 1.6em;
}
.hero__prompt { color: var(--accent-2); }
#typed { color: var(--accent); }
.caret {
  display: inline-block; width: .55em; height: 1.1em; margin-left: .15em; vertical-align: -.18em;
  background: var(--accent); border-radius: 1px; animation: blink 1.05s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0; } }
.hero__lead { margin-top: 1.1rem; max-width: 36rem; font-size: clamp(1.02rem, .4vw + .95rem, 1.18rem); color: var(--text-2); line-height: 1.7; }
.hero__ctas { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 2rem; }

.socials { display: flex; gap: .5rem; margin-top: 2rem; }
.socials a {
  width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center;
  color: var(--text-2); border: 1px solid var(--line); background: var(--surface);
  transition: color .2s, border-color .2s, transform .25s var(--ease), background-color .2s;
}
.socials a:hover { color: var(--text); border-color: var(--accent); transform: translateY(-2px); background: var(--accent-soft); }
.socials .ic { width: 18px; height: 18px; }

.hero__scroll {
  position: absolute; left: 50%; bottom: 1.25rem; transform: translateX(-50%);
  display: inline-flex; align-items: center; gap: .4rem;
  font-size: .72rem; letter-spacing: .14em; text-transform: uppercase;
  color: var(--text-3); text-decoration: none;
}
.hero__scroll .ic { width: 14px; height: 14px; animation: nudge 2s var(--ease) infinite; }
@keyframes nudge { 50% { transform: translateY(4px); } }

/* Portrait as a detection */
.hero__visual { display: grid; place-items: center; }
.scan { position: relative; margin: 0; width: min(100%, 460px); aspect-ratio: 1; }
.scan__glow {
  position: absolute; inset: 6%; border-radius: 50%;
  background: radial-gradient(circle at 50% 42%, hsla(var(--hue), 95%, 62%, .55), hsla(232, 90%, 60%, .22) 48%, transparent 70%);
  filter: blur(28px);
}
.scan__orbit {
  position: absolute; inset: 3%; border-radius: 50%;
  border: 1px dashed var(--line-strong);
  animation: spin 60s linear infinite;
}
.scan__orbit::before, .scan__orbit::after {
  content: ""; position: absolute; width: 9px; height: 9px; border-radius: 50%;
  background: var(--accent-2); box-shadow: 0 0 14px var(--accent-2);
  top: 50%; left: -5px;
}
.scan__orbit::after { left: auto; right: -5px; top: 18%; background: var(--accent); box-shadow: 0 0 14px var(--accent); }
@keyframes spin { to { transform: rotate(360deg); } }
.scan__img {
  position: relative; width: 100%; height: auto;
  -webkit-mask-image: linear-gradient(to bottom, #000 72%, transparent 97%), linear-gradient(to right, transparent 1%, #000 12%, #000 88%, transparent 99%);
  -webkit-mask-composite: source-in;
  mask-image: linear-gradient(to bottom, #000 72%, transparent 97%), linear-gradient(to right, transparent 1%, #000 12%, #000 88%, transparent 99%);
  mask-composite: intersect;
}
.scan__pose { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.scan__bones path {
  fill: none; stroke: var(--accent-2); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; opacity: .6;
  stroke-dasharray: 1200; stroke-dashoffset: 1200; animation: draw 2.2s .6s var(--ease) forwards;
}
.scan__joints circle {
  fill: var(--bg); stroke: var(--accent-2); stroke-width: 2.5;
  transform-box: fill-box; transform-origin: center;
  opacity: 0; animation: pop .5s var(--ease) forwards;
}
.scan__joints circle:nth-child(1) { animation-delay: .7s; } .scan__joints circle:nth-child(2) { animation-delay: .8s; }
.scan__joints circle:nth-child(3) { animation-delay: .9s; } .scan__joints circle:nth-child(4) { animation-delay: 1s; }
.scan__joints circle:nth-child(5) { animation-delay: 1.1s; } .scan__joints circle:nth-child(6) { animation-delay: 1.2s; }
.scan__joints circle:nth-child(7) { animation-delay: 1.3s; } .scan__joints circle:nth-child(8) { animation-delay: 1.4s; }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes pop { from { opacity: 0; transform: scale(.2); } to { opacity: 1; } }

.scan__box { position: absolute; inset: 4% 6% 6% 6%; pointer-events: none; }
.scan__box i { position: absolute; width: 26px; height: 26px; border: 2px solid var(--accent); }
.scan__box i:nth-child(1) { top: 0; left: 0; border-right: 0; border-bottom: 0; border-top-left-radius: 8px; }
.scan__box i:nth-child(2) { top: 0; right: 0; border-left: 0; border-bottom: 0; border-top-right-radius: 8px; }
.scan__box i:nth-child(3) { bottom: 0; left: 0; border-right: 0; border-top: 0; border-bottom-left-radius: 8px; }
.scan__box i:nth-child(4) { bottom: 0; right: 0; border-left: 0; border-top: 0; border-bottom-right-radius: 8px; }
.scan__label {
  position: absolute; top: calc(4% - 30px); left: 6%;
  padding: .3rem .55rem; border-radius: 7px 7px 7px 2px;
  font-size: .72rem; line-height: 1; color: #fff; background: var(--accent-strong);
  box-shadow: 0 8px 20px -8px hsla(var(--hue), 90%, 55%, .9);
}
.scan__label b { font-weight: 500; opacity: .75; margin-left: .2rem; }
.scan__sweep {
  position: absolute; left: 6%; right: 6%; top: 6%; height: 2px; border-radius: 2px;
  background: linear-gradient(90deg, transparent, var(--accent-2), transparent);
  box-shadow: 0 0 18px 2px hsla(188, 90%, 60%, .5);
  opacity: 0; animation: sweep 5.5s 1.6s ease-in-out infinite;
}
@keyframes sweep {
  0% { top: 6%; opacity: 0; } 8% { opacity: .85; } 42% { top: 92%; opacity: .85; } 48%, 100% { top: 92%; opacity: 0; }
}

.chip-card {
  position: absolute; display: flex; align-items: center; gap: .7rem;
  padding: .65rem .9rem .65rem .7rem; border-radius: 14px;
  background: var(--surface); border: 1px solid var(--line-strong);
  -webkit-backdrop-filter: blur(14px) saturate(140%); backdrop-filter: blur(14px) saturate(140%);
  box-shadow: var(--shadow);
  animation: float 7s ease-in-out infinite;
}
.chip-card b { display: block; font-size: .88rem; font-weight: 600; line-height: 1.25; }
.chip-card small { display: block; font-size: .72rem; color: var(--text-3); line-height: 1.3; }
.chip-card__icon {
  width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center;
  color: #20beff; background: rgba(32, 190, 255, .12);
}
.chip-card--a { top: 1%; right: -12%; }
.chip-card--b { bottom: 12%; left: -6%; animation-delay: -3.5s; }
.chip-card--b .medal { width: 14px; height: 14px; margin: 0 .2rem 0 .3rem; }
@keyframes float { 50% { transform: translateY(-8px); } }

/*=============== STATS & MARQUEE ===============*/
.stats {
  display: grid; grid-template-columns: repeat(4, 1fr);
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--surface);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  overflow: hidden;
}
.stat { padding: 1.5rem 1.5rem 1.4rem; display: grid; gap: .25rem; }
.stat + .stat { border-left: 1px solid var(--line); }
.stat__num {
  font-size: clamp(2rem, 2.4vw + 1rem, 2.9rem); font-weight: 600; letter-spacing: -.04em; line-height: 1.05;
  font-variant-numeric: tabular-nums;
  background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.stat__label { font-size: .9rem; color: var(--text-2); }

.marquee {
  margin-top: clamp(3rem, 6vw, 4.5rem);
  border-block: 1px solid var(--line);
  overflow: hidden;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
}
.marquee__track { display: flex; width: max-content; animation: marquee 48s linear infinite; }
.marquee:hover .marquee__track { animation-play-state: paused; }
.marquee__group { display: flex; flex: none; }
.marquee__group li {
  display: inline-flex; align-items: center; gap: 2.5rem; padding: 1.1rem 0 1.1rem 2.5rem;
  font: 500 .8rem/1 var(--font-mono); letter-spacing: .12em; text-transform: uppercase;
  color: var(--text-3); white-space: nowrap;
}
.marquee__group li::before { content: "✦"; color: var(--accent); font-size: .7rem; }
@keyframes marquee { to { transform: translateX(-50%); } }

/*=============== SECTIONS ===============*/
.section { padding: clamp(4.5rem, 9vw, 7.5rem) 0 0; }
.section--tight { padding-top: clamp(4rem, 7vw, 6rem); }
.section__head { max-width: 780px; margin-bottom: clamp(2rem, 4vw, 3rem); }
.kicker {
  display: inline-flex; align-items: center; gap: .6rem;
  font: 500 .78rem/1 var(--font-mono); letter-spacing: .14em; text-transform: uppercase;
  color: var(--accent);
}
.kicker span {
  display: inline-grid; place-items: center; min-width: 2.1em; height: 1.9em; padding: 0 .35em; border-radius: 6px;
  color: var(--accent-2); border: 1px solid var(--line-strong); background: var(--surface); letter-spacing: 0;
}
.section__title {
  margin-top: 1rem;
  font-size: clamp(1.9rem, 3vw + .8rem, 3.2rem);
  line-height: 1.08; letter-spacing: -.04em; font-weight: 600;
}
.br-lg { display: none; }
@media (min-width: 900px) { .br-lg { display: inline; } }

/*=============== TILES ===============*/
.tile {
  position: relative; isolation: isolate;
  padding: clamp(1.25rem, 2.4vw, 1.75rem);
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--line);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  transition: border-color .3s, transform .35s var(--ease), background-color .3s;
}
/* Cursor spotlight: a soft fill plus a brighter rim that follows the pointer. */
.tile::before, .tile::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  opacity: 0; transition: opacity .35s;
}
.tile::before {
  z-index: -1;
  background: radial-gradient(420px circle at var(--mx, 50%) var(--my, 50%), hsla(var(--hue), 90%, 65%, .1), transparent 45%);
}
.tile::after {
  padding: 1px;
  background: radial-gradient(260px circle at var(--mx, 50%) var(--my, 50%), hsla(var(--hue), 95%, 72%, .75), transparent 45%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
}
.tile:hover::before, .tile:hover::after { opacity: 1; }
a.tile { display: block; color: inherit; text-decoration: none; }
a.tile:hover { transform: translateY(-3px); }

.tile__eyebrow {
  display: flex; align-items: center; gap: .45rem;
  font-size: .74rem; letter-spacing: .06em; color: var(--text-3); text-transform: lowercase;
}
.tile__eyebrow .ic { width: 14px; height: 14px; }
.tile__title { font-size: 1.15rem; line-height: 1.3; letter-spacing: -.02em; font-weight: 600; }

/*=============== ABOUT (BENTO) ===============*/
.bento { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 1rem; }
.tile--bio { grid-column: span 7; grid-row: span 2; display: flex; flex-direction: column; gap: 1rem; }
.tile--kaggle { grid-column: span 5; }
.tile--now { grid-column: span 5; }
.tile--code { grid-column: span 7; padding: 0; overflow: hidden; }
.tile--blog { grid-column: span 5; }

.bio { font-size: clamp(1.08rem, .5vw + 1rem, 1.28rem); line-height: 1.6; letter-spacing: -.01em; margin-top: .25rem; }
.bio a { color: var(--accent); text-decoration: underline; text-decoration-color: var(--line-strong); text-underline-offset: 4px; }
.bio a:hover { text-decoration-color: currentColor; }
.tile--bio .muted { line-height: 1.75; }
.tile__actions { display: flex; flex-wrap: wrap; gap: .7rem; margin-top: auto; padding-top: .75rem; }

.tile--kaggle { display: flex !important; gap: 1.25rem; align-items: center; }
.tile--kaggle img { width: 88px; height: auto; flex: none; filter: drop-shadow(0 8px 24px rgba(240, 120, 50, .35)); }
.tile--kaggle .tile__title { margin: .45rem 0 .9rem; }
.medals { display: flex; flex-wrap: wrap; gap: .5rem 1rem; font-size: .88rem; color: var(--text-2); }
.medals li { display: inline-flex; align-items: center; gap: .45rem; }
.medals b { color: var(--text); font-weight: 600; }

.tile--now { display: flex; flex-direction: column; }
.tile--now .tile__title { margin: .6rem 0 .3rem; }
.now__prev { margin-top: auto; padding-top: 1.1rem; font-size: .86rem; line-height: 1.55; color: var(--text-3); }
.now__prev .mono { display: block; margin-bottom: .2rem; font-size: .7rem; letter-spacing: .08em; text-transform: uppercase; color: var(--accent-2); }
.tile--now .pulse { width: 7px; height: 7px; }

.win-bar {
  display: flex; align-items: center; gap: .45rem; padding: .8rem 1rem;
  border-bottom: 1px solid var(--line); background: color-mix(in srgb, var(--surface-solid) 60%, transparent);
}
.win-bar i { width: 10px; height: 10px; border-radius: 50%; background: #ff5f57; }
.win-bar i:nth-child(2) { background: #febc2e; }
.win-bar i:nth-child(3) { background: #28c840; }
.win-bar span { margin-left: .5rem; font-size: .75rem; color: var(--text-3); }
.code {
  margin: 0; padding: 1.1rem 1.3rem 1.3rem; overflow-x: auto;
  font: 400 .84rem/1.8 var(--font-mono); color: var(--text-2); tab-size: 2;
}
.code .k { color: var(--code-key); } .code .s { color: var(--code-str); }
.code .n { color: var(--code-num); } .code .p { color: var(--code-punc); }

.tile--blog { display: flex !important; flex-direction: column; gap: .55rem; }
.tile--blog .tile__title { font-size: 1.3rem; }
.latest {
  margin-top: auto; display: flex; align-items: center; gap: .6rem;
  padding: .75rem .9rem; border-radius: 12px; border: 1px solid var(--line); background: var(--accent-soft);
  font-size: .92rem; color: var(--text);
}
.latest__label {
  flex: none; font-size: .66rem; letter-spacing: .1em; text-transform: uppercase; color: var(--accent-2);
  padding: .2rem .4rem; border: 1px solid var(--line-strong); border-radius: 5px;
}
.latest__title { flex: 1; min-width: 0; line-height: 1.35; }
.latest__date { display: block; font: .7rem var(--font-mono); color: var(--text-2); margin-bottom: .1rem; }
.latest .ic { flex: none; color: var(--accent); transition: transform .25s var(--ease); }
.tile--blog:hover .latest .ic { transform: translateX(3px); }

/*=============== SKILLS ===============*/
.skills { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; }
.skill--wide { grid-column: span 2; }
.skill__icon {
  width: 46px; height: 46px; border-radius: 13px; display: grid; place-items: center; margin-bottom: 1.1rem;
  color: var(--accent); background: var(--accent-soft); border: 1px solid var(--line-strong);
}
.skill__icon .ic { width: 22px; height: 22px; }
.chips { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: 1rem; }
.chips li {
  font: 500 .8rem/1 var(--font-mono); padding: .55rem .75rem; border-radius: 9px;
  color: var(--text-2); border: 1px solid var(--line); background: color-mix(in srgb, var(--surface-solid) 55%, transparent);
  transition: color .2s, border-color .2s;
}
.skill:hover .chips li { border-color: var(--line-strong); }
.chips li:hover { color: var(--text); }

/*=============== TIMELINE ===============*/
.timeline { position: relative; --rail: 190px; }
.timeline::before {
  content: ""; position: absolute; left: calc(var(--rail) + 1.75rem); top: 1rem; bottom: 1rem; width: 1px;
  background: linear-gradient(to bottom, var(--accent), var(--accent-2) 55%, var(--line));
}
.tl { position: relative; display: grid; grid-template-columns: var(--rail) minmax(0, 1fr); gap: 3.5rem; padding-bottom: 1rem; }
.tl__when { padding-top: 1.5rem; text-align: right; font-size: .82rem; color: var(--text-3); letter-spacing: .02em; }
.tl--now .tl__when { color: var(--accent); }
.tl__node {
  position: absolute; left: calc(var(--rail) + 1.75rem); top: 1.1rem; transform: translateX(-50%);
  width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center;
  color: var(--accent); background: var(--bg); border: 1px solid var(--line-strong);
}
.tl__node .ic { width: 16px; height: 16px; }
.tl--now .tl__node { color: #fff; background: var(--accent-strong); border-color: transparent; box-shadow: 0 0 0 6px var(--accent-soft), 0 0 24px hsla(var(--hue), 90%, 60%, .6); }
.tl--edu .tl__node { color: var(--accent-2); }
.tl__card .tile__eyebrow { margin-bottom: .45rem; }
.tl__org { margin-top: .3rem; color: var(--text-2); font-weight: 500; }
.tl__meta { margin-top: .55rem; display: flex; flex-wrap: wrap; align-items: center; gap: .45rem; font-size: .88rem; color: var(--text-3); }
.tl__meta .ic { width: 15px; height: 15px; }

/*=============== ACHIEVEMENTS ===============*/
.records { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; margin-bottom: 1rem; }
.record { display: grid; gap: .6rem; align-content: start; }
.record__year { font-size: .78rem; color: var(--accent-2); letter-spacing: .08em; }
.record p { font-size: 1.08rem; line-height: 1.45; letter-spacing: -.01em; color: var(--text-2); }
.record strong { color: var(--text); font-weight: 600; }
.record--hero {
  background:
    radial-gradient(120% 140% at 0% 0%, hsla(var(--hue), 90%, 60%, .2), transparent 60%),
    var(--surface);
  border-color: var(--line-strong);
}

.board { padding: clamp(1.25rem, 2.4vw, 1.75rem) clamp(1rem, 2.4vw, 1.75rem); }
.board__head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 1rem 2rem; margin-bottom: 1.25rem; }
.board__head .muted { margin-top: .3rem; font-size: .92rem; }
.board__filters { display: flex; flex-wrap: wrap; gap: .4rem; }
.filter {
  display: inline-flex; align-items: center; gap: .45rem; height: 34px; padding: 0 .8rem; border-radius: 999px;
  font-size: .83rem; color: var(--text-2); cursor: pointer;
  border: 1px solid var(--line); background: transparent;
  transition: color .2s, border-color .2s, background-color .2s;
}
.filter b { font: 500 .75rem var(--font-mono); color: var(--text-2); }
.filter:hover { color: var(--text); border-color: var(--line-strong); }
.filter[aria-pressed="true"] { color: var(--text); border-color: var(--accent); background: var(--accent-soft); }
.filter .medal { width: 9px; height: 9px; box-shadow: none; }

.board__cols, .row {
  display: grid; grid-template-columns: 26px minmax(0, 1fr) 130px 76px; align-items: center; gap: 1rem;
}
.board__cols { padding: 0 .75rem .6rem; font-size: .68rem; letter-spacing: .12em; text-transform: uppercase; color: var(--text-3); }
.board__cols span:nth-child(3), .board__cols span:nth-child(4) { text-align: right; }
.row { padding: .85rem .75rem; border-top: 1px solid var(--line); border-radius: 10px; transition: background-color .2s; }
.row:hover { background: var(--accent-soft); }
.row .medal { justify-self: center; }
.row__main { display: block; min-width: 0; }
.row__main a { color: var(--text); font-weight: 500; text-decoration: none; }
.row__main a:hover { color: var(--accent); }
.row__main .tag { margin-left: .4rem; vertical-align: 1px; }
.row__main small { display: block; margin-top: .15rem; font-size: .82rem; color: var(--text-3); }
.row__rank { text-align: right; font-size: 1.02rem; color: var(--text); font-variant-numeric: tabular-nums; }
.row__rank small { font-size: .78rem; color: var(--text-3); }
.row__pct {
  justify-self: end; padding: .3rem .5rem; border-radius: 7px; font-size: .78rem; font-variant-numeric: tabular-nums;
  color: var(--ink, var(--text-2)); background: color-mix(in srgb, var(--c, var(--text-3)) 13%, transparent);
}
.row[data-medal="gold"] { --c: var(--gold); --ink: var(--gold-ink); }
.row[data-medal="silver"] { --c: var(--silver); --ink: var(--silver-ink); }
.row[data-medal="bronze"] { --c: var(--bronze); --ink: var(--bronze-ink); }
.board__more { margin: 1rem auto 0; display: flex; }

.ach-grid { display: grid; gap: 1rem; margin-top: 1rem; }
.ach-grid .tile__title { display: flex; align-items: center; gap: .6rem; margin-bottom: 1.1rem; }
.ach-grid .tile__title .ic { color: var(--accent); }
.pubs__list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .75rem; }
.pubs__list li {
  padding: 1rem 1.1rem; border-radius: 14px; border: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface-solid) 50%, transparent);
}
.venue {
  display: inline-block; font-size: .7rem; letter-spacing: .06em; color: var(--accent-2);
  padding: .22rem .45rem; border-radius: 6px; border: 1px solid var(--line-strong);
}
.pubs__list p { margin: .55rem 0 .3rem; font-weight: 500; line-height: 1.4; }
.pubs__list small { font-size: .84rem; }
.pubs__list a, .others__list a { color: var(--accent); text-decoration: none; }
.pubs__list a:hover { text-decoration: underline; text-underline-offset: 3px; }

.others__list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .15rem 1.5rem; }
.others__list li { display: flex; gap: .8rem; padding: .7rem 0; border-top: 1px solid var(--line); }
.place {
  flex: none; width: 3.1rem; height: 1.8rem; display: grid; place-items: center; border-radius: 7px;
  font-size: .74rem; font-weight: 500; color: var(--accent); background: var(--accent-soft); border: 1px solid var(--line-strong);
}
.others__list b { display: block; font-size: .9rem; font-weight: 500; line-height: 1.4; }
.others__list small { display: block; margin-top: .15rem; font-size: .8rem; line-height: 1.45; color: var(--text-3); }

/*=============== PROJECTS ===============*/
.projects { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.project { padding: 0; overflow: hidden; display: flex; flex-direction: column; }
.project__media {
  position: relative; aspect-ratio: 16 / 9; overflow: hidden;
  border-bottom: 1px solid var(--line); background: #0c0a12;
}
.project__media img { width: 100%; height: 100%; object-fit: cover; transition: transform .7s var(--ease); }
.project__media--contain { background: #4c1a5e; }
.project__media--contain img { object-fit: contain; }
.project__media--light { background: #fff; }
.project__media--light img { object-fit: contain; padding: .5rem; }
.project:hover .project__media:not(.project__media--contain):not(.project__media--light) img { transform: scale(1.04); }
.project__body { display: flex; flex-direction: column; gap: .75rem; padding: clamp(1.25rem, 2.4vw, 1.6rem); flex: 1; }
.project__body .muted { font-size: .95rem; line-height: 1.7; }
.tags { display: flex; flex-wrap: wrap; gap: .4rem; }
.tags li {
  font: 500 .7rem/1 var(--font-mono); letter-spacing: .03em; padding: .38rem .55rem; border-radius: 6px;
  color: var(--accent); background: var(--accent-soft); border: 1px solid var(--line);
}
.project--featured { grid-column: 1 / -1; }
@media (min-width: 900px) {
  .project--featured { flex-direction: row; }
  .project--featured .project__media { flex: 0 0 54%; aspect-ratio: auto; border-bottom: 0; border-right: 1px solid var(--line); }
  .project--featured .project__body { justify-content: center; gap: .9rem; }
  .project--featured .tile__title { font-size: 1.4rem; }
}
.project__links { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: auto; padding-top: .35rem; }
.link-btn {
  display: inline-flex; align-items: center; gap: .45rem; height: 36px; padding: 0 .9rem; border-radius: 999px;
  font-size: .85rem; font-weight: 500; text-decoration: none; color: var(--text);
  border: 1px solid var(--line-strong); background: var(--surface);
  transition: border-color .2s, background-color .2s, transform .25s var(--ease);
}
.link-btn .ic { width: 15px; height: 15px; color: var(--accent); }
.link-btn:hover { border-color: var(--accent); background: var(--accent-soft); transform: translateY(-1px); }

/*=============== MEETING CTA ===============*/
.cta {
  position: relative; overflow: hidden;
  display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, .8fr); gap: 2rem; align-items: center;
  padding: clamp(2rem, 5vw, 3.75rem);
  border-radius: 28px; border: 1px solid var(--line-strong);
  background:
    radial-gradient(60% 120% at 0% 0%, hsla(var(--hue), 90%, 60%, .26), transparent 60%),
    radial-gradient(55% 110% at 100% 100%, hsla(190, 90%, 55%, .16), transparent 60%),
    var(--surface-solid);
}
.cta::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image: linear-gradient(var(--grid-line) 1px, transparent 1px), linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 40px 40px;
  -webkit-mask-image: radial-gradient(ellipse 60% 80% at 80% 50%, #000, transparent 70%);
  mask-image: radial-gradient(ellipse 60% 80% at 80% 50%, #000, transparent 70%);
}
.cta > * { position: relative; }
.cta__title { margin-top: 1rem; font-size: clamp(1.8rem, 3vw + .6rem, 2.9rem); line-height: 1.1; letter-spacing: -.04em; font-weight: 600; }
.cta__text { margin: .8rem 0 1.8rem; font-size: 1.1rem; color: var(--text-2); }

.cal {
  margin-left: auto; width: min(100%, 300px); padding: 1.1rem; border-radius: 18px;
  background: var(--surface); border: 1px solid var(--line-strong); box-shadow: var(--shadow);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  transform: rotate(2deg);
}
.cal__head { display: flex; align-items: center; gap: .5rem; font-size: .88rem; font-weight: 500; }
.cal__head .ic { color: var(--accent); }
.cal__days, .cal__grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: .4rem; }
.cal__days { margin: 1rem 0 .5rem; font-size: .66rem; color: var(--text-3); text-align: center; }
.cal__grid i { aspect-ratio: 1; border-radius: 8px; background: color-mix(in srgb, var(--text) 5%, transparent); }
.cal__grid i.on { background: var(--accent-soft); box-shadow: inset 0 0 0 1px var(--line-strong); }
.cal__grid i.off { background: transparent; box-shadow: inset 0 0 0 1px var(--line); }
.cal__grid i.sel { background: var(--accent-strong); box-shadow: 0 0 18px hsla(var(--hue), 90%, 60%, .6); }
.cal__slots { display: grid; grid-template-columns: repeat(3, 1fr); gap: .4rem; margin-top: 1rem; }
.cal__slots span {
  text-align: center; padding: .45rem 0; border-radius: 8px; font-size: .74rem;
  color: var(--text-2); border: 1px solid var(--line-strong);
}
.cal__slots .sel { color: #fff; background: var(--accent-strong); border-color: transparent; }

/*=============== TESTIMONIALS ===============*/
.quotes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.quote { margin: 0; display: flex; flex-direction: column; gap: 1.5rem; }
.quote::marker { content: none; }
.quote blockquote {
  position: relative; margin: 0; padding-top: 2.4rem;
  font-size: 1.05rem; line-height: 1.7; color: var(--text-2);
}
.quote blockquote::before {
  content: "\201C"; position: absolute; top: -.6rem; left: -.1rem;
  font: 600 4.2rem/1 var(--font-sans); background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.quote figcaption { margin-top: auto; display: flex; align-items: center; gap: .8rem; }
.quote figcaption b { display: block; font-weight: 600; }
.quote figcaption small { display: block; font-size: .84rem; color: var(--text-3); }
.avatar {
  width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; flex: none;
  font: 600 .8rem/1 var(--font-mono); color: #fff;
  background: linear-gradient(135deg, hsl(var(--hue) 85% 58%), hsl(230 85% 60%));
}
.avatar--alt { background: linear-gradient(135deg, hsl(190 85% 42%), hsl(230 85% 60%)); }

/*=============== CONTACT ===============*/
.contact { display: grid; grid-template-columns: minmax(0, .85fr) minmax(0, 1.15fr); gap: clamp(2rem, 5vw, 4rem); align-items: start; }
.contact__lead { margin-top: 1rem; font-size: 1.05rem; max-width: 26rem; }
.contact__list { display: grid; gap: .6rem; margin-top: 2rem; }
.contact__list a, .contact__list li > div {
  display: flex; align-items: center; gap: .9rem; padding: .8rem; border-radius: 14px;
  text-decoration: none; color: var(--text);
  border: 1px solid var(--line); background: var(--surface);
  transition: border-color .2s, background-color .2s, transform .25s var(--ease);
  overflow-wrap: anywhere;
}
.contact__list a:hover { border-color: var(--line-strong); background: var(--surface-hover); transform: translateX(3px); }
.contact__list small { display: block; font: 500 .7rem/1.4 var(--font-mono); letter-spacing: .1em; text-transform: uppercase; color: var(--text-3); }
.contact__icon {
  width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center; flex: none;
  color: var(--accent); background: var(--accent-soft);
}
.contact__icon .ic { width: 18px; height: 18px; }

.term { padding: 0; overflow: hidden; }
.term__body { padding: clamp(1.25rem, 2.6vw, 1.75rem); display: grid; gap: 1.1rem; }
.field-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.1rem; }
.field { display: grid; gap: .45rem; align-content: start; }
.field label { font: 500 .72rem/1 var(--font-mono); letter-spacing: .1em; text-transform: uppercase; color: var(--text-3); }
.field input, .field textarea {
  width: 100%; padding: .85rem 1rem; border-radius: 12px;
  font: 400 1rem/1.5 var(--font-sans); color: var(--text);
  background: var(--input); border: 1px solid var(--line-strong);
  transition: border-color .2s, box-shadow .2s;
}
.field textarea { resize: vertical; min-height: 150px; }
.field input::placeholder, .field textarea::placeholder { color: var(--text-3); }
.field input:focus, .field textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.field [aria-invalid="true"] { border-color: var(--err); }
.field__msg { min-height: 1.1em; font: 400 .76rem/1.3 var(--font-mono); color: var(--err); }
.field__msg.ok { color: var(--ok); }
.form__foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem; }
.form__status { font-size: .82rem; color: var(--text-3); min-height: 1.2em; flex: 1 1 14rem; }
.form__status.ok { color: var(--ok); }
.form__status.err { color: var(--err); }

/*=============== FOOTER ===============*/
.footer { position: relative; margin-top: clamp(5rem, 10vw, 8rem); border-top: 1px solid var(--line); overflow: hidden; }
.footer__inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1.5rem 2rem; padding: 2.5rem 0 1.5rem; }
.footer__role { margin-top: .4rem; font-size: .9rem; }
.footer__links { display: flex; flex-wrap: wrap; gap: .4rem 1.6rem; }
.footer__links a { color: var(--text-2); text-decoration: none; font-size: .95rem; }
.footer__links a:hover { color: var(--text); }
.footer .socials { margin-top: 0; }
.footer__base {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: .5rem 2rem;
  padding: 1.25rem 0 1.5rem; border-top: 1px solid var(--line); font-size: .84rem; color: var(--text-3);
}
.footer__word {
  font-weight: 700; font-size: clamp(5rem, 22vw, 17rem); line-height: .8; letter-spacing: -.06em; text-align: center;
  margin-bottom: -.12em; user-select: none;
  background: linear-gradient(to bottom, color-mix(in srgb, var(--text) 9%, transparent), transparent 85%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}

.scrollup {
  position: fixed; right: 1rem; bottom: -4rem; z-index: 40;
  width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center;
  color: #fff; background: var(--btn); box-shadow: 0 12px 30px -10px hsla(var(--hue), 90%, 55%, .8);
  visibility: hidden;
  transition: bottom .35s var(--ease), transform .25s var(--ease), visibility 0s .35s;
}
.scrollup.show { bottom: 1.25rem; visibility: visible; transition: bottom .35s var(--ease), transform .25s var(--ease); }
.scrollup:hover { transform: translateY(-3px); }

/*=============== MOTION ===============*/
/* Hero animates on load with CSS alone, so it never waits on script. */
html:not(.entered) .hero .reveal { animation: rise .9s var(--ease) both; animation-delay: calc(var(--d, 0) * 90ms + 60ms); }
@keyframes rise { from { opacity: 0; transform: translateY(16px); } }

/* Everything else reveals on scroll, and only when script is running. */
.js main > section:not(.hero) .reveal {
  opacity: 0; translate: 0 22px;
  transition: opacity .8s var(--ease), translate .8s var(--ease), transform .35s var(--ease), border-color .3s, background-color .3s;
  transition-delay: calc(var(--d, 0) * 80ms), calc(var(--d, 0) * 80ms), 0s, 0s, 0s;
}
.js main > section:not(.hero) .reveal.in { opacity: 1; translate: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; animation-delay: 0s !important; transition-duration: .01ms !important; }
  .js main > section:not(.hero) .reveal { opacity: 1; translate: none; }
  .marquee__track { animation: none; }
  .scan__sweep { display: none; }
}

/* On-page pause for everything that loops (WCAG 2.2.2). One-shot entrances jump
   to their end state rather than freezing half-drawn. */
.motion-toggle {
  position: absolute; bottom: 1.1rem; right: max(var(--gutter), calc((100% - var(--container)) / 2));
  display: inline-flex; align-items: center; gap: .5rem; height: 30px; padding: 0 .75rem;
  font-size: .7rem; letter-spacing: .08em; text-transform: uppercase; color: var(--text-3);
  border: 1px solid var(--line); border-radius: 999px; background: var(--surface); cursor: pointer;
  transition: color .2s, border-color .2s;
}
.motion-toggle:hover { color: var(--text); border-color: var(--line-strong); }
.motion-toggle__icon { width: 8px; height: 9px; border-left: 2.5px solid currentColor; border-right: 2.5px solid currentColor; }
.motion-paused .motion-toggle__icon {
  width: 0; height: 0; border-left: 8px solid currentColor; border-right: 0;
  border-top: 5px solid transparent; border-bottom: 5px solid transparent;
}
.motion-paused *, .motion-paused *::before, .motion-paused *::after { animation-play-state: paused !important; }
.motion-paused .hero .reveal { animation: none; }
.motion-paused .scan__bones path { animation: none; stroke-dashoffset: 0; }
.motion-paused .scan__joints circle { animation: none; opacity: 1; }
.motion-paused .scan__sweep { display: none; }
/* Motion is already off for these visitors, so the control is noise. */
@media (prefers-reduced-motion: reduce) { .motion-toggle { display: none; } }

@media print {
  :root, [data-theme="dark"], [data-theme="light"] {
    --bg: #fff; --surface: #fff; --surface-solid: #fff; --line: #ddd; --line-strong: #bbb;
    --text: #000; --text-2: #222; --text-3: #444; --accent: #5b0fa8; --accent-2: #055a6e;
    --gold-ink: #6e5200; --silver-ink: #4f5968; --bronze-ink: #7f4318;
  }
  body { background: #fff; color: #000; }
  .reveal { opacity: 1 !important; translate: none !important; transform: none !important; animation: none !important; }
  .backdrop, .scrollup, .marquee, .hero__scroll, .motion-toggle, .nav__menu, .nav__actions,
  .scan__sweep, .scan__orbit, .scan__glow, .chip-card, .cta__visual, .footer__word, .skip { display: none !important; }
  .grad, .stat__num, .quote blockquote::before { background: none !important; color: #000 !important; -webkit-text-fill-color: #000; }
  .btn, .btn--primary, .brand__mark, .avatar, .tl__node, .scan__label, .nav__badge, .ps-bar, .ps-bar a, .link-btn, .place, .tag {
    color: #000 !important; background: none !important; box-shadow: none !important; border: 1px solid #bbb !important;
  }
  .code { color: #222 !important; }
  .code .k, .code .s, .code .n, .code .p { color: #333 !important; }
  .field input, .field textarea { background: #fff !important; }
  .header { position: static; }
  .tile, .cta, .stats { break-inside: avoid; box-shadow: none; backdrop-filter: none; -webkit-backdrop-filter: none; }
  .scan__bones path { animation: none; stroke-dashoffset: 0; }
  .scan__joints circle { animation: none; opacity: 1; }
  /* Paper gets every finish, whatever the on-screen filter shows. */
  .board__rows .row[hidden] { display: grid !important; }
  .board__more, .board__filters { display: none !important; }
  a { text-decoration: none; }
}

/*=============== RESPONSIVE ===============*/
@media (max-width: 1024px) {
  .hero__inner { grid-template-columns: minmax(0, 1fr) minmax(0, .8fr); }
  .chip-card--a { right: -4%; }
  .chip-card--b { left: -2%; }
}

@media (max-width: 900px) {
  .hero__inner { grid-template-columns: 1fr; min-height: 0; }
  .hero__visual { order: -1; }
  .scan { width: min(78vw, 380px); }
  .hero__scroll { display: none; }
  .motion-toggle { bottom: .9rem; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .stat:nth-child(3) { border-left: 0; }
  .stat:nth-child(n + 3) { border-top: 1px solid var(--line); }
  .bento > * { grid-column: 1 / -1 !important; grid-row: auto !important; }
  .skills { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .skill--wide { grid-column: 1 / -1; }
  .records { grid-template-columns: 1fr; }
  .pubs__list, .others__list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cta { grid-template-columns: 1fr; }
  .cal { margin: 0; transform: none; }
  .contact { grid-template-columns: 1fr; }
}

@media (max-width: 700px) {
  .timeline { --rail: 0px; }
  .timeline::before { left: 17px; }
  .tl { grid-template-columns: 1fr; gap: .5rem; padding: 0 0 1rem 3.25rem; }
  .tl__when { padding-top: .45rem; text-align: left; }
  .tl__node { left: 17px; top: .1rem; }
  .projects, .quotes { grid-template-columns: 1fr; }
  .pubs__list, .others__list { grid-template-columns: 1fr; }
  .board__cols { display: none; }
  .row {
    grid-template-columns: 18px minmax(0, 1fr) auto;
    grid-template-areas: "medal main pct" ". rank rank";
    row-gap: .35rem; padding: .85rem .5rem;
  }
  .row .medal { grid-area: medal; align-self: start; margin-top: .4rem; }
  .row__main { grid-area: main; }
  .row__rank { grid-area: rank; text-align: left; font-size: .9rem; }
  .row__pct { grid-area: pct; align-self: start; }
}

@media (max-width: 560px) {
  .hero__ctas .btn { flex: 1 1 100%; }
  .skills { grid-template-columns: 1fr; }
  .field-row { grid-template-columns: 1fr; }
  .stat { padding: 1.2rem 1.1rem; }
  .tile--kaggle { flex-direction: column; align-items: flex-start; }
  .tile--kaggle img { width: 72px; }
  .chip-card { padding: .5rem .7rem .5rem .55rem; gap: .55rem; }
  .chip-card b { font-size: .78rem; }
  .chip-card small { font-size: .66rem; }
  .chip-card__icon { width: 26px; height: 26px; }
  .chip-card--a { right: -3%; top: -7%; }
  .chip-card--b { left: -3%; bottom: 8%; }
  .form__foot .btn { flex: 1 1 100%; }
  .status__loc { display: none; }
  .code { font-size: .74rem; padding: 1rem 1.1rem 1.2rem; }
}
