/* ============ Reset & Base ============ */
* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --bg: #08080c;
  --bg-alt: #0d0d13;
  --surface: #131319;
  --surface-2: #191922;
  --border: rgba(255,255,255,0.08);
  --text: #f2f2f5;
  --text-dim: #9a9aa8;
  --text-dimmer: #6b6b78;
  --accent: #7c5cff;
  --accent-2: #22d3ee;
  --accent-3: #ff6b9d;
  --gradient: linear-gradient(135deg, var(--accent), var(--accent-2));
  --font-head: 'Space Grotesk', sans-serif;
  --font-body: 'Inter', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --nav-bg: rgba(8,8,12,0.4);
  --nav-bg-scrolled: rgba(8,8,12,0.75);
  --grid-line: rgba(255,255,255,0.025);
  --blob-opacity: 0.35;
  --blob-opacity-3: 0.18;
  --shadow-sm: 0 2px 8px rgba(0,0,0,0.25);
  --shadow-md: 0 20px 45px rgba(0,0,0,0.4);
  --shadow-glow: 0 0 0 1px rgba(124,92,255,0.25), 0 10px 28px rgba(124,92,255,0.25);
  --pop-ease: cubic-bezier(0.34, 1.56, 0.64, 1);
}

[data-theme="light"] {
  --bg: #fafafa;
  --bg-alt: #f1f1f5;
  --surface: #ffffff;
  --surface-2: #f1f1f5;
  --border: rgba(20,20,26,0.1);
  --text: #14141a;
  --text-dim: #55555f;
  --text-dimmer: #8a8a95;
  --nav-bg: rgba(250,250,250,0.55);
  --nav-bg-scrolled: rgba(250,250,250,0.85);
  --grid-line: rgba(20,20,26,0.045);
  --blob-opacity: 0.22;
  --blob-opacity-3: 0.12;
  --shadow-sm: 0 2px 10px rgba(20,20,26,0.07);
  --shadow-md: 0 20px 45px rgba(20,20,26,0.12);
  --shadow-glow: 0 0 0 1px rgba(124,92,255,0.15), 0 10px 28px rgba(124,92,255,0.16);
}

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-weight: 300;
  line-height: 1.6;
  overflow-x: hidden;
  cursor: none;
  transition: background-color 0.4s ease, color 0.4s ease;
}

@media (max-width: 860px), (hover: none) {
  body { cursor: auto; }
  .cursor-dot, .cursor-ring { display: none; }
  [data-tooltip]::after, [data-tooltip]::before { display: none; }
}

::selection { background: var(--accent); color: #fff; }

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

h1, h2, h3, h4 { font-family: var(--font-head); font-weight: 600; }

/* ============ Custom Cursor ============ */
.cursor-dot, .cursor-ring {
  position: fixed;
  top: 0; left: 0;
  border-radius: 50%;
  pointer-events: none;
  z-index: 9999;
  transform: translate(-50%, -50%);
}
.cursor-dot {
  width: 6px; height: 6px;
  background: var(--accent-2);
  transition: opacity 0.2s;
}
.cursor-ring {
  width: 36px; height: 36px;
  border: 1px solid rgba(124,92,255,0.5);
  transition: width 0.25s var(--ease), height 0.25s var(--ease), background 0.25s var(--ease), border-color 0.25s var(--ease);
}
.cursor-ring.hover {
  width: 64px; height: 64px;
  background: rgba(124,92,255,0.12);
  border-color: var(--accent);
}

/* ============ Grain overlay ============ */
.grain {
  position: fixed; inset: 0;
  pointer-events: none;
  z-index: 1;
  opacity: 0.025;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='100' height='100'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ============ Progress bar ============ */
.progress-bar {
  position: fixed;
  top: 0; left: 0;
  height: 2px;
  width: 0%;
  background: var(--gradient);
  z-index: 1001;
  transition: width 0.1s linear;
}

/* ============ Nav ============ */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 900;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 6vw;
  background: var(--nav-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s, padding 0.3s, background-color 0.3s;
}
.nav.scrolled {
  padding: 14px 6vw;
  border-color: var(--border);
  background: var(--nav-bg-scrolled);
  box-shadow: var(--shadow-sm);
}
.nav-logo {
  font-family: var(--font-head);
  font-size: 1.3rem;
  font-weight: 700;
  letter-spacing: 0.5px;
}
.nav-logo .dot { color: var(--accent-2); }
.nav-links {
  display: flex;
  gap: 2.2rem;
}
.nav-link {
  position: relative;
  font-size: 0.92rem;
  color: var(--text-dim);
  transition: color 0.25s;
  padding: 4px 0;
}
.nav-link::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0;
  width: 0; height: 1px;
  background: var(--gradient);
  transition: width 0.3s var(--ease);
}
.nav-link:hover, .nav-link.active { color: var(--text); }
.nav-link:hover::after, .nav-link.active::after { width: 100%; }

.btn-small { padding: 9px 20px; font-size: 0.85rem; }

.nav-actions {
  display: flex;
  align-items: center;
  gap: 0.9rem;
}

.theme-toggle {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px; height: 40px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-dim);
  cursor: pointer;
  transition: border-color 0.25s, color 0.25s;
}
.theme-toggle:hover { border-color: var(--accent-2); color: var(--accent-2); box-shadow: var(--shadow-glow); }
.theme-toggle svg {
  position: absolute;
  transition: opacity 0.3s ease, transform 0.4s var(--ease);
}
.icon-sun { opacity: 0; transform: rotate(-90deg) scale(0.4); }
.icon-moon { opacity: 1; transform: rotate(0) scale(1); }
[data-theme="light"] .icon-sun { opacity: 1; transform: rotate(0) scale(1); }
[data-theme="light"] .icon-moon { opacity: 0; transform: rotate(90deg) scale(0.4); }

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
}
.nav-toggle span {
  width: 22px; height: 2px;
  background: var(--text);
  transition: transform 0.3s, opacity 0.3s;
}
.nav-toggle.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle.open span:nth-child(2) { opacity: 0; }
.nav-toggle.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.mobile-menu {
  position: fixed;
  top: 0; right: -100%;
  width: min(78vw, 340px);
  height: 100vh;
  background: var(--surface);
  border-left: 1px solid var(--border);
  z-index: 950;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 1.6rem;
  padding: 2rem 3rem;
  transition: right 0.45s var(--ease);
}
.mobile-menu.open { right: 0; }
.mobile-link { font-family: var(--font-head); font-size: 1.4rem; color: var(--text-dim); }
.mobile-link:hover { color: var(--text); }

/* ============ Buttons ============ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 28px;
  border-radius: 100px;
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 500;
  transition: transform 0.35s var(--pop-ease), box-shadow 0.3s, border-color 0.3s, color 0.3s;
  cursor: pointer;
  border: 1px solid transparent;
  white-space: nowrap;
}
.btn-primary {
  background: var(--gradient);
  color: #08080c;
  font-weight: 600;
}
.btn-primary:hover { box-shadow: 0 10px 34px rgba(124,92,255,0.45); }
.btn-ghost {
  background: transparent;
  border-color: var(--border);
  color: var(--text);
}
.btn-ghost:hover { border-color: var(--accent-2); color: var(--accent-2); box-shadow: var(--shadow-glow); }

/* ============ Hero ============ */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 120px 6vw 60px;
  overflow: hidden;
}
.hero-bg {
  position: absolute; inset: 0;
  z-index: 0;
}
.blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  opacity: var(--blob-opacity);
  animation: float 18s ease-in-out infinite;
  transition: opacity 0.4s ease;
}
.blob-1 { width: 420px; height: 420px; background: var(--accent); top: -10%; left: -8%; }
.blob-2 { width: 380px; height: 380px; background: var(--accent-2); bottom: -12%; right: -6%; animation-delay: -6s; }
.blob-3 { width: 300px; height: 300px; background: var(--accent-3); top: 40%; left: 50%; opacity: var(--blob-opacity-3); animation-delay: -12s; }

@keyframes float {
  0%, 100% { transform: translate(0,0) scale(1); }
  33% { transform: translate(40px,-30px) scale(1.08); }
  66% { transform: translate(-30px,25px) scale(0.95); }
}

.grid-overlay {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse 70% 60% at 50% 40%, #000 40%, transparent 100%);
  transition: background-image 0.4s ease;
}

.hero-content {
  position: relative;
  z-index: 2;
  max-width: 780px;
  text-align: center;
}
.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-dim);
  border: 1px solid var(--border);
  padding: 7px 16px;
  border-radius: 100px;
  margin-bottom: 1.8rem;
  background: rgba(255,255,255,0.02);
}
.pulse-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: #4ade80;
  box-shadow: 0 0 0 rgba(74,222,128,0.6);
  animation: pulse 2s infinite;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(74,222,128,0.6); }
  70% { box-shadow: 0 0 0 8px rgba(74,222,128,0); }
  100% { box-shadow: 0 0 0 0 rgba(74,222,128,0); }
}

.hero-title {
  font-size: clamp(2.2rem, 6vw, 4.2rem);
  line-height: 1.1;
  margin-bottom: 1rem;
  letter-spacing: -0.02em;
}
.highlight {
  background: var(--gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero-role {
  font-size: clamp(1.2rem, 3vw, 1.7rem);
  color: var(--text-dim);
  font-weight: 400;
  margin-bottom: 1.6rem;
  min-height: 2.2em;
}
.typed { color: var(--accent-2); font-family: var(--font-mono); }
.cursor-blink { color: var(--accent-2); animation: blink 1s step-end infinite; }
@keyframes blink { 50% { opacity: 0; } }

.hero-desc {
  font-size: 1.05rem;
  color: var(--text-dim);
  max-width: 620px;
  margin: 0 auto 2.4rem;
}
.hero-desc strong { color: var(--text); font-weight: 500; }

.hero-cta {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 2.4rem;
}
.hero-social {
  display: flex;
  gap: 1.2rem;
  justify-content: center;
}
.social-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 42px; height: 42px;
  border-radius: 50%;
  border: 1px solid var(--border);
  color: var(--text-dim);
  background: var(--surface);
  transition: color 0.25s, border-color 0.25s, box-shadow 0.3s;
}
.social-link:hover {
  color: var(--accent-2);
  border-color: var(--accent-2);
  box-shadow: var(--shadow-glow);
}

.scroll-cue {
  position: absolute;
  bottom: 36px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 2px;
  color: var(--text-dimmer);
  z-index: 2;
}
.scroll-line {
  width: 1px; height: 40px;
  background: var(--border);
  position: relative;
  overflow: hidden;
}
.scroll-dot {
  position: absolute;
  top: -10px; left: 0;
  width: 100%; height: 10px;
  background: var(--accent-2);
  animation: scrollDown 2s infinite;
}
@keyframes scrollDown {
  0% { top: -10px; }
  100% { top: 40px; }
}

/* ============ Sections ============ */
.section { padding: 120px 0; position: relative; z-index: 2; }
/* translucent so the page-wide ambient backdrop reads through the band */
.section-alt { background: var(--band); }
.container { position: relative; z-index: 1; max-width: 1100px; margin: 0 auto; padding: 0 6vw; }

.section-tag {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--accent-2);
  letter-spacing: 1px;
  margin-bottom: 0.8rem;
}
.section-tag::before {
  content: '';
  width: 30px;
  height: 2px;
  border-radius: 2px;
  background: var(--gradient);
}
.section-alt {
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.section-title {
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  margin-bottom: 3.5rem;
  letter-spacing: -0.01em;
}

/* ============ Reveal animation ============ */
.reveal-up {
  opacity: 0;
  transform: translateY(32px);
  transition: opacity 0.8s var(--ease), transform 0.8s var(--ease);
  transition-delay: var(--d, 0s);
}
.reveal-up.in-view {
  opacity: 1;
  transform: translateY(0);
}

/* ============ About ============ */
.about-grid {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 3.5rem;
  align-items: start;
}
.about-text p {
  color: var(--text-dim);
  margin-bottom: 1.2rem;
  font-size: 1.02rem;
}
.about-text strong { color: var(--text); font-weight: 500; }

.about-stats {
  display: flex;
  gap: 1rem;
  margin-top: 2rem;
  flex-wrap: wrap;
}
.stat-card {
  flex: 1;
  min-width: 120px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 1.4rem 1rem;
  text-align: center;
  box-shadow: var(--shadow-sm);
  transition: border-color 0.3s, box-shadow 0.3s, transform 0.3s var(--pop-ease);
}
.stat-card:hover { border-color: var(--accent); box-shadow: var(--shadow-glow); }
.stat-num {
  display: block;
  font-family: var(--font-head);
  font-size: 2rem;
  font-weight: 700;
  background: var(--gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.stat-label { font-size: 0.8rem; color: var(--text-dimmer); }

.about-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 2rem;
  box-shadow: var(--shadow-sm);
}
.edu-list { display: flex; flex-direction: column; gap: 1.8rem; }
.edu-item { display: flex; gap: 1rem; }
.edu-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--accent-2);
  margin-top: 6px;
  flex-shrink: 0;
  box-shadow: 0 0 0 3px rgba(34,211,238,0.15);
}
.edu-item h4 { font-size: 1.02rem; margin-bottom: 0.2rem; }
.edu-sub { color: var(--text-dim); font-size: 0.9rem; }
.edu-meta { color: var(--text-dimmer); font-size: 0.82rem; font-family: var(--font-mono); margin-top: 2px; }

/* ============ Timeline (Experience) ============ */
.timeline { position: relative; padding-left: 2.4rem; }
.timeline-line {
  position: absolute;
  left: 5px; top: 6px; bottom: 6px;
  width: 2px;
  background: var(--border);
}
.timeline-line-fill {
  width: 100%;
  height: 0%;
  background: var(--gradient);
  transition: height 0.3s;
}
.timeline-item { position: relative; margin-bottom: 2.6rem; }
.timeline-item:last-child { margin-bottom: 0; }
.timeline-marker {
  position: absolute;
  left: -2.4rem; top: 6px;
  width: 12px; height: 12px;
  border-radius: 50%;
  background: var(--bg-alt);
  border: 2px solid var(--accent-2);
  box-shadow: 0 0 0 4px rgba(34,211,238,0.1);
}
.timeline-card {
  position: relative;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 1.8rem 2rem;
  box-shadow: var(--shadow-sm);
  transition: border-color 0.3s, transform 0.3s var(--ease), box-shadow 0.3s;
}
.timeline-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--gradient);
  opacity: 0;
  transform: scaleX(0.5);
  transform-origin: left;
  transition: opacity 0.3s, transform 0.4s var(--ease);
}
.timeline-card:hover {
  border-color: rgba(124,92,255,0.4);
  box-shadow: var(--shadow-md);
}
.timeline-card:hover::before { opacity: 1; transform: scaleX(1); }
.timeline-card-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.3rem;
}
.timeline-card-head h3 { font-size: 1.15rem; }
.timeline-date {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--accent-2);
}
.timeline-org { color: var(--text-dim); font-size: 0.9rem; margin-bottom: 1rem; }
.timeline-points { display: flex; flex-direction: column; gap: 0.5rem; margin-bottom: 1.2rem; }
.timeline-points li {
  position: relative;
  padding-left: 1.1rem;
  color: var(--text-dim);
  font-size: 0.92rem;
}
.timeline-points li::before {
  content: '';
  position: absolute;
  left: 0; top: 0.55em;
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--accent);
}

.tag-row { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.tag {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  padding: 4px 10px;
  border-radius: 6px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text-dim);
}

/* ============ Projects ============ */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: 1.8rem;
}
.project-card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 22px;
  padding: 2.2rem;
  box-shadow: var(--shadow-sm);
  transform-style: preserve-3d;
  transition: border-color 0.3s, box-shadow 0.3s;
  overflow: hidden;
}
.project-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--gradient);
  opacity: 0;
  transform: scaleX(0.5);
  transform-origin: left;
  transition: opacity 0.3s, transform 0.4s var(--ease);
}
.project-card:hover { border-color: rgba(124,92,255,0.35); box-shadow: var(--shadow-md); }
.project-card:hover::before { opacity: 1; transform: scaleX(1); }
.project-glow {
  position: absolute;
  width: 300px; height: 300px;
  background: radial-gradient(circle, rgba(124,92,255,0.15), transparent 70%);
  top: var(--my, 0px); left: var(--mx, 0px);
  transform: translate(-50%,-50%);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s;
}
.project-card:hover .project-glow { opacity: 1; }
.project-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}
.project-icon {
  font-size: 2rem;
  width: 56px; height: 56px;
  display: flex; align-items: center; justify-content: center;
  background: var(--surface-2);
  border-radius: 14px;
}
.project-date { font-family: var(--font-mono); font-size: 0.75rem; color: var(--text-dimmer); }
.project-card h3 { font-size: 1.4rem; margin-bottom: 0.2rem; }
.project-sub { color: var(--accent-2); font-size: 0.9rem; margin-bottom: 0.9rem; }
.project-desc { color: var(--text-dim); font-size: 0.94rem; margin-bottom: 0.9rem; }
.project-points { margin-bottom: 1.2rem; display: flex; flex-direction: column; gap: 0.4rem; }
.project-points li {
  position: relative;
  padding-left: 1.1rem;
  color: var(--text-dim);
  font-size: 0.88rem;
}
.project-points li::before {
  content: '';
  position: absolute;
  left: 0; top: 0.5em;
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--accent-2);
}
.project-card .tag-row { margin-bottom: 1.4rem; }
.project-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.9rem;
  color: var(--text);
  font-weight: 500;
  border-bottom: 1px solid var(--border);
  padding-bottom: 2px;
  transition: color 0.25s, border-color 0.25s, gap 0.25s;
}
.project-link:hover { color: var(--accent-2); border-color: var(--accent-2); gap: 10px; }

/* ============ Skills ============ */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 1.6rem;
  margin-bottom: 3rem;
}
.skill-group h4 {
  font-size: 0.9rem;
  color: var(--text-dimmer);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 0.9rem;
  font-family: var(--font-mono);
  font-weight: 500;
}
.pill-row { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.pill {
  padding: 7px 14px;
  border-radius: 100px;
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  font-size: 0.85rem;
  color: var(--text-dim);
  transition: color 0.25s, border-color 0.25s, transform 0.3s var(--pop-ease), background 0.25s, box-shadow 0.3s;
}
.pill:hover {
  color: var(--bg);
  background: var(--gradient);
  border-color: transparent;
  box-shadow: var(--shadow-glow);
  transform: translateY(-3px) scale(1.07);
}

.cert-achieve-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.6rem;
}
.mini-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 1.8rem;
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.3s, border-color 0.3s;
}
.mini-card:hover { border-color: rgba(124,92,255,0.3); box-shadow: var(--shadow-md); }
.mini-card h4 { font-size: 1rem; margin-bottom: 1rem; color: var(--accent-2); }
.mini-card ul { display: flex; flex-direction: column; gap: 0.7rem; }
.mini-card li {
  position: relative;
  padding-left: 1.1rem;
  color: var(--text-dim);
  font-size: 0.9rem;
}
.mini-card li::before {
  content: '';
  position: absolute;
  left: 0; top: 0.5em;
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--accent);
}
.mini-card strong { color: var(--text); font-weight: 500; }

/* ============ Contact ============ */
.contact-section { text-align: center; }
.contact-desc { color: var(--text-dim); max-width: 500px; margin: 0 auto 3rem; }
.contact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
  max-width: 700px;
  margin: 0 auto 2.5rem;
}
.contact-card {
  display: flex;
  align-items: center;
  gap: 10px;
  justify-content: center;
  padding: 1.2rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  font-size: 0.92rem;
  color: var(--text-dim);
  box-shadow: var(--shadow-sm);
  transition: border-color 0.3s, color 0.3s, box-shadow 0.3s;
}
.contact-card:hover {
  border-color: var(--accent-2);
  color: var(--text);
  box-shadow: var(--shadow-glow);
}
.location-line {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text-dimmer);
  font-size: 0.9rem;
  font-family: var(--font-mono);
}

/* ============ Footer ============ */
.footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 2rem 6vw 3rem;
  border-top: 1px solid var(--border);
  color: var(--text-dimmer);
  font-size: 0.85rem;
}
.to-top {
  width: 42px; height: 42px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-dim);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: border-color 0.25s, color 0.25s, transform 0.25s;
}
.to-top:hover { border-color: var(--accent-2); color: var(--accent-2); box-shadow: var(--shadow-glow); }

/* ============ Magnetic ============ */
.magnetic { transition: transform 0.2s var(--ease); }

/* ============ Tooltips ============ */
[data-tooltip] { position: relative; }
[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 12px);
  left: 50%;
  transform: translate(-50%, 6px);
  background: var(--surface-2);
  color: var(--text);
  border: 1px solid var(--border);
  padding: 6px 12px;
  border-radius: 8px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  box-shadow: var(--shadow-sm);
  transition: opacity 0.25s ease, transform 0.25s var(--pop-ease);
  z-index: 20;
}
[data-tooltip]::before {
  content: '';
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  border: 5px solid transparent;
  border-top-color: var(--surface-2);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
  z-index: 20;
}
[data-tooltip]:hover::after,
[data-tooltip]:focus-visible::after { opacity: 1; transform: translate(-50%, 0); }
[data-tooltip]:hover::before,
[data-tooltip]:focus-visible::before { opacity: 1; }

[data-tooltip].tooltip-bottom::after {
  bottom: auto;
  top: calc(100% + 12px);
  transform: translate(-50%, -6px);
}
[data-tooltip].tooltip-bottom::before {
  bottom: auto;
  top: calc(100% + 6px);
  border-top-color: transparent;
  border-bottom-color: var(--surface-2);
}
[data-tooltip].tooltip-bottom:hover::after,
[data-tooltip].tooltip-bottom:focus-visible::after { transform: translate(-50%, 0); }

/* ============ Responsive ============ */

/* Tablets */
@media (max-width: 1024px) {
  .section { padding: 90px 0; }
  .hero { padding: 110px 6vw 50px; }
  .projects-grid { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
}

@media (max-width: 900px) {
  .nav-links { display: none; }
  .nav-toggle { display: flex; }
  .about-grid { grid-template-columns: 1fr; gap: 2.2rem; }
}

/* Small tablets / large phones */
@media (max-width: 768px) {
  .section { padding: 72px 0; }
  .section-title { margin-bottom: 2.4rem; }
  .container { padding: 0 5.5vw; }
  .timeline { padding-left: 2rem; }
  .timeline-marker { left: -2rem; }
  .timeline-card { padding: 1.5rem 1.6rem; }
  .about-stats { gap: 0.7rem; }
  .stat-card { min-width: 100px; padding: 1.1rem 0.8rem; }
  .project-card { padding: 1.8rem; }
  .about-card, .mini-card { padding: 1.5rem; }
}

@media (max-width: 560px) {
  .hero-cta { flex-direction: column; width: 100%; }
  .hero-cta .btn { width: 100%; justify-content: center; }
  .footer { flex-direction: column; gap: 1rem; text-align: center; }
  .nav a.btn-small { display: none; }
}

/* Phones */
@media (max-width: 480px) {
  .nav { padding: 16px 5vw; }
  .nav.scrolled { padding: 12px 5vw; }
  .nav-logo { font-size: 1.1rem; }
  .nav-actions { gap: 0.6rem; }
  .theme-toggle { width: 36px; height: 36px; }

  .hero { padding: 100px 5vw 40px; }
  .blob-1 { width: 240px; height: 240px; filter: blur(60px); }
  .blob-2 { width: 220px; height: 220px; filter: blur(60px); }
  .blob-3 { width: 180px; height: 180px; filter: blur(50px); }

  .hero-eyebrow { font-size: 0.72rem; padding: 6px 12px; }
  .hero-social { gap: 0.9rem; }

  .about-stats { flex-direction: column; }
  .stat-card { display: flex; align-items: center; justify-content: space-between; flex-direction: row; padding: 0.9rem 1.2rem; }
  .stat-num { font-size: 1.5rem; }

  .timeline { padding-left: 1.6rem; }
  .timeline-marker { left: -1.6rem; }
  .timeline-card-head { flex-direction: column; align-items: flex-start; gap: 0.2rem; }

  .project-top { flex-wrap: wrap; gap: 0.6rem; }
  .contact-grid { grid-template-columns: 1fr; }
  .to-top { width: 38px; height: 38px; }
}

/* ============================================================
   Hero extras: floating tech chips, AI mascot, GitHub activity
   ============================================================ */

:root {
  --band: rgba(255,255,255,0.022);
  --chip-op: 0.55;
  --chip-bg: rgba(255,255,255,0.035);
  --bot-body: #1c1c28;
  --bot-body-2: #262635;
  --bot-screen: #0a0a12;
  --bot-line: rgba(255,255,255,0.14);
  --bot-shadow: rgba(0,0,0,0.5);
  --gh-panel: rgba(255,255,255,0.028);
  --gh-0: rgba(255,255,255,0.055);
  --gh-1: #0e4429;
  --gh-2: #006d32;
  --gh-3: #26a641;
  --gh-4: #39d353;
  --gh-glow: rgba(57,211,83,0.7);
}

[data-theme="light"] {
  --band: rgba(20,20,26,0.035);
  --chip-bg: rgba(255,255,255,0.62);
  --bot-body: #ffffff;
  --bot-body-2: #e6e6ef;
  --bot-screen: #15151f;
  --bot-line: rgba(20,20,26,0.2);
  --bot-shadow: rgba(20,20,26,0.2);
  --gh-panel: rgba(255,255,255,0.6);
  --gh-0: rgba(20,20,26,0.07);
  --gh-1: #9be9a8;
  --gh-2: #40c463;
  --gh-3: #30a14e;
  --gh-4: #216e39;
  --gh-glow: rgba(33,110,57,0.55);
}

/* ---------- Page-wide ambient backdrop ---------- */
/* Fixed so the hero's blob + grid atmosphere carries through every section.
   z-index:-1 keeps it above the body canvas but behind ALL content — at z-index:0
   this positioned layer would paint over in-flow text such as the footer. */
.page-ambient {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  overflow: hidden;
}

/* ---------- Floating tech chips ---------- */
.tech-orbit,
.section-bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}
.tech-orbit { z-index: 1; }
.tech-chip {
  position: absolute;
  left: var(--x);
  top: var(--y);
  width: 46px;
  height: 46px;
  margin: -23px 0 0 -23px;
  transform: translate3d(calc(var(--px, 0px) * var(--p, 2)), calc(var(--py, 0px) * var(--p, 2)), 0);
  transition: transform 0.6s cubic-bezier(0.22, 0.61, 0.36, 1);
  will-change: transform;
}
.tech-chip svg {
  width: 100%;
  height: 100%;
  padding: 12px;
  border-radius: 15px;
  border: 1px solid var(--border);
  background: var(--chip-bg);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  color: var(--accent-2);
  opacity: var(--chip-op);
  animation: chipFloat var(--dur, 15s) ease-in-out var(--d, 0s) infinite;
  transition: opacity 0.4s ease, color 0.4s ease, box-shadow 0.4s ease;
}
.tech-chip:nth-child(3n+2) svg { color: var(--accent); }
.tech-chip:nth-child(3n) svg   { color: var(--accent-3); }

.hero:hover .tech-chip svg,
.section:hover .tech-chip svg {
  opacity: 0.9;
  box-shadow: var(--shadow-sm);
}

@keyframes chipFloat {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  33%      { transform: translateY(-15px) rotate(6deg); }
  66%      { transform: translateY(10px) rotate(-5deg); }
}

/* ---------- AI mascot ---------- */
.ai-buddy {
  position: absolute;
  right: 2.5vw;
  top: 50%;
  width: clamp(150px, 14vw, 205px);
  transform: translateY(-50%);
  z-index: 3;
  cursor: none;
  outline: none;
  -webkit-tap-highlight-color: transparent;
}
.buddy-svg {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
  transition: transform 0.5s var(--pop-ease);
}
.ai-buddy:hover .buddy-svg,
.ai-buddy:focus-visible .buddy-svg { transform: scale(1.06); }

#buddyGrad .g1, #buddyGrad2 .g1 { stop-color: var(--accent); }
#buddyGrad .g2, #buddyGrad2 .g2 { stop-color: var(--accent-2); }

.bot-shadow {
  fill: var(--bot-shadow);
  filter: blur(4px);
  transform-box: view-box;
  transform-origin: 100px 229px;
  animation: botShadow 4.5s ease-in-out infinite;
}
@keyframes botShadow {
  0%, 100% { transform: scale(1);    opacity: 0.55; }
  50%      { transform: scale(0.84); opacity: 0.3; }
}

.buddy-float {
  transform-box: view-box;
  transform-origin: 100px 200px;
  animation: buddyFloat 4.5s ease-in-out infinite;
}
@keyframes buddyFloat {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-10px); }
}

.bot-headshell, .bot-body {
  fill: var(--bot-body);
  stroke: var(--bot-line);
  stroke-width: 2.5;
}
.bot-face, .bot-screen { fill: var(--bot-screen); }
.bot-ear, .bot-limb, .bot-neck, .bot-hand { fill: url(#buddyGrad); }
.bot-foot { fill: var(--bot-body-2); }
.arm path {
  fill: none;
  stroke: url(#buddyGrad2);
  stroke-width: 7;
  stroke-linecap: round;
}
.bot-antenna {
  stroke: var(--bot-line);
  stroke-width: 3.5;
  stroke-linecap: round;
}
.bot-bulb {
  fill: var(--accent-3);
  filter: drop-shadow(0 0 5px var(--accent-3));
  transform-box: view-box;
  transform-origin: 100px 20px;
  animation: botBulb 1.9s ease-in-out infinite;
}
@keyframes botBulb {
  0%, 100% { opacity: 0.5; transform: scale(0.88); }
  50%      { opacity: 1;   transform: scale(1.14); }
}

.eye {
  fill: var(--accent-2);
  filter: drop-shadow(0 0 5px var(--accent-2));
}
.pupil {
  fill: #05121a;
  transform-box: view-box;
  transform: translate(var(--eye-x, 0px), var(--eye-y, 0px));
  transition: transform 0.18s ease-out;
}
.eye-group {
  transform-box: view-box;
  transform-origin: 100px 80px;
  transition: transform 0.09s ease;
}
.ai-buddy.blink .eye-group { transform: scaleY(0.08); }

.bot-head {
  transform-box: view-box;
  transform-origin: 100px 118px;
  transform: rotate(var(--tilt, 0deg));
  transition: transform 0.5s var(--ease);
}
.bot-mouth {
  fill: none;
  stroke: var(--accent-2);
  stroke-width: 3;
  stroke-linecap: round;
  transform-box: view-box;
  transform-origin: 100px 96px;
  transition: transform 0.35s var(--pop-ease);
}
.ai-buddy:hover .bot-mouth,
.ai-buddy:focus-visible .bot-mouth { transform: scale(1.3, 1.6); }

.code-lines rect {
  fill: var(--accent-2);
  transform-box: fill-box;
  transform-origin: left center;
  animation: codeType 2.4s ease-in-out infinite;
}
.code-lines rect:nth-child(2) { fill: var(--accent-3); animation-delay: 0.35s; }
.code-lines rect:nth-child(3) { fill: var(--accent);   animation-delay: 0.7s; }
@keyframes codeType {
  0%        { transform: scaleX(0.12); opacity: 0.25; }
  30%, 75%  { transform: scaleX(1);    opacity: 0.9; }
  100%      { transform: scaleX(0.12); opacity: 0.25; }
}

.arm-right { transform-box: view-box; transform-origin: 138px 150px; animation: armIdle 5s ease-in-out infinite; }
.arm-left  { transform-box: view-box; transform-origin: 62px 150px;  animation: armIdle 5s ease-in-out 0.7s infinite reverse; }
@keyframes armIdle {
  0%, 100% { transform: rotate(0deg); }
  50%      { transform: rotate(5deg); }
}
.ai-buddy:hover .arm-right,
.ai-buddy:focus-visible .arm-right,
.ai-buddy.excited .arm-right { animation: botWave 1s ease-in-out infinite; }
@keyframes botWave {
  0%, 100% { transform: rotate(-6deg); }
  25%      { transform: rotate(-46deg); }
  50%      { transform: rotate(-16deg); }
  75%      { transform: rotate(-42deg); }
}

.buddy-bubble {
  position: absolute;
  bottom: calc(100% - 8px);
  left: 50%;
  width: max-content;
  max-width: 200px;
  padding: 9px 14px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  line-height: 1.5;
  text-align: center;
  box-shadow: var(--shadow-md);
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 10px) scale(0.9);
  transition: opacity 0.3s ease, transform 0.45s var(--pop-ease);
  z-index: 4;
}
.buddy-bubble::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 7px solid transparent;
  border-top-color: var(--surface);
}
.ai-buddy.talking .buddy-bubble { opacity: 1; transform: translate(-50%, 0) scale(1); }

/* ---------- GitHub activity graph ---------- */
.gh-activity {
  --gh-cell: 10px;
  --gh-gap: 3px;
  margin-top: 2.6rem;
  padding: 1.1rem 1.2rem 0.95rem;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: var(--gh-panel);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: var(--shadow-sm);
  text-align: left;
  transition: border-color 0.35s ease, box-shadow 0.35s ease, background-color 0.4s ease;
}
.gh-activity:hover {
  border-color: var(--gh-glow);
  box-shadow: var(--shadow-md);
}

.gh-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 0.85rem;
}
.gh-title {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  font-weight: 600;
}
.gh-title svg { color: var(--text-dim); }
.gh-total {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-dim);
}
.gh-total strong { color: var(--gh-4); font-weight: 600; }

.gh-graph-wrap { display: flex; align-items: flex-start; gap: 7px; }
.gh-days {
  display: grid;
  grid-template-rows: repeat(7, var(--gh-cell));
  gap: var(--gh-gap);
  padding-top: 16px;
  font-family: var(--font-mono);
  font-size: 0.55rem;
  line-height: var(--gh-cell);
  color: var(--text-dimmer);
}
.gh-days span:nth-child(1) { grid-row: 2; }
.gh-days span:nth-child(2) { grid-row: 4; }
.gh-days span:nth-child(3) { grid-row: 6; }

.gh-scroll {
  flex: 1;
  min-width: 0;
  overflow-x: auto;
  overflow-y: hidden;
  padding-bottom: 2px;
  scrollbar-width: thin;
}
.gh-scroll::-webkit-scrollbar { height: 5px; }
.gh-scroll::-webkit-scrollbar-thumb { background: var(--border); border-radius: 5px; }

.gh-months {
  position: relative;
  height: 16px;
  font-family: var(--font-mono);
  font-size: 0.55rem;
  color: var(--text-dimmer);
}
.gh-months span { position: absolute; top: 0; white-space: nowrap; }

.gh-grid {
  display: grid;
  grid-auto-flow: column;
  grid-template-rows: repeat(7, var(--gh-cell));
  grid-auto-columns: var(--gh-cell);
  gap: var(--gh-gap);
  width: max-content;
}
.gh-cell {
  width: var(--gh-cell);
  height: var(--gh-cell);
  border-radius: 2px;
  background: var(--gh-0);
  opacity: 0;
  transform: scale(0.3);
  transition: background-color 0.4s ease;
}
.gh-cell.pad { visibility: hidden; }
.gh-cell.l1 { background: var(--gh-1); }
.gh-cell.l2 { background: var(--gh-2); }
.gh-cell.l3 { background: var(--gh-3); }
.gh-cell.l4 { background: var(--gh-4); }

.gh-activity.loaded .gh-cell {
  animation: ghPop 0.45s var(--pop-ease) forwards;
  animation-delay: calc(var(--col, 0) * 11ms);
}
.gh-activity.loaded .gh-cell.hot {
  animation: ghPop 0.45s var(--pop-ease) forwards,
             ghGlow 3s ease-in-out infinite;
}
@keyframes ghPop { to { opacity: 1; transform: scale(1); } }
@keyframes ghGlow {
  0%, 100% { box-shadow: 0 0 0 rgba(57,211,83,0); }
  50%      { box-shadow: 0 0 7px var(--gh-glow); }
}
.gh-cell.today { box-shadow: 0 0 0 1.5px var(--gh-4); }
.gh-cell:hover { outline: 1.5px solid var(--text); outline-offset: 1px; }

.gh-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-top: 0.75rem;
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--text-dimmer);
}
.gh-streaks { display: flex; gap: 1.1rem; flex-wrap: wrap; }
.gh-streaks b { color: var(--text-dim); font-weight: 500; }
.gh-legend { display: inline-flex; align-items: center; gap: 3px; margin-left: auto; }
.gh-legend i { width: 10px; height: 10px; border-radius: 2px; }
.gh-legend .l0 { background: var(--gh-0); }
.gh-legend .l1 { background: var(--gh-1); }
.gh-legend .l2 { background: var(--gh-2); }
.gh-legend .l3 { background: var(--gh-3); }
.gh-legend .l4 { background: var(--gh-4); }

.gh-tip {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 1000;
  padding: 6px 10px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 0.68rem;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  box-shadow: var(--shadow-sm);
  transition: opacity 0.18s ease;
}
.gh-tip.show { opacity: 1; }

/* ---------- Responsive ---------- */
@media (max-width: 1180px) {
  .ai-buddy {
    width: 130px;
    right: 1vw;
    top: auto;
    bottom: 24px;
    transform: none;
  }
  .buddy-bubble { max-width: 160px; font-size: 0.66rem; }
}

@media (max-width: 900px) {
  .ai-buddy { display: none; }
  .tech-chip:nth-child(4), .tech-chip:nth-child(9) { display: none; }
}

@media (max-width: 768px) {
  /* chips sit behind body text at these widths — fade them so copy stays legible */
  :root { --chip-op: 0.3; }
  .gh-activity { --gh-cell: 9px; --gh-gap: 2.5px; }
  .tech-chip { width: 38px; height: 38px; margin: -19px 0 0 -19px; }
  .tech-chip svg { padding: 9px; border-radius: 12px; }
}

@media (max-width: 560px) {
  /* longest typed phrase wraps to 2 lines here; reserve the height so the
     hero doesn't jump as the roles cycle */
  .hero-role { min-height: 3.3em; }
  .gh-activity { --gh-cell: 8px; --gh-gap: 2px; padding: 0.9rem 1rem 0.8rem; margin-top: 2rem; }
  .gh-days { display: none; }
  .gh-legend { margin-left: 0; }
  .tech-chip:nth-child(5), .tech-chip:nth-child(8) { display: none; }
}

@media (hover: none) {
  .hero:hover .tech-chip svg,
  .section:hover .tech-chip svg { opacity: var(--chip-op); box-shadow: none; }
}

/* Short laptop viewports: keep the hero close to a single screen */
@media (min-width: 561px) and (max-height: 860px) {
  .hero { padding-top: 104px; }
  .hero-eyebrow { margin-bottom: 1.2rem; }
  .hero-desc { margin-bottom: 1.8rem; }
  .hero-cta { margin-bottom: 1.8rem; }
  .gh-activity { margin-top: 1.8rem; }
}

@media (prefers-reduced-motion: reduce) {
  .tech-chip svg,
  .buddy-float,
  .bot-shadow,
  .bot-bulb,
  .code-lines rect,
  .arm,
  .ai-buddy:hover .arm-right,
  .ai-buddy:focus-visible .arm-right,
  .ai-buddy.excited .arm-right,
  .gh-activity.loaded .gh-cell,
  .gh-activity.loaded .gh-cell.hot { animation: none !important; }

  .tech-chip { transition: none; }
  .gh-activity .gh-cell { opacity: 1 !important; transform: none !important; }
}
