:root {
  --ink: #171b18;
  --paper: #eef0ea;
  --paper-strong: #fbfcf7;
  --muted: #5c655f;
  --line: #cbd0c8;
  --lime: #d7e685;
  --cyan: #52c8d8;
  --coral: #ff8066;
  --blue: #4d68ff;
  --max: 1240px;
  --header-height: 72px;
  color-scheme: light;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-height) + 24px); }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; font-size: 16px; line-height: 1.55; letter-spacing: 0; }
body.nav-open { overflow: hidden; }
a { color: inherit; }
img { display: block; max-width: 100%; }
button, input, textarea { font: inherit; }
::selection { background: var(--lime); color: var(--ink); }

.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; top: 8px; left: 8px; z-index: 100; padding: 10px 14px; background: var(--ink); color: #fff; transform: translateY(-150%); }
.skip-link:focus { transform: translateY(0); }

.site-header { position: fixed; inset: 0 0 auto; z-index: 50; height: var(--header-height); display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 28px; padding: 0 max(22px, calc((100vw - var(--max)) / 2)); border-bottom: 1px solid transparent; transition: background-color 180ms ease, border-color 180ms ease, color 180ms ease; }
.site-header.is-scrolled, .interior-page .site-header { background: rgba(238, 240, 234, 0.92); border-color: rgba(23, 27, 24, 0.14); backdrop-filter: blur(14px); }
.brand { position: relative; z-index: 2; width: max-content; display: flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 760; font-size: 0.9rem; }
.brand-mark { display: grid; place-items: center; width: 32px; height: 32px; background: var(--ink); color: #fff; font-size: 0.65rem; }
.site-nav { display: flex; align-items: center; gap: clamp(18px, 2.4vw, 32px); }
.site-nav a, .header-contact { position: relative; text-decoration: none; font-size: 0.84rem; font-weight: 680; }
.site-nav a { color: var(--muted); }
.site-nav a::after { content: ""; position: absolute; left: 0; right: 0; bottom: -8px; height: 2px; background: var(--coral); transform: scaleX(0); transform-origin: left; transition: transform 180ms ease; }
.site-nav a:hover::after, .site-nav a:focus-visible::after, .site-nav a[aria-current="page"]::after { transform: scaleX(1); }
.site-nav a[aria-current="page"] { color: var(--ink); }
.mobile-nav-contact { display: none; }
.header-contact { justify-self: end; padding: 9px 0; }
.nav-toggle { display: none; width: 42px; height: 42px; border: 0; background: transparent; padding: 10px; }
.nav-toggle > span:not(.sr-only) { display: block; width: 22px; height: 2px; margin: 4px auto; background: currentColor; transition: transform 180ms ease, opacity 180ms ease; }
.nav-toggle[aria-expanded="true"] > span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] > span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] > span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

.eyebrow { margin: 0 0 18px; color: var(--muted); font-size: 0.72rem; font-weight: 780; text-transform: uppercase; letter-spacing: 0.14em; }
.button { min-height: 46px; display: inline-flex; align-items: center; justify-content: center; gap: 14px; padding: 12px 18px; border: 1px solid transparent; border-radius: 4px; text-decoration: none; font-size: 0.85rem; font-weight: 760; transition: transform 180ms ease, background-color 180ms ease, color 180ms ease; }
.button:hover, .button:focus-visible { transform: translateY(-2px); }
.button-primary { background: var(--ink); color: #fff; }
.button-primary:hover { background: var(--blue); }
.button-light { background: var(--paper-strong); color: var(--ink); }
.text-link, .scene-link { width: max-content; text-decoration: none; font-size: 0.88rem; font-weight: 760; border-bottom: 1px solid currentColor; }
.action-row { display: flex; align-items: center; gap: 24px; flex-wrap: wrap; margin-top: 30px; }

/* Scroll world */
.world { position: relative; height: 600svh; min-height: 4200px; background: var(--paper); }
.world-stage { position: sticky; top: 0; z-index: 1; height: 100svh; min-height: 620px; overflow: hidden; }
.world-canvas, .world-fallback, .world-wash { position: absolute; inset: 0; width: 100%; height: 100%; }
.world-canvas { display: block; opacity: 0; transition: opacity 600ms ease; }
.world.is-ready .world-canvas { opacity: 1; }
.world-fallback { background: var(--paper) url("/assets/hero-systems.webp") center / cover no-repeat; }
.world.is-ready .world-fallback { opacity: 0; }
.world-wash { pointer-events: none; background: linear-gradient(90deg, rgba(238, 240, 234, 0.97) 0%, rgba(238, 240, 234, 0.7) 25%, rgba(238, 240, 234, 0.03) 48%, rgba(238, 240, 234, 0.64) 76%, rgba(238, 240, 234, 0.96) 100%); }
.world-scenes { position: absolute; inset: 0; z-index: 3; pointer-events: none; }
.world-copy { --scene-opacity: 0; --scene-shift: 42px; position: absolute; left: max(22px, calc((100vw - var(--max)) / 2)); right: max(22px, calc((100vw - var(--max)) / 2)); top: calc(var(--scene-index, 0) * 100svh); height: 100svh; min-height: 620px; display: flex; flex-direction: column; justify-content: center; align-items: flex-start; max-width: 610px; padding-top: var(--header-height); opacity: var(--scene-opacity); transform: translateY(var(--scene-shift)); transition: opacity 120ms linear; }
.world-copy:nth-child(1) { --scene-index: 0; }
.world-copy:nth-child(2) { --scene-index: 1; }
.world-copy:nth-child(3) { --scene-index: 2; }
.world-copy:nth-child(4) { --scene-index: 3; }
.world-copy:nth-child(5) { --scene-index: 4; }
.world-copy:nth-child(6) { --scene-index: 5; }
.world-copy[data-align="right"] { left: auto; align-items: flex-end; text-align: right; }
.world-copy[data-align="center"] { left: 50%; right: auto; width: min(760px, calc(100% - 44px)); max-width: 760px; align-items: center; text-align: center; transform: translate(-50%, var(--scene-shift)); }
.world-copy-final { isolation: isolate; }
.world-copy-final::before { content: ""; position: absolute; z-index: -1; inset: 12% -24%; background: radial-gradient(ellipse at center, rgba(238, 240, 234, 0.98) 0%, rgba(238, 240, 234, 0.9) 42%, rgba(238, 240, 234, 0.54) 60%, transparent 76%); pointer-events: none; }
.world-copy.is-active { pointer-events: auto; }
.world-copy h1 { margin: 0; font-size: clamp(4.8rem, 10vw, 9.8rem); line-height: 0.78; font-weight: 830; letter-spacing: 0; }
.world-copy h2 { margin: 0; max-width: 760px; font-size: clamp(3rem, 6vw, 6.6rem); line-height: 0.92; font-weight: 810; letter-spacing: 0; }
.world-copy > p:not(.eyebrow) { max-width: 520px; margin: 26px 0 0; color: #38403a; font-size: clamp(1rem, 1.4vw, 1.22rem); }
.world-copy[data-align="right"] > p { max-width: 470px; }
.scene-link { margin-top: 28px; }
.action-row-center { justify-content: center; }
.world-status { position: absolute; z-index: 5; right: max(22px, calc((100vw - var(--max)) / 2)); bottom: 30px; display: grid; grid-template-columns: auto 90px auto; align-items: center; gap: 10px; font-size: 0.66rem; font-weight: 790; }
.world-status-line { height: 1px; background: var(--line); overflow: hidden; }
.world-status-line i { display: block; width: 100%; height: 100%; background: var(--ink); transform: scaleX(0); transform-origin: left; }
.world-scroll-cue { position: absolute; z-index: 5; left: max(22px, calc((100vw - var(--max)) / 2)); bottom: 24px; display: flex; align-items: center; gap: 14px; margin: 0; font-size: 0.7rem; font-weight: 720; text-transform: uppercase; letter-spacing: 0.12em; transition: opacity 200ms ease; }
.world-scroll-cue i { position: relative; width: 1px; height: 38px; background: var(--line); overflow: hidden; }
.world-scroll-cue i::after { content: ""; position: absolute; inset: 0; background: var(--ink); animation: scroll-cue 1.8s ease-in-out infinite; }
.world-complete .world-scroll-cue { opacity: 0; }
@keyframes scroll-cue { 0% { transform: translateY(-100%); } 50%, 100% { transform: translateY(100%); } }

.home-index { padding: 140px max(22px, calc((100vw - var(--max)) / 2)); background: var(--paper-strong); }
.section-intro { display: grid; grid-template-columns: minmax(160px, 0.45fr) 1fr; gap: 48px; align-items: start; margin-bottom: 82px; }
.section-intro h2 { margin: 0; font-size: clamp(2.5rem, 5vw, 5.8rem); line-height: 0.95; letter-spacing: 0; }
.index-links { border-top: 1px solid var(--line); }
.index-link { display: grid; grid-template-columns: 72px 1.1fr 1fr 32px; align-items: center; gap: 24px; min-height: 116px; border-bottom: 1px solid var(--line); text-decoration: none; transition: background-color 180ms ease, padding 180ms ease; }
.index-link:hover { padding-inline: 16px; background: var(--lime); }
.index-link span { font-size: 0.68rem; font-weight: 760; }
.index-link strong { font-size: clamp(1.6rem, 2.4vw, 2.4rem); }
.index-link em { color: var(--muted); font-style: normal; }
.index-link i { font-style: normal; font-size: 1.3rem; }
.availability-band { display: grid; grid-template-columns: 0.45fr 1fr auto; align-items: center; gap: 48px; padding: 100px max(22px, calc((100vw - var(--max)) / 2)); background: var(--ink); color: #fff; }
.availability-band p { color: #aeb8b0; font-size: 0.8rem; }
.availability-band h2 { margin: 0; max-width: 680px; font-size: clamp(2rem, 3.6vw, 4.4rem); line-height: 1; }

/* Interior pages */
.interior-page main { padding-top: var(--header-height); }
.page-hero { min-height: min(720px, 78svh); display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(260px, 0.5fr); gap: 60px; align-items: end; padding: 110px max(22px, calc((100vw - var(--max)) / 2)) 74px; border-bottom: 1px solid var(--line); }
.page-hero h1 { margin: 0; max-width: 920px; font-size: clamp(4.4rem, 10vw, 10rem); line-height: 0.78; letter-spacing: 0; }
.page-hero-copy { align-self: end; max-width: 390px; }
.page-hero-copy p { margin: 0; color: var(--muted); font-size: 1.08rem; }
.page-hero-meta { display: flex; gap: 20px; flex-wrap: wrap; margin-top: 28px; font-size: 0.72rem; font-weight: 760; text-transform: uppercase; letter-spacing: 0.1em; }
.content-band { padding: 120px max(22px, calc((100vw - var(--max)) / 2)); }
.content-band + .content-band { border-top: 1px solid var(--line); }
.content-band.alt { background: var(--paper-strong); }
.band-heading { display: grid; grid-template-columns: minmax(180px, 0.42fr) 1fr; gap: 50px; margin-bottom: 70px; }
.band-heading h2 { margin: 0; max-width: 860px; font-size: clamp(2.5rem, 5vw, 5.4rem); line-height: 0.96; }
.band-heading p { max-width: 620px; margin: 22px 0 0; color: var(--muted); }

.project-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.project-card { min-height: 520px; display: flex; flex-direction: column; padding: clamp(24px, 3.5vw, 48px); border: 1px solid var(--line); border-radius: 6px; background: var(--paper-strong); overflow: hidden; }
.project-card:nth-child(1) { background: var(--ink); color: #fff; }
.project-card:nth-child(2) { background: var(--cyan); }
.project-card:nth-child(3) { background: var(--lime); }
.project-card:nth-child(4) { background: var(--coral); }
.project-number { margin: 0 0 auto; font-size: 0.7rem; font-weight: 790; }
.project-card h2, .project-card h3 { max-width: 580px; margin: 60px 0 18px; font-size: clamp(2rem, 3.6vw, 4rem); line-height: 0.96; }
.project-card p { max-width: 600px; margin: 0; }
.project-card:nth-child(1) p { color: #c5cec7; }
.project-footer { display: flex; justify-content: space-between; align-items: end; gap: 28px; margin-top: 38px; }
.tag-row { display: flex; flex-wrap: wrap; gap: 8px; }
.tag-row span { padding: 6px 9px; border: 1px solid currentColor; border-radius: 3px; font-size: 0.66rem; font-weight: 720; }
.project-arrow { text-decoration: none; font-size: 1.5rem; }

.timeline { border-top: 1px solid var(--line); }
.timeline-entry { display: grid; grid-template-columns: 0.34fr 1fr; gap: 48px; padding: 48px 0; border-bottom: 1px solid var(--line); }
.timeline-date { font-size: 0.74rem; font-weight: 780; text-transform: uppercase; letter-spacing: 0.1em; }
.timeline-org { margin: 0 0 10px; color: var(--blue); font-size: 0.76rem; font-weight: 780; text-transform: uppercase; letter-spacing: 0.1em; }
.timeline-entry h2, .timeline-entry h3 { margin: 0 0 16px; max-width: 820px; font-size: clamp(1.7rem, 3vw, 3rem); line-height: 1.05; }
.timeline-entry p:last-child { max-width: 750px; margin: 0; color: var(--muted); }

.research-feature { display: grid; grid-template-columns: 0.68fr 1fr; min-height: 560px; }
.research-visual { min-height: 440px; display: grid; place-items: center; background: var(--ink); color: #fff; overflow: hidden; }
.research-diagram { position: relative; width: min(390px, 78%); aspect-ratio: 1; }
.research-diagram::before, .research-diagram::after { content: ""; position: absolute; top: 50%; width: 36%; height: 36%; border: 2px solid currentColor; transform: translateY(-50%) rotate(45deg); }
.research-diagram::before { left: 4%; color: var(--coral); }
.research-diagram::after { right: 4%; color: var(--cyan); }
.research-diagram span { position: absolute; inset: 42% 25%; z-index: 1; display: grid; place-items: center; background: var(--lime); color: var(--ink); font-size: 0.7rem; font-weight: 820; }
.research-copy { display: flex; flex-direction: column; justify-content: center; padding: clamp(36px, 7vw, 96px); background: var(--paper-strong); }
.research-copy h2 { margin: 0 0 24px; font-size: clamp(2.4rem, 4.5vw, 5rem); line-height: 0.97; }
.research-copy p { max-width: 620px; color: var(--muted); }
.research-copy cite { margin-top: 28px; font-style: normal; font-size: 0.76rem; font-weight: 760; }

.principle-grid, .skill-columns { display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid var(--line); }
.principle, .skill-column { padding: 42px 32px 42px 0; border-bottom: 1px solid var(--line); }
.principle + .principle, .skill-column + .skill-column { padding-left: 32px; border-left: 1px solid var(--line); }
.principle span { display: block; margin-bottom: 80px; font-size: 0.7rem; font-weight: 780; }
.principle h3, .skill-column h3 { margin: 0 0 14px; font-size: 1.45rem; }
.principle p, .skill-column p { color: var(--muted); }
.profile-layout { display: grid; grid-template-columns: minmax(280px, 0.72fr) 1fr; gap: clamp(48px, 8vw, 120px); align-items: start; }
.profile-photo { aspect-ratio: 4 / 5; width: 100%; object-fit: cover; object-position: center; background: var(--cyan); }
.profile-story h2 { margin: 0 0 32px; font-size: clamp(2.7rem, 5.5vw, 6.4rem); line-height: 0.92; }
.profile-story p { max-width: 680px; font-size: 1.05rem; }
.education-row { display: grid; grid-template-columns: 0.42fr 1fr; gap: 48px; padding: 42px 0; border-top: 1px solid var(--line); }
.education-row:last-child { border-bottom: 1px solid var(--line); }
.education-row h3 { margin: 0 0 8px; font-size: clamp(1.5rem, 2.7vw, 2.7rem); }
.education-row p { margin: 0; color: var(--muted); }

.contact-layout { min-height: calc(100svh - var(--header-height)); display: grid; grid-template-columns: 1.1fr 0.9fr; }
.contact-main { display: flex; flex-direction: column; justify-content: center; padding: 110px max(32px, calc((100vw - var(--max)) / 2)); padding-right: clamp(40px, 7vw, 110px); }
.contact-main h1 { margin: 0; max-width: 760px; font-size: clamp(4rem, 8vw, 9rem); line-height: 0.84; }
.contact-main > p:not(.eyebrow) { max-width: 620px; margin: 32px 0; color: var(--muted); font-size: 1.08rem; }
.contact-email { width: max-content; max-width: 100%; font-size: clamp(1.05rem, 2vw, 1.6rem); font-weight: 760; text-decoration-thickness: 1px; text-underline-offset: 6px; overflow-wrap: anywhere; }
.contact-aside { display: flex; flex-direction: column; justify-content: flex-end; padding: clamp(40px, 7vw, 96px); background: var(--ink); color: #fff; }
.contact-aside h2 { margin: 0 0 40px; font-size: clamp(2rem, 4vw, 4.2rem); line-height: 1; }
.contact-options { border-top: 1px solid #4a514c; }
.contact-option { display: flex; justify-content: space-between; gap: 20px; padding: 22px 0; border-bottom: 1px solid #4a514c; text-decoration: none; }

.next-page { display: flex; align-items: center; justify-content: space-between; gap: 30px; padding: 72px max(22px, calc((100vw - var(--max)) / 2)); background: var(--lime); text-decoration: none; }
.next-page span { font-size: 0.72rem; font-weight: 780; text-transform: uppercase; letter-spacing: 0.12em; }
.next-page strong { font-size: clamp(2rem, 5vw, 5.4rem); line-height: 1; }
.next-page i { font-size: 2rem; font-style: normal; }

.site-footer { display: grid; grid-template-columns: 1fr 1fr auto auto; align-items: center; gap: 32px; padding: 40px max(22px, calc((100vw - var(--max)) / 2)); border-top: 1px solid var(--line); background: var(--paper); font-size: 0.76rem; }
.footer-brand { font-weight: 790; text-decoration: none; }
.site-footer > p { margin: 0; color: var(--muted); }
.footer-links { display: flex; gap: 20px; }
.footer-links a { text-decoration: none; font-weight: 680; }

.has-js .reveal { opacity: 0; transform: translateY(24px); transition: opacity 650ms ease, transform 650ms cubic-bezier(0.22, 1, 0.36, 1); }
.has-js .reveal.is-visible { opacity: 1; transform: none; }

@media (max-width: 900px) {
  :root { --header-height: 64px; }
  .site-header { grid-template-columns: 1fr auto; padding-inline: 18px; }
  .nav-toggle { display: block; justify-self: end; z-index: 2; }
  .site-nav { position: fixed; inset: 0; z-index: 1; display: flex; flex-direction: column; align-items: flex-start; justify-content: center; gap: 22px; padding: 90px 28px; background: var(--paper); visibility: hidden; opacity: 0; transform: translateY(-12px); transition: opacity 180ms ease, transform 180ms ease, visibility 180ms; }
  .nav-open .site-nav { visibility: visible; opacity: 1; transform: none; }
  .site-nav a { font-size: clamp(2.2rem, 11vw, 4.6rem); line-height: 1; color: var(--ink); }
  .header-contact { display: none; }
  .mobile-nav-contact { display: block; }
  .world-wash { background: linear-gradient(180deg, rgba(238, 240, 234, 0.04) 0%, rgba(238, 240, 234, 0.18) 38%, rgba(238, 240, 234, 0.76) 52%, rgba(238, 240, 234, 0.98) 66%, var(--paper) 100%); }
  .world-copy, .world-copy[data-align="right"], .world-copy[data-align="center"] { left: 20px; right: 20px; width: auto; max-width: none; height: 100svh; min-height: 620px; align-items: flex-start; justify-content: flex-end; padding: var(--header-height) 0 100px; text-align: left; transform: translateY(var(--scene-shift)); }
  .world-copy h1 { font-size: clamp(4.1rem, 22vw, 7.2rem); }
  .world-copy h2 { font-size: clamp(2.65rem, 12vw, 4.8rem); }
  .world-copy > p:not(.eyebrow) { margin-top: 16px; font-size: 0.98rem; line-height: 1.45; }
  .world-copy .eyebrow { margin-bottom: 12px; }
  .scene-link { margin-top: 18px; }
  .action-row { margin-top: 20px; gap: 18px; }
  .action-row-center { justify-content: flex-start; }
  .world-status { right: 20px; bottom: 22px; grid-template-columns: auto 54px auto; }
  .world-scroll-cue { left: 20px; bottom: 18px; }
  .world-scroll-cue span { display: none; }
  .section-intro, .band-heading, .page-hero { grid-template-columns: 1fr; }
  .section-intro { gap: 18px; margin-bottom: 54px; }
  .availability-band { grid-template-columns: 1fr; gap: 24px; }
  .project-grid { grid-template-columns: 1fr; }
  .page-hero { min-height: 66svh; gap: 38px; padding-top: 90px; }
  .research-feature, .profile-layout, .contact-layout { grid-template-columns: 1fr; }
  .research-visual { min-height: 380px; }
  .principle-grid, .skill-columns { grid-template-columns: 1fr; }
  .principle + .principle, .skill-column + .skill-column { padding-left: 0; border-left: 0; }
  .principle span { margin-bottom: 40px; }
  .contact-main { min-height: 74svh; padding-inline: 24px; }
  .contact-aside { min-height: 520px; }
  .site-footer { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 600px) {
  .home-index, .content-band { padding-top: 88px; padding-bottom: 88px; }
  .index-link { grid-template-columns: 38px 1fr 28px; gap: 12px; min-height: 94px; }
  .index-link em { display: none; }
  .page-hero { padding-bottom: 48px; }
  .page-hero h1 { font-size: clamp(3.8rem, 21vw, 6.2rem); }
  .project-card { min-height: 430px; }
  .project-footer { align-items: start; flex-direction: column; }
  .timeline-entry, .education-row { grid-template-columns: 1fr; gap: 18px; }
  .next-page { align-items: flex-end; }
  .next-page strong { display: block; margin-top: 8px; }
  .site-footer { grid-template-columns: 1fr; gap: 16px; }
  .footer-links { flex-wrap: wrap; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
  .world { height: auto; min-height: 0; }
  .world-stage { position: absolute; inset: 0; height: 100svh; }
  .world-scenes { position: relative; }
  .world-copy { position: relative; top: auto; opacity: 1; transform: none; }
  .world-copy:not(:first-child) { min-height: 70svh; border-top: 1px solid var(--line); }
  .world-scroll-cue, .world-status { display: none; }
}
