:root {
  --bg: #fafaf9;
  --surface: #ffffff;
  --ink: #0c0a09;
  --soft: #57534e;
  --line: #d6d3d1;
  --gold: #a16207;
  --studio: #f5f5f4;
  --danger: #b91c1c;
  --danger-bg: #fef2f2;
  --serif: "Noto Serif TC", "Songti TC", serif;
  --sans: "Noto Sans TC", "PingFang TC", sans-serif;
  --mono: "Azeret Mono", ui-monospace, monospace;
  --z-header: 20;
  --z-drawer: 40;
  --z-skip: 50;
  color-scheme: light;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1rem;
  line-height: 1.65;
  text-rendering: optimizeLegibility;
  touch-action: manipulation;
}
body, .drawer-panel { scrollbar-color: var(--line) var(--bg); }
::selection { background: #f5e6c8; color: var(--ink); }
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-underline-offset: 0.18em; cursor: pointer; }
h1, h2, .price, .foot-name, .work-name, .work-price {
  font-family: var(--serif);
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.12;
}
h1 { font-size: clamp(2.75rem, 5.6vw, 5.25rem); margin: 0; text-wrap: balance; }
h2 { font-size: clamp(1.75rem, 2.6vw, 2.5rem); margin: 0 0 0.75rem; text-wrap: balance; }
p { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
button, .btn, .btn-line, .btn-paper { cursor: pointer; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }

.skip {
  position: absolute; left: 1rem; top: -4rem; background: var(--ink); color: var(--surface);
  padding: 0.6rem 0.8rem; z-index: var(--z-skip);
}
.skip:focus { top: 0.6rem; }

.wrap { width: min(1200px, calc(100% - 2rem)); margin-inline: auto; }
.top {
  position: sticky; top: 0; z-index: var(--z-header);
  display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 1.5rem;
  width: 100%; min-height: 4.5rem; padding: 0 clamp(1rem, 3vw, 2rem);
  background: var(--bg);
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  border-bottom: 1px solid var(--line);
}
.brand {
  font-family: var(--serif); font-size: clamp(1.55rem, 2vw, 1.9rem); font-weight: 600;
  text-decoration: none; letter-spacing: -0.04em; margin-right: auto;
}
.nav { display: flex; flex-wrap: wrap; }
.nav a {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 0.85rem;
  text-decoration: none; color: var(--soft);
  transition: color 180ms ease-out;
}
.nav a:hover { color: var(--ink); }
.nav a[aria-current="page"] { color: var(--ink); box-shadow: inset 0 -2px 0 var(--gold); }
.cart-link span {
  margin-left: 0.4rem; background: var(--ink); color: var(--surface);
  min-width: 1.35rem; height: 1.35rem; display: inline-grid; place-items: center;
  font-family: var(--mono); font-size: 0.75rem;
}

.hero {
  display: grid; grid-template-columns: 1.15fr 0.85fr;
  height: calc(100dvh - 4.5rem); min-height: 560px;
  background: var(--bg);
}
.hero-plate, .hero-copy { min-height: 0; }
.hero-plate {
  background: var(--studio); height: 100%; overflow: hidden;
  border-right: 1px solid var(--line);
}
.hero-plate img {
  width: 100%; height: 100%; object-fit: contain;
  animation: settle 280ms ease-out;
}
.hero-copy {
  display: flex; flex-direction: column; justify-content: center;
  gap: 1rem; padding: clamp(1.5rem, 4vw, 4rem);
}
.lede { font-size: 1.125rem; max-width: 28em; line-height: 1.7; }
.quiet { color: var(--soft); max-width: 36em; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 0.5rem; }
.price { font-size: clamp(1.6rem, 2.2vw, 2.15rem); color: var(--gold); font-variant-numeric: tabular-nums; }

.btn, .btn-line, .btn-paper {
  display: inline-flex; align-items: center; justify-content: center; min-height: 48px;
  padding: 0.7rem 1.25rem; text-decoration: none; border: 1px solid transparent;
  background: var(--ink); color: var(--surface);
  transition: background-color 180ms ease-out, color 180ms ease-out, border-color 180ms ease-out;
}
.btn:hover { background: #292524; }
.btn:active { background: #44403c; }
.btn-line { background: transparent; color: var(--ink); border-color: var(--ink); }
.btn-line:hover { background: var(--ink); color: var(--surface); }
.btn-line:active { background: #292524; }
.btn-paper { background: var(--surface); color: var(--ink); }
.btn-paper:hover { background: var(--studio); }
button:disabled { opacity: 0.45; cursor: not-allowed; }

.cats {
  display: flex; flex-wrap: wrap; gap: 0.25rem 1.25rem;
  padding: 1.5rem 0 0.75rem; border-bottom: 1px solid var(--line);
}
.cats a {
  text-decoration: none; font-family: var(--serif);
  font-size: clamp(1.1rem, 1.5vw, 1.4rem); min-height: 44px;
  display: inline-flex; align-items: center; color: var(--soft);
  transition: color 180ms ease-out;
}
.cats a:hover { color: var(--ink); }
.cats a[aria-current="true"] { color: var(--ink); box-shadow: inset 0 -2px 0 var(--gold); }

.works { padding: 0.5rem 0 4rem; }
.toolbar {
  display: flex; flex-wrap: wrap; gap: 1rem 1.5rem; align-items: end;
  justify-content: space-between; margin: 1.5rem 0 1.25rem;
}
.filters { display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: end; }
.filters label, .form label, .buy-form label { display: grid; gap: 0.35rem; color: var(--soft); font-size: 0.95rem; }
input, select, textarea {
  background: var(--surface); border: 1px solid var(--line);
  padding: 0.65rem 0.75rem; min-height: 48px; width: 100%;
  caret-color: var(--ink); border-radius: 0;
}
input:focus, select:focus, textarea:focus { border-color: var(--ink); outline: none; }
input::placeholder, textarea::placeholder { color: var(--soft); opacity: 1; }
textarea { min-height: 7rem; resize: vertical; }
.filters input, .filters select { width: min(100%, 14rem); }
.count { color: var(--soft); font-family: var(--mono); font-size: 0.85rem; }

.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2rem 1rem; }
.work {
  display: grid; gap: 0.35rem; text-decoration: none; align-content: start; color: inherit;
  cursor: pointer;
}
.work-plate {
  background: var(--studio); aspect-ratio: 4 / 5; display: block; overflow: hidden;
  border: 1px solid var(--line);
}
.work-plate img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform 200ms ease-out;
}
.work:hover img { transform: scale(1.03); }
.work:hover .work-name { color: var(--gold); }
.work-top {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.25rem 0.75rem;
  align-items: baseline; margin-top: 0.65rem;
}
.work-name { font-size: clamp(1.15rem, 1.4vw, 1.4rem); transition: color 180ms ease-out; }
.work-price { color: var(--gold); font-size: 1.05rem; margin-left: auto; white-space: nowrap; font-variant-numeric: tabular-nums; }
.work-sum, .work-meta, .work-tags { color: var(--soft); }
.work-tags { font-size: 0.92rem; }

.band { background: var(--ink); color: var(--surface); padding: 4rem 0; }
.band p { color: #e7e5e4; }
.band-inner { display: grid; gap: 1.5rem; align-items: end; }
.band h2 { max-width: 8em; font-size: clamp(2.2rem, 4.5vw, 3.75rem); color: var(--surface); }
.band p { max-width: 38em; }
.studio { display: grid; gap: 1.5rem; padding: 4rem 0; }
.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 1rem; }
.steps li { display: grid; gap: 0.35rem; padding-top: 0.85rem; border-top: 1px solid var(--line); }
.steps strong { font-family: var(--serif); font-size: 1.3rem; font-weight: 600; }
.steps span { color: var(--soft); }
.prose { white-space: pre-line; max-width: 68ch; }

.foot { border-top: 1px solid var(--line); padding: 2.5rem 0 1.5rem; }
.foot-grid { display: grid; gap: 1.5rem; }
.foot p { color: var(--soft); max-width: 42em; }
.foot-name { color: var(--ink); font-size: 1.7rem; margin-bottom: 0.4rem; }
.foot a { color: var(--ink); }
.copy { margin-top: 1.5rem; font-family: var(--mono); font-size: 0.82rem; color: var(--soft); }
.foot-end { margin-top: 0.75rem; }

.product {
  display: grid; gap: 1.5rem; padding: 1.25rem 0 4rem;
  width: min(1200px, calc(100% - 2rem));
}
.stage { background: var(--studio); min-height: 420px; display: grid; align-content: start; border: 1px solid var(--line); }
.cover, #viewer { width: 100%; height: min(72vh, 820px); object-fit: contain; background: var(--studio); }
#viewer { display: block; touch-action: none; cursor: grab; }
#viewer:active { cursor: grabbing; }
.seg { display: flex; gap: 0.25rem; padding: 0.75rem 1rem 0; background: var(--bg); }
.seg button {
  min-height: 44px; padding: 0 0.15rem; margin-right: 1rem;
  border: 0; background: transparent; color: var(--soft);
  box-shadow: inset 0 -2px 0 transparent;
  transition: color 180ms ease-out;
}
.seg button[aria-selected="true"] { color: var(--ink); box-shadow: inset 0 -2px 0 var(--gold); }
.viewer-tools { display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: center; padding: 0.75rem 1rem; background: var(--bg); }
.model-meta, .sku { font-family: var(--mono); font-size: 0.88rem; color: var(--soft); }
.buy { display: grid; gap: 1rem; align-content: start; padding-top: 0.25rem; }
.buy h1 { font-size: clamp(2.4rem, 4.5vw, 4.25rem); }
.specs { display: grid; gap: 0.5rem; margin: 0.25rem 0 0; }
.specs div, .totals div, .summary dl div { display: grid; grid-template-columns: 6.25rem 1fr; gap: 0.75rem; align-items: baseline; }
.specs dt, .totals dt, .summary dt { color: var(--soft); }
.specs dd, .totals dd, .summary dd { margin: 0; }
.spec-price { padding-bottom: 0.75rem; margin-bottom: 0.25rem; border-bottom: 1px solid var(--line); }
.spec-price .price { font-size: clamp(1.85rem, 2.6vw, 2.4rem); }
.buy-form, .form { display: grid; gap: 1rem; max-width: 36rem; }
.picks { display: grid; gap: 0.75rem; }
.picks p { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.picks button {
  min-height: 44px; padding: 0 0.9rem; border: 1px solid var(--line); background: var(--surface); color: var(--ink);
  transition: background-color 180ms ease-out, border-color 180ms ease-out, color 180ms ease-out;
}
.picks button[aria-pressed="true"] { border-color: var(--ink); background: var(--ink); color: var(--surface); }
.notice { background: var(--studio); color: var(--ink); padding: 1rem; max-width: 68ch; border: 1px solid var(--line); }
.notice-bad { background: var(--danger-bg); color: var(--danger); border-color: transparent; }
.field-error { color: var(--danger); min-height: 1.2em; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

.checkout, .order, .custom, .admin { padding: 2rem 0 4rem; display: grid; gap: 1rem; align-content: start; }
.checkout h1, .order h1, .custom h1, .admin h1 { font-size: clamp(2.4rem, 4.5vw, 4rem); }
.checkout-grid { display: grid; gap: 2rem; }
.summary, .summary-list { background: var(--surface); padding: 1.25rem; border: 1px solid var(--line); }
.summary ul, .summary-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.85rem; }
.summary li, .summary-list li { display: flex; justify-content: space-between; gap: 1rem; }
.summary small, .summary-list small { display: block; color: var(--soft); }
.limits { margin: 0; padding-left: 1.15rem; color: var(--soft); display: grid; gap: 0.35rem; }
.check { grid-template-columns: auto 1fr; align-items: center; }
.check input { width: 1.25rem; min-height: 1.25rem; }
fieldset { border: 1px solid var(--line); display: grid; gap: 0.75rem; padding: 1rem; }
legend { padding: 0 0.35rem; }

.admin-nav { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.admin-nav a {
  min-height: 44px; display: inline-flex; align-items: center; padding: 0 0.85rem;
  text-decoration: none; border: 1px solid var(--line); color: var(--soft); background: var(--surface);
}
.admin-nav a[aria-current="page"] { background: var(--ink); color: var(--surface); border-color: var(--ink); }
.token-gate { display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: end; max-width: 36rem; }
.token-gate label { flex: 1 1 16rem; }
.job, .request {
  display: grid; gap: 0.35rem 1rem; padding: 1rem 0; border-bottom: 1px solid var(--line);
}
.job-main { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.5rem 1rem; }
.job form, .status-form { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; }
.job select, .job input { width: auto; min-width: 8rem; }
.events { color: var(--soft); font-size: 0.95rem; margin: 0.25rem 0 0; padding-left: 1rem; }
.empty a { color: var(--gold); }

.drawer { position: fixed; inset: 0; z-index: var(--z-drawer); }
.drawer-backdrop { position: absolute; inset: 0; background: rgba(12, 10, 9, 0.46); border: 0; cursor: pointer; }
.drawer-panel {
  position: absolute; top: 0; right: 0; height: 100%; width: min(420px, 100%);
  background: var(--bg); padding: 1rem 1.15rem; display: flex; flex-direction: column; gap: 1rem;
  border-left: 1px solid var(--line);
}
.drawer-head { display: flex; justify-content: space-between; align-items: center; }
.drawer-head h2 { margin: 0; font-size: 1.75rem; }
.drawer-head button, .icon-btn { width: 44px; height: 44px; border: 0; background: transparent; color: var(--ink); }
.drawer-head svg, .icon-btn svg { width: 22px; height: 22px; }
.cart-line { display: grid; grid-template-columns: 1fr auto; gap: 0.35rem 0.75rem; padding: 0.85rem 0; border-bottom: 1px solid var(--line); }
.qty-row { display: flex; gap: 0.35rem; align-items: center; }
.qty-row button, .qty-row span {
  min-height: 44px; min-width: 44px; display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--line); background: var(--surface); padding: 0 0.7rem;
}
.qty-row .step { width: 44px; padding: 0; }
.drawer-foot { margin-top: auto; display: grid; gap: 0.5rem; }
.drawer-foot .btn { width: 100%; }

@media (min-width: 800px) {
  .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 2.5rem 1.25rem; }
  .band-inner, .studio, .foot-grid, .checkout-grid { grid-template-columns: 1.15fr 0.85fr; }
  .product { grid-template-columns: 1.15fr 0.85fr; gap: 2.5rem; align-items: start; }
  .stage { position: sticky; top: 5.25rem; }
  .steps { grid-column: 1 / -1; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 1rem; }
}
@media (min-width: 1280px) {
  .grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (max-width: 799px) {
  .hero { grid-template-columns: 1fr; height: auto; min-height: 0; }
  .hero-plate { height: min(64vw, 42dvh); border-right: 0; border-bottom: 1px solid var(--line); }
  .hero-copy { padding: 1.5rem 1.15rem 2rem; }
  h1 { font-size: clamp(2.4rem, 11vw, 3.25rem); }
  .stage { position: static; }
  .wrap, .product { width: min(1200px, calc(100% - 1.5rem)); }
}

@keyframes settle {
  from { opacity: 0.6; }
  to { opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  html { scroll-behavior: auto; }
}
