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

:root {
  --bg: #fbfaf8;
  --bg-alt: #f3f1ec;
  --surface: #ffffff;
  --border: #e7e3db;
  --text: #17181a;
  --text-soft: #55585e;
  --text-faint: #8a8d93;
  --accent: #2a5cff;
  --accent-soft: #eef2ff;
  --mono: 'JetBrains Mono', monospace;
  --sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --max: 1080px;
  --radius: 16px;
}

html { scroll-behavior: smooth; }

body {
  font-family: var(--sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

.container {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 32px;
}

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

.noise {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background-image: radial-gradient(circle at 15% 10%, rgba(42,92,255,0.06), transparent 40%),
                     radial-gradient(circle at 85% 30%, rgba(42,92,255,0.05), transparent 45%);
}

/* ---------- Nav ---------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(251,250,248,0.8);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid transparent;
  transition: border-color .3s ease;
}
.nav.scrolled { border-bottom-color: var(--border); }

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 18px;
  padding-bottom: 18px;
}

.logo {
  font-family: var(--mono);
  font-weight: 600;
  font-size: 1.1rem;
  letter-spacing: -0.02em;
}
.logo .dot { color: var(--accent); }

.nav-links {
  display: flex;
  gap: 32px;
}
.nav-links a {
  font-size: 0.92rem;
  color: var(--text-soft);
  transition: color .2s ease;
  position: relative;
}
.nav-links a:hover { color: var(--text); }

.nav-cta { display: inline-flex; }

.menu-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
}
.menu-toggle span {
  width: 22px;
  height: 2px;
  background: var(--text);
  transition: all .25s ease;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 22px;
  border-radius: 999px;
  font-size: 0.92rem;
  font-weight: 600;
  transition: transform .18s ease, box-shadow .18s ease, background .18s ease;
  border: 1px solid transparent;
  cursor: pointer;
}
.btn-primary {
  background: var(--text);
  color: var(--bg);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 10px 24px rgba(0,0,0,0.15); }
.btn-ghost {
  background: transparent;
  border-color: var(--border);
  color: var(--text);
}
.btn-ghost:hover { border-color: var(--text); }
.btn-small { padding: 9px 18px; font-size: 0.85rem; }
.btn-large { padding: 16px 30px; font-size: 1rem; }

/* ---------- Hero ---------- */
.hero {
  padding: 120px 32px 100px;
  position: relative;
  z-index: 1;
}

.eyebrow {
  font-family: var(--mono);
  color: var(--accent);
  font-size: 0.9rem;
  margin-bottom: 18px;
  letter-spacing: 0.02em;
}

.hero-name {
  font-size: clamp(2.6rem, 6vw, 4.6rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.03;
  margin-bottom: 18px;
}

.hero-title {
  font-size: clamp(1.15rem, 2.4vw, 1.6rem);
  font-weight: 500;
  color: var(--text-soft);
  max-width: 640px;
  margin-bottom: 20px;
  line-height: 1.4;
}

.hero-desc {
  max-width: 560px;
  color: var(--text-faint);
  font-size: 1.02rem;
  margin-bottom: 36px;
}

.hero-actions {
  display: flex;
  gap: 16px;
  margin-bottom: 44px;
  flex-wrap: wrap;
}

.hero-links {
  display: flex;
  gap: 26px;
}
.hero-links a {
  font-family: var(--mono);
  font-size: 0.85rem;
  color: var(--text-faint);
  border-bottom: 1px solid transparent;
  padding-bottom: 2px;
  transition: color .2s ease, border-color .2s ease;
}
.hero-links a:hover { color: var(--text); border-color: var(--text); }

/* ---------- Sections ---------- */
.section {
  padding: 100px 32px;
  position: relative;
  z-index: 1;
}

.section-tag {
  font-family: var(--mono);
  color: var(--accent);
  font-size: 0.85rem;
  margin-bottom: 14px;
}

.section-title {
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 36px;
}

/* ---------- About ---------- */
.about-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 60px;
  align-items: start;
}

.about-text {
  color: var(--text-soft);
  font-size: 1.02rem;
  margin-bottom: 18px;
  max-width: 560px;
}

.about-stats {
  display: grid;
  gap: 24px;
  padding: 28px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.stat { display: flex; flex-direction: column; gap: 2px; }
.stat-num {
  font-family: var(--mono);
  font-size: 2rem;
  font-weight: 700;
  color: var(--accent);
}
.stat-label {
  color: var(--text-faint);
  font-size: 0.88rem;
}

/* ---------- Skills ---------- */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
}

.skill-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 26px;
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.skill-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 14px 30px rgba(0,0,0,0.06);
  border-color: #d8d3c8;
}
.skill-card h4 {
  font-size: 1rem;
  margin-bottom: 10px;
  font-weight: 700;
}
.skill-card p {
  color: var(--text-faint);
  font-size: 0.92rem;
  line-height: 1.55;
}

/* ---------- Projects ---------- */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
}

.project-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.project-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 18px 36px rgba(0,0,0,0.08);
  border-color: #d8d3c8;
}

.project-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.project-index {
  font-family: var(--mono);
  color: var(--text-faint);
  font-size: 0.85rem;
}
.status-badge {
  font-family: var(--mono);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--accent);
  background: var(--accent-soft);
  padding: 5px 11px;
  border-radius: 999px;
}
.project-links {
  display: flex;
  gap: 12px;
}
.project-links a {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  border-radius: 50%;
  font-size: 0.85rem;
  transition: background .2s ease, color .2s ease, border-color .2s ease;
}
.project-links a:hover {
  background: var(--text);
  color: var(--bg);
  border-color: var(--text);
}

.project-card h4 {
  font-size: 1.15rem;
  font-weight: 700;
}
.project-card p {
  color: var(--text-soft);
  font-size: 0.94rem;
  flex-grow: 1;
}

.tags {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.tags span {
  font-family: var(--mono);
  font-size: 0.76rem;
  padding: 5px 11px;
  background: var(--accent-soft);
  color: var(--accent);
  border-radius: 999px;
}

/* ---------- Experience / timeline ---------- */
.timeline {
  display: flex;
  flex-direction: column;
  gap: 0;
  border-left: 2px solid var(--border);
  margin-left: 6px;
}

.timeline-item {
  position: relative;
  padding: 0 0 44px 32px;
}
.timeline-item:last-child { padding-bottom: 0; }
.timeline-item::before {
  content: '';
  position: absolute;
  left: -7px;
  top: 4px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--bg);
  border: 2px solid var(--accent);
}

.timeline-date {
  font-family: var(--mono);
  font-size: 0.82rem;
  color: var(--accent);
  margin-bottom: 8px;
}

.timeline-content h4 {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 2px;
}
.timeline-org {
  display: block;
  color: var(--text-faint);
  font-size: 0.88rem;
  margin-bottom: 10px;
}
.timeline-content p {
  color: var(--text-soft);
  font-size: 0.94rem;
  max-width: 560px;
}

/* ---------- Contact ---------- */
.contact-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 64px 48px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
}
.contact-title {
  font-size: clamp(1.6rem, 3.4vw, 2.4rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  max-width: 560px;
}
.contact-desc {
  color: var(--text-faint);
  max-width: 460px;
  margin-bottom: 6px;
}
.contact-links {
  margin-top: 14px;
  justify-content: center;
}

/* ---------- Footer ---------- */
.footer {
  border-top: 1px solid var(--border);
  padding: 28px 32px;
}
.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.85rem;
  color: var(--text-faint);
}
.back-to-top {
  color: var(--text-faint);
  transition: color .2s ease;
}
.back-to-top:hover { color: var(--text); }

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

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

@media (max-width: 720px) {
  .nav-links, .nav-cta { display: none; }
  .menu-toggle { display: flex; }

  .nav-links.open {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    padding: 20px 32px 28px;
    gap: 18px;
  }

  .hero { padding: 90px 24px 70px; }
  .section { padding: 70px 24px; }
  .container { padding: 0 24px; }
  .contact-box { padding: 44px 24px; }
  .footer-inner { flex-direction: column; gap: 10px; text-align: center; }
  .projects-grid { grid-template-columns: 1fr; }
}
