:root {
  --bg: #0b0d17;
  --bg-2: #11142280;
  --card: #141829;
  --border: #23284099;
  --text: #e6e8f2;
  --muted: #9aa0b8;
  --accent: #667eea;
  --accent-2: #a855f7;
  --green: #22c55e;
  --grad: linear-gradient(135deg, var(--accent), var(--accent-2));
  --radius: 16px;
  --shadow: 0 10px 40px -12px rgba(102, 126, 234, 0.35);
}
:root[data-theme="light"] {
  --bg: #f6f7fb;
  --bg-2: #ffffffb3;
  --card: #ffffff;
  --border: #dfe2ee;
  --text: #161a2e;
  --muted: #5b6180;
  --shadow: 0 10px 30px -12px rgba(102, 126, 234, 0.3);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; scroll-padding-top: 80px; }
/* stop wide decorations (orbit, glows) from making phones scroll sideways; clip keeps sticky/fixed working */
html, body { overflow-x: clip; }
body {
  font-family: "Inter", system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  overflow-x: hidden;
  transition: background 0.3s, color 0.3s;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
b { color: var(--text); font-weight: 600; }
h1, h2, h3 { font-family: "Space Grotesk", sans-serif; line-height: 1.2; }

/* background */
.bg-grid {
  position: fixed; inset: 0; z-index: -2; pointer-events: none;
  background-image:
    linear-gradient(var(--border) 1px, transparent 1px),
    linear-gradient(90deg, var(--border) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse at top, #000 20%, transparent 70%);
  opacity: 0.5;
}
.bg-glow {
  position: fixed; z-index: -1; pointer-events: none;
  width: 600px; height: 600px; border-radius: 50%;
  background: radial-gradient(circle, rgba(102,126,234,0.18), transparent 60%);
  top: -200px; left: 50%; transform: translateX(-50%);
}

/* nav */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px clamp(16px, 5vw, 64px);
  transition: background 0.3s, border-color 0.3s;
  border-bottom: 1px solid transparent;
}
.nav.scrolled { background: var(--bg-2); backdrop-filter: blur(14px); border-color: var(--border); }
.logo { font-family: "Space Grotesk"; font-weight: 700; font-size: 1.5rem; }
.logo span { color: var(--accent); }
.nav-links { display: flex; gap: 26px; }
.nav-links a { color: var(--muted); font-size: 0.92rem; font-weight: 500; position: relative; transition: color 0.2s; }
.nav-links a::after {
  content: ""; position: absolute; left: 0; bottom: -4px; height: 2px; width: 0;
  background: var(--grad); transition: width 0.25s;
}
.nav-links a:hover, .nav-links a.active { color: var(--text); }
.nav-links a.active::after, .nav-links a:hover::after { width: 100%; }
.nav-actions { display: flex; gap: 10px; align-items: center; }
.icon-btn {
  width: 38px; height: 38px; display: grid; place-items: center;
  border-radius: 10px; border: 1px solid var(--border); background: var(--card);
  color: var(--text); cursor: pointer; transition: border-color 0.2s, transform 0.2s;
}
.icon-btn:hover { border-color: var(--accent); transform: translateY(-2px); }
.icon-btn svg { width: 18px; height: 18px; }
.menu-btn { display: none; }

/* buttons */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 24px; border-radius: 12px; font-weight: 600; font-size: 0.95rem;
  border: 1px solid transparent; cursor: pointer; transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
  font-family: inherit;
}
.btn-sm { padding: 8px 16px; font-size: 0.85rem; }
.btn-primary { background: var(--grad); color: #fff; }
.btn-primary:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.btn-ghost { border-color: var(--border); background: var(--card); }
.btn-ghost:hover { border-color: var(--accent); transform: translateY(-2px); }

/* hero */
.hero {
  min-height: 100vh; display: grid; grid-template-columns: 1.3fr 1fr; align-items: center; gap: 48px;
  padding: 110px clamp(16px, 5vw, 64px) 60px; max-width: 1200px; margin: 0 auto; position: relative;
}
.badge {
  display: inline-flex; align-items: center; gap: 8px; font-size: 0.8rem; font-weight: 600;
  padding: 6px 14px; border-radius: 999px; color: var(--green);
  background: rgba(34,197,94,0.1); border: 1px solid rgba(34,197,94,0.3);
}
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green); animation: pulse 1.8s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(34,197,94,0.6); } 100% { box-shadow: 0 0 0 10px rgba(34,197,94,0); } }
.hello { margin-top: 22px; color: var(--muted); font-size: 1.15rem; }
.hero-name {
  font-size: clamp(2.6rem, 7vw, 4.6rem); font-weight: 700; letter-spacing: -0.02em;
  background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero-role { font-family: "Space Grotesk"; font-size: clamp(1.2rem, 3vw, 1.7rem); font-weight: 600; margin: 6px 0 16px; min-height: 1.5em; }
.caret { color: var(--accent); animation: blink 1s steps(1) infinite; margin-left: 2px; }
@keyframes blink { 50% { opacity: 0; } }
.hero-tagline { color: var(--muted); max-width: 560px; font-size: 1.05rem; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 22px 0; }
.chip {
  font-size: 0.78rem; padding: 5px 12px; border-radius: 999px;
  border: 1px solid var(--border); background: var(--card); color: var(--muted);
}
.cta { display: flex; gap: 12px; flex-wrap: wrap; }
.socials { display: flex; gap: 10px; margin-top: 26px; }
.hero-photo { display: flex; justify-content: center; }.photo-ring {
  width: min(360px, 80vw); aspect-ratio: 1; border-radius: 50%; padding: 5px;
  background: var(--grad); box-shadow: var(--shadow); animation: float 6s ease-in-out infinite;
}
.photo-ring img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; background: var(--card); }
@keyframes float { 50% { transform: translateY(-14px); } }
.scroll-cue {
  position: absolute; bottom: 24px; left: 50%; transform: translateX(-50%);
  font-size: 0.75rem; color: var(--muted); display: flex; flex-direction: column; align-items: center; gap: 6px;
  letter-spacing: 0.15em; text-transform: uppercase;
}
.scroll-cue span { width: 20px; height: 32px; border: 2px solid var(--muted); border-radius: 12px; position: relative; }
.scroll-cue span::after {
  content: ""; position: absolute; left: 50%; top: 6px; width: 4px; height: 6px; margin-left: -2px;
  border-radius: 2px; background: var(--accent); animation: wheel 1.6s infinite;
}
@keyframes wheel { to { transform: translateY(10px); opacity: 0; } }

/* sections */
.section { max-width: 1200px; margin: 0 auto; padding: 90px clamp(16px, 5vw, 64px); }
.section-title { font-size: clamp(2rem, 4.5vw, 2.8rem); margin-bottom: 14px; text-align: center; }
.section-title span { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.section-sub { text-align: center; color: var(--muted); margin-bottom: 40px; }
.section-title + :not(.section-sub) { margin-top: 40px; }
.card {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 26px; transition: transform 0.25s, border-color 0.25s, box-shadow 0.25s;
}
.card.hover:hover { transform: translateY(-6px); border-color: var(--accent); box-shadow: var(--shadow); }

/* about */
.about-grid { display: grid; grid-template-columns: 1.6fr 1fr; gap: 32px; align-items: start; }
.about-text p { color: var(--muted); margin-bottom: 14px; font-size: 1.05rem; }
.info-list { list-style: none; display: grid; gap: 12px; }
.info-list li { display: flex; gap: 12px; align-items: center; color: var(--muted); font-size: 0.95rem; word-break: break-word; }
.info-list svg, .contact-item svg { width: 18px; height: 18px; color: var(--accent); flex-shrink: 0; }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; margin: 40px 0; }
.stat { text-align: center; }
.stat .num {
  font-family: "Space Grotesk"; font-size: 2.6rem; font-weight: 700;
  background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.stat .lbl { color: var(--muted); font-size: 0.88rem; }
.link-arrow { display: inline-block; margin-top: 16px; color: var(--accent); font-weight: 600; }

/* timeline */
.timeline { position: relative; display: grid; gap: 28px; padding-left: 30px; }
.timeline::before { content: ""; position: absolute; left: 7px; top: 8px; bottom: 8px; width: 2px; background: linear-gradient(var(--accent), transparent); }
.tl-item { position: relative; }
.tl-item::before {
  content: ""; position: absolute; left: -30px; top: 30px; width: 16px; height: 16px; border-radius: 50%;
  background: var(--bg); border: 3px solid var(--accent);
}
.tl-head { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; }
.tl-head h3 { font-size: 1.25rem; }
.company { color: var(--accent); font-weight: 600; }
.period { color: var(--muted); font-size: 0.85rem; text-align: right; }
.tl-item .summary { color: var(--muted); margin: 10px 0; }
.tl-item ul { padding-left: 18px; color: var(--muted); display: grid; gap: 6px; }
.tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.tag {
  font-size: 0.75rem; padding: 4px 10px; border-radius: 8px; font-weight: 500;
  background: rgba(102,126,234,0.12); color: var(--accent); border: 1px solid rgba(102,126,234,0.25);
}

/* skills */
.skills-grid h3 { margin-bottom: 16px; font-size: 1.1rem; }
.skill-list { display: flex; flex-wrap: wrap; gap: 10px; }
.skill {
  display: flex; align-items: center; gap: 8px; padding: 7px 12px; border-radius: 10px;
  border: 1px solid var(--border); font-size: 0.88rem; transition: border-color 0.2s, transform 0.2s;
}
.skill:hover { border-color: var(--accent); transform: translateY(-2px); }
.skill-ico-img { width: 22px; height: 22px; border-radius: 5px; }
/* tile matches skillicons.dev style so every logo looks consistent */
.skill-ico {
  width: 22px; height: 22px; border-radius: 5px; background: #242938; flex-shrink: 0;
  display: grid; place-items: center; padding: 4px;
}
.skill-ico img { width: 100%; height: 100%; object-fit: contain; }
.skill-ico.glyph { color: #8b9cf5; padding: 3px; }
.skill-ico.glyph svg { width: 100%; height: 100%; }

/* projects */
.filters { display: flex; justify-content: center; flex-wrap: wrap; gap: 10px; margin-bottom: 36px; }
.filter {
  padding: 8px 18px; border-radius: 999px; border: 1px solid var(--border); background: var(--card);
  color: var(--muted); cursor: pointer; font: inherit; font-size: 0.88rem; font-weight: 500; transition: all 0.2s;
}
.filter.active, .filter:hover { background: var(--grad); color: #fff; border-color: transparent; }
.projects-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 22px; }
.project { display: flex; flex-direction: column; }
.project.hide { display: none; }
.project-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.folder { width: 42px; height: 42px; color: var(--accent); }
.project-links { display: flex; gap: 12px; }
.project-links a { color: var(--muted); transition: color 0.2s; }
.project-links a:hover { color: var(--accent); }
.project-links svg { width: 20px; height: 20px; }
/* labeled demo / code links */
.project-links { gap: 16px; }
.project-links a { display: inline-flex; align-items: center; gap: 6px; font-size: 0.85rem; font-weight: 600; }
.project-links svg { width: 16px; height: 16px; }
/* descriptions: clamp to 4 lines, "Read more" expands */
.project .pdesc { flex: none; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 4; line-clamp: 4; overflow: hidden; }
.project .pdesc.open { display: block; -webkit-line-clamp: unset; line-clamp: none; }
.more-btn {
  align-self: flex-start; margin-top: 6px; padding: 0; border: 0; background: none; cursor: pointer;
  font: inherit; font-size: 0.85rem; font-weight: 600; color: var(--accent);
}
.more-btn:hover { text-decoration: underline; }
.project-body > .tags { margin-top: auto; padding-top: 16px; }
.more-projects { display: flex; justify-content: center; margin-top: 32px; }
.more-projects .btn { color: var(--text); }
.more-projects[hidden] { display: none; }
.project h3 { font-size: 1.2rem; margin-bottom: 8px; }
.project .cat { font-size: 0.75rem; color: var(--accent); text-transform: uppercase; letter-spacing: 0.1em; font-weight: 600; }
.project p { color: var(--muted); flex: 1; margin-top: 8px; }

/* certs */
.cert-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 20px; }
.cert { display: flex; gap: 16px; align-items: flex-start; }
.cert-icon {
  width: 46px; height: 46px; flex-shrink: 0; border-radius: 12px; display: grid; place-items: center;
  background: rgba(102,126,234,0.12); color: var(--accent);
}
.cert-icon svg { width: 22px; height: 22px; }
.cert h3 { font-size: 1rem; }
.cert p { color: var(--muted); font-size: 0.85rem; }
.cert .cert-date { color: var(--accent); font-size: 0.75rem; font-weight: 600; margin-top: 4px; }
.cert .top { font-size: 0.7rem; font-weight: 700; color: #f59e0b; background: rgba(245,158,11,0.12); padding: 2px 8px; border-radius: 6px; margin-left: 6px; }

/* contact */
.contact-grid { display: grid; grid-template-columns: 1fr 1.4fr; gap: 28px; }
.contact-info { display: grid; gap: 14px; align-content: start; }
.contact-item { display: flex; gap: 14px; align-items: center; }
.contact-item .cert-icon { width: 44px; height: 44px; }
.contact-item small { color: var(--muted); display: block; font-size: 0.78rem; }
.contact-item span { word-break: break-word; }
.contact-form { display: grid; gap: 16px; }
.contact-form .row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.contact-form label { display: grid; gap: 6px; font-size: 0.85rem; color: var(--muted); font-weight: 500; }
.contact-form input, .contact-form textarea {
  font: inherit; color: var(--text); background: var(--bg); border: 1px solid var(--border);
  border-radius: 10px; padding: 12px 14px; resize: vertical; transition: border-color 0.2s;
}
.contact-form input:focus, .contact-form textarea:focus { outline: none; border-color: var(--accent); }
.contact-form .btn { justify-self: start; }

/* footer */
.footer {
  max-width: 1200px; margin: 0 auto; padding: 30px clamp(16px, 5vw, 64px);
  display: flex; justify-content: space-between; align-items: center;
  border-top: 1px solid var(--border); color: var(--muted); font-size: 0.9rem;
}

/* reveal on scroll */
.reveal { opacity: 0; transform: translateY(30px); transition: opacity 0.7s ease, transform 0.7s ease; }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  * { animation: none !important; }
}

/* responsive */
@media (max-width: 960px) {
  .nav-links {
    position: fixed; top: 66px; left: 16px; right: 16px; flex-direction: column; gap: 0;
    background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
    padding: 8px; display: none; box-shadow: var(--shadow);
  }
  .nav-links.open { display: flex; }
  .nav-links a { padding: 12px 14px; }
  .nav-links a::after { display: none; }
  .menu-btn { display: grid; }
  .hero { grid-template-columns: minmax(0, 1fr); text-align: center; padding-top: 100px; }
  .hero > * { min-width: 0; }
  .hero-photo { order: -1; }
  .photo-ring { width: min(240px, 60vw); }
  .hero-tagline { margin: 0 auto; }
  .chips, .cta, .socials { justify-content: center; }
  .about-grid, .contact-grid { grid-template-columns: 1fr; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .scroll-cue { display: none; }
}
@media (max-width: 560px) {
  .contact-form .row { grid-template-columns: 1fr; }
  .period { text-align: left; }
  .projects-grid, .cert-grid { grid-template-columns: 1fr; }
  #resumeBtn { padding: 7px 12px; }
}

/* =========================================================
   VISUAL UPGRADE
   ========================================================= */

/* scroll progress bar */
.progress {
  position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 100;
  background: var(--grad); transform-origin: 0 50%; transform: scaleX(0);
}

/* floating aurora blobs */
.blobs { position: fixed; inset: 0; z-index: -1; pointer-events: none; overflow: hidden; }
.blobs span {
  position: absolute; width: 42vmax; height: 42vmax; border-radius: 50%;
  filter: blur(90px); opacity: 0.16; animation: drift 26s ease-in-out infinite alternate;
}
.blobs span:nth-child(1) { background: #667eea; top: -12vmax; left: -10vmax; }
.blobs span:nth-child(2) { background: #a855f7; top: 30%; right: -16vmax; animation-delay: -8s; animation-duration: 32s; }
.blobs span:nth-child(3) { background: #22d3ee; bottom: -20vmax; left: 30%; opacity: 0.09; animation-delay: -16s; }
@keyframes drift { to { transform: translate(8vmax, 6vmax) scale(1.15); } }
:root[data-theme="light"] .blobs span { opacity: 0.12; }

/* cursor glow */
.cursor-glow {
  position: fixed; top: -250px; left: -250px; width: 500px; height: 500px; z-index: -1;
  border-radius: 50%; pointer-events: none; opacity: 0; transition: opacity 0.4s;
  background: radial-gradient(circle, rgba(102,126,234,0.13), transparent 60%);
}

/* animated gradient name + titles */
.hero-name, .section-title span, .stat .num {
  background-size: 200% 200%; animation: gradShift 6s ease infinite;
}
@keyframes gradShift { 0%,100% { background-position: 0% 50%; } 50% { background-position: 100% 50%; } }

/* eyebrow labels above section titles */
.eyebrow {
  display: flex; justify-content: center; align-items: center; gap: 10px;
  font-size: 0.78rem; font-weight: 600; letter-spacing: 0.22em; text-transform: uppercase; color: var(--muted);
  margin-bottom: 10px;
}
.eyebrow span { color: var(--accent); font-family: "Space Grotesk"; }
.eyebrow::before, .eyebrow::after { content: ""; width: 34px; height: 1px; background: var(--grad); }

/* cards: mouse-follow spotlight + gradient border on hover */
.card {
  position: relative;
  background:
    radial-gradient(420px circle at var(--mx, -999px) var(--my, -999px), rgba(102,126,234,0.12), transparent 45%),
    var(--card);
}
.card.hover::after {
  content: ""; position: absolute; inset: -1px; border-radius: inherit; padding: 1px; pointer-events: none;
  background: radial-gradient(260px circle at var(--mx, -999px) var(--my, -999px), rgba(168,85,247,0.9), transparent 60%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
  opacity: 0; transition: opacity 0.3s;
}
.card.hover:hover::after { opacity: 1; }
.project { transition: transform 0.15s ease-out, opacity 0.7s ease, border-color 0.25s, box-shadow 0.25s; will-change: transform; }

/* primary button shine */
.btn-primary { position: relative; overflow: hidden; }
.btn-primary::after {
  content: ""; position: absolute; top: 0; left: -120%; width: 60%; height: 100%;
  background: linear-gradient(110deg, transparent, rgba(255,255,255,0.35), transparent);
  transform: skewX(-20deg); transition: left 0.6s;
}
.btn-primary:hover::after { left: 140%; }

/* photo ring: spinning gradient halo + orbiting icons */
.photo-wrap { position: relative; display: grid; place-items: center; --size: min(360px, 80vw); }
.photo-ring { width: var(--size); position: relative; }
.photo-ring::before {
  content: ""; position: absolute; inset: -14px; border-radius: 50%; z-index: -1;
  background: conic-gradient(from 0deg, #667eea, #a855f7, #22d3ee, #667eea);
  filter: blur(22px); opacity: 0.55; animation: spin 10s linear infinite;
}
.orbit {
  position: absolute; inset: 0; margin: auto; width: var(--size); height: var(--size);
  border-radius: 50%; border: 1px dashed var(--border); animation: spin 40s linear infinite;
  pointer-events: none;
  transform-origin: center;
  scale: 1.22;
}
.orb {
  position: absolute; top: 50%; left: 50%; width: 40px; height: 40px; margin: -20px 0 0 -20px;
  transform: rotate(var(--a)) translateX(calc(var(--size) / 2)) rotate(calc(-1 * var(--a)));
}
.orb img {
  width: 100%; height: 100%; border-radius: 10px; scale: calc(1 / 1.22);
  box-shadow: 0 6px 20px -6px rgba(0,0,0,0.6); animation: spin 40s linear infinite reverse;
}
@keyframes spin { to { rotate: 360deg; } }

/* tech marquee */
.marquee {
  overflow: hidden; border-block: 1px solid var(--border); background: var(--bg-2); backdrop-filter: blur(6px);
  padding: 18px 0;
  mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent);
}
.marquee-track { display: flex; gap: 40px; width: max-content; animation: scroll 45s linear infinite; }
.marquee:hover .marquee-track { animation-play-state: paused; }
.m-item { display: flex; align-items: center; gap: 10px; color: var(--muted); font-weight: 500; white-space: nowrap; }
.m-item .skill-ico-img, .m-item .skill-ico { width: 30px; height: 30px; }
@keyframes scroll { to { transform: translateX(calc(-50% - 20px)); } }

/* skills: icon tiles */
/* masonry: cards keep their own height and stack into columns with no gaps */
.skills-grid { display: block; columns: 3 300px; column-gap: 20px; margin-bottom: -20px; }
.skills-grid > .card { break-inside: avoid; margin-bottom: 20px; }
.skills-grid h3 { display: flex; align-items: center; gap: 10px; }
.skills-grid h3::before { content: ""; width: 8px; height: 8px; border-radius: 2px; background: var(--grad); transform: rotate(45deg); }
.skill-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(86px, 1fr)); gap: 10px; }
.skill {
  flex-direction: column; justify-content: flex-start; gap: 8px; padding: 14px 6px 10px;
  text-align: center; font-size: 0.76rem; line-height: 1.25; color: var(--muted);
  background: var(--bg); border-radius: 12px; transition: transform 0.25s, border-color 0.25s, color 0.25s, box-shadow 0.25s;
}
.skill:hover { color: var(--text); transform: translateY(-4px); box-shadow: 0 8px 24px -10px rgba(102,126,234,0.6); }
.skill .skill-ico-img, .skill .skill-ico { width: 38px; height: 38px; border-radius: 9px; transition: transform 0.3s; }
.skill .skill-ico { padding: 7px; }
.skill .skill-ico.glyph { padding: 6px; }
.skill:hover .skill-ico-img, .skill:hover .skill-ico { transform: scale(1.12) rotate(-4deg); }

/* projects: numbered, gradient top accent */
.project { overflow: hidden; }
.project::before {
  content: ""; position: absolute; top: 0; left: 0; right: 0; height: 3px; background: var(--grad);
  transform: scaleX(0); transform-origin: left; transition: transform 0.4s;
}
.project:hover::before { transform: scaleX(1); }
.folder { display: flex; align-items: center; gap: 10px; width: auto; }
.folder svg { width: 40px; height: 40px; }
.folder em {
  font-style: normal; font-family: "Space Grotesk"; font-weight: 700; font-size: 1.6rem;
  color: transparent; -webkit-text-stroke: 1px var(--border);
}
.project:hover .folder em { -webkit-text-stroke-color: var(--accent); }

/* stats: glowing icons feel */
.stat { overflow: hidden; }
.stat::before {
  content: ""; position: absolute; width: 120px; height: 120px; border-radius: 50%; top: -60px; right: -60px;
  background: var(--grad); opacity: 0.15; filter: blur(10px);
}

@media (max-width: 960px) {
  .photo-wrap { --size: min(240px, 60vw); }
  .orb { width: 32px; height: 32px; margin: -16px 0 0 -16px; }
}
@media (max-width: 560px) {
  .skill-list { grid-template-columns: repeat(auto-fill, minmax(76px, 1fr)); }
}

/* =========================================================
   PROJECT SHOWCASE + LIVE BACKGROUND
   ========================================================= */

/* animated constellation behind the whole page */
.net { position: fixed; inset: 0; width: 100%; height: 100%; z-index: -1; pointer-events: none; opacity: 1; }

/* projects section backdrop: dotted field with colour glows */
#projects { position: relative; }
#projects::before {
  content: ""; position: absolute; top: 0; bottom: 0; left: 50%; width: 100vw; transform: translateX(-50%);
  z-index: -1; pointer-events: none;
  background:
    radial-gradient(600px 400px at 15% 20%, rgba(102,126,234,0.16), transparent 70%),
    radial-gradient(600px 400px at 85% 75%, rgba(168,85,247,0.14), transparent 70%),
    radial-gradient(var(--border) 1.2px, transparent 1.2px) 0 0 / 26px 26px;
  mask-image: linear-gradient(transparent, #000 12%, #000 88%, transparent);
  -webkit-mask-image: linear-gradient(transparent, #000 12%, #000 88%, transparent);
}

.projects-grid { grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 26px; }
.project { padding: 0; }
.project-body { padding: 20px 24px 24px; display: flex; flex-direction: column; flex: 1; }
.project-body .project-top { margin-bottom: 8px; }
.pnum {
  font-style: normal; font-family: "Space Grotesk"; font-weight: 700; font-size: 1.7rem; line-height: 1;
  color: transparent; -webkit-text-stroke: 1px var(--muted); opacity: 0.6; transition: all 0.3s;
}
.project:hover .pnum { -webkit-text-stroke-color: var(--accent); opacity: 1; }

/* screenshot in a mini browser window */
.shot { display: block; position: relative; overflow: hidden; border-radius: var(--radius) var(--radius) 0 0; background: #0d1020; }
.chrome { display: flex; align-items: center; gap: 6px; height: 30px; padding: 0 12px; background: #1a1e33; border-bottom: 1px solid #ffffff12; }
.chrome i { width: 9px; height: 9px; border-radius: 50%; background: #ff5f57; }
.chrome i:nth-child(2) { background: #febc2e; }
.chrome i:nth-child(3) { background: #28c840; }
.chrome span {
  margin-left: 10px; flex: 1; min-width: 0; font-size: 0.68rem; color: #9aa0b8; background: #0d1020; border-radius: 6px;
  padding: 3px 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.shot-view { aspect-ratio: 16 / 9; overflow: hidden; position: relative; }
.shot-view img { width: 100%; height: 100%; object-fit: cover; object-position: top; transition: transform 0.7s cubic-bezier(.2,.7,.2,1), filter 0.4s; }
.project:hover .shot-view img { transform: scale(1.07); filter: brightness(0.55) saturate(1.1); }
.shot-view::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(transparent 60%, var(--card));
}
.shot-cat {
  position: absolute; top: 40px; right: 12px; font-size: 0.68rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase;
  padding: 4px 10px; border-radius: 999px; color: #fff; background: var(--grad); box-shadow: 0 4px 14px -4px rgba(0,0,0,0.6);
}
.shot-cta {
  position: absolute; left: 50%; top: calc(50% + 15px); transform: translate(-50%, -30%); opacity: 0;
  display: inline-flex; align-items: center; gap: 8px; white-space: nowrap;
  padding: 10px 20px; border-radius: 999px; font-weight: 600; font-size: 0.88rem; color: #fff;
  background: rgba(255,255,255,0.12); border: 1px solid rgba(255,255,255,0.35); backdrop-filter: blur(8px);
  transition: opacity 0.3s, transform 0.3s;
}
.shot-cta svg { width: 16px; height: 16px; }
.project:hover .shot-cta { opacity: 1; transform: translate(-50%, -50%); }

/* generated banner for projects without a screenshot */
.shot-art {
  width: 100%; height: 100%; display: grid; place-content: center; justify-items: center; gap: 12px; text-align: center; padding: 20px;
  color: #fff; font-family: "Space Grotesk";
  background:
    radial-gradient(circle at 20% 20%, rgba(255,255,255,0.18), transparent 40%),
    radial-gradient(#ffffff22 1.2px, transparent 1.2px) 0 0 / 18px 18px,
    linear-gradient(135deg, #667eea, #a855f7 60%, #22d3ee);
  background-size: auto, 18px 18px, 200% 200%; animation: gradShift 8s ease infinite;
}
.shot-art span { width: 64px; height: 64px; border-radius: 18px; display: grid; place-items: center; background: rgba(13,16,32,0.35); backdrop-filter: blur(4px); }
.shot-art svg { width: 32px; height: 32px; }
.shot-art strong { font-size: 1.15rem; }

/* featured projects: wide, image beside text */
.feat-badge {
  align-self: flex-start; font-size: 0.7rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase;
  color: #f59e0b; background: rgba(245,158,11,0.12); border: 1px solid rgba(245,158,11,0.3);
  padding: 3px 10px; border-radius: 999px; margin-bottom: 10px;
}

@media (max-width: 860px) {
}
@media (max-width: 560px) { .projects-grid { grid-template-columns: 1fr; } }
.project.hover::after { inset: 0; z-index: 3; }
.project::before { z-index: 2; }

/* refinements */
.shot-view::after { background: linear-gradient(transparent 80%, var(--card)); }
.skill { padding: 14px 2px 10px; font-size: 0.72rem; letter-spacing: -0.01em; overflow-wrap: anywhere; }

/* =========================================================
   FEATURED PROJECTS (01, 02) — showcase layout
   ========================================================= */
.project.featured {
  grid-column: 1 / -1;
  display: grid; grid-template-columns: 1.12fr 1fr; align-items: stretch;
  padding: 0; overflow: hidden;
  border-color: rgba(102,126,234,0.35);
  box-shadow: 0 30px 80px -40px rgba(102,126,234,0.55);
}
.project.featured:nth-of-type(2) { grid-template-columns: 1fr 1.12fr; }
.project.featured:nth-of-type(2) .feat-stage { order: 2; }
.project.featured::before { transform: scaleX(1); height: 2px; }

/* left: glowing stage with a floating browser window */
.feat-stage {
  position: relative; display: grid; place-items: center; padding: 44px 40px;
  background:
    radial-gradient(circle at 30% 20%, rgba(102,126,234,0.45), transparent 55%),
    radial-gradient(circle at 80% 90%, rgba(168,85,247,0.4), transparent 55%),
    radial-gradient(#ffffff14 1px, transparent 1px) 0 0 / 20px 20px,
    #0f1226;
  perspective: 1200px;
}
.feat-stage .shot {
  width: 100%; border-radius: 12px; border: 1px solid #ffffff1f;
  box-shadow: 0 40px 70px -25px rgba(0,0,0,0.85), 0 0 0 1px #00000040;
  transform: rotateY(-7deg) rotateX(4deg); transition: transform 0.6s cubic-bezier(.2,.7,.2,1);
}
.project.featured:nth-of-type(2) .feat-stage .shot { transform: rotateY(7deg) rotateX(4deg); }
.project.featured:hover .feat-stage .shot { transform: none; }
.feat-stage .shot-view { aspect-ratio: 16 / 10; }
.feat-stage .shot-view::after { display: none; }
.feat-stage .shot-view img { object-position: center top; }

/* right: content */
.feat-body { padding: 40px 40px 36px; display: flex; flex-direction: column; justify-content: center; min-width: 0; }
.feat-head { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; }
.feat-head .feat-badge { margin: 0; }
.feat-cat {
  font-size: 0.7rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--accent); padding: 3px 10px; border-radius: 999px; border: 1px solid rgba(102,126,234,0.35);
}
.feat-head .pnum { margin-left: auto; font-size: 2.6rem; }
.project.featured h3 { font-size: clamp(1.5rem, 2.4vw, 2rem); margin-bottom: 8px; }
.feat-tagline { color: var(--text); font-size: 1.05rem; font-weight: 500; margin-bottom: 20px; }
.feat-stats {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; margin-bottom: 20px;
  border-radius: 12px; overflow: hidden; background: var(--border); border: 1px solid var(--border);
}
.feat-stats div { background: var(--bg); padding: 12px 10px; text-align: center; }
.feat-stats strong {
  display: block; font-family: "Space Grotesk"; font-size: 1.45rem; line-height: 1.2;
  background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.feat-stats span { font-size: 0.72rem; color: var(--muted); }
.project.featured .feat-desc { color: var(--muted); font-size: 0.93rem; line-height: 1.65; }
.project.featured .tags { margin-top: 18px; }
.feat-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 24px; }
.feat-actions .btn svg { width: 16px; height: 16px; }

@media (max-width: 960px) {
  .project.featured, .project.featured:nth-of-type(2) { grid-template-columns: 1fr; }
  .project.featured:nth-of-type(2) .feat-stage { order: 0; }
  .feat-stage { padding: 28px 22px; }
  .feat-stage .shot, .project.featured:nth-of-type(2) .feat-stage .shot { transform: none; }
  .feat-body { padding: 26px 24px 28px; }
}
@media (max-width: 480px) {
  .feat-stats strong { font-size: 1.15rem; }
  .feat-head .pnum { font-size: 2rem; }
}
/* featured: bigger window, less empty stage */
.project.featured { grid-template-columns: 1.3fr 1fr; }
.project.featured:nth-of-type(2) { grid-template-columns: 1fr 1.3fr; }
.feat-stage { padding: 36px 30px; }
.feat-stage .shot-view img { object-position: left top; }
@media (max-width: 960px) {
  .project.featured, .project.featured:nth-of-type(2) { grid-template-columns: 1fr; }
  .feat-stage { padding: 24px 18px; }
}
/* keep grid children from forcing the page wider than the screen */
.projects-grid > *, .feat-stage, .feat-body, .shot { min-width: 0; }
.project.featured { grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); }
.project.featured:nth-of-type(2) { grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr); }
@media (max-width: 960px) {
  .project.featured, .project.featured:nth-of-type(2) { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 560px) { .projects-grid { grid-template-columns: minmax(0, 1fr); } }

/* =========================================================
   PROJECT NAMES
   ========================================================= */
.ptitle { margin: 6px 0 4px; line-height: 1.15; }
.pname {
  display: inline-block; position: relative;
  font-family: "Space Grotesk", sans-serif; font-size: 1.55rem; font-weight: 700; letter-spacing: -0.02em;
  background: linear-gradient(90deg, #8b9cf5, #a855f7 55%, #22d3ee);
  background-size: 200% 100%; background-position: 0% 50%;
  -webkit-background-clip: text; background-clip: text; color: transparent;
  transition: background-position 0.6s ease;
}
.pname::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -4px; height: 2px; border-radius: 2px;
  background: var(--grad); transform: scaleX(0); transform-origin: left; transition: transform 0.35s ease;
}
.project:hover .pname { background-position: 100% 50%; }
.project:hover .pname::after { transform: scaleX(1); }
.psub {
  display: block; margin-top: 6px;
  font-family: "Inter", sans-serif; font-size: 0.78rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--muted);
}
.project.featured .pname { font-size: clamp(1.8rem, 2.8vw, 2.3rem); }
:root[data-theme="light"] .pname { background-image: linear-gradient(90deg, #4f5fd6, #9333ea 55%, #0891b2); }

/* =========================================================
   CARTOON BUDDY (replaces the profile picture)
   ========================================================= */
.ring-disc { width: 100%; aspect-ratio: 1; border-radius: 50%; background: radial-gradient(circle at 50% 40%, #1f2440, #12152a 70%); }
.buddy {
  position: absolute; left: 50%; bottom: 6%; width: calc(var(--size) * 0.78); margin-left: calc(var(--size) * -0.39);
  z-index: 2; cursor: grab; touch-action: none; user-select: none; -webkit-user-select: none;
  transition: translate 0.55s cubic-bezier(.34, 1.56, .64, 1);
  outline: none;
}
.buddy svg { display: block; width: 100%; overflow: visible; animation: bob 3.2s ease-in-out infinite; transform-origin: 50% 100%; }
.buddy.dragging { cursor: grabbing; transition: none; }
.buddy.dragging svg { animation: none; transform: rotate(-6deg) scale(1.04); }
.buddy:focus-visible { outline: 2px dashed var(--accent); outline-offset: 6px; border-radius: 20px; }
@keyframes bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-7px); } }

/* parts */
.b-shadow { fill: #000; opacity: 0.25; }
.b-hoodie { fill: url(#hoodie); }
.b-strings { stroke: #e9ecff; stroke-width: 3; stroke-linecap: round; opacity: 0.8; }
.b-sleeve { fill: none; stroke: #8b6ff2; stroke-width: 20; stroke-linecap: round; }
.b-skin { fill: #d9a07a; }
.b-hair { fill: #4a2f27; }
.b-hair-shine { fill: none; stroke: #7a5246; stroke-width: 4; stroke-linecap: round; opacity: 0.8; }
.b-brow { fill: none; stroke: #4a2f27; stroke-width: 3.5; stroke-linecap: round; }
.b-white { fill: #fff; }
.b-pupil { fill: #1d1b2b; transition: transform 0.12s ease-out; }
.b-shine { fill: #fff; transition: transform 0.12s ease-out; }
.b-blush { fill: #ff8fa3; opacity: 0.45; }
.b-smile { fill: none; stroke: #5a2d2d; stroke-width: 3.5; stroke-linecap: round; }
.b-oh { fill: #5a2d2d; opacity: 0; }
.b-screen { fill: #2a2f45; stroke: #3b4262; stroke-width: 2; }
.b-logo { fill: #8b9cf5; font: 700 17px "Space Grotesk", monospace; }
.b-base { fill: #c9cee3; }

/* blinking */
.b-eye { transform-box: fill-box; transform-origin: center; transition: transform 0.08s ease; }
.buddy.blink .b-eye { transform: scaleY(0.1); }

/* waving: hide the resting hand, raise the arm and wiggle it */
.b-wave-arm { opacity: 0; transform-box: view-box; transform-origin: 140px 160px; }
.buddy.wave .b-wave-arm { opacity: 1; animation: wave 0.4s ease-in-out 4 alternate; }
.buddy.wave .b-rest-hand { opacity: 0; }
@keyframes wave { from { transform: rotate(-10deg); } to { transform: rotate(18deg); } }

/* surprised face while being dragged */
.buddy.dragging .b-smile { opacity: 0; }
.buddy.dragging .b-oh { opacity: 1; }

/* jump on click */
.buddy.jump svg { animation: hop 0.5s cubic-bezier(.3, 1.6, .6, 1); }
@keyframes hop { 0% { transform: translateY(0) scale(1, 1); } 30% { transform: translateY(0) scale(1.06, 0.92); } 60% { transform: translateY(-22px) scale(0.96, 1.05); } 100% { transform: translateY(0) scale(1, 1); } }

/* speech bubble */
.bubble {
  position: absolute; z-index: 3; top: -7%; right: -12%; max-width: 230px;
  padding: 10px 14px; border-radius: 16px 16px 16px 4px;
  background: #ffffff; color: #1b1d2b; font-size: 0.9rem; font-weight: 600; line-height: 1.35;
  box-shadow: 0 14px 30px -12px rgba(0, 0, 0, 0.6);
  opacity: 0; transform: translateY(8px) scale(0.92); transform-origin: bottom left; pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s cubic-bezier(.34, 1.56, .64, 1);
}
.bubble.show { opacity: 1; transform: none; }

@media (max-width: 960px) {
  .bubble { right: 0; top: -4%; font-size: 0.82rem; max-width: 190px; }
}
@media (prefers-reduced-motion: reduce) {
  .buddy svg { animation: none !important; }
  .buddy.wave .b-wave-arm { animation: none; }
}
