:root {
  --bg: #f7f8fb;
  --surface: #ffffff;
  --surface-2: #eef2f8;
  --text: #111827;
  --muted: #596274;
  --subtle: #7b8494;
  --line: #dce2eb;
  --accent: #2457d6;
  --accent-strong: #173ea8;
  --accent-soft: #eaf0ff;
  --shadow: 0 18px 50px rgba(31, 43, 70, .08);
  --radius: 16px;
  --max: 1160px;
}

html[data-theme="dark"] {
  --bg: #0d1117;
  --surface: #121821;
  --surface-2: #171e29;
  --text: #f1f4f8;
  --muted: #aeb7c5;
  --subtle: #7f8998;
  --line: #283140;
  --accent: #78a0ff;
  --accent-strong: #9bb8ff;
  --accent-soft: #182548;
  --shadow: 0 18px 50px rgba(0, 0, 0, .2);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button, a { -webkit-tap-highlight-color: transparent; }
img { display: block; max-width: 100%; }
strong { color: var(--text); }

.skip-link { position: fixed; top: 10px; left: 10px; transform: translateY(-160%); padding: 10px 14px; background: var(--text); color: var(--bg); border-radius: 8px; z-index: 100; }
.skip-link:focus { transform: translateY(0); }

.container { width: min(calc(100% - 44px), var(--max)); margin: 0 auto; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  border-bottom: 1px solid color-mix(in srgb, var(--line) 75%, transparent);
  backdrop-filter: blur(16px);
}
.header-inner { width: min(calc(100% - 44px), var(--max)); min-height: 72px; margin: 0 auto; display: flex; align-items: center; gap: 28px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 730; letter-spacing: -.02em; white-space: nowrap; }
.brand-mark { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 9px; background: var(--text); color: var(--bg); font-size: .78rem; letter-spacing: .02em; }
.nav { margin-left: auto; display: flex; gap: 28px; font-size: .89rem; color: var(--muted); }
.nav a, .social-links a, .text-link { transition: color .18s ease; }
.nav a:hover, .social-links a:hover, .text-link:hover { color: var(--accent); }
.header-actions { display: flex; gap: 8px; align-items: center; }
.theme-toggle, .resume-link { min-height: 39px; display: inline-flex; align-items: center; justify-content: center; padding: 0 13px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface); color: var(--muted); font: inherit; font-size: .82rem; cursor: pointer; }
.resume-link { color: var(--text); font-weight: 680; }
.theme-toggle:hover, .resume-link:hover { border-color: color-mix(in srgb, var(--accent) 55%, var(--line)); }

.hero { padding: 94px 0 0; }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(280px, .55fr); gap: 92px; align-items: center; }
.kicker, .section-label { margin: 0 0 18px; color: var(--accent); font-size: .76rem; text-transform: uppercase; letter-spacing: .11em; font-weight: 760; }
.kicker { display: flex; align-items: center; gap: 9px; color: var(--muted); }
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: #2d9d5b; box-shadow: 0 0 0 4px color-mix(in srgb, #2d9d5b 15%, transparent); }
.hero h1 { max-width: 810px; margin: 0; font-size: clamp(3.35rem, 6.7vw, 6.65rem); line-height: .98; letter-spacing: -.066em; font-weight: 770; }
.hero h1 span { color: var(--accent); }
.hero-summary { max-width: 700px; margin: 27px 0 0; color: var(--muted); font-size: clamp(1.03rem, 1.45vw, 1.19rem); line-height: 1.7; }
.hero-actions { display: flex; gap: 11px; margin-top: 30px; }
.button { min-height: 46px; display: inline-flex; align-items: center; justify-content: center; padding: 0 18px; border: 1px solid var(--line); border-radius: 10px; font-weight: 690; font-size: .88rem; transition: transform .18s ease, border-color .18s ease, background .18s ease; }
.button:hover { transform: translateY(-1px); }
.button.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.button.primary:hover { background: var(--accent-strong); border-color: var(--accent-strong); }
.button.secondary { background: var(--surface); color: var(--text); }
.button.secondary:hover { border-color: color-mix(in srgb, var(--accent) 55%, var(--line)); }
.social-links { display: flex; gap: 20px; flex-wrap: wrap; margin-top: 25px; color: var(--muted); font-size: .85rem; }
.hero-profile { justify-self: end; width: min(100%, 320px); }
.portrait-wrap { position: relative; overflow: hidden; aspect-ratio: 4 / 5; border-radius: 18px; border: 1px solid var(--line); background: var(--surface-2); box-shadow: var(--shadow); }
.portrait-wrap::after { content: ""; position: absolute; inset: auto 0 0; height: 25%; background: linear-gradient(to top, rgba(12,17,27,.18), transparent); pointer-events: none; }
.portrait-wrap img { width: 100%; height: 100%; object-fit: cover; object-position: center top; }
.profile-caption { padding: 14px 2px 0; }
.profile-caption strong { display: block; font-size: .94rem; }
.profile-caption span { display: block; margin-top: 2px; color: var(--muted); font-size: .79rem; line-height: 1.45; }

.proof-strip { margin-top: 72px; display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.proof-strip div { padding: 25px 28px 25px 0; display: flex; align-items: baseline; gap: 13px; }
.proof-strip div + div { padding-left: 28px; border-left: 1px solid var(--line); }
.proof-strip strong { font-size: 1.48rem; letter-spacing: -.04em; }
.proof-strip span { color: var(--muted); font-size: .82rem; line-height: 1.35; }

.section { padding: 92px 0; border-bottom: 1px solid var(--line); }
.section-tint { background: var(--surface); }
.section-intro { display: grid; grid-template-columns: 1.1fr .9fr; gap: 90px; align-items: end; margin-bottom: 48px; }
.section-intro h2, .about-grid h2, .contact-inner h2 { margin: 0; font-size: clamp(2.1rem, 3.7vw, 3.85rem); line-height: 1.07; letter-spacing: -.052em; font-weight: 745; }
.section-intro > p { margin: 0; max-width: 470px; color: var(--muted); font-size: .96rem; }
.compact-intro { grid-template-columns: 1fr; margin-bottom: 32px; }

.experience-list { border-top: 1px solid var(--line); }
.experience-item { display: grid; grid-template-columns: 205px minmax(0, 1fr); gap: 52px; padding: 39px 0; border-bottom: 1px solid var(--line); }
.experience-meta { display: flex; flex-direction: column; gap: 4px; color: var(--subtle); font-size: .79rem; }
.role-line { display: flex; justify-content: space-between; gap: 20px; align-items: start; }
.experience-content h3 { margin: 0; font-size: 1.36rem; letter-spacing: -.027em; }
.organization { margin: 3px 0 17px; color: var(--accent); font-weight: 680; }
.role-tag { flex: 0 0 auto; border: 1px solid var(--line); border-radius: 999px; padding: 4px 9px; color: var(--muted); font-size: .7rem; }
.experience-content ul { margin: 0; padding-left: 19px; color: var(--muted); }
.experience-content li { margin: 7px 0; }

.tags { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 19px; }
.tags span { border: 1px solid var(--line); border-radius: 999px; background: var(--bg); color: var(--muted); padding: 5px 9px; font-size: .72rem; }
.section-tint .tags span { background: var(--surface-2); }

.project-stack { display: flex; flex-direction: column; border-top: 1px solid var(--line); }
.project-feature { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(330px, .85fr); gap: 72px; align-items: center; padding: 54px 0; border-bottom: 1px solid var(--line); }
.project-feature.reverse .project-copy { order: 2; }
.project-feature.reverse .project-visual { order: 1; }
.project-heading-row { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; }
.project-index { color: var(--accent); font-size: .77rem; font-weight: 800; }
.project-type { color: var(--subtle); font-size: .72rem; letter-spacing: .08em; text-transform: uppercase; font-weight: 720; }
.project-copy h3 { margin: 0 0 13px; max-width: 690px; font-size: clamp(1.65rem, 2.5vw, 2.35rem); line-height: 1.16; letter-spacing: -.038em; }
.project-copy > p { margin: 0; max-width: 720px; color: var(--muted); }
.project-points { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 20px; margin-top: 21px; }
.project-points span { position: relative; padding-left: 15px; color: var(--muted); font-size: .82rem; }
.project-points span::before { content: ""; position: absolute; left: 0; top: .7em; width: 5px; height: 5px; border-radius: 50%; background: var(--accent); }
.text-link { display: inline-block; margin-top: 18px; color: var(--accent); font-size: .84rem; font-weight: 700; }

.project-visual { min-height: 310px; border: 1px solid var(--line); border-radius: 16px; background: var(--bg); box-shadow: var(--shadow); padding: 24px; }
.arch-label { margin-bottom: 19px; color: var(--subtle); font-size: .67rem; letter-spacing: .12em; font-weight: 770; }
.architecture { display: flex; flex-direction: column; justify-content: center; }
.arch-node, .arch-row span { border: 1px solid var(--line); border-radius: 9px; background: var(--surface); color: var(--muted); padding: 11px 13px; text-align: center; font-size: .78rem; }
.arch-node.strong { font-weight: 700; color: var(--text); }
.arch-node.accent { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); background: var(--accent-soft); color: var(--accent-strong); font-weight: 720; }
.arch-row { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.arch-arrow { text-align: center; color: var(--subtle); line-height: 1.7; }

.metric-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 22px; }
.metric-row div { border-left: 2px solid var(--accent); padding-left: 11px; }
.metric-row strong { display: block; font-size: 1.35rem; letter-spacing: -.04em; }
.metric-row span { display: block; color: var(--subtle); font-size: .7rem; }
.comparison { display: flex; flex-direction: column; justify-content: center; }
.bar-row { display: grid; grid-template-columns: 125px 1fr 47px; gap: 10px; align-items: center; margin: 13px 0; font-size: .72rem; color: var(--muted); }
.bar-row > div { height: 8px; overflow: hidden; border-radius: 999px; background: var(--surface-2); }
.bar-row i { display: block; height: 100%; border-radius: inherit; background: var(--accent); }
.bar-row b { color: var(--text); font-size: .73rem; }
.comparison > p { margin: 15px 0 0; color: var(--subtle); text-align: right; font-size: .68rem; text-transform: uppercase; letter-spacing: .08em; }

.more-work-header { display: flex; justify-content: space-between; gap: 40px; align-items: end; margin: 58px 0 20px; }
.more-work-header h3 { margin: 0; font-size: 1.25rem; letter-spacing: -.02em; }
.more-work-header p { max-width: 520px; margin: 0; color: var(--muted); font-size: .84rem; }
.more-work-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.compact-project { position: relative; min-height: 280px; border: 1px solid var(--line); border-radius: 14px; background: var(--bg); padding: 27px; }
.compact-number { color: var(--accent); font-size: .75rem; font-weight: 800; }
.compact-project h4 { margin: 36px 0 10px; font-size: 1.25rem; letter-spacing: -.025em; }
.compact-project p { margin: 0; color: var(--muted); font-size: .9rem; }
.archive-note { margin-top: 18px; padding: 19px 22px; border-left: 3px solid var(--accent); background: var(--accent-soft); border-radius: 0 10px 10px 0; }
.archive-note p { margin: 0; color: var(--muted); font-size: .84rem; }
.archive-note .text-link { margin-top: 9px; }

.publication-list { border-top: 1px solid var(--line); }
.publication-item { display: grid; grid-template-columns: 215px minmax(0, 1fr); gap: 48px; padding: 31px 0; border-bottom: 1px solid var(--line); }
.publication-meta { display: flex; flex-direction: column; gap: 4px; color: var(--subtle); font-size: .7rem; text-transform: uppercase; letter-spacing: .07em; }
.publication-meta span:first-child { color: var(--accent); font-weight: 800; }
.publication-main h3 { margin: 0 0 8px; max-width: 800px; font-size: 1.14rem; line-height: 1.38; letter-spacing: -.015em; }
.publication-main p { margin: 0; max-width: 760px; color: var(--muted); font-size: .88rem; }
.publication-main .text-link { margin-top: 10px; }

.about-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 86px; align-items: start; }
.about-copy { margin: 24px 0 0; color: var(--muted); font-size: .98rem; }
.details-panel { border-top: 1px solid var(--line); }
.detail-row { padding: 17px 0; border-bottom: 1px solid var(--line); }
.detail-row span { display: block; margin-bottom: 4px; color: var(--subtle); font-size: .7rem; text-transform: uppercase; letter-spacing: .08em; }
.detail-row strong { font-size: .89rem; font-weight: 650; }

.education-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.education-grid article { border: 1px solid var(--line); border-radius: 14px; background: var(--surface); padding: 25px; }
.education-date { color: var(--accent); font-size: .72rem; font-weight: 760; }
.education-grid h3 { margin: 20px 0 4px; font-size: 1.18rem; }
.education-grid p { margin: 0 0 15px; color: var(--muted); font-size: .86rem; }
.education-grid strong { font-size: .85rem; }
.recognition-row { display: grid; grid-template-columns: repeat(3, 1fr); margin-top: 20px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.recognition-row div { padding: 22px 20px 22px 0; }
.recognition-row div + div { padding-left: 20px; border-left: 1px solid var(--line); }
.recognition-row strong { display: block; font-size: 1.15rem; }
.recognition-row span { display: block; margin-top: 3px; color: var(--muted); font-size: .78rem; line-height: 1.45; }

.contact-section { padding: 82px 0; background: var(--text); color: var(--bg); }
.contact-inner { display: grid; grid-template-columns: 1fr .75fr; gap: 80px; align-items: end; }
.contact-section .section-label { color: color-mix(in srgb, var(--bg) 68%, transparent); }
.contact-inner h2 { color: var(--bg); }
.contact-inner p { max-width: 630px; color: color-mix(in srgb, var(--bg) 72%, transparent); }
.contact-actions { display: flex; flex-direction: column; gap: 9px; align-items: stretch; }
.contact-section .button.primary { background: var(--bg); color: var(--text); border-color: var(--bg); }
.contact-section .button.secondary { background: transparent; color: var(--bg); border-color: color-mix(in srgb, var(--bg) 28%, transparent); }

.site-footer { padding: 22px 0; }
.footer-inner { display: flex; justify-content: space-between; gap: 20px; color: var(--subtle); font-size: .76rem; }

@media (max-width: 960px) {
  .nav { display: none; }
  .hero-grid { grid-template-columns: 1fr 250px; gap: 45px; }
  .section-intro, .about-grid, .contact-inner { grid-template-columns: 1fr; gap: 24px; }
  .project-feature { grid-template-columns: 1fr; gap: 28px; }
  .project-feature.reverse .project-copy, .project-feature.reverse .project-visual { order: initial; }
  .project-visual { min-height: 275px; }
}

@media (max-width: 720px) {
  .container, .header-inner { width: min(calc(100% - 28px), var(--max)); }
  .header-inner { min-height: 64px; gap: 10px; }
  .brand > span:last-child { display: none; }
  .theme-toggle { display: none; }
  .hero { padding-top: 62px; }
  .hero-grid { grid-template-columns: 1fr; }
  .hero-profile { justify-self: start; width: 170px; }
  .profile-caption { display: none; }
  .hero h1 { font-size: clamp(3rem, 15vw, 5rem); }
  .hero-actions { flex-direction: column; align-items: stretch; }
  .proof-strip { grid-template-columns: 1fr; margin-top: 50px; }
  .proof-strip div, .proof-strip div + div { padding: 17px 0; border-left: 0; }
  .proof-strip div + div { border-top: 1px solid var(--line); }
  .section { padding: 70px 0; }
  .experience-item { grid-template-columns: 1fr; gap: 14px; }
  .role-line { flex-direction: column; gap: 4px; }
  .role-tag { display: none; }
  .project-feature { padding: 40px 0; }
  .project-points { grid-template-columns: 1fr; }
  .metric-row { grid-template-columns: 1fr 1fr; }
  .metric-row div:last-child { grid-column: 1 / -1; }
  .more-work-header { flex-direction: column; align-items: flex-start; gap: 8px; }
  .more-work-grid, .education-grid { grid-template-columns: 1fr; }
  .publication-item { grid-template-columns: 1fr; gap: 8px; }
  .publication-meta { flex-direction: row; gap: 12px; }
  .recognition-row { grid-template-columns: 1fr; }
  .recognition-row div, .recognition-row div + div { padding: 17px 0; border-left: 0; }
  .recognition-row div + div { border-top: 1px solid var(--line); }
  .footer-inner { flex-direction: column; gap: 5px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: .01ms !important; }
}

@media print {
  .site-header, .hero-actions, .social-links, .theme-toggle, .contact-section, .site-footer { display: none !important; }
  .hero, .section { padding: 28px 0; }
  body { background: #fff; color: #000; }
}
