/* ==========================================================================
   Ibrahim Mustapha — portfolio stylesheet (v2)
   Dark theme by default; light theme via [data-theme="light"].
   No build step. Order: tokens → base → backdrop → layout → components → pages → responsive.
   ========================================================================== */

:root {
  --bg: #060A14;
  --bg-alt: rgba(14, 21, 38, 0.55);
  --surface: rgba(17, 25, 43, 0.72);
  --surface-solid: #0F1729;
  --surface-2: rgba(30, 41, 64, 0.6);
  --border: rgba(148, 163, 184, 0.13);
  --border-strong: rgba(148, 163, 184, 0.26);
  --text: #F1F5F9;
  --text-muted: #94A3B8;
  --accent: #22D3EE;
  --accent-strong: #06B6D4;
  --accent-ink: #04202A;
  --violet: #8B5CF6;
  --success: #34D399;
  --warn: #FBBF24;
  --danger: #F87171;
  --grid-line: rgba(148, 163, 184, 0.07);
  --orb-a: rgba(34, 211, 238, 0.22);
  --orb-b: rgba(139, 92, 246, 0.22);
  --orb-c: rgba(14, 165, 233, 0.14);
  --shadow: 0 1px 0 rgba(255,255,255,.04) inset, 0 18px 40px -20px rgba(0,0,0,.7);
  --shadow-lg: 0 30px 80px -30px rgba(0,0,0,.8);
  --glow: 0 0 0 1px rgba(34,211,238,.35), 0 18px 50px -18px rgba(34,211,238,.45);
  --radius: 20px;
  --radius-sm: 12px;
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --container: 1440px;
  --gutter: clamp(16px, 2.6vw, 40px);
  --header-h: 76px;
  color-scheme: dark;
}

:root[data-theme="light"] {
  --bg: #F6F8FC;
  --bg-alt: rgba(255, 255, 255, 0.55);
  --surface: rgba(255, 255, 255, 0.82);
  --surface-solid: #FFFFFF;
  --surface-2: rgba(241, 245, 249, 0.9);
  --border: rgba(15, 23, 42, 0.09);
  --border-strong: rgba(15, 23, 42, 0.18);
  --text: #0B1220;
  --text-muted: #4B5768;
  --accent: #0891B2;
  --accent-strong: #0E7490;
  --accent-ink: #FFFFFF;
  --violet: #7C3AED;
  --success: #059669;
  --warn: #B45309;
  --danger: #DC2626;
  --grid-line: rgba(15, 23, 42, 0.05);
  --orb-a: rgba(34, 211, 238, 0.20);
  --orb-b: rgba(139, 92, 246, 0.16);
  --orb-c: rgba(56, 189, 248, 0.14);
  --shadow: 0 1px 2px rgba(15,23,42,.05), 0 16px 36px -22px rgba(15,23,42,.25);
  --shadow-lg: 0 30px 70px -34px rgba(15,23,42,.35);
  --glow: 0 0 0 1px rgba(8,145,178,.35), 0 18px 44px -20px rgba(8,145,178,.4);
  color-scheme: light;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 16px); -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  min-height: 100vh;
}
img, svg { display: block; max-width: 100%; }
img { height: auto; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
h1, h2, h3, h4, h5, h6 { line-height: 1.2; margin: 0 0 .5em; letter-spacing: -0.015em; font-weight: 700; }
p { margin: 0 0 1em; }
ul, ol { margin: 0; padding: 0; }
::selection { background: color-mix(in srgb, var(--accent) 35%, transparent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }
main { position: relative; }
main:focus { outline: none; }
.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; }
.skip-link { position: absolute; left: 16px; top: -60px; z-index: 100; background: var(--accent); color: var(--accent-ink); padding: 10px 16px; border-radius: var(--radius-sm); font-weight: 600; }
.skip-link:focus { top: 12px; }
.mono { font-family: var(--mono); }
.muted { color: var(--text-muted); }
.small { font-size: .875rem; }
.warn { color: var(--warn); }
.h3 { font-size: 1.5rem; display: flex; align-items: center; gap: .6rem; margin-top: 1.5rem; }
.h3 .icon { color: var(--accent); }
.h4 { font-size: 1.2rem; }
.h5 { font-size: 1.05rem; }
.h6 { font-size: .75rem; text-transform: uppercase; letter-spacing: .1em; color: var(--text-muted); margin-top: 1.4rem; font-family: var(--mono); font-weight: 500; }
.empty { color: var(--text-muted); font-style: italic; }
.text-gradient {
  background: linear-gradient(100deg, var(--text) 0%, var(--text) 45%, var(--accent) 78%, var(--violet) 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  }

/* ---------- Backdrop: aurora orbs + engineering grid + grain ---------- */
.backdrop { position: fixed; inset: 0; z-index: -1; pointer-events: none; overflow: hidden; background: var(--bg); }
.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: 56px 56px;
  -webkit-mask-image: radial-gradient(ellipse 90% 70% at 50% 0%, #000 30%, transparent 100%);
  mask-image: radial-gradient(ellipse 90% 70% at 50% 0%, #000 30%, transparent 100%);
}
.backdrop::after {
  content: ""; position: absolute; inset: 0; opacity: .35; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.5'/%3E%3C/svg%3E");
}
.backdrop__orb { position: absolute; border-radius: 50%; filter: blur(90px); }
.backdrop__orb--a { width: 46vw; height: 46vw; max-width: 760px; max-height: 760px; top: -18vw; right: -8vw; background: var(--orb-a); animation: drift 26s ease-in-out infinite alternate; }
.backdrop__orb--b { width: 40vw; height: 40vw; max-width: 680px; max-height: 680px; top: 30vh; left: -16vw; background: var(--orb-b); animation: drift 32s ease-in-out infinite alternate-reverse; }
.backdrop__orb--c { width: 34vw; height: 34vw; max-width: 560px; max-height: 560px; bottom: -14vw; right: 18vw; background: var(--orb-c); animation: drift 38s ease-in-out infinite alternate; }
@keyframes drift { from { transform: translate3d(0,0,0) scale(1); } to { transform: translate3d(4vw,3vh,0) scale(1.08); } }

/* ---------- Layout ---------- */
.container { width: 100%; max-width: var(--container); margin: 0 auto; padding: 0 var(--gutter); }
.narrow { max-width: 820px; }
.section { position: relative; padding: clamp(56px, 7vw, 104px) 0; }
.section--tight { padding: clamp(28px, 4vw, 56px) 0; }
.section--alt {
  background: linear-gradient(180deg, transparent, var(--bg-alt) 18%, var(--bg-alt) 82%, transparent);
}
.grid { display: grid; gap: clamp(16px, 1.8vw, 24px); }
.grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.split { display: grid; grid-template-columns: 5fr 7fr; gap: clamp(32px, 5vw, 72px); align-items: start; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(32px, 5vw, 64px); }

/* ---------- Header / nav (floating glass bar) ---------- */
.site-header { position: sticky; top: 0; z-index: 50; padding: 12px 0; transition: padding .2s; }
.site-header.is-scrolled { padding: 8px 0; }
.nav {
  position: relative; height: 60px; display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 0 10px 0 14px; border-radius: 18px; border: 1px solid var(--border);
  background: color-mix(in srgb, var(--surface-solid) 70%, transparent);
  backdrop-filter: saturate(170%) blur(16px); -webkit-backdrop-filter: saturate(170%) blur(16px);
  box-shadow: var(--shadow);
  transition: border-color .2s, box-shadow .2s;
}
.site-header.is-scrolled .nav { border-color: var(--border-strong); box-shadow: var(--shadow-lg); }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--text); font-weight: 700; letter-spacing: -0.01em; }
.brand:hover { text-decoration: none; }
.brand__mark {
  width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center;
  font-size: .82rem; letter-spacing: .02em; color: #fff;
  background: linear-gradient(135deg, var(--accent-strong), var(--violet));
  box-shadow: 0 6px 18px -6px color-mix(in srgb, var(--violet) 70%, transparent);
}
.brand__text { white-space: nowrap; }
.nav__menu { display: flex; align-items: center; gap: 16px; }
.nav__links { display: flex; list-style: none; gap: 2px; padding: 4px; border-radius: 12px; }
.nav__link { display: block; padding: 7px 13px; border-radius: 9px; color: var(--text-muted); font-weight: 500; font-size: .92rem; transition: color .15s, background .15s; }
.nav__link:hover { color: var(--text); text-decoration: none; background: var(--surface-2); }
.nav__link.is-active { color: var(--text); background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--border); }
.nav__actions { display: flex; align-items: center; gap: 8px; }
.icon-btn.nav__toggle { display: none; }

.icon-btn {
  display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 11px;
  border: 1px solid var(--border); background: var(--surface-2); color: var(--text); cursor: pointer;
  transition: border-color .15s, background .15s, color .15s, transform .15s;
}
.icon-btn:hover { border-color: var(--accent); color: var(--accent); text-decoration: none; transform: translateY(-1px); }
.icon-btn--sm { width: 32px; height: 32px; border-radius: 9px; }
.theme-icon--sun { display: none; }
:root[data-theme="light"] .theme-icon--sun { display: block; }
:root[data-theme="light"] .theme-icon--moon { display: none; }

/* ---------- Buttons ---------- */
.btn {
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 10px 20px; border-radius: 12px; border: 1px solid transparent;
  font: inherit; font-weight: 600; font-size: .95rem; cursor: pointer; white-space: nowrap;
  transition: transform .15s, background .2s, border-color .15s, color .15s, box-shadow .2s;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn--primary {
  color: var(--accent-ink);
  background: linear-gradient(135deg, var(--accent) 0%, color-mix(in srgb, var(--accent) 60%, var(--violet)) 100%);
  box-shadow: 0 10px 30px -12px color-mix(in srgb, var(--accent) 80%, transparent), inset 0 1px 0 rgba(255,255,255,.25);
}
.btn--primary:hover { color: var(--accent-ink); box-shadow: 0 14px 36px -12px color-mix(in srgb, var(--accent) 90%, transparent), inset 0 1px 0 rgba(255,255,255,.3); }
.btn--ghost { border-color: var(--border-strong); color: var(--text); background: var(--surface); backdrop-filter: blur(8px); }
.btn--ghost:hover { border-color: var(--accent); color: var(--accent); }
.btn--text { color: var(--text); padding-inline: 10px; }
.btn--text:hover { color: var(--accent); }
.btn--sm { min-height: 38px; padding: 7px 14px; font-size: .875rem; border-radius: 10px; }
.btn--lg { min-height: 50px; padding: 12px 24px; font-size: 1rem; border-radius: 14px; }
.btn--block { width: 100%; }
.link-arrow { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; }
.link-arrow .icon, .btn .icon { transition: transform .15s; }
.link-arrow:hover .icon, .btn:hover .icon:last-child { transform: translateX(3px); }
.link-back { display: inline-flex; align-items: center; gap: 6px; color: var(--text-muted); font-size: .9rem; margin-bottom: 1.2rem; }
.link-back:hover { color: var(--accent); text-decoration: none; }

/* ---------- Pills, badges, status ---------- */
.pill { display: inline-flex; align-items: center; padding: 4px 11px; border-radius: 999px; font-size: .76rem; font-weight: 600; background: color-mix(in srgb, var(--violet) 15%, transparent); color: color-mix(in srgb, var(--violet) 65%, var(--text)); border: 1px solid color-mix(in srgb, var(--violet) 25%, transparent); }
.pill--link { background: color-mix(in srgb, var(--accent) 10%, transparent); color: var(--accent); border-color: color-mix(in srgb, var(--accent) 25%, transparent); font-weight: 500; }
.pill--link:hover { text-decoration: none; border-color: var(--accent); }
.tech-list { display: flex; flex-wrap: wrap; gap: 6px; list-style: none; }
.badge { display: inline-flex; align-items: center; padding: 4px 10px; border-radius: 8px; font-size: .76rem; font-weight: 500; border: 1px solid var(--border); background: var(--surface-2); color: var(--text); }
.badge--applied::before, .badge--prototype::before, .badge--learning::before { content: ""; width: 6px; height: 6px; border-radius: 50%; margin-right: 7px; flex: none; }
.badge--applied { border-color: color-mix(in srgb, var(--success) 35%, transparent); }
.badge--applied::before { background: var(--success); box-shadow: 0 0 8px var(--success); }
.badge--prototype { border-color: color-mix(in srgb, var(--accent) 35%, transparent); }
.badge--prototype::before { background: var(--accent); box-shadow: 0 0 8px var(--accent); }
.badge--learning { border-style: dashed; color: var(--text-muted); }
.badge--learning::before { border: 1.5px solid var(--warn); }
.status { font-size: .72rem; font-weight: 500; font-family: var(--mono); color: var(--text-muted); display: inline-flex; align-items: center; gap: 7px; padding: 3px 10px 3px 8px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border); text-transform: uppercase; letter-spacing: .04em; }
.status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; box-shadow: 0 0 8px currentColor; }
.status--completed { color: var(--success); }
.status--prototype, .status--active { color: var(--accent); }
.status--in_progress { color: var(--warn); }
.status--planned, .status--proposed { color: var(--text-muted); }
.status--planned::before, .status--proposed::before { box-shadow: none; }

/* ---------- Cards (glass + gradient hairline on hover) ---------- */
.card {
  position: relative; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: clamp(20px, 2vw, 28px); box-shadow: var(--shadow);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  transition: transform .25s ease, border-color .25s ease, box-shadow .25s ease;
}
.card::before {
  content: ""; position: absolute; inset: -1px; border-radius: inherit; padding: 1px; pointer-events: none;
  background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 70%, transparent), transparent 40%, transparent 60%, color-mix(in srgb, var(--violet) 70%, transparent));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
  opacity: 0; transition: opacity .25s ease;
}
.card:hover::before { opacity: 1; }
.card--dashed { border-style: dashed; box-shadow: none; background: transparent; backdrop-filter: none; }
.card--dashed::before { display: none; }
.empty-card { display: flex; gap: 16px; align-items: flex-start; }
.empty-card p { margin: 0; color: var(--text-muted); }

/* ---------- Hero ---------- */
.hero { position: relative; padding: clamp(32px, 6vw, 88px) 0 clamp(40px, 6vw, 80px); }
.hero__grid { position: relative; display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr); gap: clamp(32px, 5vw, 80px); align-items: center; }
.hero__kicker { display: flex; flex-wrap: wrap; gap: 8px; font-family: var(--mono); font-size: .8rem; letter-spacing: .04em; text-transform: uppercase; color: var(--accent); margin-bottom: 1.1rem; }
.hero__kicker span { color: var(--text-muted); }
.hero__title { font-size: clamp(2.3rem, 5vw, 4.4rem); font-weight: 800; letter-spacing: -0.035em; line-height: 1.04; margin-bottom: .55em; max-width: 16ch; }
.hero__lead { font-size: clamp(1.02rem, 1.3vw, 1.18rem); color: var(--text-muted); max-width: 60ch; }
.hero__ctas { display: flex; flex-wrap: wrap; gap: 12px; margin: 30px 0 24px; }
.eyebrow { display: inline-flex; align-items: center; gap: 10px; font-family: var(--mono); font-size: .78rem; letter-spacing: .08em; text-transform: uppercase; color: var(--accent); margin-bottom: 1rem; }
.eyebrow__index { color: var(--text-muted); padding-right: 10px; border-right: 1px solid var(--border-strong); }
.availability {
  display: inline-flex; align-items: center; gap: 10px; padding: 6px 14px 6px 10px; border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--success) 30%, var(--border)); background: color-mix(in srgb, var(--success) 8%, var(--surface));
  font-size: .85rem; color: var(--text); margin-bottom: 22px;
}
.availability__dot { position: relative; width: 8px; height: 8px; border-radius: 50%; background: var(--success); }
.availability__dot::after { content: ""; position: absolute; inset: -4px; border-radius: 50%; border: 2px solid var(--success); opacity: .6; animation: ping 2s ease-out infinite; }
@keyframes ping { from { transform: scale(.6); opacity: .7; } to { transform: scale(1.8); opacity: 0; } }
.social { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; align-items: center; }

.hero__stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0; margin: 36px 0 0; padding-top: 24px; border-top: 1px solid var(--border); max-width: 640px; }
.stat { padding-right: 16px; }
.stat + .stat { padding-left: 16px; border-left: 1px solid var(--border); }
.stat dd { margin: 0; font-size: clamp(1.5rem, 2.4vw, 2rem); font-weight: 800; letter-spacing: -0.03em; line-height: 1.1; order: -1; }
.stat dt { font-size: .78rem; color: var(--text-muted); margin-top: 4px; }
.stat { display: flex; flex-direction: column; }

.hero__visual { position: relative; justify-self: end; width: 100%; max-width: 520px; }
.portrait-frame { position: relative; padding: 1px; border-radius: 24px; background: linear-gradient(140deg, var(--accent), transparent 40%, transparent 60%, var(--violet)); box-shadow: 0 0 80px -20px color-mix(in srgb, var(--accent) 45%, transparent); }
.portrait { margin: 0; border-radius: 22px; overflow: hidden; background: var(--surface-solid); aspect-ratio: 44 / 50; box-shadow: var(--shadow-lg); }
.portrait img { width: 100%; height: 100%; object-fit: cover; }
.float-chip {
  position: absolute; display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: 999px;
  font-size: .78rem; font-weight: 600; color: var(--text); background: color-mix(in srgb, var(--surface-solid) 85%, transparent);
  border: 1px solid var(--border-strong); box-shadow: var(--shadow-lg); backdrop-filter: blur(10px);
  animation: bob 6s ease-in-out infinite;
}
.float-chip .icon { color: var(--accent); }
.float-chip--a { top: 22%; left: -22px; }
.float-chip--b { top: 38%; right: -18px; animation-delay: -2s; }
.float-chip--c { top: 58%; left: -26px; animation-delay: -4s; }
@keyframes bob { 50% { transform: translateY(-8px); } }
.identity-panel {
  position: relative; margin: -96px 28px 0 -40px; padding: 18px 20px 20px;
  background: color-mix(in srgb, var(--surface-solid) 88%, transparent); backdrop-filter: blur(14px);
  border: 1px solid var(--border-strong); border-radius: 18px; box-shadow: var(--shadow-lg);
}
.identity-panel__label { display: flex; align-items: center; gap: 12px; font-size: .74rem; color: var(--text-muted); margin-bottom: 12px; padding-bottom: 12px; border-bottom: 1px solid var(--border); }
.identity-panel__dots { display: inline-flex; gap: 5px; }
.identity-panel__dots i { width: 9px; height: 9px; border-radius: 50%; background: #F87171; }
.identity-panel__dots i:nth-child(2) { background: #FBBF24; }
.identity-panel__dots i:nth-child(3) { background: #34D399; }
.identity-panel__rows { margin: 0 0 14px; display: grid; gap: 8px; }
.identity-panel__rows div { display: grid; grid-template-columns: 96px 1fr; gap: 10px; font-size: .88rem; }
.identity-panel__rows dt { color: var(--accent); font-family: var(--mono); font-size: .78rem; padding-top: 2px; }
.identity-panel__rows dd { margin: 0; font-weight: 500; }

/* ---------- Capabilities ---------- */
.capabilities { padding: 8px 0 clamp(24px, 3vw, 40px); }
.capabilities__grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.capability {
  display: flex; gap: 14px; align-items: center; padding: 18px 20px; border-radius: 16px;
  background: var(--surface); border: 1px solid var(--border); backdrop-filter: blur(12px);
  transition: border-color .2s, transform .2s;
}
.capability:hover { border-color: color-mix(in srgb, var(--accent) 45%, var(--border)); transform: translateY(-2px); }
.capability__icon { width: 42px; height: 42px; flex: none; display: grid; place-items: center; border-radius: 12px; color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, transparent); border: 1px solid color-mix(in srgb, var(--accent) 22%, transparent); }
.capability span:last-child { display: grid; line-height: 1.35; }
.capability strong { font-size: .95rem; }
.capability small { color: var(--text-muted); font-size: .8rem; }

/* ---------- Section headings ---------- */
.section-heading { margin-bottom: clamp(28px, 3.5vw, 48px); }
.section-heading > div { max-width: 760px; }
.section-heading--split { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; }
.section-heading__link { flex: none; }
.section-heading--center { text-align: center; }
.section-heading--center > div { margin-inline: auto; }
.section-title { font-size: clamp(1.75rem, 3.2vw, 2.7rem); font-weight: 800; letter-spacing: -0.03em; margin-bottom: .35em; }
.section-lead { color: var(--text-muted); font-size: 1.06rem; margin: 0; }

/* ---------- Project cards ---------- */
.project-card { padding: 0; overflow: hidden; display: flex; flex-direction: column; }
.project-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.project-card__media { position: relative; display: block; aspect-ratio: 16 / 9; overflow: hidden; background: var(--surface-solid); border-bottom: 1px solid var(--border); }
.project-card__media::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 55%, color-mix(in srgb, var(--surface-solid) 60%, transparent)); pointer-events: none; }
.project-card__media img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s cubic-bezier(.2,.7,.2,1); }
.project-card:hover .project-card__media img { transform: scale(1.05); }
.project-card__body { padding: 20px 22px 22px; display: flex; flex-direction: column; gap: 12px; flex: 1; }
.project-card__meta { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.project-card__title { font-size: 1.18rem; margin: 0; letter-spacing: -0.02em; }
.project-card__title a { color: var(--text); }
.project-card__title a:hover { color: var(--accent); text-decoration: none; }
.project-card__title a::after { content: ""; position: absolute; inset: 0; z-index: 0; }
.project-card__desc { color: var(--text-muted); font-size: .93rem; margin: 0; }
.project-card__links { position: relative; z-index: 1; margin-top: auto; padding-top: 14px; border-top: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; }
.project-card__ext { display: flex; gap: 6px; }

/* Bento layout for featured projects: one wide hero card, then two cards side by side */
.grid--bento { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid--bento > .project-card:first-child { grid-column: 1 / -1; flex-direction: row; }
.grid--bento > .project-card:first-child .project-card__media { width: 56%; flex: none; aspect-ratio: 16 / 9; border-bottom: 0; border-right: 1px solid var(--border); }
.grid--bento > .project-card:first-child .project-card__body { padding: clamp(22px, 2.6vw, 36px); justify-content: center; }
.grid--bento > .project-card:first-child .project-card__title { font-size: clamp(1.4rem, 2vw, 1.8rem); }
.grid--bento > .project-card:first-child .project-card__desc { font-size: 1rem; }

/* ---------- Phases (journey) ---------- */
.phases { list-style: none; display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(16px, 1.8vw, 24px); position: relative; }
.phase { position: relative; padding: 28px; border-radius: var(--radius); border: 1px solid var(--border); background: var(--surface); backdrop-filter: blur(12px); overflow: hidden; }
.phase::after { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 3px; background: linear-gradient(90deg, var(--accent), var(--violet)); }
.phase__num { position: absolute; right: 22px; top: 14px; font-size: 3.4rem; font-weight: 500; line-height: 1; color: transparent; -webkit-text-stroke: 1px var(--border-strong); }
.phase__icon { width: 46px; height: 46px; display: grid; place-items: center; border-radius: 13px; color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, transparent); border: 1px solid color-mix(in srgb, var(--accent) 22%, transparent); margin-bottom: 18px; }
.phase h3 { font-size: 1.18rem; }
.phase p { color: var(--text-muted); margin: 0; font-size: .95rem; }

/* ---------- Domain / achievement cards ---------- */
.domain-card__head { display: flex; align-items: center; gap: 14px; margin-bottom: 16px; }
.domain-card__head h3 { margin: 0; font-size: 1.05rem; }
.achievement h3 { font-size: 1.05rem; margin-top: 16px; }
.domain-card__icon, .achievement__icon {
  width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; flex: none;
  color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--accent) 22%, transparent);
}
.achievement p { color: var(--text-muted); font-size: .92rem; }
.card:hover .domain-card__icon, .card:hover .achievement__icon { background: linear-gradient(135deg, var(--accent), var(--violet)); color: #fff; border-color: transparent; }

/* ---------- Publications ---------- */
.pub-list { display: grid; gap: 14px; }
.pub { display: grid; grid-template-columns: 64px 1fr; gap: 16px; padding: 20px 22px; border-radius: var(--radius); border: 1px solid var(--border); background: var(--surface); backdrop-filter: blur(12px); transition: border-color .2s; }
.pub:hover { border-color: color-mix(in srgb, var(--accent) 40%, var(--border)); }
.pub__year { color: var(--accent); font-weight: 500; padding-top: 2px; }
.pub__title { font-size: 1.02rem; margin-bottom: 6px; }
.pub__title a { color: var(--text); }
.pub__title a:hover { color: var(--accent); }
.pub__authors, .pub__venue { font-size: .88rem; color: var(--text-muted); margin: 0 0 4px; }
.pub__meta { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }

/* ---------- Blog ---------- */
.post-card { padding: 0; overflow: hidden; display: flex; flex-direction: column; }
.post-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.post-card__media { display: block; aspect-ratio: 2 / 1; overflow: hidden; background: var(--surface-solid); border-bottom: 1px solid var(--border); }
.post-card__media img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s; }
.post-card:hover .post-card__media img { transform: scale(1.04); }
.post-card__body { padding: 20px 22px 22px; }
.post-card__body p { color: var(--text-muted); font-size: .93rem; }
.post-card__meta { font-size: .76rem; color: var(--text-muted) !important; margin-bottom: 8px; }
.post-card__title { font-size: 1.12rem; letter-spacing: -0.015em; }
.post-card__title a { color: var(--text); }
.post-card__title a:hover { color: var(--accent); text-decoration: none; }

/* ---------- CTA ---------- */
.cta {
  position: relative; overflow: hidden; display: flex; align-items: center; justify-content: space-between; gap: 32px; flex-wrap: wrap;
  padding: clamp(28px, 5vw, 64px); border-radius: 28px; border: 1px solid var(--border-strong);
  background:
    radial-gradient(700px 260px at 0% 0%, color-mix(in srgb, var(--accent) 22%, transparent), transparent),
    radial-gradient(600px 260px at 100% 100%, color-mix(in srgb, var(--violet) 26%, transparent), transparent),
    var(--surface-solid);
  box-shadow: var(--shadow-lg);
}
.cta::after {
  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: linear-gradient(90deg, transparent, #000); mask-image: linear-gradient(90deg, transparent, #000);
}
.cta > * { position: relative; z-index: 1; }
.cta h2 { font-size: clamp(1.6rem, 3.2vw, 2.6rem); letter-spacing: -0.03em; max-width: 20ch; }
.cta p { color: var(--text-muted); margin: 0; }
.cta .eyebrow { margin-bottom: .8rem; }
.cta__actions { display: flex; flex-wrap: wrap; gap: 12px; }

/* ---------- Page header ---------- */
.page-header { position: relative; padding: clamp(40px, 6vw, 88px) 0 clamp(28px, 4vw, 48px); border-bottom: 1px solid var(--border); }
.page-title { font-size: clamp(2.2rem, 4.6vw, 3.6rem); font-weight: 800; letter-spacing: -0.035em; line-height: 1.05; max-width: 22ch; }
.page-lead { color: var(--text-muted); font-size: 1.12rem; max-width: 68ch; }
.page-header--project .project-card__meta { justify-content: flex-start; margin-bottom: 16px; }

/* ---------- Filters ---------- */
.filters { display: flex; flex-wrap: wrap; gap: 16px; align-items: center; justify-content: space-between; margin-bottom: 20px; padding: 12px; border-radius: 18px; border: 1px solid var(--border); background: var(--surface); backdrop-filter: blur(12px); }
.filters--pubs { justify-content: flex-start; }
.filters__chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.filters .filters__chips { margin-bottom: 0; }
.chip input { position: absolute; opacity: 0; pointer-events: none; }
.chip span, .chip-link {
  display: inline-block; padding: 8px 15px; border-radius: 999px; border: 1px solid var(--border);
  font-size: .875rem; font-weight: 500; color: var(--text-muted); cursor: pointer; transition: all .15s; background: var(--surface-2);
}
.chip span:hover, .chip-link:hover { color: var(--text); border-color: var(--accent); text-decoration: none; }
.chip input:checked + span, .chip-link.is-active { background: linear-gradient(135deg, var(--accent), color-mix(in srgb, var(--accent) 60%, var(--violet))); border-color: transparent; color: var(--accent-ink); }
.chip input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.search { position: relative; display: flex; gap: 8px; align-items: center; min-width: min(320px, 100%); flex: 0 1 360px; }
.search__icon { position: absolute; left: 14px; color: var(--text-muted); pointer-events: none; }
.search input, .select select, .form input, .form select, .form textarea {
  width: 100%; font: inherit; font-size: .95rem; color: var(--text); background: var(--surface-2);
  border: 1px solid var(--border-strong); border-radius: 12px; padding: 10px 14px; min-height: 44px;
  transition: border-color .15s, box-shadow .15s, background .15s;
}
.select select option { background: var(--surface-solid); color: var(--text); }
.search input { padding-left: 42px; }
.search input:focus, .select select:focus, .form input:focus, .form select:focus, .form textarea:focus {
  outline: none; border-color: var(--accent); background: var(--surface); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 18%, transparent);
}
.results-count { margin-bottom: 16px; }
.empty-state { grid-column: 1 / -1; text-align: center; padding: 48px; }
.pagination { display: flex; align-items: center; justify-content: center; gap: 16px; margin-top: 40px; }
.pagination__info { color: var(--text-muted); font-size: .9rem; }

/* ---------- Case study ---------- */
.case-study { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: clamp(32px, 4vw, 64px); align-items: start; }
.sticky { position: sticky; top: calc(var(--header-h) + 24px); }
.case-study__aside .h6:first-child { margin-top: 0; }
.toc { list-style: none; display: grid; gap: 2px; font-size: .9rem; counter-reset: toc; }
.toc a { display: block; padding: 5px 10px; border-radius: 8px; color: var(--text-muted); border-left: 2px solid var(--border); }
.toc a:hover { color: var(--accent); background: var(--surface-2); border-left-color: var(--accent); text-decoration: none; }
.case-study__main { max-width: 900px; }
.case-study__main > section { margin-bottom: 44px; }
.case-study__figure { margin: 0 0 44px; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--border); background: var(--surface-solid); box-shadow: var(--shadow-lg); }
.case-study__figure img { width: 100%; }
.case-study__figure figcaption { padding: 10px 16px; border-top: 1px solid var(--border); }
.feature-status { padding: 24px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); backdrop-filter: blur(12px); }
.feature-list { list-style: none; display: grid; gap: 10px; }
.feature-list li { display: flex; gap: 12px; align-items: baseline; }
.state { flex: none; width: 108px; font-family: var(--mono); font-size: .7rem; text-transform: uppercase; letter-spacing: .05em; padding: 4px 8px; border-radius: 6px; text-align: center; }
.state--implemented { background: color-mix(in srgb, var(--success) 15%, transparent); color: var(--success); }
.state--simulated { background: color-mix(in srgb, var(--accent) 15%, transparent); color: var(--accent); }
.state--planned { background: var(--surface-2); color: var(--text-muted); border: 1px dashed var(--border-strong); }

/* ---------- Prose ---------- */
.prose { font-size: 1.04rem; line-height: 1.75; }
.prose h2 { font-size: 1.55rem; margin-top: 1.6em; letter-spacing: -0.02em; }
.prose > h2:first-child { margin-top: 0; }
.prose h3 { font-size: 1.2rem; margin-top: 1.4em; }
.prose ul, .prose ol { padding-left: 1.4em; margin-bottom: 1em; }
.prose li { margin-bottom: .35em; }
.prose li::marker { color: var(--accent); }
.prose code { font-family: var(--mono); font-size: .86em; padding: 2px 6px; border-radius: 6px; background: var(--surface-2); border: 1px solid var(--border); }
.prose pre { overflow-x: auto; padding: 18px 20px; border-radius: 14px; background: #070C17; border: 1px solid var(--border-strong); margin: 0 0 1.2em; }
.prose pre code { padding: 0; border: 0; background: none; color: #E2E8F0; font-size: .86rem; line-height: 1.7; }
.prose img { border-radius: 12px; border: 1px solid var(--border); }

/* ---------- Timeline ---------- */
.timeline { list-style: none; position: relative; padding-left: 30px; margin-bottom: 24px; }
.timeline::before { content: ""; position: absolute; left: 6px; top: 8px; bottom: 8px; width: 2px; background: linear-gradient(180deg, var(--accent), var(--violet), transparent); }
.timeline__item { position: relative; padding-bottom: 28px; }
.timeline__dot { position: absolute; left: -30px; top: 6px; width: 14px; height: 14px; border-radius: 50%; background: var(--bg); border: 3px solid var(--accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 15%, transparent); }
.timeline__content { padding: 18px 20px; border-radius: 16px; background: var(--surface); border: 1px solid var(--border); backdrop-filter: blur(12px); }
.timeline__period { font-size: .76rem; color: var(--accent); margin-bottom: 4px; }
.timeline__title { font-size: 1.08rem; margin-bottom: 2px; }
.timeline__org { color: var(--text-muted); font-weight: 500; margin-bottom: 8px; }
.timeline__summary { font-size: .95rem; }
.check-list { list-style: none; display: grid; gap: 8px; }
.check-list li { position: relative; padding-left: 26px; font-size: .93rem; }
.check-list li::before { content: ""; position: absolute; left: 2px; top: .45em; width: 11px; height: 6px; border-left: 2px solid var(--accent); border-bottom: 2px solid var(--accent); transform: rotate(-45deg); }
.track-label { color: var(--accent); margin: 1.5rem 0 1rem; font-family: var(--mono); font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; font-weight: 500; }

/* ---------- About / resume ---------- */
.about-grid { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: clamp(32px, 5vw, 72px); align-items: start; }
.about-grid .prose { max-width: 820px; }
.about-card { padding: 0; overflow: hidden; position: sticky; top: calc(var(--header-h) + 24px); }
.about-card img { width: 100%; aspect-ratio: 44 / 40; object-fit: cover; }
.about-card__body { padding: 20px; display: grid; gap: 12px; }
.about-card__body p { margin: 0; }
.edu { padding: 18px 0; border-bottom: 1px solid var(--border); }
.edu h3 { font-size: 1.05rem; margin-bottom: 2px; }
.edu p { margin: 0; }
.resume-bar { display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap; margin-bottom: 36px; }
.resume-bar p { margin: 0; }
.resume-grid { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: clamp(32px, 5vw, 64px); }
.resume-grid .h3:first-child { margin-top: 0; }

/* ---------- Skills ---------- */
.legend { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 14px 20px; margin-bottom: 28px; }
.legend__title { font-family: var(--mono); font-size: .74rem; text-transform: uppercase; letter-spacing: .08em; color: var(--text-muted); margin-right: 6px; }
.skill-group__head { display: flex; gap: 14px; align-items: center; margin-bottom: 16px; }
.skill-group__head h2 { margin: 0; }
.skill-group__head p { margin: 2px 0 0; }
.skill-rows { list-style: none; display: grid; }
.skill-row { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; align-items: center; padding: 11px 0; border-top: 1px solid var(--border); }
.skill-row__name { font-weight: 500; }
.skill-row__note { grid-column: 1 / -1; }

/* ---------- Research ---------- */
.thesis { display: flex; gap: 20px; align-items: flex-start; }
.thesis h2 { margin-bottom: 6px; }
.research-projects { list-style: none; display: grid; gap: 14px; margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--border); }
.research-projects__head { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; }
.research-projects p { margin: 4px 0; }

/* ---------- Contact form ---------- */
.contact-grid { display: grid; grid-template-columns: minmax(0, 1fr) 400px; gap: clamp(24px, 3vw, 40px); align-items: start; }
.contact-aside { display: grid; gap: 20px; }
.form { display: grid; gap: 18px; }
.form__row { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.field { display: grid; gap: 6px; }
.field label { font-weight: 600; font-size: .9rem; }
.field--error input, .field--error textarea, .field--error select { border-color: var(--danger); }
.field__error, .form__error { color: var(--danger); font-size: .85rem; margin: 0; }
.form textarea { resize: vertical; min-height: 170px; }
.form .btn { justify-self: start; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* ---------- Toasts ---------- */
.toast-stack { position: relative; z-index: 40; margin-top: 8px; display: grid; gap: 8px; }
.toast { padding: 14px 18px; border-radius: 14px; border: 1px solid var(--border-strong); background: var(--surface-solid); font-weight: 500; box-shadow: var(--shadow); }
.toast--success { border-color: color-mix(in srgb, var(--success) 50%, transparent); background: color-mix(in srgb, var(--success) 12%, var(--surface-solid)); }
.toast--error { border-color: color-mix(in srgb, var(--danger) 50%, transparent); background: color-mix(in srgb, var(--danger) 12%, var(--surface-solid)); }

/* ---------- Footer ---------- */
.site-footer { position: relative; margin-top: 24px; padding-top: 64px; background: linear-gradient(180deg, transparent, var(--bg-alt)); }
.site-footer::before { content: ""; position: absolute; top: 0; left: 50%; transform: translateX(-50%); width: min(1360px, 92%); height: 1px; background: linear-gradient(90deg, transparent, var(--accent), var(--violet), transparent); opacity: .6; }
.footer__grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 40px; padding-bottom: 44px; }
.footer__tag { margin: 14px 0 18px; font-size: .95rem; max-width: 44ch; }
.footer__heading { font-size: .74rem; text-transform: uppercase; letter-spacing: .1em; color: var(--text-muted); font-family: var(--mono); font-weight: 500; }
.footer__list { list-style: none; display: grid; gap: 10px; }
.footer__list a { color: var(--text); }
.footer__list a:hover { color: var(--accent); text-decoration: none; }
.footer__bottom { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px; padding-top: 22px; padding-bottom: 30px; border-top: 1px solid var(--border); font-size: .85rem; color: var(--text-muted); }
.footer__bottom p { margin: 0; }
.footer__bottom a { color: var(--text-muted); }
.footer__bottom a:hover { color: var(--accent); }

/* ---------- Error page ---------- */
.error-page { min-height: 62vh; display: grid; align-items: center; padding: 80px 0; }
.error-page__code { font-size: clamp(4.5rem, 14vw, 8rem); font-weight: 600; line-height: 1; margin-bottom: 12px; background: linear-gradient(90deg, var(--accent), var(--violet)); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* ---------- Reveal animation (restrained) ---------- */
.js .reveal { opacity: 0; transform: translateY(16px); transition: opacity .6s ease, transform .6s cubic-bezier(.2,.7,.2,1); }
.js .reveal.is-visible { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
  .js .reveal { opacity: 1; transform: none; }
}

/* ---------- Responsive ---------- */
@media (max-width: 1180px) {
  .nav__link { padding: 7px 9px; font-size: .88rem; }
  .grid--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .capabilities__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 1024px) {
  .icon-btn.nav__toggle { display: inline-grid; }
  .nav__menu {
    position: absolute; left: 0; right: 0; top: calc(100% + 8px);
    flex-direction: column; align-items: stretch; gap: 14px; padding: 14px;
    background: var(--surface-solid); border: 1px solid var(--border-strong); border-radius: 18px;
    box-shadow: var(--shadow-lg); transform: translateY(-8px); opacity: 0; visibility: hidden; transition: all .2s;
  }
  .nav__menu.is-open { transform: none; opacity: 1; visibility: visible; }
  .nav__links { flex-direction: column; padding: 0; }
  .nav__link { padding: 12px; font-size: 1rem; }
  .nav__actions { justify-content: space-between; }
  .hero__grid, .split, .two-col, .about-grid, .resume-grid, .contact-grid, .case-study { grid-template-columns: 1fr; }
  .hero__visual { justify-self: start; max-width: 480px; }
  .grid--3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid--bento > .project-card:first-child { flex-direction: column; }
  .grid--bento > .project-card:first-child .project-card__media { width: 100%; border-right: 0; border-bottom: 1px solid var(--border); }
  .phases { grid-template-columns: 1fr; }
  .sticky, .about-card { position: static; }
  .about-card { max-width: 440px; }
  .footer__grid { grid-template-columns: 1fr 1fr; }
  .footer__grid > :first-child { grid-column: 1 / -1; }
}

@media (max-width: 640px) {
  :root { --header-h: 68px; }
  .site-header { padding: 8px 0; }
  .nav { height: 56px; }
  .grid--2, .grid--3, .grid--4, .capabilities__grid { grid-template-columns: 1fr; }
  .grid--bento { grid-template-columns: 1fr; }
  .section-heading--split { flex-direction: column; align-items: flex-start; }
  .form__row { grid-template-columns: 1fr; }
  .hero__ctas .btn { flex: 1 1 auto; }
  .hero__stats { grid-template-columns: repeat(2, 1fr); row-gap: 18px; }
  .stat:nth-child(3) { padding-left: 0; border-left: 0; }
  .identity-panel { margin: -64px 12px 0 12px; }
  .identity-panel__rows div { grid-template-columns: 1fr; gap: 0; }
  .float-chip--a { left: 4px; }
  .float-chip--b { right: 4px; }
  .pub { grid-template-columns: 1fr; gap: 6px; }
  .filters { flex-direction: column; align-items: stretch; }
  .search { flex: 1 1 auto; }
  .brand__text { font-size: .95rem; }
  .thesis { flex-direction: column; }
  .state { width: 96px; }
}
