/* ============================================================
   TOKENS
   ============================================================ */
:root {
  --bg: #1b1f1a;
  --bg-elevated: #242923;
  --surface: rgba(243, 233, 211, 0.035);
  --surface-strong: rgba(243, 233, 211, 0.06);
  --border: rgba(243, 233, 211, 0.09);
  --border-strong: rgba(123, 68, 189, 0.4);
  --foreground: #f3e9d3;
  --muted: #a89f8f;
  --muted-strong: #c9c0b0;
  --accent: #7b44bd;        /* Electric Purple */
  --accent-strong: #ff3b57; /* Neon Crimson, brightened for legibility on charcoal */
  --accent-deep: #4a20b9;   /* Deep Violet */
  --glow: rgba(123, 68, 189, 0.35);
  /* Text colors to sit on top of solid accent-filled surfaces (buttons etc),
     independent of theme since these fills stay similarly bright either way. */
  --on-accent: #f8f1e9;        /* light text for the purple/lavender fill */
  --on-accent-strong: #150c1f; /* dark text for the brighter crimson hover fill */

  --font-display: 'JetBrains Mono', monospace;
  --font-body: 'JetBrains Mono', monospace;
  --font-mono: 'JetBrains Mono', monospace;
}

/* ===== Light theme ===== */
[data-theme="light"] {
  --bg: #f3e9d3;
  --bg-elevated: #faf3e8;
  --surface: rgba(27, 31, 26, 0.035);
  --surface-strong: rgba(27, 31, 26, 0.06);
  --border: rgba(27, 31, 26, 0.1);
  --foreground: #1b1f1a;
  --muted: #55503f;
  --muted-strong: #332f26;
  --accent: color-mix(in srgb, #7b44bd 58%, black 20%);
  --accent-strong: #a41e29; /* already dark enough to read on cream */
}
[data-theme="light"] body { transition: background 0.3s ease, color 0.3s ease; }

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

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--foreground);
  font-family: var(--font-body);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

a { text-decoration: none; color: inherit; }
ul { list-style: none; }
img { max-width: 100%; display: block; }

.container {
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 24px;
}

.accent-text { color: var(--accent); }
.hl { color: var(--foreground); font-weight: 600; }

/* ============================================================
   PRELOADER
   ============================================================ */
#preloader {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transition: opacity 0.6s ease;
}
#preloader.hide { opacity: 0; pointer-events: none; }
.preloader-inner { text-align: center; }
.preloader-mark {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(48px, 9vw, 88px);
  letter-spacing: -0.02em;
  background: linear-gradient(120deg, var(--accent-strong), var(--accent), var(--accent-deep));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  opacity: 0;
  transform: translateY(24px);
  animation: preloaderRise 0.7s cubic-bezier(0.16, 1, 0.3, 1) 0.15s forwards;
}
.preloader-mark .dot { -webkit-text-fill-color: var(--accent); }
.preloader-role {
  margin-top: 10px;
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.35em;
  color: var(--muted);
  opacity: 0;
  animation: preloaderFade 0.6s ease 0.5s forwards;
}
@keyframes preloaderRise { to { opacity: 1; transform: translateY(0); } }
@keyframes preloaderFade { to { opacity: 1; } }

.preloader-bar-wrap { position: absolute; bottom: 64px; width: 240px; }
.preloader-bar-labels {
  display: flex;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--muted);
  margin-bottom: 10px;
}
#preloaderPct { color: var(--accent-strong); }
.preloader-bar-track {
  height: 2px;
  width: 100%;
  background: var(--border);
  overflow: hidden;
}
.preloader-bar-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--accent-deep), var(--accent), var(--accent-strong));
}

/* ============================================================
   AMBIENT BACKGROUND
   ============================================================ */
.bg-fx { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
.bg-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.035) 1px, transparent 1px);
  background-size: 44px 44px;
  -webkit-mask-image: radial-gradient(ellipse 70% 55% at 50% 20%, black 40%, transparent 85%);
  mask-image: radial-gradient(ellipse 70% 55% at 50% 20%, black 40%, transparent 85%);
}
.aurora {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.55;
}
.aurora-a {
  top: -12%; left: 6%;
  width: 40rem; height: 40rem;
  background: radial-gradient(circle, rgba(123,68,189,0.16), transparent 65%);
}
.aurora-b {
  top: 30%; right: -12%;
  width: 34rem; height: 34rem;
  background: radial-gradient(circle, rgba(123,68,189,0.08), transparent 65%);
}

#scrollProgress {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 2px;
  transform-origin: left;
  transform: scaleX(0);
  background: linear-gradient(90deg, var(--accent-deep), var(--accent-strong));
  z-index: 900;
}

/* ============================================================
   HEADER / NAV
   ============================================================ */
header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 500;
  display: flex;
  justify-content: center;
  padding: 16px 20px 0;
}
.navbar {
  width: 100%;
  max-width: 900px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 10px 10px 22px;
  border-radius: 999px;
  border: 1px solid transparent;
  background: transparent;
  transition: background 0.4s ease, border-color 0.4s ease, box-shadow 0.4s ease;
}
header.is-scrolled .navbar {
  background: color-mix(in srgb, var(--bg-elevated) 78%, transparent);
  border-color: var(--border);
  backdrop-filter: blur(14px);
  box-shadow: 0 12px 30px -20px rgba(0,0,0,0.6);
}
.brand {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 19px;
  letter-spacing: -0.01em;
}
.brand .dot { color: var(--accent); }
.nav-links { display: flex; align-items: center; gap: 2px; }
.nav-link {
  padding: 9px 16px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 500;
  color: var(--muted);
  transition: color 0.25s ease, background 0.25s ease;
}
.nav-link:hover { color: var(--foreground); }
.nav-link.is-active { color: var(--accent-strong); background: rgba(123,68,189,0.1); }
.nav-link::before { content: '</'; opacity: 0.5; }
.nav-link::after { content: '>'; opacity: 0.5; }

.btn-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 22px;
  border-radius: 999px;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 13.5px;
  transition: transform 0.25s ease, box-shadow 0.25s ease, background 0.25s ease, border-color 0.25s ease;
  white-space: nowrap;
}
.btn-pill--solid {
  background: var(--accent);
  color: var(--on-accent);
}
.btn-pill--solid:hover {
  background: var(--accent-strong);
  color: var(--on-accent-strong);
  transform: translateY(-2px);
  box-shadow: 0 14px 32px -12px var(--glow);
}
.btn-pill--glass {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--foreground);
}
.btn-pill--glass:hover { border-color: var(--border-strong); transform: translateY(-2px); }
.btn-pill--lg { padding: 16px 30px; font-size: 16px; font-family: var(--font-display); }
.nav-cta { display: none; }
@media (min-width: 851px) { .nav-cta { display: inline-flex; } }

.nav-icon-btn {
  position: relative;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted-strong);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 17px;
  cursor: pointer;
  flex-shrink: 0;
  transition: border-color 0.2s, color 0.2s, background 0.2s;
}
.nav-icon-btn:hover { border-color: var(--border); color: var(--accent-strong); background: var(--surface); }

.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  width: 40px; height: 40px;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  cursor: pointer;
}
.hamburger span { width: 20px; height: 1.5px; background: var(--foreground); transition: transform 0.3s, opacity 0.3s; }
.hamburger.is-open span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
.hamburger.is-open span:nth-child(2) { opacity: 0; }
.hamburger.is-open span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }

.mobile-menu {
  display: none;
  position: fixed;
  inset: 0;
  background: color-mix(in srgb, var(--bg) 97%, transparent);
  backdrop-filter: blur(10px);
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 28px;
  transform: translateY(-8px);
  opacity: 0;
  pointer-events: none;
  transition: transform 0.35s ease, opacity 0.35s ease;
  z-index: 480;
}
.mobile-menu.show { opacity: 1; transform: translateY(0); pointer-events: auto; }
.mobile-menu a { font-family: var(--font-display); font-size: 24px; font-weight: 600; }

@media (max-width: 850px) {
  .nav-links { display: none; }
  .hamburger { display: flex; }
  .mobile-menu { display: flex; }
}

/* ============================================================
   GLASS CARD / SHARED SURFACES
   ============================================================ */
.glass-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 24px;
  backdrop-filter: blur(6px);
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-family: var(--font-mono);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.28em;
  color: var(--accent);
}
.eyebrow--center { justify-content: center; }
.eyebrow-line { width: 30px; height: 1px; background: rgba(123,68,189,0.5); }
.eyebrow-label::before { content: '</'; opacity: 0.55; }
.eyebrow-label::after { content: '>'; opacity: 0.55; }

.display-xl {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(42px, 7vw, 74px);
  line-height: 0.98;
  letter-spacing: -0.02em;
  background: linear-gradient(120deg, var(--accent), var(--accent-strong), var(--accent-deep), var(--accent));
  background-size: 300% 300%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: gradientMove 6s ease infinite;
}
@keyframes gradientMove {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}
.display-lg {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(32px, 4.6vw, 52px);
  line-height: 1.05;
  letter-spacing: -0.01em;
  margin-top: 16px;
}
.section-lede {
  margin-top: 18px;
  max-width: 640px;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.7;
}
.section-head--center { text-align: center; }
.section-head--center .section-lede { margin-inline: auto; }

.section { position: relative; padding: 120px 0; }
#skills.section { padding-bottom: 60px; }

/* Scroll reveal */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.8s cubic-bezier(0.16,1,0.3,1), transform 0.8s cubic-bezier(0.16,1,0.3,1);
}
.reveal.is-visible { opacity: 1; transform: translateY(0); }
.reveal[data-reveal-delay="1"] { transition-delay: 0.1s; }
.reveal[data-reveal-delay="2"] { transition-delay: 0.2s; }

/* ============================================================
   HERO
   ============================================================ */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding: 150px 0 90px;
  overflow: hidden;
}
.hero-glow {
  position: absolute;
  top: 20%; left: 50%;
  width: 46rem; height: 46rem;
  transform: translateX(-50%);
  background: radial-gradient(circle, rgba(123,68,189,0.14), transparent 60%);
  filter: blur(10px);
  pointer-events: none;
}
.hero-grid {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 48px;
  align-items: center;
  position: relative;
  z-index: 1;
}
.eyebrow-pill {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 8px 16px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--border);
  font-size: 12.5px;
  font-weight: 500;
  color: var(--muted-strong);
  margin-bottom: 26px;
}
.pulse-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: #BF5231;
  box-shadow: 0 0 0 0 rgba(191,82,49,0.6);
  animation: pulseDot 2s infinite;
}
@keyframes pulseDot {
  0% { box-shadow: 0 0 0 0 rgba(191,82,49,0.55); }
  70% { box-shadow: 0 0 0 8px rgba(191,82,49,0); }
  100% { box-shadow: 0 0 0 0 rgba(191,82,49,0); }
}
.hero-role {
  margin-top: 20px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(20px, 2.6vw, 28px);
  color: var(--muted-strong);
}
.hero-desc {
  margin-top: 22px;
  max-width: 540px;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.8;
}
.hero-actions { margin-top: 36px; display: flex; gap: 16px; flex-wrap: wrap; }

.hero-portrait { position: relative; display: flex; align-items: center; justify-content: center; }
.portrait-glow {
  position: absolute;
  inset: 6%;
  background: radial-gradient(circle at 50% 30%, rgba(123,68,189,0.35), transparent 65%);
  filter: blur(30px);
  z-index: 0;
}
.portrait-frame {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 340px;
  aspect-ratio: 4 / 5;
  border-radius: 32px;
  border: 1px solid var(--border);
  background: linear-gradient(160deg, var(--bg-elevated), #14170f);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.portrait-photo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 1;
}
.portrait-initials {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 96px;
  background: linear-gradient(150deg, var(--accent-strong), var(--accent-deep));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  letter-spacing: -0.03em;
}
.floating-chip {
  position: absolute;
  z-index: 2;
  padding: 9px 16px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--bg-elevated) 85%, transparent);
  border: 1px solid var(--border-strong);
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--accent-strong);
  box-shadow: 0 10px 30px -14px rgba(0,0,0,0.6);
  animation: floatChip 5s ease-in-out infinite;
}
.chip-1 { top: 6%; left: -8%; animation-delay: 0s; }
.chip-2 { top: 20%; right: -12%; animation-delay: 0.6s; }
.chip-3 { bottom: 26%; left: -14%; animation-delay: 1.2s; }
.chip-4 { bottom: 8%; right: -6%; animation-delay: 1.8s; }
@keyframes floatChip { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }

.scroll-cue {
  position: absolute;
  bottom: 34px; left: 50%;
  transform: translateX(-50%);
  display: none;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
}
@media (min-width: 851px) { .scroll-cue { display: flex; } }
.scroll-cue-track {
  width: 20px; height: 34px;
  border-radius: 999px;
  border: 1px solid var(--border);
  display: flex;
  justify-content: center;
  padding-top: 6px;
}
.scroll-cue-dot { width: 4px; height: 8px; border-radius: 999px; background: var(--accent); animation: scrollCue 1.8s infinite; }
@keyframes scrollCue { 0% { opacity: 1; transform: translateY(0);} 100% { opacity: 0; transform: translateY(10px);} }

@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; text-align: center; }
  .hero-desc { margin-inline: auto; }
  .hero-actions { justify-content: center; }
  .hero-portrait { margin-top: 40px; max-width: 320px; margin-inline: auto; }
  .floating-chip { display: none; }
}

/* ============================================================
   ABOUT
   ============================================================ */
.about-grid {
  margin-top: 52px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}
.feature-card { padding: 30px; transition: border-color 0.3s ease; }
.feature-card:hover { border-color: var(--border-strong); }
.feature-num {
  font-family: var(--font-mono);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--accent);
}
.feature-card h3 { font-family: var(--font-display); font-size: 19px; margin-top: 14px; }
.feature-card p { margin-top: 10px; color: var(--muted); font-size: 14.5px; line-height: 1.7; }

.stat-strip {
  margin-top: 20px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  padding: 34px 20px;
  text-align: center;
}
.stat-num {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(28px, 4vw, 40px);
  color: var(--foreground);
}
.stat-label { margin-top: 6px; font-family: var(--font-mono); font-size: 11px; text-transform: uppercase; letter-spacing: 0.15em; color: var(--muted); }

@media (max-width: 700px) {
  .about-grid { grid-template-columns: 1fr; }
  .stat-strip { grid-template-columns: repeat(2, 1fr); gap: 24px 0; }
}

/* ============================================================
   SKILLS
   ============================================================ */
.skills-panel {
  margin-top: 52px;
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: 22px;
}
.skills-tabs { display: flex; flex-direction: column; gap: 10px; }
.skills-tab {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 17px 18px;
  border-radius: 18px;
  border: 1px solid var(--border);
  background: transparent;
  cursor: pointer;
  text-align: left;
  transition: border-color 0.25s ease, background 0.25s ease;
}
.skills-tab:hover { border-color: var(--border-strong); }
.skills-tab.is-active {
  background: rgba(123,68,189,0.07);
  border-color: var(--border-strong);
}
.skills-tab-icon {
  width: 42px; height: 42px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  background: var(--surface-strong);
  color: var(--muted);
  font-size: 19px;
  flex-shrink: 0;
}
.skills-tab.is-active .skills-tab-icon { background: rgba(123,68,189,0.16); color: var(--accent-strong); }
.skills-tab-title { display: block; font-family: var(--font-display); font-weight: 600; font-size: 15px; color: var(--muted-strong); }
.skills-tab.is-active .skills-tab-title { color: var(--foreground); }
.skills-tab-count { display: block; margin-top: 2px; font-family: var(--font-mono); font-size: 11.5px; color: var(--muted); }

.skills-display { position: relative; min-height: 280px; padding: 32px; overflow: hidden; }
.skills-pills { display: flex; flex-wrap: wrap; align-content: flex-start; gap: 12px; }
.skills-pills[hidden] { display: none; }
.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface-strong);
  font-size: 13.5px;
  font-weight: 500;
  transition: border-color 0.2s ease, color 0.2s ease;
}
.pill:hover { border-color: var(--border-strong); color: var(--accent-strong); }
.pill iconify-icon { font-size: 16px; color: var(--accent); }

@media (max-width: 800px) {
  .skills-panel { grid-template-columns: 1fr; }
}

/* Marquee */
.marquee-stack { margin-top: 60px; display: flex; flex-direction: column; gap: 8px; }
.marquee-row {
  width: 100%;
  overflow: hidden;
  -webkit-mask-image: linear-gradient(90deg, transparent, black 10%, black 90%, transparent);
  mask-image: linear-gradient(90deg, transparent, black 10%, black 90%, transparent);
}
.marquee-track { display: flex; width: max-content; animation: marqueeScroll var(--duration, 36s) linear infinite; }
.marquee-track--reverse { animation-direction: reverse; }
.marquee-group { display: flex; align-items: center; flex-shrink: 0; }
.marquee-group span {
  margin: 0 18px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 22px;
  color: rgba(244,239,230,0.35);
  white-space: nowrap;
}
.marquee-group--dim span { color: rgba(244,239,230,0.2); }
.marquee-group span i { font-style: normal; margin-left: 18px; color: var(--accent); opacity: 0.5; }
@keyframes marqueeScroll { from { transform: translateX(0); } to { transform: translateX(-50%); } }

/* ============================================================
   TIMELINE
   ============================================================ */
.timeline { position: relative; margin-top: 56px; max-width: 780px; margin-inline: auto; }
.timeline-spine {
  position: absolute;
  left: 25px; top: 4px; bottom: 4px;
  width: 1px;
  background: linear-gradient(to bottom, var(--accent), var(--border) 70%, transparent);
}
.timeline-item { position: relative; padding-left: 74px; padding-bottom: 46px; }
.timeline-item:last-child { padding-bottom: 0; }
.timeline-node {
  position: absolute;
  left: 0; top: 0;
  width: 52px; height: 52px;
  border-radius: 50%;
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
  display: flex; align-items: center; justify-content: center;
  font-size: 19px;
  color: var(--accent-strong);
  z-index: 1;
}
.timeline-card { padding: 26px 28px; }
.timeline-card-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 8px; }
.timeline-card h3 { font-family: var(--font-display); font-size: 20px; }
.timeline-date { font-family: var(--font-mono); font-size: 12px; color: var(--accent); white-space: nowrap; }
.timeline-org { margin-top: 4px; color: var(--muted-strong); font-size: 13.5px; }
.timeline-card ul { margin-top: 16px; display: flex; flex-direction: column; gap: 10px; }
.timeline-card li {
  position: relative;
  padding-left: 18px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.65;
}
.timeline-card li::before {
  content: '';
  position: absolute;
  left: 0; top: 8px;
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--accent);
}

@media (max-width: 600px) {
  .timeline-item { padding-left: 60px; }
  .timeline-node { width: 42px; height: 42px; font-size: 16px; }
  .timeline-spine { left: 20px; }
}

/* ============================================================
   PROJECTS
   ============================================================ */
.filter-bar {
  margin-top: 46px;
  display: inline-flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 6px;
  border-radius: 999px;
  width: fit-content;
  margin-inline: auto;
}
.filter-btn {
  padding: 10px 20px;
  border-radius: 999px;
  border: none;
  background: transparent;
  color: var(--muted);
  font-weight: 500;
  font-size: 13.5px;
  cursor: pointer;
  transition: background 0.25s ease, color 0.25s ease;
}
.filter-btn:hover { color: var(--foreground); }
.filter-btn.is-active { background: var(--accent); color: var(--on-accent); }

.project-grid {
  margin-top: 40px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 22px;
}
.project-card {
  padding: 30px;
  display: flex;
  flex-direction: column;
  transition: border-color 0.3s ease, transform 0.3s ease;
}
.project-card:hover { border-color: var(--border-strong); transform: translateY(-4px); }
.project-card.is-hidden { display: none; }
.project-card-top { display: flex; justify-content: space-between; align-items: center; }
.project-tag {
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--accent-strong);
  background: rgba(123,68,189,0.09);
  padding: 5px 12px;
  border-radius: 999px;
}
.project-year { font-family: var(--font-mono); font-size: 12px; color: var(--muted); }
.project-card h3 { font-family: var(--font-display); font-size: 22px; margin-top: 18px; }
.project-card > p { margin-top: 12px; color: var(--muted); font-size: 14px; line-height: 1.7; flex: 1; }
.chip-row { margin-top: 20px; display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  font-size: 11.5px;
  font-weight: 500;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid rgba(123,68,189,0.25);
  background: rgba(123,68,189,0.06);
  color: var(--accent-strong);
}
.project-link {
  margin-top: 22px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--foreground);
  border-bottom: 1px solid transparent;
  width: fit-content;
}
.project-link:hover { border-bottom-color: var(--accent); color: var(--accent-strong); }
.filter-empty { text-align: center; margin-top: 40px; color: var(--muted); }

/* ============================================================
   CONTACT
   ============================================================ */
.contact-panel { position: relative; overflow: hidden; padding: 56px; margin-top: 0; }
.contact-grid-fx {
  -webkit-mask-image: linear-gradient(to bottom, black, transparent 75%);
  mask-image: linear-gradient(to bottom, black, transparent 75%);
  opacity: 0.5;
}
.contact-row {
  position: relative;
  margin-top: 40px;
  display: flex;
  flex-wrap: wrap;
  gap: 28px;
  align-items: center;
  justify-content: space-between;
}
.btn-pill-icon {
  width: 30px; height: 30px;
  border-radius: 50%;
  background: rgba(0,0,0,0.15);
  display: flex; align-items: center; justify-content: center;
  transition: transform 0.3s ease;
}
.btn-pill--solid:hover .btn-pill-icon { transform: rotate(45deg); }
.contact-cards { display: flex; flex-wrap: wrap; gap: 14px; }
.contact-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 15px 18px;
  border-radius: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  transition: border-color 0.25s ease;
}
.contact-card:hover { border-color: var(--border-strong); }
.contact-card-icon {
  width: 38px; height: 38px;
  border-radius: 11px;
  background: rgba(123,68,189,0.12);
  color: var(--accent-strong);
  display: flex; align-items: center; justify-content: center;
  font-size: 17px;
  flex-shrink: 0;
}
.contact-card-label { display: block; font-family: var(--font-mono); font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.12em; color: var(--muted); }
.contact-card-value { display: block; margin-top: 2px; font-size: 13.5px; }

@media (max-width: 700px) {
  .contact-panel { padding: 34px 22px; }
}

/* ============================================================
   FOOTER
   ============================================================ */
footer { border-top: 1px solid var(--border); padding-top: 56px; padding-bottom: 32px; margin-top: 60px; }
.footer-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 32px;
  padding-bottom: 40px;
}
.footer-tagline { margin-top: 12px; max-width: 260px; color: var(--muted); font-size: 13.5px; line-height: 1.7; }
.footer-nav { display: flex; flex-wrap: wrap; gap: 22px; align-items: center; }
.footer-nav a { color: var(--muted); font-size: 13.5px; transition: color 0.2s ease; }
.footer-nav a:hover { color: var(--accent); }
.footer-nav a::before { content: '</'; opacity: 0.5; }
.footer-nav a::after { content: '>'; opacity: 0.5; }
.footer-socials { display: flex; gap: 12px; }
.footer-socials a {
  width: 42px; height: 42px;
  border-radius: 50%;
  border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  color: var(--muted);
  font-size: 17px;
  transition: color 0.2s ease, border-color 0.2s ease;
}
.footer-socials a:hover { color: var(--accent); border-color: var(--border-strong); }
.footer-bottom {
  border-top: 1px solid var(--border);
  padding-top: 24px;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 10px;
  font-size: 12.5px;
  color: var(--muted);
}
.footer-credit { font-family: var(--font-mono); color: rgba(156,146,132,0.7); }

/* ============================================================
   BACK TO TOP
   ============================================================ */
#backToTop {
  position: fixed;
  right: 22px; bottom: 22px;
  width: 46px; height: 46px;
  border-radius: 50%;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  color: var(--foreground);
  font-size: 17px;
  display: none;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 400;
  transition: border-color 0.25s ease, transform 0.25s ease;
}
#backToTop.show { display: flex; }
#backToTop:hover { border-color: var(--border-strong); transform: translateY(-3px); }

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}

/* ============================================================
   COLORFUL TRAILING CURSOR (desktop with a precise pointer only)
   ============================================================ */
@media (hover: hover) and (pointer: fine) {
  body { cursor: none; }
  a, button, .pill { cursor: none; }

  .cursor-trail {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 9999;
  }
  .trail-dot {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--dot-size, 10px);
    height: var(--dot-size, 10px);
    border-radius: 50%;
    background: var(--dot-color, #7b44bd);
    box-shadow: 0 0 8px var(--dot-color, #7b44bd);
    transform: translate(-50%, -50%);
    pointer-events: none;
    will-change: transform;
  }
}
@media not all and (hover: hover) and (pointer: fine) {
  .cursor-trail { display: none; }
}