/* ---------- tokens ---------- */
:root {
  --bg: #fbfbf9;
  --bg-alt: #f2f1ec;
  --surface: #ffffff;
  --text: #16161a;
  --text-soft: #55555f;
  --text-faint: #8a8a94;
  --line: #e2e1da;
  --accent: #c2410c;
  --accent-soft: rgba(194, 65, 12, 0.1);
  --shadow: 0 1px 2px rgba(20, 20, 25, 0.04), 0 8px 24px rgba(20, 20, 25, 0.05);
  --radius: 14px;
  --max: 1080px;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
}

[data-theme="dark"] {
  --bg: #0e0e11;
  --bg-alt: #141419;
  --surface: #1a1a20;
  --text: #f0efeb;
  --text-soft: #a9a8b2;
  --text-faint: #6e6e78;
  --line: #26262e;
  --accent: #fb923c;
  --accent-soft: rgba(251, 146, 60, 0.13);
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 8px 24px rgba(0, 0, 0, 0.3);
}

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

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  transition: background 0.3s ease, color 0.3s ease;
}

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

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

/* ---------- nav ---------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(12px);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  border-bottom: 1px solid transparent;
  transition: border-color 0.25s ease;
}
.nav.scrolled { border-bottom-color: var(--line); }

.nav-inner {
  display: flex;
  align-items: center;
  gap: 20px;
  height: 62px;
}

.brand {
  font-weight: 700;
  letter-spacing: 0.06em;
  font-size: 15px;
  border: 1.5px solid var(--text);
  border-radius: 8px;
  padding: 3px 8px;
}

.nav-links {
  display: flex;
  gap: 26px;
  margin-left: auto;
  font-size: 14px;
  color: var(--text-soft);
}
.nav-links a { position: relative; padding: 4px 0; transition: color 0.2s; }
.nav-links a::after {
  content: "";
  position: absolute;
  left: 0; bottom: 0;
  width: 0; height: 1.5px;
  background: var(--accent);
  transition: width 0.25s ease;
}
.nav-links a:hover,
.nav-links a.active { color: var(--text); }
.nav-links a.active::after,
.nav-links a:hover::after { width: 100%; }

.theme-toggle {
  background: none;
  border: 1px solid var(--line);
  border-radius: 999px;
  width: 34px; height: 34px;
  color: var(--text-soft);
  cursor: pointer;
  font-size: 15px;
  display: grid;
  place-items: center;
  transition: border-color 0.2s, color 0.2s, transform 0.2s;
}
.theme-toggle:hover { color: var(--accent); border-color: var(--accent); transform: rotate(180deg); }

.menu-btn {
  display: none;
  flex-direction: column;
  gap: 4px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
}
.menu-btn span {
  width: 20px; height: 1.8px;
  background: var(--text);
  transition: transform 0.25s ease, opacity 0.2s ease;
}
.menu-btn[aria-expanded="true"] span:nth-child(1) { transform: translateY(5.8px) rotate(45deg); }
.menu-btn[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.menu-btn[aria-expanded="true"] span:nth-child(3) { transform: translateY(-5.8px) rotate(-45deg); }

/* ---------- hero ---------- */
.hero { padding: 120px 0 100px; }

.eyebrow {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 18px;
}

.hero h1 {
  font-size: clamp(48px, 9vw, 92px);
  line-height: 1.02;
  letter-spacing: -0.035em;
  font-weight: 700;
  margin-bottom: 24px;
}

.lede {
  font-size: clamp(17px, 2.2vw, 21px);
  color: var(--text-soft);
  max-width: 620px;
  margin-bottom: 36px;
}
.lede strong { color: var(--text); font-weight: 600; }

.hero-cta { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 44px; }

.btn {
  display: inline-block;
  padding: 11px 22px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 14.5px;
  font-weight: 500;
  background: var(--surface);
  transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}
.btn:hover { transform: translateY(-2px); border-color: var(--accent); }
.btn-primary { background: var(--text); color: var(--bg); border-color: var(--text); }
.btn-primary:hover { background: var(--accent); border-color: var(--accent); color: #fff; }

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 28px;
  list-style: none;
  font-family: var(--mono);
  font-size: 13px;
  color: var(--text-faint);
}
.hero-meta a { border-bottom: 1px solid var(--line); padding-bottom: 2px; transition: color 0.2s, border-color 0.2s; }
.hero-meta a:hover { color: var(--accent); border-color: var(--accent); }

/* ---------- sections ---------- */
.section { padding: 88px 0; }
.section.alt { background: var(--bg-alt); }

.section-title {
  font-size: clamp(26px, 4vw, 34px);
  letter-spacing: -0.02em;
  margin-bottom: 42px;
  display: flex;
  align-items: baseline;
  gap: 14px;
}
.section-title span {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--accent);
  font-weight: 500;
}

.big-text {
  font-size: clamp(19px, 2.6vw, 24px);
  line-height: 1.5;
  letter-spacing: -0.015em;
  margin-bottom: 20px;
}

.about-body { max-width: 760px; margin-bottom: 56px; }
.statement {
  font-size: clamp(24px, 3.6vw, 36px);
  line-height: 1.28;
  letter-spacing: -0.025em;
  font-weight: 600;
  margin-bottom: 16px;
}
.lede-sm { font-size: clamp(16px, 2vw, 18px); color: var(--text-soft); }

.sub-head {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-faint);
  margin-bottom: 20px;
}

.capabilities {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}
.capability {
  background: var(--bg);
  padding: 26px 24px;
  transition: background 0.25s ease;
}
.capability:hover { background: var(--surface); }
.capability h4 {
  font-size: 15.5px;
  letter-spacing: -0.01em;
  margin-bottom: 8px;
  position: relative;
  padding-left: 16px;
}
.capability h4::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.55em;
  width: 7px;
  height: 7px;
  border-radius: 2px;
  background: var(--accent);
}
.capability p { font-size: 14.5px; color: var(--text-soft); }

/* ---------- experience ---------- */
.job-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  flex-wrap: wrap;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--line);
}
.job-head h3 { font-size: 21px; letter-spacing: -0.02em; }
.job-org { color: var(--text-soft); font-size: 14.5px; }
.chip {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text-soft);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 12px;
  white-space: nowrap;
}

.filters { display: flex; gap: 8px; flex-wrap: wrap; margin: 24px 0 26px; }
.filter {
  font: inherit;
  font-size: 13.5px;
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--text-soft);
  cursor: pointer;
  transition: all 0.2s ease;
}
.filter:hover { color: var(--text); border-color: var(--text-faint); }
.filter.is-active { background: var(--accent); border-color: var(--accent); color: #fff; }

.cards {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
}
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease, opacity 0.25s ease;
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow); border-color: color-mix(in srgb, var(--accent) 40%, var(--line)); }
.card h4 { font-size: 16px; margin-bottom: 8px; letter-spacing: -0.01em; }
.card p { font-size: 14.5px; color: var(--text-soft); }
.card strong { color: var(--text); }
.card.is-hidden { display: none; }

.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 14px; }
.tags span {
  font-family: var(--mono);
  font-size: 11px;
  padding: 3px 9px;
  border-radius: 6px;
  background: var(--accent-soft);
  color: var(--accent);
}

/* ---------- projects ---------- */
.project {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 40px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 34px;
  align-items: center;
}
.project h3 { font-size: 24px; letter-spacing: -0.02em; }
.project-sub { color: var(--text-soft); margin-bottom: 18px; font-size: 15px; }
.ticks { list-style: none; display: grid; gap: 10px; }
.ticks li {
  position: relative;
  padding-left: 22px;
  font-size: 14.5px;
  color: var(--text-soft);
}
.ticks li::before {
  content: "▸";
  position: absolute;
  left: 0;
  color: var(--accent);
}
code {
  font-family: var(--mono);
  font-size: 12.5px;
  background: var(--bg-alt);
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 1px 5px;
  color: var(--text);
}
.project-visual { display: flex; justify-content: center; }
.tree {
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.9;
  color: var(--text-soft);
  background: var(--bg-alt);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 20px;
  overflow-x: auto;
  width: 100%;
}

/* ---------- skills ---------- */
.skills { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 30px; }
.skill-group h3 {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-faint);
  margin-bottom: 14px;
  font-family: var(--mono);
  font-weight: 500;
}
.pills { display: flex; flex-wrap: wrap; gap: 8px; }
.pills span {
  font-size: 13.5px;
  padding: 5px 13px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  transition: border-color 0.2s, color 0.2s, transform 0.2s;
}
.pills span:hover { border-color: var(--accent); color: var(--accent); transform: translateY(-2px); }

.education { margin-top: 54px; padding-top: 30px; border-top: 1px solid var(--line); }
.education h3 {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-faint);
  font-family: var(--mono);
  font-weight: 500;
  margin-bottom: 16px;
}
.edu-row { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.edu-row p { color: var(--text-soft); font-size: 14.5px; }
.edu-meta { display: grid; gap: 2px; text-align: right; font-size: 13.5px; color: var(--text-faint); font-family: var(--mono); }

/* ---------- contact ---------- */
.contact .big-text { max-width: 620px; color: var(--text-soft); margin-bottom: 32px; }
.contact-links { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 14px; }
.contact-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  background: var(--surface);
  display: grid;
  gap: 4px;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}
.contact-card:hover { transform: translateY(-3px); border-color: var(--accent); box-shadow: var(--shadow); }
.contact-label { font-family: var(--mono); font-size: 11px; text-transform: uppercase; letter-spacing: 0.1em; color: var(--text-faint); }
.contact-value { font-size: 15px; font-weight: 500; word-break: break-word; }

/* ---------- footer ---------- */
footer { border-top: 1px solid var(--line); padding: 26px 0; }
.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  font-size: 13.5px;
  color: var(--text-faint);
  flex-wrap: wrap;
}
.footer-inner a:hover { color: var(--accent); }

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

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  * { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

/* ---------- responsive ---------- */
@media (max-width: 860px) {
  .project { grid-template-columns: 1fr; gap: 32px; }
  .project-visual { order: -1; }
}

@media (max-width: 680px) {
  .menu-btn { display: flex; }
  .nav-links {
    position: absolute;
    top: 62px;
    left: 0;
    right: 0;
    flex-direction: column;
    gap: 0;
    background: var(--bg);
    border-bottom: 1px solid var(--line);
    padding: 6px 24px 16px;
    display: none;
  }
  .nav-links.open { display: flex; }
  .nav-links a { padding: 11px 0; border-bottom: 1px solid var(--line); }
  .nav-links a:last-child { border-bottom: none; }
  .nav-inner { gap: 12px; }
  .theme-toggle { margin-left: auto; }
  .hero { padding: 72px 0 64px; }
  .section { padding: 62px 0; }
  .edu-meta { text-align: left; }
}
