:root {
  --bg: #eef0f6;
  --surface: #ffffff;
  --text: #12142a;
  --muted: #616783;
  --line: #d3d7e7;
  --accent: #2d3cf0;
  --accent-soft: #dde1ff;
  --mint: #c6f0d8;
  --mint-ink: #17613c;
  --display: "Bricolage Grotesque", sans-serif;
  --body: "Instrument Sans", sans-serif;
  --mono: "JetBrains Mono", monospace;
}

:root[data-theme="dark"] {
  --bg: #0d0f1c;
  --surface: #151833;
  --text: #eaecf8;
  --muted: #969bb7;
  --line: #292d4c;
  --accent: #929cff;
  --accent-soft: #242957;
  --mint: #16382a;
  --mint-ink: #9ce8c2;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 84px; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
img { max-width: 100%; }
button, a { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 4px; }
.wrap { width: min(1120px, calc(100% - 32px)); margin-inline: auto; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  height: 72px;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(14px);
}
.topbar-inner { height: 100%; display: flex; align-items: center; justify-content: space-between; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font: 750 18px var(--display); }
.brand-mark {
  width: 36px; height: 36px; display: grid; place-items: center;
  border-radius: 9px; background: var(--accent); color: #fff;
  font: 600 12px var(--mono);
}
.nav { display: flex; align-items: center; gap: 4px; }
.nav a { padding: 8px 11px; border-radius: 99px; color: var(--muted); text-decoration: none; font-size: 15px; }
.nav a:hover { color: var(--text); background: var(--surface); }
.theme-toggle {
  width: 38px; height: 38px; display: grid; place-items: center; margin-left: 5px;
  border: 1px solid var(--line); border-radius: 50%; background: var(--surface); cursor: pointer;
}
.theme-toggle svg { width: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.menu-toggle { display: none; }

.hero {
  min-height: 620px;
  display: flex;
  align-items: center;
  padding-block: 70px 64px;
}
 .hero-copy { max-width: 820px; }
.eyebrow { margin: 0 0 14px; color: var(--muted); font: 600 12px/1.4 var(--mono); letter-spacing: .08em; text-transform: uppercase; }
.status-dot { width: 8px; height: 8px; display: inline-block; margin-right: 7px; border-radius: 50%; background: #28bd72; box-shadow: 0 0 0 4px color-mix(in srgb, #28bd72 16%, transparent); }
.hero h1 { margin: 0; max-width: 760px; font: 800 clamp(56px, 8vw, 104px)/.92 var(--display); letter-spacing: -.055em; }
.hero h1 span { color: var(--accent); }
.hero-role { margin: 24px 0 0; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; font: 700 19px var(--display); }
.hero-role b { color: var(--accent); }
.lede { max-width: 620px; margin: 18px 0 0; color: var(--muted); font-size: 19px; }
.intro-copy { max-width: 820px; margin-top: 14px; }
.intro-copy:first-of-type { margin-top: 24px; }
.hero-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 28px; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 48px; padding: 11px 18px; border: 1.5px solid var(--text); border-radius: 99px; text-decoration: none; font-weight: 700; transition: transform .18s, background .18s; }
.button:hover { transform: translateY(-3px); }
.button-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.button-inverse { background: #fff; border-color: #fff; color: var(--accent); }
.now-card { background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 22px; box-shadow: 0 18px 60px rgba(28, 34, 74, .06); }
.now-card dl { margin: 0 0 18px; }
.now-card dl div { display: flex; justify-content: space-between; gap: 12px; padding: 11px 0; border-top: 1px dashed var(--line); }
.now-card dl div:last-child { border-bottom: 1px dashed var(--line); }
.now-card dt { color: var(--muted); }
.now-card dd { margin: 0; text-align: right; font-weight: 600; }
.now-card > a { color: var(--accent); text-decoration: none; font-weight: 700; }

.ticker { overflow: hidden; border-block: 1px solid var(--line); mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent); }
.ticker-track { width: max-content; display: flex; gap: 38px; align-items: center; padding-block: 14px; animation: ticker 36s linear infinite; }
.ticker-track span { display: flex; align-items: center; gap: 38px; white-space: nowrap; font: 700 24px var(--display); }
.ticker-track span::after { content: ""; width: 9px; height: 9px; background: var(--accent); transform: rotate(45deg); }
@keyframes ticker { to { transform: translateX(-50%); } }

.section { padding-block: 92px; }
.section-heading { margin-bottom: 36px; }
.section-heading h2, .experience-grid h2 { margin: 0; font: 800 clamp(38px, 6vw, 68px)/1 var(--display); letter-spacing: -.045em; }
.heading-row { display: flex; align-items: end; justify-content: space-between; gap: 24px; }
.section-note { max-width: 260px; color: var(--muted); margin: 0 0 4px; }
.about-grid { display: grid; grid-template-columns: 1.3fr 1fr; gap: 60px; align-items: start; }
.about-copy p { max-width: 650px; margin: 0 0 14px; color: var(--muted); font-size: 17px; }
.about-copy .large-copy { color: var(--text); font: 700 clamp(28px, 4vw, 42px)/1.15 var(--display); }
.stats-grid { display: grid; grid-template-columns: repeat(3, 1fr); border: 1px solid var(--line); border-radius: 18px; background: var(--surface); }
.stats-grid div { min-height: 150px; display: flex; flex-direction: column; justify-content: space-between; padding: 18px; border-right: 1px solid var(--line); }
.stats-grid div:last-child { border-right: 0; }
.stats-grid strong { color: var(--accent); font: 800 44px var(--display); }
.stats-grid span { color: var(--muted); font: 600 11px var(--mono); text-transform: uppercase; }
.skill-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; margin-top: 42px; }
.skill-grid article { padding: 22px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); }
.chips { display: flex; gap: 7px; flex-wrap: wrap; }
.chips span { padding: 7px 9px; border-radius: 7px; background: var(--accent-soft); font: 500 12px var(--mono); }
.technology-list { border-top: 1px solid var(--line); }
.technology-row { display: grid; grid-template-columns: 220px 1fr; align-items: start; gap: 32px; padding: 18px 0; border-bottom: 1px solid var(--line); }
.technology-row h3 { margin: 4px 0 0; font: 700 17px var(--body); }
.technology-items { display: flex; flex-wrap: wrap; gap: 8px; }
.technology-items span { padding: 7px 10px; border-radius: 99px; background: var(--accent-soft); font: 500 12px var(--mono); }

.project-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
.project-card { overflow: hidden; display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: 20px; transition: transform .2s, border-color .2s; }
.project-card:hover { transform: translateY(-5px); border-color: var(--accent); }
.project-feature { grid-column: 1 / -1; display: grid; grid-template-columns: 1.25fr .75fr; }
.project-image { min-height: 290px; display: block; overflow: hidden; background: #101426; border-bottom: 1px solid var(--line); }
.project-feature .project-image { border-right: 1px solid var(--line); border-bottom: 0; }
.project-image img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s ease; }
.project-card:hover .project-image img { transform: scale(1.025); }
.project-body { display: flex; flex: 1; flex-direction: column; align-items: flex-start; padding: 24px; }
.project-feature .project-body { justify-content: center; }
.project-body h3 { margin: 0 0 10px; font: 750 30px/1.05 var(--display); }
.project-body > p:not(.eyebrow) { margin: 0 0 18px; color: var(--muted); }
.project-body .chips { margin-bottom: 20px; }
.text-link { margin-top: auto; color: var(--accent); font-weight: 700; text-decoration: none; border-bottom: 1.5px solid var(--accent); }
.project-actions { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; margin-top: auto; }
.cli-preview { min-height: 290px; display: flex; flex-direction: column; gap: 10px; justify-content: center; padding: 28px; background: #101426; color: #e7eafd; border-bottom: 1px solid var(--line); font: 500 13px var(--mono); }
.cli-preview > span { color: #9fa8ff; margin-bottom: 8px; }
.cli-preview div { padding: 10px 12px; border: 1px solid #303759; border-radius: 8px; }
.cli-preview b { color: #7ee0ac; }
.cli-preview p { margin: 3px 0 0; color: #adb3d1; }

.articles-list { border-top: 1px solid var(--line); }
.article-row { display: grid; grid-template-columns: 70px 1fr auto; gap: 18px; align-items: center; padding: 20px 0; border-bottom: 1px solid var(--line); text-decoration: none; }
.article-row h3 { margin: 0; font: 750 clamp(20px, 3vw, 28px)/1.2 var(--display); }
.article-row p { margin: 4px 0 0; color: var(--muted); }
.article-number { color: var(--muted); font: 500 12px var(--mono); }
.article-arrow { color: var(--accent); font: 500 22px var(--mono); transition: transform .2s; }
.article-row:hover .article-arrow { transform: translate(4px, -4px); }
.article-placeholder { opacity: .58; }


.experience-grid { display: grid; grid-template-columns: .75fr 1.25fr; gap: 60px; padding-top: 70px; border-top: 1px solid var(--line); }
.education-grid { display: grid; grid-template-columns: .75fr 1.25fr; gap: 60px; padding-top: 70px; border-top: 1px solid var(--line); }
.education-grid h2 { margin: 0; font: 800 clamp(38px, 6vw, 68px)/1 var(--display); letter-spacing: -.045em; }
.timeline article { padding: 22px 0; border-top: 1px solid var(--line); }
.timeline article:last-child { border-bottom: 1px solid var(--line); }
.timeline span { color: var(--muted); font: 500 12px var(--mono); }
.timeline h3 { margin: 5px 0 6px; font: 750 22px var(--display); }
.timeline p { margin: 0; color: var(--muted); }
.role-logo { width: 42px; height: 42px; display: grid; place-items: center; float: left; margin: 0 12px 8px 0; border-radius: 10px; background: var(--accent); color: #fff; font: 700 12px var(--mono); }

.contact-section { margin-top: 70px; padding: clamp(32px, 6vw, 70px); border-radius: 28px; background: var(--accent); color: #fff; }
.contact-section .eyebrow { color: rgba(255,255,255,.72); }
.contact-section h2 { margin: 0; font: 800 clamp(44px, 7vw, 78px)/.95 var(--display); letter-spacing: -.05em; }
.contact-section h2 span { color: #cbd0ff; }
.contact-row { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-top: 38px; }
.social-links { display: flex; gap: 8px; }
.social-links a { padding: 8px 14px; border: 1px solid rgba(255,255,255,.65); border-radius: 99px; text-decoration: none; }
.footer { display: flex; justify-content: space-between; align-items: center; padding-block: 30px 40px; color: var(--muted); font: 500 12px var(--mono); }

@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr 250px; gap: 28px; }
  .hero h1 { font-size: clamp(52px, 9vw, 80px); }
  .about-grid { grid-template-columns: 1fr; }
  .project-feature { grid-template-columns: 1fr 1fr; }
  .research-grid { grid-template-columns: repeat(2, 1fr); }
  .research-grid .research-feature { grid-row: auto; }
  .experience-grid { grid-template-columns: 1fr; gap: 30px; }
  .education-grid { grid-template-columns: 1fr; gap: 30px; }
}

@media (max-width: 680px) {
  .wrap { width: min(100% - 24px, 1120px); }
  .topbar { height: 64px; }
  .brand { font-size: 16px; }
  .brand-mark { width: 34px; height: 34px; }
  .menu-toggle { width: 42px; height: 42px; display: grid; place-content: center; gap: 6px; border: 0; background: transparent; cursor: pointer; }
  .menu-toggle span { width: 22px; height: 2px; background: var(--text); transition: transform .2s; }
  .menu-toggle[aria-expanded="true"] span:first-child { transform: translateY(4px) rotate(45deg); }
  .menu-toggle[aria-expanded="true"] span:last-child { transform: translateY(-4px) rotate(-45deg); }
  .nav { position: fixed; top: 64px; left: 0; right: 0; display: none; align-items: stretch; flex-direction: column; padding: 12px; background: var(--bg); border-bottom: 1px solid var(--line); }
  .nav.open { display: flex; }
  .nav a { padding: 12px; }
  .theme-toggle { align-self: flex-start; margin: 8px 12px; }

  .hero { min-height: auto; grid-template-columns: 1fr; padding-block: 58px 50px; }
  .hero h1 { font-size: clamp(48px, 16vw, 72px); }
  .hero-role { font-size: 16px; }
  .lede { font-size: 17px; }
  .now-card { display: none; }
  .ticker-track { font-size: 20px; }

  .section { padding-block: 68px; }
  .heading-row { align-items: start; }
  .section-note { display: none; }
  .stats-grid { grid-template-columns: 1fr; }
  .stats-grid div { min-height: 110px; border-right: 0; border-bottom: 1px solid var(--line); }
  .stats-grid div:last-child { border-bottom: 0; }
  .skill-grid, .project-grid { grid-template-columns: 1fr; }
  .technology-row { grid-template-columns: 1fr; gap: 10px; }
  .project-feature { grid-column: auto; display: flex; }
  .project-feature .project-image { border-right: 0; border-bottom: 1px solid var(--line); }
  .project-image, .cli-preview { min-height: 220px; }
  .research-grid { grid-template-columns: 1fr; }
  .research-grid article { min-height: 180px; }
  .experience-grid { padding-top: 50px; }
  .contact-row { align-items: flex-start; flex-direction: column; }
  .button-inverse { max-width: 100%; overflow-wrap: anywhere; font-size: 14px; }
  .footer { align-items: flex-start; flex-direction: column; gap: 4px; }
  .footer p { margin: 0; }
  .article-row { grid-template-columns: 42px 1fr auto; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
