:root {
  --paper: #f3f1ec;
  --ink: #161513;
  --soft: #6f6b63;
  --rule: #d9d5cc;
  --red: #b5421f;
  --surface: #e9e6df;
  --gutter: clamp(20px, 4vw, 48px);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #161513;
    --ink: #ece8df;
    --soft: #aaa59a;
    --rule: #393630;
    --red: #ee875f;
    --surface: #24221e;
    color-scheme: dark;
  }
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", system-ui, sans-serif;
  font-size: 16px; line-height: 1.8;
}
a { color: inherit; text-underline-offset: 5px; }
button { font: inherit; color: inherit; cursor: pointer; }
button:disabled { cursor: default; }
a, button { -webkit-tap-highlight-color: transparent; }
a:focus-visible, button:focus-visible, video:focus-visible { outline: 2px solid var(--red); outline-offset: 5px; }
h1, h2, h3, h4, p, dl, dd, ol, ul, figure { margin: 0; padding: 0; }
ol, ul { list-style: none; }
.mono {
  font-family: ui-monospace, "SF Mono", "Cascadia Mono", Consolas, monospace;
  font-size: 12px; letter-spacing: .02em; font-weight: 400; color: var(--soft);
}
.wrap {
  max-width: 1200px; margin: 0 auto;
  padding-left: max(var(--gutter), env(safe-area-inset-left));
  padding-right: max(var(--gutter), env(safe-area-inset-right));
}
section { scroll-margin-top: 28px; }
.skip-link { position: fixed; left: 20px; top: -100px; z-index: 10; padding: 10px 20px; background: var(--ink); color: var(--paper); }
.skip-link:focus { top: 12px; }
.top { display: flex; justify-content: space-between; align-items: center; padding-top: 24px; padding-bottom: 24px; font-size: 14px; }
.name { display: inline-flex; gap: 10px; align-items: center; text-decoration: none; font-weight: 600; }
.name-mark { width: 9px; height: 9px; background: var(--red); }
.top nav { display: flex; gap: 28px; }
.top nav a { text-decoration: none; color: var(--soft); padding: 6px 0; }
.top nav a:hover { color: var(--red); }
.intro { padding-top: clamp(42px, 6vw, 80px); padding-bottom: clamp(56px, 7vw, 88px); }
.eyebrow { letter-spacing: .14em; margin-bottom: 22px; }
.eyebrow span { color: var(--red); padding: 0 8px; }
.intro h1 { font-size: clamp(60px, 10vw, 120px); font-weight: 700; line-height: 1.15; letter-spacing: -.05em; }
.accent { color: var(--red); padding-left: 6px; }
.facts { margin-top: 38px; display: grid; grid-template-columns: repeat(3, 1fr); column-gap: 24px; border-top: 1px solid var(--ink); }
.facts div { padding: 12px 0 15px; border-bottom: 1px solid var(--rule); }
.facts dt { color: var(--soft); font-size: 12px; margin-bottom: 2px; }
.facts dd { font-size: 15px; }
.intro-detail { margin-left: calc((100% - 48px) / 3 + 24px); margin-top: 25px; }
.bio { max-width: 40em; font-size: 16px; }
.actions { display: flex; align-items: center; gap: 28px; margin-top: 24px; }
.button { display: inline-flex; align-items: center; justify-content: space-between; gap: 32px; padding: 9px 18px; text-decoration: none; font-size: 14px; }
.primary { background: var(--ink); color: var(--paper); }
.primary:hover { background: var(--red); color: var(--paper); }
.text-link { font-size: 14px; text-decoration: none; }
.text-link:hover { color: var(--red); }
.text-link span { margin-left: 7px; }
.label { display: flex; align-items: baseline; gap: 16px; font-size: 16px; font-weight: 600; padding-top: 16px; border-top: 1px solid var(--ink); margin-bottom: 28px; }
.label > span { font-family: ui-monospace, Consolas, monospace; font-size: 12px; color: var(--red); font-weight: 400; }
.label small { margin-left: auto; letter-spacing: .08em; }
.work, .cv, .contact { padding-bottom: clamp(64px, 8vw, 104px); }
.player { position: relative; aspect-ratio: 16 / 9; background: #080a09; }
.player video { display: block; width: 100%; height: 100%; object-fit: contain; }
.play { position: absolute; left: 24px; bottom: 24px; display: inline-flex; align-items: center; gap: 12px; min-height: 48px; padding: 0 18px; border: 0; background: #f3f1ec; color: #161513; font-size: 14px; box-shadow: 0 2px 14px #0003; }
.play:hover { background: #b5421f; color: #fff; }
.tri { width: 0; height: 0; border-left: 8px solid currentColor; border-top: 5px solid transparent; border-bottom: 5px solid transparent; }
.dur { font-family: ui-monospace, Consolas, monospace; font-size: 12px; opacity: .7; padding-left: 8px; border-left: 1px solid currentColor; }
.caption { display: flex; justify-content: space-between; align-items: end; gap: 12px 24px; padding: 19px 0; border-bottom: 1px solid var(--rule); }
.caption h3 { font-size: clamp(20px, 2.5vw, 27px); font-weight: 600; margin-top: 4px; }
.video-link { flex-shrink: 0; margin-bottom: 3px; }
.notes { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; margin-top: 26px; }
.notes h4 { font-size: 12px; font-weight: 400; color: var(--soft); margin-bottom: 7px; }
.notes p { max-width: 33em; font-size: 15px; }
.chapter-heading, .subheading { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.chapter-heading { margin: 32px 0 14px; }
.chapter-heading h4 { font-size: 14px; font-weight: 500; }
.chapters { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.chapter { padding: 0; border: 0; text-align: left; background: transparent; }
.chapter-image { position: relative; display: block; overflow: hidden; aspect-ratio: 16 / 9; background: var(--surface); }
.chapter img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform .25s ease; }
.chapter-play { position: absolute; right: 10px; top: 10px; display: grid; place-items: center; width: 28px; height: 28px; background: #f3f1ec; color: #161513; }
.chapter:hover img { transform: scale(1.035); }
.chapter:hover strong { color: var(--red); }
.chapter-caption { display: flex; justify-content: space-between; gap: 8px; padding-top: 10px; }
.chapter-caption strong { font-size: 14px; font-weight: 500; }
.chapter-note { margin-top: 14px; color: var(--soft); font-size: 13px; }
.photography { margin-top: 56px; padding-top: 24px; border-top: 1px solid var(--rule); scroll-margin-top: 28px; }
.photo-grid { columns: 3; column-gap: 20px; margin-top: 22px; }
.photo-card { break-inside: avoid; margin-bottom: 26px; }
.photo-link { position: relative; display: block; background: var(--surface); }
.photo-link img { display: block; width: 100%; height: auto; }
.photo-expand { position: absolute; right: 10px; bottom: 10px; display: grid; place-items: center; width: 30px; height: 30px; background: #f3f1ec; color: #161513; font-size: 19px; opacity: 0; transition: opacity .2s ease; }
.photo-link:hover .photo-expand, .photo-link:focus-visible .photo-expand { opacity: 1; }
.photo-caption { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding-top: 9px; }
.photo-caption strong { font-size: 14px; font-weight: 500; }
.photo-carousel { margin-top: 22px; }
.photo-carousel.is-ready .photo-grid { columns: auto; margin: 0; }
.photo-carousel.is-ready .photo-card { margin: 0; }
.photo-carousel.is-ready .photo-link { height: clamp(250px, 52vw, 600px); background: #10110f; touch-action: pan-y; }
.photo-carousel.is-ready .photo-link img { width: 100%; height: 100%; object-fit: contain; animation: carousel-appear .25s ease; }
.photo-carousel.is-ready .photo-expand { opacity: 1; }
.carousel-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-top: 18px; }
.carousel-navigation { display: flex; align-items: center; gap: 16px; }
.carousel-navigation button { width: 44px; height: 44px; border: 1px solid var(--rule); background: transparent; font-size: 21px; }
.carousel-navigation button:hover { border-color: var(--red); color: var(--red); }
.carousel-toggle { min-height: 44px; padding: 0; border: 0; background: transparent; color: var(--soft); font-size: 12px; }
.carousel-toggle:hover { color: var(--red); }
.carousel-dots { display: flex; justify-content: center; flex-wrap: wrap; margin-top: 8px; }
.carousel-dot { display: grid; place-items: center; width: 24px; height: 32px; padding: 0; border: 0; background: transparent; }
.carousel-dot::after { content: ""; width: 6px; height: 6px; border-radius: 5px; background: var(--soft); opacity: .4; }
.carousel-dot[aria-current="true"]::after { width: 18px; background: var(--red); opacity: 1; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
@keyframes carousel-appear { from { opacity: .35; } to { opacity: 1; } }
body.photo-viewing { overflow: hidden; }
.photo-dialog { width: min(1200px, calc(100vw - 40px)); height: calc(100dvh - 40px); max-width: none; max-height: none; margin: auto; padding: 18px 24px; border: 1px solid #3b3b35; background: #10110f; color: #f3f1ec; }
.photo-dialog[open] { display: flex; flex-direction: column; gap: 14px; }
.photo-dialog::backdrop { background: #000d; }
.lightbox-head, .lightbox-foot { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-shrink: 0; }
.lightbox-head .mono { color: #b7b3a9; }
.lightbox-close { display: inline-flex; align-items: center; gap: 12px; min-height: 44px; padding: 0 4px; border: 0; background: transparent; color: inherit; font-size: 13px; }
.lightbox-close span { font-size: 26px; line-height: 1; }
.lightbox-stage { flex: 1; min-height: 0; display: grid; place-items: center; }
.lightbox-stage img { display: block; width: 100%; height: 100%; min-height: 0; object-fit: contain; }
.lightbox-foot p { font-size: 14px; }
.lightbox-controls { display: flex; gap: 8px; }
.lightbox-controls button { width: 44px; height: 44px; padding: 0; border: 1px solid #55564e; background: transparent; color: inherit; font-size: 21px; }
.lightbox-controls button:hover, .lightbox-close:hover { color: #ee875f; border-color: #ee875f; }
@media (max-width: 900px) { .photo-grid { columns: 2; } }
.other-projects { margin-top: 52px; }
.subheading { margin-bottom: 12px; }
.subheading h3 { font-size: 17px; font-weight: 600; }
.project-row { display: grid; grid-template-columns: 32px 1fr auto; gap: 16px; align-items: baseline; padding: 22px 0; border-top: 1px solid var(--rule); }
.project-row h4 { font-size: 16px; font-weight: 500; }
.project-row p { color: var(--soft); font-size: 14px; margin-top: 5px; }
.project-role { color: var(--red); font-size: 12px; }
.section-grid { display: grid; grid-template-columns: 1fr 2fr; gap: 24px; padding: 28px 0; border-bottom: 1px solid var(--rule); }
.cv .section-grid:first-of-type { padding-top: 0; }
.side-title { font-size: 14px; font-weight: 500; color: var(--soft); }
.section-grid h4 { font-size: 18px; font-weight: 500; margin: 6px 0; }
.section-grid p:not(.mono) { font-size: 14px; color: var(--soft); max-width: 43em; }
.timeline { border-left: 1px solid var(--rule); padding-left: 25px; }
.timeline li { position: relative; }
.timeline li + li { margin-top: 28px; }
.timeline li::before { content: ""; position: absolute; left: -29px; top: 7px; width: 7px; height: 7px; background: var(--red); }
.academic { display: flex; gap: 40px; margin-top: 20px; font-size: 12px; color: var(--soft); }
.academic strong { font-size: 24px; font-weight: 500; color: var(--ink); padding-left: 8px; }
.honors li { display: flex; justify-content: space-between; gap: 20px; font-size: 15px; }
.honors li + li { margin-top: 10px; }
.skills-section { border-bottom: 0; padding-bottom: 0; }
.skills { display: grid; grid-template-columns: repeat(2, 1fr); gap: 24px; }
.skills li { display: flex; align-items: center; gap: 14px; }
.tool-icon { display: block; width: 42px; height: 42px; flex-shrink: 0; object-fit: contain; }
.skills strong { display: block; font-size: 14px; font-weight: 500; line-height: 1.5; }
.skills div > span { font-size: 12px; color: var(--soft); }
.rows li { display: grid; grid-template-columns: 5.5em 1fr; align-items: baseline; gap: 18px; padding: 16px 0; border-bottom: 1px solid var(--rule); font-size: 15px; }
.rows li a { text-decoration-color: var(--rule); width: fit-content; }
.rows li a:hover { text-decoration-color: var(--red); }
.rows li a .mono { margin-left: 8px; }
.copy-row { display: flex; align-items: baseline; flex-wrap: wrap; gap: 10px 24px; }
.copy-button { font-size: 12px; border: 0; border-bottom: 1px solid var(--rule); padding: 4px 0; color: var(--soft); background: transparent; }
.copy-button:hover { color: var(--red); border-color: var(--red); }
.status:empty { display: none; }
.status { font-size: 13px; color: var(--red); margin-top: 12px; }
.foot { display: flex; justify-content: space-between; gap: 16px; padding-top: 20px; padding-bottom: max(30px, env(safe-area-inset-bottom)); border-top: 1px solid var(--rule); }
.foot a { text-decoration: none; }
.foot a:hover { color: var(--red); }
@media (max-width: 759px) {
  .chapters { grid-template-columns: repeat(2, 1fr); }
  .facts { grid-template-columns: 1fr; }
  .facts div { display: grid; grid-template-columns: 6em 1fr; padding: 12px 0; }
  .facts dt { margin: 0; align-self: center; }
  .intro-detail { margin-left: 0; }
  .notes { grid-template-columns: 1fr; gap: 20px; }
  .chapters { gap: 12px; }
  .section-grid { grid-template-columns: 1fr; gap: 18px; }
  .skills { gap: 22px; }
  .project-row { grid-template-columns: 24px 1fr; gap: 10px; }
  .project-role { grid-column: 2; }
}
@media (max-width: 480px) {
  .photo-grid { columns: 1; }
  .photo-expand { opacity: 1; }
  .photo-dialog { width: calc(100vw - 24px); height: calc(100dvh - 24px); padding: 12px; }
  .top { padding-top: 16px; padding-bottom: 16px; }
  .top nav { gap: 22px; }
  .eyebrow { font-size: 10px; letter-spacing: .1em; }
  .eyebrow span { padding: 0 5px; }
  .facts { margin-top: 28px; }
  .facts dd { font-size: 14px; }
  .label { gap: 12px; margin-bottom: 20px; }
  .label small { font-size: 9px; letter-spacing: 0; }
  .play { left: 12px; bottom: 12px; min-height: 42px; padding: 0 12px; gap: 9px; font-size: 12px; }
  .caption { align-items: start; flex-direction: column; gap: 10px; }
  .chapter-heading { align-items: center; }
  .chapter-heading .mono { font-size: 10px; }
  .chapters { grid-template-columns: 1fr; gap: 12px; }
  .chapter { display: grid; grid-template-columns: 112px 1fr; align-items: center; gap: 16px; }
  .chapter-caption { flex-direction: column; gap: 0; padding-top: 0; }
  .chapter-play { width: 22px; height: 22px; top: 5px; right: 5px; font-size: 12px; }
  .subheading { align-items: start; flex-direction: column; gap: 4px; }
  .project-row h4 { font-size: 15px; }
  .academic { gap: 24px; }
  .honors { font-size: 14px; }
  .honors li { gap: 10px; }
  .honors .mono { font-size: 11px; }
  .rows li { grid-template-columns: 3em 1fr; gap: 14px; font-size: 14px; }
  .rows li a .mono { font-size: 11px; margin-left: 3px; }
  .foot { flex-wrap: wrap; font-size: 10px; gap: 10px 16px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .chapter img { transition: none; }
  .photo-expand { transition: none; }
  .photo-carousel.is-ready .photo-link img { animation: none; }
}
