:root {
  color-scheme: dark;
  --bg: #0b110e;
  --text: #f7f9f8;
  --muted: #e5ebeb;
  --accent: #22c7d9;
  --accent-light: #6fe7f0;
  --line: rgba(210,221,196,.17);
  --page-padding: clamp(1.25rem,5.3vw,7rem);
  --content-max-width: 120rem;
  --header-height: 6.25rem;
  --section-gap: clamp(1.5rem,3vw,3rem);
  --overlay-color: 9,17,21;
  --overlay-opacity: .24;
  --card-width: 150px;
  --card-height: 320px;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scrollbar-color: #73796c #101712; }
body { margin: 0; background: var(--bg); color: var(--text); font-family: Arial,"PingFang SC","Microsoft YaHei",sans-serif; font-weight: 400; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; }
button,a { -webkit-tap-highlight-color: transparent; }
button:focus-visible,a:focus-visible,.deck:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
::selection { background: var(--accent); color: var(--bg); }
[hidden] { display: none !important; }
.en { display: block; font-size: 12px; color: var(--muted); margin-top: 4px; }
.icon { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 1.65; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
/* One continuous layer: photos (0), overlay (1), content (2+), navigation (10). */
main { position: relative; isolation: isolate; }
main::before { content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none; background: rgba(var(--overlay-color),var(--overlay-opacity)); }
.hero,.works,.contact { position: relative; overflow: clip; }
.scene { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: 0; pointer-events: none; }
.nav,.hero-name,.side,.hero-bottom,.work-head,.selection,.tabs,.contact-grid,.footer,.card-label { text-shadow: 0 1px 3px rgba(0,10,15,.45),0 2px 10px rgba(0,10,15,.16); }
.nav { position: absolute; inset: 0 0 auto; z-index: 10; min-height: var(--header-height); padding: 24px var(--page-padding); display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; }
.brand { font-size: 20px; line-height: 1.3; min-height: 44px; }
.nav-center { display: flex; gap: 30px; position: absolute; left: 50%; transform: translateX(-50%); padding-top: 4px; }
.nav-center a { position: relative; font-size: 16px; min-width: 44px; min-height: 44px; }
.nav-center a.active::after { content: ""; position: absolute; bottom: -16px; left: 50%; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); }
.nav-center a.active,.nav-center a.active .en,.tab[aria-selected=true] .num,.tab[aria-selected=true] strong { color: var(--accent); }
.nav-center a:hover,.document-link:hover,.contact-value:hover,.selection a:hover,.deck-controls button:hover:not(:disabled) { color: var(--accent-light); }
.contact-button { display: flex; align-items: center; gap: 17px; background: var(--accent); color: #052a30; padding: 10px 24px; border-radius: 6px; text-align: center; font-size: 16px; line-height: 1.1; min-height: 44px; text-shadow: none; transition: background .2s; }
.contact-button .en { color: #124c55; font-size: 11px; margin-top: 2px; }
.contact-button:hover,.contact-button:focus-visible { background: var(--accent-light); }
.hero { height: 100vh; height: 100dvh; min-height: 760px; background: var(--bg); }
.hero-name { position: absolute; top: 13.5%; left: 50%; transform: translateX(-50%); z-index: 2; text-align: center; white-space: nowrap; }
.hero-name h1 { font-size: clamp(130px,13vw,260px); font-weight: 500; line-height: 1.12; letter-spacing: .03em; margin: 0; }
.hero-signature { display: block; width: clamp(230px,23vw,420px); height: auto; aspect-ratio: 360 / 125; margin: -14px auto 0; transform: translateX(5%); }
.hero-lineart { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 2; pointer-events: none; }
.side { position: absolute; z-index: 2; top: 26%; font-size: 18px; line-height: 1.5; }
.side.left { left: 7.4%; }
.side.right { right: 7.4%; }
.side i,.stat::after,.contact-item::after,.thanks::after { display: block; width: 36px; height: 1px; background: var(--accent); content: ""; }
.side i { margin: clamp(55px,11vh,115px) 0; }
.side.right i { margin: 5vh 0 8vh; }
.hero-bottom { position: absolute; z-index: 2; left: var(--page-padding); right: var(--page-padding); bottom: 27px; }
.role { text-align: center; margin-bottom: 24px; }
.role h2 { font-size: clamp(30px,3.4vw,66px); font-weight: 400; line-height: 1.2; margin: 0 0 16px; }
.role p { font-size: 14px; letter-spacing: .27em; color: var(--muted); margin: 0; }
.stats { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 30px; }
.stat strong { display: block; font-size: clamp(30px,2.5vw,50px); letter-spacing: .02em; font-weight: 600; margin-bottom: 7px; }
.stat span { font-size: 14px; color: var(--muted); }
.stat small { display: block; font-size: 11px; line-height: 1.4; letter-spacing: .08em; margin-top: 5px; color: var(--muted); }
.stat::after { margin-top: 24px; }
/* Content flow reserves space for every category and the full card fan. */
.works { min-height: max(1050px,100vh); min-height: max(1050px,100dvh); background: url('assets/page5.png') center / cover; display: flex; flex-direction: column; padding-bottom: clamp(2rem,4vw,4rem); }
.work-head { position: relative; padding: clamp(2.5rem,5vh,4rem) 6.9% 0; z-index: 2; pointer-events: none; }
.work-head h2 { font-size: clamp(36px,3.1vw,60px); margin: 0 0 10px; font-weight: 600; }
.work-head>p { font-size: 18px; color: var(--muted); margin: 0; }
.category-info { display: flex; gap: 40px; margin-top: 40px; max-width: 760px; min-height: 155px; }
.category-info>div { min-width: 0; }
.category-num { font-size: 14px; color: var(--accent); padding-top: 6px; }
.category-info h3 { font-size: 25px; line-height: 1.3; margin: 0 0 4px; font-weight: 550; }
.category-info .en { font-size: 13px; }
.category-info p { font-size: 14px; line-height: 1.7; color: var(--muted); margin: 10px 0 0; }
.category-info .description-en { font-size: 13px; }
.deck { position: relative; z-index: 2; flex: 0 0 calc(var(--card-height) + 120px); margin-top: 24px; perspective: 1500px; touch-action: pan-y; cursor: grab; }
.deck:active { cursor: grabbing; }
.folder { --x: 0; position: absolute; top: 100px; left: 50%; width: var(--card-width); min-height: var(--card-height); border: 1px solid #646e5a80; border-radius: 12px; background: linear-gradient(135deg,#8a97805c,#4b574342); backdrop-filter: blur(10px); box-shadow: 0 0 0 1px #b7c3a914 inset,0 14px 40px #0003; padding: 13px; text-align: left; transform: translateX(calc(-50% + var(--x))) translateY(var(--y)) scale(var(--scale)); opacity: var(--opacity); z-index: var(--z); transition: transform .45s cubic-bezier(.22,.8,.22,1),opacity .3s,border-color .3s; }
.folder::before { content: attr(data-category); position: absolute; top: -24px; left: 15px; height: 25px; width: 75px; border: 1px solid #707a6780; border-radius: 10px 10px 0 0; background: #85927b45; padding: 6px 12px; font-size: 11px; color: #b5bcac; }
.folder.active { box-shadow: 0 18px 45px #0007,0 0 0 1px #19c7d855; }
.folder:hover,.folder.active { border-color: var(--accent); }
.cover { position: relative; width: 100%; height: 148px; border-radius: 7px; overflow: hidden; background: #182119; }
.cover img { position: absolute; max-width: none; pointer-events: none; width: var(--sprite-w); height: var(--sprite-h); left: var(--sprite-x); top: var(--sprite-y); }
.image-cover img { inset: 0; width: 100%; height: 100%; object-fit: cover; }
.portrait-cover { aspect-ratio: 1; height: auto; border-radius: 50%; }
.card-label { display: flex; justify-content: center; gap: 7px; margin-top: 11px; font-size: 12px; line-height: 1.4; text-align: center; overflow-wrap: anywhere; }
.card-label>span { min-width: 0; }
.card-label b { flex-shrink: 0; color: var(--accent); font-weight: 400; font-size: 11px; }
.card-label .en { font-size: 11px; line-height: 1.35; margin-top: 6px; }
.folder.active .card-label b { flex-shrink: 0; color: var(--accent-light); }
.text-cover { display: flex; flex-direction: column; justify-content: center; align-items: center; padding: 12px; text-align: center; border: 1px solid var(--line); background: linear-gradient(145deg,#263329,#111b15); gap: 18px; }
.text-cover span { font-size: 16px; line-height: 1.4; overflow-wrap: anywhere; }
.text-cover small { font-size: 11px; color: var(--muted); }
.deck-controls { position: relative; z-index: 3; margin: 0 6.9%; display: flex; justify-content: space-between; pointer-events: none; }
.deck-controls button { pointer-events: auto; width: 44px; height: 44px; border: 1px solid var(--line); border-radius: 50%; background: #0b110e8c; color: var(--accent); font-size: 20px; }
.deck-controls button:disabled { opacity: .3; cursor: default; }
.selection { position: relative; z-index: 2; align-self: center; margin: -44px 0 24px; width: min(440px,70%); min-height: 140px; text-align: center; pointer-events: none; }
.selection p { font-size: 12px; line-height: 1.5; color: var(--muted); margin: 0 0 6px; }
.selection h4 { font-size: 18px; line-height: 1.4; margin: 6px 0; overflow-wrap: anywhere; }
.selection .en { font-size: 13px; line-height: 1.5; }
.selection a { display: inline-flex; align-items: center; justify-content: center; width: 44px; min-height: 44px; pointer-events: auto; color: var(--accent); font-size: 26px; }
.tabs { position: relative; z-index: 2; align-self: center; margin-top: auto; width: min(900px,86%); display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.tab { text-align: center; border-right: 1px solid var(--line); padding: 12px 7px 13px; min-width: 0; }
.tab:last-child { border-right: 0; }
.tab .num { display: block; color: #c4d0cf; font-size: 13px; margin-bottom: 9px; }
.tab strong { font-size: 14px; font-weight: 400; }
.tab .en { font-size: 10px; margin-top: 7px; line-height: 1.4; }
.tab:hover { background: #19c7d814; }
.category-empty { position: relative; z-index: 2; text-align: center; color: var(--muted); font-size: 16px; }
.contact { min-height: max(930px,100vh); min-height: max(930px,100dvh); display: flex; flex-direction: column; }
/* Third page only: combined with the global 24% overlay, this yields about 32%. */
.contact::before { content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none; background: rgba(var(--overlay-color),.1053); }
.contact-grid { position: relative; z-index: 2; display: flex; justify-content: space-between; gap: var(--section-gap); padding: clamp(10rem,26vh,20rem) var(--page-padding) 5rem; }
.contact-column { width: 360px; max-width: 40%; display: flex; flex-direction: column; gap: 40px; }
.contact-item { position: relative; padding-left: 42px; min-width: 0; }
.contact-item .icon { position: absolute; left: 0; top: 2px; color: var(--accent); }
.contact-item h3 { font-size: 18px; font-weight: 400; margin: 0; min-height: 44px; }
.contact-item .en { font-size: 12px; line-height: 1.4; }
.contact-value { display: flex; align-items: center; min-height: 44px; font-size: clamp(22px,1.4vw,29px); margin-top: 8px; line-height: 1.35; overflow-wrap: anywhere; }
.document-link { display: inline-block; min-height: 44px; }
.contact-item::after { margin-top: 34px; margin-left: -42px; }
.contact-item:last-child::after { display: none; }
.available p { margin: 14px 0 0; font-size: 25px; line-height: 1.4; }
.available p .en { font-size: 14px; }
.footer { position: relative; z-index: 2; margin: auto var(--page-padding) 24px; border-top: 1px solid var(--line); padding-top: 24px; display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; font-size: 14px; color: var(--muted); }
.footer-center { color: var(--accent); letter-spacing: .02em; }
.thanks { font-size: 13px; min-height: 44px; display: flex; flex-direction: column; justify-content: space-between; }
.thanks::after { margin-top: 16px; }
.toast { position: fixed; z-index: 30; bottom: 25px; left: 50%; transform: translateX(-50%); max-width: calc(100% - 2rem); padding: 12px 24px; border: 1px solid #72815f; border-radius: 6px; background: #162015; color: var(--accent); overflow-wrap: anywhere; }
@media (min-width:1800px) {
  :root { --card-width: 175px; --card-height: 340px; }
  .cover { height: 180px; }
  .portrait-cover { height: auto; }
  .card-label { font-size: 14px; }
  .card-label .en { font-size: 12px; }
  .category-info { max-width: 800px; }
  .category-info h3 { font-size: 28px; }
}
/* Tablet includes iPad portrait and landscape, with its own spacing and card rail. */
@media (min-width:600px) and (max-width:1199px) {
  :root { --page-padding: clamp(2rem,5vw,3.5rem); --header-height: 5.5rem; --card-width: 160px; }
  .nav { padding-top: 22px; }
  .nav-center { gap: 22px; }
  .contact-button { padding: 10px 16px; }
  .hero { min-height: 720px; }
  .hero-name { top: 15%; }
  .hero-name h1 { font-size: clamp(150px,19vw,210px); }
  .hero-signature { width: clamp(260px,31vw,350px); }
  .hero .scene { object-position: 70% center; }
  .side { font-size: 14px; top: 40%; }
  .side.left { left: var(--page-padding); }
  .side.right { right: var(--page-padding); top: 15%; }
  .side i,.side.right i { margin: 35px 0; }
  .hero-bottom { bottom: 30px; }
  .role h2 { font-size: clamp(30px,4.1vw,44px); }
  .role p { font-size: 11px; letter-spacing: .15em; }
  .stats { gap: 20px; }
  .stat strong { font-size: clamp(28px,3.7vw,38px); }
  .stat span { font-size: 13px; }
  .stat small { font-size: 10px; }
  .work-head { padding-inline: var(--page-padding); }
  .category-info { max-width: 660px; gap: 24px; margin-top: 30px; min-height: 180px; }
  .category-info h3 { font-size: 23px; }
  .tabs { width: calc(100% - 2 * var(--page-padding)); }
  .contact-grid { padding-top: clamp(10rem,22vh,16rem); }
  .contact-column { max-width: 46%; }
  .contact-item { padding-left: 32px; }
  .contact-item::after { margin-left: -32px; }
  .contact-value,.available p { font-size: 21px; }
  .footer { font-size: 12px; }
  .footer-center { font-size: 11px; }
}
@media (max-width:599px) {
  :root { --page-padding: clamp(1.25rem,5.3vw,2rem); --header-height: 5.5rem; --card-width: 160px; --card-height: 320px; }
  .nav { padding-top: max(18px,env(safe-area-inset-top)); align-items: flex-start; }
  .brand { font-size: 18px; }
  .nav-center { position: static; transform: none; gap: clamp(10px,3vw,18px); padding-top: 0; }
  .nav-center a { font-size: 14px; }
  .nav-center .en { font-size: 11px; }
  .nav-center a.active::after { bottom: -8px; }
  .contact-button { display: none; }
  .hero { min-height: 640px; }
  .hero-name { top: max(var(--header-height),13%); top: max(var(--header-height),13svh); }
  .hero-name h1 { font-size: clamp(108px,31vw,145px); }
  .hero-signature { width: 58vw; max-width: 270px; margin: -4px auto 0; }
  .hero-lineart { display: none; }
  .hero .scene { object-position: 86% center; }
  .side { font-size: 12px; line-height: 1.5; top: 40%; }
  .side.left { left: var(--page-padding); }
  .side.right { right: var(--page-padding); top: 12%; font-size: 10px; text-align: right; }
  .side i { margin: 24px 0; }
  .side.right i { margin: 16px 0 16px auto; width: 24px; }
  .hero-name { left: 44%; }
  .hero-name h1 { font-size: 29vw; }
  .hero-bottom { bottom: max(20px,env(safe-area-inset-bottom)); }
  .role { margin-bottom: 20px; }
  .role h2 { font-size: clamp(22px,6vw,28px); margin-bottom: 10px; }
  .role p { font-size: 9px; line-height: 1.5; letter-spacing: .08em; }
  .stats { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 16px 20px; }
  .stat strong { font-size: clamp(25px,6.7vw,30px); margin-bottom: 3px; }
  .stat span { font-size: 12px; }
  .stat small { font-size: 9px; letter-spacing: .02em; }
  .stat::after { margin-top: 10px; width: 24px; }
  .works { min-height: 100vh; min-height: 100dvh; background-position: 62% center; padding-bottom: 28px; }
  .work-head { padding: 40px var(--page-padding) 0; }
  .work-head h2 { font-size: clamp(30px,8vw,36px); }
  .work-head>p { font-size: 14px; }
  .category-info { gap: 14px; margin-top: 28px; min-height: 250px; }
  .category-num { font-size: 12px; }
  .category-info h3 { font-size: 19px; }
  .category-info .en { font-size: 12px; line-height: 1.5; }
  .category-info p { font-size: 13px; line-height: 1.65; }
  .category-info .description-en { font-size: 12px; }
  .deck { margin-top: 16px; }
  .selection { width: 72%; min-height: 160px; }
  .selection p { font-size: 11px; }
  .selection h4 { font-size: 16px; }
  .selection .en { font-size: 12px; }
  .deck-controls { margin-inline: var(--page-padding); }
  .tabs { width: calc(100% - 2 * var(--page-padding)); }
  .tab { padding: 12px 4px; }
  .tab strong { font-size: 12px; }
  .tab .en { font-size: 10px; }
  .contact { min-height: 100vh; min-height: 100dvh; }
  .contact .scene { object-position: 60% center; }
  .contact-grid { display: grid; grid-template-columns: minmax(0,1fr); padding: 64px var(--page-padding) 64px; gap: 36px; }
  .contact-column { max-width: none; width: 100%; gap: 28px; }
  .contact-item { padding-left: 32px; }
  .contact-item h3 { font-size: 16px; }
  .contact-value { font-size: clamp(20px,5.5vw,24px); }
  .contact-item::after { margin-top: 24px; margin-left: -32px; }
  .available p { font-size: 22px; }
  .footer { font-size: 11px; align-items: flex-start; margin-bottom: max(20px,env(safe-area-inset-bottom)); }
  .footer-center { display: none; }
  .thanks { font-size: 11px; }
}
@media (max-width:389px) {
  .hero-name { top: 76px; }
  .hero-name h1 { font-size: 26vw; }
  .hero-signature { width: 52vw; margin-top: -10px; }
  .hero .scene { height: calc(100% + 70px); }
}
/* Short landscape viewports scroll naturally instead of squeezing the photograph and copy. */
@media (max-height:599px) and (min-width:600px) {
  .hero { min-height: 700px; }
  .hero-name { top: 15%; }
  .side { top: 34%; }
  .hero .scene { object-position: 65% center; }
}
@media (prefers-reduced-motion:reduce) {
  html { scroll-behavior: auto; }
  *,*::before,*::after { transition: none !important; animation: none !important; }
}
