:root {
  --paper: #f1e8d4;
  --paper-2: #e7dbc1;
  --paper-3: #dccdae;
  --ink: #14110e;
  --ink-2: #3a332b;
  --ink-3: #6e6354;
  --red: #b3261e;
  --red-2: #8e1b15;
  --gold: #8a6a32;
  --line: rgba(20, 17, 14, .18);
  --serif: "Cormorant Garamond", "Noto Serif SC", Georgia, serif;
  --brush: "Ma Shan Zheng", "Noto Serif SC", serif;
  --cjk: "Noto Serif SC", serif;
  --mono: "IBM Plex Mono", ui-monospace, monospace;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 19px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
.grain { position: fixed; inset: 0; pointer-events: none; z-index: 0; background: #000; filter: url(#paper); }
main, header, footer { position: relative; z-index: 1; }
a { color: inherit; }
code { font-family: var(--mono); font-size: .78em; background: rgba(20,17,14,.06); padding: .08em .35em; border-radius: 3px; }
::selection { background: var(--red); color: var(--paper); }

/* ── header ── */
.top {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
  padding: 14px clamp(18px, 4vw, 56px);
  background: rgba(241, 232, 212, .88);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; }
.brand-name { font-weight: 700; letter-spacing: .32em; font-size: 20px; }
.seal-mark {
  display: inline-grid; place-items: center;
  width: 42px; height: 42px; padding: 3px;
  background: var(--red); color: var(--paper);
  font-family: var(--cjk); font-size: 15px; line-height: 1; writing-mode: vertical-rl;
  border-radius: 4px; box-shadow: inset 0 0 0 2px var(--red), inset 0 0 0 3px rgba(241,232,212,.55);
  filter: url(#brush);
}
.seal-mark.sm { width: 22px; height: 22px; font-size: 13px; writing-mode: horizontal-tb; vertical-align: -5px; box-shadow: none; }
.nav { display: flex; gap: 26px; }
.nav a { text-decoration: none; font-weight: 600; font-size: 17px; color: var(--ink-2); }
.nav a:hover { color: var(--red); }
.top-right { display: flex; align-items: center; gap: 16px; }
.ticker { font-family: var(--mono); font-size: 12px; color: var(--ink-3); }
.ticker b { color: var(--red); font-weight: 500; }

/* ── buttons ── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .4em;
  font-family: var(--serif); font-weight: 700; font-size: 17px; letter-spacing: .03em;
  padding: 11px 22px; border-radius: 2px; cursor: pointer; text-decoration: none;
  border: 1.5px solid var(--ink); transition: transform .15s, background .15s, color .15s;
}
.btn:active { transform: translateY(1px); }
.btn-red { background: var(--red); color: var(--paper); border-color: var(--red); }
.btn-red:hover { background: var(--red-2); border-color: var(--red-2); }
.btn-ink { background: var(--ink); color: var(--paper); }
.btn-ink:hover { background: var(--ink-2); }
.btn-ghost { background: transparent; color: var(--ink); }
.btn-ghost:hover { background: var(--ink); color: var(--paper); }
.btn.sm { padding: 4px 12px; font-size: 14px; }
.btn[aria-disabled="true"] { opacity: .55; cursor: not-allowed; }

/* ── hero ── */
.hero {
  display: grid; grid-template-columns: 1.25fr .75fr; gap: clamp(30px, 6vw, 90px); align-items: center;
  padding: clamp(50px, 8vw, 110px) clamp(18px, 6vw, 96px) 60px;
  max-width: 1320px; margin: 0 auto;
}
.eyebrow { font-family: var(--mono); font-size: 12px; letter-spacing: .18em; text-transform: uppercase; color: var(--red); margin: 0 0 14px; }
h1 { font-size: clamp(44px, 6.4vw, 86px); line-height: .98; margin: 0 0 26px; font-weight: 700; letter-spacing: -.01em; }
h1 em { font-style: italic; font-weight: 500; color: var(--red); }
h2 { font-size: clamp(30px, 3.6vw, 46px); line-height: 1.08; margin: 0 0 10px; font-weight: 700; }
h3 { font-size: 27px; margin: 6px 0 8px; }
h4 { font-size: 23px; margin: 8px 0 4px; }
.lede { font-size: 21px; max-width: 34em; color: var(--ink-2); margin: 0 0 12px; }
.fine { font-family: var(--mono); font-size: 12px; color: var(--ink-3); margin: 0 0 30px; }
.cta-row { display: flex; flex-wrap: wrap; gap: 12px; }
.cta-row.center { justify-content: center; }

/* scroll */
.scroll-wrap { margin: 0; display: flex; flex-direction: column; align-items: center; }
.scroll { width: min(320px, 80vw); cursor: pointer; animation: unroll 1.4s cubic-bezier(.2,.7,.2,1) both; transform-origin: top; }
@keyframes unroll { from { clip-path: inset(0 0 92% 0); } to { clip-path: inset(0 0 0 0); } }
.rod { height: 16px; border-radius: 8px; background: linear-gradient(#3b2a1a, #1d140c 60%, #3b2a1a); margin: 0 -14px; position: relative; z-index: 2; }
.paper {
  position: relative; height: 460px; margin: 0 4px; overflow: hidden;
  background: linear-gradient(180deg, #f6eedb, #efe3c6);
  box-shadow: inset 0 0 0 10px #d9c7a1, inset 0 0 0 11px rgba(20,17,14,.25), 0 30px 50px -30px rgba(20,17,14,.6);
}
.mountains { position: absolute; left: 0; right: 0; bottom: 0; width: 100%; height: 170px; }
.vertical {
  position: absolute; top: 44px; right: 72px; writing-mode: vertical-rl;
  font-family: var(--brush); font-size: 58px; line-height: 1.05; color: var(--ink); letter-spacing: .06em;
  filter: url(#brush);
}
.vertical.small { right: auto; left: 64px; top: 60px; font-size: 30px; color: var(--ink-2); }
.stamp {
  position: absolute; left: 50px; bottom: 112px; width: 76px; height: 76px;
  display: grid; place-items: center; text-align: center;
  font-family: var(--cjk); font-size: 20px; line-height: 1.05; color: var(--paper);
  background: var(--red); border-radius: 4px; transform: rotate(-6deg) scale(0); opacity: 0;
  box-shadow: inset 0 0 0 3px var(--red), inset 0 0 0 5px rgba(246,238,219,.6);
  filter: url(#brush); mix-blend-mode: multiply;
}
.stamp.on { animation: stamp .45s cubic-bezier(.3,1.6,.5,1) forwards; }
@keyframes stamp { 0% { transform: rotate(-6deg) scale(2.2); opacity: 0; } 100% { transform: rotate(-6deg) scale(1); opacity: .92; } }
.scroll-wrap figcaption { margin-top: 16px; text-align: center; font-style: italic; color: var(--ink-2); font-size: 17px; }
.scroll-wrap figcaption span { font-style: normal; font-family: var(--cjk); font-size: 14px; color: var(--ink-3); }
.scroll-wrap figcaption i { font-family: var(--mono); font-style: normal; font-size: 11px; color: var(--ink-3); letter-spacing: .1em; }

/* ── blocks ── */
.block { max-width: 1320px; margin: 0 auto; padding: 80px clamp(18px, 6vw, 96px); border-top: 1px solid var(--line); }
.block-head { margin-bottom: 36px; max-width: 46em; }
.sub { color: var(--ink-3); margin: 0; font-size: 17px; }
.block.two { display: grid; grid-template-columns: 1fr 1fr; gap: 56px; }

.stats { display: grid; grid-template-columns: repeat(4, 1fr); border: 1.5px solid var(--ink); margin-bottom: 30px; background: rgba(246,238,219,.5); }
.stat { padding: 22px 24px; display: flex; flex-direction: column; gap: 4px; border-right: 1px solid var(--line); }
.stat:last-child { border-right: 0; }
.stat .k { font-family: var(--mono); font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-3); }
.stat .v { font-size: 46px; font-weight: 700; line-height: 1.05; }
.stat .s { font-family: var(--mono); font-size: 12px; color: var(--ink-3); }

.rooms { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.room { border: 1px solid var(--line); background: rgba(246,238,219,.6); padding: 24px 24px 20px; display: flex; flex-direction: column; position: relative; }
.room::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--red); }
.room p { color: var(--ink-2); font-size: 17px; margin: 0 0 14px; }
.room-top { display: flex; justify-content: space-between; align-items: center; }
.pid { font-family: var(--cjk); font-size: 26px; color: var(--red); }
.state { font-family: var(--mono); font-size: 11px; letter-spacing: .12em; text-transform: uppercase; padding: 3px 9px; border: 1px solid var(--ink-3); color: var(--ink-3); border-radius: 20px; }
.state.live { border-color: #2f6b3a; color: #2f6b3a; }
.state.live::before { content: "● "; }
.state.wait { border-color: var(--gold); color: var(--gold); }
.room-facts { list-style: none; padding: 0; margin: 0 0 16px; font-family: var(--mono); font-size: 12.5px; color: var(--ink-2); }
.room-facts li { display: flex; justify-content: space-between; padding: 5px 0; border-bottom: 1px dashed var(--line); gap: 10px; }
.room-facts li span:last-child { color: var(--ink); text-align: right; }
.addr { margin-top: auto; font-family: var(--mono); font-size: 12px; color: var(--red); text-decoration: none; word-break: break-all; }
.addr:hover { text-decoration: underline; }

.steps { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 0; counter-reset: s; }
.steps li { padding: 8px 26px 8px 0; margin-right: 26px; border-right: 1px solid var(--line); }
.steps li:last-child { border-right: 0; margin-right: 0; }
.steps p { color: var(--ink-2); font-size: 17px; margin: 0; }
.glyph { font-family: var(--brush); font-size: 64px; line-height: 1; color: var(--red); display: block; filter: url(#brush); }

.search { width: 100%; max-width: 520px; font: inherit; font-size: 18px; padding: 12px 16px; border: 1.5px solid var(--ink); background: rgba(246,238,219,.7); margin-bottom: 26px; border-radius: 2px; }
.search:focus { outline: 2px solid var(--red); outline-offset: 2px; }
.desks { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.desk { border: 1px solid var(--line); padding: 18px 18px 14px; background: rgba(246,238,219,.55); display: grid; grid-template-columns: 54px 1fr; gap: 4px 14px; }
.desk .num { grid-row: span 3; font-family: var(--brush); font-size: 44px; color: var(--ink); line-height: 1; text-align: center; }
.desk .t { font-weight: 700; font-size: 20px; line-height: 1.2; }
.desk .t small { font-family: var(--cjk); font-weight: 600; font-size: 14px; color: var(--red); margin-left: 6px; }
.desk .d { font-size: 15.5px; color: var(--ink-2); line-height: 1.4; }
.desk .c { font-family: var(--mono); font-size: 11.5px; color: var(--ink-3); }
.desk .c b { color: var(--red); font-weight: 500; }
.desk.hidden { display: none; }

.orders { display: grid; gap: 12px; }
.order { display: grid; grid-template-columns: 90px 1fr auto; gap: 18px; align-items: start; padding: 16px 20px; border: 1px solid var(--line); background: rgba(246,238,219,.55); }
.order .id { font-family: var(--mono); font-size: 13px; color: var(--ink-3); }
.order .id b { display: block; font-family: var(--serif); font-size: 28px; color: var(--ink); }
.order .body .desk-name { font-weight: 700; font-size: 18px; }
.order .body .plan { margin: 6px 0 0; font-size: 17px; color: var(--ink-2); }
.order .body .hash { font-family: var(--mono); font-size: 11.5px; color: var(--ink-3); word-break: break-all; margin-top: 4px; }
.order .body .note { font-style: italic; color: var(--ink-3); margin-top: 6px; font-size: 16px; }
.verdict { font-family: var(--cjk); font-size: 15px; padding: 8px 10px; color: var(--paper); background: var(--ink-3); border-radius: 3px; text-align: center; min-width: 92px; }
.verdict small { display: block; font-family: var(--mono); font-size: 10px; letter-spacing: .1em; text-transform: uppercase; }
.verdict.sealed { background: var(--red); }
.verdict.victory { background: #2f6b3a; }
.verdict.defeat { background: var(--ink); }
.verdict.stalemate { background: var(--gold); }
.empty { color: var(--ink-3); font-style: italic; }

.feed { display: grid; gap: 10px; max-height: 520px; overflow: auto; padding-right: 6px; }
.entry { border-left: 3px solid var(--red); padding: 8px 14px; background: rgba(246,238,219,.55); }
.entry .meta { font-family: var(--mono); font-size: 11.5px; color: var(--ink-3); }
.entry .meta a { color: var(--red); }
.entry p { margin: 4px 0 0; font-size: 17px; }

.tool { border: 1.5px solid var(--ink); padding: 28px; background: rgba(246,238,219,.6); display: flex; flex-direction: column; gap: 12px; }
.tool label { display: flex; flex-direction: column; gap: 4px; font-family: var(--mono); font-size: 12px; color: var(--ink-3); }
.tool input, .tool textarea { font: inherit; font-family: var(--mono); font-size: 14px; padding: 9px 12px; border: 1px solid var(--ink-3); background: var(--paper); color: var(--ink); border-radius: 2px; }
.tool .btn { align-self: flex-start; }
.result { font-family: var(--mono); font-size: 13px; min-height: 1.4em; margin: 0; word-break: break-all; }
.result.ok { color: #2f6b3a; }
.result.bad { color: var(--red); }

.closing { text-align: center; padding: 100px 20px 90px; border-top: 1px solid var(--line); position: relative; overflow: hidden; }
.big-glyph { font-family: var(--brush); font-size: 260px; line-height: .8; color: var(--red); opacity: .12; margin: 0; position: absolute; left: 50%; top: 40px; transform: translateX(-50%); filter: url(#brush); pointer-events: none; }
.closing h2 { position: relative; margin-bottom: 28px; }
.closing .sub { margin-top: 20px; font-family: var(--mono); font-size: 12px; }

/* ── footer ── */
.foot { background: var(--ink); color: var(--paper); padding: 40px clamp(18px, 6vw, 96px) 34px; }
.foot-row { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 20px; align-items: center; padding-bottom: 22px; border-bottom: 1px solid rgba(241,232,212,.18); }
.ca { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.ca .k { font-family: var(--mono); font-size: 11px; letter-spacing: .14em; color: #d9c7a1; }
.ca code { background: rgba(241,232,212,.08); color: var(--paper); font-size: 13px; padding: 6px 10px; }
.foot .btn-ghost { color: var(--paper); border-color: rgba(241,232,212,.5); }
.foot .btn-ghost:hover { background: var(--paper); color: var(--ink); }
.foot-links { display: flex; flex-wrap: wrap; gap: 20px; }
.foot-links a { font-size: 16px; text-decoration: none; color: #d9c7a1; }
.foot-links a:hover { color: var(--paper); }
.disclaimer { font-size: 14px; color: rgba(241,232,212,.6); max-width: 60em; margin: 20px 0 12px; }
.copyright { font-family: var(--mono); font-size: 12px; color: rgba(241,232,212,.75); margin: 0; }

.toast { position: fixed; bottom: 22px; left: 50%; transform: translate(-50%, 140%); background: var(--ink); color: var(--paper); font-family: var(--mono); font-size: 13px; padding: 12px 18px; border-left: 4px solid var(--red); transition: transform .25s, visibility .25s; z-index: 50; max-width: 90vw; visibility: hidden; }
.toast.show { transform: translate(-50%, 0); visibility: visible; }

/* ── responsive ── */
@media (max-width: 1000px) {
  .nav { display: none; }
  .hero { grid-template-columns: 1fr; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .stat:nth-child(2) { border-right: 0; }
  .stat:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .rooms, .block.two { grid-template-columns: 1fr; }
  .steps { grid-template-columns: 1fr 1fr; gap: 26px 0; }
  .steps li:nth-child(2) { border-right: 0; margin-right: 0; }
}
@media (max-width: 600px) {
  body { font-size: 17px; }
  .ticker { display: none; }
  .stats { grid-template-columns: 1fr; }
  .stat { border-right: 0; border-bottom: 1px solid var(--line); }
  .steps { grid-template-columns: 1fr; }
  .steps li { border-right: 0; margin-right: 0; border-bottom: 1px solid var(--line); padding-bottom: 18px; }
  .order { grid-template-columns: 1fr; }
  .paper { height: 400px; }
}
@media (prefers-reduced-motion: reduce) { .scroll, .stamp.on { animation: none; } .stamp.on { transform: rotate(-6deg); opacity: .92; } }
