/* ==========================================================================
   Google Fonts loaded in HTML
   Syne (display headings) | DM Sans (body) | JetBrains Mono (code/tags)
   ========================================================================== */

/* ==========================================================================
   Design Tokens
   ========================================================================== */
:root {
  /* Core palette */
  --ink:          #0A1628;
  --ink-soft:     #0F2235;
  --ink-mid:      #1a3a55;
  --teal:         #29D9C2;
  --teal-dark:    #1aab99;
  --teal-dim:     rgba(41, 217, 194, 0.12);
  --teal-glow:    rgba(41, 217, 194, 0.25);
  --gold:         #F0C274;
  --gold-dim:     rgba(240, 194, 116, 0.12);

  /* Surface palette (light sections) */
  --surface:      #F8F6F3;
  --surface-alt:  #F0EBE5;
  --card:         #FFFFFF;
  --border:       #E5E0DB;
  --border-light: #F0EBE5;

  /* Text */
  --text-primary:   #0F1F33;
  --text-secondary: #3D5266;
  --text-muted:     #7A8FA6;

  /* Text on dark */
  --on-dark:        #E8F4F8;
  --on-dark-muted:  rgba(232, 244, 248, 0.6);

  /* Typography */
  --font-display: 'Syne', sans-serif;
  --font-body:    'DM Sans', sans-serif;
  --font-mono:    'JetBrains Mono', monospace;

  /* Spacing */
  --space-xs:  0.5rem;
  --space-sm:  1rem;
  --space-md:  2rem;
  --space-lg:  4rem;
  --space-xl:  7rem;

  /* Radius */
  --r-sm:   6px;
  --r-md:   14px;
  --r-lg:   24px;
  --r-full: 9999px;

  /* Shadows */
  --shadow-sm:  0 1px 4px rgba(0,0,0,0.06);
  --shadow-md:  0 4px 16px rgba(0,0,0,0.08);
  --shadow-lg:  0 12px 32px rgba(0,0,0,0.10);
  --shadow-xl:  0 24px 48px rgba(0,0,0,0.13);
  --shadow-teal: 0 8px 32px rgba(41, 217, 194, 0.2);

  /* Transitions */
  --ease-fast:   0.15s ease;
  --ease-normal: 0.3s ease;
  --ease-spring: 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

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

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

body {
  font-family: var(--font-body);
  color: var(--text-primary);
  background-color: var(--surface);
  line-height: 1.7;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

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

img { max-width: 100%; height: auto; display: block; }
ul  { list-style: none; }

/* ==========================================================================
   Scroll Progress Bar
   ========================================================================== */
.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  width: 0%;
  background: linear-gradient(90deg, var(--teal), var(--gold));
  z-index: 9999;
  transition: width 0.1s linear;
}

/* ==========================================================================
   Layout
   ========================================================================== */
.container {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* ==========================================================================
   Section Titles
   ========================================================================== */
.section-title {
  font-family: var(--font-display);
  font-size: clamp(2rem, 4vw, 2.75rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  text-align: center;
  margin-bottom: var(--space-lg);
  color: var(--text-primary);
  position: relative;
}

.section-title::after {
  content: '';
  display: block;
  width: 52px;
  height: 3px;
  background: linear-gradient(90deg, var(--teal), var(--gold));
  margin: 1rem auto 0;
  border-radius: var(--r-full);
}

/* ==========================================================================
   Navigation
   ========================================================================== */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: rgba(10, 22, 40, 0.6);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(41, 217, 194, 0.08);
  transition: background var(--ease-normal), border-color var(--ease-normal);
}

.navbar.scrolled {
  background: rgba(10, 22, 40, 0.95);
  border-bottom-color: rgba(41, 217, 194, 0.15);
}

.navbar .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 1rem;
  padding-bottom: 1rem;
}

.nav-brand .brand-mark {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--teal);
  letter-spacing: -0.02em;
  transition: color var(--ease-fast);
}

.nav-brand .brand-mark::before {
  content: attr(data-text);
}

.nav-menu {
  display: flex;
  gap: 0.25rem;
  align-items: center;
}

.nav-link {
  font-family: var(--font-body);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--on-dark-muted);
  padding: 0.5rem 0.875rem;
  border-radius: var(--r-full);
  transition: all var(--ease-fast);
  letter-spacing: 0.01em;
}

.nav-link:hover,
.nav-link.active {
  color: var(--teal);
  background: var(--teal-dim);
}

.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(--on-dark);
  border-radius: var(--r-full);
  transition: all var(--ease-normal);
}

/* ==========================================================================
   Hero Section
   ========================================================================== */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: var(--ink);
  overflow: hidden;
  padding: 130px 0 80px;
}

.hero-bg-aurora {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 70% 55% at 15% 65%, rgba(41, 217, 194, 0.14) 0%, transparent 65%),
    radial-gradient(ellipse 55% 45% at 85% 25%, rgba(240, 194, 116, 0.08) 0%, transparent 60%),
    radial-gradient(ellipse 90% 70% at 50% 110%, rgba(26, 77, 87, 0.5) 0%, transparent 70%);
  animation: aurora 10s ease-in-out infinite alternate;
  pointer-events: none;
}

.hero-bg-grid {
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle, rgba(255,255,255,0.055) 1px, transparent 1px);
  background-size: 38px 38px;
  pointer-events: none;
}

@keyframes aurora {
  0%   { transform: translate(0, 0) scale(1); }
  33%  { transform: translate(-1.5%, 2%) scale(1.015); }
  66%  { transform: translate(2%, -1%) scale(0.99); }
  100% { transform: translate(0.5%, 1%) scale(1.01); }
}

/* Two-column hero layout */
.hero-layout {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 4rem;
  width: 100%;
}

.hero-content {
  text-align: left;
  max-width: 680px;
}

.hero-greeting {
  font-family: var(--font-mono);
  font-size: 0.95rem;
  font-weight: 400;
  color: var(--teal);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 1rem;
  opacity: 0;
  animation: fadeSlideUp 0.7s ease 0.2s forwards;
}

.hero-title {
  font-family: var(--font-display);
  font-size: clamp(3rem, 8vw, 5.5rem);
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -0.04em;
  color: var(--on-dark);
  margin-bottom: 1.25rem;
  opacity: 0;
  animation: fadeSlideUp 0.7s ease 0.4s forwards;
}

.hero-role-wrap {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 1rem;
  margin-bottom: 1.5rem;
  opacity: 0;
  animation: fadeSlideUp 0.7s ease 0.6s forwards;
}

.hero-role-line {
  flex: 1;
  max-width: 80px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(41, 217, 194, 0.5));
}

.hero-role-line:last-child {
  background: linear-gradient(270deg, transparent, rgba(41, 217, 194, 0.5));
}

.hero-subtitle {
  font-family: var(--font-body);
  font-size: clamp(1.1rem, 2.5vw, 1.4rem);
  font-weight: 400;
  color: var(--teal);
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.hero-description {
  font-size: 1.05rem;
  line-height: 1.8;
  color: var(--on-dark-muted);
  max-width: 600px;
  margin: 0 0 2rem;
  opacity: 0;
  animation: fadeSlideUp 0.7s ease 0.8s forwards;
}

.hero-description strong {
  color: var(--on-dark);
  font-weight: 600;
}

.hero-highlights {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: flex-start;
  margin-bottom: 2.5rem;
  opacity: 0;
  animation: fadeSlideUp 0.7s ease 1s forwards;
}

.highlight-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(41, 217, 194, 0.2);
  padding: 0.6rem 1.1rem;
  border-radius: var(--r-full);
  transition: all var(--ease-fast);
}

.highlight-item:hover {
  background: var(--teal-dim);
  border-color: rgba(41, 217, 194, 0.4);
  transform: translateY(-2px);
}

.highlight-item i {
  color: var(--teal);
  font-size: 0.875rem;
}

.highlight-item span {
  font-size: 0.825rem;
  font-weight: 500;
  color: var(--on-dark);
  letter-spacing: 0.01em;
}

.hero-cta {
  display: flex;
  gap: 1rem;
  justify-content: flex-start;
  margin-bottom: 2.5rem;
  flex-wrap: wrap;
  opacity: 0;
  animation: fadeSlideUp 0.7s ease 1.1s forwards;
}

.btn {
  padding: 0.875rem 2rem;
  border-radius: var(--r-md);
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: all var(--ease-normal);
  border: 1.5px solid transparent;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-primary {
  background: var(--teal);
  color: var(--ink);
  border-color: var(--teal);
}

.btn-primary:hover {
  background: var(--teal-dark);
  border-color: var(--teal-dark);
  transform: translateY(-2px);
  box-shadow: var(--shadow-teal);
  color: var(--ink);
}

.btn-secondary {
  background: transparent;
  color: var(--on-dark);
  border-color: rgba(255,255,255,0.25);
}

.btn-secondary:hover {
  background: rgba(255,255,255,0.08);
  border-color: rgba(255,255,255,0.45);
  transform: translateY(-2px);
}

.social-links {
  display: flex;
  gap: 0.75rem;
  justify-content: flex-start;
  opacity: 0;
  animation: fadeSlideUp 0.7s ease 1.2s forwards;
}

.social-links a {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 50%;
  color: var(--on-dark-muted);
  font-size: 1.1rem;
  transition: all var(--ease-fast);
}

.social-links a:hover {
  background: var(--teal-dim);
  border-color: var(--teal);
  color: var(--teal);
  transform: translateY(-3px);
}

/* ==========================================================================
   Hero Headshot
   ========================================================================== */
.hero-photo-wrap {
  position: relative;
  flex-shrink: 0;
  opacity: 0;
  animation: fadeSlideUp 0.9s ease 0.5s forwards;
}

.hero-photo-ring {
  position: relative;
  width: 300px;
  height: 300px;
  border-radius: 50%;
  padding: 4px;
  background: linear-gradient(135deg, var(--teal), var(--gold), var(--teal));
  background-size: 200% 200%;
  animation: gradientSpin 4s linear infinite;
  box-shadow: 0 0 60px rgba(41, 217, 194, 0.25), 0 0 120px rgba(41, 217, 194, 0.1);
}

@keyframes gradientSpin {
  0%   { background-position: 0% 50%; }
  50%  { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

.hero-photo-inner {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  overflow: hidden;
  background: var(--ink);
  border: 4px solid var(--ink);
}

.hero-photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 18%;
  display: block;
  transition: transform 0.5s ease;
}

.hero-photo-wrap:hover .hero-photo {
  transform: scale(1.04);
}

.hero-photo-badge {
  position: absolute;
  bottom: 10px;
  right: -8px;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  background: var(--teal);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.45rem 0.85rem;
  border-radius: var(--r-full);
  box-shadow: 0 4px 16px rgba(41, 217, 194, 0.4);
  white-space: nowrap;
  letter-spacing: 0.02em;
}

.hero-photo-badge i {
  font-size: 0.7rem;
}

.hero-scroll-hint {
  position: absolute;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  color: var(--on-dark-muted);
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-family: var(--font-mono);
  animation: bounce 2s ease-in-out infinite;
  opacity: 0;
  animation: fadeIn 1s ease 2s forwards, bounce 2s ease-in-out 3s infinite;
}

.hero-scroll-hint i {
  font-size: 0.8rem;
}

/* ==========================================================================
   About Section
   ========================================================================== */
.about {
  padding: var(--space-xl) 0;
  background: var(--surface);
}

.about-content {
  max-width: 860px;
  margin: 0 auto;
}

.about-text p {
  font-size: 1.05rem;
  line-height: 1.85;
  color: var(--text-secondary);
  margin-bottom: 1.25rem;
}

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

.about-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.25rem;
  margin-top: var(--space-lg);
}

.stat-item {
  text-align: center;
  padding: 1.75rem 1rem;
  background: var(--card);
  border-radius: var(--r-md);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  transition: all var(--ease-normal);
  position: relative;
  overflow: hidden;
}

.stat-item::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--teal), var(--gold));
  transform: scaleX(0);
  transition: transform var(--ease-normal);
}

.stat-item:hover::before { transform: scaleX(1); }

.stat-item:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg);
  border-color: transparent;
}

.stat-item h3 {
  font-family: var(--font-display);
  font-size: 2.25rem;
  font-weight: 800;
  letter-spacing: -0.04em;
  color: var(--teal-dark);
  line-height: 1;
  margin-bottom: 0.5rem;
}

.stat-item p {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-muted);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* ==========================================================================
   Experience Section
   ========================================================================== */
.experience {
  padding: var(--space-xl) 0;
  background: var(--surface-alt);
}

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

.timeline::before {
  content: '';
  position: absolute;
  left: 18px;
  top: 8px;
  bottom: 8px;
  width: 1.5px;
  background: linear-gradient(180deg, var(--teal) 0%, rgba(41, 217, 194, 0.2) 100%);
}

.timeline-item {
  position: relative;
  margin-bottom: var(--space-md);
}

.timeline-item:last-child { margin-bottom: 0; }

.timeline-item::before {
  content: '';
  position: absolute;
  left: -42px;
  top: 20px;
  width: 12px;
  height: 12px;
  background: var(--teal);
  border: 3px solid var(--surface-alt);
  border-radius: 50%;
  box-shadow: 0 0 0 3px var(--teal-dim);
  transition: all var(--ease-normal);
}

.timeline-item:hover::before {
  box-shadow: 0 0 0 5px var(--teal-glow);
  transform: scale(1.15);
}

.timeline-content {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 1.75rem 2rem;
  box-shadow: var(--shadow-sm);
  transition: all var(--ease-normal);
}

.timeline-content:hover {
  transform: translateX(6px);
  box-shadow: var(--shadow-lg);
  border-color: var(--border-light);
}

.timeline-header {
  display: flex;
  align-items: center;
  margin-bottom: 1rem;
  gap: 1rem;
  flex-wrap: wrap;
}

.timeline-logo-wrap {
  flex-shrink: 0;
}

.company-logo {
  height: 44px;
  width: auto;
  max-width: 110px;
  object-fit: contain;
  border-radius: var(--r-sm);
  background: #fff;
  padding: 6px 10px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  display: block;
}

.company-logo-fallback {
  width: 44px;
  height: 44px;
  border-radius: var(--r-sm);
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid currentColor;
  opacity: 0.85;
}

.timeline-meta {
  flex: 1;
  min-width: 0;
}

.timeline-title {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

.timeline-company {
  font-size: 0.9rem;
  color: var(--teal-dark);
  font-weight: 600;
  margin-top: 0.2rem;
  letter-spacing: 0.01em;
}

.timeline-period {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-muted);
  background: var(--surface);
  padding: 0.3rem 0.75rem;
  border-radius: var(--r-full);
  white-space: nowrap;
  flex-shrink: 0;
  align-self: flex-start;
}

.timeline-description {
  color: var(--text-secondary);
  font-size: 0.92rem;
  line-height: 1.7;
}

.timeline-description ul {
  list-style: none;
  margin-top: 0.75rem;
}

.timeline-description li {
  padding: 0.35rem 0 0.35rem 1.25rem;
  position: relative;
  color: var(--text-secondary);
  font-size: 0.9rem;
  line-height: 1.6;
}

.timeline-description li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.75rem;
  width: 6px;
  height: 6px;
  background: var(--teal);
  border-radius: 50%;
  opacity: 0.7;
}

/* ==========================================================================
   Skills Section
   ========================================================================== */
.skills {
  padding: var(--space-xl) 0;
  background: var(--surface);
}

.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.25rem;
}

.skill-category {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
  transition: all var(--ease-normal);
}

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

.skill-category h3 {
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.skill-category h3 i {
  color: var(--teal);
  font-size: 0.875rem;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--teal-dim);
  border-radius: var(--r-sm);
}

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

.skill-tag {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 400;
  color: var(--text-secondary);
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 0.35rem 0.75rem;
  border-radius: var(--r-full);
  transition: all var(--ease-fast);
  cursor: default;
}

.skill-tag:hover {
  background: var(--teal-dim);
  border-color: rgba(41, 217, 194, 0.4);
  color: var(--teal-dark);
}

/* ==========================================================================
   Projects Section
   ========================================================================== */
.projects {
  padding: var(--space-xl) 0;
  background: var(--ink);
  position: relative;
}

.projects::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle, rgba(255,255,255,0.025) 1px, transparent 1px);
  background-size: 38px 38px;
  pointer-events: none;
}

.projects .section-title {
  color: var(--on-dark);
  position: relative;
}

.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
  gap: 1.5rem;
  position: relative;
}

.project-card {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: var(--r-lg);
  overflow: hidden;
  transition: all var(--ease-normal);
  display: flex;
  flex-direction: column;
  position: relative;
}

.project-card:hover {
  transform: translateY(-10px);
  background: rgba(255,255,255,0.07);
  border-color: rgba(255,255,255,0.15);
  box-shadow: 0 30px 60px rgba(0,0,0,0.4);
}

/* Gradient banner header */
.project-banner {
  width: 100%;
  height: 160px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  padding: 1.25rem 1.5rem;
  position: relative;
  overflow: hidden;
}

.project-banner::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,0) 20%, rgba(0,0,0,0.35) 100%);
}

/* Large decorative background icon */
.project-banner-icon-bg {
  position: absolute;
  right: -10px;
  top: -10px;
  font-size: 7rem;
  color: rgba(255,255,255,0.1);
  line-height: 1;
  pointer-events: none;
  z-index: 0;
}

.project-banner-icon {
  position: relative;
  z-index: 1;
  width: 52px;
  height: 52px;
  background: rgba(255,255,255,0.15);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255,255,255,0.25);
  border-radius: var(--r-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  color: white;
}

.project-banner-tag {
  position: relative;
  z-index: 1;
  font-family: var(--font-mono);
  font-size: 0.65rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.8);
  background: rgba(0,0,0,0.3);
  backdrop-filter: blur(8px);
  padding: 0.3rem 0.7rem;
  border-radius: var(--r-full);
  border: 1px solid rgba(255,255,255,0.15);
  align-self: flex-start;
}

/* Impact metrics strip */
.project-impact {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

.project-impact-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0.875rem 0.5rem;
  text-align: center;
  border-right: 1px solid rgba(255,255,255,0.06);
  transition: background var(--ease-fast);
}

.project-impact-item:last-child { border-right: none; }

.project-impact-item:hover { background: rgba(255,255,255,0.04); }

.project-impact-item i {
  font-size: 0.75rem;
  color: var(--teal);
  margin-bottom: 0.3rem;
}

.project-impact-value {
  font-family: var(--font-display);
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--on-dark);
  letter-spacing: -0.01em;
  line-height: 1.2;
}

.project-impact-label {
  font-size: 0.62rem;
  color: var(--on-dark-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-top: 0.15rem;
}

/* Card body */
.project-content {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.project-title {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--on-dark);
  letter-spacing: -0.02em;
  margin-bottom: 0.2rem;
}

.project-subtitle {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--teal);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 0.875rem;
}

.project-description {
  color: var(--on-dark-muted);
  font-size: 0.875rem;
  line-height: 1.75;
  margin-bottom: 1.25rem;
  flex: 1;
}

.project-tech {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 1.25rem;
}

.tech-badge {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 500;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  color: var(--on-dark-muted);
  padding: 0.25rem 0.65rem;
  border-radius: var(--r-full);
  transition: all var(--ease-fast);
}

.tech-badge:hover {
  background: var(--teal-dim);
  border-color: rgba(41,217,194,0.3);
  color: var(--teal);
}

.project-links {
  display: flex;
  gap: 1rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(255,255,255,0.07);
}

.project-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--teal);
  transition: all var(--ease-fast);
  opacity: 0.85;
}

.project-link:hover {
  opacity: 1;
  gap: 0.6rem;
}

/* ==========================================================================
   Education Section
   ========================================================================== */
.education {
  padding: var(--space-xl) 0;
  background: var(--surface);
}

.education-content {
  max-width: 960px;
  margin: 0 auto;
}

.education-grid {
  display: grid;
  gap: 1.25rem;
  margin-bottom: var(--space-lg);
}

.education-item {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 1.75rem 2rem;
  box-shadow: var(--shadow-sm);
  transition: all var(--ease-normal);
  position: relative;
  overflow: hidden;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  flex-wrap: wrap;
}

.education-item::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: linear-gradient(180deg, var(--teal), var(--gold));
}

.education-item:hover {
  transform: translateX(4px);
  box-shadow: var(--shadow-lg);
}

.education-degree {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.02em;
  margin-bottom: 0.25rem;
}

.education-school {
  font-size: 0.9rem;
  color: var(--teal-dark);
  font-weight: 500;
}

.education-period {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-muted);
  background: var(--surface);
  padding: 0.3rem 0.75rem;
  border-radius: var(--r-full);
  white-space: nowrap;
  flex-shrink: 0;
  align-self: flex-start;
}

.education-details {
  font-size: 0.875rem;
  color: var(--text-secondary);
  margin-top: 0.5rem;
  width: 100%;
  line-height: 1.6;
}

.edu-logo-wrap {
  flex-shrink: 0;
  width: 56px;
  height: 56px;
  border-radius: var(--r-sm);
  overflow: hidden;
}

.edu-logo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: var(--r-sm);
  display: block;
}

.edu-logo-fallback {
  width: 100%;
  height: 100%;
  border-radius: var(--r-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.4rem;
}

.edu-text {
  flex: 1;
  min-width: 0;
}

/* Certifications */
.cert-section-title {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 1.25rem;
  letter-spacing: -0.02em;
}

.cert-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
}

.cert-item {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 1.25rem 1.5rem;
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: flex-start;
  gap: 0.875rem;
  transition: all var(--ease-normal);
  position: relative;
  overflow: hidden;
}

.cert-item::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--cert-accent, var(--teal));
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--ease-normal);
}

.cert-item:hover::before {
  transform: scaleX(1);
}

.cert-item:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: transparent;
}

.cert-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--r-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  flex-shrink: 0;
  background: var(--surface);
}

.cert-name {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.35;
  margin-bottom: 0.2rem;
}

.cert-issuer {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 400;
}

/* ==========================================================================
   Contact Section
   ========================================================================== */
.contact {
  padding: var(--space-xl) 0;
  background: var(--ink);
  position: relative;
  overflow: hidden;
}

.contact::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle, rgba(255,255,255,0.03) 1px, transparent 1px);
  background-size: 38px 38px;
  pointer-events: none;
}

.contact .section-title {
  color: var(--on-dark);
}

.contact-intro {
  text-align: center;
  color: var(--on-dark-muted);
  font-size: 1rem;
  margin-top: -2.5rem;
  margin-bottom: var(--space-lg);
  max-width: 560px;
  margin-left: auto;
  margin-right: auto;
}

.contact-content {
  max-width: 960px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1.4fr;
  gap: var(--space-md);
  position: relative;
  z-index: 1;
}

.contact-info {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.contact-item {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding: 1.25rem;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: var(--r-md);
  transition: all var(--ease-fast);
}

.contact-item:hover {
  background: var(--teal-dim);
  border-color: rgba(41, 217, 194, 0.2);
}

.contact-item i {
  color: var(--teal);
  font-size: 1.1rem;
  width: 20px;
  flex-shrink: 0;
  margin-top: 2px;
}

.contact-item h3 {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--on-dark-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 0.25rem;
}

.contact-item a,
.contact-item p {
  font-size: 0.9rem;
  color: var(--on-dark);
  transition: color var(--ease-fast);
}

.contact-item a:hover {
  color: var(--teal);
}

.contact-form-container {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: var(--r-md);
  padding: 2rem;
}

.contact-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 0.875rem 1rem;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: var(--r-sm);
  color: var(--on-dark);
  font-family: var(--font-body);
  font-size: 0.9rem;
  transition: all var(--ease-fast);
  outline: none;
}

.form-group input::placeholder,
.form-group textarea::placeholder {
  color: var(--on-dark-muted);
}

.form-group input:focus,
.form-group textarea:focus {
  border-color: rgba(41, 217, 194, 0.4);
  background: rgba(41, 217, 194, 0.06);
}

.form-group textarea { resize: vertical; min-height: 120px; }

.form-success {
  display: none;
  text-align: center;
  padding: 2rem;
  color: var(--teal);
}

.form-success i {
  font-size: 2.5rem;
  margin-bottom: 1rem;
  display: block;
}

.form-success p {
  font-size: 0.95rem;
  color: var(--on-dark-muted);
}

.contact-form .btn {
  width: 100%;
  justify-content: center;
  margin-top: 0.25rem;
}

/* ==========================================================================
   Footer
   ========================================================================== */
.footer {
  background: #060E1A;
  border-top: 1px solid rgba(255,255,255,0.06);
  padding: 1.75rem 0;
}

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

#footerCopyright {
  font-size: 0.825rem;
  color: rgba(255,255,255,0.35);
  font-family: var(--font-mono);
}

.footer-links {
  display: flex;
  gap: 1.25rem;
}

.footer-links a {
  font-size: 0.825rem;
  color: rgba(255,255,255,0.4);
  transition: color var(--ease-fast);
}

.footer-links a:hover { color: var(--teal); }

/* ==========================================================================
   Back to Top
   ========================================================================== */
.back-to-top {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 44px;
  height: 44px;
  background: var(--teal);
  color: var(--ink);
  border: none;
  border-radius: 50%;
  font-size: 1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-teal);
  transition: all var(--ease-normal);
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none;
  z-index: 999;
}

.back-to-top.visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.back-to-top:hover {
  background: var(--teal-dark);
  transform: translateY(-3px);
  box-shadow: 0 12px 24px rgba(41, 217, 194, 0.4);
}

/* ==========================================================================
   Reveal Animations
   ========================================================================== */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.65s ease, transform 0.65s ease;
}

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

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

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

/* Stagger delays for grid items */
.reveal-stagger > *:nth-child(1)  { transition-delay: 0.05s; }
.reveal-stagger > *:nth-child(2)  { transition-delay: 0.1s; }
.reveal-stagger > *:nth-child(3)  { transition-delay: 0.15s; }
.reveal-stagger > *:nth-child(4)  { transition-delay: 0.2s; }
.reveal-stagger > *:nth-child(5)  { transition-delay: 0.25s; }
.reveal-stagger > *:nth-child(6)  { transition-delay: 0.3s; }

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

@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

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

/* ==========================================================================
   Responsive — ordered largest → smallest
   ========================================================================== */

/* ── Tablet / small laptop ─────────────────────────────── max 1024px ── */
@media (max-width: 1024px) {
  .hero-layout     { gap: 2.5rem; }
  .hero-photo-ring { width: 240px; height: 240px; }
}

/* ── Tablet portrait ───────────────────────────────────── max 900px ─── */
@media (max-width: 900px) {
  .about-stats     { grid-template-columns: repeat(2, 1fr); }
  .contact-content { grid-template-columns: 1fr; }
  .projects-grid   { grid-template-columns: 1fr; }

  .timeline-header { flex-wrap: wrap; gap: 0.75rem; }
  .timeline-period { order: -1; } /* date moves above title */
}

/* ── Mobile landscape / large phones ──────────────────── max 768px ─── */
@media (max-width: 768px) {
  /* Nav */
  .nav-toggle { display: flex; }

  .nav-menu {
    position: fixed;
    top: 60px;
    left: 0;
    right: 0;
    flex-direction: column;
    background: rgba(10, 22, 40, 0.98);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    padding: 1.25rem 1.5rem 1.75rem;
    gap: 0.25rem;
    transform: translateY(-110%);
    opacity: 0;
    pointer-events: none;
    transition: transform var(--ease-normal), opacity var(--ease-normal);
    border-bottom: 1px solid rgba(41, 217, 194, 0.15);
    z-index: 999;
  }

  .nav-menu.active {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
  }

  .nav-link {
    padding: 0.75rem 1rem;
    border-radius: var(--r-sm);
    font-size: 1rem;
    text-align: left;
  }

  /* Hero — stack photo above text */
  .hero {
    padding: 90px 0 60px;
    min-height: auto;           /* don't force full-screen when stacked */
  }

  .hero-layout {
    grid-template-columns: 1fr;
    justify-items: center;
    gap: 2rem;
  }

  .hero-content {
    text-align: center;
    order: 2;
    max-width: 100%;
  }

  .hero-photo-wrap { order: 1; }

  .hero-photo-ring {
    width: 160px;
    height: 160px;
  }

  .hero-photo-badge {
    bottom: 2px;
    right: -6px;
    font-size: 0.68rem;
    padding: 0.35rem 0.7rem;
  }

  .hero-role-line   { display: none; }
  .hero-role-wrap   { justify-content: center; }
  .hero-highlights  { justify-content: center; }
  .hero-cta         { justify-content: center; flex-direction: column; align-items: center; }
  .social-links     { justify-content: center; }
  .hero-subtitle    { white-space: normal; text-align: center; }

  .hero-description {
    font-size: 0.95rem;
    margin-left: auto;
    margin-right: auto;
  }

  /* Sections */
  .section-title { font-size: 1.85rem; margin-bottom: 2.5rem; }

  /* Timeline */
  .timeline          { padding-left: 28px; }
  .timeline::before  { left: 7px; }
  .timeline-item::before { left: -23px; width: 10px; height: 10px; }
  .timeline-content  { padding: 1.25rem; }
  .timeline-logo-wrap { display: none; } /* hide logo on mobile to save space */

  /* Education */
  .education-item { flex-direction: row; flex-wrap: wrap; gap: 0.75rem; }
  .edu-logo-wrap { width: 48px; height: 48px; }
  .edu-logo-fallback { font-size: 1.2rem; }

  /* Certs */
  .cert-grid { grid-template-columns: 1fr; }

  /* About stats */
  .about-stats { grid-template-columns: repeat(2, 1fr); gap: 0.875rem; }
  .stat-item   { padding: 1.25rem 0.75rem; }
  .stat-item h3 { font-size: 1.75rem; }

  /* Contact intro spacing */
  .contact-intro { margin-top: -1.5rem; }

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

/* ── Mobile portrait / small phones ───────────────────── max 500px ─── */
@media (max-width: 500px) {
  :root {
    --space-xl: 4.5rem;
    --space-lg: 2.5rem;
  }

  /* Hero */
  .hero          { padding: 80px 0 50px; }
  .hero-greeting { font-size: 0.8rem; }
  .hero-photo-ring { width: 130px; height: 130px; }
  .hero-photo-badge { display: none; } /* too cramped at this size */

  /* Highlights: 2-column grid instead of wrapping flex */
  .hero-highlights {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
  }

  .highlight-item {
    justify-content: center;
    padding: 0.5rem 0.6rem;
    border-radius: var(--r-md);
  }

  .highlight-item span { font-size: 0.73rem; }

  /* CTAs: full width */
  .hero-cta .btn {
    width: 100%;
    max-width: 320px;
    justify-content: center;
  }

  /* Typography */
  .section-title  { font-size: 1.65rem; }
  .hero-subtitle  { font-size: 1rem; }
  .hero-description { font-size: 0.9rem; }

  /* About stats: keep 2 col */
  .stat-item h3 { font-size: 1.5rem; }
  .stat-item p  { font-size: 0.72rem; }

  /* Skills: single col */
  .skills-grid { grid-template-columns: 1fr; }

  /* Timeline */
  .timeline-title { font-size: 1.1rem; }
  .timeline-company { font-size: 0.85rem; }

  /* Project cards */
  .project-banner      { height: 130px; }
  .project-banner-icon { width: 42px; height: 42px; font-size: 1.1rem; }
  .project-banner-tag  { font-size: 0.6rem; }
  .project-impact-value { font-size: 0.72rem; }
  .project-impact-label { font-size: 0.58rem; }
  .project-content      { padding: 1.25rem; }

  /* Contact form */
  .contact-form-container { padding: 1.25rem; }

  /* Back to top */
  .back-to-top { bottom: 1.25rem; right: 1.25rem; width: 38px; height: 38px; font-size: 0.85rem; }
}

/* ── Very small phones ─────────────────────────────────── max 380px ─── */
@media (max-width: 380px) {
  .hero-highlights { grid-template-columns: 1fr; }
  .about-stats     { grid-template-columns: 1fr; }
  .hero-photo-ring { width: 110px; height: 110px; }
}
