/* ---------- Design tokens ---------- */
:root {
  --bg: #0a0e17;
  --bg-alt: #0f1523;
  --surface: #131a2b;
  --surface-hover: #182137;
  --border: #232d45;
  --text: #dbe2f0;
  --text-dim: #8b96af;
  --text-faint: #5b6787;
  --accent: #5eead4;
  --accent-dim: #2dd4bf;
  --accent-soft: rgba(94, 234, 212, 0.1);
  --shadow: 0 20px 60px -20px rgba(0, 0, 0, 0.6);
  --radius: 14px;
  --maxw: 1080px;
  --font: 'Segoe UI', -apple-system, BlinkMacSystemFont, Roboto, Helvetica, Arial, sans-serif;
  --mono: 'Consolas', 'SFMono-Regular', Menlo, Monaco, monospace;
}

:root[data-theme="light"] {
  --bg: #f6f8fc;
  --bg-alt: #eef1f8;
  --surface: #ffffff;
  --surface-hover: #f0f3fa;
  --border: #e1e6f0;
  --text: #1a2138;
  --text-dim: #545f7d;
  --text-faint: #8993ad;
  --accent: #0d9488;
  --accent-dim: #0f766e;
  --accent-soft: rgba(13, 148, 136, 0.08);
  --shadow: 0 20px 60px -20px rgba(30, 41, 59, 0.15);
}

@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --bg: #f6f8fc;
    --bg-alt: #eef1f8;
    --surface: #ffffff;
    --surface-hover: #f0f3fa;
    --border: #e1e6f0;
    --text: #1a2138;
    --text-dim: #545f7d;
    --text-faint: #8993ad;
    --accent: #0d9488;
    --accent-dim: #0f766e;
    --accent-soft: rgba(13, 148, 136, 0.08);
    --shadow: 0 20px 60px -20px rgba(30, 41, 59, 0.15);
  }
}

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

html { scroll-behavior: smooth; }

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

.container {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 clamp(1.25rem, 4vw, 2.5rem);
}

.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--accent);
  color: #04140f;
  padding: 0.75rem 1.25rem;
  z-index: 1000;
  border-radius: 0 0 8px 0;
}
.skip-link:focus { left: 0; }

.bg-grid {
  position: fixed;
  inset: 0;
  z-index: -1;
  background-image:
    radial-gradient(circle at 15% 10%, var(--accent-soft), transparent 40%),
    radial-gradient(circle at 85% 30%, var(--accent-soft), transparent 35%);
  pointer-events: none;
}

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

ul { list-style: none; }

img { max-width: 100%; display: block; }

/* ---------- Header / Nav ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(12px);
  background: color-mix(in srgb, var(--bg) 80%, transparent);
  border-bottom: 1px solid var(--border);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
}

.logo {
  font-family: var(--mono);
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text);
}
.logo span { color: var(--accent); }

.nav-links {
  display: flex;
  align-items: center;
  gap: 2rem;
}

.nav-link {
  font-size: 0.92rem;
  color: var(--text-dim);
  font-weight: 500;
  position: relative;
  padding: 0.3rem 0;
  transition: color 0.2s ease;
}
.nav-link::after {
  content: "";
  position: absolute;
  left: 0; bottom: -2px;
  width: 0; height: 2px;
  background: var(--accent);
  transition: width 0.25s ease;
}
.nav-link:hover { color: var(--text); }
.nav-link:hover::after { width: 100%; }
.nav-link.active { color: var(--accent); }

.nav-cta {
  border: 1px solid var(--accent);
  color: var(--accent) !important;
  padding: 0.45rem 1rem !important;
  border-radius: 8px;
}
.nav-cta::after { display: none; }
.nav-cta:hover { background: var(--accent-soft); }

.theme-toggle {
  background: none;
  border: 1px solid var(--border);
  color: var(--text-dim);
  width: 38px;
  height: 38px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: border-color 0.2s ease, color 0.2s ease;
}
.theme-toggle:hover { color: var(--accent); border-color: var(--accent); }
.theme-toggle svg { width: 18px; height: 18px; }
.theme-toggle .icon-moon { display: none; }
:root[data-theme="light"] .theme-toggle .icon-sun { display: none; }
:root[data-theme="light"] .theme-toggle .icon-moon { display: block; }

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
}
.nav-toggle span {
  width: 22px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: transform 0.25s ease, opacity 0.25s ease;
}

/* ---------- Hero ---------- */
.hero {
  min-height: calc(100vh - 68px);
  display: flex;
  align-items: center;
  gap: 3rem;
  padding-top: 3rem;
  padding-bottom: 3rem;
}

.hero-text { flex: 1.3; }

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

.hero-text h1 {
  font-size: clamp(2.4rem, 6vw, 3.6rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.1;
  margin-bottom: 0.4rem;
}

.hero-role {
  font-size: clamp(1.3rem, 3vw, 1.8rem);
  color: var(--text-dim);
  font-weight: 600;
  margin-bottom: 1.5rem;
}

.hero-summary {
  max-width: 640px;
  color: var(--text-dim);
  font-size: 1.05rem;
  margin-bottom: 2.2rem;
}
.hero-summary strong { color: var(--text); }

.hero-actions { display: flex; gap: 1rem; flex-wrap: wrap; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.85rem 1.6rem;
  border-radius: 10px;
  font-weight: 600;
  font-size: 0.95rem;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}
.btn-primary {
  background: var(--accent);
  color: #04140f;
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 12px 24px -8px var(--accent-soft); }
.btn-ghost {
  border: 1px solid var(--border);
  color: var(--text);
}
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); transform: translateY(-2px); }

.hero-photo { flex: 1; display: flex; justify-content: center; }

.photo-frame {
  position: relative;
  width: min(320px, 70vw);
  border-radius: 20px;
  overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}
.photo-frame::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(160deg, var(--accent-soft), transparent 60%);
  mix-blend-mode: overlay;
}
.photo-frame img { width: 100%; height: auto; }

/* ---------- Sections ---------- */
.section {
  padding: clamp(4rem, 8vw, 6rem) clamp(1.25rem, 4vw, 2.5rem);
  scroll-margin-top: 80px;
}

.section-title {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 700;
  margin-bottom: 2.5rem;
  white-space: nowrap;
}
.section-title .tag {
  font-family: var(--mono);
  color: var(--accent);
  font-size: 1.1rem;
  font-weight: 600;
}
.section-title::after {
  content: "";
  height: 1px;
  flex: 1;
  background: var(--border);
  margin-left: 0.5rem;
}

.section-lede {
  color: var(--text-dim);
  max-width: 640px;
  margin-bottom: 2.5rem;
}

/* ---------- About ---------- */
.about-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 3rem;
  align-items: start;
}
.about-text p { color: var(--text-dim); margin-bottom: 1.1rem; }
.about-text p:last-child { margin-bottom: 0; }

.about-facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 1.25rem;
}
.about-facts li {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  text-align: center;
}
.fact-num {
  display: block;
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--accent);
  font-family: var(--mono);
}
.fact-label {
  display: block;
  font-size: 0.8rem;
  color: var(--text-faint);
  margin-top: 0.3rem;
}

/* ---------- Skills ---------- */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
}
.skill-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  transition: border-color 0.2s ease, transform 0.2s ease;
}
.skill-card:hover { border-color: var(--accent-dim); transform: translateY(-3px); }
.skill-card h3 {
  font-size: 0.95rem;
  color: var(--accent);
  margin-bottom: 1rem;
  font-family: var(--mono);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.pill-list { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.pill {
  font-size: 0.82rem;
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  color: var(--text-dim);
}
.pill-star {
  color: var(--text);
  border-color: var(--accent-dim);
  background: var(--accent-soft);
}
.pill-star::after {
  content: " \2605";
  color: var(--accent);
  font-size: 0.75em;
}

/* ---------- Inline links (About, prose) ---------- */
.inline-link {
  color: var(--accent);
  font-weight: 600;
  border-bottom: 1px solid var(--accent-dim);
  transition: color 0.2s ease, border-color 0.2s ease;
}
.inline-link:hover { color: var(--accent-dim); }

/* ---------- Ventures ---------- */
.venture-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem;
  transition: border-color 0.2s ease;
}
.venture-card:hover { border-color: var(--accent-dim); }
.venture-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1.25rem;
}
.venture-head h3 { font-size: 1.3rem; font-weight: 700; }
.venture-tagline {
  color: var(--accent);
  font-size: 0.92rem;
  font-weight: 600;
  margin-top: 0.3rem;
}
.venture-visit {
  padding: 0.6rem 1.1rem;
  font-size: 0.88rem;
  white-space: nowrap;
}
.venture-desc {
  color: var(--text-dim);
  margin-bottom: 1.25rem;
  max-width: 760px;
}
.venture-pills { margin-top: 0.25rem; }

/* ---------- Timeline (Experience) ---------- */
.timeline {
  position: relative;
  padding-left: 2rem;
}
.timeline::before {
  content: "";
  position: absolute;
  left: 5px;
  top: 6px;
  bottom: 6px;
  width: 2px;
  background: var(--border);
}
.timeline-item {
  position: relative;
  margin-bottom: 2.5rem;
}
.timeline-item:last-child { margin-bottom: 0; }
.timeline-marker {
  position: absolute;
  left: -2rem;
  top: 6px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--bg);
  border: 2px solid var(--accent);
}
.timeline-content {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem 1.75rem;
  transition: border-color 0.2s ease;
}
.timeline-content:hover { border-color: var(--accent-dim); }
.timeline-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.5rem 1rem;
}
.timeline-head h3 { font-size: 1.15rem; font-weight: 700; }
.timeline-date {
  font-family: var(--mono);
  font-size: 0.82rem;
  color: var(--accent);
  white-space: nowrap;
}
.timeline-org {
  color: var(--text-dim);
  font-weight: 600;
  margin: 0.2rem 0 1rem;
}
.timeline-list li {
  position: relative;
  padding-left: 1.2rem;
  color: var(--text-dim);
  margin-bottom: 0.6rem;
  font-size: 0.95rem;
}
.timeline-list li:last-child { margin-bottom: 0; }
.timeline-list li::before {
  content: "▹";
  position: absolute;
  left: 0;
  color: var(--accent);
}

/* ---------- Education ---------- */
.edu-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.5rem;
}
.edu-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  transition: border-color 0.2s ease, transform 0.2s ease;
}
.edu-card:hover { border-color: var(--accent-dim); transform: translateY(-3px); }
.edu-card h3 { font-size: 1.05rem; margin-bottom: 0.4rem; }
.edu-org { color: var(--text-dim); font-size: 0.92rem; }
.edu-date {
  display: inline-block;
  margin-top: 0.6rem;
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--accent);
}
.edu-desc { margin-top: 0.75rem; color: var(--text-dim); font-size: 0.9rem; }

/* ---------- Research ---------- */
.scholar-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 1.25rem;
  max-width: 500px;
  margin-bottom: 2.5rem;
}
.scholar-stats li {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.1rem;
  text-align: center;
}

.research-list { display: flex; flex-direction: column; gap: 1.25rem; }
.research-item {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem 1.75rem;
  transition: border-color 0.2s ease;
}
.research-item:hover { border-color: var(--accent-dim); }
.research-main h3 { font-size: 1.02rem; font-weight: 700; margin-bottom: 0.4rem; }
.research-authors { color: var(--text-dim); font-size: 0.9rem; margin-bottom: 0.3rem; }
.research-authors strong { color: var(--text); }
.research-venue { color: var(--text-faint); font-size: 0.85rem; font-style: italic; }
.research-cite {
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--accent);
  border: 1px solid var(--accent-dim);
  background: var(--accent-soft);
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
  white-space: nowrap;
}

/* ---------- Accomplishments ---------- */
.accomplishments-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem;
}
.accomplishment-card {
  background: var(--surface);
  border-left: 3px solid var(--accent);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 1.5rem 1.75rem;
  color: var(--text-dim);
}
.accomplishment-card strong { color: var(--text); }

/* ---------- Awards ---------- */
.awards-list { display: flex; flex-direction: column; gap: 1.25rem; }
.award-item {
  display: flex;
  gap: 1.5rem;
  align-items: flex-start;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1.75rem;
  transition: border-color 0.2s ease;
}
.award-item:hover { border-color: var(--accent-dim); }
.award-year {
  font-family: var(--mono);
  font-weight: 700;
  color: var(--accent);
  min-width: 3.5rem;
  font-size: 1.05rem;
}
.award-body h3 { font-size: 1.02rem; margin-bottom: 0.3rem; }
.award-body p { color: var(--text-dim); font-size: 0.92rem; }

/* ---------- Connect ---------- */
.connect-links { display: flex; gap: 1rem; flex-wrap: wrap; }
.connect-link {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.9rem 1.5rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  font-weight: 600;
  transition: border-color 0.2s ease, transform 0.2s ease, color 0.2s ease;
}
.connect-link svg { width: 20px; height: 20px; }
.connect-link:hover { border-color: var(--accent); color: var(--accent); transform: translateY(-2px); }

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 2rem 0;
  margin-top: 2rem;
}
.footer-inner {
  text-align: center;
  color: var(--text-faint);
  font-size: 0.85rem;
}

/* ---------- Back to top ---------- */
.back-to-top {
  position: fixed;
  bottom: 1.75rem;
  right: 1.75rem;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--accent);
  color: #04140f;
  border: none;
  display: grid;
  place-items: center;
  cursor: pointer;
  box-shadow: var(--shadow);
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px);
  transition: opacity 0.25s ease, transform 0.25s ease;
  z-index: 90;
}
.back-to-top.visible { opacity: 1; pointer-events: auto; transform: translateY(0); }
.back-to-top svg { width: 20px; height: 20px; }

/* ---------- Reveal-on-scroll (below-the-fold content) ---------- */
.reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.reveal.visible { opacity: 1; transform: translateY(0); }

/* ---------- Hero entrance (pure CSS, no JS/observer dependency) ---------- */
.hero-anim {
  opacity: 0;
  transform: translateY(14px);
  animation: heroIn 0.7s ease forwards;
  animation-delay: var(--delay, 0s);
}

@keyframes heroIn {
  to { opacity: 1; transform: translateY(0); }
}

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

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
  .hero { flex-direction: column-reverse; text-align: center; padding-top: 2rem; }
  .hero-actions { justify-content: center; }
  .hero-summary { margin-left: auto; margin-right: auto; }
  .about-grid { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
  .nav-toggle { display: flex; }
  .nav-links {
    position: fixed;
    top: 68px;
    left: 0;
    right: 0;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    padding: 0.5rem 0;
    transform: translateY(-120%);
    transition: transform 0.3s ease;
  }
  .nav-links.open { transform: translateY(0); }
  .nav-links li { width: 100%; }
  .nav-link { display: block; width: 100%; padding: 0.9rem 1.5rem; }
  .nav-link::after { display: none; }
  .nav-cta { margin: 0.5rem 1.5rem; width: calc(100% - 3rem); }
  .timeline { padding-left: 1.25rem; }
  .timeline-marker { left: -1.25rem; }
}
