:root {
  --bg: #05060f;
  --bg-2: #0a0c1d;
  --surface: rgba(255, 255, 255, 0.035);
  --surface-hover: rgba(255, 255, 255, 0.06);
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(140, 160, 255, 0.28);
  --text: #e8eaf6;
  --muted: #9aa0c3;
  --dim: #6b7099;
  --cyan: #22d3ee;
  --violet: #8b5cf6;
  --pink: #ec4899;
  --green: #34d399;
  --grad: linear-gradient(120deg, #22d3ee 0%, #8b5cf6 50%, #ec4899 100%);
  --radius: 18px;
  --maxw: 1180px;
  --font-display: "Space Grotesk", system-ui, sans-serif;
  --font-body: "Inter", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, monospace;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; scroll-padding-top: 80px; overflow-x: clip; }
body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
.mono { font-family: var(--font-mono); }
::selection { background: rgba(139, 92, 246, 0.45); }

/* ---------- Background ---------- */
#neural-bg { position: fixed; inset: 0; z-index: -2; width: 100%; height: 100%; }
body::before {
  content: ""; position: fixed; inset: 0; z-index: -3;
  background:
    radial-gradient(ellipse 80% 60% at 50% -10%, rgba(76, 29, 149, 0.35), transparent 60%),
    radial-gradient(ellipse 60% 50% at 100% 100%, rgba(8, 145, 178, 0.18), transparent 60%),
    var(--bg);
}
body::after {
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background-image:
    linear-gradient(rgba(255,255,255,0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.025) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(ellipse at center, black 20%, transparent 75%);
}
.glow { position: fixed; border-radius: 50%; filter: blur(110px); z-index: -2; pointer-events: none; opacity: .45; }
.glow-1 { width: 480px; height: 480px; background: var(--violet); top: -160px; left: -140px; animation: float 18s ease-in-out infinite; }
.glow-2 { width: 420px; height: 420px; background: var(--cyan); bottom: -180px; right: -120px; opacity: .25; animation: float 22s ease-in-out infinite reverse; }
@keyframes float { 50% { transform: translate(60px, 40px) scale(1.1); } }
.cursor-glow {
  position: fixed; width: 420px; height: 420px; border-radius: 50%; pointer-events: none; z-index: -1;
  background: radial-gradient(circle, rgba(139, 92, 246, 0.13), transparent 65%);
  transform: translate(-50%, -50%); left: -500px; top: -500px; transition: opacity .3s;
}

/* ---------- Utilities ---------- */
.gradient-text {
  background: var(--grad); background-size: 200% auto;
  -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: shine 6s linear infinite;
}
@keyframes shine { to { background-position: 200% center; } }
.glass {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  position: relative;
}
.btn {
  display: inline-flex; align-items: center; gap: .5rem;
  padding: .8rem 1.4rem; border-radius: 999px; font-weight: 600; font-size: .95rem;
  transition: transform .25s, box-shadow .25s, background .25s, border-color .25s;
}
.btn:hover { transform: translateY(-2px); }
.btn-primary { background: var(--grad); background-size: 150% auto; color: #fff; box-shadow: 0 8px 30px -8px rgba(139, 92, 246, .7); }
.btn-primary:hover { box-shadow: 0 12px 40px -6px rgba(139, 92, 246, .9); background-position: right center; }
.btn-ghost { border: 1px solid var(--border-strong); background: rgba(255,255,255,.03); }
.btn-ghost:hover { border-color: var(--cyan); background: rgba(34, 211, 238, .08); }
.btn-sm { padding: .45rem 1rem; font-size: .88rem; }
.btn-lg { padding: 1rem 1.8rem; font-size: 1.05rem; }
.pills { display: flex; flex-wrap: wrap; gap: .45rem; }
.pills span {
  font-family: var(--font-mono); font-size: .74rem; color: #c5c9ee;
  padding: .28rem .65rem; border-radius: 999px;
  background: rgba(139, 92, 246, .1); border: 1px solid rgba(139, 92, 246, .22);
}
.tag { display: inline-block; white-space: nowrap; font-family: var(--font-mono); font-size: .7rem; padding: .1rem .5rem; border-radius: 6px; background: rgba(34,211,238,.12); color: var(--cyan); margin-left: .35rem; }

/* ---------- Nav ---------- */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  padding: 1.1rem max(1.25rem, calc((100vw - var(--maxw)) / 2));
  transition: background .3s, padding .3s, border-color .3s, transform .5s cubic-bezier(.2,.8,.2,1);
  border-bottom: 1px solid transparent;
}
.nav.scrolled { background: rgba(5, 6, 15, .72); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); padding-top: .7rem; padding-bottom: .7rem; border-color: var(--border); }
.logo { display: flex; align-items: center; gap: 3px; font-family: var(--font-display); font-weight: 700; font-size: 1.35rem; letter-spacing: -.02em; }
.logo-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--cyan); box-shadow: 0 0 12px var(--cyan); align-self: flex-end; margin-bottom: 7px; }
.nav-links { display: flex; align-items: center; gap: 2rem; }
.nav-links a:not(.btn) { font-size: .92rem; color: var(--muted); position: relative; transition: color .2s; }
.nav-links a:not(.btn)::after { content: ""; position: absolute; left: 0; bottom: -4px; width: 0; height: 2px; background: var(--grad); transition: width .25s; }
.nav-links a:not(.btn):hover, .nav-links a.active { color: var(--text); }
.nav-links a:not(.btn):hover::after, .nav-links a.active::after { width: 100%; }
.nav-toggle { display: none; width: 40px; height: 40px; position: relative; }
.nav-toggle span { position: absolute; left: 9px; right: 9px; height: 2px; background: var(--text); transition: transform .3s; }
.nav-toggle span:first-child { top: 15px; }
.nav-toggle span:last-child { top: 23px; }
.nav-toggle[aria-expanded="true"] span:first-child { transform: translateY(4px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:last-child { transform: translateY(-4px) rotate(-45deg); }

/* ---------- Hero ---------- */
.hero {
  min-height: 100vh; max-width: var(--maxw); margin: 0 auto;
  padding: 7rem 1.25rem 4rem;
  display: grid; grid-template-columns: 1.15fr .85fr; align-items: center; gap: 3rem;
  position: relative;
}
.status-pill {
  display: inline-flex; align-items: center; gap: .6rem;
  font-size: .82rem; color: var(--muted);
  padding: .4rem .9rem; border-radius: 999px; border: 1px solid var(--border); background: var(--surface);
  margin-bottom: 1.5rem;
}
.pulse { width: 8px; height: 8px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 0 rgba(52, 211, 153, .7); animation: pulse 2s infinite; }
@keyframes pulse { 70% { box-shadow: 0 0 0 10px rgba(52, 211, 153, 0); } 100% { box-shadow: 0 0 0 0 rgba(52, 211, 153, 0); } }
.hero h1 {
  font-family: var(--font-display); font-weight: 700;
  font-size: clamp(2.6rem, 6vw, 4.6rem); line-height: 1.04; letter-spacing: -.035em;
}
.hero-role { margin: 1.2rem 0 1.2rem; font-size: clamp(1rem, 2vw, 1.25rem); color: var(--cyan); min-height: 1.9em; }
.prompt { color: var(--violet); margin-right: .4rem; }
.caret { color: var(--cyan); animation: blink 1s steps(1) infinite; margin-left: 2px; }
@keyframes blink { 50% { opacity: 0; } }
.hero-sub { color: var(--muted); font-size: 1.08rem; max-width: 560px; }
.hero-cta { display: flex; flex-wrap: wrap; gap: .9rem; margin: 2rem 0 1.8rem; }
.socials { display: flex; gap: .8rem; }
.socials a {
  width: 44px; height: 44px; display: grid; place-items: center; border-radius: 12px;
  border: 1px solid var(--border); background: var(--surface); color: var(--muted);
  transition: color .2s, border-color .2s, transform .2s, box-shadow .2s;
}
.socials a:hover { color: #fff; border-color: var(--violet); transform: translateY(-3px); box-shadow: 0 8px 24px -8px rgba(139,92,246,.8); }
.socials svg { width: 20px; height: 20px; }

.hero-visual { display: grid; place-items: center; }
.avatar-wrap { position: relative; width: min(380px, 80vw); aspect-ratio: 1; display: grid; place-items: center; }
.avatar-ring {
  width: 72%; aspect-ratio: 1; border-radius: 50%; padding: 4px; position: relative; z-index: 2;
  background: conic-gradient(from 0deg, var(--cyan), var(--violet), var(--pink), var(--cyan));
  animation: spin 8s linear infinite;
  box-shadow: 0 0 60px -10px rgba(139, 92, 246, .7), 0 0 120px -30px rgba(34, 211, 238, .6);
}
.avatar { width: 100%; height: 100%; object-fit: cover; object-position: center; border-radius: 50%; border: 5px solid var(--bg); animation: spin 8s linear infinite reverse; }
@keyframes spin { to { transform: rotate(360deg); } }
.orbit { position: absolute; border-radius: 50%; border: 1px dashed rgba(140, 160, 255, .2); }
.orbit-1 { inset: 4%; animation: spin 24s linear infinite; }
.orbit-2 { inset: -6%; animation: spin 36s linear infinite reverse; border-style: solid; border-color: rgba(34, 211, 238, .1); }
.orbit span { position: absolute; top: -5px; left: 50%; width: 10px; height: 10px; border-radius: 50%; background: var(--cyan); box-shadow: 0 0 14px var(--cyan); }
.orbit-2 span { background: var(--pink); box-shadow: 0 0 14px var(--pink); top: auto; bottom: 12%; left: 4%; }
.chip {
  position: absolute; z-index: 3; font-size: .75rem; padding: .45rem .8rem; border-radius: 10px;
  background: rgba(10, 12, 29, .8); border: 1px solid var(--border-strong); backdrop-filter: blur(10px);
  box-shadow: 0 10px 30px -10px rgba(0,0,0,.6); white-space: nowrap; animation: bob 5s ease-in-out infinite;
}
.chip-1 { top: 10%; left: -4%; color: var(--cyan); }
.chip-2 { bottom: 16%; right: -6%; color: #c4b5fd; animation-delay: -1.6s; }
.chip-3 { bottom: 0; left: 8%; color: #f9a8d4; animation-delay: -3.2s; }
@keyframes bob { 50% { transform: translateY(-10px); } }
.scroll-hint { position: absolute; bottom: 2rem; left: 50%; transform: translateX(-50%); width: 24px; height: 38px; border: 2px solid var(--border-strong); border-radius: 14px; }
.scroll-hint span { position: absolute; top: 7px; left: 50%; width: 4px; height: 8px; margin-left: -2px; border-radius: 2px; background: var(--cyan); animation: scroll 1.8s infinite; }
@keyframes scroll { 0% { opacity: 1; transform: translateY(0); } 100% { opacity: 0; transform: translateY(14px); } }

/* ---------- Sections ---------- */
.section { max-width: var(--maxw); margin: 0 auto; padding: 6rem 1.25rem; }
.section-head { margin-bottom: 3rem; }
.eyebrow { display: inline-block; font-size: .8rem; color: var(--cyan); letter-spacing: .08em; margin-bottom: .8rem; }
.section-head h2, .contact-card h2 { font-family: var(--font-display); font-size: clamp(2rem, 4.2vw, 3.1rem); line-height: 1.1; letter-spacing: -.03em; font-weight: 700; }
.section-sub { color: var(--muted); margin-top: .8rem; max-width: 560px; }
h3 { font-family: var(--font-display); letter-spacing: -.01em; }

/* About */
.about-grid { display: grid; grid-template-columns: 1.3fr 1fr; gap: 1.5rem; }
.about-card { padding: 2rem; }
.about-card p { color: var(--muted); margin-bottom: 1rem; }
.about-card strong { color: var(--text); font-weight: 600; }
.terminal { margin-top: 1.5rem; border-radius: 12px; background: rgba(0,0,0,.45); border: 1px solid var(--border); overflow: hidden; font-size: .82rem; }
.terminal-bar { display: flex; align-items: center; gap: 6px; padding: .6rem .9rem; border-bottom: 1px solid var(--border); background: rgba(255,255,255,.02); }
.terminal-bar i { width: 10px; height: 10px; border-radius: 50%; background: #ff5f57; }
.terminal-bar i:nth-child(2) { background: #febc2e; }
.terminal-bar i:nth-child(3) { background: #28c840; }
.terminal-bar span { margin-left: auto; color: var(--dim); font-size: .72rem; }
.terminal pre { padding: 1rem 1.1rem; white-space: pre-wrap; word-break: break-word; line-height: 1.8; color: var(--text); }
.t-c { color: var(--green); }
.t-o { color: #a5b4fc; }
.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; }
.stat { padding: 1.6rem; display: flex; flex-direction: column; justify-content: space-between; gap: .8rem; transition: border-color .3s, transform .3s; overflow: hidden; }
.stat::before { content: ""; position: absolute; inset: 0; background: radial-gradient(circle at 0% 0%, rgba(34,211,238,.12), transparent 60%); opacity: 0; transition: opacity .3s; }
.stat:hover { border-color: var(--border-strong); translate: 0 -4px; }
.stat:hover::before { opacity: 1; }
.stat-num { font-family: var(--font-display); font-size: clamp(2.2rem, 4vw, 3rem); font-weight: 700; line-height: 1; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.stat-label { color: var(--muted); font-size: .88rem; line-height: 1.45; }

/* Timeline */
.timeline { position: relative; padding-left: 2.2rem; }
.timeline::before { content: ""; position: absolute; left: 7px; top: 8px; bottom: 8px; width: 2px; background: linear-gradient(var(--cyan), var(--violet), var(--pink), transparent); opacity: .5; }
.tl-item { position: relative; margin-bottom: 1.6rem; }
.tl-node { position: absolute; left: -2.2rem; top: 1.8rem; width: 16px; height: 16px; border-radius: 50%; background: var(--bg); border: 2px solid var(--cyan); box-shadow: 0 0 16px rgba(34, 211, 238, .6); }
.tl-node::after { content: ""; position: absolute; inset: 3px; border-radius: 50%; background: var(--cyan); }
.tl-card { padding: 1.8rem 2rem; transition: border-color .3s, background .3s; }
.tl-card:hover { border-color: var(--border-strong); background: var(--surface-hover); }
.tl-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; flex-wrap: wrap; margin-bottom: 1rem; }
.tl-card h3, .edu-card h3 { font-size: 1.3rem; }
.tl-org { color: var(--muted); font-size: .93rem; }
.tl-date { font-size: .78rem; color: var(--cyan); padding: .3rem .7rem; border-radius: 8px; background: rgba(34,211,238,.08); border: 1px solid rgba(34,211,238,.2); white-space: nowrap; }
.tl-card ul { margin-bottom: 1.2rem; }
.tl-card li { color: var(--muted); padding-left: 1.3rem; position: relative; margin-bottom: .5rem; font-size: .95rem; }
.tl-card li::before { content: "▹"; position: absolute; left: 0; color: var(--violet); }
.tl-card strong { color: var(--text); font-weight: 600; }

/* Projects */
.filters { display: flex; flex-wrap: wrap; gap: .6rem; margin-bottom: 2rem; }
.filter { padding: .5rem 1.1rem; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); color: var(--muted); font-size: .88rem; transition: all .25s; }
.filter:hover { color: var(--text); border-color: var(--border-strong); }
.filter.active { color: #fff; border-color: transparent; background: var(--grad); box-shadow: 0 6px 20px -8px rgba(139,92,246,.8); }
.projects-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem; }
.project { overflow: hidden; display: flex; flex-direction: column; transition: transform .35s, border-color .35s, box-shadow .35s, opacity .35s; }
.project::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit; padding: 1px; pointer-events: none;
  background: radial-gradient(400px circle at var(--mx, 50%) var(--my, 50%), rgba(139, 92, 246, .6), transparent 40%);
  -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 .3s;
}
.project:hover { translate: 0 -6px; box-shadow: 0 24px 50px -24px rgba(139, 92, 246, .55); }
.project:hover::after { opacity: 1; }
.project.hidden { display: none; }
.project.featured { grid-column: span 3; flex-direction: row; }
.project.featured .project-visual { flex: 0 0 44%; height: auto; min-height: 280px; border-bottom: 0; border-right: 1px solid var(--border); }
.project.featured .project-body { padding: 2.2rem; justify-content: center; }
.project.featured h3 { font-size: 1.8rem; }
.project-body { padding: 1.5rem; display: flex; flex-direction: column; gap: .7rem; flex: 1; }
.project-kicker { font-size: .72rem; color: var(--cyan); letter-spacing: .04em; }
.project h3 { font-size: 1.25rem; }
.project p { color: var(--muted); font-size: .92rem; flex: 1; }
.project p strong { color: var(--text); }
.project-links a { font-size: .9rem; color: var(--cyan); font-weight: 500; }
.project-links a:hover { text-decoration: underline; }

.project-visual {
  height: 170px; position: relative; overflow: hidden; border-bottom: 1px solid var(--border);
  background:
    radial-gradient(circle at 30% 20%, rgba(139,92,246,.25), transparent 55%),
    radial-gradient(circle at 80% 90%, rgba(34,211,238,.18), transparent 55%),
    var(--bg-2);
  display: grid; place-items: center;
}
.project-visual::before { content: ""; position: absolute; inset: 0; background-image: radial-gradient(rgba(255,255,255,.08) 1px, transparent 1px); background-size: 16px 16px; }

/* CV visual */
.visual-cv { background:
  repeating-linear-gradient(45deg, rgba(139,92,246,.07) 0 6px, transparent 6px 12px),
  repeating-linear-gradient(-45deg, rgba(34,211,238,.06) 0 6px, transparent 6px 12px), var(--bg-2); }
.bbox { position: absolute; border: 2px solid var(--cyan); border-radius: 4px; box-shadow: 0 0 20px rgba(34,211,238,.35), inset 0 0 20px rgba(34,211,238,.12); animation: boxpulse 3s ease-in-out infinite; }
.bbox span { position: absolute; top: -1.45rem; left: -2px; font-size: .68rem; padding: .1rem .4rem; background: var(--cyan); color: #04111a; border-radius: 3px 3px 3px 0; white-space: nowrap; font-weight: 500; }
.b1 { width: 22%; height: 26%; top: 20%; left: 12%; }
.b2 { width: 30%; height: 22%; top: 58%; left: 44%; border-color: var(--pink); box-shadow: 0 0 20px rgba(236,72,153,.35); animation-delay: -1s; }
.b2 span { background: var(--pink); color: #1a0410; }
.b3 { width: 18%; height: 30%; top: 16%; right: 12%; border-color: #a78bfa; box-shadow: 0 0 20px rgba(167,139,250,.35); animation-delay: -2s; }
.b3 span { background: #a78bfa; color: #0e0520; }
@keyframes boxpulse { 50% { opacity: .55; } }
.scanline { position: absolute; left: 0; right: 0; height: 2px; background: linear-gradient(90deg, transparent, var(--cyan), transparent); box-shadow: 0 0 18px var(--cyan); animation: scan 3.5s linear infinite; }
@keyframes scan { from { top: 0; } to { top: 100%; } }

/* Graph visual */
.visual-graph svg { width: 80%; height: 80%; position: relative; }
.visual-graph .edges line { stroke: rgba(139, 92, 246, .6); stroke-width: 1.4; stroke-dasharray: 4 4; animation: dash 3s linear infinite; }
.visual-graph .nodes circle { fill: var(--cyan); filter: drop-shadow(0 0 6px var(--cyan)); }
.visual-graph .nodes circle:nth-child(2) { fill: var(--pink); filter: drop-shadow(0 0 8px var(--pink)); }
@keyframes dash { to { stroke-dashoffset: -32; } }

/* RAG flow */
.visual-rag { display: flex; align-items: center; justify-content: center; gap: .35rem; font-size: .72rem; flex-wrap: wrap; padding: 1rem; }
.visual-rag span { position: relative; padding: .35rem .6rem; border-radius: 6px; border: 1px solid var(--border-strong); background: rgba(10,12,29,.8); color: #c7d2fe; }
.visual-rag span.hl { background: var(--grad); color: #fff; border-color: transparent; box-shadow: 0 0 20px rgba(139,92,246,.6); }
.visual-rag i { font-style: normal; color: var(--cyan); position: relative; animation: blink 1.4s infinite; }
.visual-rag i:nth-of-type(2) { animation-delay: .3s; }
.visual-rag i:nth-of-type(3) { animation-delay: .6s; }

/* Waveform */
.visual-wave { display: flex; align-items: center; justify-content: center; gap: 5px; }
.visual-wave span { position: relative; width: 6px; border-radius: 3px; background: var(--grad); animation: wave 1.2s ease-in-out infinite; height: 20px; }
.visual-wave span:nth-child(odd) { animation-duration: .9s; }
.visual-wave span:nth-child(3n) { animation-duration: 1.4s; }
.visual-wave span:nth-child(2) { animation-delay: -.2s; } .visual-wave span:nth-child(4) { animation-delay: -.5s; }
.visual-wave span:nth-child(5) { animation-delay: -.8s; } .visual-wave span:nth-child(7) { animation-delay: -.3s; }
.visual-wave span:nth-child(8) { animation-delay: -.6s; } .visual-wave span:nth-child(10) { animation-delay: -.9s; }
.visual-wave span:nth-child(11) { animation-delay: -.4s; } .visual-wave span:nth-child(13) { animation-delay: -.7s; }
@keyframes wave { 50% { height: 80px; } }

/* Document */
.visual-doc { grid-auto-flow: column; gap: 1.2rem; }
.doc { position: relative; width: 70px; height: 92px; border-radius: 6px; background: rgba(255,255,255,.06); border: 1px solid var(--border-strong); padding: 12px 10px; display: flex; flex-direction: column; gap: 7px; overflow: hidden; }
.doc::after { content: ""; position: absolute; left: 0; right: 0; height: 18px; background: linear-gradient(transparent, rgba(34,211,238,.45), transparent); animation: scan 2.4s linear infinite; }
.doc i { height: 4px; border-radius: 2px; background: rgba(199, 210, 254, .35); }
.doc i.short { width: 60%; }
.doc-arrow { position: relative; font-size: .8rem; color: var(--green); padding: .4rem .7rem; border-radius: 8px; border: 1px solid rgba(52,211,153,.35); background: rgba(52,211,153,.08); }

/* Pipeline */
.visual-pipe { display: flex; align-items: center; justify-content: center; padding: 0 1.2rem; gap: 0; }
.pipe-node { position: relative; z-index: 1; font-size: .75rem; padding: .5rem .7rem; border-radius: 8px; background: rgba(10,12,29,.9); border: 1px solid var(--border-strong); color: #c7d2fe; }
.pipe-line { position: relative; flex: 1; height: 2px; background: rgba(139,92,246,.35); overflow: hidden; max-width: 70px; }
.pipe-line b { position: absolute; top: 0; left: -30%; width: 30%; height: 100%; background: var(--cyan); box-shadow: 0 0 10px var(--cyan); animation: flow 1.6s linear infinite; }
.pipe-line:nth-of-type(4) b { animation-delay: .8s; }
@keyframes flow { to { left: 100%; } }

/* Face */
.face-box { position: relative; width: 84px; height: 100px; border: 2px solid var(--green); border-radius: 10px; box-shadow: 0 0 22px rgba(52,211,153,.35);
  background: radial-gradient(circle at 50% 38%, rgba(199,210,254,.28) 0 18px, transparent 19px), radial-gradient(ellipse 34px 22px at 50% 100%, rgba(199,210,254,.22) 0 100%, transparent 100%); }
.face-box span { position: absolute; bottom: -1.7rem; left: 50%; transform: translateX(-50%); white-space: nowrap; font-size: .7rem; color: var(--green); }
.face-box::before, .face-box::after { content: ""; position: absolute; left: 0; right: 0; height: 2px; background: var(--green); box-shadow: 0 0 10px var(--green); animation: scan 2s ease-in-out infinite alternate; }
.face-box::after { display: none; }

/* Inventory */
.visual-inv { gap: .5rem; align-content: center; font-size: .74rem; }
.inv-row { position: relative; display: flex; justify-content: space-between; gap: 2rem; padding: .4rem .8rem; border-radius: 6px; background: rgba(10,12,29,.85); border: 1px solid var(--border); color: #c7d2fe; min-width: 210px; }
.inv-row .ok { color: var(--green); }
.inv-row .warn { color: #fbbf24; }

.more { text-align: center; margin-top: 2.5rem; }

/* Skills */
.skills-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.5rem; }
.skill-card { padding: 1.7rem; transition: transform .3s, border-color .3s; }
.skill-card:hover { translate: 0 -5px; border-color: var(--border-strong); }
.skill-icon { width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center; font-size: 1.3rem; margin-bottom: 1rem; background: linear-gradient(135deg, rgba(34,211,238,.18), rgba(139,92,246,.25)); border: 1px solid var(--border-strong); color: #e0e7ff; }
.skill-card h3 { font-size: 1.15rem; margin-bottom: 1rem; }

/* Education */
.edu-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; }
.edu-card { padding: 1.8rem; display: flex; flex-direction: column; gap: .5rem; align-items: flex-start; }
.edu-card p:not(.tl-org) { color: var(--muted); font-size: .93rem; }
.edu-card em { color: var(--text); font-style: normal; font-weight: 600; }
.edu-card .tl-date { margin-bottom: .4rem; }
.certs { grid-column: span 2; }
.cert-list { display: grid; grid-template-columns: 1fr 1fr; gap: .7rem 2rem; margin-top: .6rem; width: 100%; }
.cert-list li { display: flex; align-items: center; gap: .7rem; color: var(--muted); font-size: .93rem; }
.cert-dot { flex: 0 0 8px; height: 8px; border-radius: 50%; background: var(--grad); box-shadow: 0 0 10px rgba(139,92,246,.8); }

/* Contact */
.contact-card { text-align: center; padding: 4rem 2rem; overflow: hidden; }
.contact-card::before { content: ""; position: absolute; inset: -40%; background: conic-gradient(from 0deg, transparent, rgba(139,92,246,.18), transparent 30%, rgba(34,211,238,.14), transparent 60%); animation: spin 14s linear infinite; z-index: -1; }
.contact-card p { color: var(--muted); max-width: 520px; margin: 1rem auto 2rem; }
.contact-links { display: flex; justify-content: center; flex-wrap: wrap; gap: 1.6rem; margin-top: 2rem; }
.contact-links a { color: var(--muted); font-size: .95rem; transition: color .2s; }
.contact-links a:hover { color: var(--cyan); }

.footer { max-width: var(--maxw); margin: 0 auto; padding: 2rem 1.25rem 3rem; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 1rem; color: var(--dim); font-size: .78rem; border-top: 1px solid var(--border); }


/* ---------- Responsive ---------- */
@media (max-width: 1000px) {
  .projects-grid { grid-template-columns: repeat(2, 1fr); }
  .project.featured { grid-column: span 2; }
  .skills-grid { grid-template-columns: repeat(2, 1fr); }
  .about-grid { grid-template-columns: 1fr; }
}
@media (max-width: 820px) {
  .nav-toggle { display: block; z-index: 2; }
  .nav-links {
    position: fixed; inset: 0; flex-direction: column; justify-content: center; gap: 2rem;
    background: rgba(5, 6, 15, .96); backdrop-filter: blur(20px);
    opacity: 0; pointer-events: none; transition: opacity .3s;
  }
  .nav-links a:not(.btn) { font-size: 1.3rem; }
  .nav-links.open { opacity: 1; pointer-events: auto; }
  .hero { grid-template-columns: 1fr; text-align: center; padding-top: 6.5rem; gap: 2rem; }
  .hero-visual { order: -1; }
  .avatar-wrap { width: min(300px, 72vw); }
  .hero-sub { margin: 0 auto; }
  .hero-cta, .socials { justify-content: center; }
  .scroll-hint { display: none; }
  .project.featured { flex-direction: column; }
  .project.featured .project-visual { flex: none; min-height: 200px; border-right: 0; border-bottom: 1px solid var(--border); }
  .project.featured .project-body { padding: 1.5rem; }
  .edu-grid, .cert-list { grid-template-columns: 1fr; }
  .certs { grid-column: auto; }
  .section { padding: 4.5rem 1rem; }
}
@media (max-width: 600px) {
  .projects-grid, .skills-grid { grid-template-columns: 1fr; }
  .project.featured { grid-column: auto; }
  .stats { gap: 1rem; }
  .stat { padding: 1.2rem; }
  .tl-card { padding: 1.4rem; }
  .timeline { padding-left: 1.6rem; }
  .tl-node { left: -1.6rem; }
  .chip { font-size: .66rem; }
  .chip-1 { left: 0; }
  .chip-2 { right: 0; }
  .footer { justify-content: center; text-align: center; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .reveal { opacity: 1; transform: none; }
}

/* ---------- AI Cortexo additions ---------- */
.tl-lead { color: var(--text); opacity: .85; font-size: .96rem; margin-bottom: 1rem; }
.tl-node-live { border-color: var(--green); box-shadow: 0 0 0 0 rgba(52, 211, 153, .7); animation: pulse 2s infinite; }
.tl-node-live::after { background: var(--green); }
.project.featured:nth-child(even) { flex-direction: row-reverse; }
.project.featured:nth-child(even) .project-visual { border-right: 0; border-left: 1px solid var(--border); }

.visual-agents svg { position: relative; width: 88%; height: 88%; }
.visual-agents .edges line { stroke: rgba(34, 211, 238, .45); stroke-width: 1.3; stroke-dasharray: 5 5; animation: dash 2.4s linear infinite; }
.visual-agents .core { fill: #8b5cf6; filter: drop-shadow(0 0 14px rgba(139, 92, 246, .9)); }
.visual-agents .core-ring { fill: none; stroke: rgba(236, 72, 153, .55); stroke-width: 1.5; transform-origin: 160px 110px; animation: ring 2.6s ease-out infinite; }
.visual-agents .core-label { fill: #fff; font-family: var(--font-mono); font-size: 11px; font-weight: 500; text-anchor: middle; }
.visual-agents .agent rect { fill: rgba(10, 12, 29, .92); stroke: rgba(140, 160, 255, .4); }
.visual-agents .agent text { fill: #c7d2fe; font-family: var(--font-mono); font-size: 10.5px; text-anchor: middle; }
.visual-agents .agent { animation: boxpulse 3.2s ease-in-out infinite; }
.visual-agents .agent:nth-of-type(2) { animation-delay: -.8s; }
.visual-agents .agent:nth-of-type(3) { animation-delay: -1.6s; }
.visual-agents .agent:nth-of-type(4) { animation-delay: -2.4s; }
@keyframes ring { from { transform: scale(.8); opacity: 1; } to { transform: scale(1.6); opacity: 0; } }

@media (max-width: 820px) {
  .project.featured:nth-child(even) { flex-direction: column; }
  .project.featured:nth-child(even) .project-visual { border-left: 0; border-bottom: 1px solid var(--border); }
}
.org-link, .inline-link { color: var(--cyan); transition: color .2s; }
.org-link:hover, .inline-link:hover { color: #fff; text-decoration: underline; text-underline-offset: 3px; }
.tl-cta { margin-top: 1.2rem; }
.tl-cta + .tl-cta { margin-left: .5rem; }

/* =========================================================
   Scroll animations (bidirectional)
   ========================================================= */
:root { --ease-out: cubic-bezier(.16, 1, .3, 1); }

/* Progress bar */
.scroll-progress {
  position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 60; pointer-events: none;
  background: var(--grad); transform-origin: 0 50%; transform: scaleX(0);
  box-shadow: 0 0 12px rgba(139, 92, 246, .8), 0 0 24px rgba(34, 211, 238, .5);
}

/* Nav hides on scroll down, returns on scroll up */
.nav.nav-hidden { transform: translateY(-110%); }

/* Reveal: hidden states depend on which side the element sits */
.reveal {
  --d: 0ms;
  transition:
    opacity .9s var(--ease-out),
    transform 1.1s var(--ease-out),
    filter .9s var(--ease-out),
    translate .4s var(--ease-out),
    box-shadow .35s,
    border-color .3s,
    background-color .3s;
  will-change: opacity, transform;
}
.reveal.visible { opacity: 1; transform: none; filter: none; transition-delay: var(--d), var(--d), var(--d), 0s, 0s, 0s, 0s; }
.reveal:not(.visible) { opacity: 0; filter: blur(10px); transform: translate3d(0, 70px, 0) scale(.96); }
.reveal.from-top:not(.visible) { transform: translate3d(0, -70px, 0) scale(.96); }

.reveal[data-anim="tilt"]:not(.visible) { transform: perspective(1200px) translate3d(0, 90px, -60px) rotateX(22deg) scale(.94); transform-origin: 50% 100%; }
.reveal[data-anim="tilt"].from-top:not(.visible) { transform: perspective(1200px) translate3d(0, -90px, -60px) rotateX(-22deg) scale(.94); transform-origin: 50% 0%; }

.reveal[data-anim="side"]:not(.visible) { transform: perspective(1400px) translate3d(120px, 30px, 0) rotateY(-14deg); }
.reveal[data-anim="side"].from-top:not(.visible) { transform: perspective(1400px) translate3d(120px, -30px, 0) rotateY(-14deg); }

.reveal[data-anim="flip"]:not(.visible) { transform: perspective(1000px) rotateY(55deg) translate3d(0, 40px, 0) scale(.9); }
.reveal[data-anim="flip"].from-top:not(.visible) { transform: perspective(1000px) rotateY(-55deg) translate3d(0, -40px, 0) scale(.9); }

.reveal[data-anim="pop"]:not(.visible) { transform: scale(.55) translate3d(0, 40px, 0); }
.reveal[data-anim="pop"].from-top:not(.visible) { transform: scale(.55) translate3d(0, -40px, 0); }
.reveal[data-anim="pop"].visible { transition-timing-function: cubic-bezier(.34, 1.56, .64, 1); }

.reveal[data-anim="zoom"]:not(.visible) { transform: scale(.7); filter: blur(16px); }

/* Heading words rise out of a mask */
.w { display: inline-block; overflow: hidden; vertical-align: top; padding-bottom: .14em; margin-bottom: -.14em; }
.w-inner { display: inline-block; transition: transform 1.1s var(--ease-out); transition-delay: var(--wd, 0ms); }
.reveal:not(.visible) .w-inner { transform: translate3d(0, 110%, 0) rotate(6deg); transition-delay: 0ms; }
.reveal.from-top:not(.visible) .w-inner { transform: translate3d(0, -110%, 0) rotate(-6deg); }

/* Giant outlined section numbers with parallax */
.section-head { position: relative; }
.section-head[data-num]::before {
  content: attr(data-num); position: absolute; right: 0; top: 50%; z-index: -1; pointer-events: none;
  font-family: var(--font-display); font-weight: 700; font-size: clamp(7rem, 18vw, 15rem); line-height: 1;
  color: transparent; -webkit-text-stroke: 1px rgba(140, 160, 255, .14);
  translate: calc(var(--px, 0) * 1px) -50%;
  opacity: 0; transition: opacity 1.2s var(--ease-out);
}
.section-head.visible[data-num]::before { opacity: 1; }

/* Timeline draws itself */
.timeline::before { opacity: .12; background: linear-gradient(var(--cyan), var(--violet), var(--pink)); }
.timeline::after {
  content: ""; position: absolute; left: 7px; top: 8px; bottom: 8px; width: 2px;
  background: linear-gradient(var(--cyan), var(--violet), var(--pink));
  transform-origin: top; transform: scaleY(var(--tl, 0));
  box-shadow: 0 0 12px rgba(139, 92, 246, .7);
}
.tl-comet {
  position: absolute; left: 2px; width: 12px; height: 12px; border-radius: 50%; z-index: 2; pointer-events: none;
  top: calc(8px + var(--tl, 0) * (100% - 16px)); translate: 0 -50%;
  background: #fff; box-shadow: 0 0 10px #fff, 0 0 22px var(--cyan), 0 0 44px var(--violet);
  opacity: var(--tl-on, 0); transition: opacity .3s;
}
.tl-node { transition: border-color .5s, box-shadow .5s, scale .6s cubic-bezier(.34, 1.56, .64, 1); border-color: rgba(140, 160, 255, .25); box-shadow: none; }
.tl-node::after { transition: background .5s, opacity .5s; opacity: .25; }
.tl-node.lit { border-color: var(--cyan); box-shadow: 0 0 18px rgba(34, 211, 238, .8); scale: 1.15; }
.tl-node.lit::after { opacity: 1; }
.tl-node-live.lit { border-color: var(--green); box-shadow: 0 0 18px rgba(52, 211, 153, .8); }

/* Side HUD */
.scroll-hud {
  position: fixed; right: 22px; top: 50%; z-index: 40; translate: 0 -50%;
  display: flex; flex-direction: column; align-items: flex-end; gap: 14px;
  opacity: 0; transition: opacity .5s;
}
.scroll-hud.on { opacity: 1; }
.hud-count { font-family: var(--font-mono); font-size: .72rem; color: var(--muted); margin-bottom: 4px; letter-spacing: .06em; }
.hud-count b { color: var(--cyan); font-weight: 500; }
.hud-dot { position: relative; display: flex; align-items: center; gap: 10px; }
.hud-dot i { display: block; width: 8px; height: 8px; border-radius: 50%; border: 1px solid rgba(140, 160, 255, .45); transition: all .4s var(--ease-out); }
.hud-dot span { font-family: var(--font-mono); font-size: .7rem; color: var(--muted); opacity: 0; translate: 8px 0; transition: all .3s; white-space: nowrap; }
.hud-dot:hover span, .hud-dot.active span { opacity: 1; translate: 0 0; }
.hud-dot.active span { color: var(--text); }
.hud-dot.active i { background: var(--cyan); border-color: var(--cyan); box-shadow: 0 0 12px var(--cyan); scale: 1.4; }

@media (max-width: 1100px) { .scroll-hud { display: none; } }
@media (max-width: 600px) {
  .section-head[data-num]::before { font-size: 6.5rem; top: 0; translate: calc(var(--px, 0) * 1px) -20%; }
}

@media (prefers-reduced-motion: reduce) {
  .reveal:not(.visible), .reveal.visible { opacity: 1 !important; transform: none !important; filter: none !important; }
  .w-inner { transform: none !important; }
  .timeline::after { transform: none; }
  .tl-comet, .scroll-progress { display: none; }
}

/* =========================================================
   Visual polish layer
   ========================================================= */
:root {
  --card-bg: linear-gradient(180deg, rgba(18, 20, 44, .9), rgba(9, 10, 24, .92));
  --card-bd: linear-gradient(160deg, rgba(255,255,255,.16), rgba(255,255,255,.035) 38%, rgba(139,92,246,.22));
  --card-bd-hot: linear-gradient(135deg, rgba(34,211,238,.85), rgba(139,92,246,.7) 50%, rgba(236,72,153,.75));
}

/* Film grain gives the flat darks some texture */
.grain {
  position: fixed; inset: -50%; z-index: 70; pointer-events: none; opacity: .055;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: grain 7s steps(8) infinite;
}
@keyframes grain {
  0%, 100% { transform: translate(0, 0); } 20% { transform: translate(-4%, 3%); } 40% { transform: translate(3%, -5%); }
  60% { transform: translate(-6%, -2%); } 80% { transform: translate(5%, 4%); }
}

/* Cards: gradient hairline border + depth */
.glass {
  background: var(--card-bg) padding-box, var(--card-bd) border-box;
  border: 1px solid transparent;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.05), 0 24px 60px -34px rgba(0, 0, 0, .9);
}
.tl-card:hover, .stat:hover, .skill-card:hover, .edu-card:hover, .project:hover {
  --card-bd: var(--card-bd-hot);
  --card-bg: linear-gradient(180deg, rgba(24, 26, 56, .92), rgba(11, 12, 30, .94));
  background: var(--card-bg) padding-box, var(--card-bd) border-box;
}
.project:hover { box-shadow: 0 30px 70px -30px rgba(139, 92, 246, .6), 0 0 0 1px rgba(139,92,246,.1); }

/* Logo + eyebrow */
.logo-mark { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.eyebrow::before { content: ""; display: inline-block; width: 28px; height: 1px; margin-right: .7rem; vertical-align: middle; background: var(--grad); box-shadow: 0 0 8px rgba(34,211,238,.8); }

/* Hero: aurora + bigger, glowing name */
.hero { isolation: isolate; }
.hero::before {
  content: ""; position: absolute; z-index: -1; pointer-events: none;
  width: 820px; height: 820px; right: -180px; top: 50%; margin-top: -410px; border-radius: 50%;
  background: conic-gradient(from 0deg, rgba(34,211,238,.35), rgba(139,92,246,.4), rgba(236,72,153,.32), rgba(34,211,238,.35));
  filter: blur(120px); opacity: .5; animation: spin 28s linear infinite;
}
.hero h1 { font-size: clamp(2.8rem, 6.6vw, 5.3rem); }
.hero h1 .gradient-text { filter: drop-shadow(0 0 28px rgba(139, 92, 246, .35)); }
.status-pill { background: rgba(52, 211, 153, .07); border-color: rgba(52, 211, 153, .28); color: #b7f5dc; }

.avatar-wrap::before {
  content: ""; position: absolute; inset: 16%; border-radius: 50%; z-index: 1;
  background: var(--grad); filter: blur(46px); opacity: .5; animation: breathe 6s ease-in-out infinite;
}
@keyframes breathe { 50% { opacity: .75; scale: 1.1; } }

.chip-4 { top: 4%; right: -4%; display: flex; flex-direction: column; gap: 2px; padding: .6rem .95rem; border-radius: 14px; animation-delay: -2.4s; }
.hb-num { font-family: var(--font-display); font-size: 1.45rem; font-weight: 700; line-height: 1; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hb-label { font-size: .66rem; color: var(--muted); letter-spacing: .04em; }

/* Primary button sheen */
.btn-primary { position: relative; overflow: hidden; isolation: isolate; }
.btn-primary::after {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: linear-gradient(110deg, transparent 30%, rgba(255,255,255,.5) 50%, transparent 70%);
  translate: -120% 0; animation: sheen 4s ease-in-out infinite;
}
@keyframes sheen { 55%, 100% { translate: 120% 0; } }
.btn.magnetic, .socials a.magnetic { transition: transform .25s, box-shadow .25s, background .25s, border-color .25s, color .2s, translate .35s var(--ease-out); }

/* Tech marquee between hero and about */
.marquee {
  position: relative; overflow: hidden; padding: 1.5rem 0;
  border-block: 1px solid var(--border); background: rgba(255,255,255,.015);
  -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 45s linear infinite; }
.marquee:hover .marquee-track { animation-play-state: paused; }
.marquee-track span {
  display: flex; align-items: center; white-space: nowrap;
  font-family: var(--font-display); font-size: clamp(1.1rem, 2vw, 1.5rem); font-weight: 600; letter-spacing: -.01em;
  color: rgba(232, 234, 246, .55);
}
.marquee-track span:nth-child(3n+2) { color: transparent; -webkit-text-stroke: 1px rgba(165, 180, 252, .55); }
.marquee-track span::after { content: "✦"; margin: 0 2.2rem; font-size: .75rem; color: var(--violet); -webkit-text-stroke: 0; text-shadow: 0 0 10px var(--violet); }
@keyframes marquee { to { transform: translateX(-50%); } }

/* Stats: icon on top, number + label grouped at the bottom */
.stat { justify-content: flex-start; gap: .55rem; }
.stat-num { margin-top: auto; padding-top: 1.2rem; }
.stat-icon {
  width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center; position: relative;
  background: rgba(34, 211, 238, .1); border: 1px solid rgba(34, 211, 238, .3); color: var(--cyan);
  box-shadow: 0 0 22px -6px rgba(34, 211, 238, .7);
}
.stat-icon svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.stat:nth-child(2) .stat-icon { background: rgba(139,92,246,.12); border-color: rgba(139,92,246,.35); color: #c4b5fd; box-shadow: 0 0 22px -6px rgba(139,92,246,.8); }
.stat:nth-child(3) .stat-icon { background: rgba(236,72,153,.1); border-color: rgba(236,72,153,.32); color: #f9a8d4; box-shadow: 0 0 22px -6px rgba(236,72,153,.7); }
.stat:nth-child(4) .stat-icon { background: rgba(52,211,153,.1); border-color: rgba(52,211,153,.32); color: var(--green); box-shadow: 0 0 22px -6px rgba(52,211,153,.7); }

/* Skills: each card gets its own accent */
.skill-card { --accent: 34, 211, 238; overflow: hidden; }
.skill-card:nth-child(2) { --accent: 139, 92, 246; }
.skill-card:nth-child(3) { --accent: 236, 72, 153; }
.skill-card:nth-child(4) { --accent: 52, 211, 153; }
.skill-card::after {
  content: ""; position: absolute; top: 0; left: 18%; right: 18%; height: 1px;
  background: linear-gradient(90deg, transparent, rgb(var(--accent)), transparent); box-shadow: 0 0 14px rgb(var(--accent));
}
.skill-card::before {
  content: ""; position: absolute; width: 180px; height: 180px; top: -90px; right: -60px; border-radius: 50%; pointer-events: none;
  background: radial-gradient(circle, rgba(var(--accent), .22), transparent 70%); transition: scale .5s var(--ease-out);
}
.skill-card:hover::before { scale: 1.6; }
.skill-icon { background: rgba(var(--accent), .13); border-color: rgba(var(--accent), .4); color: rgb(var(--accent)); box-shadow: 0 0 26px -6px rgba(var(--accent), .75); }

/* Pills react on hover */
.pills span { transition: background .2s, border-color .2s, color .2s, translate .2s; }
.pills span:hover { color: #fff; background: rgba(34, 211, 238, .12); border-color: rgba(34, 211, 238, .5); translate: 0 -2px; }
.skill-card .pills span:hover { background: rgba(var(--accent), .16); border-color: rgba(var(--accent), .6); }

/* Timeline dates glow a little */
.tl-date { box-shadow: 0 0 18px -8px rgba(34, 211, 238, .8); }

/* Contact: permanent gradient border + glowing CTA */
.contact-card { --card-bd: var(--card-bd-hot); background: var(--card-bg) padding-box, var(--card-bd) border-box; padding: 5rem 2rem; }
.contact-card h2 { font-size: clamp(2.2rem, 5vw, 3.8rem); }
.contact-card .btn-lg { font-size: 1.12rem; box-shadow: 0 10px 50px -8px rgba(139, 92, 246, .9), 0 0 0 6px rgba(139, 92, 246, .1); }

.footer { border-top: 0; position: relative; }
.footer::before { content: ""; position: absolute; top: 0; left: 1.25rem; right: 1.25rem; height: 1px; background: linear-gradient(90deg, transparent, rgba(139,92,246,.6), rgba(34,211,238,.6), transparent); }

/* 3D tilt (driven by JS) — only overrides the settled state */
.tilt.reveal.visible { transform: perspective(900px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)); }
.tilt.reveal.visible.tilting { transition: transform .15s ease-out, translate .4s var(--ease-out), box-shadow .35s, border-color .3s, background-color .3s; }

/* Cursor ring (fine pointers only, added by JS) */
.cursor-ring {
  position: fixed; left: 0; top: 0; z-index: 80; pointer-events: none;
  width: 34px; height: 34px; margin: -17px 0 0 -17px; border-radius: 50%;
  border: 1.5px solid rgba(34, 211, 238, .75); opacity: 0;
  transition: width .25s var(--ease-out), height .25s var(--ease-out), margin .25s var(--ease-out), background .25s, border-color .25s, opacity .3s;
}
.cursor-ring.on { opacity: 1; }
.cursor-ring.hover { width: 60px; height: 60px; margin: -30px 0 0 -30px; background: rgba(139, 92, 246, .12); border-color: rgba(236, 72, 153, .8); }

@media (max-width: 820px) {
  .hero::before { width: 520px; height: 520px; right: -140px; top: 20%; margin-top: 0; }
}
@media (max-width: 600px) {
  .chip-4 { right: 0; top: 0; }
  .marquee-track span::after { margin: 0 1.4rem; }
}
@media (prefers-reduced-motion: reduce) {
  .grain { display: none; }
  .marquee-track { animation: none; }
}

/* =========================================================
   Lab: personal projects from GitHub
   ========================================================= */
/* GitHub strip */
.gh-strip { display: grid; grid-template-columns: auto 1fr 1.2fr; align-items: center; gap: 2rem; padding: 1.4rem 1.8rem; margin-bottom: 2rem; overflow: hidden; }
.gh-strip::before { content: ""; position: absolute; inset: 0; pointer-events: none; background: radial-gradient(600px circle at 0% 50%, rgba(34,211,238,.1), transparent 50%); }
.gh-id { position: relative; display: flex; align-items: center; gap: .8rem; }
.gh-id svg { width: 42px; height: 42px; padding: 9px; border-radius: 12px; color: #fff; background: rgba(255,255,255,.06); border: 1px solid var(--border-strong); box-shadow: 0 0 24px -6px rgba(139,92,246,.8); transition: rotate .5s var(--ease-out); }
.gh-id:hover svg { rotate: -12deg; }
.gh-id b { display: block; font-family: var(--font-display); font-size: 1.05rem; }
.gh-id small { color: var(--cyan); font-size: .72rem; }
.gh-stats { position: relative; display: flex; gap: 2rem; justify-content: center; }
.gh-stats div { display: flex; flex-direction: column; }
.gh-num { font-family: var(--font-display); font-size: 1.9rem; font-weight: 700; line-height: 1.1; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.gh-label { font-size: .68rem; color: var(--muted); letter-spacing: .03em; }
.gh-langs { position: relative; }
.lang-bar { display: flex; height: 8px; border-radius: 99px; overflow: hidden; gap: 2px; background: rgba(255,255,255,.04); }
.lang-bar i { width: var(--w); background: var(--c); box-shadow: 0 0 12px var(--c); transform-origin: left; transition: transform 1.2s var(--ease-out); }
.gh-strip:not(.visible) .lang-bar i { transform: scaleX(0); }
.gh-strip.visible .lang-bar i:nth-child(2) { transition-delay: .15s; }
.gh-strip.visible .lang-bar i:nth-child(3) { transition-delay: .3s; }
.gh-strip.visible .lang-bar i:nth-child(4) { transition-delay: .45s; }
.lang-legend { display: flex; flex-wrap: wrap; gap: .35rem 1rem; margin-top: .7rem; font-size: .7rem; color: var(--muted); }
.lang-legend li { display: flex; align-items: center; gap: .4rem; }
.lang-legend i, .repo-lang i, .archive-list a > i { width: 9px; height: 9px; border-radius: 50%; background: var(--c); box-shadow: 0 0 8px var(--c); flex: none; }

/* Grid */
.lab-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem; grid-auto-flow: dense; }
.repo { overflow: hidden; display: flex; flex-direction: column; transition: transform .35s, border-color .35s, box-shadow .35s; }
.repo::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit; padding: 1px; pointer-events: none;
  background: radial-gradient(400px circle at var(--mx, 50%) var(--my, 50%), rgba(34, 211, 238, .7), transparent 40%);
  -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 .3s;
}
.repo:hover { translate: 0 -6px; box-shadow: 0 30px 70px -30px rgba(34, 211, 238, .45), 0 0 0 1px rgba(34,211,238,.08); --card-bd: var(--card-bd-hot); background: var(--card-bg) padding-box, var(--card-bd) border-box; }
.repo:hover::after { opacity: 1; }
.repo.hidden { display: none; }
.repo-xl { grid-column: span 2; grid-row: span 2; }
.repo-xl .repo-visual { height: auto; flex: 1; min-height: 300px; }
.repo-xl h3 { font-size: 1.6rem; }
.repo-xl .repo-body { padding: 1.8rem 2rem 2rem; flex: none; }

.repo-visual {
  height: 160px; position: relative; overflow: hidden; border-bottom: 1px solid var(--border);
  background: radial-gradient(circle at 25% 15%, rgba(34,211,238,.18), transparent 55%), radial-gradient(circle at 85% 95%, rgba(236,72,153,.16), transparent 55%), var(--bg-2);
  display: grid; place-items: center;
}
.repo-visual::before { content: ""; position: absolute; inset: 0; background-image: radial-gradient(rgba(255,255,255,.07) 1px, transparent 1px); background-size: 14px 14px; }
.repo-visual > * { position: relative; }
.repo-visual > .bbox, .repo-visual > .scanline { position: absolute; }
.repo-body { padding: 1.4rem 1.5rem 1.5rem; display: flex; flex-direction: column; gap: .65rem; flex: 1; }
.repo-top { display: flex; justify-content: space-between; align-items: center; gap: .8rem; font-size: .72rem; }
.repo-path { color: var(--cyan); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.repo-lang { display: flex; align-items: center; gap: .4rem; color: var(--muted); white-space: nowrap; }
.repo h3 { font-size: 1.2rem; line-height: 1.25; }
.repo p { color: var(--muted); font-size: .9rem; flex: 1; }
.repo p strong { color: var(--text); font-weight: 600; }
.repo-links { display: flex; flex-wrap: wrap; gap: .7rem; margin-top: .3rem; }
.repo-links > a:not(.btn) { font-size: .88rem; color: var(--cyan); font-weight: 500; }
.repo-links > a:not(.btn):hover { text-decoration: underline; text-underline-offset: 3px; }

/* X-ray visual */
.v-xray { background: radial-gradient(ellipse 70% 60% at 50% 50%, rgba(199,210,254,.12), transparent 70%), radial-gradient(circle at 80% 10%, rgba(34,211,238,.15), transparent 50%), #060713; }
.xray-stage { position: relative; display: grid; gap: 12px; padding: 34px 0 10px; }
.jaw { display: flex; gap: 6px; justify-content: center; }
.jaw i { width: 34px; height: 72px; border-radius: 10px 10px 16px 16px; background: linear-gradient(180deg, rgba(226,232,255,.6), rgba(199,210,254,.14)); box-shadow: inset 0 0 10px rgba(255,255,255,.25); }
.jaw-top i { border-radius: 16px 16px 10px 10px; background: linear-gradient(0deg, rgba(226,232,255,.6), rgba(199,210,254,.14)); }
.jaw i:nth-child(1), .jaw i:nth-child(12) { height: 52px; opacity: .55; }
.jaw-top i:nth-child(1), .jaw-top i:nth-child(12) { align-self: flex-end; }
.jaw i:nth-child(6), .jaw i:nth-child(7) { width: 28px; }
.jaw-top { transform: perspective(400px) rotateX(-14deg); }
.jaw-bot { transform: perspective(400px) rotateX(14deg); }
.x1 { width: 11%; top: 28px; height: 90px; left: 32.5%; border-color: var(--pink); box-shadow: 0 0 20px rgba(236,72,153,.4); }
.x1 span { background: var(--pink); color: #1a0410; }
.x2 { width: 10%; bottom: 0; height: 90px; left: -1%; animation-delay: -1s; }
.x3 { width: 11%; bottom: 4px; height: 84px; right: 16%; border-color: #fbbf24; box-shadow: 0 0 20px rgba(251,191,36,.35); animation-delay: -2s; }
.x3 span { background: #fbbf24; color: #1a1204; }
.live-badge { position: absolute !important; top: 14px; right: 14px; display: flex; align-items: center; gap: .45rem; font-size: .7rem; padding: .3rem .7rem; border-radius: 99px; color: #b7f5dc; background: rgba(5, 20, 14, .8); border: 1px solid rgba(52,211,153,.4); backdrop-filter: blur(8px); }

/* Terminal visual */
.v-term { display: flex; flex-direction: column; place-items: stretch; background: rgba(0,0,0,.55); font-size: .74rem; }
.v-term .terminal-bar { width: 100%; }
.term-lines { padding: .8rem 1rem; line-height: 1.75; }
.term-lines p { color: var(--text); white-space: nowrap; overflow: hidden; opacity: 0; animation: termline 9s infinite; }
.term-lines p b { color: var(--violet); }
.term-lines .tool { color: #a5b4fc; }
.term-lines .ask { color: #fbbf24; }
.term-lines .ask u { text-decoration: none; color: var(--text); }
.term-lines .ok { color: var(--green); }
.term-lines p:nth-child(2) { animation-delay: .8s; } .term-lines p:nth-child(3) { animation-delay: 1.6s; }
.term-lines p:nth-child(4) { animation-delay: 2.4s; } .term-lines p:nth-child(5) { animation-delay: 3.2s; } .term-lines p:nth-child(6) { animation-delay: 4.2s; }
@keyframes termline { 0% { opacity: 0; translate: -6px 0; } 4%, 88% { opacity: 1; translate: 0 0; } 96%, 100% { opacity: 0; } }
.repo-tall .repo-visual { height: 200px; }

/* Chat + citations */
.v-chat { align-content: center; gap: .6rem; padding: 0 1.4rem; justify-items: stretch; }
.bubble { font-size: .75rem; padding: .5rem .8rem; border-radius: 12px; max-width: 85%; }
.bubble.q { justify-self: end; background: var(--grad); color: #fff; border-bottom-right-radius: 3px; }
.bubble.a { justify-self: start; width: 75%; display: flex; flex-direction: column; gap: 6px; background: rgba(255,255,255,.06); border: 1px solid var(--border-strong); border-bottom-left-radius: 3px; }
.bubble.a i { height: 5px; border-radius: 3px; background: rgba(199,210,254,.35); }
.bubble.a i.short { width: 55%; }
.cites { font-size: .66rem; color: var(--muted); }
.cites b { color: var(--cyan); margin-right: .25rem; font-weight: 500; }

/* Phone */
.phone { width: 96px; height: 140px; border-radius: 16px; border: 2px solid rgba(199,210,254,.35); background: #04050c; padding: 6px; box-shadow: 0 10px 40px -10px rgba(139,92,246,.7); display: flex; flex-direction: column; gap: 4px; }
.phone-cam { flex: 1; position: relative; border-radius: 10px; overflow: hidden; background: linear-gradient(160deg, #1c2044, #0e1024 60%, #251634); }
.pbox { position: absolute; border: 1.5px solid var(--green); border-radius: 3px; animation: boxpulse 2.4s ease-in-out infinite; }
.pbox span { position: absolute; top: -12px; left: -1.5px; font-size: .5rem; padding: 0 .25rem; background: var(--green); color: #031a10; border-radius: 2px; }
.p1 { width: 44%; height: 62%; left: 12%; top: 26%; }
.p2 { width: 26%; height: 24%; right: 10%; bottom: 12%; border-color: var(--pink); animation-delay: -1.2s; }
.p2 span { background: var(--pink); color: #1a0410; }
.phone-hud { display: flex; justify-content: space-between; font-size: .5rem; color: var(--cyan); padding: 0 3px; }

/* ViT patch grid (cells added by JS) */
.v-patches { gap: .6rem; align-content: center; }
.patch-grid { display: grid; grid-template-columns: repeat(12, 13px); gap: 2px; }
.patch-grid i { height: 13px; border-radius: 2px; background: rgba(139,92,246, var(--a, .1)); animation: attn 3.2s ease-in-out infinite; animation-delay: var(--dl, 0s); }
@keyframes attn { 50% { background: rgba(34, 211, 238, calc(var(--a, .1) + .45)); box-shadow: 0 0 8px rgba(34,211,238, var(--a, .1)); } }
.patch-label { font-size: .66rem; color: var(--muted); }

/* Serverless flow */
.v-flow { display: flex; align-items: center; justify-content: center; padding: 0 .8rem; font-size: .7rem; }
.v-flow span { padding: .4rem .55rem; border-radius: 7px; border: 1px solid var(--border-strong); background: rgba(10,12,29,.9); color: #c7d2fe; z-index: 1; }
.v-flow span.hl { background: var(--grad); color: #fff; border-color: transparent; box-shadow: 0 0 18px rgba(139,92,246,.6); }
.v-flow em { position: relative; width: 22px; height: 2px; background: rgba(139,92,246,.35); overflow: hidden; }
.v-flow em b { position: absolute; top: 0; left: -40%; width: 40%; height: 100%; background: var(--cyan); box-shadow: 0 0 10px var(--cyan); animation: flow 1.4s linear infinite; }
.v-flow em:nth-of-type(2) b { animation-delay: .45s; } .v-flow em:nth-of-type(3) b { animation-delay: .9s; }

/* License plate */
.v-plate { align-content: center; gap: .9rem; background: radial-gradient(circle at 50% 40%, rgba(34,211,238,.14), transparent 60%), var(--bg-2); }
.plate { position: relative; display: flex; gap: .5rem; padding: .45rem 1rem; font-size: 1.3rem; font-weight: 500; letter-spacing: .08em; color: #0b0d1a; background: linear-gradient(#f1f5ff, #c7d2fe); border-radius: 7px; border: 3px solid #0b0d1a; outline: 2px solid var(--cyan); outline-offset: 5px; box-shadow: 0 0 30px rgba(34,211,238,.45); overflow: hidden; }
.plate::after { content: ""; position: absolute; top: 0; bottom: 0; width: 30%; background: linear-gradient(90deg, transparent, rgba(34,211,238,.55), transparent); animation: platescan 2.2s linear infinite; }
@keyframes platescan { from { left: -30%; } to { left: 100%; } }
.plate-read { font-size: .7rem; color: var(--green); }

/* Toasts */
.v-toast { align-content: center; gap: .5rem; }
.toast { display: flex; align-items: center; gap: .7rem; min-width: 230px; padding: .6rem .8rem; border-radius: 12px; background: rgba(18,20,44,.92); border: 1px solid var(--border-strong); box-shadow: 0 12px 30px -12px rgba(0,0,0,.8); animation: toastin 5s var(--ease-out) infinite; }
.toast b { display: block; font-size: .78rem; }
.toast small { font-size: .62rem; color: var(--muted); }
.toast-ico { font-size: 1.1rem; }
.toast.ghost { opacity: .45; scale: .94; animation: none; }
@keyframes toastin { 0% { translate: 0 -24px; opacity: 0; } 12%, 85% { translate: 0 0; opacity: 1; } 100% { opacity: 0; } }

/* Pose */
.v-pose svg { width: 130px; height: 120px; transform-origin: 50% 90%; animation: slouch 4s ease-in-out infinite; }
.v-pose .bones line { stroke: var(--cyan); stroke-width: 2.5; stroke-linecap: round; filter: drop-shadow(0 0 4px var(--cyan)); }
.v-pose .joints circle { fill: #fff; filter: drop-shadow(0 0 5px var(--violet)); }
.v-pose .joints circle:first-child { fill: none; stroke: #fff; stroke-width: 2; }
.v-pose .angle { fill: none; stroke: #fbbf24; stroke-width: 1.5; stroke-dasharray: 3 3; }
@keyframes slouch { 50% { rotate: 6deg; } }
.pose-alert { position: absolute !important; top: 14px; right: 14px; font-size: .68rem; padding: .25rem .6rem; border-radius: 6px; color: #fbbf24; background: rgba(251,191,36,.1); border: 1px solid rgba(251,191,36,.4); animation: blink 1.6s steps(1) infinite; }

/* SHAP bars */
.shap { width: 78%; display: grid; gap: .45rem; font-size: .66rem; }
.shap p { display: grid; grid-template-columns: 58px 1fr; align-items: center; gap: .6rem; color: var(--muted); }
.shap i { height: 9px; width: var(--v); border-radius: 0 4px 4px 0; background: linear-gradient(90deg, rgba(236,72,153,.5), var(--pink)); box-shadow: 0 0 10px rgba(236,72,153,.5); transform-origin: left; animation: grow 3.5s var(--ease-out) infinite; }
.shap i.neg { background: linear-gradient(90deg, rgba(34,211,238,.5), var(--cyan)); box-shadow: 0 0 10px rgba(34,211,238,.5); }
.shap p:nth-child(2) i { animation-delay: .15s; } .shap p:nth-child(3) i { animation-delay: .3s; } .shap p:nth-child(4) i { animation-delay: .45s; }
@keyframes grow { 0% { transform: scaleX(0); } 30%, 100% { transform: scaleX(1); } }

/* Floating languages */
.v-lang span { position: absolute; font-family: var(--font-display); font-weight: 600; font-size: 1.05rem; padding: .3rem .7rem; border-radius: 10px; background: rgba(18,20,44,.85); border: 1px solid var(--border-strong); animation: bob 4.5s ease-in-out infinite; }
.v-lang .w1 { top: 18%; left: 10%; color: var(--cyan); }
.v-lang .w2 { top: 12%; right: 10%; color: #f9a8d4; animation-delay: -1s; }
.v-lang .w3 { top: 34%; left: 36%; color: #fff; background: var(--grad); border-color: transparent; font-size: 1.2rem; animation-delay: -2s; }
.v-lang .w4 { bottom: 12%; left: 8%; color: #c4b5fd; animation-delay: -3s; }
.v-lang .w5 { bottom: 14%; right: 10%; color: var(--green); animation-delay: -.5s; }
.v-lang .w6 { bottom: 6%; left: 44%; color: #fbbf24; font-size: .9rem; animation-delay: -2.6s; }

/* Wave + timestamp */
.v-wave-ts { align-content: center; gap: .7rem; }
.v-wave-ts .visual-wave span { height: 14px; }
.ts { font-size: .72rem; color: var(--text); padding: .3rem .7rem; border-radius: 6px; background: rgba(10,12,29,.9); border: 1px solid var(--border); }
.ts span { color: var(--cyan); margin-right: .4rem; }

/* Archive */
.archive { margin-top: 1.5rem; overflow: hidden; }
.archive summary { list-style: none; cursor: pointer; display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: 1.1rem 1.5rem; font-size: .9rem; }
.archive summary::-webkit-details-marker { display: none; }
.archive summary b { color: var(--green); font-weight: 500; margin-right: .3rem; }
.archive-count { font-size: .75rem; color: var(--muted); white-space: nowrap; }
.archive-count i { display: inline-block; font-style: normal; color: var(--cyan); transition: rotate .3s; }
.archive[open] .archive-count i { rotate: 180deg; }
.archive:hover { --card-bd: var(--card-bd-hot); background: var(--card-bg) padding-box, var(--card-bd) border-box; }
.archive-list { display: grid; grid-template-columns: 1fr 1fr; border-top: 1px solid var(--border); }
.archive-list a { display: grid; grid-template-columns: 1fr auto; column-gap: 1rem; padding: .9rem 1.5rem; border-bottom: 1px solid var(--border); transition: background .2s; }
.archive-list li:nth-child(odd) a { border-right: 1px solid var(--border); }
.archive-list a:hover { background: rgba(34, 211, 238, .05); }
.archive-list a:hover span { color: var(--cyan); }
.archive-list span { font-size: .84rem; color: var(--text); transition: color .2s; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.archive-list em { grid-row: 2; font-style: normal; font-size: .8rem; color: var(--muted); }
.archive-list a > i { grid-row: 1 / span 2; grid-column: 2; align-self: center; }
.archive[open] .archive-list li { animation: rowin .5s var(--ease-out) both; }
.archive[open] .archive-list li:nth-child(n+3) { animation-delay: .05s; }
.archive[open] .archive-list li:nth-child(n+5) { animation-delay: .1s; }
.archive[open] .archive-list li:nth-child(n+7) { animation-delay: .15s; }
.archive[open] .archive-list li:nth-child(n+9) { animation-delay: .2s; }
@keyframes rowin { from { opacity: 0; translate: 0 10px; } }

@media (max-width: 1000px) {
  .lab-grid { grid-template-columns: repeat(2, 1fr); }
  .repo-xl { grid-row: auto; }
  .lab-grid > .repo:last-child { grid-column: span 2; }
  .gh-strip { grid-template-columns: 1fr 1fr; }
  .gh-langs { grid-column: span 2; }
}
@media (max-width: 600px) {
  .lab-grid { grid-template-columns: 1fr; }
  .repo-xl, .lab-grid > .repo:last-child { grid-column: auto; }
  .repo-xl .repo-visual { min-height: 220px; }
  .repo-xl .repo-body { padding: 1.4rem; }
  .repo-xl h3 { font-size: 1.3rem; }
  .jaw i { width: 18px; height: 42px; }
  .jaw i:nth-child(1), .jaw i:nth-child(12) { height: 32px; }
  .jaw { gap: 3px; }
  .x1 { height: 54px; } .x2, .x3 { height: 52px; }
  .gh-strip { grid-template-columns: 1fr; gap: 1.3rem; padding: 1.3rem; }
  .gh-langs { grid-column: auto; }
  .gh-stats { justify-content: space-between; gap: 1rem; }
  .archive-list { grid-template-columns: 1fr; }
  .archive-list li:nth-child(odd) a { border-right: 0; }
  .archive summary, .archive-list a { padding-inline: 1.1rem; }
}
@media (prefers-reduced-motion: reduce) {
  .gh-strip .lang-bar i { transform: none !important; }
  .term-lines p { opacity: 1; }
}
