/* ==========================================================================
   Baharul Islam — Portfolio
   Design system + motion layer
   ========================================================================== */

@import url("https://fonts.googleapis.com/css2?family=Sora:wght@400;500;600;700;800&family=Inter:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;500;700&display=swap");

/* Registered custom properties — animatable. Silently ignored where
   unsupported, which degrades to a correct static render. */
@property --pass {
  syntax: "<angle>";
  inherits: false;
  initial-value: 0deg;
}

@property --draw {
  syntax: "<number>";
  inherits: true;
  initial-value: 0;
}

/* ---------- 1. Tokens ---------------------------------------------------- */

:root {
  /* surface */
  --bg: #05060f;
  --bg-soft: #080a17;
  --bg-elev: #0c0f1f;
  --surface: rgba(255, 255, 255, 0.035);
  --surface-2: rgba(255, 255, 255, 0.06);
  --stroke: rgba(255, 255, 255, 0.09);
  --stroke-strong: rgba(255, 255, 255, 0.16);

  /* ink */
  --ink: #e9edf7;
  --ink-dim: #a6b0c6;
  --ink-faint: #8792a8;

  /* accents */
  --violet: #7c5cff;
  --cyan: #22d3ee;
  --pink: #ff5ca8;
  --lime: #a3e635;
  --amber: #fbbf24;

  --grad: linear-gradient(120deg, var(--violet), var(--cyan));
  --grad-warm: linear-gradient(120deg, var(--pink), var(--amber));
  --grad-text: linear-gradient(100deg, #a78bfa 0%, #22d3ee 55%, #7c5cff 100%);

  /* geometry */
  --r-sm: 0.8rem;
  --r-md: 1.4rem;
  --r-lg: 2rem;
  --r-xl: 2.8rem;

  --shadow-sm: 0 2px 10px rgba(0, 0, 0, 0.35);
  --shadow-md: 0 18px 40px -18px rgba(0, 0, 0, 0.75);
  --shadow-glow: 0 0 0 1px rgba(124, 92, 255, 0.25), 0 20px 60px -25px rgba(124, 92, 255, 0.6);

  --nav-h: 7.5rem;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-io: cubic-bezier(0.65, 0, 0.35, 1);

  /* brand colours for the icon sprite */
  --c-python: #4b8bbe;
  --c-java: #f89820;
  --c-github: #e6edf3;
  --c-numpy: #4dabcf;
  --c-pandas: #e70488;
  --c-mcp: #cfd6e4;
  --c-ollama: #dfe4ee;
  --c-circleci: #dfe4ee;
  --c-anthropic: #d97757;

  /* ---- AI layer: domain accents (rail + tags read these) ---------------- */
  --agentic:  #8b5cf6;   /* agent graphs / orchestration */
  --research: #22d3ee;   /* research, NLP, retrieval     */
  --systems:  #a3e635;   /* systems, tooling, infra      */
  --quant:    #fbbf24;   /* data & quant                 */
  --wip:      #ff5ca8;   /* in progress                  */

  /* per-card accent — overridden by [data-tags]; never hard-code downstream */
  --accent:     var(--violet);
  --accent-rgb: 124 92 255;      /* space-separated channels for rgb( / a ) */
  --accent-ink: #b7a6ff;         /* legible text tint of the accent         */

  /* ---- attention lattice ------------------------------------------------ */
  --lattice:      rgba(255, 255, 255, 0.045);
  --lattice-cell: 2.2rem;
  --lattice-hot:  rgba(255, 255, 255, 0.10);

  /* ---- signal ----------------------------------------------------------- */
  --signal:      #e4ebff;
  --rail-w:      2px;
  --ease-signal: cubic-bezier(0.4, 0, 0.2, 1);
  --spring:      cubic-bezier(0.34, 1.42, 0.5, 1);

  /* ---- projects section signature --------------------------------------- */
  --strip: 48rem;
  --cells: 16;
}

/* ---------- 2. Reset ----------------------------------------------------- */

*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: 62.5%;
  scroll-behavior: smooth;
  scroll-padding-top: var(--nav-h);
  -webkit-text-size-adjust: 100%;
  /* clip (not hidden) so decorative overflow never creates a sideways scroll
     while position: fixed / sticky keep working */
  overflow-x: clip;
}

body {
  background: var(--bg);
  color: var(--ink);
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 1.6rem;
  line-height: 1.7;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body.is-locked {
  overflow: hidden;
}

img,
svg,
canvas {
  display: block;
  max-width: 100%;
}

img {
  height: auto;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
textarea {
  font: inherit;
  color: inherit;
  border: none;
  background: none;
}

/* One visible keyboard affordance for everything focusable. Never remove this:
   `outline: none` on buttons made the whole site unusable by keyboard. */
:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 3px;
  border-radius: 0.4rem;
}

:focus:not(:focus-visible) {
  outline: none;
}

ul {
  list-style: none;
}

::selection {
  background: rgba(124, 92, 255, 0.4);
  color: #fff;
}

/* scrollbar */
html::-webkit-scrollbar {
  width: 0.85rem;
}
html::-webkit-scrollbar-track {
  background: #06070f;
}
html::-webkit-scrollbar-thumb {
  background: linear-gradient(var(--violet), var(--cyan));
  border-radius: 10rem;
}
html::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(var(--cyan), var(--violet));
}

/* ---------- 3. Typography ------------------------------------------------ */

h1,
h2,
h3,
h4 {
  font-family: "Sora", "Inter", sans-serif;
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.02em;
}

.mono {
  font-family: "JetBrains Mono", ui-monospace, monospace;
}

.grad-text {
  background: var(--grad-text);
  background-size: 200% auto;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: hue-slide 8s linear infinite;
}

/* ---------- 4. Layout utilities ------------------------------------------ */

.section {
  position: relative;
  padding: 11rem 8vw;
  max-width: 1440px;
  margin-inline: auto;
}

.section--tight {
  padding-block: 8rem;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.8rem;
  font-family: "JetBrains Mono", monospace;
  font-size: 1.25rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--cyan);
  padding: 0.5rem 1.2rem;
  border: 1px solid rgba(34, 211, 238, 0.25);
  border-radius: 10rem;
  background: rgba(34, 211, 238, 0.06);
  margin-bottom: 1.8rem;
}

.eyebrow::before {
  content: "";
  width: 0.6rem;
  height: 0.6rem;
  border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 12px var(--cyan);
  animation: pulse-dot 2s ease-in-out infinite;
}

.section-head {
  margin-bottom: 6rem;
  max-width: 76rem;
}

.section-head.center {
  margin-inline: auto;
  text-align: center;
}

.section-head.center .eyebrow {
  justify-content: center;
}

.section-title {
  font-size: clamp(3.2rem, 5.2vw, 5.4rem);
  margin-bottom: 1.6rem;
}

.section-sub {
  color: var(--ink-dim);
  font-size: clamp(1.5rem, 1.6vw, 1.75rem);
  max-width: 68ch;
}

.section-head.center .section-sub {
  margin-inline: auto;
}

/* ---------- 5. Ambient background ---------------------------------------- */

.fx-grain,
.fx-grid,
.fx-aurora {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}

.fx-grid {
  background-image: linear-gradient(rgba(255, 255, 255, 0.028) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.028) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, #000 20%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, #000 20%, transparent 75%);
}

.fx-aurora::before,
.fx-aurora::after {
  content: "";
  position: absolute;
  width: 60vw;
  height: 60vw;
  border-radius: 50%;
  filter: blur(120px);
  opacity: 0.35;
  will-change: transform;
}

.fx-aurora::before {
  background: radial-gradient(circle, rgba(124, 92, 255, 0.55), transparent 65%);
  top: -18vw;
  left: -12vw;
  animation: drift-a 26s ease-in-out infinite alternate;
}

.fx-aurora::after {
  background: radial-gradient(circle, rgba(34, 211, 238, 0.42), transparent 65%);
  bottom: -22vw;
  right: -14vw;
  animation: drift-b 32s ease-in-out infinite alternate;
}

.fx-grain {
  opacity: 0.035;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4'/%3E%3C/filter%3E%3Crect width='200' height='200' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: grain 8s steps(6) infinite;
}

/* everything above the ambience */
header,
main,
footer,
.scroll-top,
.cursor,
.cursor-ring,
.progress-rail {
  position: relative;
  z-index: 2;
}

/* ---------- 6. Preloader ------------------------------------------------- */

.preloader {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: grid;
  place-items: center;
  background: var(--bg);
  transition: opacity 0.7s var(--ease), visibility 0.7s;
  /* failsafe: if the script never runs, the overlay still clears itself
     instead of leaving the page permanently blocked */
  animation: preloader-failsafe 0.7s var(--ease) 5s forwards;
}

.preloader.done {
  opacity: 0;
  visibility: hidden;
  animation: none;
}

@keyframes preloader-failsafe {
  to { opacity: 0; visibility: hidden; }
}

.pre-mark {
  display: grid;
  place-items: center;
  gap: 2.4rem;
}

.pre-ring {
  width: 9rem;
  height: 9rem;
  display: grid;
  place-items: center;
  position: relative;
}

.pre-ring svg {
  position: absolute;
  inset: 0;
  animation: spin 1.4s linear infinite;
}

.pre-ring circle {
  fill: none;
  stroke-width: 3;
  stroke-linecap: round;
}

.pre-ring .trk {
  stroke: rgba(255, 255, 255, 0.08);
}

.pre-ring .bar {
  stroke: url(#preGrad);
  stroke-dasharray: 120 200;
}

.pre-initials {
  font-family: "Sora", sans-serif;
  font-weight: 800;
  font-size: 2.4rem;
  letter-spacing: -0.03em;
}

.pre-label {
  font-family: "JetBrains Mono", monospace;
  font-size: 1.2rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

/* ---------- 7. Cursor ---------------------------------------------------- */

.cursor,
.cursor-ring {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 9999;
  pointer-events: none;
  border-radius: 50%;
  mix-blend-mode: difference;
}

.cursor {
  width: 7px;
  height: 7px;
  background: #fff;
  transform: translate(-50%, -50%);
}

.cursor-ring {
  width: 36px;
  height: 36px;
  border: 1.5px solid rgba(255, 255, 255, 0.55);
  transform: translate(-50%, -50%);
  transition: width 0.3s var(--ease), height 0.3s var(--ease), border-color 0.3s,
    background-color 0.3s;
}

.cursor-ring.hot {
  width: 62px;
  height: 62px;
  border-color: transparent;
  background: rgba(255, 255, 255, 0.16);
}

@media (hover: none), (pointer: coarse) {
  .cursor,
  .cursor-ring {
    display: none;
  }
}

/* ---------- 8. Scroll progress ------------------------------------------- */

.progress-rail {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  z-index: 999;
  background: transparent;
}

.progress-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--violet), var(--cyan), var(--pink));
  box-shadow: 0 0 14px rgba(124, 92, 255, 0.8);
}

/* ---------- 9. Header / nav ---------------------------------------------- */

header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 8vw;
  z-index: 900;
  transition: background 0.4s var(--ease), backdrop-filter 0.4s, border-color 0.4s,
    height 0.4s var(--ease);
  border-bottom: 1px solid transparent;
}

header.stuck {
  height: 6.4rem;
  background: rgba(5, 6, 15, 0.72);
  backdrop-filter: blur(18px) saturate(160%);
  -webkit-backdrop-filter: blur(18px) saturate(160%);
  border-bottom-color: var(--stroke);
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 1rem;
  font-family: "Sora", sans-serif;
  font-weight: 700;
  font-size: 1.9rem;
  letter-spacing: -0.02em;
}

.logo-mark {
  width: 3.4rem;
  height: 3.4rem;
  display: grid;
  place-items: center;
  border-radius: 1rem;
  background: var(--grad);
  color: #fff;
  font-size: 1.5rem;
  font-weight: 800;
  box-shadow: 0 8px 24px -8px rgba(124, 92, 255, 0.9);
  transition: transform 0.5s var(--ease);
}

.logo:hover .logo-mark {
  transform: rotate(-12deg) scale(1.08);
}

.navbar ul {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid var(--stroke);
  padding: 0.5rem;
  border-radius: 10rem;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.navbar a {
  position: relative;
  display: block;
  padding: 0.75rem 1.6rem;
  border-radius: 10rem;
  font-size: 1.4rem;
  font-weight: 500;
  color: var(--ink-dim);
  transition: color 0.3s;
  white-space: nowrap;
}

.navbar a::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 10rem;
  background: var(--grad);
  opacity: 0;
  transform: scale(0.85);
  transition: opacity 0.35s var(--ease), transform 0.35s var(--ease);
  z-index: -1;
}

.navbar a:hover {
  color: var(--ink);
}

.navbar a.active {
  color: #fff;
}

.navbar a.active::before {
  opacity: 1;
  transform: scale(1);
}

.nav-cta {
  display: inline-flex;
  align-items: center;
  gap: 0.8rem;
  padding: 1rem 1.9rem;
  border-radius: 10rem;
  font-size: 1.4rem;
  font-weight: 600;
  border: 1px solid var(--stroke-strong);
  background: rgba(255, 255, 255, 0.05);
  transition: background 0.3s, border-color 0.3s, transform 0.3s var(--ease);
}

.nav-cta:hover {
  background: var(--grad);
  border-color: transparent;
  transform: translateY(-2px);
}

#menu {
  display: none;
  width: 4.4rem;
  height: 4.4rem;
  place-items: center;
  border-radius: 1.2rem;
  border: 1px solid var(--stroke);
  background: var(--surface);
  font-size: 1.8rem;
  cursor: pointer;
}

/* ---------- 10. Buttons -------------------------------------------------- */

.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 1rem;
  padding: 1.35rem 2.6rem;
  border-radius: 10rem;
  font-size: 1.5rem;
  font-weight: 600;
  cursor: pointer;
  overflow: hidden;
  isolation: isolate;
  transition: transform 0.35s var(--ease), box-shadow 0.35s var(--ease);
  white-space: nowrap;
}

.btn i,
.btn .i {
  transition: transform 0.35s var(--ease);
}

.btn:hover {
  transform: translateY(-3px);
}

.btn:active {
  transform: translateY(-1px) scale(0.98);
}

.btn-primary {
  background: var(--grad);
  color: #fff;
  box-shadow: 0 14px 34px -14px rgba(124, 92, 255, 0.9);
}

.btn-primary::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, var(--cyan), var(--violet));
  opacity: 0;
  transition: opacity 0.4s;
  z-index: -1;
}

.btn-primary:hover::after {
  opacity: 1;
}

.btn-primary:hover {
  box-shadow: 0 20px 46px -14px rgba(34, 211, 238, 0.75);
}

.btn-ghost {
  border: 1px solid var(--stroke-strong);
  background: var(--surface);
  color: var(--ink);
}

.btn-ghost:hover {
  border-color: rgba(124, 92, 255, 0.6);
  background: rgba(124, 92, 255, 0.12);
}

.btn-lock {
  border: 1px dashed rgba(251, 191, 36, 0.5);
  background: rgba(251, 191, 36, 0.08);
  color: var(--amber);
}

.btn-lock:hover {
  background: rgba(251, 191, 36, 0.16);
  border-style: solid;
}

.btn-sm {
  padding: 0.9rem 1.7rem;
  font-size: 1.3rem;
}

/* ---------- 11. Hero ----------------------------------------------------- */

.hero {
  position: relative;
  min-height: 100svh;
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  align-items: center;
  gap: 5rem;
  padding: calc(var(--nav-h) + 4rem) 8vw 8rem;
  max-width: 1440px;
  margin-inline: auto;
  overflow: hidden;
}

#particles {
  position: absolute;
  inset: 0;
  z-index: 0;
  opacity: 0.75;
}

.hero > * {
  position: relative;
  z-index: 1;
}

.hero-status {
  display: inline-flex;
  align-items: center;
  gap: 0.9rem;
  padding: 0.6rem 1.4rem 0.6rem 0.7rem;
  border: 1px solid var(--stroke);
  background: var(--surface);
  border-radius: 10rem;
  font-size: 1.3rem;
  color: var(--ink-dim);
  margin-bottom: 2.4rem;
  backdrop-filter: blur(10px);
}

.hero-status .beacon {
  position: relative;
  width: 1.9rem;
  height: 1.9rem;
  display: grid;
  place-items: center;
}

.hero-status .beacon::before,
.hero-status .beacon::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  background: var(--lime);
}

.hero-status .beacon::before {
  width: 0.8rem;
  height: 0.8rem;
}

.hero-status .beacon::after {
  width: 1.9rem;
  height: 1.9rem;
  opacity: 0.35;
  animation: ripple 2.2s ease-out infinite;
}

.hero h1 {
  font-size: clamp(4rem, 7vw, 7.6rem);
  line-height: 1.02;
  margin-bottom: 2rem;
}

.hero h1 .line {
  display: block;
  overflow: hidden;
  /* let descenders (y, g) render without being clipped by the reveal mask */
  padding-bottom: 0.14em;
  margin-bottom: -0.14em;
}

.hero h1 .line > span {
  display: block;
  transform: translateY(110%);
  animation: rise-in 1s var(--ease) forwards;
}

.hero h1 .line:nth-child(1) > span {
  animation-delay: 0.15s;
}
.hero h1 .line:nth-child(2) > span {
  animation-delay: 0.3s;
}

.hero-role {
  font-size: clamp(1.7rem, 2.2vw, 2.2rem);
  color: var(--ink-dim);
  margin-bottom: 1.8rem;
  min-height: 3.4rem;
  font-family: "JetBrains Mono", monospace;
}

.typing-text {
  color: var(--cyan);
  font-weight: 500;
}

.caret {
  display: inline-block;
  width: 2px;
  height: 1.1em;
  background: var(--cyan);
  vertical-align: text-bottom;
  animation: blink 1s steps(2) infinite;
}

.hero-blurb {
  color: var(--ink-dim);
  font-size: 1.65rem;
  max-width: 56ch;
  margin-bottom: 3rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 1.2rem;
  margin-bottom: 3.4rem;
}

.socials {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.social-link {
  width: 4.6rem;
  height: 4.6rem;
  display: grid;
  place-items: center;
  border-radius: 1.3rem;
  border: 1px solid var(--stroke);
  background: var(--surface);
  font-size: 1.8rem;
  color: var(--ink-dim);
  position: relative;
  overflow: hidden;
  transition: transform 0.4s var(--ease), color 0.3s, border-color 0.3s;
}

.social-link .i {
  width: 2rem;
  height: 2rem;
}

.social-link::before {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--grad);
  transform: translateY(101%);
  transition: transform 0.45s var(--ease);
  z-index: -1;
}

.social-link:hover {
  color: #fff;
  transform: translateY(-6px);
  border-color: transparent;
}

.social-link:hover::before {
  transform: translateY(0);
}

/* hero portrait */
.hero-visual {
  position: relative;
  display: grid;
  place-items: center;
}

.portrait {
  position: relative;
  width: min(38rem, 78%);
  aspect-ratio: 1;
  border-radius: 50%;
  display: grid;
  place-items: center;
  isolation: isolate;
}

.portrait::before {
  content: "";
  position: absolute;
  inset: -6%;
  border-radius: 50%;
  background: conic-gradient(from 0deg, var(--violet), var(--cyan), var(--pink), var(--violet));
  filter: blur(28px);
  opacity: 0.55;
  animation: spin 14s linear infinite;
  z-index: -2;
}

.portrait img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  border: 1px solid var(--stroke-strong);
  background: var(--bg-elev);
  animation: float-y 6s ease-in-out infinite;
}

.orbit {
  position: absolute;
  inset: -8%;
  border-radius: 50%;
  border: 1px dashed rgba(255, 255, 255, 0.12);
  animation: spin 26s linear infinite;
}

.orbit.rev {
  inset: -20%;
  animation-duration: 38s;
  animation-direction: reverse;
  border-style: solid;
  border-color: rgba(255, 255, 255, 0.06);
}

.orbit-chip {
  position: absolute;
  width: 5.2rem;
  height: 5.2rem;
  display: grid;
  place-items: center;
  border-radius: 1.5rem;
  background: rgba(12, 15, 31, 0.92);
  border: 1px solid var(--stroke);
  box-shadow: var(--shadow-md);
  backdrop-filter: blur(8px);
}

.orbit-chip .i {
  width: 2.6rem;
  height: 2.6rem;
}

/* counter-rotate the chips so logos stay upright */
.orbit-chip > span {
  display: grid;
  place-items: center;
  animation: spin-rev 26s linear infinite;
}

.orbit.rev .orbit-chip > span {
  animation: spin 38s linear infinite;
}

.orbit-chip.p1 { top: -2.6rem; left: 50%; margin-left: -2.6rem; }
.orbit-chip.p2 { bottom: -2.6rem; left: 50%; margin-left: -2.6rem; }
.orbit-chip.p3 { left: -2.6rem; top: 50%; margin-top: -2.6rem; }
.orbit-chip.p4 { right: -2.6rem; top: 50%; margin-top: -2.6rem; }

/* hero stats */
.hero-stats {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.6rem;
  margin-top: 2rem;
}

.stat {
  padding: 2.2rem;
  border-radius: var(--r-md);
  border: 1px solid var(--stroke);
  background: var(--surface);
  backdrop-filter: blur(10px);
  transition: transform 0.4s var(--ease), border-color 0.4s, background 0.4s;
}

.stat:hover {
  transform: translateY(-6px);
  border-color: rgba(124, 92, 255, 0.45);
  background: rgba(124, 92, 255, 0.07);
}

.stat b {
  display: block;
  font-family: "Sora", sans-serif;
  font-size: clamp(2.6rem, 3.4vw, 3.6rem);
  font-weight: 800;
  line-height: 1;
  background: var(--grad-text);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.stat span {
  display: block;
  margin-top: 0.7rem;
  font-size: 1.35rem;
  color: var(--ink-faint);
  letter-spacing: 0.02em;
}

.scroll-hint {
  position: absolute;
  bottom: 2.4rem;
  left: 50%;
  transform: translateX(-50%);
  display: grid;
  place-items: center;
  gap: 0.8rem;
  font-family: "JetBrains Mono", monospace;
  font-size: 1.1rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--ink-faint);
  z-index: 3;
}

.scroll-hint .rail {
  width: 1px;
  height: 5rem;
  background: linear-gradient(var(--cyan), transparent);
  position: relative;
  overflow: hidden;
}

.scroll-hint .rail::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 40%;
  background: var(--cyan);
  animation: rail-run 2s ease-in-out infinite;
}

/* ---------- 12. Marquee -------------------------------------------------- */

.marquee {
  position: relative;
  overflow: hidden;
  padding: 2.4rem 0;
  border-block: 1px solid var(--stroke);
  background: rgba(255, 255, 255, 0.02);
  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;
  width: max-content;
  gap: 4.5rem;
  animation: marquee 38s linear infinite;
}

.marquee:hover .marquee-track {
  animation-play-state: paused;
}

.marquee-item {
  display: inline-flex;
  align-items: center;
  gap: 1rem;
  font-family: "JetBrains Mono", monospace;
  font-size: 1.45rem;
  color: var(--ink-faint);
  white-space: nowrap;
  transition: color 0.3s;
}

.marquee-item .i {
  width: 2.2rem;
  height: 2.2rem;
  filter: grayscale(1);
  opacity: 0.65;
  transition: filter 0.3s, opacity 0.3s;
}

.marquee-item:hover {
  color: var(--ink);
}

.marquee-item:hover .i {
  filter: none;
  opacity: 1;
}

/* ---------- 13. Cards (shared) ------------------------------------------- */

.card {
  position: relative;
  border-radius: var(--r-lg);
  border: 1px solid var(--stroke);
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.055), rgba(255, 255, 255, 0.015));
  overflow: hidden;
  transition: transform 0.5s var(--ease), border-color 0.4s, box-shadow 0.5s var(--ease);
}

.card::before {
  /* cursor spotlight */
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(
    320px circle at var(--mx, 50%) var(--my, 50%),
    rgba(124, 92, 255, 0.16),
    transparent 60%
  );
  opacity: 0;
  transition: opacity 0.4s;
  pointer-events: none;
}

.card:hover::before {
  opacity: 1;
}

.card:hover {
  border-color: rgba(124, 92, 255, 0.4);
  box-shadow: var(--shadow-md);
}

/* ---------- 14. About ---------------------------------------------------- */

.about-grid {
  display: grid;
  grid-template-columns: 0.85fr 1.15fr;
  gap: 5rem;
  align-items: start;
}

.about-photo {
  position: relative;
  border-radius: var(--r-xl);
  overflow: hidden;
  border: 1px solid var(--stroke);
  aspect-ratio: 4 / 5;
}

.about-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.9s var(--ease), filter 0.6s;
  filter: saturate(0.9);
}

.about-photo:hover img {
  transform: scale(1.06);
  filter: saturate(1.1);
}

.about-photo::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 45%, rgba(5, 6, 15, 0.9));
}

.photo-badge {
  position: absolute;
  left: 1.8rem;
  right: 1.8rem;
  bottom: 1.8rem;
  z-index: 2;
  padding: 1.4rem 1.8rem;
  border-radius: var(--r-md);
  background: rgba(8, 10, 23, 0.75);
  border: 1px solid var(--stroke);
  backdrop-filter: blur(14px);
}

.photo-badge b {
  display: block;
  font-family: "Sora", sans-serif;
  font-size: 1.7rem;
}

.photo-badge span {
  font-size: 1.3rem;
  color: var(--cyan);
  font-family: "JetBrains Mono", monospace;
}

.about-body p {
  color: var(--ink-dim);
  margin-bottom: 1.8rem;
  font-size: 1.65rem;
}

.about-body strong {
  color: var(--ink);
  font-weight: 600;
}

.fact-grid {
  display: grid;
  /* wide enough that an email address never breaks mid-word */
  grid-template-columns: repeat(auto-fit, minmax(26rem, 1fr));
  gap: 1.2rem;
  margin: 2.8rem 0 3rem;
}

.fact {
  display: flex;
  gap: 1.2rem;
  align-items: center;
  padding: 1.4rem 1.6rem;
  border-radius: var(--r-md);
  border: 1px solid var(--stroke);
  background: var(--surface);
  transition: transform 0.35s var(--ease), border-color 0.35s;
}

.fact:hover {
  transform: translateX(6px);
  border-color: rgba(34, 211, 238, 0.4);
}

.fact i {
  display: grid;
  place-items: center;
  width: 3.8rem;
  height: 3.8rem;
  flex-shrink: 0;
  border-radius: 1.1rem;
  background: rgba(124, 92, 255, 0.14);
  color: var(--violet);
  font-size: 1.6rem;
}

.fact div {
  min-width: 0;
}

.fact b {
  display: block;
  font-size: 1.15rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-faint);
  font-weight: 600;
}

.fact span {
  font-size: 1.5rem;
  word-break: break-word;
}

/* terminal card (about) */
.terminal {
  overflow: hidden;
  background: linear-gradient(165deg, #0d1020, #070912);
}

.term-bar {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 1.2rem 1.6rem;
  border-bottom: 1px solid var(--stroke);
  background: rgba(255, 255, 255, 0.03);
}

.term-bar .dot {
  width: 1.1rem;
  height: 1.1rem;
  border-radius: 50%;
  flex-shrink: 0;
}

.term-bar .dot.r { background: #ff5f57; }
.term-bar .dot.y { background: #febc2e; }
.term-bar .dot.g { background: #28c840; }

.term-name {
  margin-left: auto;
  font-size: 1.2rem;
  color: var(--ink-faint);
}

.term-body {
  margin: 0;
  padding: 2.4rem 2.2rem;
  font-size: 1.32rem;
  line-height: 1.85;
  color: var(--ink-dim);
  overflow-x: auto;
  white-space: pre;
  tab-size: 4;
}

.term-body::-webkit-scrollbar { height: 0.6rem; }
.term-body::-webkit-scrollbar-thumb { background: var(--stroke-strong); border-radius: 10rem; }

.c-com { color: #5d6b8a; font-style: italic; }
.c-kw { color: #a78bfa; }
.c-str { color: #7dd3a0; }
.c-fn { color: #22d3ee; }
.c-num { color: #fbbf24; }

/* ---------- 15. Skills --------------------------------------------------- */

.skill-groups {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(34rem, 1fr));
  gap: 2.2rem;
  /* natural card heights — the four groups differ a lot in length */
  align-items: start;
}

/* four cards read better as 2x2 than as 3 + 1 orphan */
@media (min-width: 1100px) {
  .skill-groups {
    grid-template-columns: repeat(2, 1fr);
  }
}

.skill-card {
  padding: 3rem;
}

.skill-card h3 {
  display: flex;
  align-items: center;
  gap: 1.2rem;
  font-size: 1.9rem;
  margin-bottom: 0.6rem;
}

.skill-card h3 i {
  display: grid;
  place-items: center;
  width: 4.4rem;
  height: 4.4rem;
  border-radius: 1.3rem;
  font-size: 1.8rem;
  flex-shrink: 0;
}

.sk-1 h3 i { background: rgba(124, 92, 255, 0.16); color: #a78bfa; }
.sk-2 h3 i { background: rgba(34, 211, 238, 0.16); color: var(--cyan); }
.sk-3 h3 i { background: rgba(255, 92, 168, 0.16); color: var(--pink); }
.sk-4 h3 i { background: rgba(251, 191, 36, 0.16); color: var(--amber); }

.skill-card > p {
  color: var(--ink-faint);
  font-size: 1.4rem;
  margin-bottom: 2.2rem;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.9rem;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1.3rem;
  border-radius: 10rem;
  border: 1px solid var(--stroke);
  background: rgba(255, 255, 255, 0.04);
  font-size: 1.38rem;
  color: var(--ink-dim);
  cursor: default;
  transition: transform 0.3s var(--ease), color 0.3s, border-color 0.3s, background 0.3s,
    box-shadow 0.3s;
}

.chip .i,
.chip > i {
  width: 1.8rem;
  height: 1.8rem;
  font-size: 1.5rem;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.chip:hover {
  color: var(--ink);
  transform: translateY(-4px);
  border-color: rgba(124, 92, 255, 0.5);
  background: rgba(124, 92, 255, 0.1);
  box-shadow: 0 10px 26px -14px rgba(124, 92, 255, 0.9);
}

.chip--soft {
  border-style: dashed;
  color: var(--ink-faint);
}

/* ---------- 16. Timeline (experience + education) ------------------------ */

.timeline {
  position: relative;
  padding-left: 5.5rem;
}

.timeline::before {
  content: "";
  position: absolute;
  left: 1.85rem;
  top: 0.6rem;
  bottom: 0.6rem;
  width: 2px;
  background: rgba(255, 255, 255, 0.09);
}

.timeline-progress {
  position: absolute;
  left: 1.85rem;
  top: 0.6rem;
  width: 2px;
  height: 0;
  background: linear-gradient(var(--violet), var(--cyan), var(--pink));
  box-shadow: 0 0 14px rgba(124, 92, 255, 0.7);
  transition: height 0.15s linear;
}

.tl-item {
  position: relative;
  padding-bottom: 4.5rem;
}

.tl-item:last-child {
  padding-bottom: 0;
}

.tl-node {
  position: absolute;
  left: -5.5rem;
  top: 0.4rem;
  width: 3.8rem;
  height: 3.8rem;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--bg-elev);
  border: 1px solid var(--stroke-strong);
  color: var(--ink-dim);
  font-size: 1.5rem;
  z-index: 2;
  transition: transform 0.45s var(--ease), border-color 0.45s, color 0.45s,
    box-shadow 0.45s;
}

.tl-node img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

.tl-item.in .tl-node {
  border-color: rgba(124, 92, 255, 0.7);
  color: #fff;
  box-shadow: 0 0 0 6px rgba(124, 92, 255, 0.1), 0 0 22px rgba(124, 92, 255, 0.5);
}

.tl-item:hover .tl-node {
  transform: scale(1.12);
}

.tl-card {
  padding: 2.8rem 3rem;
}

.tl-top {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 1.6rem;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 0.5rem;
}

.tl-card h3 {
  font-size: 2rem;
}

.tl-org {
  display: block;
  color: var(--cyan);
  font-weight: 600;
  font-size: 1.5rem;
  margin-bottom: 0.4rem;
}

.tl-when {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  font-family: "JetBrains Mono", monospace;
  font-size: 1.25rem;
  color: var(--ink-faint);
  padding: 0.45rem 1.1rem;
  border: 1px solid var(--stroke);
  border-radius: 10rem;
  white-space: nowrap;
}

.tl-when.now {
  color: var(--lime);
  border-color: rgba(163, 230, 53, 0.35);
  background: rgba(163, 230, 53, 0.07);
}

.tl-meta {
  font-size: 1.35rem;
  color: var(--ink-faint);
  margin-bottom: 1.6rem;
}

.tl-list {
  display: grid;
  gap: 1rem;
  margin-bottom: 1.8rem;
}

.tl-list li {
  position: relative;
  padding-left: 2.4rem;
  color: var(--ink-dim);
  font-size: 1.52rem;
}

.tl-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 1rem;
  width: 0.9rem;
  height: 0.9rem;
  border-radius: 50%;
  border: 2px solid var(--violet);
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
}

.tag {
  font-family: "JetBrains Mono", monospace;
  font-size: 1.15rem;
  padding: 0.45rem 1rem;
  border-radius: 0.7rem;
  background: rgba(34, 211, 238, 0.09);
  border: 1px solid rgba(34, 211, 238, 0.2);
  color: #7dd3fc;
}

/* education variant */
.edu-grade {
  display: inline-flex;
  align-items: center;
  gap: 0.8rem;
  margin-top: 1.2rem;
  padding: 0.7rem 1.4rem;
  border-radius: 10rem;
  background: var(--grad);
  color: #fff;
  font-weight: 600;
  font-size: 1.35rem;
}

/* ---------- 17. Projects ------------------------------------------------- */

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  margin-bottom: 3.4rem;
}

.filter {
  padding: 0.85rem 1.8rem;
  border-radius: 10rem;
  border: 1px solid var(--stroke);
  background: var(--surface);
  font-size: 1.38rem;
  font-weight: 500;
  color: var(--ink-dim);
  cursor: pointer;
  transition: all 0.3s var(--ease);
}

.filter:hover {
  color: var(--ink);
  border-color: var(--stroke-strong);
}

.filter.on {
  background: var(--grad);
  border-color: transparent;
  color: #fff;
}

.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(35rem, 1fr));
  gap: 2.2rem;
}

.project {
  display: flex;
  flex-direction: column;
  padding: 3rem;
}

.project.hide {
  display: none;
}

.proj-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1.6rem;
  margin-bottom: 1.8rem;
}

.proj-icon {
  width: 5.4rem;
  height: 5.4rem;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  border-radius: 1.6rem;
  font-size: 2.1rem;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.5rem 1.1rem;
  border-radius: 10rem;
  font-family: "JetBrains Mono", monospace;
  font-size: 1.1rem;
  letter-spacing: 0.06em;
  white-space: nowrap;
}

.badge-live {
  background: rgba(163, 230, 53, 0.12);
  border: 1px solid rgba(163, 230, 53, 0.3);
  color: var(--lime);
}

.badge-private {
  background: rgba(251, 191, 36, 0.12);
  border: 1px solid rgba(251, 191, 36, 0.3);
  color: var(--amber);
}

.badge-soon {
  background: rgba(255, 92, 168, 0.12);
  border: 1px solid rgba(255, 92, 168, 0.3);
  color: var(--pink);
}

.project h3 {
  font-size: 2rem;
  margin-bottom: 1rem;
}

.project > p {
  color: var(--ink-dim);
  font-size: 1.5rem;
  margin-bottom: 1.8rem;
}

.proj-points {
  display: grid;
  gap: 0.8rem;
  margin-bottom: 2rem;
}

.proj-points li {
  position: relative;
  padding-left: 2.2rem;
  font-size: 1.42rem;
  color: var(--ink-dim);
}

.proj-points li::before {
  content: "\f0da";
  font-family: "Font Awesome 5 Free";
  font-weight: 900;
  position: absolute;
  left: 0;
  top: 0;
  color: var(--cyan);
  font-size: 1.2rem;
}

.proj-foot {
  margin-top: auto;
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  padding-top: 2rem;
}

/* coming-soon card */
.soon-pulse {
  display: inline-grid;
  place-items: center;
  width: 5.4rem;
  height: 5.4rem;
  border-radius: 1.6rem;
  background: rgba(255, 92, 168, 0.14);
  border: 1px solid rgba(255, 92, 168, 0.25);
  color: var(--pink);
  font-size: 2.1rem;
  animation: breathe 2.6s ease-in-out infinite;
}

/* ---------- 17b. Projects — "forward pass" layer -------------------------
   Three motifs, deliberately no more:
     · attention lattice — a faint weight grid with a few cells burning hotter
     · logit rail        — a quantised softmax column encoding the domain
     · signal trace      — one packet tracing the border on hover
   ------------------------------------------------------------------------- */

.project {
  /* default accent; the [data-tags] rules below reassign it */
  --accent: var(--violet);
  --accent-rgb: 124 92 255;
  --accent-ink: #b7a6ff;

  /* own stacking context, so the z-index:-1 pseudo stays INSIDE the card:
     it paints above the card background but below the text. */
  isolation: isolate;

  border-color: rgb(var(--accent-rgb) / 0.16);

  /* layer 1 — cursor heat, banded into discrete contours rather than a
     smooth glow, so it reads as a loss surface and not a spotlight.
     layer 2 — the logit rail down the left edge.
     layer 3 — the original glass base, untouched. */
  background-image:
    radial-gradient(
      280px circle at var(--mx, 50%) var(--my, 50%),
      rgb(var(--accent-rgb) / 0.16) 0%,
      rgb(var(--accent-rgb) / 0.16) 22%,
      rgb(var(--accent-rgb) / 0.09) 23%,
      rgb(var(--accent-rgb) / 0.09) 44%,
      rgb(var(--accent-rgb) / 0.05) 45%,
      rgb(var(--accent-rgb) / 0.05) 66%,
      transparent 67%
    ),
    linear-gradient(
      180deg,
      rgb(var(--accent-rgb) / 0.95) 0 18%,
      rgb(var(--accent-rgb) / 0.40) 18% 30%,
      rgb(var(--accent-rgb) / 0.78) 30% 46%,
      rgb(var(--accent-rgb) / 0.18) 46% 58%,
      rgb(var(--accent-rgb) / 0.60) 58% 78%,
      rgb(var(--accent-rgb) / 0.12) 78% 100%
    ),
    linear-gradient(160deg, rgba(255, 255, 255, 0.055), rgba(255, 255, 255, 0.015));
  background-size: 100% 100%, var(--rail-w) 82%, 100% 100%;
  background-position: 0 0, left 0 top 9%, 0 0;
  background-repeat: no-repeat;

  /* the transform is composed from a variable so the WAAPI filter animation
     can take the element over and hand it back without clobbering hover */
  --lift: 0px;
  transform: translate3d(0, var(--lift), 0);
  transition: transform 0.55s var(--spring), border-color 0.4s var(--ease),
    box-shadow 0.45s var(--ease), opacity 0.4s;
}

/* ---- domain accents. Source order matters: .soon must stay last --------- */
.project[data-tags~="agents"]   { --accent: var(--agentic);  --accent-rgb: 139  92 246; --accent-ink: #c4b5fd; }
.project[data-tags~="research"] { --accent: var(--research); --accent-rgb:  34 211 238; --accent-ink: #7dd3fc; }
.project[data-tags~="systems"]  { --accent: var(--systems);  --accent-rgb: 163 230  53; --accent-ink: #bef264; }
.project[data-tags~="data"]     { --accent: var(--quant);    --accent-rgb: 251 191  36; --accent-ink: #fcd34d; }

/* the "in progress" card is dashed and pink, and must win over every tag rule */
.project.soon {
  --accent: var(--wip);
  --accent-rgb: 255 92 168;
  --accent-ink: #f9a8d4;
  border-style: dashed;
  background-image:
    radial-gradient(
      280px circle at var(--mx, 50%) var(--my, 50%),
      rgb(255 92 168 / 0.12) 0%,
      rgb(255 92 168 / 0.12) 30%,
      rgb(255 92 168 / 0.05) 31%,
      rgb(255 92 168 / 0.05) 60%,
      transparent 61%
    ),
    linear-gradient(
      180deg,
      rgb(255 92 168 / 0.70) 0 18%,
      rgb(255 92 168 / 0.22) 18% 34%,
      rgb(255 92 168 / 0.50) 34% 52%,
      rgb(255 92 168 / 0.14) 52% 100%
    ),
    linear-gradient(160deg, rgba(255, 92, 168, 0.05), rgba(255, 255, 255, 0.012));
}

/* ---- ::after — attention heat map: lattice + a few hot weights ---------- */
.project::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image:
    linear-gradient(rgb(var(--accent-rgb) / 0.26) 0 0),
    linear-gradient(var(--lattice-hot) 0 0),
    linear-gradient(rgb(var(--accent-rgb) / 0.14) 0 0),
    linear-gradient(rgb(var(--accent-rgb) / 0.10) 0 0),
    linear-gradient(90deg, var(--lattice) 1px, transparent 1px),
    linear-gradient(180deg, var(--lattice) 1px, transparent 1px);
  background-size:
    var(--lattice-cell) var(--lattice-cell),
    var(--lattice-cell) var(--lattice-cell),
    var(--lattice-cell) var(--lattice-cell),
    var(--lattice-cell) var(--lattice-cell),
    var(--lattice-cell) var(--lattice-cell),
    var(--lattice-cell) var(--lattice-cell);
  background-position:
    right 4.4rem top 2.2rem,
    right 2.2rem top 6.6rem,
    right 8.8rem top 4.4rem,
    right 6.6rem top 11rem,
    right 0 top 0,
    right 0 top 0;
  background-repeat: no-repeat, no-repeat, no-repeat, no-repeat, repeat, repeat;
  /* keep it a corner motif, never wallpaper */
  -webkit-mask-image: radial-gradient(115% 88% at 92% -4%, #000 0%, transparent 58%);
          mask-image: radial-gradient(115% 88% at 92% -4%, #000 0%, transparent 58%);
  opacity: 0.62;
  transition: opacity 0.5s var(--ease);
}

.project:hover::after,
.project:focus-within::after {
  opacity: 1;
}

/* ---- ::before — the traced hairline: one forward pass, on hover only ----
   This overrides .card::before (the generic spotlight) by source order.
   Where @property is unsupported the conic renders static at 0deg — a fixed
   accent arc on the lower edge. Still correct, never broken. */
.project::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 3;
  border-radius: calc(var(--r-lg) - 1px);
  padding: 1px;
  background: conic-gradient(
    from var(--pass),
    transparent 0turn,
    transparent 0.58turn,
    rgb(var(--accent-rgb) / 0.45) 0.78turn,
    var(--signal) 0.87turn,
    rgb(var(--accent-rgb) / 0.45) 0.94turn,
    transparent 1turn
  );
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
          mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
          mask-composite: exclude;
  opacity: 0;
  transition: opacity 0.35s var(--ease);
  pointer-events: none;
}

.project:hover::before,
.project:focus-within::before {
  opacity: 1;
  animation: forward-pass 1.5s var(--ease-signal) forwards; /* ONCE. */
}

@keyframes forward-pass {
  to { --pass: 1turn; }
}

/* ---- the node: signal pulse on the icon --------------------------------- */
.proj-icon {
  position: relative;
  z-index: 2;
  background: rgb(var(--accent-rgb) / 0.13);
  color: var(--accent-ink);
  border: 1px solid rgb(var(--accent-rgb) / 0.26);
  transition: transform 0.5s var(--spring), background 0.4s var(--ease),
    border-color 0.4s var(--ease);
}

.proj-icon::before {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  border: 1px solid rgb(var(--accent-rgb) / 0.6);
  opacity: 0;
  pointer-events: none;
}

@keyframes node-fire {
  0%   { opacity: 0.85; transform: scale(1); }
  70%  { opacity: 0; transform: scale(1.5); }
  100% { opacity: 0; transform: scale(1.5); }
}

/* ---- tags inherit the domain accent (scoped, so the timeline stays cyan) - */
.project .tag {
  background: rgb(var(--accent-rgb) / 0.08);
  border: 1px solid rgb(var(--accent-rgb) / 0.20);
  color: var(--accent-ink);
  transition: transform 0.4s var(--spring), background 0.3s var(--ease),
    border-color 0.3s var(--ease);
}

/* ---- bullets become matrix cells, not carets ---------------------------- */
.project .proj-points li::before {
  content: "";
  font-family: inherit;
  width: 0.62rem;
  height: 0.62rem;
  border-radius: 0.15rem;
  top: 0.62em;
  background: rgb(var(--accent-rgb) / 0.85);
  box-shadow: 0 0 0 3px rgb(var(--accent-rgb) / 0.12); /* static, never animated */
}

/* ---- physical hover: five coordinated micro-motions, transform only ----- */
@media (hover: hover) and (pointer: fine) {
  .project:hover,
  .project:focus-within {
    --lift: -10px;
    border-color: rgb(var(--accent-rgb) / 0.38);
    box-shadow: 0 32px 60px -28px rgba(0, 0, 0, 0.85),
      0 0 0 1px rgb(var(--accent-rgb) / 0.28);
  }

  .project:active {
    --lift: -4px;
    transition-duration: 0.12s;
  }

  .project:hover .proj-icon,
  .project:focus-within .proj-icon {
    transform: translate3d(0, -2px, 0) rotate(-6deg) scale(1.05);
    background: rgb(var(--accent-rgb) / 0.22);
    border-color: rgb(var(--accent-rgb) / 0.45);
  }

  .project:hover .proj-icon::before,
  .project:focus-within .proj-icon::before {
    animation: node-fire 1.3s var(--ease-io) 2; /* two beats, then silence */
  }

  .project:hover .tag {
    transform: translate3d(0, -2px, 0);
    background: rgb(var(--accent-rgb) / 0.13);
    border-color: rgb(var(--accent-rgb) / 0.34);
    transition-delay: calc(var(--ti, 0) * 16ms);
  }

  .project:hover .proj-foot .btn i,
  .project:hover .proj-foot .btn .i {
    transform: translate3d(3px, 0, 0);
  }
}

.proj-foot .btn i,
.proj-foot .btn .i {
  transition: transform 0.35s var(--ease);
}

/* ---------- 17c. Projects section signature — the attention row ----------
   16 quantised weight cells with a single bright cell stepping across them:
   argmax scanning the row. Transform-only, so it never repaints layout. */

#projects .section-head {
  position: relative;
  padding-bottom: 3.2rem;
  margin-bottom: 4.2rem;
}

#projects .section-head::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: var(--strip);
  max-width: 100%;
  height: 1.4rem;
  border-radius: 0.3rem;
  background: linear-gradient(
    90deg,
    rgb(124 92 255 / 0.14) 0 6.25%,
    rgb(124 92 255 / 0.55) 6.25% 12.5%,
    rgb(34 211 238 / 0.10) 12.5% 18.75%,
    rgb(34 211 238 / 0.30) 18.75% 25%,
    rgb(124 92 255 / 0.80) 25% 31.25%,
    rgb(34 211 238 / 0.12) 31.25% 37.5%,
    rgb(124 92 255 / 0.22) 37.5% 43.75%,
    rgb(34 211 238 / 0.62) 43.75% 50%,
    rgb(124 92 255 / 0.16) 50% 56.25%,
    rgb(34 211 238 / 0.40) 56.25% 62.5%,
    rgb(124 92 255 / 0.90) 62.5% 68.75%,
    rgb(34 211 238 / 0.18) 68.75% 75%,
    rgb(124 92 255 / 0.34) 75% 81.25%,
    rgb(34 211 238 / 0.52) 81.25% 87.5%,
    rgb(124 92 255 / 0.12) 87.5% 93.75%,
    rgb(34 211 238 / 0.26) 93.75% 100%
  );
  -webkit-mask: repeating-linear-gradient(90deg, #000 0 calc(6.25% - 2px), transparent calc(6.25% - 2px) 6.25%);
          mask: repeating-linear-gradient(90deg, #000 0 calc(6.25% - 2px), transparent calc(6.25% - 2px) 6.25%);
  pointer-events: none;
}

#projects .section-head::before {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  z-index: 1;
  width: calc(var(--strip) / var(--cells) - 2px);
  height: 1.4rem;
  border-radius: 0.3rem;
  background: linear-gradient(180deg, #ffffff, var(--cyan));
  opacity: 0.92;
  pointer-events: none;
  animation: argmax-scan 7.5s steps(var(--cells), jump-none) infinite;
}

@keyframes argmax-scan {
  from { transform: translateX(0); }
  to   { transform: translateX(calc(var(--strip) - var(--strip) / var(--cells))); }
}

@media (max-width: 640px) {
  #projects .section-head { --strip: 30rem; }
}

/* ---------- 18. Publications --------------------------------------------- */

.pub-list {
  display: grid;
  gap: 1.8rem;
}

.pub {
  padding: 0;
}

.pub-main {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 2rem;
  align-items: center;
  padding: 2.6rem 3rem;
  cursor: pointer;
  text-align: left;
  width: 100%;
}

.pub-num {
  font-family: "JetBrains Mono", monospace;
  font-size: 1.3rem;
  color: var(--ink-faint);
  padding-top: 0.2rem;
}

.pub-mid {
  min-width: 0;
}

.pub-main:focus-visible {
  outline: 2px solid var(--violet);
  outline-offset: -4px;
  border-radius: var(--r-lg);
}

.pub-title {
  font-size: 1.85rem;
  line-height: 1.35;
  margin-bottom: 0.9rem;
}

.pub-metaline {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem 1.4rem;
  align-items: center;
  font-size: 1.35rem;
  color: var(--ink-faint);
}

.pub-venue {
  color: var(--cyan);
  font-weight: 500;
}

.status {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.4rem 1rem;
  border-radius: 10rem;
  font-family: "JetBrains Mono", monospace;
  font-size: 1.05rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.status-pub {
  background: rgba(163, 230, 53, 0.12);
  border: 1px solid rgba(163, 230, 53, 0.3);
  color: var(--lime);
}

.status-sub {
  background: rgba(251, 191, 36, 0.12);
  border: 1px solid rgba(251, 191, 36, 0.3);
  color: var(--amber);
}

.pub-toggle {
  width: 4rem;
  height: 4rem;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid var(--stroke);
  background: var(--surface);
  color: var(--ink-dim);
  transition: transform 0.45s var(--ease), background 0.35s, color 0.35s;
}

.pub.open .pub-toggle {
  transform: rotate(180deg);
  background: var(--grad);
  color: #fff;
  border-color: transparent;
}

.pub-body {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.55s var(--ease);
}

.pub.open .pub-body {
  grid-template-rows: 1fr;
}

.pub-body > div {
  overflow: hidden;
}

.pub-inner {
  padding: 0 3rem 3rem;
  border-top: 1px solid var(--stroke);
  margin-top: 0;
  padding-top: 2.4rem;
}

.pub-authors {
  font-size: 1.42rem;
  color: var(--ink-dim);
  margin-bottom: 1.6rem;
}

.pub-authors em {
  color: var(--ink);
  font-style: normal;
  font-weight: 700;
  border-bottom: 2px solid var(--violet);
}

.pub-abstract-label {
  font-family: "JetBrains Mono", monospace;
  font-size: 1.15rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--violet);
  margin-bottom: 0.8rem;
}

.pub-abstract {
  font-size: 1.5rem;
  color: var(--ink-dim);
  line-height: 1.8;
  text-align: justify;
}

.pub-soon {
  display: flex;
  align-items: center;
  gap: 1.2rem;
  padding: 1.8rem 2rem;
  border-radius: var(--r-md);
  border: 1px dashed rgba(251, 191, 36, 0.35);
  background: rgba(251, 191, 36, 0.05);
  color: var(--amber);
  font-size: 1.5rem;
}

.pub-soon i {
  font-size: 2rem;
  animation: breathe 2.6s ease-in-out infinite;
}

.pub-links {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 2.2rem;
}

/* ---------- 19. Achievements --------------------------------------------- */

.ach-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(30rem, 1fr));
  gap: 1.8rem;
}

.ach {
  display: flex;
  gap: 1.8rem;
  padding: 2.6rem;
  align-items: flex-start;
}

.ach-medal {
  width: 5rem;
  height: 5rem;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  border-radius: 1.5rem;
  font-size: 1.9rem;
  position: relative;
  transition: transform 0.5s var(--ease);
}

.ach:hover .ach-medal {
  transform: rotate(-10deg) scale(1.08);
}

.m-gold { background: rgba(251, 191, 36, 0.15); color: var(--amber); border: 1px solid rgba(251, 191, 36, 0.28); }
.m-violet { background: rgba(124, 92, 255, 0.15); color: #a78bfa; border: 1px solid rgba(124, 92, 255, 0.28); }
.m-cyan { background: rgba(34, 211, 238, 0.15); color: var(--cyan); border: 1px solid rgba(34, 211, 238, 0.28); }
.m-pink { background: rgba(255, 92, 168, 0.15); color: var(--pink); border: 1px solid rgba(255, 92, 168, 0.28); }
.m-lime { background: rgba(163, 230, 53, 0.15); color: var(--lime); border: 1px solid rgba(163, 230, 53, 0.28); }

.ach h3 {
  font-size: 1.7rem;
  margin-bottom: 0.6rem;
}

.ach p {
  font-size: 1.42rem;
  color: var(--ink-dim);
}

.ach a.mini {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  margin-top: 1rem;
  font-size: 1.3rem;
  color: var(--cyan);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s;
}

.ach a.mini:hover {
  border-bottom-color: var(--cyan);
}

/* ---------- 20. Beyond Roles (Instagram) --------------------------------- */

.beyond {
  position: relative;
}

.beyond-wrap {
  display: grid;
  grid-template-columns: 1fr 0.85fr;
  gap: 4.5rem;
  align-items: center;
  padding: 4.5rem;
  border-radius: var(--r-xl);
  border: 1px solid var(--stroke);
  background: radial-gradient(
      120% 120% at 0% 0%,
      rgba(255, 0, 105, 0.12),
      transparent 55%
    ),
    radial-gradient(120% 120% at 100% 100%, rgba(251, 191, 36, 0.1), transparent 55%),
    rgba(255, 255, 255, 0.025);
  overflow: hidden;
}

.beyond-wrap h3 {
  font-size: clamp(2.6rem, 3.6vw, 3.6rem);
  margin-bottom: 1.4rem;
}

.ig-handle {
  display: inline-flex;
  align-items: center;
  gap: 0.9rem;
  font-family: "JetBrains Mono", monospace;
  font-size: 1.45rem;
  padding: 0.7rem 1.4rem;
  border-radius: 10rem;
  border: 1px solid rgba(255, 0, 105, 0.3);
  background: rgba(255, 0, 105, 0.08);
  color: #ff8fc0;
  margin-bottom: 2rem;
}

.ig-handle .i {
  width: 1.9rem;
  height: 1.9rem;
}

.beyond-wrap p {
  color: var(--ink-dim);
  font-size: 1.6rem;
  margin-bottom: 1.6rem;
}

.beyond-quote {
  border-left: 3px solid var(--pink);
  padding: 0.4rem 0 0.4rem 1.8rem;
  font-size: 1.6rem;
  color: var(--ink);
  font-style: italic;
  margin-bottom: 2.4rem;
}

.beyond-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  margin-bottom: 2.8rem;
}

.beyond-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.7rem 1.3rem;
  border-radius: 10rem;
  border: 1px solid var(--stroke);
  background: var(--surface);
  font-size: 1.35rem;
  color: var(--ink-dim);
}

.beyond-pill i {
  color: var(--pink);
}

.btn-ig {
  background: linear-gradient(120deg, #f9ce34, #ee2a7b 45%, #6228d7);
  color: #fff;
  box-shadow: 0 14px 34px -14px rgba(238, 42, 123, 0.9);
}

/* phone mock */
.phone {
  position: relative;
  width: min(30rem, 100%);
  aspect-ratio: 9 / 17;
  margin-inline: auto;
  border-radius: 3.6rem;
  border: 2px solid rgba(255, 255, 255, 0.14);
  background: linear-gradient(170deg, #14162b, #08091a);
  padding: 1.4rem;
  box-shadow: 0 40px 80px -30px rgba(0, 0, 0, 0.9);
  animation: float-y 7s ease-in-out infinite;
  overflow: hidden;
}

.phone::before {
  content: "";
  position: absolute;
  top: 1.1rem;
  left: 50%;
  transform: translateX(-50%);
  width: 9rem;
  height: 1.5rem;
  border-radius: 10rem;
  background: rgba(0, 0, 0, 0.7);
  z-index: 3;
}

.phone-screen {
  height: 100%;
  border-radius: 2.6rem;
  background: #0b0d1c;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  padding-top: 3.4rem;
}

.ph-top {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.4rem 1.4rem;
  border-bottom: 1px solid var(--stroke);
}

.ph-av {
  width: 3.6rem;
  height: 3.6rem;
  border-radius: 50%;
  background: linear-gradient(120deg, #f9ce34, #ee2a7b 45%, #6228d7);
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 1.3rem;
  color: #fff;
  flex-shrink: 0;
}

.ph-top b {
  display: block;
  font-size: 1.25rem;
}

.ph-top span {
  font-size: 1.05rem;
  color: var(--ink-faint);
}

.ph-feed {
  flex: 1;
  overflow: hidden;
  position: relative;
}

.ph-track {
  display: grid;
  gap: 1rem;
  padding: 1.2rem;
  animation: ph-scroll 18s linear infinite;
}

.ph-post {
  border-radius: 1.4rem;
  border: 1px solid var(--stroke);
  background: rgba(255, 255, 255, 0.04);
  padding: 1.3rem;
}

.ph-post .bar {
  display: block;
  height: 0.7rem;
  border-radius: 10rem;
  background: rgba(255, 255, 255, 0.12);
  margin-bottom: 0.6rem;
}

.ph-post .bar.w1 { width: 85%; }
.ph-post .bar.w2 { width: 60%; }
.ph-post .bar.grad { background: linear-gradient(90deg, #ee2a7b, #f9ce34); width: 42%; }

.ph-post i {
  color: var(--pink);
  font-size: 1.1rem;
  margin-right: 0.5rem;
}

/* ---------- 21. Contact -------------------------------------------------- */

.contact-wrap {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: 4rem;
  align-items: start;
}

.contact-side h3 {
  font-size: 2.6rem;
  margin-bottom: 1.4rem;
}

.contact-side > p {
  color: var(--ink-dim);
  margin-bottom: 2.8rem;
}

.contact-lines {
  display: grid;
  gap: 1.2rem;
  margin-bottom: 3rem;
}

.cline {
  display: flex;
  align-items: center;
  gap: 1.4rem;
  padding: 1.6rem 1.8rem;
  border-radius: var(--r-md);
  border: 1px solid var(--stroke);
  background: var(--surface);
  transition: transform 0.35s var(--ease), border-color 0.35s, background 0.35s;
}

.cline:hover {
  transform: translateX(6px);
  border-color: rgba(34, 211, 238, 0.45);
  background: rgba(34, 211, 238, 0.06);
}

.cline i,
.cline .i {
  width: 4.2rem;
  height: 4.2rem;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  border-radius: 1.2rem;
  background: rgba(34, 211, 238, 0.12);
  color: var(--cyan);
  font-size: 1.7rem;
}

/* svg sprite icons need inset so the glyph doesn't fill the whole tile */
.cline .i {
  padding: 1.15rem;
}

/* the sprite lives in the document but must never render itself */
.sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.cline b {
  display: block;
  font-size: 1.1rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

.cline span {
  font-size: 1.5rem;
  word-break: break-word;
}

form.contact-form {
  padding: 3.4rem;
  border-radius: var(--r-xl);
  border: 1px solid var(--stroke);
  background: rgba(255, 255, 255, 0.03);
}

.field {
  position: relative;
  margin-bottom: 1.8rem;
}

.field input,
.field textarea {
  width: 100%;
  padding: 1.7rem 1.8rem 1.7rem 5rem;
  border-radius: var(--r-md);
  border: 1px solid var(--stroke);
  background: rgba(255, 255, 255, 0.035);
  font-size: 1.5rem;
  color: var(--ink);
  transition: border-color 0.3s, background 0.3s, box-shadow 0.3s;
}

.field textarea {
  min-height: 15rem;
  resize: vertical;
  padding-top: 1.9rem;
}

.field input::placeholder,
.field textarea::placeholder {
  color: var(--ink-faint);
}

.field input:focus,
.field textarea:focus {
  border-color: rgba(124, 92, 255, 0.6);
  background: rgba(124, 92, 255, 0.05);
  box-shadow: 0 0 0 4px rgba(124, 92, 255, 0.12);
}

.field > i {
  position: absolute;
  left: 1.8rem;
  top: 2rem;
  color: var(--ink-faint);
  font-size: 1.5rem;
  transition: color 0.3s;
  pointer-events: none;
}

.field input:focus ~ i,
.field textarea:focus ~ i {
  color: var(--violet);
}

.form-note {
  font-size: 1.3rem;
  color: var(--ink-faint);
  margin-top: 1.4rem;
}

.form-status {
  margin-top: 1.4rem;
  font-size: 1.42rem;
  padding: 1.2rem 1.6rem;
  border-radius: var(--r-sm);
  display: none;
}

.form-status.show {
  display: block;
}

.form-status.ok {
  background: rgba(163, 230, 53, 0.1);
  border: 1px solid rgba(163, 230, 53, 0.3);
  color: var(--lime);
}

.form-status.err {
  background: rgba(255, 92, 168, 0.1);
  border: 1px solid rgba(255, 92, 168, 0.3);
  color: var(--pink);
}

/* ---------- 22. Footer --------------------------------------------------- */

footer {
  border-top: 1px solid var(--stroke);
  background: rgba(255, 255, 255, 0.015);
  padding: 6rem 8vw 3rem;
}

.foot-grid {
  max-width: 1440px;
  margin-inline: auto;
  display: grid;
  grid-template-columns: 1.6fr 1fr 1fr;
  gap: 4rem;
  padding-bottom: 4rem;
}

.foot-grid h4 {
  font-size: 1.6rem;
  margin-bottom: 1.8rem;
}

.foot-about p {
  color: var(--ink-dim);
  font-size: 1.45rem;
  margin: 1.4rem 0 2rem;
  max-width: 42ch;
}

.foot-links {
  display: grid;
  gap: 0.9rem;
}

.foot-links a {
  color: var(--ink-dim);
  font-size: 1.45rem;
  width: fit-content;
  transition: color 0.3s, transform 0.3s var(--ease);
}

.foot-links a:hover {
  color: var(--cyan);
  transform: translateX(5px);
}

.foot-bottom {
  max-width: 1440px;
  margin-inline: auto;
  border-top: 1px solid var(--stroke);
  padding-top: 2.6rem;
  display: flex;
  flex-wrap: wrap;
  gap: 1.2rem;
  justify-content: space-between;
  align-items: center;
  font-size: 1.35rem;
  color: var(--ink-faint);
}

.foot-bottom .fa-heart {
  color: var(--pink);
  animation: beat 1.4s ease-in-out infinite;
}

/* ---------- 23. Scroll top ----------------------------------------------- */

.scroll-top {
  position: fixed;
  right: 2.4rem;
  bottom: 2.4rem;
  width: 5rem;
  height: 5rem;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--grad);
  color: #fff;
  font-size: 1.8rem;
  z-index: 800;
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px) scale(0.85);
  transition: all 0.45s var(--ease);
  box-shadow: 0 14px 30px -12px rgba(124, 92, 255, 0.9);
}

.scroll-top.on {
  opacity: 1;
  visibility: visible;
  transform: none;
}

.scroll-top:hover {
  transform: translateY(-4px) scale(1.06);
}

/* ---------- 24. Reveal --------------------------------------------------- */

[data-reveal] {
  opacity: 0;
  transform: translateY(38px);
  transition: opacity 0.9s var(--ease), transform 0.9s var(--ease);
  transition-delay: var(--d, 0ms);
  /* promotion is applied in section 29 only while the reveal is pending,
     so ~55 elements do not hold compositor layers for the page's lifetime */
  will-change: auto;
}

[data-reveal="left"] {
  transform: translateX(-45px);
}

[data-reveal="right"] {
  transform: translateX(45px);
}

[data-reveal="scale"] {
  transform: scale(0.9);
}

[data-reveal].in {
  opacity: 1;
  transform: none;
}

/* ---------- 25. Icon helper ---------------------------------------------- */

.i {
  width: 2.2rem;
  height: 2.2rem;
  fill: currentColor;
  flex-shrink: 0;
}

/* brand tints, tuned for a dark canvas */
.i-python { color: var(--c-python); }
.i-openjdk { color: var(--c-java); }
.i-c { color: #a8b9cc; }
.i-mysql { color: #6ba7d6; }
.i-numpy { color: var(--c-numpy); }
.i-pandas { color: var(--c-pandas); }
.i-scipy { color: #8caae6; }
.i-pytorch { color: #ee4c2c; }
.i-tensorflow { color: #ff8f00; }
.i-scikitlearn { color: #f7931e; }
.i-opencv { color: #8b6bff; }
.i-huggingface { color: #ffd21e; }
.i-keras { color: #ff4b4b; }
.i-langchain { color: #7fc8ff; }
.i-langgraph { color: #7fc8ff; }
.i-haystack { color: #0eaf9c; }
.i-qdrant { color: #ff5c7c; }
.i-modelcontextprotocol { color: var(--c-mcp); }
.i-ollama { color: var(--c-ollama); }
.i-anthropic { color: var(--c-anthropic); }
.i-fastapi { color: #12b3a0; }
.i-flask { color: #62c6dc; }
.i-pydantic { color: #ff4d94; }
.i-streamlit { color: #ff6b6b; }
.i-docker { color: #4aa8f0; }
.i-git { color: #f4603e; }
.i-github { color: var(--c-github); }
.i-linux { color: #fcc624; }
.i-jupyter { color: #f37626; }
.i-kaggle { color: #20beff; }
.i-circleci { color: var(--c-circleci); }
.i-javascript { color: #f7df1e; }
.i-instagram { color: #ff5c9d; }
.i-leetcode { color: #ffa116; }
.i-googlescholar { color: #6ba3f5; }
.i-ieee { color: #4d9fd6; }
.i-orcid { color: #a6ce39; }
.i-gmail { color: #ea6a5e; }
.i-googledrive { color: #6ba3f5; }
.i-whatsapp { color: #25d366; }

/* ---------- 26. Keyframes ------------------------------------------------ */

@keyframes spin {
  to { transform: rotate(360deg); }
}

@keyframes spin-rev {
  to { transform: rotate(-360deg); }
}

@keyframes hue-slide {
  to { background-position: 200% center; }
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.35; transform: scale(0.75); }
}

@keyframes ripple {
  0% { transform: scale(0.5); opacity: 0.6; }
  100% { transform: scale(1.9); opacity: 0; }
}

@keyframes rise-in {
  to { transform: translateY(0); }
}

@keyframes blink {
  0%, 49% { opacity: 1; }
  50%, 100% { opacity: 0; }
}

@keyframes float-y {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-14px); }
}

@keyframes drift-a {
  0% { transform: translate(0, 0) scale(1); }
  100% { transform: translate(14vw, 10vh) scale(1.18); }
}

@keyframes drift-b {
  0% { transform: translate(0, 0) scale(1.1); }
  100% { transform: translate(-12vw, -9vh) scale(1); }
}

@keyframes grain {
  0%, 100% { transform: translate(0, 0); }
  10% { transform: translate(-5%, -10%); }
  30% { transform: translate(3%, -15%); }
  50% { transform: translate(-8%, 5%); }
  70% { transform: translate(9%, -4%); }
  90% { transform: translate(-3%, 12%); }
}

@keyframes marquee {
  to { transform: translateX(-50%); }
}

@keyframes rail-run {
  0% { transform: translateY(-120%); }
  100% { transform: translateY(320%); }
}

@keyframes breathe {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.12); opacity: 0.75; }
}

@keyframes beat {
  0%, 100% { transform: scale(1); }
  25% { transform: scale(1.22); }
  50% { transform: scale(1); }
  75% { transform: scale(1.15); }
}

@keyframes ph-scroll {
  0%, 8% { transform: translateY(0); }
  100% { transform: translateY(-52%); }
}

/* ---------- 27. Responsive ----------------------------------------------- */

@media (max-width: 1200px) {
  .navbar a { padding: 0.7rem 1.2rem; font-size: 1.32rem; }
}

@media (max-width: 1080px) {
  .hero {
    grid-template-columns: 1fr;
    text-align: center;
    /* the portrait moves to the top here — leave room so the outer orbit
       and its chips clear the fixed header instead of colliding with the logo */
    padding-top: calc(var(--nav-h) + 8rem);
  }
  .hero-visual { order: -1; }
  .portrait { width: min(28rem, 62%); }
  /* rings are closer together at this size — push them apart so the chips
     on each ring don't collide as they counter-rotate */
  .orbit.rev { inset: -30%; }
  .hero .eyebrow, .hero-status { justify-content: center; }
  .hero-blurb { margin-inline: auto; }
  .hero-actions, .socials { justify-content: center; }
  .hero-stats { grid-template-columns: repeat(2, 1fr); }
  .about-grid, .contact-wrap, .beyond-wrap { grid-template-columns: 1fr; }
  .about-photo { max-width: 40rem; margin-inline: auto; aspect-ratio: 1; }
  .beyond-wrap { padding: 3rem; }
  .phone { order: -1; }
  .foot-grid { grid-template-columns: 1fr 1fr; }
  .foot-about { grid-column: 1 / -1; }
}

@media (max-width: 900px) {
  #menu { display: grid; }
  .nav-cta { display: none; }
  .navbar {
    position: fixed;
    top: var(--nav-h);
    left: 4vw;
    right: 4vw;
    padding: 1.4rem;
    border-radius: var(--r-lg);
    background: rgba(8, 10, 23, 0.96);
    border: 1px solid var(--stroke);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: var(--shadow-md);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-14px) scale(0.98);
    transition: all 0.4s var(--ease);
  }
  .navbar.open {
    opacity: 1;
    visibility: visible;
    transform: none;
  }
  .navbar ul {
    flex-direction: column;
    align-items: stretch;
    gap: 0.3rem;
    background: none;
    border: none;
    padding: 0;
    backdrop-filter: none;
  }
  .navbar a { padding: 1.2rem 1.6rem; font-size: 1.5rem; text-align: center; }
}

@media (max-width: 760px) {
  .section { padding: 8rem 6vw; }
  header { padding-inline: 6vw; }
  footer { padding-inline: 6vw; }
  .hero { padding-inline: 6vw; }
  .timeline { padding-left: 4.4rem; }
  .timeline::before, .timeline-progress { left: 1.45rem; }
  .tl-node { left: -4.4rem; width: 3rem; height: 3rem; font-size: 1.2rem; }
  .tl-card { padding: 2.2rem; }
  .skill-card, .project, .ach { padding: 2.2rem; }
  .pub-main { padding: 2rem; gap: 1.2rem; grid-template-columns: 1fr auto; }
  .pub-num { display: none; }
  .pub-inner { padding: 2rem 2rem 2.4rem; }
  form.contact-form { padding: 2.4rem; }
  .pub-abstract { text-align: left; }
}

@media (max-width: 620px) {
  /* eight chips on two rings is too dense at phone width — keep the outer
     ring's chips only, so nothing crosses as the rings counter-rotate */
  .orbit.rev .orbit-chip { display: none; }
}

@media (max-width: 520px) {
  .hero-stats { grid-template-columns: 1fr; }
  .foot-grid { grid-template-columns: 1fr; }
  .btn { padding: 1.2rem 2rem; font-size: 1.4rem; }
  .section-title { font-size: 3rem; }
}

/* ---------- 29. Motion layer --------------------------------------------
   Everything that starts hidden is scoped under .js-motion, so a no-JS or
   pre-JS render shows fully visible content instead of a blank page.
   ------------------------------------------------------------------------- */

/* ---- scroll progress reacts to fling speed ------------------------------ */

.progress-bar {
  transform-origin: 0 0;
  transform: scaleY(var(--sv-boost, 1));
  transition: transform 0.18s linear;
}

/* ---- project card content cascade --------------------------------------- */

.js-motion .project .cascade-item {
  opacity: 0;
  transform: translate3d(0, 10px, 0);
  transition: opacity 0.5s var(--ease), transform 0.55s var(--ease);
  transition-delay: calc(var(--d, 0ms) + 140ms + var(--ci, 0) * 45ms);
}

.js-motion .project.in .cascade-item {
  opacity: 1;
  transform: none;
}

/* the card's own rise is shorter now that its contents carry the detail */
.js-motion .project[data-reveal] {
  transform: translate3d(0, 18px, 0);
  transition-duration: 0.62s;
}

.js-motion .project[data-reveal].in {
  transform: translate3d(0, var(--lift), 0);
}

/* ---- filter bar: sliding ink, busy state, live count -------------------- */

.filters {
  position: relative;
  align-items: center;
}

.filter {
  position: relative;
  z-index: 1;
  transition: color 0.3s var(--ease), border-color 0.3s var(--ease),
    transform 0.35s var(--spring);
}

.filter:active {
  transform: scale(0.96);
}

/* the gradient now lives on the ink pill, not on the button */
.filter.on {
  background: transparent;
  border-color: transparent;
  color: #fff;
}

.filter-ink {
  position: absolute;
  left: 0;
  top: 0;
  z-index: 0;
  width: 0;
  height: 0;
  border-radius: 10rem;
  background: linear-gradient(120deg, var(--agentic), var(--research));
  box-shadow: 0 10px 26px -12px rgba(124, 92, 255, 0.9);
  pointer-events: none;
  contain: layout paint;
}

.filters.is-busy {
  pointer-events: none;
}

.filters.is-busy .filter-ink {
  animation: ink-busy 0.7s var(--ease) infinite;
}

@keyframes ink-busy {
  0%, 100% { filter: brightness(1); }
  50% { filter: brightness(1.4); }
}

.filter-count {
  font-family: "JetBrains Mono", monospace;
  font-size: 1.2rem;
  letter-spacing: 0.1em;
  color: var(--ink-faint);
  margin: -2.2rem 0 3rem;
}

.project-grid.is-filtering {
  pointer-events: none;
}

/* ---- per-word section title reveal -------------------------------------- */

.js-motion .section-title .w {
  display: inline-block;
  opacity: 0;
  transform: translate3d(0, 0.42em, 0);
  transition: opacity 0.62s var(--ease), transform 0.72s var(--ease);
  transition-delay: var(--wd, 0ms);
}

.js-motion .section-title.split-in .w {
  opacity: 1;
  transform: none;
}

/* the block-level reveal drops its translate; the words carry it now */
.js-motion .section-head.has-split[data-reveal] {
  transform: none;
  transition: opacity 0.5s var(--ease);
}

/* ---- scroll-linked header depth ----------------------------------------- */

@media (min-width: 900px) {
  .js-motion .section-head .eyebrow,
  .js-motion .section-head .section-title,
  .js-motion .section-head .section-sub {
    transform: translate3d(0, var(--py, 0px), 0);
  }
}

/* ---- section dividers: scroll-linked stroke draw ------------------------ */

.divider {
  --draw: 0;
  position: relative;
  z-index: 2;
  max-width: 1440px;
  margin-inline: auto;
  padding-inline: 8vw;
  height: 4rem;
}

.divider svg {
  width: 100%;
  height: 4rem;
  overflow: visible;
}

.divider-path {
  fill: none;
  stroke: url(#dividerGrad);
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-dasharray: 1;
  stroke-dashoffset: calc(1 - var(--draw));
}

.divider-spark {
  fill: none;
  stroke: #a5f3fc;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-dasharray: 0.035 1;
  stroke-dashoffset: calc(0.035 - var(--draw));
  opacity: calc(var(--draw) * (1 - var(--draw)) * 4);
  filter: drop-shadow(0 0 6px rgba(34, 211, 238, 0.9));
}

/* ---- only promote a reveal target while it is actually pending ---------- */

.js-motion [data-reveal]:not(.in) {
  will-change: opacity, transform;
}

/* ---- Contact link is mobile-nav only ------------------------------------ */

@media (min-width: 901px) {
  .nav-only-mobile { display: none; }
}

/* ---------- 28. Motion preferences --------------------------------------- */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
  [data-reveal] {
    opacity: 1 !important;
    transform: none !important;
  }
  .hero h1 .line > span {
    transform: none;
  }
  #particles,
  .fx-grain {
    display: none;
  }

  /* static opacity:0 states must be force-shown, or the content is invisible */
  .js-motion .project .cascade-item,
  .js-motion .section-title .w {
    opacity: 1 !important;
    transform: none !important;
    transition-delay: 0ms !important;
  }

  .js-motion .section-head .eyebrow,
  .js-motion .section-head .section-title,
  .js-motion .section-head .section-sub {
    --py: 0px !important;
    transform: none !important;
  }

  .divider { --draw: 1 !important; }
  .divider-spark { display: none !important; }
  .progress-bar { transform: none !important; }
  .filters.is-busy .filter-ink { animation: none !important; }
  #projects .section-head::before { animation: none !important; }
}

@media print {
  .preloader, header, .scroll-top, #particles, .fx-aurora, .fx-grain, .fx-grid,
  .cursor, .cursor-ring, .progress-rail { display: none !important; }
  body { background: #fff; color: #000; }
}
