/* ===== CSS CUSTOM PROPERTIES ===== */
:root {
  /* Light mode (default) */
  --bg-primary: #FAFAFA;
  --bg-secondary: #F1F5F9;
  --bg-card: #FFFFFF;
  --bg-card-hover: #F8FAFC;
  --text-primary: #0F172A;
  --text-secondary: #334155;
  --text-muted: #64748B;
  --accent: #C9A84C;
  --accent-hover: #B8953D;
  --accent-glow: rgba(201, 168, 76, 0.15);
  --blue: #2563EB;
  --blue-hover: #1D4ED8;
  --border: #E2E8F0;
  --border-subtle: #F1F5F9;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
  --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.07), 0 2px 4px -2px rgba(0,0,0,0.05);
  --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.08), 0 4px 6px -4px rgba(0,0,0,0.04);
  --shadow-xl: 0 20px 25px -5px rgba(0,0,0,0.08), 0 8px 10px -6px rgba(0,0,0,0.04);
  --nav-bg: rgba(255, 255, 255, 0.85);
  --nav-blur: blur(20px);
  --gradient-hero: linear-gradient(135deg, #0F172A 0%, #1E293B 50%, #0F172A 100%);
  --gradient-accent: linear-gradient(135deg, #C9A84C, #E2C97E);
  --transition-fast: 150ms ease;
  --transition-base: 250ms ease;
  --transition-slow: 400ms ease;
}

[data-theme="dark"] {
  --bg-primary: #0A0E1A;
  --bg-secondary: #111827;
  --bg-card: #1E293B;
  --bg-card-hover: #253349;
  --text-primary: #F1F5F9;
  --text-secondary: #CBD5E1;
  --text-muted: #94A3B8;
  --border: #1E293B;
  --border-subtle: #1E293B;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.3);
  --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.4);
  --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.5);
  --shadow-xl: 0 20px 25px -5px rgba(0,0,0,0.6);
  --nav-bg: rgba(10, 14, 26, 0.85);
  --accent-glow: rgba(201, 168, 76, 0.08);
}

/* ===== RESET & BASE ===== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  transition: background-color var(--transition-slow), color var(--transition-slow);
  overflow-x: hidden;
}

/* ===== TYPOGRAPHY ===== */
h1, h2, h3, h4 {
  font-family: 'Playfair Display', Georgia, serif;
  line-height: 1.2;
  font-weight: 700;
}

h1 { font-size: clamp(2.5rem, 5vw, 4rem); }
h2 { font-size: clamp(2rem, 4vw, 3rem); }
h3 { font-size: clamp(1.25rem, 2.5vw, 1.5rem); }

p {
  max-width: 70ch;
  line-height: 1.75;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover { color: var(--accent-hover); }

/* ===== NAVIGATION ===== */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  padding: 1rem 2rem;
  background: var(--nav-bg);
  backdrop-filter: var(--nav-blur);
  -webkit-backdrop-filter: var(--nav-blur);
  border-bottom: 1px solid var(--border);
  transition: all var(--transition-base);
}

.navbar.scrolled {
  padding: 0.6rem 2rem;
  box-shadow: var(--shadow-md);
}

.nav-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-family: 'Playfair Display', serif;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
  cursor: pointer;
}

.nav-logo svg {
  width: 40px;
  height: 40px;
}

.nav-links {
  display: flex;
  gap: 2rem;
  list-style: none;
  align-items: center;
}

.nav-links a {
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  position: relative;
  padding: 0.25rem 0;
  cursor: pointer;
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--gradient-accent);
  transition: width var(--transition-base);
}

.nav-links a:hover { color: var(--text-primary); }
.nav-links a:hover::after { width: 100%; }

.nav-links a.active {
  color: var(--accent);
}

.nav-links a.active::after {
  width: 100%;
}

/* Theme Toggle */
.theme-toggle {
  background: none;
  border: 2px solid var(--border);
  border-radius: 50%;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-secondary);
  transition: all var(--transition-base);
}

.theme-toggle:hover {
  border-color: var(--accent);
  color: var(--accent);
  transform: rotate(30deg);
}

.theme-toggle .icon-sun,
.theme-toggle .icon-moon { transition: opacity var(--transition-base); }

[data-theme="dark"] .theme-toggle .icon-sun { display: none; }
[data-theme="light"] .theme-toggle .icon-moon,
:root:not([data-theme]) .theme-toggle .icon-moon { display: none; }

/* Mobile menu */
.mobile-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 10px;
  min-width: 44px;
  min-height: 44px;
  align-items: center;
  justify-content: center;
}

.mobile-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--text-primary);
  transition: all var(--transition-base);
  border-radius: 2px;
}

.mobile-toggle.active span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}
.mobile-toggle.active span:nth-child(2) { opacity: 0; }
.mobile-toggle.active span:nth-child(3) {
  transform: rotate(-45deg) translate(5px, -5px);
}

/* ===== HERO SECTION ===== */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  background: var(--gradient-hero);
  position: relative;
  overflow: hidden;
  padding: 6rem 2rem 4rem;
}

.hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background:
    radial-gradient(ellipse at 20% 50%, rgba(201, 168, 76, 0.08) 0%, transparent 60%),
    radial-gradient(ellipse at 80% 20%, rgba(37, 99, 235, 0.06) 0%, transparent 50%);
  pointer-events: none;
}

#hero-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
}

.hero-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: center;
  position: relative;
  z-index: 1;
}

.hero-content {
  color: #F1F5F9;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  background: rgba(201, 168, 76, 0.1);
  border: 1px solid rgba(201, 168, 76, 0.25);
  border-radius: 100px;
  font-size: 0.85rem;
  color: #C9A84C;
  margin-bottom: 1.5rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.hero-badge .dot {
  width: 8px;
  height: 8px;
  background: #C9A84C;
  border-radius: 50%;
  animation: pulse-dot 2s ease-in-out infinite;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(1.3); }
}

.hero h1 {
  color: #FFFFFF;
  margin-bottom: 0.5rem;
  letter-spacing: -0.02em;
}

.hero h1 .accent {
  background: var(--gradient-accent);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-subtitle {
  font-size: 1.25rem;
  color: #94A3B8;
  margin-bottom: 1.5rem;
  font-weight: 400;
}

.hero-description {
  font-size: 1.05rem;
  color: #CBD5E1;
  margin-bottom: 2rem;
  max-width: 540px;
}

.hero-cta {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.85rem 1.75rem;
  border-radius: 8px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-base);
  border: none;
  letter-spacing: 0.01em;
}

.btn-primary {
  background: var(--gradient-accent);
  color: #0F172A;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(201, 168, 76, 0.3);
  color: #0F172A;
}

.btn-outline {
  background: transparent;
  border: 2px solid rgba(241, 245, 249, 0.25);
  color: #F1F5F9;
}

.btn-outline:hover {
  border-color: #C9A84C;
  color: #C9A84C;
  transform: translateY(-2px);
}

/* Hero Photo */
.hero-image {
  display: flex;
  justify-content: center;
  align-items: center;
}

.hero-photo-wrapper {
  position: relative;
  width: 380px;
  height: 460px;
}

.hero-photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  border-radius: 20px;
  position: relative;
  z-index: 1;
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.4);
}

.hero-photo-wrapper::before {
  content: '';
  position: absolute;
  top: -8px;
  right: -8px;
  width: 100%;
  height: 100%;
  border: 2px solid rgba(201, 168, 76, 0.4);
  border-radius: 20px;
  z-index: 0;
}

.hero-photo-wrapper::after {
  content: '';
  position: absolute;
  bottom: -12px;
  left: -12px;
  width: 80px;
  height: 80px;
  border-left: 3px solid #C9A84C;
  border-bottom: 3px solid #C9A84C;
  border-radius: 0 0 0 20px;
  z-index: 0;
}

/* ===== SECTION SHARED ===== */
.section {
  padding: 6rem 2rem;
}

.section-inner {
  max-width: 1200px;
  margin: 0 auto;
}

.section-header {
  text-align: center;
  margin-bottom: 4rem;
}

.section-label {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.75rem;
}

.section-header h2 {
  color: var(--text-primary);
  margin-bottom: 1rem;
}

.section-header p {
  color: var(--text-muted);
  margin: 0 auto;
  font-size: 1.05rem;
}

/* ===== IMPACT NUMBERS ===== */
.impact {
  background: var(--bg-secondary);
}

.impact-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 2rem;
}

.impact-card {
  text-align: center;
  padding: 2.5rem 1.5rem;
  background: var(--bg-card);
  border-radius: 16px;
  border: 1px solid var(--border);
  transition: all var(--transition-base);
}

.impact-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: var(--accent);
}

/* Impact Ring Animation */
.impact-ring {
  position: relative;
  width: 100px;
  height: 100px;
  margin: 0 auto 1.25rem;
}

.impact-ring svg {
  width: 100%;
  height: 100%;
}

.impact-ring-fill {
  transition: stroke-dashoffset 2s cubic-bezier(0.4, 0, 0.2, 1);
}

.impact-ring.animated .impact-ring-fill {
  stroke-dashoffset: var(--ring-offset, 0);
}

.impact-ring-inner {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  align-items: center;
  justify-content: center;
}

@keyframes ring-pulse {
  0%, 100% { filter: drop-shadow(0 0 4px rgba(201, 168, 76, 0.2)); }
  50% { filter: drop-shadow(0 0 12px rgba(201, 168, 76, 0.4)); }
}

.impact-ring.animated svg {
  animation: ring-pulse 3s ease-in-out infinite;
}

.impact-number {
  font-family: 'Playfair Display', serif;
  font-size: 3rem;
  font-weight: 700;
  background: var(--gradient-accent);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1;
  margin-bottom: 0.5rem;
}

.impact-label {
  font-size: 0.95rem;
  color: var(--text-muted);
  font-weight: 500;
}

/* ===== EXPERIENCE / TIMELINE ===== */
.timeline {
  position: relative;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  top: 0;
  bottom: 0;
  width: 2px;
  background: linear-gradient(to bottom, var(--accent), var(--border));
}

.timeline-item {
  display: flex;
  margin-bottom: 4rem;
  position: relative;
}

.timeline-item:nth-child(odd) {
  justify-content: flex-start;
  padding-right: calc(50% + 3rem);
}

.timeline-item:nth-child(even) {
  justify-content: flex-end;
  padding-left: calc(50% + 3rem);
}

.timeline-dot {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  width: 16px;
  height: 16px;
  background: var(--accent);
  border-radius: 50%;
  border: 3px solid var(--bg-primary);
  z-index: 2;
  box-shadow: 0 0 0 4px var(--accent-glow);
}

.timeline-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 2rem;
  transition: all var(--transition-base);
  cursor: pointer;
}

.timeline-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: var(--accent);
}

.timeline-date {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--accent);
  margin-bottom: 0.5rem;
  letter-spacing: 0.05em;
}

.timeline-company {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.timeline-company-logo {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: var(--bg-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.75rem;
  color: var(--text-muted);
  border: 1px solid var(--border);
}

.timeline-company h3 {
  font-family: 'Inter', sans-serif;
  font-size: 1.1rem;
  font-weight: 700;
}

.timeline-role {
  font-size: 0.95rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.timeline-highlights {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.timeline-highlights li {
  font-size: 0.9rem;
  color: var(--text-secondary);
  padding-left: 1.25rem;
  position: relative;
}

.timeline-highlights li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.6em;
  width: 6px;
  height: 6px;
  background: var(--accent);
  border-radius: 50%;
}

.timeline-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1rem;
}

.tag {
  font-size: 0.75rem;
  padding: 0.25rem 0.75rem;
  background: var(--accent-glow);
  color: var(--accent);
  border-radius: 100px;
  font-weight: 500;
  border: 1px solid rgba(201, 168, 76, 0.2);
}

/* ===== SKILLS SECTION ===== */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
}

.skill-category {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 2rem;
  transition: all var(--transition-base);
}

.skill-category:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: var(--accent);
}

.skill-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: var(--accent-glow);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.25rem;
  color: var(--accent);
}

.skill-category h3 {
  font-family: 'Inter', sans-serif;
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 1rem;
}

.skill-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.skill-tag {
  font-size: 0.8rem;
  padding: 0.35rem 0.75rem;
  background: var(--bg-secondary);
  color: var(--text-secondary);
  border-radius: 6px;
  font-weight: 500;
  transition: all var(--transition-fast);
}

.skill-tag:hover {
  background: var(--accent-glow);
  color: var(--accent);
}

/* ===== EDUCATION & CERTS ===== */
.education-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 2rem;
}

.edu-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 2rem;
  transition: all var(--transition-base);
}

.edu-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.edu-card h3 {
  font-family: 'Inter', sans-serif;
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
}

.edu-card .edu-school {
  color: var(--accent);
  font-size: 0.9rem;
  font-weight: 500;
  margin-bottom: 0.25rem;
}

.edu-card .edu-year {
  color: var(--text-muted);
  font-size: 0.85rem;
}

.certs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
  margin-top: 3rem;
}

.cert-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.25rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  transition: all var(--transition-base);
}

.cert-item:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.cert-year {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--accent);
  min-width: 40px;
}

.cert-name {
  font-size: 0.9rem;
  color: var(--text-secondary);
  font-weight: 500;
}

/* ===== CONTACT SECTION ===== */
.contact {
  background: var(--gradient-hero);
  position: relative;
}

.contact::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 50% 50%, rgba(201, 168, 76, 0.06) 0%, transparent 70%);
  pointer-events: none;
}

.contact .section-inner {
  position: relative;
  z-index: 1;
}

.contact .section-label { color: #C9A84C; }
.contact .section-header h2 { color: #FFFFFF; }
.contact .section-header p { color: #94A3B8; }

.contact-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
  max-width: 800px;
  margin: 0 auto;
}

.contact-card {
  text-align: center;
  padding: 2rem 1.5rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  transition: all var(--transition-base);
  cursor: pointer;
}

.contact-card:hover {
  background: rgba(201, 168, 76, 0.08);
  border-color: rgba(201, 168, 76, 0.3);
  transform: translateY(-4px);
}

.contact-icon {
  width: 48px;
  height: 48px;
  margin: 0 auto 1rem;
  background: rgba(201, 168, 76, 0.1);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #C9A84C;
}

.contact-card h3 {
  font-family: 'Inter', sans-serif;
  font-size: 1rem;
  font-weight: 600;
  color: #F1F5F9;
  margin-bottom: 0.25rem;
}

.contact-card p {
  font-size: 0.9rem;
  color: #94A3B8;
}

/* ===== DOWNLOAD CV / QR CODE ===== */
.download-cv {
  background: var(--gradient-hero);
  padding: 4rem 2rem;
}

.download-cv-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 3rem;
  max-width: 800px;
  margin: 0 auto;
  padding: 3rem;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 20px;
}

.download-cv-content {
  flex: 1;
}

.download-cv-content .section-label {
  color: #C9A84C;
}

.qr-frame {
  padding: 16px;
  background: #FFFFFF;
  border-radius: 16px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.3);
  line-height: 0;
}

#qr-canvas {
  width: 160px;
  height: 160px;
  display: block;
}

@media (max-width: 640px) {
  .download-cv-inner {
    flex-direction: column;
    text-align: center;
    padding: 2rem;
  }

  .download-cv-content .btn {
    margin: 0 auto;
  }

  #qr-canvas {
    width: 140px;
    height: 140px;
  }
}

/* ===== FOOTER ===== */
.footer {
  background: #050810;
  padding: 2rem;
  text-align: center;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.footer p {
  color: #64748B;
  font-size: 0.85rem;
  margin: 0 auto;
}

.footer a {
  color: #C9A84C;
}

/* ===== SCROLL ANIMATIONS ===== */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

.reveal-left {
  opacity: 0;
  transform: translateX(-40px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal-right {
  opacity: 0;
  transform: translateX(40px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal-left.visible,
.reveal-right.visible {
  opacity: 1;
  transform: translateX(0);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 1024px) {
  .hero-inner {
    grid-template-columns: 1fr;
    text-align: center;
    gap: 3rem;
  }

  .hero-content {
    order: 2;
  }

  .hero-image {
    order: 1;
  }

  .hero-photo-wrapper {
    width: 280px;
    height: 340px;
  }

  .hero-cta {
    justify-content: center;
  }

  .hero-description {
    margin: 0 auto 2rem;
  }

  .timeline::before { left: 20px; }

  .timeline-item:nth-child(odd),
  .timeline-item:nth-child(even) {
    padding-left: 60px;
    padding-right: 0;
    justify-content: flex-start;
  }

  .timeline-dot {
    left: 20px;
  }

  .skills-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .section { padding: 4rem 1.25rem; }

  /* Navbar tighter on mobile */
  .navbar { padding: 0.75rem 1.25rem; }
  .navbar.scrolled { padding: 0.5rem 1.25rem; }

  .nav-links { display: none; }
  .mobile-toggle { display: flex; }

  .nav-links.open {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--nav-bg);
    backdrop-filter: var(--nav-blur);
    -webkit-backdrop-filter: var(--nav-blur);
    padding: 0.75rem 1.25rem;
    border-bottom: 1px solid var(--border);
    gap: 0;
  }

  /* Touch-friendly nav links (min 44px tap target) */
  .nav-links.open li a {
    display: flex;
    align-items: center;
    min-height: 44px;
    padding: 0 0.25rem;
    font-size: 1rem;
  }

  .impact-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.25rem;
  }

  .skills-grid {
    grid-template-columns: 1fr;
  }

  .education-grid {
    grid-template-columns: 1fr;
  }

  .contact-grid {
    grid-template-columns: 1fr;
    max-width: 400px;
  }

  /* Contact cards — full touch targets */
  .contact-card {
    padding: 1.5rem 1.25rem;
    min-height: 44px;
  }

  .hero-photo-wrapper {
    width: 200px;
    height: 260px;
  }

  /* Hide decorative overflow elements on small screens */
  .hero-photo-wrapper::before,
  .hero-photo-wrapper::after {
    display: none;
  }

  /* Timeline — more compact */
  .timeline-card {
    padding: 1.5rem 1.25rem;
  }

  .timeline-tags {
    gap: 0.4rem;
  }

  .tag {
    font-size: 0.7rem;
    padding: 0.2rem 0.6rem;
  }

  /* Section headers */
  .section-header {
    margin-bottom: 2.5rem;
  }
}

@media (max-width: 480px) {
  .impact-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
  }

  .hero { padding: 5rem 1rem 3rem; }

  /* Hero badge — compact on tiny screens */
  .hero-badge {
    font-size: 0.75rem;
    padding: 0.4rem 0.85rem;
    letter-spacing: 0.03em;
  }

  /* Impact numbers — slightly smaller */
  .impact-number {
    font-size: 2.5rem;
  }

  .impact-card {
    padding: 2rem 1rem;
  }

  .impact-ring {
    width: 88px;
    height: 88px;
  }

  /* CTA buttons stack full-width for thumb reach */
  .hero-cta {
    flex-direction: column;
    align-items: stretch;
  }

  .hero-cta .btn {
    width: 100%;
    justify-content: center;
    min-height: 48px;
  }

  /* Skills grid */
  .skill-category {
    padding: 1.5rem 1.25rem;
  }

  /* Cert items */
  .cert-item {
    padding: 1rem;
  }

  /* Footer */
  .footer {
    padding: 1.5rem 1rem;
  }
}

/* ===== VERY SMALL (375px) ===== */
@media (max-width: 390px) {
  .impact-grid {
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
  }

  .impact-number {
    font-size: 2.2rem;
  }

  .impact-label {
    font-size: 0.82rem;
  }

  /* Prevent nav logo text overflow */
  .nav-logo span {
    display: none;
  }

  /* Section inner padding */
  .section { padding: 3.5rem 1rem; }
}

/* ===== REDUCED MOTION ===== */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }

  .reveal, .reveal-left, .reveal-right {
    opacity: 1;
    transform: none;
  }

  html { scroll-behavior: auto; }
}
