@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

:root {
  --font-sora: 'Sora', sans-serif;
  --font-body: 'IBM Plex Sans', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  --bg: oklch(0.16 0.015 255);
  --gradient-top: oklch(0.34 0.06 248);
  --grid-line: oklch(0.55 0.05 240 / 0.18);

  --text: oklch(0.88 0.01 250);
  --text-crisp: oklch(0.95 0.005 250);
  --text-bright: oklch(0.92 0.005 250);
  --text-bright-alt: oklch(0.9 0.01 250);
  --text-dim: oklch(0.6 0.02 250);
  --text-dim-alt: oklch(0.65 0.015 250);
  --text-body: oklch(0.72 0.015 250);
  --text-muted: oklch(0.62 0.015 250);
  --text-muted-2: oklch(0.58 0.015 250);
  --text-faint: oklch(0.5 0.015 250);
  --text-quote: oklch(0.78 0.015 250);
  --text-highlight: oklch(0.85 0.09 205);

  --accent: oklch(0.65 0.08 240);
  --accent-text: oklch(0.75 0.06 240);
  --accent-bg-soft: oklch(0.55 0.05 240 / 0.12);
  --accent-border-soft: oklch(0.55 0.05 240 / 0.4);
  --accent-bg-strong: oklch(0.55 0.05 240 / 0.15);
  --accent-bg-hover: oklch(0.55 0.05 240 / 0.18);
  --accent-line: oklch(0.55 0.05 240 / 0.3);

  --card-bg: oklch(0.2 0.015 255);
  --card-border: oklch(0.4 0.03 250 / 0.3);
  --panel-bg: oklch(0.19 0.015 255);
  --panel-border: oklch(0.4 0.03 250 / 0.5);
  --shadow-menu: oklch(0.1 0.02 250 / 0.55);
  --quote-bg: oklch(0.25 0.02 250);
  --course-item-bg: oklch(0.18 0.015 255);
  --course-item-border: oklch(0.4 0.03 250 / 0.2);
  --stat-header-bg: oklch(0.24 0.02 250);
  --dash-border: oklch(0.4 0.03 250 / 0.5);
  --slot-text: oklch(0.5 0.02 250);

  --status-dot: oklch(0.75 0.1 150);

  --warn-bg: oklch(0.22 0.03 80 / 0.55);
  --warn-border: oklch(0.6 0.09 80 / 0.45);
  --warn-border-strong: oklch(0.75 0.13 80);
  --warn-text: oklch(0.93 0.02 85);
  --warn-text-dim: oklch(0.8 0.02 85);

  --pill-border: oklch(0.4 0.03 250 / 0.4);
  --pill-text: oklch(0.65 0.02 250);
  --pill-active-bg: oklch(0.65 0.08 240);
  --pill-active-text: oklch(0.14 0.02 250);

  --menu-item-text: oklch(0.68 0.02 250);
}

* { box-sizing: border-box; }

html, body { margin: 0; }

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
}

::selection { background: oklch(0.55 0.06 240 / 0.35); }

a { color: inherit; }

.app {
  min-height: 100vh;
  width: 100%;
  position: relative;
  overflow-x: hidden;
}

.bg-gradient {
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 33vh;
  background: linear-gradient(180deg, var(--gradient-top) 0%, var(--bg) 100%);
  pointer-events: none;
}

.bg-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 48px 48px;
  pointer-events: none;
}

/* ---------- nav ---------- */

.nav {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px 48px;
  background: oklch(0.16 0.015 255 / 0.85);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--card-border);
}

.logo {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  color: var(--text-bright-alt);
  background: none;
  border: none;
  padding: 0;
}

.logo-caret { color: var(--accent); }
.logo-cursor { color: var(--accent); animation: fadeIn 1s ease infinite alternate; }

.nav-links {
  display: flex;
  gap: 4px;
  align-items: center;
  max-width: 62vw;
}

.nav-item {
  padding: 9px 14px;
  font-family: var(--font-mono);
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
  flex-shrink: 0;
  border-radius: 4px;
  color: var(--pill-text);
  display: flex;
  align-items: center;
  background: none;
  border: none;
}

.nav-item:hover { color: var(--text-bright-alt); }

.nav-item.is-active {
  background: var(--accent-bg-strong);
  color: var(--text-bright-alt);
}

.nav-dropdown { position: relative; }

.caret { margin-left: 7px; font-size: 10px; display: inline-block; }

.dropdown-menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  min-width: 190px;
  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
  border-radius: 8px;
  padding: 6px;
  box-shadow: 0 12px 32px var(--shadow-menu);
  z-index: 20;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.dropdown-menu.is-wide { min-width: 210px; }
.dropdown-menu[hidden] { display: none; }

.dropdown-item {
  padding: 10px 14px;
  border-radius: 6px;
  cursor: pointer;
  font-family: var(--font-mono);
  font-size: 12.5px;
  font-weight: 500;
  color: var(--menu-item-text);
  background: transparent;
}

.dropdown-item:hover { background: var(--accent-bg-hover); color: var(--text-crisp); }

.dropdown-item.is-active { color: var(--text-crisp); background: var(--accent-bg-hover); }

/* ---------- about sub-nav pills ---------- */

.subnav[hidden] { display: none; }

.subnav {
  position: relative;
  max-width: 980px;
  margin: 0 auto;
  padding: 64px 48px 0;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.pill {
  padding: 15px 28px;
  font-family: var(--font-mono);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  border-radius: 6px;
  border: 1px solid var(--pill-border);
  color: var(--pill-text);
  transition: all 0.2s;
  background: transparent;
}

.pill:hover { color: var(--text-bright-alt); border-color: var(--accent); }

.pill.is-active {
  color: var(--pill-active-text);
  background: var(--pill-active-bg);
  border-color: var(--pill-active-bg);
}

/* ---------- page sections ---------- */

.page-section {
  animation: fadeIn 0.45s ease;
  position: relative;
  margin: 0 auto;
}

.page-section[hidden] { display: none; }

#page-home, #page-education, #page-experience {
  padding: 44px 48px 100px;
}
#page-home { max-width: 980px; }
#page-education, #page-experience { max-width: 900px; }

#page-data, #page-stats, #page-ai {
  padding: 100px 48px;
  max-width: 1100px;
}

#page-faq, #page-contact {
  padding: 100px 48px;
  max-width: 900px;
}

h1, h2 { margin: 0; }

.page-title {
  font-family: var(--font-sora);
  font-size: 34px;
  font-weight: 800;
  margin: 0 0 8px;
  color: var(--text-crisp);
}

.page-kicker {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text-dim);
  margin-bottom: 44px;
}

/* ---------- home hero ---------- */

.hero-row {
  display: flex;
  align-items: center;
  gap: 48px;
  margin-bottom: 40px;
  flex-wrap: wrap;
}

.hero-copy { flex: 1; min-width: 320px; }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 12.5px;
  font-weight: 600;
  padding: 8px 14px;
  border-radius: 6px;
  background: var(--accent-bg-soft);
  border: 1px solid var(--accent-border-soft);
  color: var(--accent-text);
  margin-bottom: 28px;
}

.badge-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--status-dot);
  display: inline-block;
}

.hero-title {
  font-family: var(--font-sora);
  font-size: 44px;
  line-height: 1.15;
  font-weight: 800;
  margin: 0;
  max-width: 820px;
  color: var(--text-crisp);
}

.hero-title .hl { color: var(--text-highlight); }

.notice {
  background: var(--warn-bg);
  border: 1px solid var(--warn-border);
  border-left: 3px solid var(--warn-border-strong);
  border-radius: 10px;
  padding: 22px 26px;
  margin: 0 0 40px;
  max-width: 720px;
}

.notice-row {
  display: flex;
  gap: 18px;
  align-items: flex-start;
}

.notice-body { flex: 1; min-width: 220px; }

.notice-title {
  font-family: var(--font-sora);
  font-size: 17px;
  font-weight: 700;
  color: var(--warn-text);
  margin-bottom: 10px;
}

.notice-text {
  font-size: 15px;
  line-height: 1.65;
  color: var(--warn-text-dim);
  margin: 0 0 10px;
}
.notice-text:last-child { margin-bottom: 0; }
.notice-text strong { color: var(--warn-text); }

.whoami {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 12px;
  padding: 28px 32px;
  font-family: var(--font-mono);
  font-size: 14px;
  line-height: 1.9;
}

.whoami-prompt { color: var(--accent-text); margin-bottom: 14px; }
.whoami-name { color: var(--text-bright); font-weight: 700; }

.whoami-label {
  color: var(--text-dim);
  font-size: 12px;
  letter-spacing: 0.04em;
  margin-bottom: 8px;
}

.whoami-value {
  color: var(--text-body);
  margin-bottom: 18px;
}
.whoami-value:last-child { margin-bottom: 0; }

.whoami-status {
  color: var(--text-body);
  display: flex;
  align-items: center;
  gap: 8px;
}

.status-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--status-dot);
  display: inline-block;
}

/* ---------- cards / quote rows (shared) ---------- */

.card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 12px;
  padding: 30px;
}

.card-list {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.card-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 10px;
  gap: 12px;
  flex-wrap: wrap;
}

.card-title {
  font-family: var(--font-sora);
  font-size: 26px;
  font-weight: 700;
  color: var(--text-crisp);
}

.card-pill {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 6px;
  background: var(--accent-bg-soft);
  border: 1px solid var(--accent-border-soft);
  color: var(--accent-text);
  white-space: nowrap;
}

.card-subtitle {
  font-size: 14px;
  color: var(--text-dim);
  margin-bottom: 14px;
}

.quote-row {
  display: flex;
  gap: 18px;
  align-items: center;
  background: var(--quote-bg);
  border-left: 3px solid var(--accent);
  border-radius: 8px;
  padding: 18px 22px;
}

.quote-text {
  flex: 1;
  min-width: 220px;
  font-style: italic;
  font-size: 15px;
  line-height: 1.6;
  color: var(--text-quote);
}

.card .quote-row {
  margin: 0 0 24px;
}

.intro-quote {
  margin: 0 0 44px;
}
#page-stats .intro-quote { margin-bottom: 36px; }
#page-ai .intro-quote { margin-bottom: 36px; }

/* ---------- education ---------- */

.courses {
  border-top: 1px solid var(--card-border);
  padding-top: 18px;
}

.courses-label {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  color: var(--accent-text);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin-bottom: 12px;
}

.courses-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.course-item {
  padding: 12px 16px;
  border-radius: 8px;
  background: var(--course-item-bg);
  border: 1px solid var(--course-item-border);
}

.course-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 3px;
}

.course-blurb {
  font-size: 13px;
  color: var(--text-muted-2);
}

/* ---------- experience ---------- */

.job-card {
  display: flex;
  gap: 26px;
  flex-wrap: wrap;
}

.job-main { flex: 1; min-width: 260px; }

.job-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 12px;
  gap: 12px;
  flex-wrap: wrap;
}

.job-role {
  font-family: var(--font-sora);
  font-size: 20px;
  font-weight: 700;
  color: var(--text-bright);
}

.job-company {
  font-size: 14px;
  color: var(--text-dim);
  margin-bottom: 14px;
}

.job-bullets {
  margin: 0;
  padding-left: 20px;
  font-size: 15px;
  line-height: 1.7;
  color: var(--text-body);
}

/* ---------- data pipeline ---------- */

.pipeline {
  position: relative;
  display: flex;
  flex-direction: column;
  padding-left: 4px;
}

.pipeline-step {
  position: relative;
  display: flex;
  gap: 24px;
  padding-bottom: 36px;
  align-items: flex-start;
}

.pipeline-connector {
  position: absolute;
  top: 48px;
  bottom: 0;
  left: 23px;
  width: 2px;
  background: var(--accent-line);
}

.pipeline-num {
  width: 48px;
  height: 48px;
  border-radius: 10px;
  background: var(--accent-bg-soft);
  border: 1px solid var(--accent);
  z-index: 1;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-text);
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 18px;
}

.pipeline-body { flex: 1; padding-bottom: 4px; }

.pipeline-label {
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 600;
  color: var(--accent-text);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin-bottom: 2px;
}

.pipeline-slots {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-top: 10px;
}

.project-slot {
  background: var(--card-bg);
  border-radius: 10px;
  overflow: hidden;
  border: 1px dashed var(--dash-border);
  height: 90px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.project-slot span {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--slot-text);
}

/* ---------- stats ---------- */

.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

.stat-course-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 12px;
  overflow: hidden;
  transition: border-color 0.2s;
}

.stat-course-card:hover { border-color: var(--accent); }

.stat-course-shot {
  height: 150px;
  background: var(--stat-header-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  border-bottom: 1px solid var(--card-border);
}

.stat-course-shot span {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-dim);
}

.stat-course-body { padding: 22px; }

.stat-course-code {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  color: var(--accent-text);
  margin-bottom: 6px;
}

.stat-course-name {
  font-family: var(--font-sora);
  font-size: 19px;
  font-weight: 700;
  color: var(--text-bright);
  margin-bottom: 8px;
}

.stat-course-desc {
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-muted);
}

/* ---------- ai lab ---------- */

.ai-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 36px;
}

.ai-active-label {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--accent-text);
  margin-bottom: 16px;
}

.ai-slots {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.ai-slot {
  background: var(--card-bg);
  border: 1px dashed var(--dash-border);
  border-radius: 10px;
  height: 150px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ai-slot span {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--slot-text);
}

/* ---------- faq ---------- */

.faq-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.faq-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 10px;
  padding: 24px 26px;
}

.faq-q {
  font-family: var(--font-sora);
  font-size: 17px;
  font-weight: 700;
  margin-bottom: 10px;
  color: var(--text-bright);
}

.faq-a {
  font-size: 15px;
  line-height: 1.6;
  color: oklch(0.65 0.015 250);
}

/* ---------- contact ---------- */

.contact-intro {
  font-size: 16px;
  line-height: 1.6;
  color: var(--text-muted);
  max-width: 560px;
  margin: 0 0 44px;
}

.contact-links {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.contact-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  text-decoration: none;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 10px;
  padding: 20px 24px;
  transition: border-color 0.15s;
}

.contact-link:hover { border-color: var(--accent); }

.contact-link-label {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  color: var(--accent-text);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 4px;
}

.contact-link-value {
  font-family: var(--font-sora);
  font-size: 17px;
  font-weight: 700;
  color: var(--text-bright-alt);
}

.contact-link-arrow {
  font-size: 18px;
  color: var(--accent);
  font-family: monospace;
}

/* ---------- footer ---------- */

.site-footer {
  position: relative;
  padding: 40px 48px;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-faint);
  border-top: 1px solid var(--card-border);
}

/* ---------- photos ---------- */

.eduphoto {
  width: 58px;
  height: 58px;
  flex-shrink: 0;
  border-radius: 50%;
  object-fit: cover;
  display: block;
  background: oklch(0.24 0.02 250);
}

@media (max-width: 640px) {
  .nav { padding: 16px 20px; flex-wrap: wrap; gap: 10px; }
  .nav-links { max-width: none; flex-wrap: wrap; }

  #page-home, #page-education, #page-experience,
  #page-data, #page-stats, #page-ai,
  #page-faq, #page-contact {
    padding-left: 20px;
    padding-right: 20px;
  }
  .subnav { padding-left: 20px; padding-right: 20px; }
  .site-footer { padding: 32px 20px; }

  .page-title { font-size: 28px; }
  .hero-title { font-size: 32px; }
  .stats-grid, .pipeline-slots, .ai-slots { grid-template-columns: 1fr; }

  .notice-row, .quote-row { flex-wrap: wrap; }
  .notice-body, .quote-text { min-width: 0; }

  #ai-menu { left: auto; right: 0; }

  .pipeline-step { gap: 16px; }
  .pipeline-connector { left: 23px; }
}
