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

:root {
  --white:       #ffffff;
  --bg:          #f8fafc;
  --sidebar-bg:  #ffffff;
  --navy:        #0f172a;
  --navy2:       #1e293b;
  --blue:        #1d4ed8;
  --blue-mid:    #2563eb;
  --blue-pale:   #eff6ff;
  --blue-border: #bfdbfe;
  --border:      #e2e8f0;
  --muted:       #64748b;
  --text:        #1e293b;
  --shadow-sm:   0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.06);
  --shadow-md:   0 4px 16px rgba(0,0,0,0.08), 0 2px 6px rgba(0,0,0,0.05);
  --shadow-lg:   0 10px 40px rgba(0,0,0,0.1);
  --sidebar-w:   272px;
  --radius:      12px;
}

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  display: flex;
  min-height: 100vh;
}

/* ── Sidebar ── */
.sidebar {
  width: var(--sidebar-w);
  min-height: 100vh;
  background: var(--sidebar-bg);
  border-right: 1px solid var(--border);
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 48px 24px 32px;
  z-index: 50;
  overflow-y: auto;
}

.sidebar-photo-wrap {
  width: 130px;
  height: 130px;
  border-radius: 50%;
  overflow: hidden;
  border: 3px solid var(--blue-border);
  box-shadow: var(--shadow-md);
  margin-bottom: 20px;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.sidebar-photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.sidebar-photo-fallback {
  display: none;
  font-size: 2.2rem;
  font-weight: 700;
  color: var(--blue);
  font-family: 'Space Grotesk', sans-serif;
}

.sidebar-name {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--navy);
  text-align: center;
  margin-bottom: 8px;
  line-height: 1.25;
}

.sidebar-tagline {
  font-size: 0.82rem;
  color: var(--muted);
  text-align: center;
  line-height: 1.55;
  margin-bottom: 28px;
}

.sidebar-divider {
  width: 40px;
  height: 2px;
  background: var(--blue);
  border-radius: 2px;
  margin: 0 auto 28px;
}

/* Sidebar nav */
.sidebar-nav {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: auto;
}
.sidebar-nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--muted);
  text-decoration: none;
  transition: background 0.15s, color 0.15s;
}
.sidebar-nav a:hover {
  background: var(--blue-pale);
  color: var(--blue);
}
.sidebar-nav a.active {
  background: var(--blue-pale);
  color: var(--blue);
  font-weight: 600;
}
.sidebar-nav a svg { flex-shrink: 0; opacity: 0.6; }
.sidebar-nav a.active svg { opacity: 1; }

.sidebar-socials {
  display: flex;
  gap: 12px;
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
  width: 100%;
  justify-content: center;
}
.social-link {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  transition: all 0.2s;
  text-decoration: none;
}
.social-link:hover {
  background: var(--blue);
  border-color: var(--blue);
  color: white;
}

/* ── Main ── */
.main {
  margin-left: var(--sidebar-w);
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

/* Top nav */
.top-nav {
  background: var(--white);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 40;
  padding: 0 48px;
  display: flex;
  gap: 0;
}
.top-nav a {
  display: block;
  padding: 18px 24px;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--muted);
  text-decoration: none;
  border-bottom: 2px solid transparent;
  transition: color 0.2s, border-color 0.2s;
  white-space: nowrap;
}
.top-nav a:hover { color: var(--navy); }
.top-nav a.active {
  color: var(--blue);
  border-bottom-color: var(--blue);
  font-weight: 600;
}

/* ── Page sections ── */
.page-section {
  padding: 56px 48px;
  border-bottom: 1px solid var(--border);
}
.page-section:last-of-type { border-bottom: none; }

.section-label {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--blue);
  margin-bottom: 8px;
}
.section-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 8px;
  line-height: 1.2;
}
.section-subtitle {
  font-size: 1rem;
  color: var(--muted);
  margin-bottom: 40px;
  max-width: 560px;
  line-height: 1.7;
}

/* ── Hero section ── */
#hero {
  background: linear-gradient(135deg, #f0f7ff 0%, var(--white) 60%);
  padding: 72px 48px 64px;
}
.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--blue-pale);
  border: 1px solid var(--blue-border);
  color: var(--blue);
  font-size: 0.78rem;
  font-weight: 600;
  padding: 5px 14px;
  border-radius: 100px;
  letter-spacing: 0.04em;
  margin-bottom: 24px;
}
.hero-eyebrow::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--blue);
}
.hero-name {
  font-family: 'Space Grotesk', sans-serif;
  font-size: clamp(2.4rem, 5vw, 3.8rem);
  font-weight: 800;
  color: var(--navy);
  line-height: 1.05;
  margin-bottom: 16px;
}
.hero-name span {
  color: var(--blue);
}
.hero-bio {
  font-size: 1.05rem;
  color: var(--muted);
  max-width: 560px;
  line-height: 1.75;
  margin-bottom: 36px;
}
.hero-buttons {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 24px;
  border-radius: 8px;
  font-size: 0.875rem;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.2s;
  cursor: pointer;
  border: none;
  font-family: 'Inter', sans-serif;
}
.btn-primary {
  background: var(--blue);
  color: white;
  box-shadow: 0 2px 8px rgba(29,78,216,0.3);
}
.btn-primary:hover {
  background: #1e40af;
  box-shadow: 0 4px 16px rgba(29,78,216,0.4);
  transform: translateY(-1px);
}
.btn-outline {
  background: white;
  color: var(--navy);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}
.btn-outline:hover {
  border-color: var(--blue);
  color: var(--blue);
  transform: translateY(-1px);
}

/* Hero stats row */
.hero-stats {
  display: flex;
  gap: 32px;
  margin-top: 48px;
  padding-top: 32px;
  border-top: 1px solid var(--border);
  flex-wrap: wrap;
}
.hero-stat {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.hero-stat-num {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--navy);
  line-height: 1;
}
.hero-stat-label {
  font-size: 0.78rem;
  color: var(--muted);
  font-weight: 500;
}

/* ── About ── */
.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: start;
}
.about-text p {
  color: var(--muted);
  font-size: 0.975rem;
  line-height: 1.8;
  margin-bottom: 16px;
}
.skills-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 24px;
}
.skill-chip {
  background: var(--blue-pale);
  border: 1px solid var(--blue-border);
  color: var(--blue);
  padding: 5px 14px;
  border-radius: 100px;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.education-cards {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.edu-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 22px;
  box-shadow: var(--shadow-sm);
  display: flex;
  gap: 16px;
  align-items: flex-start;
  transition: box-shadow 0.2s, border-color 0.2s;
}
.edu-card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--blue-border);
}
.edu-icon {
  font-size: 1.5rem;
  flex-shrink: 0;
  margin-top: 2px;
}
.edu-card strong {
  display: block;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 3px;
}
.edu-card span {
  font-size: 0.82rem;
  color: var(--muted);
  display: block;
  line-height: 1.5;
}
.edu-date {
  margin-top: 4px;
  font-size: 0.75rem !important;
  color: var(--blue) !important;
  font-weight: 600 !important;
}

/* ── Experience ── */
.timeline {
  display: flex;
  flex-direction: column;
  gap: 16px;
  position: relative;
  padding-left: 28px;
}
.timeline::before {
  content: '';
  position: absolute;
  left: 7px;
  top: 14px;
  bottom: 14px;
  width: 2px;
  background: linear-gradient(to bottom, var(--blue), var(--border));
  border-radius: 2px;
}
.tl-item {
  position: relative;
}
.tl-dot {
  position: absolute;
  left: -24px;
  top: 18px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--blue);
  border: 2px solid white;
  box-shadow: 0 0 0 2px var(--blue-border);
}
.tl-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px 26px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.2s, border-color 0.2s, transform 0.2s;
}
.tl-card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--blue-border);
  transform: translateX(3px);
}
.tl-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}
.tl-header h3 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1rem;
  font-weight: 700;
  color: var(--navy);
}
.tl-company {
  font-size: 0.85rem;
  color: var(--blue);
  font-weight: 500;
  margin-top: 2px;
}
.tl-date {
  font-size: 0.75rem;
  color: var(--muted);
  background: var(--bg);
  border: 1px solid var(--border);
  padding: 3px 10px;
  border-radius: 100px;
  white-space: nowrap;
}
.tl-desc {
  font-size: 0.875rem;
  color: var(--muted);
  line-height: 1.7;
  margin-bottom: 14px;
}
.tl-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.tl-tags span {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--blue);
  background: var(--blue-pale);
  border: 1px solid var(--blue-border);
  padding: 2px 9px;
  border-radius: 100px;
}

/* ── Projects ── */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
.proj-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 26px 22px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.2s, border-color 0.2s, transform 0.2s;
}
.proj-card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--blue-border);
  transform: translateY(-3px);
}
.proj-icon { font-size: 1.8rem; }
.proj-card h3 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.975rem;
  font-weight: 700;
  color: var(--navy);
  line-height: 1.35;
}
.proj-card p {
  font-size: 0.845rem;
  color: var(--muted);
  line-height: 1.65;
  flex: 1;
}
.proj-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 4px;
}
.proj-tags span {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--muted);
  background: var(--bg);
  border: 1px solid var(--border);
  padding: 2px 9px;
  border-radius: 100px;
}

/* ── Resume ── */
.resume-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 44px;
  box-shadow: var(--shadow-md);
  max-width: 780px;
}
.resume-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 36px;
  padding-bottom: 28px;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}
.resume-top h3 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--navy);
  margin-bottom: 4px;
}
.resume-top p { font-size: 0.9rem; color: var(--muted); margin-bottom: 2px; }
.resume-location { color: var(--blue) !important; font-weight: 500 !important; }

.resume-block {
  margin-bottom: 28px;
  padding-bottom: 28px;
  border-bottom: 1px solid var(--border);
}
.resume-block:last-of-type { border-bottom: none; margin-bottom: 0; padding-bottom: 0; }
.resume-block h4 {
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--blue);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 16px;
}
.resume-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  padding: 10px 0;
  border-bottom: 1px solid var(--bg);
  flex-wrap: wrap;
}
.resume-row:last-child { border-bottom: none; }
.resume-row-left { display: flex; flex-direction: column; gap: 2px; }
.resume-row strong { font-size: 0.875rem; color: var(--navy); font-weight: 600; }
.resume-row span { font-size: 0.815rem; color: var(--muted); }
.resume-date { font-size: 0.78rem; color: var(--muted); white-space: nowrap; }
.resume-skills { font-size: 0.875rem; color: var(--muted); line-height: 1.8; }

.resume-note {
  margin-top: 20px;
  padding: 14px 18px;
  background: var(--blue-pale);
  border: 1px solid var(--blue-border);
  border-radius: 8px;
  font-size: 0.8rem;
  color: var(--blue);
}
.resume-note code {
  font-family: monospace;
  background: rgba(29,78,216,0.1);
  padding: 1px 6px;
  border-radius: 4px;
}

/* ── Contact ── */
#contact { background: var(--white); }
.contact-inner {
  max-width: 780px;
}
/* Flash messages */
.flash-msgs { margin-bottom: 24px; }
.flash {
  padding: 12px 18px;
  border-radius: 8px;
  font-size: 0.875rem;
  font-weight: 500;
  margin-bottom: 8px;
}
.flash--success {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  color: #166534;
}
.flash--error {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #991b1b;
}

/* Contact form + side */
.contact-wrap {
  display: grid;
  grid-template-columns: 1fr 220px;
  gap: 24px;
  align-items: start;
}
.contact-form {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-group label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--navy);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.form-group input,
.form-group textarea {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 14px;
  font-family: 'Inter', sans-serif;
  font-size: 0.9rem;
  color: var(--text);
  transition: border-color 0.2s, box-shadow 0.2s;
  outline: none;
  resize: vertical;
}
.form-group input::placeholder,
.form-group textarea::placeholder { color: #94a3b8; }
.form-group input:focus,
.form-group textarea:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(29,78,216,0.1);
}
.form-submit { align-self: flex-start; }

.contact-aside {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.contact-tile {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 18px;
  text-decoration: none;
  color: var(--text);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  text-align: center;
  box-shadow: var(--shadow-sm);
  transition: all 0.2s;
}
.contact-tile:hover {
  border-color: var(--blue);
  box-shadow: var(--shadow-md);
  color: var(--blue);
  transform: translateY(-2px);
}
.contact-tile svg { color: var(--blue); }
.contact-tile strong { font-size: 0.875rem; font-weight: 600; }
.contact-tile span { font-size: 0.75rem; color: var(--muted); }

/* ── Footer ── */
footer {
  background: var(--white);
  border-top: 1px solid var(--border);
  text-align: center;
  padding: 24px;
  font-size: 0.82rem;
  color: var(--muted);
}
footer a { color: var(--blue); text-decoration: none; }

/* ── Reveal animations ── */
.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.55s ease, transform 0.55s ease;
}
.reveal.visible { opacity: 1; transform: translateY(0); }
.d1 { transition-delay: 0.08s; }
.d2 { transition-delay: 0.16s; }
.d3 { transition-delay: 0.24s; }
.d4 { transition-delay: 0.32s; }
.d5 { transition-delay: 0.40s; }

/* Mobile hamburger */
.sidebar-toggle {
  display: none;
  position: fixed;
  top: 14px;
  left: 14px;
  z-index: 200;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 10px;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
}
.sidebar-toggle span {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--navy);
  border-radius: 2px;
  margin: 4px 0;
}
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  z-index: 49;
}

/* ── Responsive ── */
@media (max-width: 1024px) {
  .cards-grid { grid-template-columns: 1fr 1fr; }
  .about-grid { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
    transition: transform 0.3s;
  }
  .sidebar.open { transform: translateX(0); }
  .sidebar-overlay.open { display: block; }
  .sidebar-toggle { display: block; }
  .main { margin-left: 0; }
  .top-nav { padding: 0 16px; padding-left: 56px; }
  .page-section { padding: 40px 20px; }
  #hero { padding: 48px 20px; }
  .cards-grid { grid-template-columns: 1fr; }
  .contact-wrap { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; }
  .resume-card { padding: 24px 18px; }
  .hero-stats { gap: 20px; }
}
