/* JUMAK app — design system "Tavern Terminal" (direction A, 2026-09-26).
   Rules: one focal motion per viewport; amber = actions + key numbers only; chili = alerts/WANTED;
   jade = live/success; text ≥ 13px (labels 12–13px mono); tap targets ≥ 44px. */
:root {
  --soot: #0E0A08; --soot-2: #17110E; --soot-3: #221913; --line: #3A2C22; --line-2: #54402F;
  --amber: #FFB547; --amber-2: #FFD37A; --chili: #E8412C; --rice: #F3E9D2; --rice-2: #CFC2A6; --muted: #A8977C;
  --jade: #3FB38A;
  --display: "Geist", "Inter", system-ui, sans-serif;
  --mono: "Geist Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --readout: "VT323", var(--mono);
  --r: 4px;
  --bar-h: 64px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--soot); color: var(--rice); font: 16px/1.6 var(--display); }
a { color: inherit; }
img { max-width: 100%; display: block; }
.px { image-rendering: pixelated; }
:focus-visible { outline: 2px solid var(--amber); outline-offset: 3px; }
[hidden] { display: none !important; }

/* ---------- scanline texture (behind content only, ~3%) ---------- */
body::before { content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background: repeating-linear-gradient(#0000 0 3px, #ffb54708 3px 4px); }
main, .top { position: relative; z-index: 1; }

/* ---------- top bar: logo · tabs · wallet ---------- */
.top { position: sticky; top: 0; z-index: 20; background: #0E0A08ee; backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--line); }
.top-in { max-width: 1240px; margin: 0 auto; height: var(--bar-h); padding: 0 20px;
  display: flex; align-items: center; gap: 20px; }
.logo { display: flex; align-items: center; gap: 10px; text-decoration: none; font: 800 21px/1 var(--display); letter-spacing: -.02em; }
.logo img { width: 32px; height: 32px; }
.tabs { display: flex; gap: 6px; margin-left: 12px; }
.tab { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 16px; border-radius: var(--r);
  font: 600 15px/1 var(--display); text-decoration: none; color: var(--rice-2); }
.tab:hover { color: var(--rice); background: var(--soot-2); }
.tab.on { color: var(--rice); box-shadow: inset 0 -2px 0 var(--amber); border-radius: 0; }
.tab.mint { color: var(--soot); background: var(--amber); }
.tab.mint:hover { background: var(--amber-2); }
.tab.mint.on { box-shadow: none; }
.tab .ic { display: inline-grid; width: 20px; height: 20px; }
.tab .ic svg { width: 100%; height: 100%; }
.top-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.icon-link { display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: var(--r); color: var(--rice-2); }
.icon-link:hover { color: var(--rice); background: var(--soot-2); }
.icon-link svg { width: 20px; height: 20px; }

/* sub-page header: back + title only */
.back { display: inline-grid; place-items: center; width: 44px; height: 44px; margin-left: -10px; border-radius: var(--r); color: var(--rice); }
.back:hover { background: var(--soot-2); }
.back svg { width: 24px; height: 24px; }
.top-title { font: 700 17px/1 var(--display); letter-spacing: -.01em; }
@media (min-width: 761px) { .top.sub .tabs { display: none; } }

/* wallet chip (My Tavern lives behind it) */
.wallet { position: relative; }
.chip { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 16px; border-radius: var(--r);
  border: 1px solid var(--line-2); background: var(--soot-2); color: var(--rice); font: 600 14px/1 var(--mono); cursor: pointer; }
.chip:hover { border-color: var(--amber); }
.chip .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); }
.chip.on .dot { background: var(--jade); }
.menu { position: absolute; right: 0; top: calc(100% + 8px); width: 280px; background: var(--soot-2); border: 1px solid var(--line-2);
  border-radius: 8px; padding: 14px; box-shadow: 0 18px 40px #000a; }
.menu h4 { margin: 0 0 4px; font: 600 13px/1.4 var(--mono); color: var(--muted); text-transform: uppercase; letter-spacing: .08em; }
.menu .addr { font: 15px/1.4 var(--mono); word-break: break-all; margin-bottom: 12px; }
.menu a, .menu button { display: flex; align-items: center; justify-content: space-between; width: 100%; min-height: 44px; padding: 0 12px;
  border: 0; border-radius: var(--r); background: none; color: var(--rice); font: 15px/1 var(--display); text-decoration: none; cursor: pointer; }
.menu a:hover, .menu button:hover { background: var(--soot-3); }

/* mobile: the tabs become an app-style bottom bar — icon over label, always visible, no hamburger */
@media (max-width: 760px) {
  :root { --bar-h: 56px; --dock-h: 64px; }
  .top-in { padding: 0 14px; gap: 10px; }
  .tabs { position: fixed; left: 0; right: 0; bottom: 0; top: auto; z-index: 30; margin: 0; gap: 0;
    padding: 0 6px env(safe-area-inset-bottom); display: grid; grid-template-columns: repeat(5, 1fr);
    background: #0E0A08f5; backdrop-filter: blur(8px); border-top: 1px solid var(--line); }
  .tab, .tab.mint { flex-direction: column; justify-content: center; gap: 4px; height: var(--dock-h); padding: 0;
    border-radius: 0; background: none; color: var(--muted); font: 600 12px/1 var(--mono); letter-spacing: .02em; box-shadow: none; }
  .tab:hover, .tab.mint:hover { background: none; color: var(--rice-2); }
  .tab .ic { width: 24px; height: 24px; }
  .tab.on, .tab.on:hover { color: var(--amber); box-shadow: inset 0 2px 0 var(--amber); }
  body { padding-bottom: calc(var(--dock-h) + env(safe-area-inset-bottom)); }
  /* backdrop-filter on the header would make it the containing block of the fixed dock (pinning it to the top) */
  .top { backdrop-filter: none; -webkit-backdrop-filter: none; background: #0E0A08; }
  .icon-link.opt { display: none; }
  .chip { padding: 0 12px; font-size: 13px; }
}

/* ---------- type ---------- */
.eyebrow { font: 600 13px/1.4 var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--amber); margin: 0 0 12px; }
h1 { font: 800 clamp(40px, 6.2vw, 84px)/.94 var(--display); letter-spacing: -.035em; margin: 0 0 18px; }
h2 { font: 800 clamp(26px, 3.2vw, 40px)/1.05 var(--display); letter-spacing: -.02em; margin: 0 0 12px; }
h3 { font: 700 19px/1.3 var(--display); margin: 0 0 6px; }
.lead { font-size: clamp(17px, 1.6vw, 20px); color: var(--rice-2); max-width: 34ch; margin: 0 0 26px; }
.note { font-family: var(--mono); font-size: 13px; color: var(--muted); }
.note a { display: inline-block; padding: 12px 0; margin: -12px 0; color: var(--rice-2); }
.readout { font: 26px/1 var(--readout); color: var(--amber); }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 52px; padding: 0 26px;
  border-radius: var(--r); border: 1px solid transparent; font: 700 16px/1 var(--display); text-decoration: none; cursor: pointer;
  transition: transform .12s cubic-bezier(.23,1,.32,1), background .12s; }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--amber); color: var(--soot); }
.btn.primary:hover { background: var(--amber-2); }
.btn.ghost { border-color: var(--line-2); color: var(--rice); background: #0E0A0899; }
.btn.ghost:hover { border-color: var(--rice-2); }
.btn[disabled] { opacity: .45; cursor: not-allowed; transform: none; }
.btn.block { width: 100%; }
.row { display: flex; gap: 12px; flex-wrap: wrap; }

/* ---------- layout ---------- */
.wrap { max-width: 1240px; margin: 0 auto; padding: 0 20px; }
.section { padding: 72px 0; }
.card { background: var(--soot-2); border: 1px solid var(--line); border-radius: 8px; padding: 22px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
@media (max-width: 760px) { .grid2 { grid-template-columns: 1fr; } .section { padding: 44px 0; } .wrap { padding: 0 16px; } }

/* ---------- hero scene with calm parallax (desktop only) ---------- */
.scene { position: relative; overflow: hidden; background: #0b0d18; }
.scene .layers { position: relative; aspect-ratio: 16 / 9; max-height: calc(100vh - var(--bar-h)); width: 100%; }
.scene .layers img { position: absolute; inset: -14px; width: calc(100% + 28px); height: calc(100% + 28px); object-fit: cover;
  object-position: 70% 50%; image-rendering: pixelated; will-change: transform; }
.scene .mobile-art { display: none; }
.scene::after { content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(90deg, #0E0A08f0 0%, #0E0A08b0 30%, #0E0A0800 58%), linear-gradient(0deg, #0E0A08 0%, #0E0A0800 22%); }
.scene .copy { position: absolute; z-index: 2; left: 0; right: 0; bottom: 0; top: 0; display: flex; align-items: center; }
.scene .copy .wrap { width: 100%; }
.scene .copy-in { max-width: 560px; }
@media (max-width: 760px) {
  /* Phone: words first on solid ground, then the art — never text over the picture. */
  .scene { display: flex; flex-direction: column; background: var(--soot); }
  .scene .layers { display: none; }
  .scene .copy { position: static; order: 1; padding: 28px 0 22px; }
  .scene .mobile-art { display: block; order: 2; width: 100%; aspect-ratio: 4 / 5; object-fit: cover; object-position: 50% 62%; image-rendering: pixelated; }
  .scene::after { display: none; }
  .scene .stats { margin-top: 22px; gap: 22px; }
  .scene h1 { font-size: 44px; }
  .scene .lead { margin-bottom: 20px; }
  .scene .row .btn { flex: 1; }
}

/* ---------- stats strip ---------- */
.stats { display: flex; gap: 28px; margin-top: 30px; }
.stat b { display: block; font: 26px/1 var(--readout); color: var(--rice); }
.stat span { font: 600 12px/1.4 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }

/* ---------- progress ---------- */
.bar { height: 10px; background: var(--soot-3); border-radius: 99px; overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--amber); width: 0; transition: width .6s cubic-bezier(.23,1,.32,1); }

/* ---------- mint ---------- */
.mint-shell { position: relative; min-height: calc(100vh - var(--bar-h)); display: flex; align-items: center; }
.mint-shell .bgart { position: absolute; inset: 0; background: center / cover no-repeat; image-rendering: pixelated; }
.mint-shell::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, #0E0A08f2 0%, #0E0A08c8 40%, #0E0A0850 70%, #0E0A0820 100%); }
.mint-shell > .wrap { position: relative; z-index: 2; width: 100%; padding-top: 40px; padding-bottom: 40px; }
.panel { width: min(460px, 100%); background: #17110Ef2; border: 1px solid var(--line-2); border-radius: 10px; padding: 26px; box-shadow: 0 24px 60px #000b; }
.panel .phase { display: flex; justify-content: space-between; align-items: center; margin-bottom: 18px; }
.pill { display: inline-flex; align-items: center; gap: 8px; min-height: 28px; padding: 0 10px; border-radius: 99px; font: 600 12px/1 var(--mono);
  letter-spacing: .08em; text-transform: uppercase; border: 1px solid var(--line-2); color: var(--rice-2); }
.pill.live { color: var(--jade); border-color: #3FB38A66; }
.pill.live::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--jade); animation: pulse 2s steps(2) infinite; }
.pill.closed { color: var(--muted); }
@keyframes pulse { 50% { opacity: .35; } }
.kv { display: flex; justify-content: space-between; align-items: baseline; margin: 16px 0 8px; }
.kv span { font: 600 13px/1 var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.kv b { font: 30px/1 var(--readout); }
.stepper { display: grid; grid-template-columns: 52px 1fr 52px; border: 1px solid var(--line-2); border-radius: var(--r); overflow: hidden; margin: 8px 0 18px; }
.stepper button { min-height: 52px; background: var(--soot-3); color: var(--rice); border: 0; font-size: 22px; cursor: pointer; }
.stepper button:disabled { opacity: .4; cursor: not-allowed; }
.stepper output { display: grid; place-items: center; font: 26px/1 var(--readout); }
.status { min-height: 24px; margin: 14px 0 0; font-size: 14px; color: var(--rice-2); }
.status.err { color: #ff8a78; }
.phases { margin: 20px 0 0; padding: 0; list-style: none; border-top: 1px solid var(--line); }
.phases li { display: flex; justify-content: space-between; gap: 10px; padding: 12px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.phases li b { font-weight: 600; }
.phases li span { font: 13px/1.4 var(--mono); color: var(--muted); text-align: right; }
.phases li.now b { color: var(--jade); }
@media (max-width: 760px) {
  /* Phone: the mint panel only — no art competing for the first screen. */
  .mint-shell { display: block; min-height: 0; }
  .mint-shell .bgart, .mint-shell::after { display: none; }
  .mint-shell > .wrap { padding-top: 16px; padding-bottom: 24px; }
  .panel { width: 100%; box-shadow: none; padding: 16px; border: 0; background: none; }
  /* One screen on a phone: price and quantity share a row, the total lives in the button. */
  .mint-page main .wrap { padding: 0 12px; }
  .panel .tagline, .panel .total-row { display: none; }
  .panel h2 { font-size: 28px; margin-bottom: 4px; }
  .panel .phase { margin-bottom: 12px; }
  .panel .kv { margin: 12px 0 6px; }
  .buy { display: grid; grid-template-columns: 1fr 1.2fr; gap: 12px; align-items: end; }
  .buy .buy-price { flex-direction: column; align-items: flex-start; gap: 8px; margin: 12px 0 18px; }
  .buy .buy-qty .kv { margin-top: 12px; }
  .buy .buy-qty .kv .note { display: none; }
  .buy .stepper { margin-bottom: 18px; }
  .panel .phases { margin-top: 14px; }
  .panel { padding: 20px; }
  .mintbar { display: flex; }
}
/* sticky mobile mint bar (shown after the panel scrolls out) */
.mintbar { display: none; position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; align-items: center; gap: 12px;
  padding: 10px 14px calc(10px + env(safe-area-inset-bottom)); background: #17110Ef5; border-top: 1px solid var(--line-2); }
.mintbar .mb-info { flex: 1; font: 13px/1.3 var(--mono); color: var(--rice-2); }
.mintbar .mb-info b { display: block; font: 20px/1 var(--readout); color: var(--rice); }
.mintbar.off { transform: translateY(110%); }
.mintbar { transition: transform .2s cubic-bezier(.23,1,.32,1); }

/* ---------- reveal / result ---------- */
.result { margin-top: 18px; border-top: 1px dashed var(--line-2); padding-top: 18px; }
.tokens { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 10px; margin: 10px 0 16px; }
.tokens a { text-decoration: none; font: 13px/1.4 var(--mono); color: var(--rice-2); }
.tokens img { width: 100%; aspect-ratio: 1; border-radius: 6px; image-rendering: pixelated; animation: reveal .5s cubic-bezier(.23,1,.32,1) both; }
@keyframes reveal { from { opacity: 0; transform: scale(.94); filter: brightness(2.5); } }

/* ---------- open-in-wallet sheet (X in-app browser) ---------- */
.sheet { position: fixed; inset: 0; z-index: 50; background: #000b; display: flex; align-items: flex-end; justify-content: center; }
.sheet-in { width: min(520px, 100%); background: var(--soot-2); border: 1px solid var(--line-2); border-radius: 14px 14px 0 0;
  padding: 22px 18px calc(22px + env(safe-area-inset-bottom)); }
.sheet-in h3 { margin-bottom: 4px; }
.sheet-in p { color: var(--rice-2); font-size: 15px; margin: 0 0 16px; }
.sheet-in .btn { width: 100%; margin-bottom: 10px; }

/* ---------- collection ---------- */
.head { padding: 48px 0 24px; display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; }
.head p { margin: 0; color: var(--rice-2); }
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 16px; padding-bottom: 80px; }
.tcard { display: block; text-decoration: none; background: var(--soot-2); border: 1px solid var(--line); border-radius: 8px; overflow: hidden;
  transition: transform .16s cubic-bezier(.23,1,.32,1), border-color .16s; }
.tcard:hover { transform: translateY(-3px); border-color: var(--amber); }
.tcard img { width: 100%; aspect-ratio: 1; image-rendering: pixelated; }
.tcard div { display: flex; justify-content: space-between; padding: 10px 12px; font: 600 14px/1.3 var(--mono); }
.tcard div span { color: var(--muted); font-weight: 400; }
.empty { padding: 60px 20px; text-align: center; color: var(--rice-2); border: 1px dashed var(--line-2); border-radius: 10px; }
@media (max-width: 760px) { .gallery { grid-template-columns: repeat(2, 1fr); gap: 10px; } }

/* ---------- SANJEOK detail ---------- */
.detail { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 40px; padding: 48px 0 80px; align-items: start; }
.portrait { position: relative; border-radius: 10px; overflow: hidden; border: 1px solid var(--line-2); }
.portrait img { width: 100%; aspect-ratio: 1; image-rendering: pixelated; }
.portrait .scan { position: absolute; left: 0; right: 0; height: 30%; top: -30%; background: linear-gradient(180deg, #FFB54700, #FFB54740, #FFB54700);
  animation: scan 1.1s cubic-bezier(.23,1,.32,1) .15s 1 both; pointer-events: none; }
@keyframes scan { to { top: 100%; } }
.traits { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 18px 0; }
.trait { background: var(--soot-2); border: 1px solid var(--line); border-radius: 6px; padding: 10px 12px; }
.trait span { display: block; font: 600 12px/1.3 var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.trait b { font-weight: 600; font-size: 15px; }
.trait em { display: block; font-style: normal; font: 12px/1.4 var(--mono); color: var(--amber); margin-top: 2px; }
.charges { list-style: none; padding: 0; margin: 10px 0 0; }
.charges li { padding: 12px 0; border-bottom: 1px solid var(--line); font-size: 15px; }
.charges li span { display: block; font: 13px/1.4 var(--mono); color: var(--muted); }
@media (max-width: 860px) { .detail { grid-template-columns: 1fr; gap: 24px; padding-top: 24px; } }

/* ---------- home teasers ---------- */
.teasers { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.teaser { display: flex; flex-direction: column; gap: 10px; text-decoration: none; }
.teaser img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; border-radius: 6px; image-rendering: pixelated; }
.teaser p { margin: 0; color: var(--rice-2); font-size: 15px; }
.teaser .go { margin-top: auto; font: 600 14px/1 var(--mono); color: var(--amber); }
@media (max-width: 860px) { .teasers { grid-template-columns: 1fr; } }

/* ---------- More tab: links that used to be the footer ---------- */
main { padding-bottom: env(safe-area-inset-bottom); }
.more { display: flex; flex-direction: column; margin: 40px 0 64px; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.more a { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 56px; padding: 0 18px;
  text-decoration: none; color: var(--rice); font-weight: 600; border-top: 1px solid var(--line); }
.more a:first-child { border-top: 0; }
.more a:hover { background: #ffffff08; color: var(--amber); }
.more small { font: 13px/1.4 var(--mono); color: var(--muted); text-align: right; }


@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 1ms !important; animation-iteration-count: 1 !important; transition-duration: 1ms !important; }
}
.in-frame, .in-frame body { scrollbar-width: none; }
.in-frame ::-webkit-scrollbar { display: none; }

/* ---------- secondary pages: one shell for lore, links, terms, privacy, soon, wall ---------- */
body.public { padding-bottom: 0; }
.page { max-width: 1080px; margin: 0 auto; padding: 56px 20px 96px; }
.page-head { margin-bottom: 40px; }
.page-head h1 { font-size: clamp(40px, 5.4vw, 68px); }
.page-head .lead { max-width: 52ch; margin-bottom: 0; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 22px; }
.chips a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 14px; border: 1px solid var(--line-2); border-radius: 99px;
  font: 600 13px/1 var(--mono); text-decoration: none; color: var(--rice-2); }
.chips a:hover { border-color: var(--amber); color: var(--rice); }
.card { background: var(--soot-2); border: 1px solid var(--line); border-radius: 12px; padding: 24px; }
.card h2, .card h3 { margin-top: 0; }
.card p, .card li, .card dd { color: var(--rice-2); }
.card.alert { border-color: #E8412C88; background: linear-gradient(180deg, #E8412C14, #E8412C05); }
.card.alert .eyebrow { color: var(--chili); }
code, .mono { font: 600 14px/1.4 var(--mono); color: var(--amber); }

/* lore: numbered chapters, art + text, alternating on desktop */
.chapters { display: grid; gap: 56px; }
.chapter { display: grid; grid-template-columns: 1.15fr 1fr; gap: 40px; align-items: center; }
.chapter:nth-child(even) .art { order: 2; }
.chapter .art { border-radius: 10px; overflow: hidden; border: 1px solid var(--line-2); box-shadow: 0 24px 60px #000a; }
.chapter .art img { width: 100%; image-rendering: pixelated; }
.chapter .no { font: 32px/1 var(--readout); color: var(--amber); margin-bottom: 8px; }
.chapter p { color: var(--rice-2); font-size: 17px; }
.chapter a { color: var(--amber); }
.rules-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-top: 18px; }
.rules-grid div { padding: 18px; border: 1px solid var(--line); border-radius: 10px; background: var(--soot-2); }
.rules-grid b { display: block; font: 800 22px/1.1 var(--display); }
.rules-grid span { font: 13px/1.4 var(--mono); color: var(--muted); }
@media (max-width: 760px) {
  .page { padding: 32px 16px 56px; }
  .chapter { grid-template-columns: 1fr; gap: 16px; }
  .chapter:nth-child(even) .art { order: 0; }
  .chapters { gap: 40px; }
  .rules-grid { grid-template-columns: 1fr 1fr; }
}

/* links: a grid of cards, the scam warning spans the row */
.link-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.link-grid .wide { grid-column: 1 / -1; }
.link-grid ul { margin: 0; padding-left: 20px; }
.link-grid li { margin: 6px 0; }
.faq dt { font-weight: 700; margin-top: 18px; }
.faq dt:first-child { margin-top: 0; }
.faq dd { margin: 4px 0 0; }
.faq a, .link-grid a { color: var(--amber); }
@media (max-width: 760px) { .link-grid { grid-template-columns: 1fr; } }

/* terms / privacy: readable column + section index */
.doc { display: grid; grid-template-columns: 220px 1fr; gap: 56px; align-items: start; }
.doc .toc { position: sticky; top: calc(var(--bar-h) + 24px); display: grid; gap: 2px; }
.doc .toc a { display: flex; align-items: center; min-height: 36px; font: 13px/1.3 var(--mono); color: var(--muted); text-decoration: none; }
.doc .toc a:hover { color: var(--amber); }
.prose { max-width: 70ch; }
.prose h2 { font: 700 22px/1.3 var(--display); letter-spacing: -.01em; margin: 44px 0 10px; padding-top: 20px; border-top: 1px solid var(--line); scroll-margin-top: 80px; }
.prose > h2:first-of-type { margin-top: 0; }
.prose p, .prose li { color: var(--rice-2); }
.prose li { margin: 6px 0; }
.prose a { color: var(--amber); }
.prose section[lang="ko"] { margin-top: 72px; }
:lang(ko) { font-family: "Noto Sans KR", var(--display); word-break: keep-all; }
@media (max-width: 860px) { .doc { grid-template-columns: 1fr; gap: 0; } .doc .toc { display: none; } }

/* soon: the gate at night, one message */
.soon { position: relative; min-height: calc(100vh - var(--bar-h)); display: grid; place-items: center; text-align: center; overflow: hidden; }
.soon .bg { position: absolute; inset: 0; background: center / cover no-repeat; image-rendering: pixelated; }
.soon::after { content: ""; position: absolute; inset: 0; background: radial-gradient(ellipse at center, #0E0A08e6 0%, #0E0A08b3 45%, #0E0A0866 100%); }
.soon .in { position: relative; z-index: 1; padding: 40px 20px; max-width: 620px; }
.soon .lead { margin: 0 auto 28px; max-width: 40ch; }
.stamp { display: inline-block; padding: 10px 18px; border: 2px solid var(--chili); color: var(--chili); border-radius: 4px;
  font: 600 13px/1 var(--mono); letter-spacing: .2em; transform: rotate(-3deg); margin-bottom: 28px; }
.soon .row { justify-content: center; }

/* wall: art banner, three steps, the ledger */
.wall-hero { position: relative; min-height: 380px; display: flex; align-items: flex-end; overflow: hidden; border-bottom: 1px solid var(--line); }
.wall-hero .bg { position: absolute; inset: 0; background: center 35% / cover no-repeat; image-rendering: pixelated; }
.wall-hero::after { content: ""; position: absolute; inset: 0; background: linear-gradient(0deg, #0E0A08 0%, #0E0A08cc 35%, #0E0A0833 100%); }
.wall-hero .wrap { position: relative; z-index: 1; width: 100%; padding-bottom: 36px; }
.wall-hero .eyebrow { color: var(--chili); }
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 32px 0; }
.steps div { padding: 18px; border: 1px solid var(--line); border-radius: 10px; background: var(--soot-2); }
.steps b { display: block; font: 30px/1 var(--readout); color: var(--amber); margin-bottom: 6px; }
.steps p { margin: 0; color: var(--rice-2); font-size: 15px; }
.claim { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px; }
.claim p { margin: 0; color: var(--rice-2); }
#msg { display: none; margin: 14px 0; padding: 12px 16px; border: 1px solid var(--amber); border-radius: 8px; color: var(--amber); }
.ledger { width: 100%; border-collapse: collapse; margin-top: 12px; }
.ledger th { font: 600 12px/1 var(--mono); letter-spacing: .1em; color: var(--muted); text-align: left; padding: 12px 10px; border-bottom: 1px solid var(--line-2); }
.ledger td { padding: 14px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.ledger td small { display: block; font: 12px/1.4 var(--mono); color: var(--muted); text-transform: uppercase; }
.ledger td.m { font-family: var(--mono); white-space: nowrap; color: var(--rice-2); }
.ledger td.c { max-width: 380px; }
.ledger td a { color: var(--amber); }
.ledger td.s { font: 600 12px/1 var(--mono); color: var(--muted); text-transform: uppercase; white-space: nowrap; }
.ledger td.s.wl { color: var(--jade); }
.ledger td.b { color: var(--chili); font-weight: 600; }
.empty-wall { margin-top: 12px; }
@media (max-width: 760px) {
  .wall-hero { min-height: 300px; }
  .steps { grid-template-columns: 1fr; }
  .ledger thead { display: none; }
  .ledger tr { display: grid; grid-template-columns: auto 1fr auto; gap: 4px 12px; padding: 14px 0; border-bottom: 1px solid var(--line); }
  .ledger td { border: 0; padding: 0; }
  .ledger td.c { grid-column: 1 / -1; max-width: none; }
  .ledger td.c:empty { display: none; }
  .ledger td.b { grid-column: 1 / -1; }
  .ledger td.b:empty { display: none; }
  .ledger td:nth-child(6) { grid-column: 1 / 3; font-size: 14px; }
  .ledger td.s { text-align: right; }
}
.wall-hero .bg { background-image: url(art/wall-d.webp); }
@media (max-width: 760px) { .wall-hero .bg { background-image: url(art/wall-m.webp); } }
.soon .bg.m { display: none; }
@media (max-width: 760px) { .soon .bg.d { display: none; } .soon .bg.m { display: block; } }

/* ---------- lore: told in scenes ---------- */
.lore-hero { position: relative; min-height: calc(100vh - var(--bar-h)); display: flex; align-items: flex-end; overflow: hidden; }
.lore-hero > img, .scene-ch .shot img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; image-rendering: pixelated; }
.lore-hero::after { content: ""; position: absolute; inset: 0; background: linear-gradient(0deg, #0E0A08 0%, #0E0A08b0 30%, #0E0A0800 65%); }
.lore-hero .wrap { position: relative; z-index: 1; width: 100%; padding-bottom: 72px; }
.lore-hero h1 { font-size: clamp(44px, 6.4vw, 92px); }
.lore-hero .lead { max-width: 40ch; }

.scene-ch { position: relative; min-height: 92vh; display: flex; align-items: flex-end; overflow: hidden; border-top: 1px solid var(--line); }
.scene-ch .shot { position: absolute; inset: 0; }
.scene-ch::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, #0E0A08f0 0%, #0E0A08b8 34%, #0E0A0800 62%); }
.scene-ch:nth-child(even)::after { background: linear-gradient(270deg, #0E0A08f0 0%, #0E0A08b8 34%, #0E0A0800 62%); }
.scene-ch .txt { position: relative; z-index: 1; width: min(480px, 100%); margin: 0 0 72px max(20px, calc((100vw - 1200px) / 2)); }
.scene-ch:nth-child(even) .txt { margin-left: auto; margin-right: max(20px, calc((100vw - 1200px) / 2)); }
.scene-ch .no { display: block; font: 34px/1 var(--readout); color: var(--amber); margin-bottom: 10px; }
.scene-ch h2 { font-size: clamp(32px, 3.6vw, 52px); }
.scene-ch p { color: var(--rice-2); font-size: 18px; margin: 0; }
.scene-ch .go { display: inline-flex; align-items: center; min-height: 44px; margin-top: 10px; color: var(--amber); font-weight: 700; text-decoration: none; }
.scene-ch.last::after { background: linear-gradient(0deg, #0E0A08 0%, #0E0A08d9 40%, #0E0A0833 100%); }
.scene-ch.last .txt { width: min(760px, 100%); margin: 0 auto 72px; padding: 0 20px; text-align: left; }
.scene-ch.last .rules-grid { margin-top: 24px; }

.armory { padding: 96px 0 72px; border-top: 1px solid var(--line); }
.arm-row { display: grid; grid-auto-flow: column; grid-auto-columns: min(420px, 78vw); gap: 16px; overflow-x: auto; scroll-snap-type: x mandatory;
  padding: 28px max(20px, calc((100vw - 1200px) / 2)) 8px; scrollbar-width: thin; }
.arm { margin: 0; scroll-snap-align: start; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: var(--soot-2); }
.arm img { width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: cover; image-rendering: pixelated; }
.arm figcaption { display: grid; grid-template-columns: 1fr auto; align-items: baseline; gap: 6px 12px; padding: 16px 18px 18px; }
.arm b { font: 700 19px/1.2 var(--display); }
.arm .count { font: 13px/1 var(--mono); color: var(--muted); white-space: nowrap; }
.arm .count .readout { font-size: 30px; }
.arm em { grid-column: 1 / -1; font-style: normal; color: var(--rice-2); font-size: 15px; }
.arm-row { align-items: start; }
.arm:last-child { border-color: #FFB54766; }

/* chapter text rises in as it scrolls into view (CSS only, where supported) */
@supports (animation-timeline: view()) {
  @media (prefers-reduced-motion: no-preference) {
    .scene-ch .txt { animation: rise linear both; animation-timeline: view(); animation-range: entry 10% cover 35%; }
    @keyframes rise { from { opacity: 0; transform: translateY(28px); } to { opacity: 1; transform: none; } }
  }
}

@media (max-width: 760px) {
  .lore-hero { min-height: 78vh; }
  .lore-hero > img { object-position: 30% center; }
  .lore-hero .wrap { padding-bottom: 36px; }
  .scene-ch, .scene-ch.last { display: block; min-height: 0; }
  .scene-ch .shot { position: relative; aspect-ratio: 16 / 10; }
  .scene-ch::after, .scene-ch:nth-child(even)::after, .scene-ch.last::after { inset: 0 0 auto 0; height: calc(100vw * 10 / 16);
    background: linear-gradient(0deg, #0E0A08 0%, #0E0A0800 40%); }
  .scene-ch .txt, .scene-ch:nth-child(even) .txt, .scene-ch.last .txt { width: auto; margin: -28px 16px 44px; padding: 0; }
  .scene-ch p { font-size: 16px; }
  .armory { padding: 56px 0 40px; }
  .arm-row { padding: 20px 16px 8px; }
}

/* Genesis (#1–555) marker on the token page */
.eyebrow .gen { color: var(--rice); background: var(--chili); padding: 2px 8px; border-radius: 3px; }
.trait.genesis { border-color: #E8412C88; background: linear-gradient(180deg, #E8412C1f, #E8412C08); }
.trait.genesis b { color: var(--rice); }

/* ---------- holder loop: the innkeeper's file, the Sanjeok wall (2026-09-27) ---------- */
.file { background: var(--soot-2); border: 1px solid var(--line); border-left: 3px solid var(--amber); border-radius: 6px; padding: 18px 20px; margin-top: 12px; }
.file.old { border-left-color: var(--line-2); opacity: .85; }
.file .alias { font: 400 30px/1.1 var(--readout); color: var(--amber); margin: 0 0 10px; }
.file dl { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; margin: 0 0 12px; }
.file dt { font: 600 12px/1.6 var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.file dd { margin: 0; }
.file .line { font-weight: 600; margin: 0 0 8px; }
.file p { margin: 0 0 10px; overflow-wrap: anywhere; }
.file-meta { margin: 8px 0 0 !important; }
.empty-file { border-left-color: var(--line-2); color: var(--rice-2); }
.older { margin-top: 12px; }
.older summary { cursor: pointer; font: 600 13px/1.4 var(--mono); color: var(--rice-2); min-height: 44px; display: flex; align-items: center; }
.linkish { background: none; border: 0; padding: 12px 0; margin: -12px 0; color: var(--rice-2); font: inherit; text-decoration: underline; cursor: pointer; }
.linkish[disabled] { opacity: .5; cursor: default; }
@media (max-width: 560px) { .file dl { grid-template-columns: 1fr; gap: 0 0; } .file dd { margin-bottom: 8px; } }

.wrap.narrow { max-width: 720px; padding-bottom: 80px; }
.story-head { display: flex; gap: 18px; align-items: center; padding: 32px 0 20px; }
.story-head .mini { width: 96px; height: 96px; border-radius: 8px; border: 1px solid var(--line-2); image-rendering: pixelated; flex: none; }
#story .q { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin: 22px 0 8px; font-weight: 600; }
#story .q small { font: 400 12px/1.4 var(--mono); color: var(--muted); white-space: nowrap; }
#story input, #story textarea { width: 100%; background: var(--soot-2); color: var(--rice); border: 1px solid var(--line-2); border-radius: var(--r);
  padding: 12px 14px; font: 16px/1.5 var(--display); min-height: 48px; resize: vertical; }
#story input:focus, #story textarea:focus { border-color: var(--amber); outline: none; }
#story .fineprint { margin: 24px 0 16px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.chip { min-height: 44px; padding: 0 14px; border-radius: 22px; border: 1px dashed var(--line-2); background: none; color: var(--rice-2);
  font: 13px/1.3 var(--mono); cursor: pointer; text-align: left; }
.chip:hover { border-color: var(--amber); color: var(--rice); }

.holders { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; margin-top: 16px; }
.holder { background: var(--soot-2); border: 1px solid var(--line); border-radius: 8px; padding: 14px; }
.holder .h { display: inline-block; font: 600 15px/1.3 var(--mono); color: var(--amber); text-decoration: none; padding: 8px 0; }
.holder .faces { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 6px; }
.holder .faces img { width: 52px; height: 52px; border-radius: 4px; image-rendering: pixelated; border: 1px solid var(--line); }
.holder .more-n { font: 600 13px var(--mono); color: var(--muted); padding: 0 6px; }
.card.week { margin-top: 16px; border-color: var(--amber); }
.week-in { display: flex; gap: 18px; align-items: center; }
.week-in img { width: 120px; height: 120px; border-radius: 6px; image-rendering: pixelated; flex: none; }
@media (max-width: 560px) { .week-in { flex-direction: column; align-items: flex-start; } }
.wall-link { margin: 20px 0 8px; }
.wall-link p { margin: 0 0 14px; }

/* ---------- home: more of the tavern (2026-10-01 opening pages) ---------- */
.home-links { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.home-links a { display: flex; flex-direction: column; gap: 2px; padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--r);
  background: var(--soot-2); text-decoration: none; }
.home-links a:hover { border-color: var(--amber); }
.home-links b { color: var(--rice); }
.home-links span { color: var(--muted); font-size: 14px; }
