:root {
  --navy-950: #171c3a;
  --navy-900: #272f5e;
  --navy-800: #333e7a;
  --accent: #4f6df5;
  --accent-soft: rgba(79, 109, 245, 0.12);
  --warm-accent: #eab308;

  --bg: #f8f9fc;
  --bg-alt: #f1f4fa;
  --surface: #ffffff;
  --text: #181e3a;
  --text-muted: #525b7a;
  --border: #e2e7f2;
  --shadow: 0 10px 30px -12px rgba(23, 28, 58, 0.08);
  --radius: 14px;
  --font-sans: "Plus Jakarta Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
}

[data-theme="dark"] {
  --bg: #0f1326;
  --bg-alt: #141933;
  --surface: #1a2142;
  --text: #eef1fa;
  --text-muted: #a6b0cf;
  --border: #2a335e;
  --accent: #748ffc;
  --accent-soft: rgba(116, 143, 252, 0.15);
  --shadow: 0 14px 34px -14px rgba(0, 0, 0, 0.45);
}

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

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

body {
  margin: 0;
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  transition: background-color 0.2s ease, color 0.2s ease;
}

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

.skip-link {
  position: absolute;
  left: -9999px;
  top: 8px;
  background: var(--navy-900);
  color: #fff;
  padding: 8px 14px;
  border-radius: 8px;
  z-index: 1000;
}

.skip-link:focus {
  left: 12px;
}

.container {
  width: min(1120px, calc(100% - 2rem));
  margin: 0 auto;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(12px);
  background: color-mix(in srgb, var(--surface) 86%, transparent);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  height: 68px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: var(--navy-900);
  color: #fff;
  font-size: 0.85rem;
  font-weight: 800;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--text-muted);
}

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

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.icon-btn {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  transition: border-color 0.2s, background-color 0.2s;
}

.icon-btn:hover {
  border-color: var(--accent);
}

[data-theme="light"] .icon-sun { display: none; }
[data-theme="dark"] .icon-moon { display: none; }

.mobile-only { display: none; }

.mobile-nav {
  display: flex;
  flex-direction: column;
  padding: 0.75rem 1rem 1rem;
  border-top: 1px solid var(--border);
  background: var(--surface);
  gap: 0.5rem;
}

.mobile-nav[hidden] {
  display: none;
}

.mobile-nav a {
  padding: 0.5rem 0.75rem;
  border-radius: 8px;
  font-weight: 500;
}

.mobile-nav a:hover {
  background: var(--bg-alt);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.7rem 1.2rem;
  border-radius: 10px;
  font-family: inherit;
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  transition: transform 0.15s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn-sm {
  padding: 0.45rem 0.85rem;
  font-size: 0.85rem;
}

.btn-primary {
  background: var(--navy-900);
  color: #fff;
  box-shadow: 0 8px 20px -8px rgba(39, 47, 94, 0.55);
}

[data-theme="dark"] .btn-primary {
  background: var(--accent);
  color: #0b1024;
}

.btn-outline {
  border-color: var(--border);
  background: var(--surface);
  color: var(--text);
}

.btn-outline:hover {
  border-color: var(--accent);
}

.btn-outline-light {
  border-color: rgba(255, 255, 255, 0.35);
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.btn-outline-light:hover {
  background: rgba(255, 255, 255, 0.16);
}

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
}

.btn-ghost:hover {
  color: var(--text);
  background: var(--bg-alt);
}

/* Hero */
.hero {
  padding: 4.5rem 0 4rem;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.35fr 0.95fr;
  gap: 2.5rem;
  align-items: center;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.35rem 0.85rem;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 1.15rem;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #10b981;
}

.hero h1 {
  margin: 0 0 1rem;
  font-size: clamp(2.35rem, 5vw, 3.6rem);
  line-height: 1.1;
  letter-spacing: -0.03em;
}

.hero-lead {
  margin: 0 0 1.75rem;
  font-size: 1.1rem;
  color: var(--text-muted);
  max-width: 58ch;
}

.hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
}

.hero-card {
  background: var(--navy-900);
  color: #fff;
  padding: 1.85rem;
  border-radius: 18px;
  box-shadow: 0 20px 45px -18px rgba(23, 28, 58, 0.55);
}

.profile-badge {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding-bottom: 1.25rem;
  margin-bottom: 1.25rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.14);
}

.avatar-monogram {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #fef3c7;
  color: var(--navy-900);
  font-weight: 800;
  font-size: 1.2rem;
  flex-shrink: 0;
}

.profile-card-name {
  font-weight: 700;
  font-size: 1.1rem;
}

.profile-card-role {
  font-size: 0.88rem;
  color: rgba(255, 255, 255, 0.78);
}

.quick-facts {
  margin: 0;
  display: grid;
  gap: 0.9rem;
}

.quick-facts dt {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(255, 255, 255, 0.65);
  margin-bottom: 0.15rem;
}

.quick-facts dd {
  margin: 0;
  font-size: 0.93rem;
  font-weight: 500;
}

.copy-inline {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: none;
  border: none;
  padding: 0;
  color: #fff;
  font: inherit;
  cursor: pointer;
}

.copy-tag {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  padding: 0.12rem 0.45rem;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.15);
  color: rgba(255, 255, 255, 0.9);
}

/* Sections */
.section {
  padding: 4.25rem 0;
}

.section-alt {
  background: var(--bg-alt);
}

.section-header {
  margin-bottom: 2rem;
}

.section-header-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-end;
  gap: 1rem;
}

.section-kicker {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent);
  margin-bottom: 0.35rem;
}

.section h2 {
  margin: 0;
  font-size: clamp(1.65rem, 3vw, 2.15rem);
  letter-spacing: -0.02em;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow);
}

/* About */
.about-grid {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 1.5rem;
}

.about-text {
  margin: 0 0 1rem;
  color: var(--text-muted);
}

.about-text:last-child {
  margin-bottom: 0;
}

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

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  box-shadow: var(--shadow);
}

.stat-value {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--navy-900);
  letter-spacing: -0.02em;
}

[data-theme="dark"] .stat-value {
  color: var(--accent);
}

.stat-label {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 0.2rem;
}

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

.skill-group h3 {
  margin: 0 0 0.9rem;
  font-size: 1rem;
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.tag {
  font-size: 0.8rem;
  font-weight: 500;
  padding: 0.28rem 0.65rem;
  border-radius: 999px;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  color: var(--text-muted);
}

.tag-accent {
  background: var(--accent-soft);
  border-color: transparent;
  color: var(--accent);
  font-weight: 600;
}

/* Timeline */
.timeline {
  position: relative;
  display: grid;
  gap: 1.5rem;
  padding-left: 1.75rem;
}

.timeline::before {
  content: "";
  position: absolute;
  left: 7px;
  top: 12px;
  bottom: 12px;
  width: 2px;
  background: var(--border);
}

.timeline-item {
  position: relative;
}

.timeline-marker {
  position: absolute;
  left: -1.75rem;
  top: 1.4rem;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--navy-900);
  border: 3px solid var(--bg);
  box-shadow: 0 0 0 2px var(--accent);
}

.timeline-top {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.timeline-top h3 {
  margin: 0;
  font-size: 1.15rem;
}

.company {
  margin: 0.15rem 0 0;
  font-weight: 600;
  color: var(--accent);
  font-size: 0.95rem;
}

.period-badge {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  padding: 0.25rem 0.65rem;
  border-radius: 999px;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  color: var(--text-muted);
}

.stack-line {
  font-size: 0.88rem;
  color: var(--text-muted);
  background: var(--bg-alt);
  padding: 0.6rem 0.85rem;
  border-radius: 8px;
  margin: 0 0 1rem;
}

.exp-list {
  margin: 0;
  padding-left: 1.15rem;
  display: grid;
  gap: 0.65rem;
  color: var(--text-muted);
  font-size: 0.94rem;
}

.exp-list strong {
  color: var(--text);
}

/* Projects */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.filter-btn {
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  padding: 0.45rem 0.9rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s ease;
}

.filter-btn:hover {
  border-color: var(--accent);
  color: var(--text);
}

.filter-btn.active {
  background: var(--navy-900);
  color: #fff;
  border-color: var(--navy-900);
}

[data-theme="dark"] .filter-btn.active {
  background: var(--accent);
  color: #0b1024;
  border-color: var(--accent);
}

.projects-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
}

.project-card {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.project-card:hover {
  transform: translateY(-3px);
  border-color: var(--accent);
}

.project-card[hidden] {
  display: none;
}

.project-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.78rem;
}

.project-org {
  font-weight: 600;
  color: var(--accent);
}

.project-type {
  font-family: var(--font-mono);
  color: var(--text-muted);
}

.project-card h3 {
  margin: 0;
  font-size: 1.08rem;
}

.project-card p {
  margin: 0;
  font-size: 0.9rem;
  color: var(--text-muted);
  flex: 1;
}

/* Education & Referees */
.info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}

.info-grid h3 {
  margin: 0 0 1rem;
  font-size: 1.1rem;
}

.sub-heading {
  margin-top: 1.75rem !important;
}

.edu-block h4 {
  margin: 0.65rem 0 0.2rem;
  font-size: 1.05rem;
}

.edu-block p {
  margin: 0;
  color: var(--text-muted);
}

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

.hobby-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.6rem 0.85rem;
  border-radius: 10px;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  font-size: 0.9rem;
  font-weight: 500;
}

.referees-list {
  display: grid;
  gap: 1.25rem;
}

.referee-item {
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}

.referee-item:last-child {
  padding-bottom: 0;
  border-bottom: none;
}

.referee-item h4 {
  margin: 0 0 0.2rem;
}

.ref-role {
  margin: 0 0 0.35rem;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.ref-contact {
  margin: 0;
  font-size: 0.88rem;
}

.ref-contact a {
  color: var(--accent);
}

.ref-contact a:hover {
  text-decoration: underline;
}

/* Contact Banner */
.contact-banner {
  background: var(--navy-900);
  color: #fff;
  padding: 2.5rem;
  border-radius: 18px;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 1.5rem;
}

.contact-banner .section-kicker {
  color: #a5b4fc;
}

.contact-banner h2 {
  margin: 0 0 0.5rem;
}

.contact-banner p {
  margin: 0;
  color: rgba(255, 255, 255, 0.8);
  max-width: 52ch;
}

.contact-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.contact-banner .btn-primary {
  background: #fff;
  color: var(--navy-900);
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 1.5rem 0;
  font-size: 0.88rem;
  color: var(--text-muted);
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
}

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

/* Toast */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: var(--navy-900);
  color: #fff;
  padding: 0.65rem 1.1rem;
  border-radius: 10px;
  font-size: 0.88rem;
  font-weight: 500;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.25);
  z-index: 200;
}

/* Responsive */
@media (max-width: 960px) {
  .hero-grid,
  .about-grid,
  .info-grid {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 680px) {
  .nav-links,
  #print-btn span {
    display: none;
  }

  .mobile-only {
    display: grid;
  }

  .skills-grid,
  .projects-grid,
  .stats-grid,
  .hobbies-grid {
    grid-template-columns: 1fr;
  }

  .hero {
    padding: 2.75rem 0;
  }

  .contact-banner {
    padding: 1.75rem;
  }
}

/* Print */
@media print {
  .site-header,
  .filter-bar,
  .hero-cta,
  .copy-tag,
  .toast,
  .site-footer a {
    display: none !important;
  }

  body {
    background: #fff;
    color: #000;
  }

  .section {
    padding: 1.5rem 0;
  }

  .card,
  .hero-card,
  .contact-banner {
    box-shadow: none;
    break-inside: avoid;
  }
}
