/* Vice Shifu: a hanging scroll, mounted in Vice City silk. */
:root {
  --wall: #16383c;
  --wall-2: #10292c;
  --silk: #2a7479;
  --silk-pink: #f2a0b8;
  --paper: #e9e1cc;
  --paper-2: #ddd3ba;
  --ink: #1e1b18;
  --ink-2: #4b453e;
  --ink-3: #7a7266;
  --seal: #b5312a;
  --dusk: #d9507a;
  --sea: #1d8288;
  --wood: #5a3a24;

  --cn: "Ma Shan Zheng", "STKaiti", "KaiTi", serif;
  --body: "Spectral", Georgia, serif;
  --ease: cubic-bezier(.2, .8, .2, 1);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--wall);
  color: var(--ink);
  font: 400 18px/1.62 var(--body);
  padding: 28px 0 40px;
  overflow-x: hidden;
}
img { display: block; max-width: 100%; height: auto; }
button { font: inherit; color: inherit; cursor: pointer; }
:focus-visible { outline: 2px solid var(--dusk); outline-offset: 3px; }
[hidden] { display: none !important; }

/* ---------- the scroll ---------- */
.rod {
  width: min(1220px, calc(100% - 8px));
  height: 22px;
  margin: 0 auto;
  border-radius: 11px;
  background:
    linear-gradient(180deg, rgba(255,255,255,.18), rgba(0,0,0,.25) 70%),
    var(--wood);
  position: relative;
  z-index: 2;
  box-shadow: 0 6px 14px rgba(0,0,0,.35);
}
.rod::before, .rod::after { /* the knobs */
  content: "";
  position: absolute; top: -4px;
  width: 26px; height: 30px; border-radius: 8px;
  background: linear-gradient(180deg, #d9b878, #8a6a33);
}
.rod::before { left: -14px; }
.rod::after { right: -14px; }
.rod-top { margin-bottom: -6px; }
.rod-bottom { margin-top: -6px; height: 26px; }

.mount {
  width: min(1180px, 100%);
  margin: 0 auto;
  padding: 46px 34px 40px;
  background-color: var(--silk);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='64' height='64' viewBox='0 0 64 64'%3E%3Cg fill='none' stroke='%23f2a0b8' stroke-width='1.3' stroke-linecap='round' opacity='.38'%3E%3Cpath d='M8 22c0-5 6-7 9-3 1-6 10-6 11 0 4-2 8 1 6 5H10c-1 0-2-1-2-2z'/%3E%3Cpath d='M20 19c2-2 5-1 5 1'/%3E%3Cpath d='M46 40v16M46 40c-4-3-9-2-11 1M46 40c4-3 9-2 11 1M46 40c-2-4-6-6-9-5M46 40c2-4 6-6 9-5'/%3E%3C/g%3E%3C/svg%3E");
  box-shadow: 0 30px 60px rgba(0,0,0,.35), inset 0 0 0 1px rgba(255,255,255,.08);
  position: relative;
}


.paper {
  position: relative;
  background-color: var(--paper);
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='f'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .35 0 0 0 0 .3 0 0 0 0 .22 0 0 0 .22 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23f)'/%3E%3C/svg%3E"),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cg fill='none' stroke='%23a89878' stroke-width='.6' opacity='.35'%3E%3Cpath d='M10 40c40 6 70-10 120 4'/%3E%3Cpath d='M160 120c30-8 60 6 120-2'/%3E%3Cpath d='M30 230c24 10 50 0 90 12'/%3E%3Cpath d='M200 260c20-6 40 2 70-4'/%3E%3C/g%3E%3C/svg%3E");
  padding: 0 clamp(18px, 5vw, 64px);
  box-shadow: 0 0 0 1px rgba(0,0,0,.12), 0 0 30px rgba(80,60,30,.25) inset;
}

/* one orchestrated moment: the scroll unrolls over the first screen */
@media (prefers-reduced-motion: no-preference) {
  .js .paper { clip-path: inset(0 0 100% 0); }
  .js.unrolling .paper { animation: unroll 1.25s var(--ease) .1s both; }
  .js.unrolled .paper { clip-path: none; animation: none; }
}
@keyframes unroll {
  from { clip-path: inset(0 0 100% 0); }
  to { clip-path: inset(0 0 calc(100% - 110vh) 0); }
}

h1, h2, h3 { margin: 0; font-weight: 400; }
h2 {
  font-family: var(--body);
  font-weight: 600;
  font-size: clamp(30px, 4.4vw, 46px);
  line-height: 1.1;
  letter-spacing: -.01em;
}
.sub { color: var(--ink-2); max-width: 58ch; margin: 12px 0 0; }

section { padding: clamp(48px, 7vw, 84px) 0; border-top: 1px solid rgba(30,27,24,.14); }
section:first-child { border-top: 0; }

/* ---------- hero ---------- */
.hero {
  display: grid;
  grid-template-columns: auto minmax(0, .85fr) minmax(0, 1.7fr);
  gap: clamp(16px, 3vw, 40px);
  align-items: start;
  padding-top: clamp(40px, 6vw, 70px);
}
.vert {
  writing-mode: vertical-rl;
  font-family: var(--cn);
  font-size: clamp(38px, 5vw, 60px);
  line-height: 1;
  margin: 0;
  color: var(--ink);
  letter-spacing: .08em;
}
h1 { display: grid; gap: 4px; }
.t-cn { font-family: var(--cn); font-size: clamp(76px, 10vw, 128px); line-height: .95; color: var(--ink); }
.t-en { font-family: var(--body); font-style: italic; font-size: clamp(28px, 3.4vw, 40px); line-height: 1.1; color: var(--ink-2); }
.lead { margin: 22px 0 0; max-width: 32ch; }

.ca {
  margin-top: 28px;
  display: flex; align-items: center; gap: 10px;
  padding: 10px 10px 10px 14px;
  border: 1.5px solid var(--ink);
  border-radius: 3px 5px 3px 6px;
  max-width: 100%;
}
.ca-label { font-size: 14px; color: var(--ink-3); }
.ca code { font: 600 15px/1.3 var(--body); overflow-wrap: anywhere; flex: 1; min-width: 0; }
.ca button {
  border: 0; background: var(--ink); color: var(--paper);
  padding: 6px 12px; border-radius: 2px;
}
.ca button:disabled { opacity: .35; cursor: default; }

.actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 44px; padding: 8px 16px;
  border: 1.5px solid var(--ink);
  border-radius: 4px 2px 5px 3px;
  background: transparent; color: var(--ink);
  text-decoration: none; font-size: 16px;
  transition: transform .16s var(--ease), background-color .16s var(--ease);
}
.btn:active { transform: scale(.97); }
.btn-seal { background: var(--seal); border-color: var(--seal); color: #f6ecd9; }
.btn[aria-disabled="true"] { opacity: .4; pointer-events: none; }
@media (hover: hover) {
  .btn:hover { background: rgba(30,27,24,.07); }
  .btn-seal:hover { background: #a22a24; }
}

.painting { margin: 0; position: relative; }
.frame {
  position: relative;
  background: var(--paper-2);
  padding: 10px;
  box-shadow: 0 1px 0 rgba(255,255,255,.4), 0 10px 24px rgba(60,40,20,.22);
  transform: rotate(.4deg);
}
.frame img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; filter: saturate(.92) contrast(1.02); }
.missing-note { display: none; }
.frame.missing { aspect-ratio: 4 / 3; display: grid; place-items: center; background: repeating-linear-gradient(135deg, var(--paper-2) 0 12px, #d3c8ac 12px 13px); }
.frame.missing img { display: none; }
.frame.missing .missing-note { display: block; color: var(--ink-3); font-style: italic; text-align: center; padding: 20px; }
figcaption { margin-top: 12px; font-style: italic; color: var(--ink-3); font-size: 15px; }

.collector-seals { position: absolute; inset: 0; pointer-events: none; }
.cseal {
  position: absolute;
  width: 46px; height: 46px;
  opacity: 0; transform: scale(1.25) rotate(var(--r, 0deg));
  transition: opacity .18s ease-out, transform .18s var(--ease);
}
.cseal.on { opacity: .92; transform: scale(1) rotate(var(--r, 0deg)); }

/* ---------- lesson ---------- */
.chars { display: flex; flex-wrap: wrap; gap: clamp(6px, 1.4vw, 18px); margin-top: 30px; }
.char {
  font-family: var(--cn);
  font-size: clamp(64px, 11vw, 128px);
  line-height: 1;
  width: 1.1em; height: 1.1em;
  display: grid; place-items: center;
  border: 0; background: transparent; color: var(--ink);
  border-bottom: 2px solid transparent;
  padding: 0;
  transition: color .16s var(--ease), transform .16s var(--ease);
}
.char:active { transform: scale(.96); }
.char[aria-pressed="true"] { color: var(--seal); border-bottom-color: var(--seal); }
@media (hover: hover) { .char:hover { color: var(--seal); } }
.reading { min-height: 3.4em; margin: 18px 0 0; max-width: 58ch; }
.r-py { font-style: italic; color: var(--seal); margin-right: 10px; font-size: 22px; }
.r-py:empty { display: none; }

.also { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; margin-top: 40px; }
.also-item p { margin: 6px 0 0; color: var(--ink-2); font-size: 16px; }
.mini {
  font-family: var(--cn); font-size: 40px; line-height: 1.1;
  border: 0; background: none; padding: 0; color: var(--ink);
  text-align: left;
}
.mini[data-shown]::after {
  content: attr(data-shown);
  display: block; font: italic 15px/1.3 var(--body); color: var(--seal); margin-top: 4px;
}
.story { margin: 40px 0 0; max-width: 60ch; font-size: 19px; }

/* ---------- studio ---------- */
.studio-head { display: grid; grid-template-columns: minmax(0, 1fr) 270px; gap: clamp(20px, 4vw, 48px); align-items: end; }
.studio-photo { margin: 0; background: var(--paper-2); padding: 8px; box-shadow: 0 10px 24px rgba(60,40,20,.22); transform: rotate(-1.2deg); }
.studio-photo img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; }
.desk {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 290px;
  gap: 28px;
  margin-top: 30px;
  align-items: start;
}
.sheet-wrap {
  position: relative;
  aspect-ratio: 3 / 4;
  width: min(100%, calc(80vh * 3 / 4));
  justify-self: center;
  background: #efe8d6;
  box-shadow: 0 0 0 1px rgba(0,0,0,.14), 0 14px 30px rgba(60,40,20,.2);
  touch-action: none;
}
.sheet-wrap::before { /* felt under the paper edge, and the paper grain */
  content: ""; position: absolute; inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='f'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.75' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .4 0 0 0 0 .35 0 0 0 0 .25 0 0 0 .16 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23f)'/%3E%3C/svg%3E");
  pointer-events: none;
}
.sheet, .guide { position: absolute; inset: 0; width: 100%; height: 100%; }
.guide { pointer-events: none; }
.sheet { cursor: crosshair; z-index: 1; }
.sheet.sealing { cursor: copy; }
.seal-hint {
  position: absolute; left: 50%; bottom: 14px; transform: translateX(-50%);
  margin: 0; padding: 6px 12px; background: var(--ink); color: var(--paper);
  font-size: 14px; border-radius: 2px; z-index: 2; white-space: nowrap;
}

.tools { display: grid; gap: 18px; }
fieldset { border: 0; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
legend { font-weight: 600; font-size: 15px; margin-bottom: 8px; padding: 0; }
.swatch, .pill { position: relative; display: inline-flex; align-items: center; gap: 8px; font-size: 15px; cursor: pointer; }
.swatch { width: 100%; padding: 4px 0; }
.swatch input, .pill input { position: absolute; opacity: 0; pointer-events: none; }
.sw { width: 26px; height: 26px; border-radius: 50% 46% 52% 48%; box-shadow: inset 0 0 0 2px rgba(0,0,0,.15); }
.sw-ink { background: var(--ink); }
.sw-dusk { background: var(--dusk); }
.sw-sea { background: var(--sea); }
.swatch input:checked + .sw { box-shadow: 0 0 0 2px var(--paper), 0 0 0 4px var(--ink); }
.swatch input:focus-visible + .sw, .pill input:focus-visible + span { outline: 2px solid var(--dusk); outline-offset: 3px; }
.pill span { display: inline-block; padding: 6px 12px; border: 1.5px solid var(--ink); border-radius: 3px 5px 2px 4px; }
.pill input:checked + span { background: var(--ink); color: var(--paper); }
select {
  width: 100%; font: inherit; font-size: 16px; padding: 8px 10px; min-height: 44px;
  background: transparent; color: var(--ink); border: 1.5px solid var(--ink); border-radius: 3px;
}
.seals { display: flex; gap: 10px; }
.seal-btn {
  width: 58px; height: 58px; padding: 4px; border: 1.5px solid transparent; background: transparent;
  border-radius: 3px;
  transition: transform .16s var(--ease);
}
.seal-btn img, .seal-btn canvas { width: 100%; height: 100%; }
.seal-btn[aria-pressed="true"] { border-color: var(--ink); }
.seal-btn:active { transform: scale(.94); }
.row { display: flex; gap: 8px; flex-wrap: wrap; }
.row .btn { flex: 1; }
.tool-note { margin: 0; font-size: 14px; color: var(--ink-3); line-height: 1.45; }

/* ---------- collectors ---------- */
.col-list {
  list-style: none; padding: 0; margin: 30px 0 0;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 22px 18px;
}
.col-list li { display: grid; grid-template-columns: 52px minmax(0, 1fr); gap: 12px; align-items: center; }
.col-list canvas { width: 52px; height: 52px; opacity: .22; filter: grayscale(1); transition: opacity .18s ease-out, filter .18s ease-out; }
.col-list li.on canvas { opacity: 1; filter: none; }
.col-list b { display: block; font-weight: 600; font-size: 17px; }
.col-list span { display: block; font-size: 14px; color: var(--ink-2); line-height: 1.35; }
.sim { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; margin-top: 34px; }
.sim label { font-weight: 600; font-size: 16px; }
.sim input { flex: 1 1 220px; accent-color: var(--seal); }
.sim output { font-weight: 600; min-width: 5.5em; }
.badge { font-size: 14px; padding: 3px 10px; border: 1.5px solid var(--ink-3); color: var(--ink-2); border-radius: 2px; }
.badge.live { border-color: var(--seal); color: var(--seal); }

/* ---------- buy ---------- */
.steps { list-style: none; padding: 0; margin: 30px 0 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 28px; counter-reset: s; }
.steps li { counter-increment: s; }
.steps li::before {
  content: counter(s);
  display: block; font-family: var(--cn); font-size: 54px; line-height: 1; color: var(--seal); margin-bottom: 8px;
}
.steps h3 { font-weight: 600; font-size: 20px; }
.steps p { margin: 6px 0 0; color: var(--ink-2); font-size: 16px; }

.foot { padding: 34px 0 44px; border-top: 1px solid rgba(30,27,24,.14); font-size: 14px; color: var(--ink-3); }
.foot p { margin: 0 0 8px; max-width: 70ch; }

/* ---------- phone ---------- */
@media (max-width: 860px) {
  .hero { grid-template-columns: auto minmax(0, 1fr); }
  .painting { grid-column: 1 / -1; }
  .desk { grid-template-columns: minmax(0, 1fr); }
  .studio-head { grid-template-columns: minmax(0, 1fr) 200px; }
  .tools { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .tools .row, .tools .tool-note { grid-column: 1 / -1; }
}
@media (max-width: 560px) {
  body { font-size: 17px; padding-top: 16px; }
  .rod { width: calc(100% - 28px); }
  .mount { padding: 22px 10px 20px; }
  .vert { font-size: 34px; }
  .also { grid-template-columns: minmax(0, 1fr); gap: 18px; }
  .chars { gap: 4px; }
  .char { font-size: 50px; }
  .steps { grid-template-columns: minmax(0, 1fr); }
  .tools { grid-template-columns: minmax(0, 1fr); }
  .studio-head { grid-template-columns: minmax(0, 1fr); }
  .studio-photo { width: 72%; justify-self: center; order: -1; }
  .swatch { width: auto; padding-right: 10px; }
  .sheet-wrap { aspect-ratio: 4 / 5; }
}
