:root {
  color-scheme: light;
  --paper: #f8f9fa;
  --white: #fff;
  --ink: #161a22;
  --muted: #505964;
  --line: #d8dde4;
  --accent: #2345d9;
  --accent-hover: #1734b5;
  --dark: #131824;
  --shell: 75rem;
  --edge: clamp(1.25rem, 4vw, 3rem);
  --sans: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
  --mono: ui-monospace, "SFMono-Regular", Consolas, monospace;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-padding-top: 6rem; }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: var(--sans); font-size: 1rem; line-height: 1.65; }
h1, h2, h3, p, ol, ul, dl, dd, figure { margin: 0; }
h1, h2, h3 { line-height: 1.18; text-wrap: balance; }
p { overflow-wrap: anywhere; }
a { color: inherit; text-decoration: none; }
button { font: inherit; }
img { display: block; max-width: 100%; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 4px; }
::selection { background: #d8e1ff; color: #142a93; }

.shell { width: min(var(--shell), calc(100% - 2 * var(--edge))); margin-inline: auto; }

.skip-link { position: fixed; top: .75rem; left: var(--edge); z-index: 6; padding: .65rem 1rem; background: var(--white); color: var(--accent); transform: translateY(-170%); }
.skip-link:focus { transform: translateY(0); }

.site-header {
  position: sticky;
  top: 0;
  z-index: 3;
  border-bottom: 1px solid var(--line);
  background: var(--paper);
}
.header-inner { min-height: 4.8rem; display: flex; align-items: center; justify-content: space-between; gap: clamp(.7rem, 2vw, 2rem); position: relative; }
.brand { display: inline-flex; align-items: center; gap: .62rem; flex: none; }
.brand-mark { display: grid; place-items: center; width: 2.35rem; height: 2.35rem; border-radius: 2px; color: var(--white); background: var(--accent); font-size: 1rem; font-weight: 760; font-family: var(--mono); letter-spacing: -.09em; padding-right: .09em; }
.brand-name { font-weight: 680; font-size: 1rem; line-height: 1.1; }
.brand-name span { display: block; margin-top: .22rem; color: var(--muted); font-family: var(--mono); font-size: .66rem; font-weight: 500; letter-spacing: .055em; white-space: nowrap; }
.primary-nav { display: flex; align-items: stretch; align-self: stretch; gap: clamp(.65rem, 1.8vw, 1.75rem); white-space: nowrap; }
.primary-nav a { display: flex; align-items: center; position: relative; font-size: .875rem; color: var(--muted); }
.primary-nav a:hover, .primary-nav [aria-current], .primary-nav .current-section { color: var(--accent); }
.primary-nav [aria-current]::after, .primary-nav .current-section::after {
  content: ""; position: absolute; height: 2px; bottom: -1px; inset-inline: 0; background: var(--accent);
}
.header-actions { display: flex; align-items: center; gap: clamp(.65rem, 1.75vw, 1.4rem); white-space: nowrap; }
.header-actions a { font-size: .875rem; font-weight: 650; }
.header-actions a:hover, .header-actions [aria-current] { color: var(--accent); }
.header-contact { border: 1px solid var(--line); padding: .5rem .75rem; }
.header-contact:hover { border-color: var(--accent); }

.eyebrow { color: var(--accent); font-weight: 690; font-size: .875rem; letter-spacing: .08em; }
.eyebrow span { margin-left: .6rem; font-family: var(--mono); letter-spacing: 0; font-weight: 550; white-space: nowrap; }
.text-link { display: inline-flex; align-items: center; min-height: 2.75rem; font-weight: 680; color: var(--accent); text-decoration: underline; text-underline-offset: .28em; text-decoration-thickness: 1px; }
.text-link:hover { color: var(--accent-hover); text-decoration-thickness: 2px; }

.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }

.home-page { --front-ink: #101520; --front-accent: #c5d3ff; }
.home-page .site-header { position: absolute; inset: 0 0 auto; background: transparent; border-color: transparent; color: var(--white); }
.home-page .site-header .shell { width: calc(100% - 2 * var(--edge)); max-width: 94rem; }
.home-page .site-header .brand-name span, .home-page .primary-nav a { color: #e2e7f1; }
.home-page .primary-nav a:hover, .home-page .primary-nav [aria-current], .home-page .header-actions a:hover { color: var(--front-accent); }
.home-page .primary-nav [aria-current]::after { background: var(--front-accent); }
.home-page .header-contact { border-color: #ffffff69; }
.home-page .site-header :focus-visible, .home-showcase :focus-visible { outline-color: var(--front-accent); }

.home-showcase { position: relative; background: var(--front-ink); color: var(--white); }
.showcase-heading {
  position: absolute;
  top: 6.15rem;
  left: var(--edge);
  z-index: 1;
  padding: .25rem .57rem;
  border: 1px solid #d5dbea55;
  background: #101520ac;
  font-size: .875rem;
  letter-spacing: .07em;
  font-weight: 600;
  pointer-events: none;
}
.showcase-track {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  overscroll-behavior-inline: contain;
  scroll-snap-type: x mandatory;
  scrollbar-width: thin;
}
.showcase-ready .showcase-track { scrollbar-width: none; }
.showcase-track:focus-visible { outline-offset: -4px; }
.showcase-slide { min-width: 0; height: clamp(31rem, 79svh, 49rem); scroll-snap-align: start; }
.showcase-project {
  position: relative;
  isolation: isolate;
  display: flex;
  align-items: flex-end;
  height: 100%;
  background: var(--front-ink);
  color: var(--white);
}
.showcase-project img { position: absolute; inset: 0; z-index: -2; width: 100%; height: 100%; object-fit: cover; object-position: center; }
.showcase-project::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(180deg, #080d17f5, #0a101ab3 10%, #0a101a00 31%),
              linear-gradient(0deg, #080d17f5, #0a101abd 15%, #0a101a49 35%, transparent 63%);
}
.showcase-project:focus-visible { outline-offset: -5px; }
.showcase-caption { width: min(76%, 63rem); padding: 1rem var(--edge) clamp(1.8rem, 5vw, 4.6rem); }
.showcase-meta { color: #edf0f7; font-size: .9rem; font-weight: 650; }
.showcase-meta span { margin-left: .75rem; color: #e2e9f6; font-family: var(--mono); font-weight: 500; }
.showcase-caption h2 { margin-top: .33rem; font-size: clamp(2.5rem, 6.2vw, 6rem); line-height: 1.04; letter-spacing: -.065em; text-wrap: pretty; }
.showcase-project-link { display: inline-block; margin-top: .78rem; color: #f3f5ff; font-size: .9rem; font-weight: 650; text-decoration: underline; text-underline-offset: .25em; }
.showcase-project:hover .showcase-project-link { color: var(--front-accent); }
.showcase-controls {
  position: absolute;
  bottom: clamp(1.8rem, 5vw, 4.6rem);
  right: var(--edge);
  z-index: 2;
  display: flex;
  align-items: center;
  gap: .8rem;
}
.showcase-controls[hidden] { display: none; }
.showcase-position { color: #f0f3fa; font-family: var(--mono); font-size: .9rem; font-variant-numeric: tabular-nums; white-space: nowrap; }
.showcase-buttons { display: flex; gap: .38rem; }
.showcase-buttons button {
  min-width: 3.85rem;
  min-height: 2.75rem;
  padding: .28rem .55rem;
  border: 1px solid #e9efff77;
  background: #111825d9;
  color: var(--white);
  font-size: .875rem;
  font-weight: 640;
  cursor: pointer;
}
.showcase-buttons button:hover:not([aria-disabled="true"]) { background: #f3f5ff; color: var(--front-ink); }
.showcase-buttons button[aria-disabled="true"] { color: #adb5c7; border-color: #e9efff44; cursor: default; }

.section-heading { display: flex; justify-content: space-between; align-items: baseline; flex-wrap: wrap; gap: .5rem 1rem; border-top: 1px solid var(--line); padding-top: 1.15rem; margin-bottom: 1.38rem; }
.section-heading h2 { font-size: clamp(1.85rem, 3.25vw, 2.65rem); letter-spacing: -.04em; font-weight: 710; }
.section-heading p { color: var(--muted); font-size: .875rem; }
.project-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(1.7rem, 4vw, 3.4rem) clamp(1.1rem, 2.65vw, 2.35rem); }
.project-card { border-bottom: 1px solid var(--line); min-width: 0; }
.card-link { display: block; height: 100%; }
.card-photo { aspect-ratio: 1.78; overflow: hidden; background: #edf0f4; border-radius: 2px; }
.card-photo img { width: 100%; height: 100%; object-fit: cover; transition: transform .28s ease; }
.card-link:hover .card-photo img { transform: scale(1.025); }
.card-copy { padding: .9rem 0 1.05rem; }
.card-meta { display: flex; flex-wrap: wrap; align-items: baseline; gap: .3rem .7rem; color: var(--accent); font-size: .875rem; font-weight: 650; }
.card-meta span { color: var(--muted); font-family: var(--mono); font-size: .8rem; font-weight: 500; }
.card-copy h3 { margin-top: .3rem; font-size: clamp(1.23rem, 2.15vw, 1.72rem); letter-spacing: -.035em; }
.card-link:hover h3 { color: var(--accent); }
.card-summary { margin-top: .4rem; color: var(--muted); font-size: .95rem; }

.home-profile { padding-block: clamp(2.55rem, 6.3vw, 6rem) clamp(3.2rem, 7.2vw, 6.5rem); }
.profile-intro { display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); align-items: end; gap: 1.25rem clamp(1.25rem, 4vw, 4rem); }
.profile-identity h2 { margin-top: .4rem; font-size: clamp(3.65rem, 8.3vw, 7rem); line-height: 1; letter-spacing: -.075em; }
.profile-identity > p:last-child { margin-top: .7rem; color: var(--muted); font-size: 1.05rem; font-weight: 630; }
.profile-identity span { margin-left: .45rem; font-family: var(--mono); font-size: .85rem; font-weight: 500; }
.profile-summary { align-self: end; }
.profile-summary p:first-child { font-size: clamp(1.25rem, 2.4vw, 1.93rem); color: var(--ink); font-weight: 660; line-height: 1.5; letter-spacing: -.028em; }
.profile-summary p + p { margin-top: .55rem; color: var(--muted); max-width: 39rem; }
.profile-summary .text-link { margin-top: .35rem; }
.profile-details { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2rem clamp(1.4rem, 4vw, 4rem); margin-top: clamp(2.1rem, 5vw, 4.25rem); }
.profile-details section { border-top: 1px solid var(--line); padding-top: 1rem; }
.profile-details h2 { margin-bottom: .95rem; font-size: clamp(1.55rem, 3.35vw, 2.65rem); letter-spacing: -.04em; }
.award-list { list-style: none; padding: 0; }
.award-list li { padding-block: .62rem; border-bottom: 1px solid var(--line); }
.award-list li h3 { font-size: 1.02rem; line-height: 1.4; }
.award-list li h3 span { margin-left: .6rem; color: var(--muted); font-family: var(--mono); font-size: .85rem; font-weight: 500; }
.award-list li a { display: inline-block; margin-top: .22rem; color: var(--accent); text-decoration: underline; text-underline-offset: .25em; }
.profile-details .skill-list { gap: 0; }
.profile-details .skill-list div { padding-block: .57rem; border-bottom: 1px solid var(--line); }
.profile-details .skill-list dd { margin-top: .2rem; color: var(--muted); }

.site-footer { background: var(--dark); color: var(--white); }
.footer-inner { display: flex; align-items: flex-end; justify-content: space-between; flex-wrap: wrap; gap: 1rem 2rem; padding-block: clamp(2rem, 5vw, 3.65rem); }
.footer-title { font-size: 1.15rem; font-weight: 680; margin-bottom: .35rem; }
.email-link { color: #e1e8ff; font-family: var(--mono); font-size: clamp(1rem, 2vw, 1.45rem); overflow-wrap: anywhere; }
.footer-about { color: #e1e8ff; font-size: .9rem; padding-block: .45rem; }
.email-link:hover, .footer-about:hover { text-decoration: underline; text-underline-offset: .26em; }
.site-footer :focus-visible { outline-color: var(--white); }

.breadcrumb { font-size: .875rem; color: var(--muted); padding-top: 1.65rem; }
.breadcrumb ol { display: flex; flex-wrap: wrap; align-items: baseline; gap: .25rem .62rem; list-style: none; padding: 0; }
.breadcrumb li + li::before { content: "/"; margin-right: .62rem; color: #6e7682; }
.breadcrumb a { text-decoration: underline; text-decoration-color: #a0a9bb; text-underline-offset: .23em; }
.breadcrumb a:hover { color: var(--accent); }
.breadcrumb [aria-current] { color: var(--ink); font-weight: 650; }
.page-intro { padding-block: clamp(2.3rem, 6vw, 5.25rem) clamp(2rem, 4.5vw, 3.6rem); }
.page-intro h1 { max-width: 22ch; font-size: clamp(2.45rem, 6vw, 5.1rem); letter-spacing: -.06em; font-weight: 750; overflow-wrap: anywhere; text-wrap: pretty; }
.page-intro .eyebrow { margin-bottom: .65rem; }
.page-intro p:not(.eyebrow) { max-width: 42rem; margin-top: 1rem; color: var(--muted); font-size: clamp(1rem, 1.7vw, 1.25rem); }
.category-projects, .about-content { padding-bottom: clamp(3.6rem, 7vw, 6.5rem); }
.empty-state { margin-bottom: clamp(3.6rem, 7vw, 6.5rem); padding: 2rem 0; border-block: 1px solid var(--line); }
.empty-state h2 { font-size: clamp(1.45rem, 3vw, 2.05rem); }
.empty-state .text-link { margin-top: .45rem; }

.about-row {
  display: grid;
  grid-template-columns: minmax(9rem, .53fr) minmax(0, 1.47fr);
  gap: .9rem 2rem;
  padding-block: clamp(1.35rem, 3vw, 2.4rem);
  border-top: 1px solid var(--line);
}
.about-row h2 { font-size: clamp(1.4rem, 2.5vw, 2.05rem); }
.about-row h3 { font-size: 1.17rem; }
.about-row p:not(.job-period), .about-row dd { margin-top: .26rem; color: var(--muted); }
.experience-list, .skill-list { display: grid; gap: 1.25rem; }
.job { display: grid; grid-template-columns: minmax(9rem, .45fr) minmax(0, 1.55fr); gap: .35rem 1rem; }
.job-period { color: var(--accent); font-family: var(--mono); font-size: .9rem; }
.job-role, .skill-list dt { font-weight: 690; }

.case-cover { overflow: hidden; border-radius: 2px; background: #edf0f4; }
.case-cover img { height: auto; width: 100%; }
.case-section { margin-top: clamp(2.1rem, 5vw, 4.4rem); padding-top: clamp(1.1rem, 3vw, 2.25rem); border-top: 1px solid var(--line); }
.case-section-copy {
  display: grid;
  grid-template-columns: minmax(10rem, .86fr) minmax(0, 1.14fr);
  gap: .75rem 1.5rem;
}
.case-section h2 { font-size: clamp(1.35rem, 2.55vw, 2.1rem); letter-spacing: -.025em; }
.case-section p { color: var(--muted); font-size: 1.04rem; max-width: 42rem; }
.case-gallery { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1.1rem clamp(.9rem, 2vw, 1.6rem); margin-top: 1.15rem; }
.case-gallery.two-up { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.zoom-link { position: relative; display: block; background: #edf0f4; border-radius: 2px; overflow: hidden; cursor: zoom-in; }
.zoom-link img { width: 100%; height: auto; }
.zoom-label { display: flex; align-items: center; gap: .38rem; position: absolute; right: .55rem; bottom: .55rem; min-height: 2.25rem; padding: .25rem .57rem; background: #131824ec; color: var(--white); font-size: .875rem; border-radius: 2px; }
.zoom-link:hover .zoom-label { background: var(--accent); }
.zoom-icon { width: .63rem; height: .63rem; border: 1px solid currentColor; border-radius: 50%; position: relative; margin-right: .19rem; }
.zoom-icon::after { content: ""; position: absolute; width: .29rem; height: 1px; background: currentColor; transform: rotate(45deg); right: -.23rem; bottom: -.1rem; }
.detail-figure figcaption { color: var(--muted); font-size: .875rem; margin-top: .38rem; }
.case-nav { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem 2rem; border-top: 1px solid var(--line); margin-top: clamp(2.25rem, 5vw, 4rem); padding-block: 1.15rem clamp(2.6rem, 5vw, 4.25rem); }
.next-project { display: block; font-weight: 710; }
.next-project span { display: block; color: var(--muted); font-size: .875rem; font-weight: 500; }
.next-project:hover { color: var(--accent); }

.lightbox {
  width: min(92vw, 90rem);
  max-width: none;
  max-height: 94dvh;
  padding: .65rem;
  border: 1px solid #576070;
  border-radius: 3px;
  background: var(--dark);
  color: var(--white);
  overflow: auto;
}
.lightbox::backdrop { background: #080c15e8; }
.lightbox-bar { display: flex; align-items: center; flex-wrap: wrap; gap: .35rem .75rem; margin-bottom: .5rem; font-size: .9rem; }
.lightbox-bar p { margin-right: auto; min-width: 0; }
.lightbox-original, .lightbox-close { display: inline-flex; align-items: center; min-height: 2.75rem; }
.lightbox-original { text-decoration: underline; text-underline-offset: .2em; }
.lightbox-close { color: var(--white); border: 1px solid #68758c; background: transparent; border-radius: 2px; padding: .2rem .7rem; cursor: pointer; }
.lightbox-close:hover { background: #333d50; }
.lightbox :focus-visible { outline-color: var(--white); outline-offset: 2px; }
.lightbox-image { max-height: calc(94dvh - 6rem); width: auto; height: auto; margin-inline: auto; object-fit: contain; }

@media (max-width: 740px) {
  html { scroll-padding-top: 7.4rem; }
  .header-inner { display: grid; grid-template-columns: 1fr auto; gap: 0 .55rem; }
  .header-inner .brand, .header-actions { min-height: 3.6rem; }
  .header-actions { grid-column: 2; grid-row: 1; }
  .header-contact { padding: .35rem .53rem; }
  .primary-nav {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: .95fr 1.13fr .94fr 1.45fr .92fr;
    gap: .23rem;
    min-height: 2.75rem;
    border-top: 1px solid var(--line);
    white-space: normal;
  }
  .home-page .primary-nav { border-color: #ffffff39; }
  .primary-nav a { justify-content: center; padding-block: .28rem; font-size: clamp(.78rem, 2.9vw, .875rem); line-height: 1.25; text-align: center; }

  .showcase-heading { top: 7.1rem; }
  .showcase-slide { height: clamp(25rem, 68svh, 35rem); }
  .showcase-project img { top: 5.1rem; height: calc(100% - 8rem); }
  .showcase-project::after {
    background: linear-gradient(180deg, var(--front-ink) 13%, #101520c4 20%, transparent 38%),
                linear-gradient(0deg, var(--front-ink) 6%, #101520ed 14%, #1015206e 38%, transparent 61%);
  }
  .showcase-caption { width: 100%; padding: 1rem var(--edge) 5rem; }
  .showcase-caption h2 { font-size: clamp(1.88rem, 7.7vw, 3.75rem); }
  .showcase-project-link { margin-top: .48rem; }
  .showcase-controls { bottom: .95rem; left: var(--edge); justify-content: space-between; }
  .project-grid, .profile-intro, .profile-details, .about-row, .case-section-copy, .case-gallery.two-up { grid-template-columns: minmax(0, 1fr); }
  .card-copy { padding-top: .72rem; }
  .about-content { padding-bottom: 3rem; }
  .job { grid-template-columns: minmax(0, 1fr); }
  .breadcrumb { padding-top: 1.15rem; }
  .case-gallery { margin-top: .85rem; }
}

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