﻿/* ========================================
   index2.min.css — Full Stylesheet v2
   Taufik Nur Rahmanda Portfolio
   Design: Purple + Black, Rounded, Modern
   Animations: scroll-driven, parallax, entrance
   ======================================== */
:root {
  --clr-primary: #7c3aed;
  --clr-primary-light: #a78bfa;
  --clr-primary-dark: #4c1d95;
  --clr-accent: #c084fc;
  --clr-purple-deep: #2e1065;
  --clr-purple-dark: #1e0533;
  --clr-bg: #0a0015;
  --clr-bg-card: #14002e;
  --clr-surface: #1c043a;
  --clr-text: #f5f3ff;
  --clr-text-muted: #a59cb8;
  --clr-text-dim: #6d6390;
  --clr-white: #ffffff;
  --clr-glow: rgba(124,58,237,0.5);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  --radius-2xl: 36px;
  --font-family: InterVariable, Inter, ui-sans-serif, system-ui, -apple-system, sans-serif;
  --max-width: 1200px;
  --nav-height: 64px;
  --parallax-x: 0px;
  --parallax-y: 0px;
}

/* === Cursor spotlight: registered custom props = animatable in CSS === */
/* Registering --mx/--my lets the spotlight border be *transitioned* by CSS,
   which produces the smooth trailing/inertia feel with zero JS. */
@property --mx {
  syntax: "<length-percentage>";
  inherits: true;
  initial-value: 50%;
}
@property --my {
  syntax: "<length-percentage>";
  inherits: true;
  initial-value: 50%;
}

/* === Scroll watcher === */
#scroll-watcher {
  position: fixed; top: 0; left: 0; height: 3px;
  background: linear-gradient(90deg, var(--clr-primary), var(--clr-primary-light));
  z-index: 9999; width: 0;
  animation: scrollProgress linear;
  animation-timeline: scroll(root);
}
@keyframes scrollProgress { from { width: 0 } to { width: 100% } }

/* === Base === */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0 }
html { scroll-behavior: smooth; scroll-padding-top: var(--nav-height) }
body {
  font-feature-settings: "salt";
  font-family: var(--font-family); background: var(--clr-bg); color: var(--clr-text);
  overflow-x: hidden; font-size: 1rem; line-height: 1.65;
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}
a { color: var(--clr-primary-light); text-decoration: none; transition: color .3s }
a:hover { color: var(--clr-white) }
img { max-width: 100%; height: auto; display: block }
::selection { background: var(--clr-primary); color: var(--clr-white) }
::-webkit-scrollbar { width: 8px }
::-webkit-scrollbar-track { background: var(--clr-bg) }
::-webkit-scrollbar-thumb { background: var(--clr-primary-dark); border-radius: 99px }
::-webkit-scrollbar-thumb:hover { background: var(--clr-primary) }

/* === Utilities === */
.skip-link {
  position: absolute; top: -100%; left: 1rem; z-index: 9999;
  padding: .5rem 1rem; background: var(--clr-primary); color: var(--clr-white);
  border-radius: var(--radius-sm); transition: top .2s;
}
.skip-link:focus { top: 1rem }
.container { width: 100%; max-width: var(--max-width); margin: 0 auto; padding: 0 max(1.5rem, 5vw) }
.section { padding: 5rem max(1.5rem, 5vw); position: relative; overflow: hidden }
.section-title {
  font-size: clamp(1.75rem, 4vw, 3rem); font-weight: 800; text-align: center; margin-bottom: 0.5em;
  background: linear-gradient(135deg, var(--clr-white), var(--clr-primary-light));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}
.section-subtitle {
  text-align: center; color: var(--clr-text-muted); max-width: 640px;
  margin: 0 auto 3rem auto; font-size: clamp(.95rem, 1.5vw, 1.1rem);
}
.btn {
  display: inline-flex; align-items: center; gap: 0.5rem;
  padding: .75rem 1.75rem; border-radius: var(--radius-md); font-weight: 600;
  font-size: .95rem; transition: all .3s ease; cursor: pointer; border: none; font-family: inherit;
  /* Cursor-follow drift: smooth translate driven by --drift-x/y (set in JS) */
  --drift-x: 0px; --drift-y: 0px;
  transform: translate3d(var(--drift-x), var(--drift-y), 0);
  transition: background .3s ease, box-shadow .3s ease, color .3s ease, border-color .3s ease,
              transform .4s cubic-bezier(.22,1,.36,1);
  will-change: transform;
}
/* Hover lift preserves the cursor-follow drift */
.btn:hover { transform: translate3d(var(--drift-x), calc(var(--drift-y) - 2px), 0) }
.btn-primary { background: var(--clr-primary); color: var(--clr-white) }
.btn-primary:hover {
  background: var(--clr-primary-light);
  box-shadow: 0 8px 32px var(--clr-glow);
}
.btn-outline { background: transparent; color: var(--clr-text); border: 1px solid var(--clr-primary-light) }
.btn-outline:hover { border: 1px solid var(--clr-primary) }

/* === Nav === */
#navbar {
  position: fixed; top: 0; left: 0; right: 0; height: var(--nav-height); z-index: 1000;
  background: rgba(10, 0, 21, .85); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(124, 58, 237, .15);
}
.nav-inner {
  display: flex; align-items: center; justify-content: space-between;
  height: 100%; max-width: var(--max-width); margin: 0 auto; padding: 0 max(1.5rem, 5vw);
}
.nav-logo { font-weight: 800; font-size: 1.15rem; color: var(--clr-white); letter-spacing: -.02em }
.nav-logo span { color: var(--clr-primary-light) }
.nav-links { display: flex; list-style: none; gap: .25rem }
.nav-links a {
  padding: .5rem 1rem; border-radius: var(--radius-sm); color: var(--clr-text-muted);
  font-size: .875rem; font-weight: 500; transition: all .2s;
}
.nav-links a:hover, .nav-links a.active { color: var(--clr-white); background: rgba(124, 58, 237, .15) }
.nav-hamburger { display: none; flex-direction: column; gap: 5px; background: none; border: none; cursor: pointer; padding: 4px }
.nav-hamburger span { display: block; width: 24px; height: 2px; background: var(--clr-text); border-radius: 2px; transition: all .3s }
/* Nav socials & copyright: hidden on desktop, shown in mobile overlay */
.nav-socials, .nav-copyright { display: none }

@media (max-width: 768px) {
  .nav-links {
    position: fixed; top: var(--nav-height); left: 0; right: 0; bottom: 0;
    width: 100vw; height: 100vh;
    flex-direction: column; justify-content: center; align-items: center;
    background: rgba(10, 0, 21, .98); -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px);
    padding: 2rem 1.5rem; gap: 0;
    transform: translateY(-100%); opacity: 0; pointer-events: none;
    transition: all .4s ease;
    z-index: 100;
  }
  .nav-links.open { transform: translateY(0); opacity: 1; pointer-events: auto }
  .nav-links > li { opacity: 0; transform: translateY(24px); transition: opacity .5s cubic-bezier(.22,1,.36,1) calc(var(--i,0) * 0.08s), transform .5s cubic-bezier(.22,1,.36,1) calc(var(--i,0) * 0.08s) }
  .nav-links.open > li { opacity: 1; transform: translateY(0); margin-bottom: 1rem }
  .nav-links a { padding: .65rem 1.5rem; border-radius: var(--radius-lg); font-size: 1.35rem; font-weight: 600 }
  .nav-hamburger { display: flex }
  .nav-hamburger.active span:nth-child(1) { transform: translateY(7px) rotate(45deg) }
  .nav-hamburger.active span:nth-child(2) { opacity: 0 }
  .nav-hamburger.active span:nth-child(3) { transform: translateY(-7px) rotate(-45deg) }
  /* Social icons in overlay */
  .nav-socials { display: flex; gap: 1rem; margin-top: 2rem; padding-top: 2rem; border-top: 1px solid rgba(124, 58, 237, .15) }
  .nav-socials a { padding: 0; width: 40px; height: 40px; border-radius: 50%; background: rgba(124, 58, 237, .1); display: flex; align-items: center; justify-content: center; font-size: 0 }
  .nav-socials a:hover { background: var(--clr-primary) }
  .nav-socials svg { width: 18px; height: 18px; fill: var(--clr-text-muted) }
  .nav-socials a:hover svg { fill: var(--clr-white) }
  /* Copyright in overlay */
  .nav-copyright { display: block; font-size: .75rem; color: var(--clr-text-dim); margin-top: 1.5rem }
}

/* === Hero (with parallax) === */
#hero {
  min-height: 100vh; display: flex; align-items: center; position: relative; overflow: hidden;
  padding: calc(var(--nav-height) + 3rem) max(1.5rem, 5vw) 2rem;
  /* background:
    radial-gradient(circle 400px at 20% 50%, rgba(124, 58, 237, .05), transparent),
    radial-gradient(circle 300px at 80% 30%, rgba(167, 139, 250, .04), transparent),
    radial-gradient(ellipse 80% 60% at 50% -10%, var(--clr-purple-dark), transparent),
    radial-gradient(ellipse 60% 40% at 80% 80%, rgba(124, 58, 237, .08), transparent),
    var(--clr-bg); */
  background: repeating-linear-gradient(
    0deg,
    rgba(255,255,255,.1) 0,
    rgba(255,255,255,.1) 1px,
    transparent 1px,
    transparent 120px
  ), repeating-linear-gradient(
    90deg,
    rgba(255,255,255,.1) 0,
    rgba(255,255,255,.1) 1px,
    transparent 1px,
    transparent 120px
  );
}
#hero::before {
  content: ''; position: absolute; inset: 0;
  background:
    radial-gradient(circle 400px at 20% 50%, rgba(124, 58, 237, .25), transparent),
    radial-gradient(circle 300px at 80% 30%, rgba(167, 139, 250, .1), transparent);
  pointer-events: none;
}

/* === Hero backdrop: floating boxes + drifting particles === */
.hero-bg {
  position: absolute; inset: 0; z-index: 0;
  overflow: hidden; pointer-events: none;
}
.hero-bg .hero-box {
  position: absolute;
  border-radius: 28%;
  background: linear-gradient(135deg, rgba(124, 58, 237, .12), rgba(167, 139, 250, .04));
  box-shadow: 0 0 40px rgba(124, 58, 237, .12);
}
.hero-bg .hero-box:nth-child(1) { width: 7vmin;  height: 7vmin;  left: 66%; top: 24%; opacity: .55 }
.hero-bg .hero-box:nth-child(2) { width: 13vmin; height: 13vmin; left: 82%; top: 30%; opacity: .4 }
.hero-bg .hero-box:nth-child(3) { width: 24vmin; height: 24vmin; left: 55%; top: 70%; opacity: .28 }
.hero-bg .hero-box::after {
  content: ''; display: block; width: 100%; height: 100%; border-radius: inherit;
  border: 1px solid rgba(167, 139, 250, .25);
  background: inherit;
  animation: heroFloat 7s ease-in-out infinite;
}
.hero-bg .hero-box:nth-child(2)::after { animation-duration: 9s }
.hero-bg .hero-box:nth-child(3)::after { animation-duration: 11s }
@keyframes heroFloat { 50% { transform: translateY(-34px) } }

.hero-bg .particle {
  position: absolute; width: 5px; height: 5px; border-radius: 50%;
  background: rgba(167, 139, 250, .55);
  box-shadow: 0 0 8px rgba(124, 58, 237, .5);
  animation: heroParticle 6s linear infinite;
}
.hero-bg .particle:nth-child(4) { --mx: -120px; --my: 160px;  left: 12%; top: 30%; animation-delay: -.3s }
.hero-bg .particle:nth-child(5) { --mx: 140px;  --my: -110px; left: 30%; top: 55%; animation-delay: -.9s }
.hero-bg .particle:nth-child(6) { --mx: -160px; --my: -130px; left: 50%; top: 25%; animation-delay: -1.5s }
.hero-bg .particle:nth-child(7) { --mx: 150px;  --my: 180px;  left: 68%; top: 40%; animation-delay: -2.1s }
.hero-bg .particle:nth-child(8) { --mx: -140px; --my: -150px; left: 85%; top: 60%; animation-delay: -2.7s }
.hero-bg .particle:nth-child(9) { --mx: 120px;  --my: 150px;  left: 22%; top: 75%; animation-delay: -3.3s }
.hero-bg .particle:nth-child(10){ --mx: -170px; --my: -160px; left: 44%; top: 12%; animation-delay: -3.9s }
.hero-bg .particle:nth-child(11){ --mx: 160px;  --my: 140px;  left: 72%; top: 80%; animation-delay: -4.5s }
@keyframes heroParticle {
  0%   { transform: translate3d(0, 0, 0) rotate(0); opacity: 0 }
  15%  { opacity: 1 }
  85%  { opacity: 1 }
  100% { transform: translate3d(var(--mx, 100px), var(--my, 100px), 0) rotate(220deg); opacity: 0 }
}
.hero-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 3rem;
  align-items: center; position: relative; z-index: 1;
}
/* 3D tilt + cursor-follow drift on hero buttons (combined so they don't conflict) */
.portfolio-btn {
  transform: translate3d(var(--drift-x, 0px), var(--drift-y, 0px), 0)
             perspective(800px) rotateX(var(--rotate-x, 0deg)) rotateY(var(--rotate-y, 0deg));
  transition: transform .4s cubic-bezier(.22,1,.36,1), background-position .4s ease, box-shadow .3s ease;
}
.hero-content { display: flex; flex-direction: column; gap: 1.25rem }
.hero-badge {
  display: inline-flex; align-items: center; gap: .5rem; padding: .35rem 1rem;
  border-radius: 99px; font-size: .8rem; font-weight: 500;
  background: rgba(124, 58, 237, .15); color: var(--clr-primary-light);
  border: 1px solid rgba(124, 58, 237, .25); width: fit-content;
}
.hero-name { font-size: clamp(2rem, 5vw, 3.5rem); font-weight: 800; line-height: 1.15; letter-spacing: -.03em }
.hero-name .highlight {
  background: linear-gradient(110deg, var(--clr-primary) 0%, var(--clr-accent) 25%, var(--clr-primary-light) 50%, var(--clr-accent) 75%, var(--clr-primary) 100%);
  background-size: 200% auto;
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
  animation: nameShine 5s linear infinite;
}
@keyframes nameShine {
  0% { background-position: 0% 50% }
  100% { background-position: 200% 50% }
}
.hero-title {
  font-size: clamp(.75rem, 2vw, 1rem); color: var(--clr-text-muted);
  font-weight: 500; line-height: 1.5; max-width: 540px;
}
.hero-title span { color: var(--clr-primary-light); font-weight: 600 }
.hero-actions { display: flex; gap: .85rem; flex-wrap: nowrap; margin-top: .5rem }
.btn { border-radius: var(--radius-lg) }
.hero-actions .btn { border-radius: 5rem }
/* Hero buttons: 1 line, no wrapping */
.portfolio-btn, .about-btn { white-space: nowrap }
.portfolio-btn { max-width: 300px; padding-right: 0 }
.about-btn { border: none }

/* Rotating label on the About Me button — each text scales/translates/
   rotates in, holds, then scales/translates/rotates out; loops forever
   with staggered delays. */
.dropping-texts {
  display: inline-grid; position: relative;
  height: 1.2em; line-height: 1.2em;
  overflow: visible; vertical-align: middle; text-align: left;
  transition: width .35s cubic-bezier(.22,1,.36,1);
}
.dropping-texts > span {
  grid-area: 1/1; white-space: nowrap; transform-origin: left center;
  font: inherit; font-weight: inherit; justify-self: start;
  opacity: 0; transform: scale(0) translate(-30px, 0) rotate(-25deg);
  animation: dropRoll 4.5s linear infinite;
}
.dropping-texts > span:nth-child(1) { animation-delay: 0s }
.dropping-texts > span:nth-child(2) { animation-delay: 1.125s }
.dropping-texts > span:nth-child(3) { animation-delay: 2.25s }
.dropping-texts > span:nth-child(4) { animation-delay: 3.375s }
@keyframes dropRoll {
  0%   { opacity: 0; transform: scale(0)   translate(-30px, 0)    rotate(-25deg) }
  3%   { opacity: 1; transform: scale(1.15)   translate(0, 0)        rotate(0) }
  5%   { opacity: 1; transform: scale(1)   translate(0, 0)        rotate(0) }
  20%  { opacity: 1; transform: scale(1)   translate(0, 0)        rotate(0) }
  27%  { opacity: .5; transform: scale(0)  translate(-20px, 50px) rotate(0) }
}
.btn-primary { display: inline-flex; align-items: center; gap: 0; background: var(--clr-primary); color: var(--clr-white); overflow: hidden }
.btn-primary:hover { background: var(--clr-primary-light); box-shadow: 0 8px 32px var(--clr-glow) }
/* Portfolio button: gradient bg with animated position on hover */
.portfolio-btn.btn-primary { background: linear-gradient(135deg, #0e235b, #5c25ba, #49142f); background-size: 200%; background-position: 0% 50%; transition: background-position .4s ease, box-shadow .3s ease, transform .4s cubic-bezier(.22,1,.36,1) }
/* Hover lift keeps the 3D tilt + cursor drift intact */
.portfolio-btn.btn-primary:hover,
.portfolio-btn:hover {
  background-position: 100% 50%; box-shadow: 0 8px 32px var(--clr-glow);
  transform: translate3d(var(--drift-x, 0px), calc(var(--drift-y, 0px) - 2px), 0)
             perspective(800px) rotateX(var(--rotate-x, 0deg)) rotateY(var(--rotate-y, 0deg));
}
/* About button: cursor-follow drift + hover lift */
.about-btn { transform: translate3d(var(--drift-x, 0px), var(--drift-y, 0px), 0); transition: transform .4s cubic-bezier(.22,1,.36,1), background .3s ease, color .3s ease, border-color .3s ease }
.about-btn:hover { transform: translate3d(var(--drift-x, 0px), calc(var(--drift-y, 0px) - 2px), 0) }
.btn-primary .btn-text { padding: .75rem 0 }
.btn-primary .btn-marquee { display: inline-flex; align-items: center; gap: .35rem; padding: 0 1rem 0 .6rem; overflow: hidden; mask: linear-gradient(90deg, transparent 2%, #000 8%, #000 92%, transparent 98%); -webkit-mask: linear-gradient(90deg, transparent 2%, #000 8%, #000 92%, transparent 98%) }
.btn-primary .btn-marquee-inner { display: flex; gap: .35rem; animation: btnMarquee 20s linear infinite }
.btn-primary .btn-marquee img { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; flex-shrink: 0; border: 1.5px solid rgba(255,255,255,.3) }
@keyframes btnMarquee { 0% { transform: translateX(0) } 100% { transform: translateX(-50%) } }
.hero-socials { display: flex; gap: .75rem; align-items: center; margin-top: .25rem }
.hero-socials a {
  display: flex; align-items: center; justify-content: center; width: 44px; height: 44px;
  border-radius: var(--radius-md); background: rgba(255, 255, 255, .04);
  border: 1px solid rgba(255, 255, 255, .06); transition: all .3s;
}
.hero-socials a:hover {
  background: var(--clr-primary); border-color: var(--clr-primary);
  transform: translateY(-3px); box-shadow: 0 4px 20px var(--clr-glow);
}
.hero-socials svg { width: 20px; height: 20px; fill: var(--clr-text-muted); transition: fill .3s }
.hero-socials a:hover svg { fill: var(--clr-white) }
.hero-visual { display: flex; justify-content: center; align-items: center; position: relative }
.profile-wrapper {
  position: relative; width: clamp(220px, 22vw, 340px); aspect-ratio: 3/4;
  border-radius: var(--radius-2xl); overflow: hidden;
  border: 2px solid rgba(124, 58, 237, .25);
  box-shadow: 0 0 60px rgba(124, 58, 237, .15);
}
.profile-wrapper img { width: 100%; height: 100%; object-fit: cover }
.profile-glow {
  position: absolute; inset: -20%;
  background: radial-gradient(circle, var(--clr-glow), transparent 70%);
  opacity: .3; pointer-events: none;
  animation: profilePulse 4s ease-in-out infinite;
}
@keyframes profilePulse {
  0%, 100% { opacity: .2; transform: scale(1) }
  50% { opacity: .4; transform: scale(1.05) }
}

/* === Scroll indicator === */
.scroll-indicator {
  position: absolute; bottom: 1.5rem; left: 50%; transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center; gap: .35rem;
  color: var(--clr-text-dim); font-size: .7rem; letter-spacing: .1em; text-transform: uppercase; z-index: 2;
}
.scroll-indicator .mouse { width: 20px; height: 32px; border: 2px solid var(--clr-text-dim); border-radius: 99px; position: relative }
.scroll-indicator .mouse::after {
  content: ''; position: absolute; top: 6px; left: 50%; transform: translateX(-50%);
  width: 3px; height: 8px; background: var(--clr-primary-light); border-radius: 99px;
  animation: scrollWheel 2s ease-in-out infinite;
}
@keyframes scrollWheel {
  0%, 100% { opacity: 1; transform: translateX(-50%) translateY(0) }
  50% { opacity: .3; transform: translateX(-50%) translateY(8px) }
}

/* === Tech Stack === */
#tech-stack { padding: 3rem max(1.5rem, 5vw); border-top: 1px solid rgba(124, 58, 237, .06); border-bottom: 1px solid rgba(124, 58, 237, .06) }
.tech-label { text-align: center; font-size: .8rem; text-transform: uppercase; letter-spacing: .12em; color: var(--clr-text-dim); margin-bottom: 1.5rem; font-weight: 600 }
.tech-marquee { cursor: none; overflow: clip; position: relative; mask: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent); -webkit-mask: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent) }
.tech-track { display: flex; gap: 2.5rem; width: max-content; padding: 1rem 0; animation: techScroll 30s linear infinite }
.tech-track:hover { animation-play-state: paused }
.tech-track img { height: clamp(28px, 3vw, 40px); width: auto; opacity: .35; filter: grayscale(1) brightness(1.5); transition: all .4s cubic-bezier(.34, 1.56, .64, 1) }
.tech-track img:hover { opacity: 1; filter: grayscale(0) brightness(1); transform: scale(1.15) }
@keyframes techScroll { 0% { transform: translateX(0) } 100% { transform: translateX(-50%) } }
.tech-magnifier {
  position: absolute; width: 140px; height: 140px; border-radius: 50%;
  left: var(--mx, -100px); top: var(--my, -100px);
  transform: translate(-50%,-50%) scale(0); opacity: 0;
  pointer-events: none; z-index: 2;
  background: radial-gradient(circle at 35% 35%, rgba(255,255,255,.15) 0%, rgba(124,58,237,.08) 40%, transparent 70%);
  border: 1.5px solid rgba(255,255,255,.15);
  box-shadow:
    0 8px 32px rgba(0,0,0,.3),
    inset 0 -4px 12px rgba(0,0,0,.15),
    inset 0 4px 12px rgba(255,255,255,.2),
    0 0 0 2px rgba(124,58,237,.08);
  -webkit-backdrop-filter: contrast(1.6) brightness(1.25) saturate(1.3);
  backdrop-filter: contrast(1.6) brightness(1.25) saturate(1.3);
  mask-image: radial-gradient(circle, black 35%, rgba(0,0,0,.35) 65%, transparent 100%);
  -webkit-mask-image: radial-gradient(circle, black 35%, rgba(0,0,0,.35) 65%, transparent 100%);
  transition: opacity .35s ease, transform .35s cubic-bezier(.22,1,.36,1);
}
.tech-marquee:hover .tech-magnifier { opacity: 1; transform: translate(-50%,-50%) scale(1) }

/* === Stats === */
/* === Pure-CSS count-up (no JS) === */
@property --angle {
  syntax: "<angle>";
  initial-value: 0deg;
  inherits: false;
}
@property --num {
  syntax: "<integer>";
  initial-value: 0;
  inherits: true;
}
@keyframes statCount {
  from { --num: 0 }
  to   { --num: var(--target) }
}
#stats {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 0;
  padding: 3rem max(1.5rem, 5vw); max-width: var(--max-width); margin: 0 auto;
  border-bottom: 1px solid rgba(124, 58, 237, .06);
}
.stat-item {
  text-align: center; padding: 1.5rem 1rem;
  border-right: 1px solid rgba(124, 58, 237, .08); transition: all .4s;
}
.stat-item:last-child { border-right: none }
.stat-item:hover { transform: translateY(-3px) }
.stat-icon { width: 32px; height: 32px; stroke: var(--clr-primary-light); margin: 0 auto .6rem; display: block; opacity: .8 }
.stat-number { font-size: clamp(1.75rem, 3vw, 2.5rem); font-weight: 800; line-height: 1.1 }
.stat-number .stat-value {
  background: linear-gradient(135deg, var(--clr-white), var(--clr-primary-light));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
  /* Pure-CSS counter: render the animatable --num integer as text */
  counter-reset: num var(--num);
}
.stat-number .stat-value::after { content: counter(num) }
.stat-plus { font-size: clamp(1rem, 1.5vw, 1.25rem); color: var(--clr-primary-light) }
.stat-item {
  /* Default to the target so the number is correct even if the animation never runs */
  --num: var(--target);
  /* Animate --num from 0 to --target, driven by scroll into view.
     Finishes when the element reaches 30% from the top of the screen, so the
     count stays noticeable across a longer scroll distance (entry -> top at 30%). */
  animation: statCount 2.4s cubic-bezier(.22,1,.36,1) forwards;
  animation-timeline: view();
  animation-range: entry 5% cover 70%;
}
/* Fallback for browsers without animation-timeline: run on load (time-based) */
@supports not (animation-timeline: view()) {
  .stat-item { animation: statCount 2.4s cubic-bezier(.22,1,.36,1) forwards; }
}
.stat-label { font-size: .8rem; color: var(--clr-text-dim); margin-top: .25rem; font-weight: 500; text-transform: uppercase; letter-spacing: .06em }
@media (max-width: 640px) {
  #stats { grid-template-columns: repeat(2, 1fr) }
  .stat-item:nth-child(2) { border-right: none }
}

/* === Portfolio (staggered masonry-like grid) === */
/* overflow: clip (not hidden) so the sticky filter bar can stick to the VIEWPORT:
   overflow: hidden on #portfolio would make it a scroll container and kill sticky */
#portfolio { background: var(--clr-bg); overflow: clip }
/* Segmented-control style filter: a frosted-glass container wraps all tabs,
   and ONE absolutely-positioned pill underlines only the active tab. The pill's
   width/position come from CSS custom properties (--w/--x, set by a tiny JS
   measurement) and are transitioned with a soft ease so it fluidly morphs
   between tab widths. Buttons themselves stay transparent (no bg/border). */
/* Sticky: stays in normal flow until its top hits `top`, then pins to the
   viewport (below the fixed navbar) while the portfolio cards scroll under it.
   It automatically un-sticks at the bottom of its containing block (.container)
   and re-sticks on the way back up — pure CSS, no JS. */
.portfolio-filter {
  position: sticky; top: calc(var(--nav-height) + 1rem); z-index: 100;
  display: flex; justify-content: center; align-items: center;
  flex-wrap: nowrap;
  gap: .5rem;
  width: fit-content; max-width: 100%;
  margin: 0 auto 3rem;
  --pad: .4rem;
  padding: var(--pad);
  border-radius: 999px;
  -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px);
  background: rgba(255, 255, 255, .06);
  border: 1px solid rgba(255, 255, 255, .12);
  box-shadow: 0 8px 32px rgba(0, 0, 0, .25), inset 0 1px 0 rgba(255, 255, 255, .06);
  --x: 0px; --w: 0px;
}
.filter-indicator {
  position: absolute; top: var(--pad); bottom: var(--pad); left: 0;
  width: var(--w); transform: translateX(var(--x));
  border-radius: 999px;
  background: linear-gradient(135deg, var(--clr-primary), var(--clr-primary-dark));
  border: 1px solid rgba(255, 255, 255, .18);
  box-shadow: 0 4px 20px var(--clr-glow), inset 0 1px 0 rgba(255, 255, 255, .2);
  transition: transform .5s cubic-bezier(.22, 1, .36, 1), width .5s cubic-bezier(.22, 1, .36, 1);
  will-change: transform, width;
  pointer-events: none;
  z-index: 0;
  opacity: 0;
}
.filter-btn {
  position: relative; z-index: 1;
  padding: .55rem 1.25rem; border-radius: 99px; font-size: .85rem; font-weight: 600;
  cursor: pointer; border: none; background: transparent;
  color: var(--clr-text-muted); transition: color .3s; font-family: inherit;
  white-space: nowrap;
}
.filter-btn:hover { color: var(--clr-white) }
.filter-btn.active { color: var(--clr-white) }
.portfolio-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 330px), 1fr));
  gap: 1.5rem;
  grid-auto-rows: auto;
}
/* Stagger: taller cards span 2 rows, smaller ones span 1 */
.project-card {
  background: rgba(255, 255, 255, .03); border: 1px solid rgba(124, 58, 237, .1);
  border-radius: var(--radius-xl);
  overflow: hidden; transition: background .4s, border-color .4s, transform .4s, box-shadow .4s;
  display: flex; flex-direction: column;
  grid-row: span 1;
}
.project-card.tall { grid-row: span 2 }
.project-card:hover .card-tag { animation: chipBounce .35s ease; animation-delay: calc((sibling-index() - 1) * 0.04s) }
.project-card .card-img { width: 100%; aspect-ratio: 16/9; object-fit: cover; border-bottom: 1px solid rgba(124, 58, 237, .08) }
.project-card .card-body { padding: 1.5rem; flex: 1; display: flex; flex-direction: column }
.project-card .card-tags { display: flex; flex-wrap: wrap; gap: .35rem; margin-bottom: .75rem }
.project-card .card-tag {
  padding: .2rem .65rem; font-size: .7rem; font-weight: 600; border-radius: 99px;
  background: rgba(124, 58, 237, .15); color: var(--clr-primary-light); border: 1px solid rgba(124, 58, 237, .15);
}
.project-card .card-title { font-size: 1.1rem; font-weight: 700; margin-bottom: .5rem; color: var(--clr-white) }
.project-card .card-desc { font-size: .88rem; color: var(--clr-text-muted); line-height: 1.6; flex: 1 }
.project-card .card-links { display: flex; gap: .75rem; margin-top: 1rem; padding-top: 1rem; border-top: 1px solid rgba(255, 255, 255, .04) }
.project-card .card-links a { font-size: .82rem; font-weight: 500; color: var(--clr-primary-light) }
.project-card .card-links a:hover { color: var(--clr-white) }

/* Twistloom card: animated gradient glow border */
.portfolio-grid > .project-card:first-child {
  overflow: visible;
  position: relative;
}
.portfolio-grid > .project-card:first-child .card-body {
  background: rgba(0, 0, 0, .85);
  border-bottom-left-radius: var(--radius-xl);
  border-bottom-right-radius: var(--radius-xl);
}
.portfolio-grid > .project-card:first-child .card-img {
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
}
.portfolio-grid > .project-card:first-child::before {
  content: "";
  position: absolute;
  inset: -3px;
  border-radius: inherit;
  z-index: -1;
  background: conic-gradient(
    from var(--angle),
    transparent 0deg,
    var(--clr-primary) 30deg,
    var(--clr-accent) 60deg,
    var(--clr-primary-light) 90deg,
    transparent 120deg,
    transparent 180deg,
    var(--clr-primary) 210deg,
    var(--clr-accent) 240deg,
    var(--clr-primary-light) 270deg,
    transparent 300deg,
    transparent 360deg
  );
  animation: spin 3s linear infinite;
}
/* .portfolio-grid > .project-card:first-child::after {
  filter: blur(6px);
  opacity: 0.35;
} */
@keyframes spin {
  to { --angle: 360deg; }
}

/* === Skills (Tech Stack) === */
#skills { background: var(--clr-purple-dark); position: relative; display: flex; align-items: center }
#skills .container { width: 100% }
.skills-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 1.5rem }
.skill-category {
  background: rgba(255, 255, 255, .03); border: 1px solid rgba(124, 58, 237, .12);
  border-radius: var(--radius-xl); padding: 2rem;
  overflow: hidden;
  transition: background .4s, border-color .4s, transform .4s, box-shadow .4s;
}
.skill-category:hover .cat-list li { animation: chipBounce .35s ease; animation-delay: calc((sibling-index() - 1) * 0.04s) }

@keyframes chipBounce { 0%, 100% { transform: scale(1) } 50% { transform: scale(1.12) } }

.skill-category:hover,
.project-card:hover { background: rgba(124, 58, 237, .12); border-color: rgba(124, 58, 237, .25); box-shadow: 0 8px 32px rgba(124, 58, 237, .15) }

/* 3D tilt on hover — uses `transform` only, which is independent from the
   `translate` property the stagger entrance animates, so they never conflict. */
[data-stagger] > .skill-category:hover,
[data-stagger] > .project-card:hover,
[data-stagger] > .testimonial-card:hover {
  transform: perspective(900px)
             rotateX(var(--tilt-x)) rotateY(var(--tilt-y))
             translateY(var(--lift, 0));
}
.skill-category:hover { --lift: -4px }
.project-card:hover { --lift: -8px }
.testimonial-card:hover { --lift: -4px }
.skill-category .cat-icon { width: 28px; height: 28px; stroke: var(--clr-primary-light); margin-bottom: 1rem; display: block }
.skill-category .cat-title { font-size: 1.15rem; font-weight: 700; margin-bottom: .15rem }
.skill-category .cat-sub { font-size: .82rem; color: var(--clr-text-dim); margin-bottom: 1rem }
.skill-category .cat-list { list-style: none; display: flex; flex-wrap: wrap; gap: .4rem }
.skill-category .cat-list li {
  padding: .3rem .85rem; font-size: .78rem; border-radius: 99px;
  background: rgba(124, 58, 237, .12); color: var(--clr-primary-light);
  font-weight: 500; border: 1px solid rgba(124, 58, 237, .1);
}

/* === Testimonials === */
#testimonials { padding: 5rem max(1.5rem, 5vw); max-width: var(--max-width); margin: 0 auto }
/* Pure-CSS slider: horizontal scroll-snap carousel (no JS).
   Dots are auto-generated by scroll-marker-group from each card's ::scroll-marker. */
.testimonial-slider {
  position: relative;
  display: flex; align-items: center; gap: 1rem;
  padding-bottom: 2.75rem;
}
.testimonial-track {
  flex: 1 1 0; min-width: 0;
  display: flex;
  /* Real flex gap gives definitive, equal card widths with no manual margins */
  --card-gap: 1.5rem; --per-view: 3;
  gap: var(--card-gap);
  overflow-x: auto; scroll-snap-type: x mandatory;
  scroll-marker-group: after;
  /* breathing room so the 3D tilt + spotlight never get clipped by overflow */
  padding: 1.25rem 1.25rem 2rem;
  scroll-padding: 1.25rem;
  scrollbar-width: none; -ms-overflow-style: none;
}
.testimonial-track::-webkit-scrollbar { display: none; width: 0; height: 0 }
/* Prev / Next circular arrow buttons */
.slider-arrow {
  flex-shrink: 0; width: 48px; height: 48px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: rgba(124, 58, 237, .12); border: 1px solid rgba(124, 58, 237, .25);
  color: var(--clr-primary-light); cursor: pointer;
  transition: background .3s, transform .3s, box-shadow .3s, opacity .3s;
}
.slider-arrow svg { width: 22px; height: 22px; stroke: currentColor }
.slider-arrow:hover {
  background: var(--clr-primary); color: var(--clr-white);
  transform: scale(1.08); box-shadow: 0 6px 20px var(--clr-glow);
}
.slider-arrow:active { transform: scale(.94) }
@media (max-width: 600px) {
  .slider-arrow { display: none }
}
.testimonial-card {
  /* Responsive slides: 3 per view on desktop, 2 on tablet, 1 on mobile.
     Width is computed from the track's own --per-view / --card-gap so every
     card is definitively equal and none is truncated between the arrows. */
  flex: 0 0 calc((100% - var(--card-gap, 1.5rem) * (var(--per-view, 3) - 1)) / var(--per-view, 3));
  scroll-snap-align: start;
  background: linear-gradient(160deg, rgba(124, 58, 237, .04), rgba(20, 0, 46, .8));
  border: 1px solid rgba(124, 58, 237, .08); border-radius: var(--radius-xl);
  /* Fixed, equal height across all cards — no CLS, no per-card differences.
     The 3D tilt uses `transform` only, so it never shifts neighboring cards.
     `contain: layout paint` fully isolates each card's tilt from its siblings. */
  height: 320px;
  contain: layout paint;
  padding: 2rem 1.5rem 1.25rem; position: relative; display: flex; flex-direction: column;
  transition: border-color .4s, transform .4s, box-shadow .4s;
}
/* Auto dot navigation (scroll-marker — Chrome 129+; graceful no-op elsewhere) */
.testimonial-card::scroll-marker {
  content: ""; aspect-ratio: 1; flex: 0 0 auto;
  border-radius: 50%;
  background: rgba(167, 139, 250, .25); border: 3px solid rgba(167, 139, 250, .4);
  transition: transform .25s ease, background .25s ease, border-color .25s ease;
}
.testimonial-card::scroll-marker:hover { transform: scale(1.15); border-color: var(--clr-primary-light) }
.testimonial-card:target-current::scroll-marker,
::scroll-marker:target-current {
  background: var(--clr-primary-light); border-color: var(--clr-primary-light); transform: scale(1.35);
}
/* The marker group is injected as the last flex child of the track; pull it out of
   the flex row and pin it to the bottom-center of the slider instead. */
::scroll-marker-group {
  position: absolute; left: 0; right: 0; bottom: 0;
  display: flex; flex-wrap: wrap; gap: .6em; justify-content: center; align-items: center;
}
.testimonial-card:hover { border-color: rgba(124, 58, 237, .2); box-shadow: 0 8px 32px rgba(124, 58, 237, .08) }
.testimonial-card::before {
  content: '\201C'; position: absolute; top: .75rem; right: 1.5rem;
  font-size: 4rem; line-height: 1; color: var(--clr-primary); opacity: .12; font-weight: 800;
}
/* Content sits at the bottom within the card padding. On hover the block lifts
   a few px and the LinkedIn button fades/slides in. The button always reserves
   its space, so the card height never changes (no CLS). */
.testimonial-card .card-content {
  flex: 1; display: flex; flex-direction: column; justify-content: flex-end;
  transform: translateY(1rem);
  transition: transform .45s cubic-bezier(.22,1,.36,1);
}
.testimonial-card:hover .card-content { transform: translateY(-6px) }

/* === Cursor-follow spotlight border + 3D tilt (Stripe/Plotdrive style) === */
/* The light does NOT snap to the cursor. --mx/--my are registered with
   @property above and interpolated by the transitions below, so the border
   glow trails behind the cursor with smooth inertia — no rAF loop needed. */
[data-stagger] > .skill-category,
[data-stagger] > .project-card,
[data-stagger] > .testimonial-card {
  --mx: 50%; --my: 50%;
  --tilt-x: 0deg; --tilt-y: 0deg;
  position: relative;
  transform-style: preserve-3d;
  will-change: transform;
  /* Merge the cursor-lag transitions with the [data-stagger] entrance + tilt */
  transition:
    --mx .35s cubic-bezier(.22, 1, .36, 1),
    --my .35s cubic-bezier(.22, 1, .36, 1),
    opacity .6s cubic-bezier(.22, 1, .36, 1) calc(var(--i, 0) * .1s),
    translate .6s cubic-bezier(.22, 1, .36, 1) calc(var(--i, 0) * .1s),
    filter .6s cubic-bezier(.22, 1, .36, 1) calc(var(--i, 0) * .1s),
    transform .25s cubic-bezier(.22, 1, .36, 1),
    border-color .4s, background-color .4s, box-shadow .4s;
}
/* Sharp border ring: the radial spotlight is masked down to a 2px border,
   so only the border segment near the light source actually glows. */
.skill-category::after,
.project-card::after,
.testimonial-card::after {
  content: ''; position: absolute; inset: 0; z-index: 3; padding: 2px;
  border-radius: inherit; pointer-events: none; opacity: 0;
  transition: opacity .35s ease;
  background: radial-gradient(140px circle at var(--mx) var(--my),
    rgba(255, 255, 255, .95), rgba(124, 58, 237, .75) 28%, transparent 72%);
  -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;
}
/* Soft blurred bloom glowing from the cursor point, behind the content.
   (Testimonial cards keep ::before for their quote mark, so they get the
   ring only; Twistloom's first card keeps its conic-gradient border.) */
.skill-category::before,
.project-card:not(:first-child)::before {
  content: ''; position: absolute; inset: -15%; z-index: 0; pointer-events: none;
  border-radius: 50%; opacity: 0; transition: opacity .35s ease;
  background: radial-gradient(circle at var(--mx) var(--my), rgba(124, 58, 237, .4), transparent 65%);
  filter: blur(24px);
}
/* Keep interactive content above the bloom (the ring stays on the edge) */
.skill-category > *,
.project-card > *,
.testimonial-card > * { position: relative; z-index: 2 }
/* Slow exit: on hover-off the light stays at its last --mx/--my while the
   opacity fades down over .35s, instead of snapping away. */
.skill-category:hover::after,
.project-card:hover::after,
.testimonial-card:hover::after,
.skill-category:hover::before,
.project-card:not(:first-child):hover::before { opacity: 1 }
.testimonial-card .card-content q { font-style: italic; color: var(--clr-text-muted); font-size: .9rem; line-height: 1.7; display: block; margin-bottom: 1.25rem }
.testimonial-card .attribution { display: flex; align-items: center; gap: .85rem }
.testimonial-card .attribution img { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; border: 2px solid var(--clr-primary); flex-shrink: 0 }
.testimonial-card .attribution-initials {
  width: 40px; height: 40px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: .8rem; font-weight: 700; letter-spacing: .02em;
  color: var(--clr-white); background: linear-gradient(135deg, var(--clr-primary), var(--clr-primary-dark));
  border: 2px solid var(--clr-primary-light);
}
.testimonial-card .attribution > div { flex: 1; min-width: 0; overflow: hidden }
.testimonial-card .attribution .name { font-size: .88rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis }
.testimonial-card .attribution .role { font-size: .75rem; color: var(--clr-text-dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis }

.card-linkedin {
  display: flex; align-items: center; justify-content: center; gap: .5rem;
  margin: .9rem auto 0; padding: .5rem 1.2rem;
  border-radius: 99px; background: rgba(124, 58, 237, .12);
  color: var(--clr-primary-light); font-size: .82rem; font-weight: 600;
  text-decoration: none;
  opacity: 0; transform: translateY(16px); pointer-events: none;
  transition: opacity .35s ease, transform .4s cubic-bezier(.34,1.56,.64,1),
              background .3s ease;
}
.card-linkedin svg { width: 18px; height: 18px; fill: currentColor; flex-shrink: 0 }
/* Delay the button's reveal so the content lift reads first */
.testimonial-card:hover .card-linkedin {
  opacity: 1; transform: translateY(0); pointer-events: auto;
  transition-delay: .18s;
}
.card-linkedin:hover { background: rgba(124, 58, 237, .25); transition-delay: 0s }

/* === Scroll-triggered text highlights (bidirectional) === */
/* Driven by the existing stagger `.visible` class, which the observer now
   toggles both ways: scrolling the card back out resets the highlight, and
   re-entering from the bottom draws it in again. The base rules carry no delay
   so the reverse (leave) is immediate, while the `.visible` rules delay the
   forward draw-in until the card nears screen center. No extra observer.
   --i (card index) and per-span --hl-i / --hl-u-i stagger the reveals.
   Highlight/underline colors are drawn at ~70% opacity via color-mix. */

/* Portfolio cards: marker-style backdrop highlight on key phrases */
.card-desc .hl {
  --hl-i: 0s;
  color: inherit;
  padding: .02em .18em;
  border-radius: .18em;
  background-image: linear-gradient(100deg,
    color-mix(in srgb, var(--clr-primary-dark) 70%, transparent),
    color-mix(in srgb, var(--clr-primary) 70%, transparent));
  background-repeat: no-repeat;
  background-position: 0 78%;
  background-size: 0% 100%;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
  transition:
    background-size 1.15s cubic-bezier(.22,1,.36,1),
    color .5s ease;
}
.card-desc .hl:nth-of-type(2) { --hl-i: .25s }
.card-desc .hl:nth-of-type(3) { --hl-i: .5s }
.project-card.visible .card-desc .hl {
  background-size: 100% 100%;
  color: var(--clr-white);
  transition:
    background-size 1.15s cubic-bezier(.22,1,.36,1) calc(1s + var(--i, 0) * .1s + var(--hl-i)),
    color .5s ease calc(1s + var(--i, 0) * .1s + var(--hl-i));
}

/* Testimonial cards: animated underline on key phrases */
.card-content q .hl-u {
  --hl-u-i: 0s;
  position: relative;
  color: inherit;
  transition: color .5s ease;
}
.card-content q .hl-u::after {
  content: '';
  position: absolute;
  left: 0; right: 0; bottom: .05em;
  height: .18em;
  border-radius: .1em;
  background: linear-gradient(90deg,
    color-mix(in srgb, var(--clr-primary-light) 70%, transparent),
    color-mix(in srgb, var(--clr-accent) 70%, transparent));
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 1.05s cubic-bezier(.22,1,.36,1);
}
.card-content q .hl-u:nth-of-type(2) { --hl-u-i: .3s }
.card-content q .hl-u:nth-of-type(3) { --hl-u-i: .6s }
.testimonial-card.visible .card-content q .hl-u::after {
  transform: scaleX(1);
  transition: transform 1.05s cubic-bezier(.22,1,.36,1) calc(1s + var(--i, 0) * .1s + var(--hl-u-i));
}
.testimonial-card.visible .card-content q .hl-u {
  color: var(--clr-white);
  transition: color .5s ease calc(1s + var(--i, 0) * .1s + var(--hl-u-i));
}

/* === FAQ === */
/* Smooth auto-height animation for <details> (modern browsers) */
html { interpolate-size: allow-keywords; }
#faq { padding: 5rem max(1.5rem, 5vw); max-width: 820px; margin: 0 auto }
.faq-list { display: flex; flex-direction: column; gap: 1rem }
.faq-item {
  background: linear-gradient(160deg, rgba(124, 58, 237, .04), rgba(20, 0, 46, .8));
  border: 1px solid rgba(124, 58, 237, .08); border-radius: var(--radius-xl);
  overflow: hidden; transition: border-color .4s, box-shadow .4s, transform .4s;
}
.faq-item:hover { border-color: rgba(124, 58, 237, .2); transform: translateY(-2px); box-shadow: 0 8px 32px rgba(124, 58, 237, .08) }
.faq-item[open] { border-color: rgba(124, 58, 237, .25) }
.faq-q {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: 1.25rem 1.5rem; cursor: pointer; list-style: none; user-select: none;
  font-weight: 600; font-size: clamp(.95rem, 1.6vw, 1.05rem); color: var(--clr-text);
  transition: color .3s;
}
.faq-q::-webkit-details-marker { display: none }
.faq-item[open] .faq-q { color: var(--clr-primary-light) }
.faq-q > span:first-child { flex: 1; min-width: 0 }
.faq-icon { position: relative; width: 22px; height: 22px; flex-shrink: 0; transition: transform .4s cubic-bezier(.34,1.56,.64,1) }
.faq-icon::before, .faq-icon::after {
  content: ''; position: absolute; top: 50%; left: 50%; background: var(--clr-primary-light);
  border-radius: 2px; transform: translate(-50%, -50%); transition: opacity .3s, transform .4s cubic-bezier(.34,1.56,.64,1);
}
.faq-icon::before { width: 16px; height: 2px }
.faq-icon::after { width: 2px; height: 16px }
.faq-item[open] .faq-icon { transform: rotate(135deg) }
/* Modern: animate native details-content to/from auto height */
.faq-item::details-content {
  height: 0; overflow: hidden;
  transition: height .35s cubic-bezier(.22,1,.36,1), content-visibility .35s allow-discrete;
}
.faq-item[open]::details-content { height: auto; }
/* Fallback: grid-rows trick for browsers without ::details-content support */
@supports not (height: calc(0px + 1lh)) {
  .faq-a { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .45s cubic-bezier(.22,1,.36,1) }
  .faq-item[open] .faq-a { grid-template-rows: 1fr }
}
.faq-a > p {
  overflow: hidden; margin: 0; padding: 0 1.5rem;
  color: var(--clr-text-muted); font-size: .92rem; line-height: 1.7;
  opacity: 0; transform: translateY(8px); transition: opacity .4s ease .1s, transform .4s ease .1s, padding .45s cubic-bezier(.22,1,.36,1);
}
.faq-item[open] .faq-a > p { opacity: 1; transform: translateY(0); padding-bottom: 1.5rem }

/* === CTA === */
#cta { text-align: center; padding: 5rem max(1.5rem, 5vw); background: radial-gradient(ellipse 80% 50% at 50% 100%, var(--clr-purple-deep), transparent) }
#cta h2 { font-size: clamp(1.75rem, 4vw, 3rem); font-weight: 800; margin-bottom: .75rem }
#cta p { color: var(--clr-text-muted); max-width: 480px; margin: 0 auto 2rem auto; font-size: 1.05rem }
.cta-actions { display: flex; justify-content: center; gap: 1rem; flex-wrap: wrap }
/* CTA buttons: fit text, expand width on hover */
.cta-linkedin, .cta-github { display: inline-flex; align-items: center; gap: 0 }
.cta-linkedin .cta-btn-icon, .cta-github .cta-btn-icon { width: 0; height: 20px; opacity: 0; transform: translateX(-8px); transition: all .35s ease; flex-shrink: 0; overflow: hidden }
.cta-linkedin:hover .cta-btn-icon, .cta-github:hover .cta-btn-icon { width: 20px; opacity: 1; transform: translateX(0); margin-left: .5rem }
.cta-linkedin:hover, .cta-github:hover { transform: none }

/* === Sticky footer reveal === */
.main-wrapper {
  position: relative; z-index: 1;
  background: var(--clr-bg);
  min-height: 100vh;
  margin-bottom: var(--footer-h, 220px);
}
#footer {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 0;
  background: var(--clr-purple-dark);
  border-top: 1px solid rgba(124, 58, 237, .1);
  padding: 3rem max(1.5rem, 5vw) 1.5rem;
}
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 2rem; max-width: var(--max-width); margin: 0 auto }
.footer-brand p { color: var(--clr-text-muted); font-size: .85rem; max-width: 320px; margin-top: .5rem }
.footer-col h4 { font-size: .85rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--clr-text-dim); margin-bottom: 1rem }
.footer-col ul { list-style: none }
.footer-col ul li { margin-bottom: .5rem }
.footer-col ul a { font-size: .85rem; color: var(--clr-text-muted); transition: color .3s }
.footer-col ul a:hover { color: var(--clr-primary-light) }
.footer-bottom {
  margin-top: 2rem; border-top: 1px solid rgba(124, 58, 237, .08);
  font-size: .8rem; color: var(--clr-text-dim); text-align: left;
  max-width: var(--max-width); margin-left: auto; margin-right: auto;
  padding: 2rem 4rem;
  text-align: center;
}
.footer-socials { display: flex; gap: .6rem; margin: 1rem 0 }
.footer-socials a {
  display: flex; align-items: center; justify-content: center; width: 36px; height: 36px;
  border-radius: 50%; background: rgba(124, 58, 237, .1); transition: all .3s;
}
.footer-socials a:hover { background: var(--clr-primary); transform: translateY(-2px) }
.footer-socials svg { width: 16px; height: 16px; fill: var(--clr-text-muted) }
.footer-socials a:hover svg { fill: var(--clr-white) }

/* === Scroll to top (pure CSS, scroll-driven) === */
.scroll-top {
  position: fixed; bottom: 2rem; right: 2rem; z-index: 999; width: 48px; height: 48px;
  border-radius: 50%; background: linear-gradient(135deg, var(--clr-primary), #9333ea);
  display: grid; place-items: center;
  box-shadow: 0 4px 20px var(--clr-glow); opacity: 0; pointer-events: none;
  animation: showScrollTop linear both;
  animation-timeline: scroll(root);
  animation-range: 100vh 120vh;
  transition: margin-bottom .4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.scroll-top-arrow { width: 22px; height: 22px; stroke: var(--clr-white); position: relative; z-index: 1 }
.scroll-top:hover { margin-bottom: 4px; box-shadow: 0 6px 28px var(--clr-glow) }
@keyframes showScrollTop {
  from { opacity: 0; transform: translateY(12px); pointer-events: none }
  to { opacity: 1; transform: translateY(0); pointer-events: auto }
}
/* Circular progress ring */
.scroll-top-ring { position: absolute; inset: -2px; transform: rotate(-90deg); pointer-events: none }
.ring-bg { fill: none; stroke: rgba(255,255,255,.15); stroke-width: 3 }
.ring-progress {
  fill: none; stroke: var(--clr-white); stroke-width: 3; stroke-linecap: round;
  stroke-dasharray: 158; stroke-dashoffset: 158;
  animation: drawRing linear both;
  animation-timeline: scroll(root);
}
@keyframes drawRing {
  from { stroke-dashoffset: 158 }
  to { stroke-dashoffset: 0 }
}

/* === Animations === */
@keyframes fadeInUp { from { opacity: 0; transform: translateY(40px) } to { opacity: 1; transform: translateY(0) } }
@keyframes fadeInDown { from { opacity: 0; transform: translateY(-30px) } to { opacity: 1; transform: translateY(0) } }
@keyframes fadeInLeft { from { opacity: 0; transform: translateX(-40px) } to { opacity: 1; transform: translateX(0) } }
@keyframes fadeInRight { from { opacity: 0; transform: translateX(40px) } to { opacity: 1; transform: translateX(0) } }
@keyframes fadeInScale { from { opacity: 0; transform: scale(.85) } to { opacity: 1; transform: scale(1) } }
@keyframes zoomIn { from { opacity: 0; transform: scale(.7) rotate(-2deg) } to { opacity: 1; transform: scale(1) rotate(0) } }
@keyframes slideUpBlur { from { opacity: 0; transform: translateY(60px); filter: blur(8px) } to { opacity: 1; transform: translateY(0); filter: blur(0) } }

/* Hero entrance: sequential slide-up blur-to-focus for badge, title,
   description, buttons and socials. Pure CSS, runs once on load. */
.hero-content > * {
  opacity: 0;
  animation: slideUpBlur .7s cubic-bezier(.22,1,.36,1) forwards;
}
.hero-content > *:nth-child(1) { animation-delay: .1s }
.hero-content > *:nth-child(2) { animation-delay: .25s }
.hero-content > *:nth-child(3) { animation-delay: .4s }
.hero-content > *:nth-child(4) { animation-delay: .55s }
.hero-content > *:nth-child(5) { animation-delay: .7s }

/* Default entrance: fade + slide up */
[data-anim] { opacity: 0; transform: translateY(40px); transition: opacity .7s cubic-bezier(.22,1,.36,1), transform .7s cubic-bezier(.22,1,.36,1) }
[data-anim].visible { opacity: 1; transform: translateY(0) }
[data-anim='scale'] { transform: scale(.85) }
[data-anim='scale'].visible { transform: scale(1) }
[data-anim='left'] { transform: translateX(-40px) }
[data-anim='left'].visible { transform: translateX(0) }
[data-anim='right'] { transform: translateX(40px) }
[data-anim='right'].visible { transform: translateX(0) }
[data-anim='zoom'] { transform: scale(.7) rotate(-2deg) }
[data-anim='zoom'].visible { transform: scale(1) rotate(0) }
[data-anim='blur'] { filter: blur(8px); transform: translateY(40px) }
[data-anim='blur'].visible { filter: blur(0); transform: translateY(0) }
[data-anim='down'] { transform: translateY(-30px) }
[data-anim='down'].visible { transform: translateY(0) }

/* Staggered children: each child delays by its index.
   Uses the independent `translate` property for the entrance so it NEVER collides
   with the 3D `transform` tilt applied on hover (separate properties). */
[data-stagger] > * {
  opacity: 0; translate: 0 30px; filter: blur(8px);
  transition: opacity .6s cubic-bezier(.22,1,.36,1) calc(var(--i,0) * 0.1s),
              translate .6s cubic-bezier(.22,1,.36,1) calc(var(--i,0) * 0.1s),
              filter .6s cubic-bezier(.22,1,.36,1) calc(var(--i,0) * 0.1s),
              transform .25s cubic-bezier(.22,1,.36,1);
}
[data-stagger].visible > *,
[data-stagger] > *.visible { opacity: 1; translate: 0 0; filter: blur(0) }

/* Different speed parallax on scroll for sections */
#tech-stack { view-timeline-name: --tech; animation: parallaxFade linear; animation-timeline: view(); animation-range: entry 0% entry 60% }
@keyframes parallaxFade { from { opacity: .6; transform: translateY(20px) } to { opacity: 1; transform: translateY(0) } }

/* View-timeline powered: Chrome 115+ */
@supports (animation-timeline: view()) {
  [data-anim='timeline'] { animation: fadeInUp .7s ease forwards; animation-timeline: view(); animation-range: entry 0% entry 40% }
  [data-anim='scale-timeline'] { animation: fadeInScale .7s ease forwards; animation-timeline: view(); animation-range: entry 0% entry 40% }
  [data-anim='left-timeline'] { animation: fadeInLeft .7s ease forwards; animation-timeline: view(); animation-range: entry 0% entry 35% }
  [data-anim='right-timeline'] { animation: fadeInRight .7s ease forwards; animation-timeline: view(); animation-range: entry 0% entry 35% }
  [data-anim='blur-timeline'] { animation: slideUpBlur .8s ease forwards; animation-timeline: view(); animation-range: entry 0% entry 40% }
}

/* === Typewriter section title (Featured Work) === */
.section-title--tw {
  background: none !important;
  -webkit-text-fill-color: initial !important;
}
.tw-wrap {
  display: inline-grid;
  position: relative;
  height: 1.15em;
  line-height: 1.15;
  vertical-align: bottom;
}
.tw-text {
  grid-area: 1/1; justify-self: start;
  white-space: nowrap; overflow: hidden;
  width: max-content; max-width: 0;
  border-right: .12em solid transparent;
  background: linear-gradient(135deg, var(--clr-white), var(--clr-primary-light));
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
  animation:
    twType 12s steps(80,end) infinite,
    twState 12s step-end infinite,
    twCaret 1s step-end infinite;
}
.tw-text:nth-child(1) { animation-delay: 0s, 0s, 0s }
.tw-text:nth-child(2) { animation-delay: 4s, 4s, 4s }
.tw-text:nth-child(3) { animation-delay: 8s, 8s, 8s }
@keyframes twType {
  0%, 2%   { max-width: 0 }
  24%      { max-width: 500px }
  28%      { max-width: 500px }
  32%      { max-width: 0 }
  100%     { max-width: 0 }
}
@keyframes twState {
  0%, 2%   { border-color: transparent }
  2.01%    { border-color: var(--clr-primary-light) }
  32%      { border-color: var(--clr-primary-light) }
  32.01%   { border-color: transparent }
  100%     { border-color: transparent }
}
@keyframes twCaret {
  50% { border-color: transparent }
}

/* === Responsive === */
@media (max-width: 768px) {
  #hero { padding-top: calc(var(--nav-height) + 1.5rem); text-align: center }
  .hero-grid { grid-template-columns: 1fr; gap: 2rem; width: 100% }
  .hero-content { align-items: center }
  .hero-actions, .hero-socials { justify-content: center }
  .hero-actions { flex-wrap: wrap }
  .hero-visual { order: -1 }
  .hero-visual .profile-wrapper { width: clamp(160px, 40vw, 220px) }
  .main-wrapper { margin-bottom: 0 }
  .scroll-indicator { display: none }
  .btn-primary { justify-content: center }
  .btn-primary .btn-text { padding: .6rem 0 }
  .btn-primary .btn-marquee { padding: 0 .75rem 0 .4rem }
  .portfolio-btn { padding-right: 0 }
  .btn-marquee img { width: 32px; height: 32px }
  .footer-grid { grid-template-columns: 1fr; gap: 1.5rem; text-align: center }
  .footer-brand p { margin-left: auto; margin-right: auto }
  .footer-brand .footer-socials { justify-content: center }
  .portfolio-grid { grid-template-columns: 1fr; grid-auto-rows: auto }
  .project-card.tall { grid-row: span 1 }
  .skills-grid { grid-template-columns: 1fr 1fr }
  #footer { height: auto; position: relative }
  #testimonials { padding: 3rem 1rem }
  #faq { padding: 3rem 1rem }
  /* Slider: 2 slides per view on tablet */
  .testimonial-track { --per-view: 2; --card-gap: 1rem }
}
@media (max-width: 480px) {
  .skills-grid { grid-template-columns: 1fr }
  .section { padding: 3rem 1rem }
  .hero-name { font-size: clamp(1.6rem, 8vw, 2.2rem) }
  .hero-title { font-size: .95rem }
  /* Segmented filter: tighten so all tabs stay on one line and the pill stays aligned */
  .portfolio-filter { --pad: .3rem; gap: .3rem; padding: .3rem }
  .filter-btn { padding: .5rem .9rem; font-size: .8rem }
  /* Slider: 1 slide per view on mobile */
  .testimonial-track { --per-view: 1; --card-gap: 1rem }
  #stats { padding: 2rem 1rem }
  .stat-item { padding: 1rem .75rem }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important }
  .tech-track { animation: none }
  [data-anim] { opacity: 1 !important; transform: none !important }
}
