/* ==========================================================================
   栢僻 BAIPI — 标本室 / Herbarium
   Deep forest, bone paper, one moss accent. Editorial, not templated.
   No custom cursor, no smooth-scroll hijack, no pinned sections.
   ========================================================================== */

@font-face {
  font-family: "BP Serif";
  src: url("../fonts/bp-serif.woff2") format("woff2");
  font-weight: 300 700;
  font-display: swap;
}
@font-face {
  font-family: "BP Latin";
  src: url("../fonts/bp-latin.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}

:root {
  --ink: #0b1410;
  --ink-2: #10201a;
  --paper: #f2efe4;
  --paper-2: #e7e2d2;
  --bone: #d9d3c0;
  --moss: #c6e27a;
  --moss-2: #8fae4a;
  --text: #efece0;
  --text-dim: rgba(239, 236, 224, .58);
  --line: rgba(239, 236, 224, .17);
  --line-dark: rgba(11, 20, 16, .18);

  --serif: "BP Serif", "Noto Serif SC", "Songti SC", serif;
  --sans: -apple-system, "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
  --latin: "BP Latin", "Cormorant Garamond", Georgia, serif;

  --shell: min(1360px, 90vw);
  --pad: clamp(18px, 4.4vw, 64px);
  --ease: cubic-bezier(.22, 1, .36, 1);
  --head: 76px;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--ink);
  color: var(--text);
  font-family: var(--sans);
  font-size: 16.5px;
  line-height: 1.8;
  letter-spacing: .015em;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
img, video, svg { display: block; max-width: 100%; }
h1, h2, h3, p, figure, dl, dd, dt, ul, ol { margin: 0; padding: 0; }
ul, ol { list-style: none; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
::selection { background: var(--moss); color: var(--ink); }
:focus-visible { outline: 2px solid var(--moss); outline-offset: 4px; }

.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 400;
  background: var(--moss); color: var(--ink); padding: 10px 16px;
}
.skip-link:focus { left: 0; }

/* ------------------------------------------------------------------ shell */
.shell { width: var(--shell); margin-inline: auto; }

/* hairline frame around the whole page — a gallery matte */
.frame { position: fixed; inset: 0; z-index: 70; pointer-events: none; }
.frame::before,
.frame::after { content: ""; position: absolute; background: var(--line); }
.frame::before { left: var(--pad); right: var(--pad); top: 0; height: 1px; }
.frame::after { left: var(--pad); right: var(--pad); bottom: 0; height: 1px; }

/* ------------------------------------------------------------------- type */
.eyebrow {
  font-size: 10.5px; letter-spacing: .34em; text-transform: uppercase;
  color: var(--text-dim);
}
.label {
  font-size: 10.5px; letter-spacing: .26em; text-transform: uppercase;
  color: var(--text-dim);
}
.display { font-family: var(--serif); font-weight: 500; line-height: 1.04; letter-spacing: -.01em; }
.h2 {
  font-family: var(--serif); font-weight: 500;
  font-size: clamp(1.65rem, 3vw, 2.6rem);
  line-height: 1.2;
}
.num {
  font-family: var(--latin);
  font-size: clamp(2.5rem, 5vw, 4.5rem);
  line-height: .8;
  color: var(--moss);
}
.body-copy { font-size: 1rem; line-height: 1.95; color: var(--text-dim); max-width: 33em; }
.body-copy + .body-copy { margin-top: .9em; }
.rule { height: 1px; background: var(--line); border: 0; margin: 0; }

.link { border-bottom: 1px solid var(--moss); padding-bottom: 1px; transition: color .2s, border-color .2s; }
.link:hover { color: var(--moss); }

.btn {
  display: inline-flex; align-items: center; gap: .6em;
  min-height: 44px; padding: 0 22px;
  border: 1px solid var(--line);
  font-size: 13px; letter-spacing: .1em;
  transition: background-color .22s, color .22s, border-color .22s;
}
.btn:hover { background: var(--moss); border-color: var(--moss); color: var(--ink); }
.btn--solid { background: var(--moss); border-color: var(--moss); color: var(--ink); }
.btn--solid:hover { filter: brightness(1.06); }

/* ------------------------------------------------------------------- head */
.site-head {
  position: fixed; inset: 0 0 auto 0; z-index: 80;
  height: var(--head);
  display: flex; align-items: center; justify-content: space-between;
  gap: 20px; padding-inline: var(--pad);
  pointer-events: none;
}
.site-head > * { pointer-events: auto; }

.brand { display: inline-flex; align-items: baseline; gap: 10px; }
.brand-cn { font-family: var(--serif); font-size: 19px; letter-spacing: .14em; }
.brand-latin { font-family: var(--latin); font-size: 11px; letter-spacing: .38em; color: var(--text-dim); }

.nav { display: flex; gap: clamp(14px, 2.2vw, 30px); }
.nav a {
  position: relative; font-size: 12.5px; letter-spacing: .1em;
  color: var(--text-dim); padding-block: 6px;
  transition: color .2s;
}
.nav a::after {
  content: ""; position: absolute; left: 0; bottom: 0;
  width: 100%; height: 1px; background: var(--moss);
  transform: scaleX(0); transform-origin: left;
  transition: transform .28s var(--ease);
}
.nav a:hover, .nav a.is-active { color: var(--text); }
.nav a:hover::after, .nav a.is-active::after { transform: scaleX(1); }

.head-actions { display: flex; align-items: center; gap: 10px; }
.icon-btn {
  width: 40px; height: 40px; display: grid; place-items: center;
  border: 1px solid var(--line);
  transition: border-color .2s, color .2s;
}
.icon-btn:hover { border-color: var(--moss); color: var(--moss); }
.icon-btn svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.4; }

.menu-btn { display: none; }
.menu-btn span { display: block; width: 16px; height: 1px; background: currentColor; margin: 4px auto; }
.sound-bars { display: inline-flex; align-items: flex-end; gap: 2px; height: 12px; }
.sound-bars i { width: 2px; height: 4px; background: currentColor; }
.sound-btn[aria-pressed="true"] .sound-bars i { animation: bars .9s ease-in-out infinite; }
.sound-btn[aria-pressed="true"] .sound-bars i:nth-child(2) { animation-delay: .15s; }
.sound-btn[aria-pressed="true"] .sound-bars i:nth-child(3) { animation-delay: .3s; }
@keyframes bars { 0%,100% { height: 4px; } 50% { height: 12px; } }

/* ---------------------------------------------------------------- loading */
html.is-loading body { overflow: hidden; }
.loader {
  position: fixed; inset: 0; z-index: 300;
  display: grid; place-items: center;
  background: var(--ink);
  transition: opacity .6s var(--ease), clip-path .9s var(--ease);
  clip-path: inset(0 0 0 0);
}
.loader.is-done { opacity: 0; clip-path: inset(0 0 100% 0); pointer-events: none; }
.loader-inner { display: flex; align-items: flex-end; gap: clamp(16px, 4vw, 48px); padding: 0 8vw; }
.loader-art {
  width: clamp(130px, 18vw, 220px); height: auto;
  filter: drop-shadow(0 24px 36px rgba(0,0,0,.6));
  animation: bob 3.4s ease-in-out infinite;
}
@keyframes bob { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }
.loader-meta { display: grid; gap: 10px; padding-bottom: 12px; }
.loader-name { font-family: var(--serif); font-size: clamp(1.25rem,2.6vw,1.9rem); letter-spacing: .1em; }
.loader-name span { font-family: var(--latin); font-size: 10px; letter-spacing: .4em; color: var(--moss); margin-left: 8px; }
.loader-bar { width: clamp(140px,18vw,220px); height: 1px; background: var(--line); overflow: hidden; }
.loader-bar span { display: block; height: 100%; width: 0; background: var(--moss); transition: width .3s linear; }
.loader-count { font-family: var(--latin); font-size: 12px; color: var(--text-dim); letter-spacing: .12em; }

/* ------------------------------------------------------------------- hero */
.hero { position: relative; min-height: 100svh; display: grid; align-items: end; overflow: hidden; }
.hero-media { position: absolute; inset: 0; }
.hero-video, .hero-poster {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
  filter: saturate(.72) contrast(1.06) brightness(.72);
}
.hero-poster { filter: blur(12px) brightness(.7); transform: scale(1.06); transition: opacity .8s; }
.hero-video { opacity: 0; transition: opacity 1s var(--ease); }
.hero-video.is-ready { opacity: 1; }
.hero.is-video-ready .hero-poster { opacity: 0; }
.hero-shade {
  position: absolute; inset: 0;
  background:
    linear-gradient(180deg, rgba(6,14,10,.86) 0%, rgba(6,14,10,.28) 34%, rgba(6,14,10,.9) 100%),
    radial-gradient(80% 60% at 50% 45%, rgba(18,44,28,.5), rgba(6,14,10,.2) 70%);
}
.hero-inner {
  position: relative; z-index: 2;
  width: var(--shell); margin: 0 auto;
  padding-bottom: clamp(56px, 10vh, 110px);
  display: grid; gap: clamp(16px, 3vh, 28px);
}
.hero-top { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; }
.hero-title {
  font-family: var(--serif);
  font-size: clamp(4rem, 13vw, 11rem);
  font-weight: 500;
  line-height: .88;
  letter-spacing: .02em;
}
.hero-title em {
  display: block; font-family: var(--latin); font-style: normal;
  font-size: clamp(.75rem, 1.2vw, 1rem);
  letter-spacing: .62em; color: var(--moss); margin-top: .5em;
}
.hero-foot { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; flex-wrap: wrap; }
.hero-sub { font-size: clamp(.95rem, 1.4vw, 1.1rem); color: rgba(239,236,224,.78); max-width: 26em; }
.hero-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.scroll-cue { display: inline-flex; align-items: center; gap: 10px; }
.scroll-cue i { display: block; width: 26px; height: 1px; background: var(--moss); animation: cue 2.6s var(--ease) infinite; }
@keyframes cue { 0%,100% { transform: scaleX(.5); opacity: .5; } 50% { transform: scaleX(1); opacity: 1; } }

/* --------------------------------------------------------------- sections */
.section { padding-block: clamp(72px, 11vh, 148px); position: relative; }
.section--paper { background: var(--paper); color: var(--ink-2); }
.section--paper .label, .section--paper .body-copy { color: rgba(11,20,16,.62); }
.section--paper .rule { background: var(--line-dark); }
.section--paper .h2 { color: var(--ink); }
.section--paper .btn { border-color: var(--line-dark); }
.section--paper .btn:hover { background: var(--ink); border-color: var(--ink); color: var(--paper); }

.section-head {
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr) minmax(0, .8fr);
  gap: clamp(16px, 3vw, 40px);
  align-items: end;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
  margin-bottom: clamp(28px, 4.5vh, 56px);
}
.section--paper .section-head { border-color: var(--line-dark); }
.section-head .num { color: var(--moss); }
.section--paper .section-head .num { color: var(--moss-2); }
.section-head .note { font-size: 12.5px; color: var(--text-dim); text-align: right; }
.section--paper .section-head .note { color: rgba(11,20,16,.55); }

/* ------------------------------------------------------------------- card */
.card-grid {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(28px, 5vw, 72px); align-items: center;
}
.portrait { position: relative; }
.portrait img { width: 100%; height: auto; }
.portrait figcaption {
  display: flex; justify-content: space-between; gap: 12px;
  margin-top: 10px; font-size: 11px; letter-spacing: .16em;
  color: rgba(11,20,16,.5);
}
.card-copy { display: grid; gap: 18px; align-content: center; }
.card-name { font-family: var(--serif); font-size: clamp(2rem, 4.4vw, 3.4rem); line-height: 1; }
.card-name span { font-family: var(--latin); font-size: .9rem; letter-spacing: .4em; color: var(--moss-2); margin-left: 10px; }
.card-quote {
  font-family: var(--serif);
  font-size: clamp(1.05rem, 1.7vw, 1.35rem);
  line-height: 1.75; color: var(--ink-2); max-width: 26em;
}
.meta-list { display: grid; border-top: 1px solid var(--line-dark); }
.meta-list div {
  display: grid; grid-template-columns: 96px minmax(0,1fr);
  gap: 16px; padding-block: 11px;
  border-bottom: 1px solid var(--line-dark);
  font-size: 13.5px;
}
.meta-list dt { font-size: 10.5px; letter-spacing: .2em; color: rgba(11,20,16,.5); align-self: center; }

/* ------------------------------------------------------------------ works */
.rail {
  display: flex; gap: clamp(14px, 2vw, 28px);
  overflow-x: auto; overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory;
  padding: 0 var(--pad) 18px;
}
.rail::-webkit-scrollbar { height: 3px; }
.rail::-webkit-scrollbar-thumb { background: var(--line); }
.rail-item { flex: 0 0 auto; width: clamp(230px, 26vw, 340px); scroll-snap-align: center; display: grid; gap: 10px; }
.rail-media { display: block; background: var(--ink-2); aspect-ratio: 4/5; overflow: hidden; }
.rail-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .7s var(--ease); }
.rail-item:hover .rail-media img { transform: scale(1.03); }
.rail-cap { display: flex; justify-content: space-between; gap: 10px; font-size: 11.5px; color: var(--text-dim); }
.rail-cap b { font-weight: 400; color: var(--text); }
.rail-hint { display: flex; align-items: center; gap: 10px; padding-inline: var(--pad); margin-top: 14px; font-size: 11px; letter-spacing: .18em; color: var(--text-dim); }
.rail-hint i { flex: 1; height: 1px; background: var(--line); }

/* ------------------------------------------------------------------ grids */
.grid-orders { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: clamp(14px, 2vw, 26px); }
.grid-sketch { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: clamp(12px, 1.8vw, 22px); }
.tile { display: grid; gap: 8px; }
.tile-media { display: block; overflow: hidden; background: var(--paper-2); aspect-ratio: 1/1; }
.grid-sketch .tile-media { aspect-ratio: 3/4; }
.tile-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .7s var(--ease); }
.tile:hover .tile-media img { transform: scale(1.04); }
.tile-cap { display: flex; justify-content: space-between; font-size: 11px; color: rgba(11,20,16,.55); letter-spacing: .06em; }

/* -------------------------------------------------------------------- bili */
.bili { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: clamp(20px, 4vw, 60px); align-items: center; }
.bili-shot { position: relative; display: block; overflow: hidden; background: var(--ink-2); aspect-ratio: 16/9; }
.bili-shot img { width: 100%; height: 100%; object-fit: cover; filter: saturate(.8) brightness(.8); transition: transform .8s var(--ease); }
.bili:hover .bili-shot img { transform: scale(1.03); }
.bili-play {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: 66px; height: 66px; border: 1px solid rgba(239,236,224,.7);
  display: grid; place-items: center;
}
.bili-play svg { width: 20px; height: 20px; fill: var(--paper); margin-left: 3px; }
.bili-copy { display: grid; gap: 14px; align-content: center; }

/* -------------------------------------------------------------- commission */
.commission-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, .78fr); gap: clamp(28px, 5vw, 72px); align-items: start; }
.steps { display: grid; border-top: 1px solid var(--line-dark); }
.step { display: grid; grid-template-columns: 56px minmax(0,1fr); gap: 6px 20px; padding-block: 18px; border-bottom: 1px solid var(--line-dark); }
.step .n { font-family: var(--latin); font-size: 15px; color: var(--moss-2); }
.step h3 { font-family: var(--serif); font-size: 1.15rem; font-weight: 500; }
.step p { grid-column: 2; font-size: 13.5px; line-height: 1.85; color: rgba(11,20,16,.62); }

.qr { justify-self: end; width: min(320px, 100%); display: grid; gap: 12px; justify-items: center; text-align: center; }
.qr img { width: 100%; max-width: 240px; padding: 10px; background: #fff; }
.qr .qq { font-family: var(--latin); font-size: 1.6rem; letter-spacing: .06em; color: var(--ink); }
.chip-row { display: flex; flex-wrap: wrap; gap: 6px; }
.chip-row li { padding: 4px 10px; border: 1px solid var(--line-dark); font-size: 12px; }
.chip-row--off li { opacity: .45; }

/* ----------------------------------------------------------------- contact */
.contact { display: grid; gap: clamp(18px, 3vh, 30px); }
.contact-line { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; padding-block: 14px; border-bottom: 1px solid var(--line); }
.contact-line a, .contact-line .v { font-family: var(--latin); font-size: clamp(1.1rem, 2.2vw, 1.7rem); letter-spacing: .04em; }
.contact-copy { font-size: 11px; letter-spacing: .18em; color: var(--text-dim); padding: 6px 10px; border: 1px solid var(--line); }

/* ------------------------------------------------------------------ footer */
.foot { padding-block: 26px; border-top: 1px solid var(--line); }
.foot-inner { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; font-size: 11px; letter-spacing: .1em; color: var(--text-dim); }

/* ------------------------------------------------------------------ widget */
.widget {
  position: fixed; left: 0; top: 0; z-index: 90;
  width: clamp(58px, 5.2vw, 82px);
  touch-action: none; cursor: grab;
  user-select: none; -webkit-user-select: none;
  will-change: transform;
  transform: translate3d(0, 0, 0);
}
.widget:active { cursor: grabbing; }
.widget-rope {
  display: block; width: 1px; margin: 0 auto;
  background: linear-gradient(180deg, rgba(239,236,224,.05), rgba(239,236,224,.55));
  height: var(--rope, 44px);
}
.widget-art {
  position: relative; display: block;
  transform-origin: 50% -10px;
  animation: sway 5.4s ease-in-out infinite;
}
.widget.is-dragging .widget-art { animation: none; }
@keyframes sway { 0%, 100% { transform: rotate(-2.6deg); } 50% { transform: rotate(2.6deg); } }
.widget-art img { width: 100%; height: auto; pointer-events: none; -webkit-user-drag: none; }
.widget-hint {
  position: absolute; left: 50%; top: calc(100% + 6px); transform: translateX(-50%);
  white-space: nowrap; font-size: 10px; letter-spacing: .14em;
  color: var(--text-dim); opacity: 0; transition: opacity .2s;
}
.widget:hover .widget-hint, .widget.is-dragging .widget-hint { opacity: 1; }

/* ------------------------------------------------------------------ dialog */
.note-dialog { border: 0; padding: 0; background: transparent; max-width: min(420px, 92vw); }
.note-dialog::backdrop { background: rgba(6,14,10,.7); }
.note-card { background: var(--paper); color: var(--ink-2); padding: clamp(22px,4vw,34px); }
.note-eyebrow { font-size: 10px; letter-spacing: .24em; color: var(--moss-2); }
.note-text { margin-top: 12px; font-family: var(--serif); font-size: 1.3rem; line-height: 1.6; }
.note-card .btn { margin-top: 20px; border-color: var(--ink-2); color: var(--ink-2); }

.toast {
  position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%);
  z-index: 200; padding: 10px 18px;
  background: var(--moss); color: var(--ink);
  font-size: 12px; letter-spacing: .08em;
}
.toast[hidden] { display: none; }

.mobile-menu { position: fixed; inset: 0; z-index: 150; background: var(--ink); display: grid; place-content: center; gap: 6px; text-align: center; }
.mobile-menu[hidden] { display: none; }
.mobile-menu a { font-family: var(--serif); font-size: clamp(1.8rem, 8vw, 2.6rem); padding: 8px 0; }
.menu-close { position: absolute; top: 18px; right: 18px; padding: 10px 14px; border: 1px solid var(--line); font-size: 12px; }

/* -------------------------------------------------------------- work page */
.work { padding-top: calc(var(--head) + 20px); }
.work-top { display: flex; justify-content: space-between; align-items: baseline; font-size: 11px; letter-spacing: .16em; color: var(--text-dim); padding-block: 14px; }
.work-title { font-family: var(--serif); font-size: clamp(2.2rem, 6vw, 4.6rem); line-height: 1.02; }
.work-sub { margin-top: 10px; font-size: 11.5px; letter-spacing: .14em; color: var(--text-dim); }
.work-plate { width: min(1120px, 92vw); margin: clamp(26px,5vh,56px) auto; background: var(--ink-2); }
.work-plate img { width: 100%; height: auto; }
.work-body { display: grid; grid-template-columns: minmax(0,1.4fr) minmax(0,.6fr); gap: clamp(24px,5vw,64px); padding-bottom: 64px; }
.work-note { font-size: 1.05rem; line-height: 1.95; }
.work-spec { border-top: 1px solid var(--line); align-self: start; }
.work-spec div { display: grid; grid-template-columns: 60px 1fr; gap: 12px; padding-block: 10px; border-bottom: 1px solid var(--line); font-size: 13px; }
.work-spec dt { font-size: 10px; letter-spacing: .16em; color: var(--text-dim); align-self: center; }
.work-nav { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; padding-block: 22px 68px; border-top: 1px solid var(--line); }
.work-nav a { display: grid; gap: 4px; }
.work-nav .label { font-size: 10px; }
.work-nav .t { font-family: var(--serif); font-size: 1.05rem; }
.work-nav .mid { text-align: center; }
.work-nav .right { text-align: right; }

/* --------------------------------------------------------------- reveal */
[data-reveal] { opacity: 0; transform: translateY(16px); transition: opacity .7s var(--ease), transform .7s var(--ease); }
[data-reveal].is-in { opacity: 1; transform: none; }

/* ------------------------------------------------------------- responsive */
@media (max-width: 1080px) {
  .nav { display: none; }
  .menu-btn { display: grid; }
  .card-grid, .commission-grid, .bili { grid-template-columns: minmax(0,1fr); }
  .grid-orders { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .grid-sketch { grid-template-columns: repeat(3, minmax(0,1fr)); }
  .section-head { grid-template-columns: 64px minmax(0,1fr); }
  .section-head .note { grid-column: 1 / -1; text-align: left; margin-top: 8px; }
}

@media (max-width: 720px) {
  :root { --head: 62px; }
  body { font-size: 16px; }
  .hero-title { font-size: clamp(3.2rem, 18vw, 5.5rem); }
  .hero-foot { flex-direction: column; align-items: flex-start; }
  .grid-orders, .grid-sketch { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .qr { justify-self: stretch; width: 100%; }
  .work-body { grid-template-columns: minmax(0,1fr); }
  .work-nav { grid-template-columns: minmax(0,1fr); }
  .work-nav .mid, .work-nav .right { text-align: left; }
  .widget { width: 56px; }
  .meta-list div { grid-template-columns: 76px minmax(0,1fr); }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
  [data-reveal] { opacity: 1; transform: none; }
}
