/* ═══════════════════════════════════════════════════
   DAVID SPELL  –  Portfolio CSS
   ═══════════════════════════════════════════════════ */

/* ── Light Theme (Default) ────────────────────────– */
:root,
[data-theme="light"] {
  --navy: #05091a;
  --navy-2: #0a0f2e;
  --navy-card: #0d1535;
  --navy-border: #1a2550;
  --blue: #1d6ef5;
  --blue-light: #4d8ff7;
  --blue-glow: rgba(29, 110, 245, 0.35);
  --blue-subtle: rgba(29, 110, 245, 0.12);
  --white: #ffffff;
  --off-white: #e8edf8;
  --text: #bcc9e6;
  --text-muted: #6a80b0;
  --light-bg: #f5f7fc;
  --light-text: #1a2040;
  --light-sub: #4a5880;
  --light-border: #d5dded;
  --radius-sm: 6px;
  --radius: 12px;
  --radius-lg: 20px;
  --shadow: 0 8px 32px rgba(5, 9, 26, 0.55);
  --shadow-card: 0 4px 24px rgba(5, 9, 26, 0.35);
  --transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  --md-strong-weight: 650;
  --md-strong-color: color-mix(in srgb, currentColor 84%, var(--blue) 16%);

  /* typography */
  --font: "Inter", system-ui, -apple-system, sans-serif;
  color-scheme: light;
}

/* ── Dark Theme ────────────────────────────────────– */
[data-theme="dark"] {
  /* Dark sections stay dark — these are the panel/card colors */
  --navy: #131929;
  --navy-2: #0c1020;
  --navy-card: #1a2240;
  --navy-border: #2a3558;
  /* Blue stays vibrant */
  --blue: #3b82f6;
  --blue-light: #60a5fa;
  --blue-glow: rgba(59, 130, 246, 0.3);
  --blue-subtle: rgba(59, 130, 246, 0.12);
  /* Text on dark section panels */
  --white: #e8eef8;
  --off-white: #c0cce8;
  --text: #8094c0;
  --text-muted: #5a6a90;
  /* Body / "light" sections flip to dark */
  --light-bg: #0d1117;
  --light-text: #d4dff5;
  --light-sub: #8a9abc;
  --light-border: #1e2d4a;
  /* Shadows */
  --shadow: 0 8px 32px rgba(0, 0, 0, 0.7);
  --shadow-card: 0 4px 24px rgba(0, 0, 0, 0.5);
  --md-strong-weight: 650;
  --md-strong-color: color-mix(in srgb, currentColor 82%, var(--blue-light) 18%);
  color-scheme: dark;
}

/* ── Reset & Base ───────────────────────────────────── */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 72px;
}

body {
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.65;
  background: var(--light-bg);
  color: var(--light-text);
  overflow-x: hidden;
}

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

a {
  text-decoration: none;
  color: inherit;
}

ul {
  list-style: none;
}

.ats-resume {
  display: none;
}

/* ── Utilities ──────────────────────────────────────── */
.container {
  max-width: 1140px;
  margin: 0 auto;
  padding: 0 24px;
}

.section-dark {
  background: var(--navy);
  color: var(--off-white);
}

/* Light theme: section-dark sections become light */
[data-theme="light"] .section-dark {
  background: var(--light-bg);
  color: var(--light-text);
}

[data-theme="light"] #hero .hero-overlay {
  background: linear-gradient(
    135deg,
    rgba(20, 25, 40, 0.7) 0%,
    rgba(25, 30, 50, 0.65) 50%,
    rgba(20, 25, 40, 0.7) 100%
  );
}

[data-theme="light"] #hero .hero-grid {
  background-image:
    linear-gradient(rgba(29, 110, 245, 0.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(29, 110, 245, 0.02) 1px, transparent 1px);
  background-size: 48px 48px;
}

[data-theme="light"] .section-dark .skill-card,
[data-theme="light"] .section-dark .achievement-card,
[data-theme="light"] .section-dark .contact-card,
[data-theme="light"] .section-dark .contact-cta-box {
  background: var(--light-bg);
  border-color: var(--light-border);
  color: var(--light-text);
}

[data-theme="light"] .section-dark .skill-card h3,
[data-theme="light"] .section-dark .achievement-card h3,
[data-theme="light"] .section-dark .contact-card strong,
[data-theme="light"] .section-dark .contact-cta-box h3 {
  color: var(--light-text);
}

[data-theme="light"] .section-dark .skill-card ul li,
[data-theme="light"] .section-dark .achievement-card p,
[data-theme="light"] .section-dark .contact-card span,
[data-theme="light"] .section-dark .contact-cta-box p {
  color: var(--light-text);
}

[data-theme="light"] .section-dark .section-header h2 {
  color: var(--light-text);
}

[data-theme="light"] #hero .hero-name,
[data-theme="light"] #hero .stat-num {
  color: #ffffff;
}

[data-theme="light"] #hero .hero-tagline,
[data-theme="light"] #hero .stat-label {
  color: #e8edf8;
}

[data-theme="light"] .name-first {
  color: #ffffff;
}

[data-theme="light"] #hero .name-last {
  color: #4d8ff7;
}

[data-theme="light"] #hero .hero-badge {
  background: rgba(29, 110, 245, 0.25);
  border-color: rgba(29, 110, 245, 0.5);
  color: #ffffff;
}

[data-theme="light"] .section-dark .skill-icon,
[data-theme="light"] .section-dark .achievement-icon,
[data-theme="light"] .section-dark .cc-icon {
  background: var(--blue-subtle);
  border-color: rgba(29, 110, 245, 0.2);
}

[data-theme="light"] .section-dark .achievement-impact {
  background: rgba(29, 110, 245, 0.08);
  border-color: rgba(29, 110, 245, 0.2);
  color: var(--blue);
}

[data-theme="light"] .section-dark .achievement-impact strong {
  color: var(--light-text);
}

[data-theme="light"] #hero .stat-divider {
  background: rgba(255, 255, 255, 0.25);
}

[data-theme="light"] #hero .scroll-down {
  color: rgba(255, 255, 255, 0.6);
}

[data-theme="light"] #hero .scroll-down:hover {
  color: #4d8ff7;
}

[data-theme="light"] .section-dark .skill-card:hover,
[data-theme="light"] .section-dark .achievement-card:hover,
[data-theme="light"] .section-dark .contact-card:hover:not(.no-link) {
  border-color: var(--blue);
}

[data-theme="light"] .section-dark .section-tag {
  background: var(--blue-subtle);
  border-color: rgba(29, 110, 245, 0.2);
}

[data-theme="light"] .section-dark .skill-card ul li {
  border-color: var(--light-border);
}

[data-theme="light"] .section-dark .achievement-year {
  color: var(--light-sub);
}

[data-theme="light"] .section-dark .contact-cta-box::before {
  background: radial-gradient(
    circle at 50% 0%,
    rgba(29, 110, 245, 0.08) 0%,
    transparent 60%
  );
}

section:not(#hero):not(.section-dark) {
  padding: 36px 0;
}

.section-dark {
  padding: 36px 0;
}

.section-header {
  text-align: center;
  margin-bottom: 60px;
}

.section-header h2 {
  font-size: clamp(1.8rem, 3vw, 2.6rem);
  font-weight: 800;
  color: var(--light-text);
  line-height: 1.2;
  margin-top: 8px;
}

.section-header.light h2 {
  color: var(--white);
}

.section-header.light .section-sub {
  color: var(--text);
}

.section-tag {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--blue);
  background: var(--blue-subtle);
  border: 1px solid var(--blue-glow);
  border-radius: 999px;
  padding: 4px 14px;
}

.section-dark .section-tag {
  background: rgba(59, 130, 246, 0.18);
  border-color: rgba(59, 130, 246, 0.4);
}

.section-sub {
  margin-top: 12px;
  font-size: 1.05rem;
  color: var(--light-sub);
  max-width: 560px;
  margin-left: auto;
  margin-right: auto;
}

/* ── Buttons ────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  border: 2px solid transparent;
  transition: var(--transition);
  white-space: nowrap;
}

.btn-primary {
  background: var(--blue);
  color: var(--white);
  border-color: var(--blue);
}

.btn-primary:hover {
  background: var(--blue-light);
  border-color: var(--blue-light);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px var(--blue-glow);
}

.btn-outline {
  background: transparent;
  color: var(--white);
  border-color: rgba(255, 255, 255, 0.45);
}

.btn-ghost {
  background: transparent;
  color: var(--blue);
  border-color: rgba(29, 110, 245, 0.35);
}

.btn-ghost:hover {
  background: var(--blue-subtle);
  border-color: var(--blue);
}

.btn-sm {
  padding: 8px 16px;
  font-size: 0.85rem;
}
.btn-lg {
  padding: 14px 32px;
  font-size: 1rem;
}

/* ── Navbar ─────────────────────────────────────────── */
#navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: linear-gradient(
    180deg,
    rgba(28, 38, 64, 0.78) 0%,
    rgba(16, 22, 42, 0.64) 100%
  );
  backdrop-filter: blur(34px) saturate(170%);
  -webkit-backdrop-filter: blur(34px) saturate(170%);
  border-bottom: 1px solid rgba(140, 165, 210, 0.22);
  box-shadow:
    0 10px 34px rgba(0, 0, 0, 0.34),
    inset 0 1px 0 rgba(255, 255, 255, 0.12);
  transition:
    background var(--transition),
    box-shadow var(--transition),
    backdrop-filter var(--transition);
  padding: 0;
}

[data-theme="light"] #navbar {
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.82) 0%,
    rgba(241, 246, 255, 0.74) 100%
  );
  backdrop-filter: blur(30px) saturate(160%);
  -webkit-backdrop-filter: blur(30px) saturate(160%);
  border-bottom: 1px solid rgba(105, 128, 173, 0.24);
  box-shadow:
    0 10px 30px rgba(5, 9, 26, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.85);
}

[data-theme="light"] #navbar .nav-brand {
  color: var(--light-text);
}

[data-theme="light"] #navbar .nav-link {
  color: rgba(26, 32, 64, 0.7);
}

[data-theme="light"] #navbar .nav-link:hover,
[data-theme="light"] #navbar .nav-link.active {
  color: var(--light-text);
  background: rgba(29, 110, 245, 0.08);
}

[data-theme="light"] #navbar #theme-toggle {
  color: rgba(26, 32, 64, 0.6);
}

[data-theme="light"] #navbar #theme-toggle:hover {
  background: rgba(29, 110, 245, 0.1);
  color: var(--light-text);
}

#navbar.scrolled {
  background: linear-gradient(
    180deg,
    rgba(28, 38, 64, 0.78) 0%,
    rgba(16, 22, 42, 0.64) 100%
  );
  backdrop-filter: blur(34px) saturate(170%);
  -webkit-backdrop-filter: blur(34px) saturate(170%);
  border-bottom: 1px solid rgba(140, 165, 210, 0.22);
  box-shadow:
    0 10px 34px rgba(0, 0, 0, 0.34),
    inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

[data-theme="light"] #navbar.scrolled {
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.82) 0%,
    rgba(241, 246, 255, 0.74) 100%
  );
  backdrop-filter: blur(30px) saturate(160%);
  -webkit-backdrop-filter: blur(30px) saturate(160%);
  border-bottom: 1px solid rgba(105, 128, 173, 0.24);
  box-shadow:
    0 10px 30px rgba(5, 9, 26, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.85);
}

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

.nav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--white);
  letter-spacing: 0.01em;
}

[data-theme="light"] #navbar.scrolled .nav-brand {
  color: var(--light-text);
}

.brand-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: var(--blue);
  color: var(--white);
  font-size: 0.9rem;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
}

.nav-link {
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.75);
  transition: var(--transition);
}

.nav-link:hover,
.nav-link.active {
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
}

.nav-link.active {
  color: var(--blue-light);
}

[data-theme="light"] #navbar.scrolled .nav-link {
  color: rgba(26, 32, 64, 0.7);
}

[data-theme="light"] #navbar.scrolled .nav-link:hover,
[data-theme="light"] #navbar.scrolled .nav-link.active {
  color: var(--light-text);
  background: rgba(29, 110, 245, 0.08);
}

#navbar.scrolled #theme-toggle {
  color: rgba(255, 255, 255, 0.6);
}

#navbar.scrolled #theme-toggle:hover {
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
}

[data-theme="light"] #navbar.scrolled #theme-toggle {
  color: rgba(26, 32, 64, 0.6);
}

[data-theme="light"] #navbar.scrolled #theme-toggle:hover {
  background: rgba(29, 110, 245, 0.1);
  color: var(--light-text);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}

.nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--white);
  border-radius: 2px;
  transition: var(--transition);
}

#theme-toggle {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1.2rem;
  color: rgba(255, 255, 255, 0.8);
  padding: 6px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  width: 32px;
  height: 32px;
  transition: var(--transition);
}

#theme-toggle:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  transform: scale(1.1);
}

#theme-toggle i {
  position: absolute;
  transition:
    opacity 0.3s ease,
    transform 0.3s ease;
}

#theme-toggle [data-icon="sun"] {
  opacity: 1;
  transform: rotate(0deg) scale(1);
}

#theme-toggle [data-icon="moon"] {
  opacity: 0;
  transform: rotate(-90deg) scale(0.8);
}

[data-theme="dark"] #theme-toggle [data-icon="sun"] {
  opacity: 0;
  transform: rotate(-90deg) scale(0.8);
}

[data-theme="dark"] #theme-toggle [data-icon="moon"] {
  opacity: 1;
  transform: rotate(0deg) scale(1);
}

/* ── Hero ───────────────────────────────────────────── */
#hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  inset: 0;
  background: url("https://images.unsplash.com/photo-1558494949-ef010cbdcc31?w=1920&q=80")
    center / cover no-repeat;
  z-index: 0;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    135deg,
    rgba(5, 9, 26, 0.92) 0%,
    rgba(10, 15, 45, 0.85) 50%,
    rgba(5, 9, 26, 0.9) 100%
  );
}

.hero-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(29, 110, 245, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(29, 110, 245, 0.06) 1px, transparent 1px);
  background-size: 48px 48px;
}

.hero-content {
  position: relative;
  z-index: 1;
  max-width: 820px;
  padding: 120px 24px 80px;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(29, 110, 245, 0.18);
  border: 1px solid rgba(29, 110, 245, 0.45);
  border-radius: 999px;
  padding: 6px 18px;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--blue-light);
  margin-bottom: 28px;
}

.hero-name {
  font-size: clamp(3.5rem, 9vw, 7rem);
  font-weight: 900;
  line-height: 1;
  letter-spacing: -0.03em;
  margin-bottom: 24px;
  text-transform: uppercase;
}

.name-first {
  color: var(--white);
}
.name-last {
  color: var(--blue);
}

.hero-tagline {
  font-size: clamp(1.1rem, 2.5vw, 1.45rem);
  color: var(--text);
  max-width: 666px;
  margin: 0 auto 40px;
  line-height: 1.5;
}

#hero .hero-copy-line {
  display: block;
}

#hero .hero-tagline br {
  display: none;
}

.copy-linebreak {
  display: none;
}

.hero-print-contact {
  display: block;
}

#hero .hero-print-contact a {
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
  font-weight: 600;
}

#hero .hero-print-contact a:hover,
#hero .hero-print-contact a:focus-visible {
  text-decoration-thickness: 2px;
}

[data-theme="dark"] #hero .hero-print-contact a {
  color: var(--blue-light);
}

[data-theme="dark"] #hero .hero-print-contact a:hover,
[data-theme="dark"] #hero .hero-print-contact a:focus-visible {
  color: var(--white);
}

[data-theme="light"] #hero .hero-print-contact a {
  color: var(--blue-light);
}

[data-theme="light"] #hero .hero-print-contact a:hover,
[data-theme="light"] #hero .hero-print-contact a:focus-visible {
  color: var(--white);
}

.hero-print-links {
  display: none !important;
}

.hero-stats {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 32px;
  margin-bottom: 48px;
  flex-wrap: wrap;
}

.stat {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.stat-num {
  font-size: 2rem;
  font-weight: 800;
  color: var(--white);
  line-height: 1;
}

.stat-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-top: 4px;
}

.stat-divider {
  width: 1px;
  height: 40px;
  background: rgba(255, 255, 255, 0.15);
}

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

.scroll-down {
  position: absolute;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1;
  color: rgba(255, 255, 255, 0.4);
  font-size: 1.1rem;
  animation: bounce 2s infinite;
  transition: color var(--transition);
}

.scroll-down:hover {
  color: var(--blue-light);
}

@keyframes bounce {
  0%,
  100% {
    transform: translateX(-50%) translateY(0);
  }
  50% {
    transform: translateX(-50%) translateY(8px);
  }
}

/* ── About ──────────────────────────────────────────── */
#about {
  background: var(--light-bg);
}

.about-grid {
  display: grid;
  grid-template-columns: 340px 1fr;
  gap: 64px;
  align-items: start;
}

.about-image-wrap {
  position: relative;
}

.about-image-bg {
  position: absolute;
  inset: -16px -16px -16px 16px;
  background: linear-gradient(135deg, var(--blue-subtle), transparent);
  border-radius: var(--radius-lg);
  border: 1px solid rgba(29, 110, 245, 0.2);
}

.about-photo {
  position: relative;
  width: 100%;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  object-fit: cover;
  aspect-ratio: 3/4;
}

.about-image-wrap.no-photo .about-image-bg {
  position: relative;
  inset: 0;
  aspect-ratio: 3/4;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 5rem;
  color: var(--blue);
}

.about-text p {
  color: var(--light-sub);
  margin-bottom: 20px;
  font-size: 1.05rem;
}

.about-highlights {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin: 32px 0;
}

.highlight-item {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  background: var(--light-bg);
  border: 1px solid var(--light-border);
  border-radius: var(--radius);
  padding: 16px;
}

.highlight-item i {
  font-size: 1.3rem;
  color: var(--blue);
  margin-top: 2px;
  flex-shrink: 0;
}

.highlight-item strong {
  display: block;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--light-text);
}

.highlight-item span {
  font-size: 0.8rem;
  color: var(--light-sub);
}

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

/* ── Skills ─────────────────────────────────────────── */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.skill-card {
  background: var(--navy-card);
  border: 1px solid var(--navy-border);
  border-radius: var(--radius);
  padding: 28px 24px;
  transition: var(--transition);
}

.skill-card:hover {
  border-color: var(--blue);
  transform: translateY(-4px);
  box-shadow: 0 8px 32px var(--blue-glow);
}

.skill-icon {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-sm);
  background: var(--blue-subtle);
  border: 1px solid rgba(29, 110, 245, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  color: var(--blue);
  margin-bottom: 18px;
}

.skill-card h3 {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--white);
  margin-bottom: 14px;
}

.skill-card ul li {
  font-size: 0.85rem;
  color: var(--text);
  padding: 5px 0;
  border-bottom: 1px solid var(--navy-border);
  padding-left: 12px;
  position: relative;
}

.skill-card ul li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--blue);
}

.skill-card ul li:last-child {
  border-bottom: none;
}

/* ── Experience / Timeline ──────────────────────────── */
#experience {
  background: var(--light-bg);
}

.timeline {
  position: relative;
  max-width: 860px;
  margin: 0 auto;
}

#experience .timeline {
  max-width: 980px;
}

.timeline-item {
  display: grid;
  grid-template-columns: 56px 1fr;
  gap: 24px;
  margin-bottom: 40px;
}

.timeline-marker {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.tl-dot {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--blue);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  color: var(--white);
  flex-shrink: 0;
  box-shadow: 0 0 0 4px rgba(29, 110, 245, 0.2);
  z-index: 1;
}

.tl-line {
  flex: 1;
  width: 2px;
  background: linear-gradient(to bottom, var(--blue), rgba(29, 110, 245, 0.1));
  margin: 8px 0;
}

.timeline-card {
  background: var(--light-bg);
  border: 1px solid var(--light-border);
  border-radius: var(--radius);
  padding: 24px 28px;
  margin-bottom: 0;
  transition: var(--transition);
}

.timeline-card:hover {
  border-color: var(--blue);
  box-shadow: 0 4px 24px rgba(29, 110, 245, 0.1);
}

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

.tc-header h3 {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--light-text);
}

.recognition-quotes {
  display: grid;
  gap: 12px;
}

.recognition-quote {
  margin: 0;
  padding: 12px 14px;
  border-left: 4px solid var(--blue);
  border-radius: 10px;
  background: rgba(29, 110, 245, 0.04);
}

.recognition-quote p {
  margin: 0;
}

.publication-link {
  color: var(--blue);
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.publication-link::after {
  content: "↗";
  font-size: 0.85em;
  line-height: 1;
}

.publication-link:hover {
  color: var(--blue-light);
}

.publication-link:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
  border-radius: 4px;
}

.tc-company {
  display: inline-block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--blue);
  margin-right: 12px;
}

.tc-meta {
  font-size: 0.85rem;
  margin: 2px 0 8px;
  color: var(--light-sub);
}

.tc-meta .tc-company {
  color: var(--blue);
  font-weight: 600;
  margin-right: 0;
}

.tc-meta .tc-date {
  font-size: 0.85rem;
  font-style: italic;
  color: var(--light-sub);
  background: none;
  border: none;
  border-radius: 0;
  padding: 0;
  white-space: normal;
  flex-shrink: unset;
}

.tc-meta .tc-sep {
  font-style: normal;
  color: var(--light-sub);
}

.tc-meta .tc-date::before {
  content: none;
  font-style: normal;
  color: var(--light-sub);
}


.tc-location {
  font-size: 0.8rem;
  color: var(--light-sub);
}

.tc-location i {
  margin-right: 4px;
}

.tc-date {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--light-sub);
  background: var(--light-bg);
  border: 1px solid var(--light-border);
  border-radius: 999px;
  padding: 3px 12px;
  white-space: nowrap;
  flex-shrink: 0;
}

.tc-summary {
  font-size: 0.9rem;
  color: var(--light-sub);
  font-style: italic;
  margin-bottom: 14px;
  border-left: 3px solid var(--blue);
  padding-left: 12px;
}

.tc-bullets {
  padding-left: 0;
}

.tc-bullets li {
  font-size: 0.9rem;
  color: var(--light-sub);
  padding: 5px 0 5px 20px;
  position: relative;
}

.tc-bullets li::before {
  content: "→";
  position: absolute;
  left: 0;
  color: var(--blue);
  font-weight: 700;
}

.tc-bullets li .tc-bullet-title {
  color: color-mix(in srgb, var(--light-text) 86%, var(--light-sub) 14%);
  font-weight: 600;
}

/* ── Accomplishments ────────────────────────────────── */
.achievements-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
}

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

.achievement-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--blue), var(--blue-light));
  border-radius: var(--radius) var(--radius) 0 0;
}

.achievement-card:hover {
  border-color: var(--blue);
  transform: translateY(-4px);
  box-shadow: 0 8px 32px var(--blue-glow);
}

.achievement-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-sm);
  background: var(--blue-subtle);
  border: 1px solid rgba(29, 110, 245, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  color: var(--blue);
  margin-bottom: 16px;
}

.achievement-year {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.achievement-card h3 {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--white);
  margin-bottom: 12px;
}

.achievement-card p {
  font-size: 0.9rem;
  color: var(--text);
  margin-bottom: 16px;
}

.achievement-impact {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 0.85rem;
  color: var(--blue-light);
  background: rgba(29, 110, 245, 0.1);
  border: 1px solid rgba(29, 110, 245, 0.2);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
}

.achievement-impact i {
  flex-shrink: 0;
  margin-top: 2px;
}
.achievement-impact strong {
  color: var(--white);
}

/* ── Education ──────────────────────────────────────── */
#education {
  background: var(--light-bg);
}

.edu-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  max-width: 900px;
  margin: 0 auto;
}

.edu-col-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--light-text);
  margin-bottom: 24px;
}

.edu-col-title i {
  color: var(--blue);
}

.edu-item {
  margin-bottom: 20px;
  padding-left: 16px;
  border-left: 3px solid var(--blue);
}

.edu-item strong {
  display: block;
  font-size: 0.95rem;
  color: var(--light-text);
  margin-bottom: 4px;
}

.edu-item span {
  font-size: 0.85rem;
  color: var(--light-sub);
}

.cert-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.cert-badge {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--light-bg);
  border: 1px solid var(--light-border);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--light-text);
  transition: var(--transition);
}

.cert-badge i {
  color: var(--blue);
  font-size: 1rem;
  width: 20px;
  text-align: center;
}

.cert-badge:hover {
  border-color: var(--blue);
  background: var(--blue-subtle);
}

/* ── Contact ────────────────────────────────────────── */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: start;
}

.contact-cards {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.contact-card {
  display: flex;
  align-items: center;
  gap: 16px;
  background: var(--navy-card);
  border: 1px solid var(--navy-border);
  border-radius: var(--radius);
  padding: 16px 20px;
  transition: var(--transition);
  color: var(--off-white);
}

.contact-card:hover:not(.no-link) {
  border-color: var(--blue);
  transform: translateX(4px);
}

.cc-icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: var(--blue-subtle);
  border: 1px solid rgba(29, 110, 245, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
  color: var(--blue);
  flex-shrink: 0;
}

.contact-card strong {
  display: inline;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--white);
}

.contact-card span {
  display: inline;
  font-size: 0.85rem;
  color: var(--text);
}

.contact-card strong::after {
  content: ": ";
}

.contact-cta-box {
  background: var(--navy-card);
  border: 1px solid var(--navy-border);
  border-radius: var(--radius-lg);
  padding: 40px 36px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.contact-cta-box::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(
    circle at 50% 0%,
    rgba(29, 110, 245, 0.15) 0%,
    transparent 60%
  );
  pointer-events: none;
}

.contact-cta-box h3 {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--white);
  margin-bottom: 14px;
  line-height: 1.3;
}

.contact-cta-box p {
  font-size: 0.92rem;
  color: var(--text);
  margin-bottom: 28px;
  line-height: 1.6;
}

.contact-cta-box .btn {
  width: 100%;
  justify-content: center;
  margin-bottom: 12px;
}

/* ── Footer ─────────────────────────────────────────── */
#footer {
  background: var(--navy-2);
  border-top: 1px solid var(--navy-border);
  padding: 40px 0;
  color: var(--text);
}

.footer-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  text-align: center;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--white);
}

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

.footer-links {
  display: flex;
  gap: 16px;
}

.footer-links a {
  width: 38px;
  height: 38px;
  border-radius: 8px;
  background: var(--navy-card);
  border: 1px solid var(--navy-border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text);
  font-size: 1rem;
  transition: var(--transition);
}

.footer-links a:hover {
  color: var(--blue-light);
  border-color: var(--blue);
  background: var(--blue-subtle);
}

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

/* ── Responsive ─────────────────────────────────────── */
@media (max-width: 1024px) {
  .skills-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .about-grid {
    grid-template-columns: 260px 1fr;
    gap: 40px;
  }
}

@media (max-width: 768px) {
  .brand-icon {
    display: none;
  }

  .nav-brand {
    gap: 8px;
  }

  .nav-links {
    display: none;
    position: fixed;
    top: 68px;
    left: 0;
    right: 0;
    background: rgba(5, 9, 26, 0.97);
    backdrop-filter: blur(16px);
    flex-direction: column;
    padding: 20px 16px;
    gap: 4px;
    border-bottom: 1px solid var(--navy-border);
  }

  .nav-links.open {
    display: flex;
  }

  .nav-link {
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    font-size: 1rem;
  }

  .nav-toggle {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.22);
    padding: 0;
    gap: 4px;
    flex-shrink: 0;
    box-sizing: border-box;
  }

  .nav-toggle span {
    width: 16px;
    height: 2px;
    background: rgba(255, 255, 255, 0.88);
  }

  [data-theme="light"] #navbar.scrolled .nav-toggle {
    background: rgba(255, 255, 255, 0.75);
    border-color: rgba(26, 32, 64, 0.2);
  }

  [data-theme="light"] #navbar.scrolled .nav-toggle span {
    background: rgba(26, 32, 64, 0.72);
  }

  /* Hide resume btn text on small */
  #navbar .btn-ghost span {
    display: none;
  }

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

  .about-image-wrap {
    max-width: 280px;
    margin: 0 auto;
  }

  .about-image-bg {
    display: none;
  }

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

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

  .edu-grid {
    grid-template-columns: 1fr;
    gap: 32px;
  }

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

  .hero-stats {
    gap: 20px;
  }

  .stat-divider {
    height: 30px;
  }

  .timeline-item {
    grid-template-columns: 40px 1fr;
    gap: 16px;
  }

  .tl-dot {
    width: 36px;
    height: 36px;
    font-size: 0.85rem;
  }

  .tc-header {
    flex-direction: column;
  }
}

@media (max-width: 480px) {
  .about-highlights {
    grid-template-columns: 1fr;
  }

  .hero-name {
    font-size: clamp(3rem, 16vw, 5rem);
  }
}

/* ── Page loader ──────────────────────────────── */
#page-loader {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: var(--navy);
  display: flex;
  align-items: center;
  justify-content: center;
}

.loader-spinner {
  width: 48px;
  height: 48px;
  border: 4px solid rgba(29, 110, 245, 0.25);
  border-top-color: var(--blue);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* Rendered-mode helpers */
.markdown-syntax {
  font-size: 0 !important;
  line-height: 0 !important;
  display: inline !important;
  width: 0 !important;
  overflow: hidden !important;
  color: transparent !important;
}

.md-strong {
  font-weight: var(--md-strong-weight, 600);
  color: var(--md-strong-color, inherit);
  letter-spacing: 0.005em;
}

.md-em {
  font-style: italic;
  color: inherit;
}

/* Keep toggle button position consistent in rendered mode */
.view-toggle {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 3000;
  border: 1px solid #cfd6e6;
  background: #ffffff;
  color: #1a2040;
  border-radius: 999px;
  padding: 10px 16px;
  font-family:
    Inter,
    system-ui,
    -apple-system,
    sans-serif;
  font-size: 0.84rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(9, 16, 36, 0.18);
}

.view-toggle:hover {
  border-color: #1d6ef5;
  color: #1d6ef5;
}
