:root {
  /* High-end Midnight Navy & Optic Azure Palette */
  --bg-surface: #faf8ff;
  --bg-surface-low: #f2f3ff;
  --bg-surface-lowest: #ffffff;
  --bg-primary-container: #001e2f;
  
  --text-on-surface: #131b2e;
  --text-on-surface-variant: #45464d;
  --text-on-primary-container: #008cc7;
  --text-primary-fixed: #c9e6ff;
  --text-sky: #89ceff;
  --text-white: #ffffff;
  
  --border-subtle: rgba(198, 198, 205, 0.3);
  --border-highlight: rgba(255, 255, 255, 0.1);

  /* Typography */
  --font-headline: "Manrope", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-body: var(--font-headline);
  --font-label: var(--font-headline);

  /* macOS Aesthetic Shadows */
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 10px 30px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 20px 40px rgba(15, 23, 42, 0.06);
  --shadow-float: 0 30px 60px rgba(0, 30, 47, 0.2);
  
  /* Radii */
  --radius-sm: 0.25rem;
  --radius-md: 0.5rem;
  --radius-lg: 0.75rem;
  --radius-xl: 1rem;
  --radius-full: 9999px;

  /* Transitions */
  --transition-theme: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

[data-theme="dark"] {
  --bg-surface: #0f172a;
  --bg-surface-low: #1e293b;
  --bg-surface-lowest: #0c111d;
  --bg-primary-container: #000c14; /* Even deeper for dark mode */
  
  --text-on-surface: #f1f5f9;
  --text-on-surface-variant: #94a3b8;
  --text-white: #ffffff;
  
  --border-subtle: rgba(255, 255, 255, 0.1);
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 10px 30px rgba(0, 0, 0, 0.6);
  --shadow-lg: 0 20px 40px rgba(0, 0, 0, 0.8);
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  background-color: var(--bg-surface);
  color: var(--text-on-surface);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: var(--transition-theme);
}

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

ul {
  list-style: none;
}

button {
  border: none;
  background: none;
  cursor: pointer;
  font-family: inherit;
}

/* Typography Utilities */
.font-headline { font-family: var(--font-headline); }
.font-label { font-family: var(--font-label); }
.text-uppercase { text-transform: uppercase; letter-spacing: 0.05em; }
.tracking-widest { letter-spacing: 0.1em; }
.tracking-tight { letter-spacing: -0.02em; }

/* Layout Utilities */
.container {
  max-width: 80rem;
  margin-left: auto;
  margin-right: auto;
  padding-left: 2rem;
  padding-right: 2rem;
}

.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }

/* Glassmorphism Navigation */
.nav-bar {
  position: fixed;
  top: 0;
  width: 100%;
  z-index: 50;
  background: rgba(250, 248, 255, 0.6);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-subtle);
  transition: all 0.3s ease;
}

.nav-bar .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 5rem;
}

.nav-brand {
  font-family: var(--font-headline);
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--text-on-surface);
}

.nav-links {
  display: flex;
  gap: 2rem;
}

.nav-link {
  font-family: var(--font-headline);
  font-weight: 500;
  color: var(--text-on-surface-variant);
  transition: color 0.2s ease;
  padding-bottom: 4px;
}

.nav-link:hover, .nav-link.active {
  color: var(--text-on-primary-container);
}
.nav-link.active {
  border-bottom: 2px solid var(--text-on-primary-container);
  font-weight: 700;
}

[data-theme="dark"] .nav-bar {
  background: rgba(15, 23, 42, 0.6);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.theme-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: var(--radius-full);
  color: var(--text-on-surface);
  background: rgba(0, 0, 0, 0.04);
  transition: all 0.2s ease;
  border: 1px solid var(--border-subtle);
}

[data-theme="dark"] .theme-toggle {
  background: rgba(255, 255, 255, 0.05);
}

.theme-toggle:hover {
  transform: translateY(-2px);
  background: rgba(0, 0, 0, 0.08);
}

[data-theme="dark"] .theme-toggle:hover {
  background: rgba(255, 255, 255, 0.1);
}

.theme-toggle .sun-icon { display: none; }
.theme-toggle .moon-icon { display: block; }

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

.nav-actions {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.nav-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--text-on-surface);
  cursor: pointer;
  padding: 0.5rem;
}

@media (max-width: 1024px) {
  .nav-links {
    gap: 1.5rem;
  }
}

@media (max-width: 768px) {
  .nav-links {
    display: none;
    position: absolute;
    top: 5rem;
    left: 0;
    width: 100%;
    background: var(--bg-surface-lowest);
    flex-direction: column;
    padding: 2rem;
    gap: 1.5rem;
    box-shadow: var(--shadow-lg);
    border-bottom: 1px solid var(--border-subtle);
    z-index: 100;
  }
  
  .nav-links.active {
    display: flex;
  }

  .nav-toggle {
    display: block;
  }
  
  .nav-brand {
    font-size: 1.25rem;
  }
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem 1.5rem;
  border-radius: var(--radius-full);
  font-family: var(--font-label);
  font-size: 0.875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  transition: all 0.2s ease;
}

.btn-primary {
  background-color: var(--bg-primary-container);
  color: var(--text-white);
}

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

/* Nav Specific Button Overrides */
.nav-bar .btn-primary, .cv-header .btn-primary {
  background-color: var(--text-on-primary-container);
  border: 1px solid var(--text-on-primary-container);
  box-shadow: 0 4px 20px rgba(0, 140, 199, 0.15);
}

.nav-bar .btn-primary:hover, .cv-header .btn-primary:hover {
  background-color: #0077aa;
  border-color: #0077aa;
  box-shadow: 0 6px 24px rgba(0, 140, 199, 0.25);
}

.btn-secondary {
  background-color: var(--text-on-primary-container);
  color: var(--bg-primary-container);
  padding: 1rem 2rem;
}

.btn-secondary:hover {
  opacity: 0.9;
}

/* Hero Section */
.hero {
  min-height: 100vh;
  background-color: var(--bg-primary-container);
  padding: 8rem 0 4rem 0; /* Increased top padding to clear fixed nav comfortably */
  display: flex;
  align-items: center;
  position: relative;
  overflow: visible; /* Allow glows to breathe but keep content safe */
}

.hero-bg-glow {
  position: absolute;
  top: -10%;
  right: -20%;
  width: 600px;
  height: 600px;
  border-radius: 50%;
  background: var(--text-on-primary-container);
  filter: blur(140px);
  opacity: 0.1;
  pointer-events: none;
}

.hero .container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: center;
  position: relative;
  z-index: 10;
}

.hero-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid var(--border-highlight);
  padding: 0.375rem 1rem;
  border-radius: var(--radius-full);
  margin-bottom: 2rem;
}
.hero-tag-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--text-on-primary-container);
}
.hero-tag-text {
  font-family: var(--font-label);
  font-size: 0.75rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--text-on-primary-container);
}

.hero-title {
  font-family: var(--font-headline);
  font-size: clamp(3rem, 8vw, 5rem);
  font-weight: 800; /* Heavy */
  color: var(--text-white);
  line-height: 1;
  margin-bottom: 2rem;
  letter-spacing: -0.04em;
}
.hero-title span {
  display: block;
  font-weight: 300; /* Light */
  font-size: 0.75em;
  color: var(--text-sky);
  font-style: normal;
  margin-top: 0.5rem;
  letter-spacing: -0.01em;
}

.hero-subtitle {
  font-family: var(--font-label);
  font-size: 1.25rem;
  color: var(--text-sky);
  margin-bottom: 1rem;
}

.hero-desc {
  font-size: 1.125rem;
  color: rgba(255, 255, 255, 0.8);
  max-width: 36rem;
  margin-bottom: 2.5rem;
}

.hero-actions {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.link-subtle {
  color: var(--text-white);
  font-family: var(--font-label);
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  border-bottom: 1px solid rgba(255, 255, 255, 0.3);
  padding-bottom: 2px;
  transition: all 0.2s ease;
}
.link-subtle:hover {
  color: var(--text-on-primary-container);
  border-color: var(--text-on-primary-container);
}

.hero-image-wrapper {
  position: relative;
  z-index: 5;
}
.hero-image-glow {
  position: absolute;
  inset: -2rem;
  background: radial-gradient(circle at center, rgba(14, 165, 233, 0.15), transparent 70%);
  border-radius: var(--radius-xl);
  filter: blur(40px);
  z-index: 1; /* Behind the container */
  pointer-events: none;
}
.hero-image-container {
  position: relative;
  z-index: 10; /* Above the glow */
  background: white;
  border-radius: var(--radius-xl);
  overflow: hidden;
  aspect-ratio: 4/5;
  max-height: 75vh; /* Safeguard against vertical overflow */
  width: fit-content;
  margin-left: auto;
  box-shadow: var(--shadow-float);
}
.hero-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 1;
  filter: none !important; /* Overriding any hidden or cached filter properties */
  transition: transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}
.hero-image-wrapper:hover .hero-image {
  transform: scale(1.02);
}

/* --- Sections & Layout --- */
.section {
    padding: clamp(4rem, 8vh, 6rem) 0; /* Tightened from 8rem for better pacing */
    position: relative;
}
.section-header {
    margin-bottom: 4rem;
    max-width: 52rem;
}
.section-tag {
    font-family: var(--font-label);
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    color: var(--text-on-primary-container);
    margin-bottom: 1.5rem;
    display: inline-block;
    background: rgba(0, 140, 199, 0.1);
    padding: 0.5rem 1rem;
    border-radius: var(--radius-sm);
}
.section-title {
    font-family: var(--font-headline);
    font-size: clamp(2.5rem, 5vw, 3.5rem);
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: 1.5rem;
    color: var(--text-on-surface);
    letter-spacing: -0.03em;
}
.section-title span {
    color: var(--text-on-primary-container);
    font-weight: 400;
}
.section-desc {
    font-size: 1.25rem;
    color: var(--text-on-surface-variant);
}

/* --- Bento Grid Layout --- */
.bento-grid {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 1.5rem;
}

.col-span-12 { grid-column: span 12; }
.col-span-7 { grid-column: span 7; }
.col-span-6 { grid-column: span 6; }
.col-span-5 { grid-column: span 5; }
.col-span-4 { grid-column: span 4; }
.col-span-3 { grid-column: span 3; }

@media (max-width: 1024px) {
    .bento-grid { grid-template-columns: repeat(6, 1fr); }
    .col-span-7, .col-span-6, .col-span-5 { grid-column: span 6; }
    .col-span-4, .col-span-3 { grid-column: span 3; }
}

@media (max-width: 768px) {
    .bento-grid { grid-template-columns: 1fr; }
    .col-span-7, .col-span-6, .col-span-5, .col-span-4, .col-span-3 { grid-column: span 1; }
    .hero .container { grid-template-columns: 1fr; }
}

/* --- Cards --- */
.card {
    border-radius: var(--radius-xl);
    padding: 2.5rem;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    border: 1px solid var(--border-subtle);
    display: flex;
    flex-direction: column;
}
.card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}
.card-surface {
    background-color: var(--bg-surface-lowest);
}
.card-primary {
    background-color: var(--bg-primary-container);
    color: var(--text-white);
    border-color: transparent;
}
.card-primary:hover {
    box-shadow: var(--shadow-float);
}

.card-icon {
    width: 3.5rem;
    height: 3.5rem;
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 2rem;
    transition: all 0.3s ease;
}
.card-surface .card-icon {
    background-color: var(--bg-surface-low);
    color: var(--text-on-primary-container);
}
.card-primary .card-icon {
    background-color: rgba(255, 255, 255, 0.1);
    color: var(--text-white);
}

.card:hover .card-icon {
    transform: scale(1.05);
}
.card-surface:hover .card-icon {
    background-color: var(--bg-primary-container);
    color: var(--text-white);
}
.card-primary:hover .card-icon {
    background-color: var(--text-white);
    color: var(--bg-primary-container);
}

.card-title {
    font-family: var(--font-headline);
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
}

/* --- Chips --- */
.chip-container {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: auto;
}
.chip, .chip-solid, .chip-soft {
    padding: 0.4rem 0.85rem;
    border-radius: 4px; /* matching the card radius style slightly better */
    font-family: var(--font-label);
    font-size: 0.75rem;
    font-weight: 600;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid var(--border-subtle);
    background-color: rgba(0, 140, 199, 0.04);
    color: var(--text-on-surface-variant);
    display: inline-flex;
    align-items: center;
}

.chip:hover, .chip-solid:hover, .chip-soft:hover {
    transform: translateY(-2px);
    background-color: var(--bg-surface-lowest);
    border-color: var(--text-on-primary-container);
    color: var(--text-on-primary-container);
    box-shadow: 0 4px 12px rgba(0, 140, 199, 0.08);
}

/* Primary card variations */
.card-primary .chip, .card-primary .chip-solid, .card-primary .chip-soft {
    background-color: rgba(255, 255, 255, 0.08);
    color: var(--text-white);
    border-color: rgba(255, 255, 255, 0.15);
}

.card-primary .chip:hover, .card-primary .chip-solid:hover, .card-primary .chip-soft:hover {
    background-color: var(--text-white);
    color: var(--bg-primary-container);
    border-color: transparent;
}

/* Footer Accent Quotes */
.quote-section {
    margin-top: 6rem;
    padding-top: 4rem;
    border-top: 1px solid var(--border-subtle);
    display: flex;
    align-items: center;
    gap: 4rem;
}
.quote-img {
    flex: 1;
    height: 12rem;
    border-radius: var(--radius-xl);
    object-fit: cover;
    filter: grayscale(100%);
    transition: filter 0.5s ease;
}
.quote-img:hover {
    filter: grayscale(0%);
}
.quote-content {
    flex: 2;
}
.quote-text {
    font-family: var(--font-headline);
    font-size: 2rem;
    font-style: italic;
    color: var(--text-on-surface);
    line-height: 1.4;
}

/* --- Timeline & Journey --- */
.timeline {
    position: relative;
    padding-left: 3rem;
}
.timeline::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--border-subtle);
}
.timeline-item {
    position: relative;
    margin-bottom: 4rem;
}
.timeline-dot {
    position: absolute;
    left: -3rem;
    top: 0.5rem;
    width: 1.25rem;
    height: 1.25rem;
    background: var(--bg-surface);
    border: 3px solid var(--text-on-primary-container);
    border-radius: 50%;
    transform: translateX(-50%);
    box-shadow: 0 0 0 6px var(--bg-surface);
    z-index: 10;
}
.timeline-item:hover .timeline-dot {
    background: var(--text-on-primary-container);
}
.timeline-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 0.5rem;
}
.timeline-title {
    font-family: var(--font-headline);
    font-size: 1.75rem;
    font-weight: 700;
}
.timeline-date {
    font-family: var(--font-label);
    font-size: 0.875rem;
    font-weight: 700;
    color: var(--text-on-primary-container);
}
.timeline-org {
    font-family: var(--font-label);
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-on-surface-variant);
    margin-bottom: 1.5rem;
}
.timeline-content {
    color: var(--text-on-surface-variant);
    max-width: 48rem;
}
.timeline-list {
    margin-top: 1rem;
    list-style: none;
    padding: 0;
}
.timeline-list li {
    display: flex;
    gap: 1rem;
    margin-bottom: 0.75rem;
}
.timeline-list li .material-symbols-outlined {
    font-size: 1.25rem;
    color: var(--text-on-primary-container);
    flex-shrink: 0;
}

/* --- Recognition Section --- */
.recognition-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
}
@media (max-width: 1024px) {
    .recognition-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 768px) {
    .recognition-grid { grid-template-columns: 1fr; }
    .timeline { padding-left: 1.5rem; }
    .timeline-dot { left: -1.5rem; }
}

