:root {
  --ink: #0f172a;
  --ink-soft: #334155;
  --muted: #64748b;
  --line: #dbe3ee;
  --surface: #ffffff;
  --surface-alt: #f5f8fc;
  --accent: #1d4ed8;
  --accent-dark: #153eaa;
  --accent-soft: #e8efff;
  --success: #16a34a;
  --warm: #f59e0b;
  --radius-lg: 28px;
  --radius-md: 18px;
  --shadow: 0 18px 45px rgba(15, 23, 42, 0.08);
  --max-width: 1180px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 84px; }
body {
  margin: 0;
  color: var(--ink);
  background: var(--surface);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img, video { display: block; max-width: 100%; }
a { color: var(--accent); text-decoration-thickness: 1.5px; text-underline-offset: 0.2em; }
a:hover { color: var(--accent-dark); }
button, a { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 3px solid rgba(29, 78, 216, 0.38); outline-offset: 4px; border-radius: 5px; }

.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.skip-link { position: fixed; left: 1rem; top: -5rem; z-index: 1000; padding: .7rem 1rem; color: #fff; background: var(--ink); border-radius: 8px; }
.skip-link:focus { top: 1rem; }
.container { width: min(calc(100% - 40px), var(--max-width)); margin-inline: auto; }
.section { padding: 96px 0; }
.section-muted { background: var(--surface-alt); border-block: 1px solid #eef2f7; }
.muted { color: var(--muted); font-weight: 560; }

.site-header { position: sticky; top: 0; z-index: 100; background: rgba(255,255,255,.92); border-bottom: 1px solid rgba(219,227,238,.85); backdrop-filter: blur(16px); }
.header-inner { min-height: 72px; display: flex; align-items: center; justify-content: space-between; gap: 2rem; }
.brand { color: var(--ink); text-decoration: none; font-weight: 760; letter-spacing: -.02em; }
.site-nav { display: flex; align-items: center; gap: 1.6rem; }
.site-nav a { color: var(--ink-soft); text-decoration: none; font-size: .95rem; font-weight: 620; }
.site-nav a:hover { color: var(--accent); }
.site-nav .nav-resume { color: #fff; background: var(--ink); padding: .58rem .9rem; border-radius: 999px; }
.site-nav .nav-resume:hover { color: #fff; background: var(--accent); }
.nav-toggle { display: none; width: 44px; height: 44px; align-items: center; justify-content: center; flex-direction: column; gap: 5px; border: 0; background: transparent; }
.nav-toggle span:not(.sr-only) { width: 22px; height: 2px; background: var(--ink); border-radius: 2px; }

.hero { padding-top: 86px; overflow: hidden; }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1.36fr) minmax(320px, .64fr); gap: clamp(3rem, 7vw, 7rem); align-items: center; }
.eyebrow, .section-kicker, .project-number { margin: 0 0 .9rem; color: var(--accent); font-size: .78rem; font-weight: 780; letter-spacing: .095em; text-transform: uppercase; }
.status-dot { display: inline-block; width: .56rem; height: .56rem; margin-right: .55rem; border-radius: 50%; background: var(--success); box-shadow: 0 0 0 5px rgba(22,163,74,.11); vertical-align: .03em; }
h1 { max-width: 920px; margin: 0; font-size: clamp(2.65rem, 4.1vw, 4.05rem); line-height: 1.02; letter-spacing: -.055em; }
.hero-credential { max-width: 780px; margin: 1rem 0 0; color: var(--muted); font-size: clamp(1.18rem, 2vw, 1.55rem); font-weight: 680; line-height: 1.3; letter-spacing: -.02em; }
.hero-lead { max-width: 780px; margin: 1.45rem 0 0; color: var(--ink-soft); font-size: clamp(1.2rem, 2vw, 1.52rem); line-height: 1.48; }
.hero-body { max-width: 780px; margin: 1.2rem 0 0; color: var(--ink-soft); }
.hero-actions { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 2rem; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: .45rem; min-height: 48px; padding: .72rem 1.08rem; border: 1px solid transparent; border-radius: 12px; text-decoration: none; font-weight: 720; line-height: 1.2; transition: transform .15s ease, background .15s ease, border-color .15s ease; }
.button:hover { transform: translateY(-1px); }
.button-primary { color: #fff; background: var(--accent); box-shadow: 0 8px 24px rgba(29,78,216,.18); }
.button-primary:hover { color: #fff; background: var(--accent-dark); }
.button-secondary { color: var(--ink); background: #fff; border-color: var(--line); }
.button-secondary:hover { color: var(--accent); border-color: #b8c8df; }
.hero-meta { display: flex; flex-wrap: wrap; gap: .4rem 1.4rem; margin: 2rem 0 0; padding: 0; color: var(--muted); font-size: .9rem; list-style: none; }
.hero-meta li { position: relative; }
.hero-meta li + li::before { content: "·"; position: absolute; left: -.85rem; color: #a5b4c8; }
.profile-links { display: flex; flex-wrap: wrap; gap: .55rem 1.25rem; margin-top: 1rem; }
.profile-links a { color: var(--ink-soft); font-size: .92rem; font-weight: 680; text-decoration: none; }
.profile-links a:hover { color: var(--accent); }
.hero-portrait-wrap {
  position: relative;
  justify-self: end;
  width: min(100%, 285px);
}
.portrait-accent { position: absolute; inset: -24px 38px 55px -38px; border-radius: 40% 60% 52% 48% / 56% 45% 55% 44%; background: linear-gradient(145deg, var(--accent-soft), #fef3c7); transform: rotate(-4deg); }
.hero-portrait {
  position: relative;
  z-index: 1;
  width: 100%;
  height: auto;
  aspect-ratio: 349 / 850;
  object-fit: cover;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}
.portrait-caption { position: relative; z-index: 2; width: calc(100% - 36px); margin: -30px auto 0; padding: .88rem 1rem; background: rgba(255,255,255,.96); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 12px 26px rgba(15,23,42,.1); }
.portrait-caption strong, .portrait-caption span { display: block; }
.portrait-caption strong { font-size: .8rem; text-transform: uppercase; letter-spacing: .08em; }
.portrait-caption span { margin-top: .14rem; color: var(--muted); font-size: .85rem; }

.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 3rem; margin-bottom: 3rem; }
.section-heading.compact { display: block; margin-bottom: 2rem; }
h2 { margin: 0; font-size: clamp(2rem, 3.5vw, 3.35rem); line-height: 1.1; letter-spacing: -.04em; }
.section-intro { max-width: 520px; margin: 0; color: var(--muted); }
.text-link { font-weight: 720; white-space: nowrap; }
.focus-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; }
.focus-card { min-height: 210px; padding: 1.45rem; background: #fff; border: 1px solid var(--line); border-radius: var(--radius-md); box-shadow: 0 4px 20px rgba(15,23,42,.035); }
.focus-card h3 { margin: 0; font-size: 1.08rem; }
.focus-card p { margin: .65rem 0 0; color: var(--muted); font-size: .93rem; }

.projects { display: grid; gap: 1.25rem; }
.project { display: grid; grid-template-columns: minmax(300px, .9fr) minmax(0, 1.1fr); min-height: 450px; overflow: hidden; background: #fff; border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: 0 5px 24px rgba(15,23,42,.045); }
.project:nth-child(even) .project-media { order: 2; }
.project:nth-child(even) .project-content { order: 1; }
.project-media { min-height: 420px; background: #eef3fb; overflow: hidden; }
.project-media img, .project-media video { width: 100%; height: 100%; }
.media-cover img { object-fit: cover; }
.media-contain { padding: clamp(1.6rem, 4vw, 3.4rem); display: grid; place-items: center; background: linear-gradient(145deg, #f5f8ff, #edf2ff); }
.media-contain img { object-fit: contain; }
.media-video video { object-fit: cover; background: #050a14; }
.project-content { display: flex; flex-direction: column; justify-content: center; padding: clamp(2rem, 5vw, 4.1rem); }
.project-content h3 { margin: 0; font-size: clamp(1.65rem, 3vw, 2.45rem); line-height: 1.15; letter-spacing: -.03em; }
.project-content > p:not(.project-number) { margin: 1rem 0 0; color: var(--ink-soft); }
.tag-list { display: flex; flex-wrap: wrap; gap: .48rem; margin: 1.3rem 0 0; padding: 0; list-style: none; }
.tag-list li { padding: .38rem .68rem; color: #273a57; background: #edf3fb; border-radius: 999px; font-size: .78rem; font-weight: 680; }
.project-links { display: flex; gap: 1.25rem; margin-top: 1.6rem; }
.project-links a { font-weight: 750; }

.packing-media { position: relative; display: grid; place-items: center; min-height: 420px; background: radial-gradient(circle at 22% 17%, #dbeafe, transparent 35%), linear-gradient(145deg, #eef3fa, #dbe4f0); }
.truck-shell { position: relative; width: 76%; height: 52%; border: 8px solid #334155; border-right-width: 18px; border-radius: 12px 3px 3px 12px; background: rgba(255,255,255,.58); box-shadow: inset 0 -10px 20px rgba(15,23,42,.08); }
.truck-shell::before, .truck-shell::after { content: ""; position: absolute; bottom: -28px; width: 38px; height: 38px; border: 8px solid #334155; border-radius: 50%; background: #cbd5e1; }
.truck-shell::before { left: 12%; } .truck-shell::after { right: 10%; }
.box { position: absolute; display: block; border: 2px solid rgba(15,23,42,.25); border-radius: 4px; box-shadow: inset -8px -8px 14px rgba(15,23,42,.08); }
.box-a { left: 5%; bottom: 5%; width: 24%; height: 34%; background: #60a5fa; }
.box-b { left: 30%; bottom: 5%; width: 18%; height: 48%; background: #fbbf24; }
.box-c { left: 49%; bottom: 5%; width: 30%; height: 25%; background: #34d399; }
.box-d { left: 50%; bottom: 32%; width: 20%; height: 36%; background: #a78bfa; }
.box-e { left: 6%; bottom: 42%; width: 22%; height: 24%; background: #fb7185; }
.box-f { left: 72%; bottom: 33%; width: 22%; height: 42%; background: #fb923c; }
.grid-stack { position: absolute; right: 5%; top: 6%; display: grid; gap: 5px; opacity: .38; transform: rotate(6deg); }
.grid-stack span { display: block; width: 74px; height: 56px; border: 2px solid var(--accent); background-image: linear-gradient(rgba(29,78,216,.28) 1px, transparent 1px), linear-gradient(90deg, rgba(29,78,216,.28) 1px, transparent 1px); background-size: 10px 10px; }

.publication-list { margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--line); }
.publication-list li { display: grid; grid-template-columns: 86px 1fr; gap: 1.5rem; padding: 1.65rem 0; border-bottom: 1px solid var(--line); }
.publication-year { color: var(--accent); font-weight: 800; }
.publication-list h3 { margin: 0; font-size: 1.06rem; line-height: 1.45; }
.publication-list h3 a { color: var(--ink); text-decoration: none; }
.publication-list h3 a:hover { color: var(--accent); }
.publication-list p {
  margin: .34rem 0 0;
  color: var(--ink-soft);
  font-size: .9rem;
}
.publication-list .publication-venue { color: var(--ink-soft); font-weight: 650; }
.thesis-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-top: 2rem; }
.thesis-row article { padding: 1.5rem; background: #fff; border: 1px solid var(--line); border-radius: var(--radius-md); }
.thesis-institution {
  margin: 0.75rem 0 0;
  color: var(--muted);
  font-size: 0.95rem;
  font-weight: 400;
  line-height: 1.5;
}
.thesis-row h3 { margin: 0; font-size: 1.08rem; line-height: 1.5; }
.thesis-row h3 a { color: var(--ink); text-decoration: none; }
.thesis-row h3 a:hover { color: var(--accent); }

.background-grid { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(300px, .55fr); gap: clamp(2.5rem, 7vw, 6rem); }
.subsection-title { margin: 0 0 1.5rem; font-size: .88rem; color: var(--ink-soft); text-transform: uppercase; letter-spacing: .1em; }
.timeline { margin: 0; padding: 0; list-style: none; }
.timeline li { display: grid; grid-template-columns: 170px 1fr; gap: 1.5rem; padding: 0 0 2.3rem; }
.timeline li:last-child { padding-bottom: 0; }
.timeline-date { color: var(--muted); font-size: .86rem; font-weight: 680; }
.timeline-content { position: relative; padding-left: 1.5rem; border-left: 2px solid var(--line); }
.timeline-content::before { content: ""; position: absolute; left: -7px; top: .25rem; width: 12px; height: 12px; border-radius: 50%; background: var(--accent); border: 3px solid #fff; box-shadow: 0 0 0 1px var(--accent); }
.timeline-content h4 { margin: 0; font-size: 1.16rem; }
.timeline-content h4 span { color: var(--muted); font-weight: 570; }
.timeline-content p { margin: .45rem 0 0; color: var(--ink-soft); }
.timeline-content .timeline-org { color: var(--accent); font-size: .9rem; font-weight: 700; }
.education-panel { padding: 1.7rem; background: var(--surface-alt); border: 1px solid var(--line); border-radius: var(--radius-lg); align-self: start; }
.education-panel article { padding: 0 0 1.5rem; margin-bottom: 1.5rem; border-bottom: 1px solid var(--line); }
.education-panel article:last-of-type { margin-bottom: 0; }
.education-panel h4 { margin: .1rem 0; font-size: 1.03rem; }
.education-panel p { margin: .15rem 0 0; color: var(--ink-soft); font-size: .9rem; }
.education-panel .education-year { color: var(--accent); font-weight: 780; }
.education-panel .education-detail { color: var(--ink-soft); }
.speaking-block { margin-top: 2rem; }
.speaking-block ul { display: grid; gap: .75rem; margin: 0; padding: 0; list-style: none; }
.speaking-block li { color: var(--ink-soft); font-size: .88rem; }
.speaking-block li span { display: inline-block; min-width: 48px; color: var(--accent); font-weight: 780; }

.contact-section { padding-top: 50px; }
.contact-card { display: grid; grid-template-columns: 1fr auto; gap: 3rem; align-items: center; padding: clamp(2rem, 5vw, 4rem); color: #fff; background: linear-gradient(135deg, #0f172a, #1e3a70); border-radius: var(--radius-lg); }
.contact-card .section-kicker { color: #93c5fd; }
.contact-card h2 { max-width: 800px; }
.contact-card p { max-width: 760px; margin: 1rem 0 0; color: #dbeafe; }
.contact-actions { display: grid; gap: .7rem; min-width: 210px; }
.button-light { color: var(--ink); background: #fff; }
.button-light:hover { color: var(--accent); background: #f8fafc; }
.button-outline-light { color: #fff; border-color: rgba(255,255,255,.45); }
.button-outline-light:hover { color: #fff; border-color: #fff; }
.site-footer { padding: 2.2rem 0 2.8rem; }
.footer-inner { display: flex; justify-content: space-between; gap: 1rem; color: var(--muted); font-size: .82rem; }
.footer-inner p { margin: 0; }

@media (max-width: 1000px) {
  .focus-grid { grid-template-columns: 1fr 1fr; }
  .hero-grid { grid-template-columns: 1.25fr .75fr; gap: 3rem; }
  .project { grid-template-columns: .8fr 1.2fr; }
  .background-grid { grid-template-columns: 1fr; }
  .education-panel { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
  .education-panel > .subsection-title, .education-panel .speaking-block { grid-column: 1 / -1; }
  .education-panel article { margin: 0; padding: 0 1rem 0 0; border-bottom: 0; border-right: 1px solid var(--line); }
  .education-panel article:last-of-type { border-right: 0; }
}

@media (max-width: 760px) {
  body { font-size: 16px; }
  .container { width: min(calc(100% - 28px), var(--max-width)); }
  .section { padding: 72px 0; }
  .site-header { backdrop-filter: blur(12px); }
  .nav-toggle { display: flex; }
  .site-nav { position: absolute; left: 14px; right: 14px; top: 64px; display: none; align-items: stretch; flex-direction: column; gap: 0; padding: .7rem; background: #fff; border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); }
  .site-nav.is-open { display: flex; }
  .site-nav a { padding: .72rem .8rem; border-radius: 8px; }
  .site-nav .nav-resume { margin-top: .4rem; text-align: center; }
  .hero { padding-top: 55px; }
  .hero-grid { grid-template-columns: 1fr; }
  h1 { font-size: clamp(2.55rem, 12vw, 4.3rem); }
  .hero-portrait-wrap { justify-self: stretch; width: min(100%, 430px); margin-inline: auto; }
  .hero-portrait { aspect-ratio: 4/4.5; object-position: center top; }
  .hero-meta { display: grid; gap: .35rem; }
  .hero-meta li + li::before { content: none; }
  .section-heading { display: grid; gap: 1rem; align-items: start; }
  .section-intro { max-width: none; }
  .focus-grid { grid-template-columns: 1fr; }
  .focus-card { min-height: auto; }
  .project, .project:nth-child(even) { grid-template-columns: 1fr; }
  .project:nth-child(even) .project-media, .project:nth-child(even) .project-content { order: initial; }
  .project-media { min-height: 320px; }
  .media-video { min-height: 450px; }
  .project-content { padding: 1.7rem; }
  .publication-list li { grid-template-columns: 54px 1fr; gap: .8rem; }
  .thesis-row { grid-template-columns: 1fr; }
  .timeline li { grid-template-columns: 1fr; gap: .5rem; }
  .timeline-content { margin-left: .35rem; }
  .education-panel { display: block; }
  .education-panel article { padding: 0 0 1.2rem; margin-bottom: 1.2rem; border-right: 0; border-bottom: 1px solid var(--line); }
  .contact-card { grid-template-columns: 1fr; gap: 1.6rem; }
  .contact-actions { min-width: 0; }
  .footer-inner { display: grid; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
