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

:root {
  /* palette */
  --accent:      #6366f1;   /* indigo */
  --accent-2:    #8b5cf6;   /* violet */
  --accent-3:    #06b6d4;   /* cyan */
  --accent-soft: #eef2ff;
  --text:        #0f172a;
  --text-2:      #334155;
  --muted:       #64748b;
  --border:      #e2e8f0;
  --bg:          #ffffff;
  --bg-alt:      #f8fafc;
  --card:        #ffffff;

  --radius-sm: 8px;
  --radius:    14px;
  --radius-lg: 20px;

  --nav-h:  64px;
  --max-w:  1060px;
  --shadow-sm: 0 1px 2px rgba(15,23,42,0.04);
  --shadow:    0 4px 20px rgba(15,23,42,0.06);
  --shadow-lg: 0 12px 40px rgba(15,23,42,0.10);

  --grad: linear-gradient(135deg, var(--accent) 0%, var(--accent-2) 50%, var(--accent-3) 100%);
}

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  font-size: 15.5px;
  line-height: 1.7;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a { color: var(--accent); text-decoration: none; transition: color .15s; }
a:hover { color: var(--accent-2); }

ul { padding-left: 1.25rem; }
li { margin-bottom: 0.4rem; color: var(--text-2); }

/* ── Nav ───────────────────────────────────────────────────── */
#navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255,255,255,0.78);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--border);
  height: var(--nav-h);
}

.nav-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 1.75rem;
  height: 100%;
  display: flex;
  align-items: center;
  gap: 2rem;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-shrink: 0;
  font-weight: 600;
  color: var(--text);
}
.nav-brand:hover { color: var(--text); }

.brand-mark {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  display: block;
  box-shadow: 0 0 0 2px #fff, 0 0 0 3px var(--accent);
}

.brand-name { font-size: 0.92rem; }

.nav-links {
  display: flex;
  list-style: none;
  gap: 1.75rem;
  padding: 0;
  margin: 0 0 0 auto;
  flex-wrap: wrap;
}

.nav-links a {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--muted);
  position: relative;
  padding: 0.25rem 0;
}
.nav-links a::after {
  content: '';
  position: absolute;
  left: 0; right: 0; bottom: -4px;
  height: 2px;
  background: var(--grad);
  border-radius: 2px;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .2s;
}
.nav-links a:hover,
.nav-links a.active { color: var(--text); }
.nav-links a.active::after { transform: scaleX(1); }

.nav-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 1.4rem;
  cursor: pointer;
  color: var(--text);
  margin-left: auto;
}

/* ── Hero ──────────────────────────────────────────────────── */
.hero {
  position: relative;
  padding: 5.5rem 1.75rem 3rem;
  text-align: center;
  overflow: hidden;
  border-bottom: 1px solid var(--border);
}

.hero-bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 60% at 50% 0%, rgba(99,102,241,0.14), transparent 60%),
    radial-gradient(ellipse 60% 50% at 80% 20%, rgba(139,92,246,0.12), transparent 60%),
    radial-gradient(ellipse 60% 50% at 20% 30%, rgba(6,182,212,0.10), transparent 60%);
  z-index: -2;
}
.hero::before {
  content: '';
  position: absolute; inset: 0;
  background-image:
    linear-gradient(to right, rgba(15,23,42,0.04) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(15,23,42,0.04) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse at center, #000 30%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse at center, #000 30%, transparent 75%);
  z-index: -1;
}

.hero-inner {
  max-width: 780px;
  margin: 0 auto;
  position: relative;
}

.avatar-wrap {
  position: relative;
  display: inline-block;
  margin-bottom: 1.5rem;
}

.avatar-photo {
  width: 140px;
  height: 140px;
  border-radius: 50%;
  object-fit: cover;
  display: block;
  box-shadow: var(--shadow-lg), 0 0 0 4px #fff, 0 0 0 6px var(--accent);
  background: var(--grad);
}

.status-dot {
  position: absolute;
  bottom: 6px; right: 6px;
  width: 18px; height: 18px;
  background: #22c55e;
  border: 3px solid #fff;
  border-radius: 50%;
  box-shadow: 0 0 0 0 rgba(34,197,94,0.6);
  animation: pulse 2.5s infinite;
}
@keyframes pulse {
  0%   { box-shadow: 0 0 0 0   rgba(34,197,94,0.55); }
  70%  { box-shadow: 0 0 0 10px rgba(34,197,94,0); }
  100% { box-shadow: 0 0 0 0   rgba(34,197,94,0); }
}

.hero-name {
  font-size: clamp(2.2rem, 5vw, 3.2rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.1;
  margin-bottom: 1rem;
  background: linear-gradient(180deg, var(--text) 0%, #334155 100%);
  -webkit-background-clip: text;
          background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-title {
  font-size: clamp(1rem, 2vw, 1.2rem);
  color: var(--text-2);
  margin-bottom: 1rem;
  max-width: 640px;
  margin-left: auto;
  margin-right: auto;
  line-height: 1.55;
}

.gradient-text {
  background: var(--grad);
  -webkit-background-clip: text;
          background-clip: text;
  -webkit-text-fill-color: transparent;
  font-weight: 700;
}

.hero-location {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.875rem;
  color: var(--muted);
  margin-bottom: 1.75rem;
}
.hero-location .pin { width: 14px; height: 14px; }

.hero-links {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.65rem;
}

.hero-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.65rem 1.1rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: #fff;
  color: var(--text);
  font-size: 0.88rem;
  font-weight: 500;
  transition: all .2s;
  box-shadow: var(--shadow-sm);
}
.hero-btn svg { width: 16px; height: 16px; }
.hero-btn:hover {
  color: var(--text);
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(99,102,241,0.15);
}

.hero-btn-primary {
  background: var(--grad);
  color: #fff;
  border-color: transparent;
}
.hero-btn-primary:hover { color: #fff; }

/* ── Sections ──────────────────────────────────────────────── */
.section { padding: 5rem 1.75rem; }
.section-alt { background: var(--bg-alt); }

.container {
  max-width: var(--max-w);
  margin: 0 auto;
}

.section-head {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
  margin-bottom: 2.25rem;
}
.section-head.center {
  justify-content: center;
}

.section-num {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--accent);
  opacity: 0.85;
}

.section-title {
  font-size: 1.6rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
}

/* ── About ─────────────────────────────────────────────────── */
.about-grid {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 3rem;
  align-items: start;
}

.about-text {
  color: var(--text-2);
  margin-bottom: 1rem;
}
.about-text.lead {
  font-size: 1.1rem;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 1.25rem;
}

.about-stack {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  box-shadow: var(--shadow-sm);
}

.stack-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin-bottom: 0.75rem;
}

.stack-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.stack-tags span {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.72rem;
  padding: 0.25rem 0.55rem;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text-2);
}

/* ── Timeline ──────────────────────────────────────────────── */
.timeline { display: flex; flex-direction: column; gap: 0; }

.timeline-item {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 2rem;
  padding: 2rem 0;
  border-top: 1px solid var(--border);
}
.timeline-item:first-child { border-top: none; padding-top: 0; }

.timeline-meta {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding-top: 0.15rem;
}

.timeline-date {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--accent);
}

.timeline-loc {
  font-size: 0.78rem;
  color: var(--muted);
}

.timeline-role {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 0.15rem;
  color: var(--text);
}

.timeline-company {
  font-size: 0.9rem;
  color: var(--muted);
  margin-bottom: 0.9rem;
}

.timeline-body ul {
  font-size: 0.92rem;
  color: var(--text-2);
}

/* ── Projects ──────────────────────────────────────────────── */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.25rem;
}

.project-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.4rem;
  transition: all .25s;
  position: relative;
  overflow: hidden;
}
.project-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--grad);
  opacity: 0;
  transition: opacity .25s;
}
.project-card:hover {
  border-color: transparent;
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}
.project-card:hover::before { opacity: 1; }

.project-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 10px;
  background: var(--accent-soft);
  color: var(--accent);
  margin-bottom: 0.9rem;
}
.project-icon svg { width: 20px; height: 20px; }

.project-card h3 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--text);
}

.project-card p {
  font-size: 0.88rem;
  color: var(--text-2);
  margin-bottom: 1rem;
  line-height: 1.6;
}

.project-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.project-tags span {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.7rem;
  font-weight: 500;
  padding: 0.2rem 0.55rem;
  background: var(--bg-alt);
  color: var(--muted);
  border-radius: 6px;
}

/* ── Writing ───────────────────────────────────────────────── */
.writing-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

.article-card {
  display: block;
  padding: 1.5rem 1.75rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  transition: all .25s;
}
.article-card:hover {
  color: var(--text);
  border-color: var(--accent);
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
}

.article-meta {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.75rem;
  color: var(--muted);
  margin-bottom: 0.55rem;
  flex-wrap: wrap;
}
.article-source {
  font-weight: 600;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.article-dot { color: #cbd5e1; }

.article-title {
  font-size: 1.15rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  line-height: 1.4;
  color: var(--text);
}

.article-excerpt {
  font-size: 0.92rem;
  color: var(--text-2);
  margin-bottom: 0.85rem;
  line-height: 1.6;
}

.article-arrow {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--accent);
}
.article-arrow svg {
  width: 14px; height: 14px;
  transition: transform .2s;
}
.article-card:hover .article-arrow svg { transform: translateX(4px); }

/* ── Education ─────────────────────────────────────────────── */
.edu-list { display: flex; flex-direction: column; gap: 1.5rem; }

.edu-item {
  padding: 1.25rem 1.5rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  position: relative;
  overflow: hidden;
}
.edu-item::before {
  content: '';
  position: absolute;
  top: 0; bottom: 0; left: 0;
  width: 4px;
  background: var(--grad);
}

.edu-degree {
  font-weight: 600;
  font-size: 1.05rem;
  color: var(--text);
}

.edu-school {
  font-size: 0.9rem;
  color: var(--muted);
  margin-top: 0.15rem;
}

.edu-year {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.78rem;
  color: var(--accent);
  margin-top: 0.3rem;
}

.edu-courses {
  font-size: 0.82rem;
  color: var(--muted);
  margin-top: 0.5rem;
  line-height: 1.6;
}

/* ── Awards ────────────────────────────────────────────────── */
.awards-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.award-item {
  display: grid;
  grid-template-columns: 52px 1fr;
  gap: 1.1rem;
  align-items: start;
  padding: 1.35rem 1.5rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: all .25s;
}
.award-item:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.award-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--grad);
  color: #fff;
  box-shadow: 0 4px 12px rgba(99,102,241,0.3);
}
.award-icon svg { width: 22px; height: 22px; }

.award-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.25rem;
  line-height: 1.4;
}

.award-meta {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.78rem;
  color: var(--accent);
  margin-bottom: 0.5rem;
}

.award-desc {
  font-size: 0.88rem;
  color: var(--text-2);
  line-height: 1.6;
}

@media (max-width: 520px) {
  .award-item { grid-template-columns: 1fr; gap: 0.75rem; }
}

/* ── Skills ────────────────────────────────────────────────── */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 1.5rem;
}

.skill-group {
  padding: 1.4rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.skill-group h3 {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin-bottom: 0.9rem;
}

.skill-icon {
  font-size: 0.95rem;
  color: var(--accent);
}

.skill-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.skill-tags span {
  font-size: 0.78rem;
  font-weight: 500;
  padding: 0.3rem 0.7rem;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text-2);
  transition: all .15s;
}
.skill-tags span:hover {
  background: var(--accent-soft);
  border-color: #c7d2fe;
  color: var(--accent);
  transform: translateY(-1px);
}

/* ── Contact ───────────────────────────────────────────────── */
.contact-container { text-align: center; max-width: 640px; }

.contact-blurb {
  color: var(--text-2);
  margin-bottom: 1.75rem;
  font-size: 1rem;
}

.contact-email {
  font-family: 'JetBrains Mono', monospace;
  font-size: 1.2rem;
  font-weight: 500;
  color: var(--text);
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.7rem 1.1rem;
  display: inline-block;
  user-select: all;
  margin: 0;
}

.contact-links {
  margin-top: 1.5rem;
  font-size: 0.9rem;
  color: var(--muted);
}
.contact-links a {
  color: var(--muted);
  font-weight: 500;
}
.contact-links a:hover { color: var(--accent); }
.sep { margin: 0 0.6rem; color: #cbd5e1; }

/* ── Footer ────────────────────────────────────────────────── */
footer {
  border-top: 1px solid var(--border);
  background: var(--bg-alt);
}
.footer-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 1.75rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  font-size: 0.8rem;
  color: var(--muted);
}

/* ── Reveal animation ──────────────────────────────────────── */
.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity .6s ease, transform .6s ease;
}
.reveal.visible {
  opacity: 1;
  transform: none;
}

/* ── Responsive ────────────────────────────────────────────── */
@media (max-width: 820px) {
  .about-grid { grid-template-columns: 1fr; gap: 1.5rem; }
}

@media (max-width: 640px) {
  .nav-inner { padding: 0 1.25rem; gap: 1rem; }
  .brand-name { display: none; }

  .nav-links {
    display: none;
    margin-left: 0;
  }
  .nav-links.open {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: var(--nav-h);
    left: 0; right: 0;
    background: #fff;
    border-bottom: 1px solid var(--border);
    padding: 1rem 1.5rem;
    gap: 0.85rem;
    box-shadow: var(--shadow);
  }
  .nav-toggle { display: block; margin-left: auto; }

  .hero { padding: 3.5rem 1.25rem 3rem; }
  .hero-name { font-size: 2rem; }
  .avatar-photo { width: 110px; height: 110px; }

  .section { padding: 3.5rem 1.25rem; }

  .timeline-item {
    grid-template-columns: 1fr;
    gap: 0.5rem;
  }
  .timeline-meta {
    flex-direction: row;
    gap: 0.75rem;
    align-items: center;
    flex-wrap: wrap;
  }

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