/* ============================================================
   RESET & BASE
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #ffffff;
  --bg-alt: #f7f8fa;
  --bg-dark: #0f1117;
  --bg-dark2: #161b27;
  --text: #111827;
  --text-muted: #6b7280;
  --text-light: #9ca3af;
  --accent: #2563eb;
  --accent-hover: #1d4ed8;
  --accent-light: #eff6ff;
  --accent-green: #059669;
  --accent-green-bg: #ecfdf5;
  --border: #e5e7eb;
  --border-dark: #1f2937;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 3px rgba(0,0,0,.08), 0 4px 16px rgba(0,0,0,.06);
  --shadow-md: 0 4px 24px rgba(0,0,0,.10);
  --shadow-lg: 0 8px 40px rgba(0,0,0,.14);
  --font: 'Inter', system-ui, sans-serif;
  --mono: 'JetBrains Mono', monospace;
}

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ============================================================
   NAV
   ============================================================ */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  background: transparent;
  backdrop-filter: none;
  border-bottom: 1px solid transparent;
  transition: background .3s ease, border-color .3s ease, box-shadow .3s ease;
}
.nav.scrolled {
  background: rgba(15, 17, 23, 0.92);
  backdrop-filter: blur(14px);
  border-color: rgba(255,255,255,.07);
  box-shadow: 0 1px 20px rgba(0,0,0,.3);
}
.nav-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.nav-logo {
  font-weight: 700;
  font-size: .95rem;
  letter-spacing: -.01em;
  color: rgba(255,255,255,.9);
}
.nav-links {
  list-style: none;
  display: flex;
  gap: 4px;
  align-items: center;
}
.nav-links a {
  font-size: .85rem;
  font-weight: 500;
  color: rgba(255,255,255,.6);
  padding: 6px 12px;
  border-radius: 6px;
  transition: background .15s, color .15s;
  text-decoration: none;
}
.nav-links a:hover { background: rgba(255,255,255,.08); color: #fff; }
.nav-cta {
  background: var(--accent) !important;
  color: #fff !important;
  border-radius: 6px;
}
.nav-cta:hover { background: var(--accent-hover) !important; }

/* Nav over light sections (post-hero) */
.nav.nav-light {
  background: rgba(255,255,255,.92) !important;
  border-color: var(--border) !important;
  box-shadow: 0 1px 12px rgba(0,0,0,.07) !important;
}
.nav.nav-light .nav-logo { color: var(--text) !important; }
.nav.nav-light .nav-links a { color: var(--text-muted) !important; }
.nav.nav-light .nav-links a:hover { background: var(--bg-alt) !important; color: var(--text) !important; }

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: .9rem;
  font-weight: 600;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all .15s;
  text-decoration: none;
  white-space: nowrap;
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); text-decoration: none; }
.btn-outline { background: transparent; color: var(--accent); border: 1.5px solid var(--accent); }
.btn-outline:hover { background: var(--accent-light); text-decoration: none; }
.btn-lg { font-size: 1rem; padding: 14px 28px; }

/* ============================================================
   SECTIONS
   ============================================================ */
.section { padding: 96px 0; }

/* Subtle grain texture for dark backgrounds */
.section-dark,
.section-cta,
.hero {
  --grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='200' height='200' filter='url(%23n)' opacity='0.04'/%3E%3C/svg%3E");
}
.section-dark { background: var(--bg-dark); background-image: var(--grain); }
.section-alt { background: var(--bg-alt); }
.section-cta { background: var(--bg-dark); background-image: var(--grain); }

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
}

.section-title {
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -.03em;
  margin-bottom: 8px;
}
.section-title.light { color: #fff; }
.section-subtitle {
  font-size: 1.05rem;
  color: var(--text-muted);
  margin-bottom: 48px;
}
.section-subtitle.light { color: #9ca3af; }

/* ============================================================
   HERO
   ============================================================ */
.hero {
  padding: 130px 0 80px;
  background: linear-gradient(135deg, #0f1117 0%, #161b27 50%, #1a2035 100%);
  background-image: var(--grain), linear-gradient(135deg, #0f1117 0%, #161b27 50%, #1a2035 100%);
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute;
  top: -40%; left: 55%;
  width: 700px; height: 700px;
  background: radial-gradient(circle, rgba(37,99,235,.18) 0%, transparent 70%);
  pointer-events: none;
  animation: pulse-glow 6s ease-in-out infinite;
}
.hero::after {
  content: '';
  position: absolute;
  bottom: -20%; left: -10%;
  width: 500px; height: 500px;
  background: radial-gradient(circle, rgba(5,150,105,.08) 0%, transparent 70%);
  pointer-events: none;
  animation: pulse-glow 8s ease-in-out infinite reverse;
}
@keyframes pulse-glow {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.12); opacity: .7; }
}
.hero-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 64px;
  align-items: center;
}
.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--accent-green-bg);
  color: var(--accent-green);
  font-size: .78rem;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
  padding: 5px 12px;
  border-radius: 100px;
  margin-bottom: 20px;
}
.hero-badge::before {
  content: '';
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--accent-green);
}
.hero-name {
  font-size: 3.2rem;
  font-weight: 800;
  letter-spacing: -.04em;
  line-height: 1.1;
  color: #fff;
  margin-bottom: 12px;
}
.accent { color: var(--accent); }
.hero-title {
  font-size: 1.1rem;
  font-weight: 500;
  color: #94a3b8;
  margin-bottom: 8px;
}
.hero-location {
  font-size: .9rem;
  color: #64748b;
  margin-bottom: 28px;
}
.hero-pitch {
  background: rgba(37,99,235,.1);
  border-left: 3px solid var(--accent);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  padding: 18px 20px;
  color: #cbd5e1;
  font-size: .97rem;
  line-height: 1.7;
  margin-bottom: 32px;
  font-style: normal;
}
.hero-pitch strong { color: #fff; }
.hero-links { display: flex; gap: 12px; flex-wrap: wrap; }
.hero-photo {
  display: flex;
  justify-content: center;
}
.hero-photo img {
  width: 240px;
  height: 240px;
  object-fit: cover;
  object-position: 50% 30%;
  border-radius: 50%;
  border: 4px solid rgba(37,99,235,.4);
  box-shadow: 0 0 0 8px rgba(37,99,235,.08), var(--shadow-lg);
}

/* ============================================================
   IMPACT STATS
   ============================================================ */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}
.stat-card {
  background: var(--bg-dark2);
  border: 1px solid var(--border-dark);
  border-radius: var(--radius);
  padding: 28px 24px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  transition: border-color .25s, transform .25s, box-shadow .25s;
  position: relative;
  overflow: hidden;
}
.stat-card::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(37,99,235,.06) 0%, transparent 60%);
  opacity: 0;
  transition: opacity .25s;
  pointer-events: none;
}
.stat-card:hover {
  border-color: rgba(37,99,235,.5);
  transform: translateY(-4px);
  box-shadow: 0 8px 32px rgba(37,99,235,.18);
}
.stat-card:hover::after {
  opacity: 1;
}
.stat-number {
  font-size: 2.4rem;
  font-weight: 800;
  letter-spacing: -.04em;
  color: var(--accent);
  font-family: var(--mono);
}
.stat-label {
  font-size: .95rem;
  font-weight: 600;
  color: #e2e8f0;
  line-height: 1.3;
}
.stat-context {
  font-size: .8rem;
  color: #64748b;
}

/* ============================================================
   EXPERTISE
   ============================================================ */
.expertise-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}
.expertise-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 24px;
  transition: border-color .2s, box-shadow .2s, transform .2s;
}
.expertise-card:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}
.expertise-icon {
  font-size: 1.8rem;
  margin-bottom: 14px;
}
.expertise-card h3 {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 10px;
  color: var(--text);
}
.expertise-card p {
  font-size: .88rem;
  color: var(--text-muted);
  line-height: 1.65;
}

/* ============================================================
   TIMELINE / EXPERIENCE
   ============================================================ */
.timeline {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.timeline-item {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: border-color .2s;
}
.timeline-item.open { border-color: var(--accent); }
.timeline-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 22px 24px;
  cursor: pointer;
  user-select: none;
  gap: 16px;
}
.timeline-header:hover { background: var(--bg-alt); }
.timeline-meta {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.timeline-company {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
}
.timeline-role {
  font-size: .9rem;
  font-weight: 500;
  color: var(--accent);
}
.timeline-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  flex-shrink: 0;
}
.timeline-period {
  font-size: .82rem;
  font-weight: 600;
  color: var(--text-muted);
  font-family: var(--mono);
}
.timeline-industry {
  font-size: .78rem;
  color: var(--text-light);
}
.timeline-chevron {
  font-size: .65rem;
  color: var(--text-light);
  transition: transform .25s;
  margin-top: 4px;
}
.timeline-item.open .timeline-chevron { transform: rotate(90deg); }
.timeline-body {
  display: none;
  padding: 0 24px 24px;
  border-top: 1px solid var(--border);
}
.timeline-item.open .timeline-body { display: block; padding-top: 20px; }
.timeline-body ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.timeline-body li {
  font-size: .9rem;
  color: var(--text-muted);
  line-height: 1.65;
  padding-left: 18px;
  position: relative;
}
.timeline-body li::before {
  content: '→';
  position: absolute;
  left: 0;
  color: var(--accent);
  font-weight: 700;
}

/* ============================================================
   PROJECTS
   ============================================================ */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
}
.project-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 26px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: border-color .2s, box-shadow .2s, transform .2s;
}
.project-card:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}
.project-tag {
  font-size: .75rem;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--accent);
  background: var(--accent-light);
  padding: 3px 10px;
  border-radius: 100px;
  width: fit-content;
}
.project-card h3 {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.3;
}
.project-result {
  font-size: .92rem;
  font-weight: 600;
  color: var(--accent-green);
  background: var(--accent-green-bg);
  padding: 8px 12px;
  border-radius: var(--radius-sm);
}
.project-card > p:not(.project-result) {
  font-size: .88rem;
  color: var(--text-muted);
  line-height: 1.65;
  flex: 1;
}
.project-stack {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 4px;
}
.project-stack span {
  font-size: .75rem;
  font-weight: 500;
  font-family: var(--mono);
  color: var(--text-muted);
  background: var(--bg-alt);
  border: 1px solid var(--border);
  padding: 3px 9px;
  border-radius: 4px;
}

/* ============================================================
   EDUCATION
   ============================================================ */
.education-container {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 64px;
  align-items: start;
}
.edu-list {
  display: flex;
  flex-direction: column;
  gap: 28px;
  margin-top: 16px;
}
.edu-item {
  border-left: 3px solid var(--accent);
  padding-left: 20px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.edu-degree {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
}
.edu-link {
  color: var(--text);
  text-decoration: none;
  transition: color .15s;
}
.edu-link:hover { color: var(--accent); text-decoration: none; }
.edu-year {
  font-size: .82rem;
  font-weight: 600;
  color: var(--accent);
  font-family: var(--mono);
}
.edu-item p {
  font-size: .88rem;
  color: var(--text-muted);
  line-height: 1.6;
  margin-top: 4px;
}
.edu-callout {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  align-items: center;
  text-align: center;
  box-shadow: var(--shadow);
}
.edu-callout-icon { font-size: 2.5rem; }
.edu-callout p {
  font-size: .9rem;
  color: var(--text-muted);
  line-height: 1.65;
}
.edu-callout strong { color: var(--text); }

/* ============================================================
   TECH STACK
   ============================================================ */
.stack-groups {
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.stack-group {
  display: flex;
  align-items: flex-start;
  gap: 20px;
}
.stack-group-label {
  font-size: .8rem;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--text-muted);
  min-width: 120px;
  padding-top: 4px;
}
.stack-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.stack-tags span {
  font-size: .82rem;
  font-weight: 500;
  font-family: var(--mono);
  color: var(--text);
  background: var(--bg-alt);
  border: 1px solid var(--border);
  padding: 5px 12px;
  border-radius: 6px;
  transition: border-color .15s, color .15s;
}
.stack-tags span:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* ============================================================
   CTA
   ============================================================ */
.cta-box {
  max-width: 700px;
  margin: 0 auto;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 20px;
  align-items: center;
}
.cta-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(5,150,105,.15);
  color: #34d399;
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  padding: 5px 14px;
  border-radius: 100px;
  border: 1px solid rgba(52,211,153,.2);
}
.cta-badge::before {
  content: '';
  width: 7px; height: 7px;
  border-radius: 50%;
  background: #34d399;
}
.cta-box h2 {
  font-size: 2.6rem;
  font-weight: 800;
  letter-spacing: -.04em;
  color: #fff;
  line-height: 1.2;
}
.cta-box > p {
  font-size: 1.05rem;
  color: #94a3b8;
  line-height: 1.7;
}
.cta-box strong { color: #e2e8f0; }
.cta-links {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
}
.cta-phone {
  font-size: .88rem !important;
  color: #4b5563 !important;
  margin-top: -8px;
}

/* ============================================================
   BEYOND THE TERMINAL (FUN SECTION)
   ============================================================ */
.section-fun {
  background: linear-gradient(135deg, #f0f4ff 0%, #fdf4ff 50%, #f0fdf9 100%);
}
.fun-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}
.fun-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 22px;
  text-align: center;
  box-shadow: var(--shadow);
  transition: transform .25s ease, box-shadow .25s ease;
  position: relative;
  overflow: hidden;
}
.fun-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, transparent 60%, rgba(37,99,235,.04) 100%);
  pointer-events: none;
}
.fun-card:hover {
  transform: translateY(-6px) rotate(0.5deg);
  box-shadow: var(--shadow-lg);
}
.fun-icon {
  display: block;
  font-size: 2.4rem;
  margin-bottom: 14px;
  filter: drop-shadow(0 2px 6px rgba(0,0,0,.1));
}
.fun-card p {
  font-size: .9rem;
  color: var(--text-muted);
  line-height: 1.6;
}

/* ============================================================
   SCROLL-REVEAL ANIMATION
   ============================================================ */
.reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity .5s ease, transform .5s ease;
}
.reveal.revealed {
  opacity: 1;
  transform: translateY(0);
}

/* ============================================================
   FOOTER
   ============================================================ */
.footer {
  background: #080b11;
  background-image: var(--grain);
  padding: 24px;
  text-align: center;
  font-size: .82rem;
  color: #374151;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 900px) {
  .hero-inner { grid-template-columns: 1fr; gap: 40px; }
  .hero-photo { order: -1; }
  .hero-photo img { width: 180px; height: 180px; }
  .hero-name { font-size: 2.4rem; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .expertise-grid { grid-template-columns: repeat(2, 1fr); }
  .projects-grid { grid-template-columns: 1fr; }
  .education-container { grid-template-columns: 1fr; }
  .nav-links { display: none; }
  .fun-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 600px) {
  .section { padding: 64px 0; }
  .stats-grid { grid-template-columns: 1fr; }
  .expertise-grid { grid-template-columns: 1fr; }
  .fun-grid { grid-template-columns: 1fr; }
  .hero-name { font-size: 2rem; }
  .section-title { font-size: 1.6rem; }
  .cta-box h2 { font-size: 1.9rem; }
  .stack-group { flex-direction: column; gap: 8px; }
  .stack-group-label { min-width: unset; }
}
