/* =============================================
   VARIABLES & RESET
   ============================================= */
:root {
  --bg: #f7f8fc;
  --bg-2: #eef0f7;
  --bg-card: #ffffff;
  --bg-hero: #0c1120;
  --border: rgba(15, 23, 42, 0.09);
  --border-hover: rgba(37, 99, 235, 0.35);
  --text: #0f172a;
  --text-muted: #64748b;
  --accent: #2563eb;
  --accent-dim: rgba(37, 99, 235, 0.08);
  --accent-glow: rgba(37, 99, 235, 0.18);
  --font: 'Space Grotesk', sans-serif;
  --mono: 'JetBrains Mono', monospace;
  --radius: 12px;
  --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

[data-theme="dark"] {
  --bg: #080d14;
  --bg-2: #0b1120;
  --bg-card: #0e1628;
  --bg-hero: #050a10;
  --border: rgba(96, 165, 250, 0.12);
  --border-hover: rgba(96, 165, 250, 0.4);
  --text: #e2e8f0;
  --text-muted: #64748b;
  --accent: #60a5fa;
  --accent-dim: rgba(96, 165, 250, 0.08);
  --accent-glow: rgba(96, 165, 250, 0.25);
}

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

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  line-height: 1.6;
  overflow-x: hidden;
}

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

/* =============================================
   UTILITIES
   ============================================= */
.container {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 24px;
}

.mono { font-family: var(--mono); }
.accent { color: var(--accent); }
.text-center { text-align: center; }

.section {
  padding: 100px 0;
}

.section__label {
  font-size: 0.78rem;
  color: var(--accent);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 12px;
  display: block;
}

.section__title {
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 60px;
  color: var(--text);
}

/* =============================================
   BUTTONS
   ============================================= */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 28px;
  border-radius: 8px;
  font-family: var(--font);
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  border: none;
  transition: var(--transition);
  white-space: nowrap;
}

.btn--primary {
  background: var(--accent);
  color: #000;
}
.btn--primary:hover {
  background: #fff;
  box-shadow: 0 0 30px var(--accent-glow);
  transform: translateY(-2px);
}

.btn--ghost {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
}
.btn--ghost:hover {
  border-color: var(--accent);
  color: var(--accent);
  box-shadow: 0 0 20px var(--accent-dim);
  transform: translateY(-2px);
}

.btn--sm { padding: 8px 18px; font-size: 0.85rem; }
.btn--lg { padding: 16px 40px; font-size: 1.05rem; margin-top: 36px; }

/* =============================================
   NAV
   ============================================= */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 48px;
  transition: var(--transition);
}

.nav.scrolled {
  background: rgba(255, 255, 255, 0.97);
  backdrop-filter: blur(20px);
  padding: 14px 48px;
  border-bottom: 1px solid var(--border);
  box-shadow: 0 1px 16px rgba(15, 23, 42, 0.07);
}

.nav__logo {
  font-family: var(--mono);
  font-size: 1.3rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: #fff;
  transition: color var(--transition);
}
.nav.scrolled .nav__logo { color: var(--text); }

.nav__links {
  display: flex;
  align-items: center;
  gap: 36px;
}

.nav__links a {
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.65);
  transition: color var(--transition);
}
.nav__links a:hover { color: #fff; }

.nav.scrolled .nav__links a { color: var(--text-muted); }
.nav.scrolled .nav__links a:hover { color: var(--text); }

.nav__cta {
  background: var(--accent) !important;
  color: #fff !important;
  padding: 8px 20px;
  border-radius: 6px;
  font-weight: 600;
}
.nav__cta:hover {
  background: #1d4ed8 !important;
  color: #fff !important;
}
.nav.scrolled .nav__cta { color: #fff !important; }

.nav__hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}
.nav__hamburger span {
  display: block;
  width: 24px;
  height: 2px;
  background: #fff;
  border-radius: 2px;
  transition: transform 0.3s ease, opacity 0.3s ease;
}
.nav.scrolled .nav__hamburger span { background: var(--text); }

/* =============================================
   HERO
   ============================================= */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: var(--bg-hero);
}

.hero__canvas {
  position: absolute;
  inset: 0;
  z-index: 0;
}

#particleCanvas {
  width: 100%;
  height: 100%;
}

.hero__content {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 0 24px;
  max-width: 800px;
}

.hero__label {
  font-size: 0.8rem;
  color: rgba(37, 99, 235, 0.9);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  margin-bottom: 24px;
  display: block;
  opacity: 0;
  animation: fadeUp 0.8s 0.3s forwards;
}

.hero__title {
  font-size: clamp(2.8rem, 7vw, 5.5rem);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin-bottom: 24px;
  opacity: 0;
  animation: fadeUp 0.8s 0.5s forwards;
  color: #f1f5f9;
}

.hero__typed-wrap {
  display: block;
  min-height: calc(1.1 * 5.5rem * 2);
}

.hero__title .typed {
  display: inline;
  min-width: 2ch;
}

.hero__title .typed::after {
  content: '';
  display: inline-block;
  width: 3px;
  height: 0.85em;
  background: var(--accent);
  margin-left: 4px;
  vertical-align: middle;
  animation: blink 0.9s step-end infinite;
}

.hero__sub {
  font-size: 1.1rem;
  color: rgba(148, 163, 184, 0.85);
  letter-spacing: 0.08em;
  margin-bottom: 40px;
  opacity: 0;
  animation: fadeUp 0.8s 0.7s forwards;
}

.hero__actions {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
  opacity: 0;
  animation: fadeUp 0.8s 0.9s forwards;
}

.hero__scroll {
  position: absolute;
  bottom: 40px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  z-index: 1;
  opacity: 0;
  animation: fadeUp 0.8s 1.2s forwards;
}

.hero .btn--ghost {
  color: rgba(241, 245, 249, 0.85);
  border-color: rgba(241, 245, 249, 0.2);
}
.hero .btn--ghost:hover {
  color: #fff;
  border-color: rgba(241, 245, 249, 0.5);
  box-shadow: none;
}

.hero__scroll span {
  font-size: 0.7rem;
  color: rgba(148, 163, 184, 0.6);
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.hero__scroll-line {
  width: 1px;
  height: 40px;
  background: linear-gradient(to bottom, var(--accent), transparent);
  animation: scrollLine 1.5s ease-in-out infinite;
}

/* =============================================
   ABOUT
   ============================================= */
.about {
  background: var(--bg-2);
}

.about__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 80px;
  align-items: center;
}

.about__text .section__label { margin-bottom: 12px; }
.about__text .section__title { margin-bottom: 24px; }

.about__body {
  color: var(--text-muted);
  font-size: 1.05rem;
  margin-bottom: 20px;
  line-height: 1.75;
}

.about__stats {
  display: flex;
  gap: 40px;
  margin-top: 40px;
  padding-top: 40px;
  border-top: 1px solid var(--border);
}

.stat { display: flex; flex-direction: column; gap: 4px; }
.stat__num { font-size: 2.2rem; font-weight: 700; line-height: 1; }
.stat__label { font-size: 0.8rem; color: var(--text-muted); }

/* Circuit Card */
.circuit-card {
  aspect-ratio: 1;
  max-width: 380px;
  margin: 0 auto;
}

.circuit-card__inner {
  width: 100%;
  height: 100%;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-card);
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
}

.circuit-card__inner::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 50%, rgba(37, 99, 235, 0.06) 0%, transparent 70%);
}

.robo-icon {
  position: relative;
  z-index: 1;
  width: 200px;
  animation: float 4s ease-in-out infinite;
}

.circuit-lines {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.c-line {
  position: absolute;
  background: var(--accent);
  opacity: 0.15;
}
.c-line--1 { width: 60px; height: 1px; top: 30%; left: 0; animation: pulse 3s 0s ease-in-out infinite; }
.c-line--2 { width: 1px; height: 50px; bottom: 20%; right: 20%; animation: pulse 3s 1s ease-in-out infinite; }
.c-line--3 { width: 80px; height: 1px; top: 70%; right: 0; animation: pulse 3s 2s ease-in-out infinite; }

.c-dot {
  position: absolute;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
}
.c-dot--1 { top: 30%; left: 60px; animation: pulse 3s 0s ease-in-out infinite; }
.c-dot--2 { bottom: 20%; right: calc(20% - 2px); animation: pulse 3s 1s ease-in-out infinite; }
.c-dot--3 { top: 70%; right: 80px; animation: pulse 3s 2s ease-in-out infinite; }

/* =============================================
   SKILLS
   ============================================= */
.skills__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.skill-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.skill-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, var(--accent-dim), transparent);
  opacity: 0;
  transition: var(--transition);
}

.skill-card {
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.05);
}
.skill-card:hover {
  border-color: var(--border-hover);
  transform: translateY(-4px);
  box-shadow: 0 12px 32px rgba(37, 99, 235, 0.1), 0 0 0 1px var(--border-hover);
}
.skill-card:hover::before { opacity: 1; }

.skill-card__icon {
  width: 40px;
  height: 40px;
  color: var(--accent);
  margin-bottom: 16px;
  position: relative;
  z-index: 1;
}

.skill-card h3 {
  font-size: 1.05rem;
  font-weight: 600;
  margin-bottom: 10px;
  position: relative;
  z-index: 1;
}

.skill-card p {
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 16px;
  position: relative;
  z-index: 1;
}

.skill-card__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  position: relative;
  z-index: 1;
}

.skill-card__tags span {
  font-family: var(--mono);
  font-size: 0.7rem;
  padding: 3px 10px;
  border-radius: 100px;
  background: var(--accent-dim);
  color: var(--accent);
  border: 1px solid rgba(37, 99, 235, 0.18);
}

/* =============================================
   PROJECTS
   ============================================= */
.projects {
  background: var(--bg-2);
}

.projects__grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
}

.project-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: var(--transition);
  display: flex;
  flex-direction: column;
}

.project-card {
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.06);
}
.project-card:hover {
  border-color: var(--border-hover);
  box-shadow: 0 16px 48px rgba(37, 99, 235, 0.1), 0 0 0 1px var(--border-hover);
  transform: translateY(-4px);
}

.project-card--featured {
  grid-column: span 2;
  flex-direction: row;
}

.project-card__visual {
  background: linear-gradient(135deg, #0d1220, #0f1830);
  position: relative;
  min-height: 200px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.project-card--featured .project-card__visual {
  width: 45%;
  flex-shrink: 0;
  min-height: 300px;
}

.project-card__badge {
  position: absolute;
  top: 16px;
  left: 16px;
  font-size: 0.7rem;
  color: var(--accent);
  background: rgba(37, 99, 235, 0.15);
  border: 1px solid rgba(37, 99, 235, 0.3);
  padding: 4px 12px;
  border-radius: 100px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.project-schematic {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.schematic-svg {
  width: 100%;
  max-width: 320px;
}

.project-card__body {
  padding: 28px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.project-card__body h3 {
  font-size: 1.2rem;
  font-weight: 600;
  margin-bottom: 12px;
}

.project-card__body p {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.7;
  flex: 1;
  margin-bottom: 20px;
}

.project-card__tech {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 20px;
}

.project-card__tech span {
  font-family: var(--mono);
  font-size: 0.7rem;
  padding: 3px 10px;
  border-radius: 100px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-muted);
  border: 1px solid var(--border);
}

/* Project category label inside featured card body */
.project-card__cat {
  font-family: var(--mono);
  font-size: 0.7rem;
  color: var(--accent);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 10px;
}

/* Compact project grid */
.projects__compact {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-top: 24px;
}

.project-card-sm {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-top: 2px solid var(--accent);
  border-radius: var(--radius);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: var(--transition);
}

.project-card-sm {
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.05);
}
.project-card-sm:hover {
  border-color: var(--border-hover);
  border-top-color: var(--accent);
  transform: translateY(-4px);
  box-shadow: 0 12px 32px rgba(37, 99, 235, 0.1), 0 0 0 1px var(--border-hover);
}

.project-card--featured, .project-card-sm { cursor: pointer; }

.project-card-sm__cat {
  font-family: var(--mono);
  font-size: 0.68rem;
  color: var(--accent);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.project-card-sm h3 {
  font-size: 0.98rem;
  font-weight: 600;
  line-height: 1.3;
}

.project-card-sm p {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.65;
  flex: 1;
}

.project-card-sm__tech {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: auto;
}

.project-card-sm__tech span {
  font-family: var(--mono);
  font-size: 0.68rem;
  padding: 2px 9px;
  border-radius: 100px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-muted);
  border: 1px solid var(--border);
}

/* =============================================
   EXPERIENCE / TIMELINE
   ============================================= */
.timeline {
  max-width: 760px;
  margin: 0 auto;
  position: relative;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 16px;
  top: 0;
  bottom: 0;
  width: 1px;
  background: linear-gradient(to bottom, var(--accent), transparent);
}

.timeline__item {
  display: flex;
  gap: 36px;
  padding-bottom: 52px;
  position: relative;
}

.timeline__item:last-child { padding-bottom: 0; }

.timeline__marker {
  width: 33px;
  height: 33px;
  border-radius: 50%;
  border: 2px solid var(--accent);
  background: var(--bg-card);
  flex-shrink: 0;
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 0 4px var(--bg), 0 0 14px rgba(37, 99, 235, 0.2);
}

.timeline__marker::after {
  content: '';
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--accent);
}

.timeline__content {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  flex: 1;
  transition: var(--transition);
}

.timeline__content:hover {
  border-color: var(--border-hover);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.2);
}

.timeline__header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.timeline__header h3 {
  font-size: 1.05rem;
  font-weight: 600;
}

.timeline__company {
  display: block;
  font-size: 0.85rem;
  color: var(--accent);
  margin-top: 4px;
}

.timeline__date {
  font-size: 0.78rem;
  color: var(--text-muted);
  white-space: nowrap;
}

.timeline__content > p {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.7;
  margin-bottom: 16px;
}

.timeline__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.timeline__tags span {
  font-family: var(--mono);
  font-size: 0.7rem;
  padding: 3px 10px;
  border-radius: 100px;
  background: var(--accent-dim);
  color: var(--accent);
  border: 1px solid rgba(37, 99, 235, 0.18);
}

/* =============================================
   EDUCATION
   ============================================= */
.education {
  background: var(--bg);
}

.edu__grid {
  max-width: 820px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.edu-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 24px;
  transition: var(--transition);
}

.edu-card:hover {
  border-color: var(--border-hover);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.2);
}

.edu-card__year {
  font-size: 0.78rem;
  color: var(--accent);
  padding-top: 4px;
  letter-spacing: 0.05em;
}

.edu-card__degree {
  font-size: 1.05rem;
  font-weight: 600;
  margin-bottom: 4px;
}

.edu-card__school {
  font-size: 0.85rem;
  color: var(--accent);
  margin-bottom: 12px;
}

.edu-card__body > p {
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.7;
  margin-bottom: 14px;
}

.edu-card__highlights {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.edu-card__highlights span {
  font-family: var(--mono);
  font-size: 0.7rem;
  padding: 3px 10px;
  border-radius: 100px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-muted);
  border: 1px solid var(--border);
}

@media (max-width: 600px) {
  .edu-card {
    grid-template-columns: 1fr;
    gap: 8px;
  }
}

/* =============================================
   CONTACT
   ============================================= */
.contact {
  background: var(--bg-2);
}

.contact__inner {
  max-width: 600px;
  margin: 0 auto;
  text-align: center;
}

.contact__inner .section__title { margin-bottom: 20px; }

.contact__sub {
  color: var(--text-muted);
  font-size: 1.05rem;
  margin-bottom: 40px;
  line-height: 1.7;
}

.contact__links {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
}

.contact__link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 24px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.9rem;
  transition: var(--transition);
}

.contact__link svg {
  width: 18px;
  height: 18px;
}

.contact__link:hover {
  border-color: var(--accent);
  color: var(--accent);
  box-shadow: 0 0 20px var(--accent-dim);
  transform: translateY(-2px);
}

/* =============================================
   FOOTER
   ============================================= */
.footer {
  padding: 24px 0;
  border-top: 1px solid var(--border);
}

.footer .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.footer span {
  font-size: 0.78rem;
  color: var(--text-muted);
}

/* =============================================
   ANIMATIONS
   ============================================= */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0; }
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(-12px); }
}

@keyframes pulse {
  0%, 100% { opacity: 0.1; }
  50%       { opacity: 0.5; }
}

@keyframes scrollLine {
  0%   { transform: scaleY(0); transform-origin: top; }
  50%  { transform: scaleY(1); transform-origin: top; }
  51%  { transform: scaleY(1); transform-origin: bottom; }
  100% { transform: scaleY(0); transform-origin: bottom; }
}

.blink {
  animation: pulse 1.8s ease-in-out infinite;
}

/* Scroll reveal */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* =============================================
   THEME TOGGLE
   ============================================= */
.theme-toggle {
  background: none;
  border: none;
  cursor: pointer;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255, 255, 255, 0.75);
  transition: color var(--transition);
  flex-shrink: 0;
}

.nav.scrolled .theme-toggle { color: var(--text-muted); }
[data-theme="dark"] .nav.scrolled .theme-toggle { color: rgba(226, 232, 240, 0.75); }

[data-theme="light"] .theme-toggle__sun { display: none; }
[data-theme="dark"] .theme-toggle__moon { display: none; }

/* =============================================
   DARK MODE OVERRIDES
   ============================================= */
[data-theme="dark"] .nav.scrolled {
  background: rgba(11, 17, 32, 0.97);
}

[data-theme="dark"] .nav__links {
  background: rgba(8, 13, 20, 0.98);
}

[data-theme="dark"] .nav__links a { color: rgba(226, 232, 240, 0.65); }
[data-theme="dark"] .nav__links a:hover { color: #e2e8f0; }
[data-theme="dark"] .nav.scrolled .nav__links a { color: rgba(226, 232, 240, 0.65); }
[data-theme="dark"] .nav.scrolled .nav__links a:hover { color: #e2e8f0; }
[data-theme="dark"] .nav.scrolled .nav__logo { color: #e2e8f0; }
[data-theme="dark"] .nav.scrolled .nav__hamburger span { background: #e2e8f0; }

[data-theme="dark"] .project-card-sm__tech span,
[data-theme="dark"] .edu-card__highlights span {
  background: rgba(96, 165, 250, 0.06);
  color: rgba(226, 232, 240, 0.6);
}

[data-theme="dark"] .btn--primary { color: #fff; }

/* =============================================
   MODAL
   ============================================= */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.modal-overlay.open {
  opacity: 1;
  pointer-events: all;
}

.modal {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  width: 100%;
  max-width: 760px;
  max-height: 88vh;
  overflow-y: auto;
  position: relative;
  transform: translateY(24px);
  transition: transform 0.3s ease;
  box-shadow: 0 32px 80px rgba(0, 0, 0, 0.3);
}

.modal-overlay.open .modal {
  transform: translateY(0);
}

.modal__close {
  position: sticky;
  top: 16px;
  float: right;
  margin: 16px 16px 0 0;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 50%;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-muted);
  transition: var(--transition);
  z-index: 1;
}
.modal__close:hover {
  background: var(--accent-dim);
  color: var(--accent);
  border-color: var(--border-hover);
}

.modal__content {
  padding: 32px 36px 36px;
  clear: both;
}

.modal__cat {
  font-family: var(--mono);
  font-size: 0.7rem;
  color: var(--accent);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 12px;
}

.modal__title {
  font-size: clamp(1.3rem, 3vw, 1.8rem);
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 20px;
}

.modal__desc {
  font-size: 0.95rem;
  color: var(--text-muted);
  line-height: 1.8;
  margin-bottom: 24px;
}

.modal__tech {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 24px;
}

.modal__tech span {
  font-family: var(--mono);
  font-size: 0.72rem;
  padding: 4px 12px;
  border-radius: 100px;
  background: var(--accent-dim);
  color: var(--accent);
  border: 1px solid rgba(37, 99, 235, 0.2);
}

.modal__links {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

@media (max-width: 600px) {
  .modal__content { padding: 24px 20px 28px; }
  .modal { border-radius: 12px; }
}

/* =============================================
   RESPONSIVE — TABLET (≤ 1024px)
   ============================================= */
@media (max-width: 1024px) {
  .projects__compact { grid-template-columns: repeat(2, 1fr); }
}

/* =============================================
   RESPONSIVE — SMALL TABLET / LARGE MOBILE (≤ 900px)
   ============================================= */
@media (max-width: 900px) {
  /* Nav */
  .nav { padding: 16px 24px; }
  .nav.scrolled { padding: 12px 24px; }
  .nav__links {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(20px);
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 32px;
    z-index: 99;
  }
  .nav__links.open { display: flex; }
  .nav__links a { font-size: 1.3rem; color: var(--text-muted) !important; }
  .nav__links a:hover { color: var(--text) !important; }
  .nav__hamburger { display: flex; z-index: 101; position: relative; }

  /* About */
  .about__grid { grid-template-columns: 1fr; gap: 48px; }
  .about__visual { order: -1; }
  .circuit-card { max-width: 260px; }

  /* Skills */
  .skills__grid { grid-template-columns: repeat(2, 1fr); }

  /* Projects */
  .project-card--featured { flex-direction: column; }
  .project-card--featured .project-card__visual { width: 100%; min-height: 200px; }

  /* Timeline */
  .timeline__header { flex-direction: column; gap: 4px; }
}

/* =============================================
   RESPONSIVE — MOBILE (≤ 600px)
   ============================================= */
@media (max-width: 600px) {
  .container { padding: 0 16px; }

  .section { padding: 64px 0; }
  .section__title { font-size: 1.7rem; margin-bottom: 36px; }

  /* Hero */
  .hero__title { font-size: clamp(2rem, 10vw, 3rem); }
  .hero__sub { font-size: 0.9rem; letter-spacing: 0.04em; }
  .hero__actions { flex-direction: column; align-items: center; }
  .hero__scroll { display: none; }

  /* About */
  .about__stats { gap: 20px; flex-wrap: wrap; }
  .stat__num { font-size: 1.8rem; }

  /* Skills */
  .skills__grid { grid-template-columns: 1fr; }

  /* Projects */
  .projects__compact { grid-template-columns: 1fr; }

  /* Education */
  .edu-card { grid-template-columns: 1fr; gap: 6px; }

  /* Timeline */
  .timeline::before { left: 11px; }
  .timeline__marker { width: 23px; height: 23px; }
  .timeline__item { gap: 20px; }
  .timeline__content { padding: 18px; }

  /* Contact */
  .contact__links { flex-direction: column; align-items: center; }
  .contact__link { width: 100%; max-width: 260px; justify-content: center; }
  .btn--lg { width: 100%; max-width: 260px; justify-content: center; }

  /* Footer */
  .footer .container { flex-direction: column; gap: 6px; text-align: center; }

  /* Nav mobile fullscreen */
  .nav__links a { font-size: 1.5rem !important; }
  .nav__cta {
    padding: 12px 32px !important;
    border-radius: 8px !important;
    font-size: 1.1rem !important;
    color: #fff !important;
  }
}
