/* =========================================================
   Design tokens
   ========================================================= */
:root {
  --bg-0: #05060A;
  --bg-1: #0B0F1A;
  --bg-2: #111827;
  --border: #1F2937;
  --text-0: #E6EDF3;
  --text-1: #9CA3AF;
  --accent-cyan: #22D3EE;
  --accent-mag: #D946EF;
  --accent-lime: #A3E635;
  --glow-cyan: 0 0 12px rgba(34, 211, 238, 0.55);
  --glow-cyan-strong: 0 0 24px rgba(34, 211, 238, 0.75);
  --glow-mag: 0 0 14px rgba(217, 70, 239, 0.55);

  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  --font-sans: 'Inter', system-ui, -apple-system, Segoe UI, Roboto, sans-serif;

  --nav-height: 64px;
}

/* =========================================================
   Reset & base
   ========================================================= */
* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  background: var(--bg-0);
}

body {
  margin: 0;
  font-family: var(--font-sans);
  color: var(--text-0);
  background: var(--bg-0);
  line-height: 1.6;
  overflow-x: hidden;
  visibility: hidden; /* shown by scripts.js after DOM ready (FOUC guard) */
}

body.is-ready { visibility: visible; }

a { color: var(--accent-cyan); text-decoration: none; }
a:hover { color: var(--accent-mag); }

img { max-width: 100%; height: auto; display: block; }

::selection { background: var(--accent-cyan); color: var(--bg-0); }

/* Subtle starfield-style page background grid */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(34, 211, 238, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(34, 211, 238, 0.04) 1px, transparent 1px);
  background-size: 48px 48px;
  z-index: 0;
  mask-image: radial-gradient(ellipse at center, rgba(0,0,0,0.9), transparent 70%);
}

/* =========================================================
   Typography helpers
   ========================================================= */
.mono { font-family: var(--font-mono); }
.kicker {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--text-1);
  letter-spacing: 0.05em;
}
.kicker .accent { color: var(--accent-cyan); }

h1, h2, h3 { font-family: var(--font-mono); letter-spacing: -0.01em; margin: 0; }
h1 { font-weight: 700; }
h2 { font-weight: 700; }
h3 { font-weight: 500; }

.section-title {
  font-size: clamp(1.75rem, 3vw, 2.5rem);
  margin-bottom: 0.5rem;
}
.section-title .index {
  color: var(--text-1);
  font-weight: 500;
  font-size: 0.8em;
  margin-right: 0.5rem;
}

/* =========================================================
   Layout
   ========================================================= */
.section {
  position: relative;
  padding: 6rem 1.5rem;
  scroll-margin-top: calc(var(--nav-height) + 8px);
  z-index: 1;
}
.section--alt { background: var(--bg-1); }
.container { max-width: 1100px; margin: 0 auto; }

/* Ambient glow orbs on the fully-dark sections */
.section:not(.section--alt) { overflow: hidden; }
.section:not(.section--alt) > .container {
  position: relative;
  z-index: 1;
}
.section:not(.section--alt)::before,
.section:not(.section--alt)::after {
  content: '';
  position: absolute;
  width: 720px;
  height: 720px;
  border-radius: 50%;
  filter: blur(100px);
  opacity: 0.3;
  pointer-events: none;
  z-index: 0;
  will-change: transform;
}
.section:not(.section--alt)::before {
  background: radial-gradient(circle, rgba(34, 211, 238, 0.7) 0%, transparent 65%);
  top: -260px;
  left: -240px;
  animation: orbDriftA 26s ease-in-out infinite;
}
.section:not(.section--alt)::after {
  background: radial-gradient(circle, rgba(217, 70, 239, 0.55) 0%, transparent 65%);
  bottom: -260px;
  right: -240px;
  animation: orbDriftB 32s ease-in-out infinite;
}
/* Stagger the loops so adjacent dark sections aren't in sync */
#experience::before { animation-delay: 0s; }
#experience::after  { animation-delay: -6s; }
#skills::before     { animation-delay: -10s; }
#skills::after      { animation-delay: -16s; }
#contact::before    { animation-delay: -18s; }
#contact::after     { animation-delay: -22s; }
@media (max-width: 899px) {
  /* Same story for section orbs — freeze + lower blur radius on mobile. */
  .section:not(.section--alt)::before,
  .section:not(.section--alt)::after {
    width: 500px;
    height: 500px;
    filter: blur(40px);
    opacity: 0.22;
    animation: none !important;
  }
  .section:not(.section--alt)::before { top: -180px; left: -160px; }
  .section:not(.section--alt)::after  { bottom: -180px; right: -160px; }
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--accent-cyan);
  color: var(--bg-0);
  padding: 0.5rem 1rem;
  font-family: var(--font-mono);
  z-index: 100;
}
.skip-link:focus { left: 1rem; top: 1rem; }

/* =========================================================
   Nav
   ========================================================= */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--nav-height);
  background: rgba(5, 6, 10, 0.75);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(34, 211, 238, 0.2);
  z-index: 50;
  display: flex;
  align-items: center;
}
.nav__inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1.5rem;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.nav__brand {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 1rem;
  color: var(--accent-cyan);
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}
.nav__brand::after {
  content: '_';
  color: var(--accent-cyan);
  animation: blink 1s steps(1) infinite;
}
.nav__links { display: none; gap: 1.5rem; list-style: none; margin: 0; padding: 0; }
@media (min-width: 768px) { .nav__links { display: flex; } }

.nav__link {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  color: var(--text-0);
  position: relative;
  padding: 0.25rem 0;
}
.nav__link::after {
  content: '';
  position: absolute;
  left: 0; right: 0; bottom: -4px;
  height: 2px;
  background: var(--accent-cyan);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 200ms ease;
}
.nav__link:hover, .nav__link.is-active { color: var(--accent-cyan); }
.nav__link:hover::after, .nav__link.is-active::after {
  transform: scaleX(1);
  box-shadow: var(--glow-cyan);
}

.nav__menu-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px; height: 40px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--accent-cyan);
  cursor: pointer;
}
@media (min-width: 768px) { .nav__menu-btn { display: none; } }

.nav__mobile {
  position: fixed;
  top: var(--nav-height);
  left: 0; right: 0;
  background: rgba(5, 6, 10, 0.95);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(34, 211, 238, 0.2);
  max-height: 0;
  overflow: hidden;
  transition: max-height 250ms ease;
  z-index: 49;
}
.nav__mobile.is-open { max-height: 400px; }
.nav__mobile ul { list-style: none; margin: 0; padding: 0.5rem 1.5rem 1rem; }
.nav__mobile li a {
  display: block;
  padding: 0.75rem 0;
  font-family: var(--font-mono);
  color: var(--text-0);
  border-bottom: 1px solid var(--border);
}
.nav__mobile li:last-child a { border-bottom: 0; }

/* =========================================================
   Hero
   ========================================================= */
.hero {
  position: relative;
  min-height: 100vh;
  padding: calc(var(--nav-height) + 4rem) 1.5rem 4rem;
  display: flex;
  align-items: center;
  overflow: hidden;
}
.hero #particles {
  position: absolute;
  inset: 0;
  z-index: 0;
}
.hero::after {
  /* radial vignette to fade particles into background at edges */
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at center, transparent 0%, var(--bg-0) 90%);
  pointer-events: none;
  z-index: 1;
}
.hero__inner {
  position: relative;
  z-index: 3;
  max-width: 1100px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr;
  gap: 3rem;
  align-items: center;
  width: 100%;
}

.hero__orb {
  position: absolute;
  width: 820px;
  height: 820px;
  border-radius: 50%;
  filter: blur(100px);
  opacity: 0.42;
  pointer-events: none;
  z-index: 2;
  will-change: transform;
}
.hero__orb--cyan {
  background: radial-gradient(circle, rgba(34, 211, 238, 0.7) 0%, transparent 65%);
  top: -280px;
  left: -240px;
  animation: orbDriftA 22s ease-in-out infinite;
}
.hero__orb--mag {
  background: radial-gradient(circle, rgba(217, 70, 239, 0.55) 0%, transparent 65%);
  bottom: -300px;
  right: -260px;
  animation: orbDriftB 28s ease-in-out infinite;
}
@media (max-width: 899px) {
  /* Mobile/tablet performance: shrink, drop blur radius, and freeze orb motion.
     Animated giant blurs are the #1 cost on mobile GPUs. */
  .hero__orb {
    width: 540px;
    height: 540px;
    filter: blur(40px);
    opacity: 0.32;
    animation: none !important;
  }
  .hero__orb--cyan { top: -160px; left: -160px; }
  .hero__orb--mag  { bottom: -180px; right: -180px; }
}
@keyframes orbDriftA {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33%      { transform: translate(80px, 60px) scale(1.08); }
  66%      { transform: translate(-50px, 90px) scale(0.95); }
}
@keyframes orbDriftB {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33%      { transform: translate(-70px, -50px) scale(1.06); }
  66%      { transform: translate(40px, -90px) scale(1.12); }
}
@media (min-width: 768px) {
  .hero__inner { grid-template-columns: 200px 1fr; }
}

.hero__avatar-wrap {
  position: relative;
  width: 180px;
  height: 180px;
  margin: 0 auto;
}
.hero__avatar {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  object-position: top;
  border: 2px solid var(--accent-cyan);
  box-shadow: var(--glow-cyan-strong);
  animation: float 6s ease-in-out infinite;
}
.hero__avatar-ring {
  position: absolute;
  inset: -10px;
  border-radius: 50%;
  border: 1px dashed rgba(34, 211, 238, 0.35);
  animation: spin 24s linear infinite;
}

.hero__headline { text-align: left; }
@media (max-width: 767px) { .hero__headline { text-align: center; } }

.hero__name {
  font-size: clamp(2.75rem, 7vw, 5rem);
  font-weight: 700;
  color: var(--text-0);
  margin: 0.5rem 0;
  letter-spacing: -0.02em;
  text-shadow: 0 0 24px rgba(34, 211, 238, 0.35);
}
.hero__name .accent { color: var(--accent-cyan); }

.hero__subtitle {
  font-family: var(--font-mono);
  font-size: clamp(1rem, 2vw, 1.25rem);
  color: var(--accent-cyan);
  min-height: 1.5em;
}
.hero__subtitle .caret {
  display: inline-block;
  width: 0.6em;
  background: var(--accent-cyan);
  margin-left: 2px;
  animation: blink 1s steps(1) infinite;
  color: transparent;
}

.hero__tagline {
  margin-top: 1rem;
  color: var(--text-1);
  max-width: 36rem;
  font-size: 1.05rem;
}

.hero__cta {
  margin-top: 2rem;
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}
@media (max-width: 767px) { .hero__cta { justify-content: center; } }

.hero__scroll {
  position: absolute;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%);
  font-family: var(--font-mono);
  color: var(--text-1);
  font-size: 0.8rem;
  z-index: 2;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  animation: bobUp 2.4s ease-in-out infinite;
}

/* =========================================================
   Buttons
   ========================================================= */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.25rem;
  font-family: var(--font-mono);
  font-size: 0.9rem;
  font-weight: 500;
  background: transparent;
  border: 1px solid var(--accent-cyan);
  color: var(--accent-cyan);
  border-radius: 6px;
  cursor: pointer;
  transition: all 180ms ease;
  text-decoration: none;
}
.btn:hover {
  background: var(--accent-cyan);
  color: var(--bg-0);
  box-shadow: var(--glow-cyan);
  transform: translateY(-2px);
}
.btn--mag { border-color: var(--accent-mag); color: var(--accent-mag); }
.btn--mag:hover { background: var(--accent-mag); color: var(--bg-0); box-shadow: var(--glow-mag); }

/* =========================================================
   About
   ========================================================= */
.about__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 3rem;
}
@media (min-width: 900px) {
  .about__grid { grid-template-columns: 3fr 2fr; }
}
.about__text p { margin: 0 0 1rem; color: var(--text-0); }
.about__text p + p { color: var(--text-1); }

.stats {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.5rem;
  position: relative;
  overflow: hidden;
}
.stats::before {
  content: '> stats.json';
  position: absolute;
  top: 0.6rem; left: 1rem;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-1);
}
.stats { padding-top: 2.5rem; }

.stat {
  text-align: left;
  border-left: 2px solid var(--accent-cyan);
  padding-left: 1rem;
}
.stat__value {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 2.5rem;
  color: var(--accent-cyan);
  line-height: 1;
}
.stat__label {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-1);
  margin-top: 0.4rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* =========================================================
   Skills
   ========================================================= */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.25rem;
  margin-top: 2rem;
}

.skill-card {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.5rem;
  transition: transform 200ms ease, border-color 200ms ease, box-shadow 200ms ease;
}
.skill-card:hover {
  transform: translateY(-4px);
  border-color: var(--accent-cyan);
  box-shadow: var(--glow-cyan);
}
.skill-card__index {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-1);
}
.skill-card__title {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin: 0.5rem 0 1rem;
  font-size: 1.1rem;
  color: var(--text-0);
}
.skill-card__title i { color: var(--accent-cyan); }

.chips { display: flex; flex-wrap: wrap; gap: 0.4rem; list-style: none; margin: 0; padding: 0; }
.chip {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  padding: 0.25rem 0.6rem;
  background: var(--bg-1);
  border: 1px solid rgba(34, 211, 238, 0.3);
  color: var(--text-0);
  border-radius: 4px;
  transition: all 150ms ease;
}
.skill-card:hover .chip { border-color: var(--accent-cyan); color: var(--accent-cyan); }
.chip--mag { border-color: rgba(217, 70, 239, 0.4); }
.chip--lime { border-color: rgba(163, 230, 53, 0.4); }

/* =========================================================
   Experience timeline
   ========================================================= */
.timeline {
  position: relative;
  margin-top: 2rem;
}
.timeline::before {
  content: '';
  position: absolute;
  left: 18px;
  top: 0; bottom: 0;
  width: 2px;
  background: linear-gradient(to bottom, transparent, rgba(34, 211, 238, 0.35), transparent);
}
@media (min-width: 900px) {
  .timeline::before { left: 50%; transform: translateX(-1px); }
}

.tl-item {
  position: relative;
  padding-left: 50px;
  margin-bottom: 2.5rem;
}
@media (min-width: 900px) {
  .tl-item { width: 50%; padding-left: 0; padding-right: 3rem; }
  .tl-item:nth-child(even) { margin-left: 50%; padding-right: 0; padding-left: 3rem; }
}

.tl-dot {
  position: absolute;
  left: 12px;
  top: 8px;
  width: 14px; height: 14px;
  border-radius: 50%;
  background: var(--accent-cyan);
  box-shadow: var(--glow-cyan);
  z-index: 2;
}
@media (min-width: 900px) {
  .tl-dot { left: auto; right: -7px; }
  .tl-item:nth-child(even) .tl-dot { left: -7px; right: auto; }
}
.tl-item.is-revealed .tl-dot { animation: pulse 1.6s ease-in-out infinite; }

.tl-card {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.5rem;
  position: relative;
  transition: border-color 200ms ease, box-shadow 200ms ease;
}
.tl-card:hover { border-color: var(--accent-cyan); box-shadow: var(--glow-cyan); }

.tl-card__head {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1rem;
}
.tl-card__img {
  width: 56px; height: 56px;
  border-radius: 8px;
  object-fit: cover;
  border: 1px solid var(--accent-cyan);
  box-shadow: var(--glow-cyan);
  flex-shrink: 0;
}
.tl-card__title { font-size: 1.05rem; color: var(--text-0); margin: 0; }
.tl-card__meta {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-1);
  margin-top: 0.25rem;
}
.tl-card__date { color: var(--accent-cyan); }

.tl-card ul {
  list-style: none;
  padding: 0;
  margin: 0 0 1rem;
}
.tl-card ul li {
  position: relative;
  padding-left: 1.25rem;
  margin-bottom: 0.5rem;
  color: var(--text-1);
  font-size: 0.95rem;
}
.tl-card ul li::before {
  content: '▸';
  position: absolute;
  left: 0;
  color: var(--accent-cyan);
  font-family: var(--font-mono);
}

/* =========================================================
   Education
   ========================================================= */
.edu-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
  margin-top: 2rem;
}
@media (min-width: 768px) {
  .edu-grid { grid-template-columns: 1fr 1fr; }
}
.edu-card {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.5rem;
  transition: border-color 200ms ease, box-shadow 200ms ease;
}
.edu-card:hover { border-color: var(--accent-cyan); box-shadow: var(--glow-cyan); }
.edu-card__head { display: flex; align-items: center; gap: 1rem; margin-bottom: 1rem; }
.edu-card__logo {
  width: 64px; height: 64px;
  object-fit: contain;
  background: var(--bg-1);
  border-radius: 8px;
  padding: 6px;
  border: 1px solid var(--border);
}
.edu-card__title { font-size: 1.05rem; color: var(--text-0); }
.edu-card__sub {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-1);
  margin-top: 0.25rem;
}
.edu-card__sub .accent { color: var(--accent-cyan); }
.edu-card__courses {
  margin-top: 1rem;
  color: var(--text-1);
  font-size: 0.9rem;
}
.edu-card__courses strong { color: var(--text-0); font-family: var(--font-mono); }

/* =========================================================
   Projects
   ========================================================= */
.projects-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
  margin-top: 2rem;
}
@media (min-width: 900px) {
  .projects-grid { grid-template-columns: 1fr 1fr; }
}

.proj-card {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: border-color 200ms ease, box-shadow 200ms ease, transform 200ms ease;
}
.proj-card:hover {
  border-color: var(--accent-mag);
  box-shadow: var(--glow-mag);
  transform: translateY(-4px);
}
.proj-card__cover {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: var(--bg-1);
}
.proj-card__cover img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform 400ms ease;
}
.proj-card:hover .proj-card__cover img { transform: scale(1.06); }
.proj-card__cover::after {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(135deg, transparent 40%, rgba(217, 70, 239, 0.18) 100%);
  opacity: 0;
  transition: opacity 300ms ease;
}
.proj-card:hover .proj-card__cover::after { opacity: 1; }

.proj-card__body { padding: 1.5rem; }
.proj-card__index { font-family: var(--font-mono); font-size: 0.75rem; color: var(--text-1); }
.proj-card__title { font-size: 1.15rem; color: var(--text-0); margin: 0.5rem 0; }
.proj-card__meta {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--accent-cyan);
  margin-bottom: 1rem;
}
.proj-card__body ul { list-style: none; padding: 0; margin: 0 0 1rem; }
.proj-card__body ul li {
  position: relative;
  padding-left: 1.25rem;
  margin-bottom: 0.5rem;
  color: var(--text-1);
  font-size: 0.9rem;
}
.proj-card__body ul li::before {
  content: '▸';
  position: absolute; left: 0;
  color: var(--accent-mag);
  font-family: var(--font-mono);
}

/* =========================================================
   Contact
   ========================================================= */
.terminal {
  background: var(--bg-2);
  border: 1px solid var(--accent-cyan);
  border-radius: 12px;
  padding: 1.5rem;
  box-shadow: var(--glow-cyan);
  font-family: var(--font-mono);
  font-size: 0.95rem;
  line-height: 1.9;
  max-width: 640px;
  margin: 2rem auto;
  position: relative;
}
.terminal::before {
  content: '';
  position: absolute;
  top: 12px; left: 16px;
  width: 12px; height: 12px;
  border-radius: 50%;
  background: var(--accent-mag);
  box-shadow:
    20px 0 0 rgba(163, 230, 53, 0.7),
    40px 0 0 rgba(34, 211, 238, 0.7);
}
.terminal__body { margin-top: 1.5rem; }
.terminal__line { display: block; min-height: 1.5em; }
.terminal__prompt { color: var(--text-1); }
.terminal__cmd { color: var(--text-0); }
.terminal__out { color: var(--accent-cyan); padding-left: 1rem; }
.terminal__out a { color: var(--accent-cyan); }
.terminal__out a:hover { color: var(--accent-mag); }

.contact__cta {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: center;
  margin-top: 2rem;
}

/* =========================================================
   Footer
   ========================================================= */
.footer {
  background: var(--bg-1);
  border-top: 1px solid var(--border);
  padding: 2.5rem 1.5rem;
  text-align: center;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--text-1);
  z-index: 1;
  position: relative;
}
.footer__links {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 1rem;
}
.footer__pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 1rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text-0);
  transition: all 180ms ease;
}
.footer__pill:hover { border-color: var(--accent-cyan); color: var(--accent-cyan); box-shadow: var(--glow-cyan); }
.footer__socials { margin-top: 1rem; display: flex; gap: 1rem; justify-content: center; }
.footer__socials a { color: var(--text-1); font-size: 1.2rem; }
.footer__socials a:hover { color: var(--accent-cyan); }

/* =========================================================
   Reveal animations
   ========================================================= */
[data-reveal] {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 600ms cubic-bezier(0.22, 1, 0.36, 1),
              transform 600ms cubic-bezier(0.22, 1, 0.36, 1);
}
[data-reveal].is-revealed {
  opacity: 1;
  transform: translateY(0);
}

/* Timeline slide-in variants */
.tl-item[data-reveal] { transform: translateX(-30px); }
@media (min-width: 900px) {
  .tl-item:nth-child(even)[data-reveal] { transform: translateX(30px); }
}
.tl-item[data-reveal].is-revealed { transform: translateX(0); }

/* =========================================================
   Keyframes
   ========================================================= */
@keyframes blink {
  0%, 50% { opacity: 1; }
  50.01%, 100% { opacity: 0; }
}
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}
@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}
@keyframes bobUp {
  0%, 100% { transform: translate(-50%, 0); opacity: 0.6; }
  50% { transform: translate(-50%, -8px); opacity: 1; }
}
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 8px rgba(34, 211, 238, 0.4); }
  50% { box-shadow: 0 0 18px rgba(34, 211, 238, 0.9); }
}

/* =========================================================
   Hero status badges
   ========================================================= */
.status-row {
  list-style: none;
  margin: 1.25rem 0 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.status-row li {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.75rem;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-0);
  background: rgba(11, 15, 26, 0.7);
  border: 1px solid rgba(34, 211, 238, 0.25);
  border-radius: 999px;
  backdrop-filter: blur(4px);
}
.status-row li i { color: var(--accent-cyan); font-size: 0.8em; }
.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-lime);
  box-shadow: 0 0 8px rgba(163, 230, 53, 0.8);
}
.status-dot--live { animation: liveBlink 2s ease-in-out infinite; }
@keyframes liveBlink {
  0%, 100% { box-shadow: 0 0 6px rgba(163, 230, 53, 0.6); }
  50%      { box-shadow: 0 0 14px rgba(163, 230, 53, 1); }
}

/* =========================================================
   Glitch effect on hero name
   ========================================================= */
.glitch {
  position: relative;
  display: inline-block;
}
.glitch::before,
.glitch::after {
  content: attr(data-text);
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0;
  text-shadow: none;
}
.glitch::before { color: var(--accent-cyan); animation: glitchA 7s infinite steps(1); }
.glitch::after  { color: var(--accent-mag);  animation: glitchB 7s infinite steps(1); }
@keyframes glitchA {
  0%, 88%, 100% { opacity: 0; transform: translate(0, 0); clip-path: inset(0 0 0 0); }
  89% { opacity: 0.85; transform: translate(-3px, -1px); clip-path: inset(0 0 60% 0); }
  90% { opacity: 0.85; transform: translate(2px, 1px);   clip-path: inset(50% 0 20% 0); }
  91% { opacity: 0.85; transform: translate(-2px, 2px);  clip-path: inset(20% 0 50% 0); }
  92% { opacity: 0.85; transform: translate(3px, -2px);  clip-path: inset(70% 0 0 0); }
  93% { opacity: 0; }
}
@keyframes glitchB {
  0%, 88%, 100% { opacity: 0; transform: translate(0, 0); clip-path: inset(0 0 0 0); }
  89% { opacity: 0.85; transform: translate(3px, 1px);  clip-path: inset(0 0 60% 0); }
  90% { opacity: 0.85; transform: translate(-2px, -1px); clip-path: inset(50% 0 20% 0); }
  91% { opacity: 0.85; transform: translate(2px, -2px);  clip-path: inset(20% 0 50% 0); }
  92% { opacity: 0.85; transform: translate(-3px, 2px);  clip-path: inset(70% 0 0 0); }
  93% { opacity: 0; }
}

/* =========================================================
   Headshot duotone + scanlines
   ========================================================= */
.hero__avatar-wrap {
  position: relative;
  overflow: visible;
}
.hero__avatar-mask {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  overflow: hidden;
  isolation: isolate;
}
.hero__avatar-mask::before {
  /* cyan duotone overlay — subtle, doesn't kill the face */
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 40%, rgba(34, 211, 238, 0.18), rgba(217, 70, 239, 0.18));
  mix-blend-mode: color;
  pointer-events: none;
  z-index: 2;
}
.hero__avatar-mask::after {
  /* moving scanline bar */
  content: '';
  position: absolute;
  inset: 0;
  background:
    repeating-linear-gradient(
      to bottom,
      transparent 0px,
      transparent 3px,
      rgba(34, 211, 238, 0.08) 3px,
      rgba(34, 211, 238, 0.08) 4px
    ),
    linear-gradient(
      to bottom,
      transparent 0%,
      rgba(34, 211, 238, 0.0) 45%,
      rgba(34, 211, 238, 0.35) 50%,
      rgba(34, 211, 238, 0.0) 55%,
      transparent 100%
    );
  background-size: 100% 100%, 100% 300%;
  background-position: 0 0, 0 -100%;
  animation: scanSweep 5s linear infinite;
  mix-blend-mode: screen;
  pointer-events: none;
  z-index: 3;
}
@keyframes scanSweep {
  from { background-position: 0 0, 0 -100%; }
  to   { background-position: 0 0, 0 200%; }
}

/* =========================================================
   Tech marquee strip
   ========================================================= */
.marquee {
  position: relative;
  overflow: hidden;
  padding: 1rem 0;
  background: var(--bg-1);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  z-index: 1;
  --mask: linear-gradient(to right, transparent 0%, #000 8%, #000 92%, transparent 100%);
  -webkit-mask-image: var(--mask);
  mask-image: var(--mask);
}
.marquee__track {
  display: flex;
  width: max-content;
  animation: marqueeScroll 45s linear infinite;
  will-change: transform;
}
.marquee__group {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}
.marquee__item {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  color: var(--text-1);
  padding: 0 1.5rem;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}
.marquee__item .dot {
  color: var(--accent-cyan);
  font-size: 0.6em;
}
@keyframes marqueeScroll {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

/* =========================================================
   Magenta accent balance — alternate sections + accents
   ========================================================= */
#experience .kicker .accent,
#skills     .kicker .accent,
#contact    .kicker .accent { color: var(--accent-mag); }

/* Project index numbers in magenta for variety in the projects grid */
.proj-card__index { color: var(--accent-mag); }

/* Alternate skill card icon hues so the grid doesn't read as all-cyan */
.skill-card:nth-of-type(2) .skill-card__title i,
.skill-card:nth-of-type(4) .skill-card__title i { color: var(--accent-mag); }

/* Make every other skill card's hover glow magenta for the same effect */
.skill-card:nth-of-type(2):hover,
.skill-card:nth-of-type(4):hover {
  border-color: var(--accent-mag);
  box-shadow: var(--glow-mag);
}
.skill-card:nth-of-type(2):hover .chip,
.skill-card:nth-of-type(4):hover .chip {
  border-color: var(--accent-mag);
  color: var(--accent-mag);
}

/* Hero scroll hint chevron in magenta for a pop of color at the bottom */
.hero__scroll i { color: var(--accent-mag); }

/* =========================================================
   Focus states
   ========================================================= */
:focus-visible {
  outline: 2px solid var(--accent-cyan);
  outline-offset: 3px;
  border-radius: 4px;
}

/* =========================================================
   Mobile performance pass
   Mobile GPUs choke on continuous large-radius blurs and
   backdrop-filter. Below 900px we trade some visual fidelity
   for steady 60fps scrolling.
   ========================================================= */
@media (max-width: 899px) {
  /* Glass nav -> solid translucent fill. backdrop-filter is
     re-evaluated every scroll frame on mobile. */
  .nav {
    background: rgba(5, 6, 10, 0.95);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }

  /* Freeze the moving scanline mask on the headshot. Duotone tint stays. */
  .hero__avatar-mask::after { animation: none; }

  /* The full-viewport grid pattern is fixed-positioned with a mask;
     fixed + mask + scroll on mobile is jank-prone. Drop it on small screens. */
  body::before { display: none; }

  /* Skip rendering off-screen cards until they're scrolled near.
     contain-intrinsic-size reserves space so the scrollbar doesn't jump. */
  .skill-card,
  .tl-item,
  .proj-card,
  .edu-card {
    content-visibility: auto;
    contain-intrinsic-size: 0 480px;
  }
}

/* =========================================================
   Reduced motion
   ========================================================= */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  [data-reveal] { opacity: 1; transform: none; }
  body::before { display: none; }
  .glitch::before, .glitch::after { display: none; }
  .hero__avatar-mask::after { display: none; }
  .marquee__track { animation: none; }
  .status-dot--live { animation: none; }
}
