﻿/* ========================================
   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: 'Inter', system-ui, -apple-system, sans-serif;
  --max-width: 1200px;
  --nav-height: 64px;
  --parallax-x: 0px;
  --parallax-y: 0px;
}

/* === 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-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;
}
.btn-primary { background: var(--clr-primary); color: var(--clr-white) }
.btn-primary:hover {
  background: var(--clr-primary-light); transform: translateY(-2px);
  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 { background: var(--clr-primary); border-color: var(--clr-primary); transform: translateY(-2px) }

/* === 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);
}
#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-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 3rem;
  align-items: center; position: relative; z-index: 1;
}
/* 3D tilt on portfolio button based on mouse position */
.portfolio-btn { transform: perspective(800px) rotateX(var(--rotate-x, 0deg)) rotateY(var(--rotate-y, 0deg)); transition: transform 0.15s ease-out }
.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(135deg, var(--clr-primary-light), var(--clr-white));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}
.hero-title {
  font-size: clamp(1rem, 2vw, 1.35rem); 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 }
.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 .3s ease }
.portfolio-btn.btn-primary:hover { background-position: 100% 50%; box-shadow: 0 8px 32px var(--clr-glow); transform: translateY(-2px) }
.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 }
.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: 100px; height: 100px; 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,rgba(124,58,237,.12) 0%,rgba(124,58,237,.04) 40%,transparent 70%);
  border: 1.5px solid rgba(124,58,237,.12);
  box-shadow: 0 0 30px rgba(124,58,237,.08), inset 0 0 30px rgba(124,58,237,.04);
  -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px);
  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 === */
#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 }
.stat-plus { font-size: clamp(1rem, 1.5vw, 1.25rem); color: var(--clr-primary-light) }
.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) === */
#portfolio { background: var(--clr-bg) }
.portfolio-filter { display: flex; justify-content: center; gap: .5rem; flex-wrap: wrap; margin-bottom: 3rem }
.filter-btn {
  padding: .5rem 1.25rem; border-radius: 99px; font-size: .85rem; font-weight: 500;
  cursor: pointer; border: 1px solid rgba(124, 58, 237, .2); background: transparent;
  color: var(--clr-text-muted); transition: all .3s; font-family: inherit;
}
.filter-btn.active, .filter-btn:hover { background: var(--clr-primary); border-color: var(--clr-primary); 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) }

/* === 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;
  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) }

.skill-category:hover { transform: translateY(-4px) }
.project-card:hover { transform: translateY(-8px) }
.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 }
.testimonial-track { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 1.5rem }
.testimonial-card {
  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);
  padding: 2rem 2rem 1rem; position: relative; display: flex; flex-direction: column;
  transition: border-color .4s, transform .4s, box-shadow .4s;
}
.testimonial-card:hover { border-color: rgba(124, 58, 237, .2); transform: translateY(-4px); 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;
}
.testimonial-card .card-content { flex: 1; transition: transform .4s cubic-bezier(.22,1,.36,1); transform: translateY(40px); }
.testimonial-card:hover .card-content { transform: translateY(-10px) }
.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 > 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: 0 auto; margin-top: .75rem; 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(8px);
  transition: all .35s cubic-bezier(.34,1.56,.64,1);
}
.card-linkedin svg { width: 18px; height: 18px; fill: currentColor; flex-shrink: 0 }
.testimonial-card:hover .card-linkedin { opacity: 1; transform: translateY(0) }
.card-linkedin:hover { background: rgba(124, 58, 237, .25) }

/* === 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) } }

/* 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 */
[data-stagger] > * { opacity: 0; transform: translateY(30px); filter: blur(8px); transition: opacity .6s cubic-bezier(.22,1,.36,1) calc(var(--i,0) * 0.1s), transform .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) }
[data-stagger].visible > *,
[data-stagger] > *.visible { opacity: 1; transform: translateY(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% }
}

/* === 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 }
}
@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 }
  #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 }
}
