@font-face {
  font-family: "DanXing";
  src: url("danxingshu-subset.woff2") format("woff2");
  font-display: block;
}

/* smooth cross-page transitions between tabs (Chrome, Safari 18+) */
@view-transition { navigation: auto; }
::view-transition-old(root) { animation: vt-out .28s ease both; }
::view-transition-new(root) { animation: vt-in .42s cubic-bezier(.2,.8,.2,1) both; }
@keyframes vt-out { to { opacity: 0; transform: translateY(-10px); } }
@keyframes vt-in { from { opacity: 0; transform: translateY(14px); } }

:root {
  --paper: #efe7da;
  --paper-2: #e6dccb;
  --paper-3: #f7f2e9;
  --ink: #231f1c;
  --ink-2: #5a524a;
  --ink-3: #8f857a;
  --rule: #d3c8b6;
  --zhu: #b23a2b;
  --display: "Fraunces", "Times New Roman", serif;
  --sans: "Inter", system-ui, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, monospace;
  --gutter: clamp(16px, 5vw, 72px);
  --ease: cubic-bezier(.2, .8, .2, 1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background-color: var(--paper);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .14 0 0 0 0 .12 0 0 0 0 .1 0 0 0 .09 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  color: var(--ink);
  font: 300 17px/1.65 var(--sans);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
body.locked { overflow: hidden; }
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
.mono { font-family: var(--mono); font-size: 13px; letter-spacing: .02em; font-weight: 400; }
.dx { font-family: "DanXing", serif; font-weight: 400; }
.red { color: var(--zhu); }
h1 { font: 400 clamp(46px, 6.2vw, 96px)/.96 var(--display); letter-spacing: -.025em; font-variation-settings: "opsz" 144; }
h1 em, h2 em { color: var(--zhu); font-style: italic; }
h2 { font: 400 clamp(36px, 5vw, 68px)/1.02 var(--display); letter-spacing: -.015em; max-width: 14em; }
h3 { font: 400 clamp(30px, 3.2vw, 46px)/1.02 var(--display); letter-spacing: -.01em; }
.eyebrow { color: var(--ink-3); margin-bottom: 20px; text-transform: uppercase; letter-spacing: .12em; }
section { padding: clamp(100px, 13vw, 170px) var(--gutter) 0; position: relative; }
.lead { font: 400 clamp(20px, 1.8vw, 24px)/1.5 var(--display); color: var(--ink-2); max-width: 36em; }
.lead strong { color: var(--ink); font-weight: 500; }

/* ---------- nav: tabs ---------- */
.nav {
  position: fixed; inset: 0 0 auto 0; z-index: 50;
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center;
  padding: 16px var(--gutter);
  font: 500 13px var(--mono);
  view-transition-name: nav;
}
.nav::before { content: ""; position: absolute; inset: 0; background: color-mix(in srgb, var(--paper) 82%, transparent); backdrop-filter: blur(10px); opacity: 0; transition: opacity .3s; z-index: -1; }
.nav.solid::before { opacity: 1; }
.brand { display: flex; align-items: baseline; gap: 8px; }
.brand .dx { font-size: 18px; color: var(--zhu); }
.tabs { display: flex; gap: 2px; padding: 4px; list-style: none; background: color-mix(in srgb, var(--paper-3) 70%, transparent); border: 1px solid var(--rule); border-radius: 999px; }
.tabs a { display: block; padding: 7px 16px; border-radius: 999px; color: var(--ink-2); transition: color .2s; position: relative; isolation: isolate; }
.tabs a:hover { color: var(--ink); }
.tabs a[aria-current="page"] { color: var(--paper); }
.tabs a[aria-current="page"]::before { content: ""; position: absolute; inset: 0; border-radius: inherit; background: var(--ink); z-index: -1; view-transition-name: tab-pill; }
.btn { justify-self: end; background: var(--ink); color: var(--paper); padding: 8px 16px; border-radius: 999px; transition: background .2s; }
.btn:hover { background: var(--zhu); }

/* ---------- page header (inner pages) ---------- */
.page-head { padding-top: clamp(130px, 16vw, 190px); display: grid; grid-template-columns: 1.2fr 1fr; gap: clamp(28px, 5vw, 72px); align-items: end; }
.page-head h1 { font-size: clamp(52px, 7vw, 108px); }
.page-head p { color: var(--ink-2); max-width: 34em; }

/* ================= HOME ================= */
.hero {
  min-height: 100vh; padding: 100px var(--gutter) 60px;
  display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); gap: clamp(40px, 6vw, 110px);
  align-items: center; position: relative; overflow: hidden;
}
.hero-copy, .portrait { position: relative; z-index: 1; }
.hero h1 { font-size: clamp(56px, 6.6vw, 112px); }
.hero-ink { position: absolute; left: 0; right: 0; bottom: 0; height: 27%; opacity: .55; pointer-events: none; }
.hero-cta { display: flex; flex-wrap: wrap; align-items: center; gap: 22px; margin-top: 36px; }
.btn-lg { padding: 14px 22px; border-radius: 999px; background: var(--ink); color: var(--paper); font: 500 15px var(--sans); transition: background .2s; }
.btn-lg:hover { background: var(--zhu); }
.kicker { display: flex; align-items: center; gap: 8px; color: var(--ink-2); margin-bottom: 28px; }
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--zhu); animation: pulse 2.4s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(178,58,43,.5); } 70%, 100% { box-shadow: 0 0 0 8px rgba(178,58,43,0); } }
.portrait { justify-self: end; width: min(100%, calc((100vh - 260px) * .75)); margin: 0; }
.portrait canvas { width: 100%; aspect-ratio: 3/4; display: block; cursor: none; touch-action: pan-y; }
.portrait figcaption { display: flex; flex-direction: column; gap: 6px; margin-top: 16px; }
.cue { color: var(--zhu); font-weight: 500; }
.cue-touch { display: none; }
@media (hover: none) { .cue-mouse { display: none; } .cue-touch { display: inline; } }
.legend { font: 300 15px/1.55 var(--sans); color: var(--ink-2); }
.legend em { font-style: italic; }
.hero-note { max-width: 34ch; margin-top: 30px; font: 300 19px/1.6 var(--sans); color: var(--ink-2); }
.scroll-cue { position: absolute; left: 50%; bottom: 18px; transform: translateX(-50%); color: var(--ink-3); }
.scroll-cue::after { content: ""; display: block; width: 1px; height: 28px; margin: 6px auto 0; background: var(--ink-3); animation: drip 1.8s infinite; transform-origin: top; }
@keyframes drip { 0% { transform: scaleY(0); } 50% { transform: scaleY(1); } 100% { transform: scaleY(1); opacity: 0; } }

.intro { display: grid; grid-template-columns: .8fr 1.2fr; gap: clamp(28px, 6vw, 96px); }
.intro .lead + .lead { margin-top: 1em; }
.intro .link { margin-top: 32px; }

.doors { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin-top: 48px; }
.door { position: relative; display: block; aspect-ratio: 4/5; overflow: hidden; background: var(--ink); color: var(--paper); border-radius: 4px; }
.door img { position: absolute; inset: -6% 0; width: 100%; height: 112%; object-fit: cover; opacity: .72; transition: transform .8s var(--ease), opacity .4s; }
.door:hover img { transform: scale(1.06); opacity: .5; }
.door .door-text { position: absolute; inset: auto 0 0 0; padding: 26px; background: linear-gradient(transparent, rgba(20,16,12,.8)); }
.door h3 { color: var(--paper); }
.door .mono { color: #e2d6c4; }
.door .arrow { position: absolute; top: 20px; right: 22px; width: 42px; height: 42px; border-radius: 50%; background: var(--paper); color: var(--ink); display: grid; place-items: center; font-size: 18px; transition: transform .4s var(--ease), background .2s; }
.door:hover .arrow { transform: rotate(-45deg); background: var(--zhu); color: #fff; }

/* ================= WORK: fanned deck ================= */
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 40px; }
.chip { padding: 8px 14px; border: 1px solid var(--rule); border-radius: 999px; font: 500 13px var(--mono); color: var(--ink-2); transition: all .2s; }
.chip:hover { border-color: var(--ink); color: var(--ink); }
.chip[aria-pressed="true"] { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.deck-wrap { padding: 40px var(--gutter) 0; }
.deck { position: relative; height: 560px; --cw: 320px; }
.pcard {
  position: absolute; left: 0; top: 60px; width: var(--cw); height: 440px;
  display: flex; flex-direction: column; text-align: left;
  background: var(--paper-3); border: 1px solid var(--rule); border-radius: 6px;
  box-shadow: -10px 0 30px -18px rgba(35,31,28,.45);
  transform: translate(var(--x, 0px), var(--y, 0px)) rotate(var(--rot, 0deg)) scale(var(--s, 1));
  transform-origin: 50% 120%;
  transition: transform .55s var(--ease), box-shadow .35s, opacity .35s;
}
.pcard.out { opacity: 0; pointer-events: none; }
.pcard.tier-1, .pcard.tier-1 .tab { background: var(--zhu); border-color: var(--zhu); color: #fff; }
.pcard.tier-1 .tab, .pcard.tier-1 .tab b, .pcard.tier-1 .cap p { color: #f7e3dc; }
.pcard.tier-1 .open { background: #fff; color: var(--zhu); }
.pcard.tier-2, .pcard.tier-2 .tab { background: #f2ddd4; border-color: #e3bfb2; }
.pcard.tier-2 .cap p { color: #8a5a4c; }
.pcard.hot { box-shadow: 0 40px 60px -30px rgba(35,31,28,.55); }
.pcard .tab { position: absolute; top: -26px; left: 18px; height: 27px; padding: 0 12px; display: flex; align-items: center; gap: 8px; background: var(--paper-3); border: 1px solid var(--rule); border-bottom: 0; border-radius: 6px 6px 0 0; font: 500 12px var(--mono); color: var(--ink-3); white-space: nowrap; }
.pcard .tab b { color: var(--zhu); font-weight: 500; }
.pcard .cover { flex: 1; margin: 10px 10px 0; overflow: hidden; border-radius: 3px; background: var(--paper-2); position: relative; }
.pcard .cover img { width: 100%; height: 100%; object-fit: cover; transition: transform .8s var(--ease); }
.pcard.hot .cover img { transform: scale(1.05); }
.pcard .cap { padding: 14px 16px 16px; }
.pcard .cap h4 { font: 400 26px/1.1 var(--display); }
.pcard .cap p { font: 400 13px/1.45 var(--mono); color: var(--ink-3); margin-top: 6px; padding-right: 40px; }
.pcard .open { position: absolute; right: 16px; bottom: 18px; width: 34px; height: 34px; border-radius: 50%; background: var(--ink); color: var(--paper); display: grid; place-items: center; opacity: 0; transform: scale(.6); transition: all .35s var(--ease); }
.pcard.hot .open { opacity: 1; transform: none; }
.type-cover { display: grid; place-items: center; height: 100%; background: var(--ink); color: var(--paper); text-align: center; padding: 20px; }
.type-cover span { font: italic 300 44px/1 var(--display); }
.type-cover small { display: block; margin-top: 10px; font: 500 11px var(--mono); color: #f0a08f; }
.deck-hint { color: var(--ink-3); text-align: center; margin-top: 8px; }

/* detail sheet */
.detail { position: fixed; inset: 0; z-index: 80; background: var(--paper); overflow-y: auto; overscroll-behavior: contain; }
.detail[hidden] { display: none; }
.detail.enter { animation: sheet-in .5s var(--ease); }
@keyframes sheet-in { from { transform: translateY(40px); opacity: 0; } }
.d-bar { position: sticky; top: 0; z-index: 2; display: flex; justify-content: space-between; align-items: center; padding: 14px var(--gutter); background: color-mix(in srgb, var(--paper) 88%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--rule); }
.d-bar .group { display: flex; gap: 8px; align-items: center; }
.round { width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--rule); display: grid; place-items: center; font-size: 16px; transition: all .2s; }
.round:hover { background: var(--ink); color: var(--paper); border-color: var(--ink); }
/* project page: same rhythm as the case studies — a readable column, a cover
   that never outgrows the screen, facts in one row, an even gallery grid */
.d-page { max-width: 1180px; margin: 0 auto; padding: 0 var(--gutter) 120px; }
.d-hero { padding-top: 56px; display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); gap: clamp(28px, 5vw, 72px); align-items: center; }
.d-hero h2 { font-size: clamp(48px, 6.4vw, 92px); }
.d-hero .kick { font: italic 400 24px/1.3 var(--display); color: var(--ink-2); margin: 10px 0 24px; }
.d-hero .body p { color: var(--ink-2); font: 300 18px/1.65 var(--sans); max-width: 38em; }
.d-hero .body p + p { margin-top: .9em; }
.d-cover { justify-self: center; border-radius: 6px; overflow: hidden; background: var(--paper-2); max-width: 100%; }
.d-cover img { display: block; max-width: 100%; max-height: min(68vh, 640px); width: auto; cursor: zoom-in; }
.d-links { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 30px; }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 10px 16px; border-radius: 999px; background: var(--ink); color: var(--paper); font: 500 13px var(--mono); transition: background .2s; }
.pill:hover { background: var(--zhu); }
.pill.ghost { background: transparent; color: var(--ink); border: 1px solid var(--ink); }
.pill.ghost:hover { background: var(--ink); color: var(--paper); }
.d-facts { display: flex; flex-wrap: wrap; margin-top: 56px; border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); }
.d-facts > div { flex: 1 1 180px; padding: 22px 20px; border-left: 1px solid var(--rule); }
.d-facts > div:first-child { border-left: 0; padding-left: 0; }
.d-facts strong { display: block; font: 400 clamp(30px, 3.4vw, 44px)/1 var(--display); }
.d-facts > div > span { display: block; margin-top: 8px; font: 300 15px/1.45 var(--sans); color: var(--ink-2); }
.d-facts .m span { font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); margin: 0 0 8px; }
.d-facts .m b { display: block; font: 400 16px/1.45 var(--sans); color: var(--ink); }
.d-gal-head { margin-top: 72px; }
.d-gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 20px; align-items: start; }
.d-gallery > figure { margin: 0; border-radius: 6px; overflow: hidden; background: var(--paper-3); border: 1px solid var(--rule); }
.d-gallery img { display: block; width: 100%; aspect-ratio: 4/5; object-fit: contain; background: var(--paper-2); cursor: zoom-in; transition: transform .6s var(--ease); }
.d-gallery figure:hover img { transform: scale(1.02); }
.d-gallery figcaption { padding: 10px 14px; color: var(--ink-3); font-size: 13px; }
.d-gallery .wide { grid-column: 1 / -1; }
.d-gallery .wide img { aspect-ratio: auto; max-height: 70vh; object-fit: contain; }
.d-gallery .embed { position: relative; aspect-ratio: var(--ar, 16/9); }
.d-gallery .embed iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.d-gallery figure:has(.embed), .d-gallery figure:has(video) { grid-column: 1 / -1; }
.d-gallery figure:has(.embed[style*="9/16"]) { grid-column: auto; max-width: 380px; }
.d-gallery video { width: 100%; display: block; max-height: 72vh; background: #000; }
.d-gallery audio { width: calc(100% - 32px); margin: 16px; }
/* always-visible way back, on project pages and case studies */
.back-float { position: fixed; left: 20px; bottom: 20px; z-index: 85; padding: 12px 18px; border-radius: 999px; background: var(--ink); color: var(--paper); font: 500 13px var(--mono); box-shadow: 0 10px 30px -10px rgba(35,31,28,.5); transition: background .2s, transform .2s; }
.back-float:hover { background: var(--zhu); transform: translateY(-2px); }

/* ================= ABOUT ================= */
.about-hero { padding-top: clamp(130px, 16vw, 190px); display: grid; grid-template-columns: minmax(260px, .7fr) 1.3fr; gap: clamp(32px, 6vw, 96px); align-items: start; }
.about-photo { position: sticky; top: 100px; }
.about-photo img { width: 100%; border-radius: 4px; }
.about-photo figcaption { margin-top: 10px; color: var(--ink-3); }
.about-text h1 { font-size: clamp(48px, 6vw, 92px); margin-bottom: 36px; }
.about-text .lead + .lead { margin-top: 1em; }
.facts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; margin-top: 44px; background: var(--rule); border: 1px solid var(--rule); }
.facts div { background: var(--paper-3); padding: 18px; }
.facts strong { display: block; font: 400 34px/1 var(--display); }
.facts span { font-size: 13px; color: var(--ink-3); }

/* name cards */
.name { text-align: center; }
.name h2 { margin: 0 auto; }
.chars { display: flex; justify-content: center; gap: clamp(12px, 4vw, 56px); margin-top: 56px; perspective: 1000px; }
.char { width: clamp(140px, 20vw, 240px); aspect-ratio: 3/4; position: relative; transform-style: preserve-3d; transition: transform .8s var(--ease); }
.char:hover, .char.flipped { transform: rotateY(180deg); }
.char .front, .char .back { position: absolute; inset: 0; backface-visibility: hidden; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; border: 1px solid var(--rule); background: var(--paper-3); border-radius: 4px; overflow: hidden; }
.char .front .dx { font-size: clamp(88px, 13vw, 170px); line-height: 1; }
.char .front .mono { color: var(--ink-3); }
.char .back { transform: rotateY(180deg); padding: clamp(12px, 2vw, 24px); text-align: center; background: var(--ink); color: var(--paper); }
.char .back strong { font: 400 italic clamp(20px, 2.4vw, 30px)/1.05 var(--display); color: #f0a08f; }
.char .back span { font-size: clamp(12px, 1.2vw, 14px); line-height: 1.45; color: #cfc5b6; }

/* origins: a row you swipe, drag or step through — the page keeps scrolling normally */
.origins { padding: 0; margin-top: clamp(100px, 13vw, 170px); }
.origins-head { padding: 0 var(--gutter); margin-bottom: 40px; display: flex; justify-content: space-between; align-items: end; gap: 24px; }
.progress { width: 160px; height: 2px; background: var(--rule); position: relative; flex-shrink: 0; }
.progress i { position: absolute; inset: 0; background: var(--zhu); transform-origin: left; transform: scaleX(0); }
.origins-nav { display: flex; align-items: center; gap: 12px; flex-shrink: 0; }
.origins-nav .progress { margin-right: 10px; }
.arrow { width: 46px; height: 46px; border-radius: 50%; border: 1px solid var(--rule); font: 400 18px var(--sans); color: var(--ink); transition: all .2s; }
.arrow:hover:not(:disabled) { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.arrow:disabled { opacity: .35; cursor: default; }
.track { display: flex; gap: 28px; padding: 0 var(--gutter) 8px; overflow-x: auto; scroll-snap-type: x mandatory; scroll-padding: 0 var(--gutter); scrollbar-width: none; overscroll-behavior-x: contain; cursor: grab; }
.track::-webkit-scrollbar { display: none; }
.track.dragging { cursor: grabbing; scroll-snap-type: none; user-select: none; }
.track .panel { scroll-snap-align: start; }
.panel { flex: 0 0 min(440px, 78vw); min-height: 500px; position: relative; padding: 34px; background: var(--paper-3); border: 1px solid var(--rule); border-radius: 4px; display: flex; flex-direction: column; justify-content: flex-end; overflow: hidden; }
.panel h3 { margin: 10px 0 14px; position: relative; }
.panel p { color: var(--ink-2); font-size: 17px; position: relative; }
.panel-ink { position: relative; flex: 0 0 230px; margin: -34px -34px auto; padding-bottom: 20px; }
.panel .num { color: var(--zhu); position: relative; }
.photo-panel { flex-basis: min(640px, 86vw); }
.photo-panel .ph { position: absolute; inset: 0; overflow: hidden; }
.photo-panel .ph img { width: 100%; height: 100%; object-fit: cover; pointer-events: none; }
.photo-panel .ph::after { content: ""; position: absolute; inset: 0; background: linear-gradient(transparent 30%, rgba(20,16,12,.78)); }
.photo-panel h3 { color: var(--paper); }
.photo-panel p { color: #e8dfd2; }
.photo-panel .num { color: #f0a08f; }

/* eight jobs: hanging name badges */
.jobs-head { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(28px, 5vw, 72px); align-items: end; }
.jobs-head p { color: var(--ink-2); }
.line { position: relative; margin-top: 64px; padding-top: 40px; }
.line::before { content: ""; position: absolute; left: -2%; right: -2%; top: 0; height: 2px; background: var(--ink); border-radius: 2px; transform: rotate(-.4deg); }
.badges { display: grid; grid-template-columns: repeat(8, 1fr); gap: 14px; }
.badge { position: relative; transform-origin: 50% -40px; animation: sway 5s ease-in-out infinite; animation-delay: calc(var(--i) * -.6s); }
.badge::before { content: ""; position: absolute; left: 50%; top: -40px; width: 1.5px; height: 40px; background: var(--ink-3); }
.badge:hover { animation-play-state: paused; }
@keyframes sway { 0%, 100% { rotate: -2.5deg; } 50% { rotate: 2.5deg; } }
.badge-card { background: #fffdf8; border: 1px solid var(--rule); border-radius: 8px; overflow: hidden; box-shadow: 0 16px 24px -18px rgba(35,31,28,.5); text-align: center; transition: transform .4s var(--ease); }
.badge:hover .badge-card { transform: translateY(8px) scale(1.05); }
.badge-top { background: var(--zhu); color: #fff; padding: 8px 4px 6px; font: 500 10px var(--mono); letter-spacing: .1em; }
.badge-top b { display: block; font: italic 400 16px var(--display); letter-spacing: 0; }
.badge-mid { padding: 16px 8px 14px; min-height: 104px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; }
.badge-mid strong { font: 400 19px/1.1 var(--display); }
.badge-mid span { font: 400 12px/1.3 var(--mono); color: var(--ink-3); }
.badge-hole { width: 18px; height: 5px; border-radius: 4px; background: var(--paper); border: 1px solid var(--rule); margin: 8px auto 0; }
.hats { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 64px; justify-content: center; }
.hat { padding: 10px 18px; border-radius: 999px; border: 1px solid var(--ink); font: 400 20px var(--display); transition: all .3s var(--ease); }
.hat:hover { background: var(--ink); color: var(--paper); transform: translateY(-3px); }
.trait { margin-top: 72px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.trait div { padding: 28px 0; border-top: 2px solid var(--ink); }
.trait h4 { font: 400 26px/1.15 var(--display); margin-bottom: 10px; }
.trait p { font-size: 15px; color: var(--ink-2); }

/* words */
.notes { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(28px, 5vw, 72px); margin-top: 24px; }
.note { padding: 40px; background: var(--paper-3); border: 1px solid var(--rule); border-radius: 4px; transition: rotate .4s; }
.note:first-child { rotate: -1.2deg; }
.note:last-child { rotate: 1deg; margin-top: 60px; }
.note:hover { rotate: 0deg; }
.note p { font: 400 clamp(22px, 2.3vw, 30px)/1.25 var(--display); }
.note cite { display: block; margin-top: 22px; font-style: normal; color: var(--ink-3); }

/* rug: peel to reveal */
.rug { overflow: clip; }
.rug-stage { position: relative; height: clamp(520px, 52vw, 640px); margin-top: 48px; }
.desk {
  position: absolute; inset: 0; overflow: hidden; border-radius: 4px;
  background-color: #c9a77c;
  background-image:
    repeating-linear-gradient(0deg, rgba(90,60,30,.18) 0 1px, transparent 1px 64px),
    repeating-linear-gradient(90deg, rgba(90,60,30,.10) 0 1px, transparent 1px 220px),
    linear-gradient(#cfae84, #c39f74);
}
.file { position: absolute; left: var(--x); top: var(--y); width: 120px; display: flex; flex-direction: column; align-items: center; gap: 8px; touch-action: none; user-select: none; }
.ico { width: 64px; height: 76px; border-radius: 6px; background: #fff; box-shadow: 0 6px 12px -6px rgba(0,0,0,.4); display: grid; place-items: center; font-size: 26px; color: var(--ink-2); transition: transform .2s; }
.file:hover .ico { transform: translateY(-4px) rotate(-2deg); }
.ico-folder { width: 80px; height: 62px; background: linear-gradient(#7cc0f2, #4d9fe0); border-radius: 4px 10px 6px 6px; position: relative; }
.ico-folder::before { content: ""; position: absolute; left: 0; top: -8px; width: 34px; height: 12px; background: #6ab3ec; border-radius: 4px 4px 0 0; }
.ico-img { background-size: cover; background-position: center; border: 3px solid #fff; }
.ico-sheet { background-color: #fff; background-image: linear-gradient(#2e8b57, #2e8b57), repeating-linear-gradient(0deg, #ddd 0 1px, transparent 1px 10px), repeating-linear-gradient(90deg, #ddd 0 1px, transparent 1px 16px); background-size: 100% 12px, 100% 100%, 100% 100%; background-repeat: no-repeat; }
.ico-ink { font-size: 40px; color: var(--ink); }
.star { color: var(--zhu); background: #fff3ef; }
.fname { font: 500 12px/1.3 var(--sans); color: #fff; text-align: center; text-shadow: 0 1px 3px rgba(0,0,0,.6); word-break: break-word; padding: 2px 6px; border-radius: 4px; }
.file:focus-visible .fname, .file.sel .fname { background: #2f6fd6; text-shadow: none; }
.window { position: absolute; left: 50%; top: 50%; translate: -50% -50%; width: min(420px, 86%); z-index: 20; background: var(--paper-3); border-radius: 10px; overflow: hidden; box-shadow: 0 30px 60px -20px rgba(0,0,0,.5), 0 0 0 1px rgba(0,0,0,.08); animation: pop .25s cubic-bezier(.2,.9,.3,1.2); }
@keyframes pop { from { scale: .85; opacity: 0; } }
.win-bar { display: flex; justify-content: space-between; align-items: center; padding: 10px 14px; background: var(--paper-2); color: var(--ink-2); }
.win-close { font-size: 20px; line-height: 1; width: 24px; height: 24px; border-radius: 50%; }
.win-close:hover { background: var(--zhu); color: #fff; }
.win-imgs { display: grid; grid-template-columns: repeat(var(--n, 1), 1fr); gap: 2px; background: var(--paper-2); }
.win-imgs[hidden] { display: none; }
.win-imgs img { width: 100%; height: 300px; object-fit: cover; object-position: center 35%; cursor: zoom-in; }
.win-imgs.grid img { height: 170px; }
.window p { padding: 20px; font: 400 21px/1.35 var(--display); }
.cover-sheet { position: absolute; inset: 0; z-index: 5; background: radial-gradient(ellipse at 30% 20%, rgba(255,255,255,.5), transparent 60%), var(--paper-3); border: 1px solid var(--rule); border-radius: 4px; display: grid; place-items: center; user-select: none; }
.cover-ink { position: absolute; inset: 0; overflow: hidden; border-radius: 4px; }
.cover-inner { position: absolute; left: 32px; top: 30px; max-width: 380px; }
.cover-title { font: 400 28px/1.1 var(--display); color: var(--ink); }
.cover-text { margin-top: 10px; font: 300 15px/1.55 var(--sans); color: var(--ink-2); }
.cover-hint { position: absolute; right: 26px; bottom: 22px; color: var(--zhu); animation: nudge 1.6s ease-in-out infinite; }
@keyframes nudge { 50% { transform: translate(4px, 4px); } }
.flap-wrap { position: absolute; inset: 0; z-index: 6; pointer-events: none; filter: drop-shadow(-6px -6px 10px rgba(35,31,28,.28)); }
.flap { position: absolute; left: -100%; top: -100%; width: 300%; height: 300%; }
.corner { position: absolute; right: 0; bottom: 0; width: 120px; height: 120px; z-index: 7; cursor: grab; touch-action: none; }
.reset { display: block; margin: 20px auto 0; color: var(--ink-3); border-bottom: 1px solid var(--rule); }
.reset:hover { color: var(--zhu); }
.reset[hidden] { display: none; }

/* ================= LENS ================= */
.hint { color: var(--ink-3); margin-top: 40px; }
.table { position: relative; height: clamp(1260px, 128vw, 1660px); margin-top: 16px; }
.stamp {
  --perf: 7px;
  position: absolute; left: var(--x); top: var(--y); width: var(--w);
  padding: 12px; background: #fbf8f2;
  rotate: var(--r);
  -webkit-mask: linear-gradient(#000 0 0) content-box, radial-gradient(circle var(--perf), #0000 96%, #000) calc(var(--perf) * -1) calc(var(--perf) * -1) / calc(var(--perf) * 2.4) calc(var(--perf) * 2.4) round;
          mask: linear-gradient(#000 0 0) content-box, radial-gradient(circle var(--perf), #0000 96%, #000) calc(var(--perf) * -1) calc(var(--perf) * -1) / calc(var(--perf) * 2.4) calc(var(--perf) * 2.4) round;
  filter: drop-shadow(0 10px 14px rgba(35,31,28,.18));
  cursor: grab; touch-action: none; user-select: none;
  transition: filter .2s, scale .25s var(--ease);
}
.stamp.land { --w: 30%; }
.stamp.port { --w: 19%; }
.stamp:hover { scale: 1.03; }
.stamp.dragging { cursor: grabbing; scale: 1.06; filter: drop-shadow(0 26px 30px rgba(35,31,28,.3)); transition: none; }
.stamp img { width: 100%; pointer-events: none; }
.stamp figcaption { position: absolute; right: 22px; bottom: 18px; color: #ffb35c; font-weight: 500; text-shadow: 0 0 6px rgba(255,140,40,.7); }
.lightbox { position: fixed; inset: 0; z-index: 90; background: rgba(20,16,12,.88); display: grid; place-items: center; padding: 5vh 5vw; cursor: zoom-out; animation: fade .3s ease; }
.lightbox[hidden] { display: none; }
.lightbox img { max-width: 100%; max-height: 90vh; border-radius: 3px; box-shadow: 0 30px 80px rgba(0,0,0,.5); animation: zoom .45s var(--ease); }
@keyframes fade { from { opacity: 0; } }
@keyframes zoom { from { transform: scale(.92); opacity: 0; } }

/* ---------- footer ---------- */
.footer { padding: clamp(100px, 13vw, 170px) var(--gutter) 32px; }
.stamp-zone { position: relative; min-height: 56vh; cursor: crosshair; }
.links { display: flex; flex-direction: column; gap: 10px; margin-top: 36px; font: 400 22px var(--display); }
.links a { width: fit-content; border-bottom: 1px solid var(--rule); cursor: pointer; }
.links a:hover { color: var(--zhu); border-color: var(--zhu); }
.signature { position: absolute; right: 0; bottom: 30px; margin: 0; }
.sig-row { display: flex; align-items: flex-end; gap: 20px; }
.sig { font-size: clamp(64px, 6.4vw, 92px); line-height: 1; white-space: nowrap; }
.sig-seal { display: block; rotate: -3deg; margin-bottom: 6px; }
.signature figcaption { margin-top: 18px; max-width: 360px; display: flex; flex-direction: column; gap: 6px; }
.sig-roman { color: var(--zhu); font-weight: 500; letter-spacing: .06em; }
.sig-note { font: 300 15px/1.55 var(--sans); color: var(--ink-2); }
.seal-mark { display: block; }
.footer-ink { height: 170px; margin: -10px calc(var(--gutter) * -1) 0; pointer-events: none; }
.stamp-hint { color: var(--ink-3); margin-top: 40px; }
.dropped { position: absolute; translate: -50% -50%; animation: thunk .35s cubic-bezier(.2,.9,.3,1.4) both; pointer-events: none; }
@keyframes thunk { from { scale: 1.8; opacity: 0; } }
.fine { display: flex; justify-content: space-between; margin-top: 56px; padding-top: 20px; border-top: 1px solid var(--rule); color: var(--ink-3); }
.link { display: inline-block; font: 500 13px var(--mono); border-bottom: 1px solid currentColor; }
.link:hover { color: var(--zhu); }

/* ---------- reveal ---------- */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity 1s ease, transform 1s var(--ease); }
.reveal.in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .dot, .scroll-cue::after, .cover-hint, .badge { animation: none; }
  ::view-transition-old(root), ::view-transition-new(root) { animation: none; }
}

/* ---------- tablet & phone ---------- */
@media (max-width: 1100px) {
  .badges { grid-template-columns: repeat(4, 1fr); row-gap: 72px; }
}
@media (max-width: 900px) {
  .nav { grid-template-columns: auto 1fr; gap: 12px; }
  .nav .btn { display: none; }
  .tabs { justify-self: end; }
  .tabs a { padding: 7px 11px; }
  .brand .name-en { display: none; }
  .hero { grid-template-columns: 1fr; padding-top: 110px; gap: 44px; align-content: start; min-height: 0; }
  .hero h1 { font-size: 50px; }
  .hero-note { font-size: 17px; }
  .hero-ink { height: 18%; }
  .portrait { max-width: 440px; width: 100%; justify-self: center; }
  .scroll-cue { display: none; }
  .intro, .page-head, .about-hero, .jobs-head, .notes, .d-hero { grid-template-columns: 1fr; }
  .d-hero { padding-top: 32px; }
  .d-facts > div { border-left: 0; padding-left: 0; }
  .about-photo { position: static; max-width: 360px; }
  .doors { grid-template-columns: 1fr; }
  .door { aspect-ratio: 16/10; }
  .track { gap: 16px; }
  .track .panel { flex-basis: 84vw; min-height: 440px; }
  .origins-nav .progress, .arrow { display: none; }
  .trait { grid-template-columns: 1fr; }
  .note:last-child { margin-top: 0; }
  .deck { height: auto; display: flex; gap: 14px; overflow-x: auto; scroll-snap-type: x mandatory; padding: 34px 0 20px; }
  .pcard { position: relative; top: 0; flex: 0 0 78vw; height: 440px; transform: none !important; scroll-snap-align: center; scroll-snap-stop: always; }
  .pcard.out { display: none; }
  .pcard .open { opacity: 1; transform: none; }
  .table { height: auto; display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
  .stamp { position: relative; left: auto; top: auto; width: auto; translate: none !important; touch-action: auto; cursor: zoom-in; }
  .stamp.land { grid-column: span 2; }
  .rug-stage { height: 620px; }
  .file { width: 96px; }
  .signature { position: static; margin-top: 56px; }
  .sig { font-size: 60px; }
  .footer-ink { height: 110px; }
}
@media (max-width: 520px) {
  /* name cards: taller and tighter on the back so the meaning fits */
  .chars { gap: 10px; }
  .char { width: calc((100vw - 2 * var(--gutter) - 20px) / 3); aspect-ratio: 3/5; }
  .char .back { padding: 10px 8px; gap: 6px; justify-content: flex-start; padding-top: 16px; }
  .char .back strong { font-size: 18px; }
  .char .back span { font-size: 12px; line-height: 1.4; }
  .tabs a { padding: 6px 8px; font-size: 13px; }
  .badges { grid-template-columns: repeat(2, 1fr); }
  .facts { grid-template-columns: 1fr; }
}
