/* ==========================================================================
   Mohamed Abdelhamid - Portfolio
   Hand-written CSS. No framework, no build step.
   ========================================================================== */

/* ---------- Design tokens ---------- */
:root {
  --bg:            #070b16;
  --bg-2:          #0b1020;
  --surface:       rgba(255, 255, 255, 0.038);
  --surface-2:     rgba(255, 255, 255, 0.06);
  --border:        rgba(255, 255, 255, 0.10);
  --border-strong: rgba(255, 255, 255, 0.18);

  --text:          #e8edf7;
  --text-soft:     #a3adc2;
  --text-faint:    #6b7590;

  --accent:        #38e1ff;
  --accent-2:      #8b6bff;
  --accent-3:      #2bd9a4;
  --accent-ink:    #04121a;

  --grad: linear-gradient(115deg, var(--accent) 0%, var(--accent-2) 55%, #ff6bd6 100%);

  --radius:    18px;
  --radius-sm: 12px;
  --radius-lg: 26px;

  --shadow:    0 18px 50px -22px rgba(0, 0, 0, .75);
  --shadow-lg: 0 40px 90px -40px rgba(0, 0, 0, .9);

  --shell: 1200px;
  --ease:  cubic-bezier(.22, 1, .36, 1);

  --font-display: "Sora", system-ui, sans-serif;
  --font-body:    "Inter", system-ui, -apple-system, sans-serif;
  --font-mono:    "JetBrains Mono", ui-monospace, SFMono-Regular, monospace;

  --nav-h: 72px;
  color-scheme: dark;
}

[data-theme="light"] {
  --bg:            #f6f7fb;
  --bg-2:          #eceff8;
  --surface:       rgba(255, 255, 255, 0.78);
  --surface-2:     rgba(255, 255, 255, 0.95);
  --border:        rgba(14, 20, 40, 0.10);
  --border-strong: rgba(14, 20, 40, 0.18);

  --text:          #131a2b;
  --text-soft:     #4d5771;
  --text-faint:    #7b869e;

  --accent:        #0a8fb5;
  --accent-2:      #6b46e5;
  --accent-3:      #0f9d76;
  --accent-ink:    #ffffff;

  --shadow:    0 18px 46px -26px rgba(20, 28, 60, .30);
  --shadow-lg: 0 40px 80px -44px rgba(20, 28, 60, .38);
  color-scheme: light;
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--nav-h) + 18px);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.68;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  transition: background .5s var(--ease), color .5s var(--ease);
}

img, svg, canvas { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; margin: 0; padding: 0; }
button { font: inherit; color: inherit; border: 0; background: none; cursor: pointer; }
input, textarea { font: inherit; color: inherit; }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.025em;
  margin: 0;
}

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

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

.skip-link {
  position: fixed; top: -100px; left: 16px; z-index: 200;
  padding: 10px 18px; border-radius: 0 0 10px 10px;
  background: var(--accent); color: var(--accent-ink); font-weight: 600;
  transition: top .2s;
}
.skip-link:focus { top: 0; }

.shell {
  width: min(var(--shell), calc(100% - 48px));
  margin-inline: auto;
}

.mono { font-family: var(--font-mono); }

.grad {
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* ---------- Ambient background ---------- */
.progress {
  position: fixed; inset: 0 0 auto 0; height: 2px; z-index: 120;
  background: transparent; pointer-events: none;
}
.progress span {
  display: block; height: 100%; width: 0%;
  background: var(--grad);
  box-shadow: 0 0 14px rgba(56, 225, 255, .6);
}

.aurora {
  position: fixed; inset: 0; z-index: -1;
  overflow: hidden; pointer-events: none;
  background:
    radial-gradient(120% 90% at 50% -10%, var(--bg-2) 0%, var(--bg) 60%);
}

.blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(110px);
  opacity: .40;
  will-change: transform;
}
.b1 { width: 620px; height: 620px; top: -220px; left: -160px;
      background: radial-gradient(circle, #1d7fff 0%, transparent 68%);
      animation: drift1 26s ease-in-out infinite; }
.b2 { width: 560px; height: 560px; top: 22%; right: -200px;
      background: radial-gradient(circle, #8b6bff 0%, transparent 68%);
      animation: drift2 32s ease-in-out infinite; }
.b3 { width: 520px; height: 520px; bottom: -180px; left: 28%;
      background: radial-gradient(circle, #2bd9a4 0%, transparent 68%);
      animation: drift3 29s ease-in-out infinite; }

[data-theme="light"] .blob { opacity: .22; filter: blur(130px); }

@keyframes drift1 { 50% { transform: translate3d(140px, 90px, 0) scale(1.12); } }
@keyframes drift2 { 50% { transform: translate3d(-130px, 70px, 0) scale(1.08); } }
@keyframes drift3 { 50% { transform: translate3d(90px, -110px, 0) scale(1.14); } }

#neural { position: absolute; inset: 0; width: 100%; height: 100%; opacity: .5; }
[data-theme="light"] #neural { opacity: .35; }

.noise {
  position: absolute; inset: 0; opacity: .22; 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='.85' numOctaves='3'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.5'/%3E%3C/svg%3E");
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  padding: 13px 24px;
  border-radius: 999px;
  font-family: var(--font-display);
  font-size: .94rem; font-weight: 600;
  letter-spacing: -0.01em;
  white-space: nowrap;
  cursor: pointer;
  transition: transform .3s var(--ease), box-shadow .3s var(--ease),
              background .3s var(--ease), border-color .3s var(--ease);
}
.btn svg { width: 17px; height: 17px; flex: none; }
.btn:hover { transform: translateY(-2px); }

.btn-primary {
  background: var(--grad);
  color: #05101c;
  box-shadow: 0 12px 34px -14px rgba(56, 225, 255, .65);
}
.btn-primary:hover { box-shadow: 0 20px 44px -14px rgba(139, 107, 255, .7); }

.btn-ghost {
  background: var(--surface);
  border: 1px solid var(--border-strong);
  color: var(--text);
  backdrop-filter: blur(12px);
}
.btn-ghost:hover { background: var(--surface-2); border-color: var(--accent); color: var(--accent); }

.btn-block { width: 100%; }

.icon-btn {
  display: grid; place-items: center;
  width: 42px; height: 42px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-soft);
  backdrop-filter: blur(12px);
  transition: color .25s, border-color .25s, background .25s, transform .25s;
}
.icon-btn:hover { color: var(--accent); border-color: var(--accent); transform: translateY(-2px); }
.icon-btn svg { width: 19px; height: 19px; }

.i-moon { display: none; }
[data-theme="light"] .i-sun  { display: none; }
[data-theme="light"] .i-moon { display: block; }

/* ---------- Nav ---------- */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  height: var(--nav-h);
  display: flex; align-items: center;
  transition: background .35s var(--ease), border-color .35s, backdrop-filter .35s;
  border-bottom: 1px solid transparent;
}
.nav.stuck {
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  backdrop-filter: blur(18px) saturate(1.4);
  border-bottom-color: var(--border);
}

.nav-inner { display: flex; align-items: center; gap: 24px; width: min(var(--shell), calc(100% - 48px)); margin-inline: auto; }

.brand { display: flex; align-items: center; gap: 11px; margin-right: auto; }
.brand-mark {
  display: grid; place-items: center;
  width: 38px; height: 38px; border-radius: 11px;
  background: var(--grad); color: #05101c;
  font-family: var(--font-display); font-weight: 800; font-size: .88rem;
  letter-spacing: -.03em;
  box-shadow: 0 8px 22px -10px rgba(56, 225, 255, .8);
}
.brand-text {
  font-family: var(--font-display); font-weight: 500; font-size: .95rem;
  color: var(--text-soft); letter-spacing: -.02em;
}
.brand-text strong { color: var(--text); font-weight: 700; margin-left: 5px; }

.nav-links { display: flex; align-items: center; gap: 4px; }
.nav-links a {
  position: relative;
  padding: 9px 15px; border-radius: 999px;
  font-size: .9rem; font-weight: 500; color: var(--text-soft);
  transition: color .25s, background .25s;
}
.nav-links a:hover { color: var(--text); background: var(--surface); }
.nav-links a.active { color: var(--accent); }
.nav-links a.active::after {
  content: ""; position: absolute; left: 50%; bottom: 2px;
  width: 16px; height: 2px; border-radius: 2px;
  transform: translateX(-50%);
  background: var(--grad);
}

.nav-actions { display: flex; align-items: center; gap: 10px; }
.nav-cv { padding: 10px 18px; font-size: .88rem; }
.menu-btn { display: none; flex-direction: column; gap: 4px; }
.menu-btn span {
  display: block; width: 18px; height: 2px; border-radius: 2px;
  background: currentColor; transition: transform .3s var(--ease), opacity .2s;
}
.menu-btn[aria-expanded="true"] span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.menu-btn[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.menu-btn[aria-expanded="true"] span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

/* ---------- Hero ---------- */
.hero { padding: calc(var(--nav-h) + 72px) 0 90px; }

.hero-inner {
  display: grid;
  grid-template-columns: 1.15fr .85fr;
  gap: 64px;
  align-items: center;
}

.eyebrow {
  display: inline-flex; align-items: center; gap: 10px;
  margin: 0 0 26px;
  padding: 7px 16px 7px 12px;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  backdrop-filter: blur(12px);
  font-size: .8rem; font-weight: 500; color: var(--text-soft);
  letter-spacing: .01em;
}
.pulse {
  position: relative; width: 8px; height: 8px; border-radius: 50%;
  background: var(--accent-3); flex: none;
}
.pulse::after {
  content: ""; position: absolute; inset: -4px; border-radius: 50%;
  border: 2px solid var(--accent-3); opacity: 0;
  animation: ping 2.4s var(--ease) infinite;
}
@keyframes ping { 0% { transform: scale(.6); opacity: .9; } 100% { transform: scale(1.7); opacity: 0; } }

.hero-title {
  font-size: clamp(3rem, 7.4vw, 5.6rem);
  font-weight: 800;
  letter-spacing: -0.045em;
  margin-bottom: 18px;
}

.hero-role {
  display: flex; align-items: center; gap: 10px;
  margin: 0 0 22px;
  font-family: var(--font-mono); font-size: clamp(.95rem, 2vw, 1.12rem);
  color: var(--accent-3);
}
.hero-role .mono { color: var(--text-faint); }
.typed { font-weight: 500; }
.caret { animation: blink 1.05s steps(2) infinite; color: var(--accent); }
@keyframes blink { 50% { opacity: 0; } }

.hero-lede {
  max-width: 56ch;
  margin: 0 0 34px;
  font-size: 1.06rem;
  color: var(--text-soft);
}
.hero-lede strong { color: var(--text); font-weight: 600; }

.hero-cta { display: flex; flex-wrap: wrap; gap: 13px; margin-bottom: 34px; }

.hero-social { display: flex; gap: 11px; }
.hero-social a {
  display: grid; place-items: center;
  width: 42px; height: 42px; border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-soft);
  backdrop-filter: blur(12px);
  transition: color .25s, border-color .25s, transform .25s var(--ease);
}
.hero-social a:hover { color: var(--accent); border-color: var(--accent); transform: translateY(-3px); }
.hero-social svg { width: 18px; height: 18px; }

/* Portrait */
.hero-visual { display: grid; place-items: center; }

.portrait-wrap {
  position: relative;
  width: min(380px, 78vw);
  aspect-ratio: 1;
  transform-style: preserve-3d;
  transition: transform .4s var(--ease);
}

.portrait-ring {
  position: absolute; inset: -14px;
  border-radius: 50%;
  background: conic-gradient(from 0deg, var(--accent), var(--accent-2), #ff6bd6, var(--accent-3), var(--accent));
  filter: blur(2px);
  opacity: .65;
  animation: spin 14s linear infinite;
  mask: radial-gradient(farthest-side, transparent calc(100% - 4px), #000 calc(100% - 3px));
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 4px), #000 calc(100% - 3px));
}
@keyframes spin { to { transform: rotate(360deg); } }

.portrait {
  position: absolute; inset: 0;
  border-radius: 50%;
  overflow: hidden;
  border: 1px solid var(--border-strong);
  box-shadow: var(--shadow-lg);
  transform: translateZ(40px);
}
.portrait img { width: 100%; height: 100%; object-fit: cover; object-position: center; }
.portrait picture { display: contents; }

.chip {
  position: absolute;
  display: inline-flex; align-items: center; gap: 8px;
  padding: 9px 15px;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  background: color-mix(in srgb, var(--bg-2) 86%, transparent);
  backdrop-filter: blur(14px);
  font-family: var(--font-mono); font-size: .74rem;
  color: var(--text);
  white-space: nowrap;
  box-shadow: var(--shadow);
  transform: translateZ(72px);
  animation: float 6s ease-in-out infinite;
}
.chip .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent-3); flex: none; }
.chip-1 { top: 6%;  left: -14%;  animation-delay: 0s; }
.chip-2 { top: 46%; right: -20%; animation-delay: -2s; }
.chip-2 .dot { background: var(--accent); }
.chip-3 { bottom: 4%; left: -6%;  animation-delay: -4s; }
.chip-3 .dot { background: var(--accent-2); }

@keyframes float { 50% { transform: translateZ(72px) translateY(-11px); } }

/* Stats */
.stats {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 18px;
  margin-top: 84px;
  padding: 26px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: var(--surface);
  backdrop-filter: blur(16px);
  box-shadow: var(--shadow);
}
.stats li { text-align: center; position: relative; }
.stats li + li::before {
  content: ""; position: absolute; left: -9px; top: 12%; bottom: 12%;
  width: 1px; background: var(--border);
}
.stat-value {
  display: block;
  font-family: var(--font-display); font-weight: 800;
  font-size: clamp(1.8rem, 4vw, 2.5rem);
  letter-spacing: -.04em;
  background: var(--grad);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.stat-label { font-size: .82rem; color: var(--text-faint); }

/* ---------- Sections ---------- */
.section { padding: 100px 0; position: relative; }

.section-head { max-width: 62ch; margin-bottom: 52px; }
.kicker {
  margin: 0 0 14px;
  font-family: var(--font-mono); font-size: .78rem;
  letter-spacing: .14em; text-transform: uppercase;
  color: var(--accent);
}
.section-head h2 { font-size: clamp(2rem, 4.4vw, 3rem); letter-spacing: -.04em; }
.section-sub { margin: 18px 0 0; color: var(--text-soft); font-size: 1.02rem; }

.glass {
  border: 1px solid var(--border);
  background: var(--surface);
  backdrop-filter: blur(16px);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

/* ---------- About ---------- */
.about-grid { display: grid; grid-template-columns: 1.25fr .75fr; gap: 54px; align-items: start; }
.about-copy p { color: var(--text-soft); margin: 0 0 20px; }
.about-copy .lead { font-size: 1.12rem; color: var(--text); }
.about-copy strong { color: var(--text); font-weight: 600; }
.about-actions { display: flex; flex-wrap: wrap; gap: 13px; margin-top: 30px; }

.about-side { display: grid; gap: 20px; }
.facts, .edu { padding: 26px; }
.facts h3, .edu h3 { font-size: 1.02rem; margin-bottom: 18px; }
.facts dl { margin: 0; display: grid; gap: 14px; }
.facts dl > div { display: grid; gap: 2px; }
.facts dt { font-family: var(--font-mono); font-size: .72rem; letter-spacing: .1em; text-transform: uppercase; color: var(--text-faint); }
.facts dd { margin: 0; font-size: .92rem; color: var(--text); }

.edu-degree { font-family: var(--font-display); font-weight: 700; font-size: 1.02rem; margin: 0 0 4px; }
.edu-school { font-size: .9rem; color: var(--text-soft); margin: 0 0 4px; }
.edu-meta { font-family: var(--font-mono); font-size: .76rem; color: var(--text-faint); margin: 0 0 16px; }
.edu-meta b { color: var(--accent-3); font-weight: 500; }

/* ---------- Tag pills ---------- */
.tags { display: flex; flex-wrap: wrap; gap: 7px; }
.tag {
  padding: 5px 11px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  font-family: var(--font-mono); font-size: .71rem;
  color: var(--text-soft);
  transition: color .2s, border-color .2s;
}
.tag:hover { color: var(--accent); border-color: var(--accent); }

/* ---------- Timeline ---------- */
.timeline { position: relative; padding-left: 40px; display: grid; gap: 26px; }
.timeline::before {
  content: ""; position: absolute; left: 11px; top: 10px; bottom: 10px;
  width: 2px; border-radius: 2px;
  background: linear-gradient(180deg, var(--accent), var(--accent-2), transparent);
}

.tl-item { position: relative; }
.tl-item::before {
  content: ""; position: absolute; left: -35px; top: 26px;
  width: 12px; height: 12px; border-radius: 50%;
  background: var(--bg); border: 2px solid var(--accent-2);
}
.tl-item.is-current::before {
  background: var(--accent-3); border-color: var(--accent-3);
  box-shadow: 0 0 0 5px color-mix(in srgb, var(--accent-3) 22%, transparent);
}

.tl-card {
  padding: 26px 28px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
  backdrop-filter: blur(14px);
  transition: transform .35s var(--ease), border-color .35s, box-shadow .35s;
}
.tl-card:hover { transform: translateX(6px); border-color: var(--border-strong); box-shadow: var(--shadow); }

.tl-top { display: flex; flex-wrap: wrap; align-items: baseline; gap: 10px; margin-bottom: 4px; }
.tl-role { font-size: 1.16rem; }
.tl-now {
  padding: 3px 10px; border-radius: 999px;
  background: color-mix(in srgb, var(--accent-3) 16%, transparent);
  border: 1px solid color-mix(in srgb, var(--accent-3) 40%, transparent);
  color: var(--accent-3);
  font-family: var(--font-mono); font-size: .68rem; letter-spacing: .06em; text-transform: uppercase;
}
.tl-org { color: var(--accent); font-weight: 600; font-size: .95rem; }
.tl-meta { font-family: var(--font-mono); font-size: .76rem; color: var(--text-faint); margin: 2px 0 16px; }

.tl-points { display: grid; gap: 9px; margin-bottom: 18px; }
.tl-points li {
  position: relative; padding-left: 20px;
  color: var(--text-soft); font-size: .94rem;
}
.tl-points li::before {
  content: ""; position: absolute; left: 3px; top: .68em;
  width: 6px; height: 6px; border-radius: 2px;
  background: var(--grad);
}

/* ---------- Filters ---------- */
.filters { display: flex; flex-wrap: wrap; gap: 9px; margin-bottom: 40px; }
.filter {
  padding: 9px 18px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  backdrop-filter: blur(12px);
  font-size: .87rem; font-weight: 500; color: var(--text-soft);
  transition: all .28s var(--ease);
}
.filter:hover { color: var(--text); border-color: var(--border-strong); transform: translateY(-2px); }
.filter[aria-selected="true"] {
  background: var(--grad); color: #05101c; border-color: transparent; font-weight: 600;
  box-shadow: 0 10px 26px -12px rgba(56, 225, 255, .7);
}
.filter .count { opacity: .6; font-family: var(--font-mono); font-size: .76rem; margin-left: 5px; }

/* ---------- Featured project cards ---------- */
.featured { display: grid; gap: 22px; margin-bottom: 70px; }

.fcard {
  display: grid;
  grid-template-columns: 330px 1fr;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: var(--surface);
  backdrop-filter: blur(16px);
  overflow: hidden;
  transition: transform .4s var(--ease), border-color .4s, box-shadow .4s;
}
.fcard:hover { transform: translateY(-5px); border-color: var(--border-strong); box-shadow: var(--shadow-lg); }
.fcard:nth-child(even) { grid-template-columns: 1fr 330px; }
.fcard:nth-child(even) .fcover { order: 2; }

/* Generated cover art - no image files needed */
.fcover {
  position: relative;
  min-height: 260px;
  overflow: hidden;
  background:
    radial-gradient(130% 110% at 20% 10%, hsl(var(--h) 90% 56% / .55) 0%, transparent 60%),
    radial-gradient(130% 110% at 85% 90%, hsl(calc(var(--h) + 58) 85% 60% / .48) 0%, transparent 62%),
    linear-gradient(160deg, #0a1020, #060a14);
}
.fcover::before {
  content: "";
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,.07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.07) 1px, transparent 1px);
  background-size: 28px 28px;
  mask-image: radial-gradient(75% 75% at 50% 50%, #000, transparent);
  -webkit-mask-image: radial-gradient(75% 75% at 50% 50%, #000, transparent);
}
.fcover-glyph {
  position: absolute; inset: 0;
  display: grid; place-items: center;
  color: rgba(255, 255, 255, .92);
  transition: transform .6s var(--ease);
}
.fcover-glyph svg { width: 78px; height: 78px; filter: drop-shadow(0 8px 20px rgba(0,0,0,.5)); }
.fcard:hover .fcover-glyph { transform: scale(1.09) rotate(-3deg); }

.fcover-cat {
  position: absolute; left: 18px; bottom: 16px;
  padding: 5px 12px; border-radius: 999px;
  background: rgba(6, 10, 20, .62);
  border: 1px solid rgba(255, 255, 255, .2);
  backdrop-filter: blur(10px);
  font-family: var(--font-mono); font-size: .68rem;
  letter-spacing: .07em; text-transform: uppercase;
  color: #fff;
}
.fcover-year {
  position: absolute; right: 18px; top: 16px;
  font-family: var(--font-mono); font-size: .74rem;
  color: rgba(255, 255, 255, .6);
}

.fbody { padding: 30px 32px; display: flex; flex-direction: column; }
.fbadge {
  display: inline-block; align-self: flex-start;
  margin-bottom: 11px;
  padding: 4px 11px; border-radius: 7px;
  background: color-mix(in srgb, var(--accent) 14%, transparent);
  border: 1px solid color-mix(in srgb, var(--accent) 34%, transparent);
  color: var(--accent);
  font-family: var(--font-mono); font-size: .7rem; letter-spacing: .05em;
}
.fbody h3 { font-size: 1.36rem; margin-bottom: 11px; letter-spacing: -.03em; }
.fblurb { color: var(--text-soft); font-size: .96rem; margin: 0 0 18px; }

.fhighlights { display: grid; gap: 7px; margin-bottom: 20px; }
.fhighlights li {
  position: relative; padding-left: 21px;
  font-size: .89rem; color: var(--text-soft);
}
.fhighlights li::before {
  content: ""; position: absolute; left: 2px; top: .52em;
  width: 11px; height: 11px; border-radius: 50%;
  border: 2px solid var(--accent-3);
}

.fmetrics { display: flex; flex-wrap: wrap; gap: 26px; margin-bottom: 20px; }
.fmetric { display: grid; }
.fmetric b {
  font-family: var(--font-display); font-weight: 800; font-size: 1.36rem;
  letter-spacing: -.03em;
  background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.fmetric span { font-size: .74rem; color: var(--text-faint); }

.fstack { margin-bottom: 22px; }
.flinks { display: flex; flex-wrap: wrap; gap: 10px; margin-top: auto; }
.flink {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 9px 17px; border-radius: 999px;
  border: 1px solid var(--border-strong);
  background: var(--surface-2);
  font-size: .85rem; font-weight: 500;
  transition: all .28s var(--ease);
}
.flink svg { width: 15px; height: 15px; }
.flink:hover { transform: translateY(-2px); border-color: var(--accent); color: var(--accent); }
.flink.live {
  background: color-mix(in srgb, var(--accent-3) 15%, transparent);
  border-color: color-mix(in srgb, var(--accent-3) 44%, transparent);
  color: var(--accent-3);
}
.flink.live:hover { border-color: var(--accent-3); color: var(--accent-3); }

/* ---------- More grid ---------- */
.more-head { display: flex; align-items: center; gap: 20px; margin-bottom: 28px; }
.more-head h3 { font-size: 1.24rem; white-space: nowrap; }
.rule { flex: 1; height: 1px; background: linear-gradient(90deg, var(--border-strong), transparent); }

.grid-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(288px, 1fr));
  gap: 18px;
}

.mcard {
  position: relative;
  display: flex; flex-direction: column;
  padding: 24px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
  backdrop-filter: blur(14px);
  overflow: hidden;
  transition: transform .35s var(--ease), border-color .35s, box-shadow .35s;
}
.mcard::after {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(420px circle at var(--mx, 50%) var(--my, 0%),
              hsl(var(--h) 90% 60% / .13), transparent 42%);
  opacity: 0; transition: opacity .35s; pointer-events: none;
}
.mcard:hover { transform: translateY(-5px); border-color: var(--border-strong); box-shadow: var(--shadow); }
.mcard:hover::after { opacity: 1; }

.mcard-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.mcard-icon {
  display: grid; place-items: center;
  width: 42px; height: 42px; border-radius: 12px;
  background: linear-gradient(140deg, hsl(var(--h) 88% 56% / .22), hsl(calc(var(--h) + 50) 85% 60% / .14));
  border: 1px solid hsl(var(--h) 80% 60% / .3);
  color: hsl(var(--h) 85% 68%);
}
.mcard-icon svg { width: 20px; height: 20px; }
.mcard-year { font-family: var(--font-mono); font-size: .74rem; color: var(--text-faint); }

.mcard h4 { font-size: 1.04rem; margin-bottom: 9px; letter-spacing: -.02em; }
.mcard p { font-size: .88rem; color: var(--text-soft); margin: 0 0 16px; flex: 1; }
.mcard .tags { margin-bottom: 16px; }

.mcard-link {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: .85rem; font-weight: 600; color: var(--accent);
  transition: gap .25s var(--ease);
}
.mcard-link svg { width: 15px; height: 15px; }
.mcard:hover .mcard-link { gap: 11px; }

.grid-empty { text-align: center; color: var(--text-faint); padding: 40px 0; }
.projects-foot { display: flex; justify-content: center; margin-top: 46px; }

.is-hidden { display: none !important; }

/* ---------- Skills ---------- */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 18px;
}
.skill-card {
  padding: 26px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
  backdrop-filter: blur(14px);
  transition: transform .35s var(--ease), border-color .35s, box-shadow .35s;
}
.skill-card:hover { transform: translateY(-4px); border-color: var(--border-strong); box-shadow: var(--shadow); }
.skill-head { display: flex; align-items: center; gap: 13px; margin-bottom: 18px; }
.skill-head h3 { font-size: 1.04rem; }
.skill-ico {
  display: grid; place-items: center;
  width: 40px; height: 40px; border-radius: 11px;
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--accent) 28%, transparent);
  color: var(--accent);
}
.skill-ico svg { width: 19px; height: 19px; }

/* Logo marquee */
.marquee {
  margin-top: 40px;
  overflow: hidden;
  border-block: 1px solid var(--border);
  padding: 18px 0;
  mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
}
.marquee-track {
  display: flex; gap: 42px; width: max-content;
  animation: scroll-x 42s linear infinite;
}
.marquee:hover .marquee-track { animation-play-state: paused; }
.marquee-track span {
  font-family: var(--font-display); font-weight: 600; font-size: 1.05rem;
  color: var(--text-faint); white-space: nowrap;
  transition: color .25s;
}
.marquee-track span:hover { color: var(--accent); }
@keyframes scroll-x { to { transform: translateX(-50%); } }

/* ---------- Research ---------- */
.research-grid { display: grid; grid-template-columns: 1.3fr .7fr; gap: 26px; align-items: start; }

.pub-card {
  position: relative;
  padding: 30px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: var(--surface);
  backdrop-filter: blur(16px);
  overflow: hidden;
  transition: transform .35s var(--ease), border-color .35s;
}
.pub-card:hover { transform: translateY(-4px); border-color: var(--accent); }
.pub-card::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px;
  background: var(--grad);
}
.pub-tag {
  display: inline-flex; align-items: center; gap: 7px;
  margin-bottom: 14px;
  padding: 5px 12px; border-radius: 999px;
  background: color-mix(in srgb, var(--accent-2) 15%, transparent);
  border: 1px solid color-mix(in srgb, var(--accent-2) 36%, transparent);
  color: var(--accent-2);
  font-family: var(--font-mono); font-size: .7rem; letter-spacing: .07em; text-transform: uppercase;
}
.pub-card h3 { font-size: 1.22rem; margin-bottom: 10px; letter-spacing: -.025em; }
.pub-venue { color: var(--text-soft); font-size: .93rem; margin: 0 0 8px; }
.pub-note { color: var(--accent-3); font-size: .88rem; margin: 0 0 20px; }

.mini-head { font-size: 1.04rem; margin-bottom: 18px; }
.certs ul { display: grid; gap: 9px; }
.certs li {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  backdrop-filter: blur(12px);
  transition: border-color .25s, transform .25s var(--ease);
}
.certs li:hover { border-color: var(--accent); transform: translateX(4px); }
.certs svg { width: 17px; height: 17px; color: var(--accent-3); flex: none; margin-top: 3px; }
.cert-name { font-size: .9rem; font-weight: 600; display: block; }
.cert-issuer { font-size: .78rem; color: var(--text-faint); }

/* ---------- Contact ---------- */
.contact { padding-bottom: 110px; }
.contact-card {
  display: grid; grid-template-columns: 1.05fr .95fr;
  gap: 52px;
  padding: 52px;
  border-radius: var(--radius-lg);
}
.contact-copy h2 { font-size: clamp(1.9rem, 4vw, 2.7rem); margin-bottom: 18px; }
.contact-copy > p { color: var(--text-soft); margin: 0 0 28px; max-width: 46ch; }

.contact-list { display: grid; gap: 13px; margin-bottom: 28px; }
.contact-list li { display: flex; align-items: center; gap: 13px; font-size: .95rem; color: var(--text-soft); }
.contact-list svg { width: 18px; height: 18px; color: var(--accent); flex: none; }
.contact-list a { transition: color .2s; }
.contact-list a:hover { color: var(--accent); }
.contact-social { margin-top: 4px; }

.contact-form h3 { font-size: 1.1rem; margin-bottom: 20px; }
.field { margin-bottom: 16px; }
.field label {
  display: block; margin-bottom: 7px;
  font-family: var(--font-mono); font-size: .72rem;
  letter-spacing: .09em; text-transform: uppercase; color: var(--text-faint);
}
.field input, .field textarea {
  width: 100%;
  padding: 13px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: color-mix(in srgb, var(--bg) 48%, transparent);
  font-size: .94rem;
  resize: vertical;
  transition: border-color .25s, background .25s, box-shadow .25s;
}
.field input::placeholder, .field textarea::placeholder { color: var(--text-faint); }
.field input:focus, .field textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent);
}
.field.invalid input, .field.invalid textarea { border-color: #ff6b8b; }

/* Two fields side by side, stacking on narrow screens */
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 520px) { .field-row { grid-template-columns: 1fr; gap: 0; } }

/* Honeypot - off-screen rather than display:none so bots still fill it */
.hp {
  position: absolute !important;
  left: -9999px; width: 1px; height: 1px;
  opacity: 0; pointer-events: none;
}

.form-note { margin: 14px 0 0; font-size: .84rem; color: var(--text-soft); min-height: 1.2em; }
.form-note.ok  { color: var(--accent-3); }
.form-note.err { color: #ff8da3; }

/* Sending state */
.spinner { display: none; width: 16px; height: 16px; flex: none; }
.contact-form.sending .btn-icon  { display: none; }
.contact-form.sending .spinner {
  display: block;
  border: 2px solid rgba(5, 16, 28, .28);
  border-top-color: #05101c;
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
#cf-submit:disabled { opacity: .7; cursor: not-allowed; transform: none; }

/* ---------- Footer ---------- */
.footer { border-top: 1px solid var(--border); padding: 28px 0; }
.footer-inner { display: flex; align-items: center; justify-content: space-between; gap: 18px; flex-wrap: wrap; }
.footer p { margin: 0; font-size: .85rem; color: var(--text-faint); }
.to-top {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: .85rem; color: var(--text-soft);
  transition: color .25s, gap .25s var(--ease);
}
.to-top svg { width: 15px; height: 15px; }
.to-top:hover { color: var(--accent); gap: 12px; }

/* ---------- Scroll reveal ---------- */
.reveal {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity .8s var(--ease), transform .8s var(--ease);
  transition-delay: var(--d, 0ms);
}
.reveal.in { opacity: 1; transform: none; }

/* ---------- Responsive ---------- */
@media (max-width: 1040px) {
  .hero-inner { grid-template-columns: 1fr; gap: 52px; }
  .hero-visual { order: -1; }
  .portrait-wrap { width: min(300px, 62vw); }
  .chip-1 { left: -6%; } .chip-2 { right: -8%; } .chip-3 { left: 0; }
  .about-grid, .research-grid { grid-template-columns: 1fr; gap: 34px; }
  .fcard, .fcard:nth-child(even) { grid-template-columns: 1fr; }
  .fcard:nth-child(even) .fcover { order: 0; }
  .fcover { min-height: 190px; }
  .contact-card { grid-template-columns: 1fr; gap: 38px; padding: 38px; }
}

@media (max-width: 860px) {
  .shell, .nav-inner { width: calc(100% - 36px); }
  .menu-btn { display: flex; }
  .nav-cv { display: none; }

  .nav-links {
    position: fixed; inset: var(--nav-h) 0 auto 0;
    flex-direction: column; align-items: stretch;
    gap: 2px; padding: 18px;
    background: color-mix(in srgb, var(--bg) 96%, transparent);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
    transform: translateY(-14px);
    opacity: 0; visibility: hidden;
    transition: opacity .3s var(--ease), transform .3s var(--ease), visibility .3s;
  }
  .nav-links.open { opacity: 1; visibility: visible; transform: none; }
  .nav-links a { padding: 13px 16px; border-radius: 12px; font-size: .98rem; }

  .section { padding: 74px 0; }
  .stats { grid-template-columns: repeat(2, 1fr); gap: 24px 12px; margin-top: 60px; }
  .stats li:nth-child(odd)::before { display: none; }
  .fbody { padding: 26px 22px; }
  .timeline { padding-left: 30px; }
  .tl-item::before { left: -25px; }
  .tl-card { padding: 22px 20px; }
  .contact-card { padding: 30px 22px; }
  .footer-inner { justify-content: center; text-align: center; }
}

@media (max-width: 460px) {
  .stats { grid-template-columns: 1fr; }
  .stats li::before { display: none; }
  .hero-cta .btn { width: 100%; }
  .brand-text { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; }
  #neural { display: none; }
}

@media print {
  .nav, .aurora, .progress, .contact-form, .footer, .filters, .hero-cta { display: none !important; }
  body { background: #fff; color: #000; }
}
