/* ===== Theme tokens ===== */
:root {
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --max: 1080px;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

[data-theme="light"] {
  --bg: #ffffff;
  --bg-soft: #f5f5f7;
  --bg-card: #ffffff;
  --text: #1d1d1f;
  --text-soft: #6e6e73;
  --text-faint: #86868b;
  --line: #e4e4e7;
  --accent: #0071e3;
  --accent-soft: rgba(0,113,227,0.1);
  --nav-bg: rgba(255,255,255,0.72);
  --hero-glow: radial-gradient(60% 50% at 50% 0%, rgba(0,113,227,0.16), transparent 70%);
  --chip-bg: #f5f5f7;
  --shadow: 0 4px 24px rgba(0,0,0,0.06);
  --shadow-hover: 0 12px 40px rgba(0,0,0,0.12);
}

[data-theme="dark"] {
  --bg: #000000;
  --bg-soft: #0a0a0a;
  --bg-card: #141416;
  --text: #f5f5f7;
  --text-soft: #a1a1a6;
  --text-faint: #6e6e73;
  --line: #2a2a2d;
  --accent: #2997ff;
  --accent-soft: rgba(41,151,255,0.14);
  --nav-bg: rgba(0,0,0,0.6);
  --hero-glow: radial-gradient(60% 50% at 50% 0%, rgba(41,151,255,0.22), transparent 70%);
  --chip-bg: #1c1c1f;
  --shadow: 0 4px 24px rgba(0,0,0,0.4);
  --shadow-hover: 0 12px 48px rgba(0,0,0,0.6);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: 80px; }

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

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

/* ===== Navigation ===== */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  background: var(--nav-bg);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.4s var(--ease), background 0.5s var(--ease);
}
.nav.scrolled { border-bottom-color: var(--line); }
.nav-inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 24px;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.nav-logo { font-weight: 600; font-size: 17px; letter-spacing: -0.01em; }
.nav-links { display: flex; gap: 28px; }
.nav-links a {
  font-size: 13px;
  color: var(--text-soft);
  transition: color 0.2s;
}
.nav-links a:hover { color: var(--text); }

.theme-toggle {
  background: none; border: none; cursor: pointer;
  width: 34px; height: 34px; border-radius: 50%;
  display: grid; place-items: center;
  color: var(--text-soft);
  transition: background 0.2s, color 0.2s;
}
.theme-toggle:hover { background: var(--bg-soft); color: var(--text); }
.theme-toggle svg { width: 18px; height: 18px; }
.icon-moon { display: none; }
.icon-sun { display: block; }
[data-theme="dark"] .icon-moon { display: block; }
[data-theme="dark"] .icon-sun { display: none; }

/* ===== Layout ===== */
.section {
  max-width: var(--max);
  margin: 0 auto;
  padding: 100px 24px;
}
.section-title {
  font-size: clamp(34px, 5vw, 56px);
  font-weight: 700;
  letter-spacing: -0.025em;
  margin-bottom: 48px;
}
.section-kicker {
  font-size: 14px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
  margin-bottom: 20px;
}

/* ===== Hero ===== */
.hero {
  position: relative;
  min-height: 92vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 120px 24px 60px;
  overflow: hidden;
}
.hero-glow {
  position: absolute; inset: 0;
  background: var(--hero-glow);
  pointer-events: none;
}
.hero-content { position: relative; max-width: 760px; }
.hero-eyebrow {
  font-size: 15px; font-weight: 500;
  color: var(--accent);
  margin-bottom: 18px;
  letter-spacing: -0.01em;
}
.hero-title {
  font-size: clamp(56px, 11vw, 112px);
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 0.98;
  margin-bottom: 24px;
  background: linear-gradient(180deg, var(--text), var(--text-soft));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.hero-sub {
  font-size: clamp(18px, 2.4vw, 23px);
  color: var(--text-soft);
  line-height: 1.45;
  max-width: 620px;
  margin: 0 auto 36px;
}
.hero-actions { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }

.hero-stats {
  position: relative;
  display: flex;
  gap: 56px;
  margin-top: 80px;
  flex-wrap: wrap;
  justify-content: center;
}
.stat { display: flex; flex-direction: column; align-items: center; }
.stat-num {
  font-size: 44px; font-weight: 700; letter-spacing: -0.03em;
  color: var(--text);
}
.stat-label { font-size: 14px; color: var(--text-faint); margin-top: 4px; }

/* ===== Buttons ===== */
.btn {
  display: inline-flex; align-items: center;
  padding: 12px 24px;
  border-radius: 980px;
  font-size: 15px; font-weight: 500;
  transition: transform 0.2s var(--ease), background 0.2s, opacity 0.2s;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { opacity: 0.9; }
.btn-secondary { background: var(--bg-soft); color: var(--text); border: 1px solid var(--line); }
.btn-secondary:hover { background: var(--chip-bg); }

/* ===== About ===== */
.section-about { padding-top: 60px; padding-bottom: 60px; }
.about-grid {
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: 56px;
  align-items: center;
}
.about-photo { margin: 0; }
.about-photo img {
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  object-position: center 20%;
  border-radius: 24px;
  box-shadow: var(--shadow);
  border: 1px solid var(--line);
}
@media (max-width: 820px) {
  .about-grid { grid-template-columns: 1fr; gap: 36px; }
  .about-photo { max-width: 340px; }
}
.big-statement {
  font-size: clamp(26px, 4vw, 40px);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.28;
  margin-bottom: 28px;
}
.big-statement .hl { color: var(--accent); }
.lead {
  font-size: clamp(17px, 2vw, 20px);
  color: var(--text-soft);
  max-width: 760px;
  line-height: 1.55;
}

/* ===== Cards ===== */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
}
.card {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 30px;
  box-shadow: var(--shadow);
  transition: transform 0.4s var(--ease), box-shadow 0.4s var(--ease), border-color 0.3s;
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow-hover); }
.card h3 { font-size: 19px; font-weight: 600; letter-spacing: -0.01em; margin-bottom: 10px; }
.card p { font-size: 15px; color: var(--text-soft); line-height: 1.5; }
.card-wide { grid-column: span 2; }
.card-tag {
  display: inline-block;
  font-size: 12px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.05em;
  color: var(--accent);
  background: var(--accent-soft);
  padding: 4px 10px; border-radius: 980px;
  margin-bottom: 14px;
}
.card-link { display: flex; flex-direction: column; }
.card-cta {
  margin-top: 16px;
  font-size: 14px; font-weight: 500;
  color: var(--accent);
  transition: gap 0.2s;
}
.card code {
  font-family: "SF Mono", ui-monospace, Menlo, monospace;
  font-size: 0.88em;
  background: var(--chip-bg);
  padding: 1px 6px; border-radius: 6px;
}

/* ===== Timeline ===== */
.timeline { position: relative; padding-left: 28px; }
.timeline::before {
  content: ""; position: absolute;
  left: 5px; top: 8px; bottom: 8px;
  width: 2px; background: var(--line);
}
.tl-item { position: relative; padding-bottom: 56px; }
.tl-item:last-child { padding-bottom: 0; }
.tl-marker {
  position: absolute; left: -28px; top: 6px;
  width: 12px; height: 12px; border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px var(--bg);
}
.tl-head {
  display: flex; justify-content: space-between;
  align-items: baseline; gap: 16px; flex-wrap: wrap;
}
.tl-head h3 { font-size: 24px; font-weight: 700; letter-spacing: -0.02em; }
.tl-div { font-weight: 500; color: var(--text-soft); font-size: 18px; }
.tl-date { font-size: 14px; color: var(--text-faint); white-space: nowrap; }
.tl-role { font-size: 16px; color: var(--accent); font-weight: 500; margin-top: 4px; }
.tl-note { font-size: 14px; color: var(--text-faint); font-style: italic; margin-top: 6px; }
.tl-bullets { list-style: none; margin-top: 16px; }
.tl-bullets li {
  position: relative;
  padding-left: 20px; margin-bottom: 10px;
  font-size: 15.5px; color: var(--text-soft); line-height: 1.5;
}
.tl-bullets li::before {
  content: ""; position: absolute; left: 2px; top: 9px;
  width: 5px; height: 5px; border-radius: 50%;
  background: var(--text-faint);
}
.tl-bullets strong { color: var(--text); font-weight: 600; }

/* ===== Skills ===== */
.skills-grid { display: flex; flex-direction: column; gap: 36px; }
.skill-group h4 {
  font-size: 14px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--text-faint);
  margin-bottom: 16px;
}
.chips { display: flex; flex-wrap: wrap; gap: 10px; }
.chips span {
  font-size: 14px;
  background: var(--chip-bg);
  border: 1px solid var(--line);
  color: var(--text);
  padding: 8px 14px;
  border-radius: 980px;
  transition: transform 0.2s var(--ease), border-color 0.2s, color 0.2s;
}
.chips span:hover { transform: translateY(-2px); border-color: var(--accent); color: var(--accent); }

/* ===== Education ===== */
.section-edu { background: var(--bg-soft); max-width: none; }
.section-edu .section-title,
.section-edu .edu-grid { max-width: var(--max); margin-left: auto; margin-right: auto; }
.edu-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 24px; }
.edu-item h3 { font-size: 22px; font-weight: 600; letter-spacing: -0.01em; }
.edu-item p { color: var(--text-soft); margin-top: 6px; font-size: 15px; }
.edu-date { display: inline-block; margin-top: 10px; font-size: 14px; color: var(--text-faint); }

/* ===== Contact ===== */
.section-contact { text-align: center; padding-top: 120px; padding-bottom: 120px; }
.contact-title {
  font-size: clamp(36px, 6vw, 64px);
  font-weight: 700; letter-spacing: -0.03em;
  margin-bottom: 16px;
}
.contact-sub { font-size: 19px; color: var(--text-soft); margin-bottom: 36px; }
.contact-links { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }
.contact-meta { margin-top: 28px; font-size: 14px; color: var(--text-faint); }

/* ===== Footer ===== */
.footer {
  border-top: 1px solid var(--line);
  text-align: center;
  padding: 32px 24px;
}
.footer p { font-size: 13px; color: var(--text-faint); }

/* ===== Reveal animation ===== */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.8s var(--ease), transform 0.8s var(--ease);
}
.reveal.visible { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  html { scroll-behavior: auto; }
}

/* ===== Responsive ===== */
@media (max-width: 720px) {
  .nav-links { display: none; }
  .section { padding: 72px 20px; }
  .hero-stats { gap: 36px; }
  .card-wide { grid-column: span 1; }
  .tl-head h3 { font-size: 21px; }
}
