/* 古書 しおり堂 — old paper, sumi ink and one vermilion seal. Laid out like a printed antiquarian catalogue (目録). */
:root {
  --paper: #efe6d3;
  --paper-2: #e6d9bf;
  --paper-3: #f7f1e4;
  --ink: #2a2521;
  --ink-2: #4f463e;
  --muted: #7d6f60;
  --rule: #b5a385;
  --rule-soft: #d3c4a6;
  --shu: #b0391f;
  --shu-soft: rgba(176, 57, 31, .1);
  --cha: #6b4a2b;
  --night: #1f1b18;
  --f-body: "BIZ UDPMincho", "Yu Mincho", "Hiragino Mincho ProN", serif;
  --f-head: "Shippori Mincho B1", "BIZ UDPMincho", "Yu Mincho", serif;
  --f-hand: "Zen Kurenaido", "Klee One", cursive;
  --grain: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='220' height='220'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 .35  0 0 0 0 .27  0 0 0 0 .17  0 0 0 .09 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
  color-scheme: light;
}
html[data-stage="2"] { --paper: #ede5d4; --shu: #a8442c; }
html:is([data-stage="3"], [data-stage="4"]) { --paper: #f2eee6; --paper-2: #ebe5d8; --shu: #b0391f; --rule: #c9bfae; }

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; } }
body { margin: 0; background: var(--paper) var(--grain); color: var(--ink); font-family: var(--f-body); font-size: 16px; line-height: 1.95; letter-spacing: .02em; overflow-x: hidden; transition: background-color 1.2s; }
img { max-width: 100%; display: block; }
a { color: var(--cha); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { color: var(--shu); }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--shu); outline-offset: 3px; }
.container { max-width: 1120px; margin: 0 auto; padding-left: max(20px, env(safe-area-inset-left, 0px)); padding-right: max(20px, env(safe-area-inset-right, 0px)); }
.nb { white-space: nowrap; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.shu { color: var(--shu); }

/* stage visibility helpers */
html[data-stage="0"] :is(.from-1, .from-2, .from-3, .from-4),
html[data-stage="1"] :is(.from-2, .from-3, .from-4),
html[data-stage="2"] :is(.from-3, .from-4),
html[data-stage="3"] .from-4,
html:is([data-stage="1"], [data-stage="2"], [data-stage="3"], [data-stage="4"]) .until-1,
html:is([data-stage="2"], [data-stage="3"], [data-stage="4"]) .until-2,
html:is([data-stage="3"], [data-stage="4"]) .until-3 { display: none !important; }

/* ink drain */
.dch { display: inline-block; }
.dch.fall { animation-name: fall; animation-timing-function: cubic-bezier(.55, 0, .9, .45); animation-fill-mode: forwards; }
@keyframes fall {
  0% { transform: none; opacity: 1; }
  12% { transform: translateY(1px) scaleY(1.05); opacity: 1; }
  100% { transform: translate(var(--sway, 0), var(--fall, 120px)) scaleY(1.9); opacity: 0; filter: blur(1.4px); }
}
.blanked, .blanked * { color: transparent !important; text-shadow: none !important; }
.blanked img, .blanked .tag { opacity: 0 !important; }
.blanked .tag { border-color: transparent !important; }

/* top bar */
.topbar { background: var(--night); color: #d8cfc0; font-size: 12.5px; letter-spacing: .08em; }
.topbar .container { display: flex; gap: 12px; align-items: center; min-height: 32px; flex-wrap: wrap; }
.topbar .sep { opacity: .35; }
.topbar .open-on::before { content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: #9db86d; margin-right: 6px; vertical-align: 1px; }
.topbar .stock { margin-left: auto; color: #f1a38f; animation: flick 4s steps(1) infinite; }
@keyframes flick { 0%, 90%, 100% { opacity: 1; } 91% { opacity: .25; } 93% { opacity: .9; } 94% { opacity: .1; } }

/* header */
.site-header { background: var(--paper) var(--grain); border-bottom: 3px double var(--ink); position: relative; z-index: 30; }
.site-header .container { display: flex; align-items: center; gap: 24px; min-height: 84px; }
.logo { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; color: var(--ink); }
.seal { width: 46px; height: 46px; color: var(--shu); flex: none; transition: color 1s, opacity 1s; }
.seal text { font-family: "Shippori Mincho B1", "Yu Mincho", serif; font-weight: 800; }
html:is([data-stage="3"], [data-stage="4"]) .seal { color: #cbb9a7; }
html:is([data-stage="3"], [data-stage="4"]) .seal text { opacity: .08; }
.logo .word { font-family: var(--f-head); font-weight: 800; font-size: 26px; letter-spacing: .16em; line-height: 1; }
.logo .word small { display: block; font-size: 11px; font-weight: 600; letter-spacing: .6em; color: var(--muted); margin-bottom: 6px; }
.nav { display: flex; margin-left: auto; font-size: 14.5px; }
.nav a { color: var(--ink-2); text-decoration: none; padding: 4px 14px; border-left: 1px solid var(--rule-soft); }
.nav a:first-child { border-left: 0; }
.nav a:hover, .nav a[aria-current="page"] { color: var(--shu); }
.nav a[aria-current="page"] { text-decoration: underline; text-decoration-style: dotted; text-underline-offset: 6px; }
.cart-link { text-decoration: none; color: var(--ink); border: 1px solid var(--ink); padding: 6px 12px 6px 14px; font-size: 14px; display: inline-flex; gap: 8px; align-items: center; white-space: nowrap; }
.cart-link:hover { background: var(--ink); color: var(--paper-3); }
.cart-n { font-size: 12px; min-width: 20px; height: 20px; display: inline-grid; place-items: center; border: 1px solid currentColor; border-radius: 50%; line-height: 1; }
.cart-n.has { background: var(--shu); border-color: var(--shu); color: #fff; }
.menu-btn { display: none; background: none; border: 1px solid var(--ink); width: 42px; height: 42px; cursor: pointer; padding: 0; }
.menu-btn span { display: block; width: 18px; height: 1.5px; background: var(--ink); margin: 4px auto; }

/* catalogue headings: 一 新着古書 */
.mh { display: flex; align-items: baseline; gap: 16px; flex-wrap: wrap; margin: 0 0 22px; padding: 12px 0 10px; border-top: 3px double var(--ink); border-bottom: 1px solid var(--ink); font-family: var(--f-head); font-weight: 700; font-size: clamp(22px, 2.8vw, 28px); letter-spacing: .14em; line-height: 1.4; }
.mh .no { font-size: .7em; color: var(--shu); border: 1px solid var(--shu); padding: 0 .4em; letter-spacing: 0; line-height: 1.5; }
.mh small { font-family: var(--f-body); font-weight: 400; font-size: 13px; letter-spacing: .08em; color: var(--muted); }
.mh .more { margin-left: auto; font-family: var(--f-body); font-size: 13.5px; font-weight: 400; letter-spacing: .06em; }
section.sec { padding-block: 56px; }
.lead { color: var(--ink-2); max-width: 40em; }
.page-title { padding-block: 40px 8px; }
.page-title h1 { font-family: var(--f-head); font-weight: 800; font-size: clamp(28px, 4vw, 40px); letter-spacing: .2em; margin: 0; line-height: 1.35; }
.page-title p { margin: 8px 0 0; color: var(--muted); font-size: 14px; letter-spacing: .1em; }
.crumb { font-size: 12.5px; color: var(--muted); letter-spacing: .1em; padding-top: 18px; }
.crumb a { color: var(--muted); }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 22px; border: 1px solid var(--ink); background: var(--paper-3); color: var(--ink); font-size: 15px; letter-spacing: .12em; text-decoration: none; cursor: pointer; transition: background .2s, color .2s; }
.btn:hover { background: var(--ink); color: var(--paper-3); }
.btn.ink { background: var(--ink); color: var(--paper-3); }
.btn.ink:hover { background: var(--shu); border-color: var(--shu); }
.btn.shu { background: var(--shu); border-color: var(--shu); color: #fff; }
.btn.shu:hover { background: #8f2c16; }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .45; cursor: not-allowed; }
.btn.sm { padding: 6px 14px; font-size: 13.5px; }

/* photo with a paper mat */
.ph { background: var(--paper-3); padding: 6px; border: 1px solid var(--rule); box-shadow: 0 1px 0 rgba(255,255,255,.6) inset, 0 6px 18px rgba(60, 40, 20, .12); }
.ph img { width: 100%; height: 100%; object-fit: cover; }
figure { margin: 0; }
figcaption { font-size: 12.5px; color: var(--muted); margin-top: 6px; letter-spacing: .06em; }

/* thread binding along the right edge (四つ目綴じ) */
.toji { position: relative; padding-right: 46px; }
.toji::before { content: ""; position: absolute; top: 0; bottom: 0; right: 0; width: 34px; background: linear-gradient(90deg, rgba(0,0,0,.08), rgba(0,0,0,0) 30%), var(--paper-2); border-left: 1px solid var(--rule); }
.toji::after { content: ""; position: absolute; right: 12px; top: 10%; bottom: 10%; width: 22px;
  background:
    radial-gradient(circle at 6px 50%, #2c2620 2.2px, transparent 2.8px) 0 0 / 22px 33.33% repeat-y,
    linear-gradient(90deg, transparent 5px, #3b4256 5px 7px, transparent 7px) 0 0 / 22px 100% no-repeat,
    repeating-linear-gradient(180deg, transparent 0 calc(16.66% - 1px), #3b4256 calc(16.66% - 1px) calc(16.66% + 1px), transparent calc(16.66% + 1px) 33.33%); }

/* hero */
.hero { padding-block: 34px 10px; }
.hero-grid { display: grid; grid-template-columns: 1.25fr 1fr; gap: 40px; align-items: stretch; }
.hero-grid > *, .cols > *, .item-grid > * { min-width: 0; }
.hero-photo { aspect-ratio: 16 / 10; }
.hero-photo img { aspect-ratio: auto; }
.koujo { background: var(--paper-3); border: 1px solid var(--rule); padding: 32px 30px; display: flex; gap: 26px; }
.koujo.toji { padding-right: 66px; }
.koujo .tate { writing-mode: vertical-rl; font-family: var(--f-head); font-weight: 800; font-size: clamp(24px, 2.6vw, 32px); letter-spacing: .24em; line-height: 1.6; margin: 0; flex: none; }
.koujo .tate em { font-style: normal; color: var(--shu); }
.koujo .body { font-size: 15px; color: var(--ink-2); display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; align-content: start; flex: 1; min-width: 0; }
.koujo .body p { margin: 0; }
.today { font-size: 13.5px; border-top: 1px dotted var(--rule); padding-top: 12px; display: grid; gap: 2px; }
.today b { font-family: var(--f-head); letter-spacing: .1em; }
.search-box { display: flex; border: 1px solid var(--ink); background: var(--paper-3); }
.search-box input { flex: 1; min-width: 0; border: 0; background: transparent; padding: 11px 14px; font-size: 15.5px; }
.search-box input:focus { outline: none; }
.search-box button { border: 0; border-left: 1px solid var(--ink); background: var(--ink); color: var(--paper-3); padding: 0 20px; letter-spacing: .2em; cursor: pointer; white-space: nowrap; }
.search-box:focus-within { box-shadow: 0 0 0 2px var(--shu-soft); }

/* notice list */
.oshirase { list-style: none; padding: 0; margin: 0; }
.oshirase li { display: grid; grid-template-columns: 8.5em 1fr; gap: 16px; padding: 10px 0; border-bottom: 1px dotted var(--rule); font-size: 15px; }
.oshirase time { color: var(--muted); font-size: 13.5px; letter-spacing: .06em; padding-top: 2px; }
.oshirase .new { color: var(--shu); font-size: 12px; border: 1px solid var(--shu); padding: 0 5px; margin-right: 6px; }

/* catalogue entries (目録) */
.mk { list-style: none; margin: 0; padding: 0; counter-reset: mk; }
.mk-item { display: grid; grid-template-columns: 104px 1fr auto; gap: 18px; padding: 18px 0; border-bottom: 1px solid var(--rule-soft); align-items: start; }
.mk-item:first-child { border-top: 1px solid var(--rule-soft); }
.mk-item .thumb { width: 104px; aspect-ratio: 1; padding: 4px; }
.mk-item .thumb.noimg { display: grid; place-items: center; font-size: 11.5px; color: var(--muted); letter-spacing: .1em; background: var(--paper-2); }
.mk-no { font-size: 12px; color: var(--muted); letter-spacing: .12em; }
.mk-title { font-family: var(--f-head); font-weight: 700; font-size: 18.5px; line-height: 1.5; letter-spacing: .06em; margin: 0; }
.mk-title a { color: var(--ink); text-decoration: none; }
.mk-title a:hover { color: var(--shu); text-decoration: underline; }
.mk-meta { font-size: 13.5px; color: var(--ink-2); margin: 2px 0 6px; }
.mk-desc { font-size: 14px; color: var(--ink-2); margin: 6px 0 0; line-height: 1.85; }
.mk-price { text-align: right; white-space: nowrap; font-family: var(--f-head); font-size: 19px; font-weight: 700; letter-spacing: .04em; display: grid; gap: 8px; justify-items: end; }
.mk-price small { font-family: var(--f-body); font-size: 11.5px; font-weight: 400; color: var(--muted); display: block; }
.mk-arrived { font-size: 12px; color: var(--muted); }
.tags { display: flex; flex-wrap: wrap; gap: 5px; }
.tag { font-size: 12px; line-height: 1.6; padding: 0 7px; border: 1px solid var(--ink-2); color: var(--ink-2); letter-spacing: .06em; background: var(--paper-3); }
.tag.w { border-color: var(--shu); color: var(--shu); }
.tag.g { border-color: var(--rule); color: var(--muted); }
.zoom-btn { font-size: 12.5px; border: 1px solid var(--rule); background: var(--paper-3); padding: 2px 10px; cursor: pointer; color: var(--ink-2); letter-spacing: .08em; }
.zoom-btn:hover { border-color: var(--shu); color: var(--shu); }
.zoom-btn .seen { color: var(--muted); }
.pick { display: grid; grid-template-columns: repeat(4, 1fr); gap: 22px; }
.pick a { text-decoration: none; color: var(--ink); display: grid; gap: 8px; }
.pick .ph { aspect-ratio: 1; display: block; }
.pick .t { font-family: var(--f-head); font-weight: 700; font-size: 15.5px; line-height: 1.5; }
.pick .p { font-size: 13.5px; color: var(--muted); }

/* 2-column blocks */
.cols { display: grid; grid-template-columns: 1fr 1fr; gap: 44px; }
.cols3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; }
.box { background: var(--paper-3); border: 1px solid var(--rule); padding: 22px 24px; }
.box h3 { font-family: var(--f-head); font-size: 18px; margin: 0 0 8px; letter-spacing: .1em; }
.box p { margin: 0; font-size: 14.5px; color: var(--ink-2); }
.box.shu-l { border-left: 3px solid var(--shu); }

/* tables */
.t-wrap { overflow-x: auto; }
table.tb { width: 100%; border-collapse: collapse; font-size: 14.5px; border-top: 2px solid var(--ink); border-bottom: 2px solid var(--ink); }
table.tb th, table.tb td { padding: 10px 12px; border-bottom: 1px solid var(--rule-soft); text-align: left; vertical-align: top; }
table.tb th { font-weight: 400; color: var(--ink); background: var(--paper-2); white-space: nowrap; letter-spacing: .08em; }
table.tb td.r { text-align: right; white-space: nowrap; }
dl.def { display: grid; grid-template-columns: 9em 1fr; margin: 0; border-top: 1px solid var(--ink); }
dl.def dt, dl.def dd { margin: 0; padding: 10px 6px; border-bottom: 1px dotted var(--rule); font-size: 14.5px; }
dl.def dt { font-family: var(--f-head); font-weight: 700; letter-spacing: .1em; }
dl.def dd { color: var(--ink-2); }

/* lightbox (zoomable photo) */
.lb { position: fixed; inset: 0; z-index: 80; background: rgba(24, 20, 17, .92); display: grid; grid-template-rows: auto 1fr auto; }
.lb-bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 16px; color: #e8dfcf; font-size: 14px; }
.lb-bar b { font-family: var(--f-head); letter-spacing: .1em; font-weight: 700; }
.lb-close { background: none; border: 1px solid #8f8475; color: #e8dfcf; padding: 4px 14px; cursor: pointer; }
.lb-stage { position: relative; overflow: hidden; touch-action: none; cursor: zoom-in; }
.lb-stage.zoomed { cursor: grab; }
.lb-stage.dragging { cursor: grabbing; }
.lb-stage img { position: absolute; left: 0; top: 0; max-width: none; transform-origin: 0 0; user-select: none; -webkit-user-drag: none; box-shadow: 0 10px 40px rgba(0,0,0,.5); }
.lb-hint { color: #b9ae9d; font-size: 12.5px; text-align: center; padding: 8px 16px 14px; letter-spacing: .08em; }

/* item page */
.item-grid { display: grid; grid-template-columns: 1.35fr 1fr; gap: 40px; align-items: start; }
.item-main-photo { aspect-ratio: 4 / 3; }
.item-info h1 { font-family: var(--f-head); font-weight: 800; font-size: clamp(24px, 3vw, 32px); letter-spacing: .08em; line-height: 1.45; margin: 4px 0 6px; }
.item-info .alias { font-size: 14px; color: var(--muted); }
.price-row { display: flex; align-items: baseline; gap: 16px; margin: 18px 0 14px; padding: 14px 0; border-top: 1px solid var(--ink); border-bottom: 1px solid var(--ink); flex-wrap: wrap; }
.price-row .p { font-family: var(--f-head); font-size: 30px; font-weight: 800; letter-spacing: .04em; }
.price-row .p small { font-size: 13px; font-weight: 400; color: var(--muted); margin-left: 6px; }
.price-row .stock { font-size: 14px; }
.price-row .stock b { font-size: 20px; color: var(--shu); margin: 0 4px; }
.buy { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.buy-msg { font-size: 14px; margin: 10px 0 0; min-height: 1.6em; }
.buy-msg.err { color: var(--shu); }
.notice { border: 1px solid var(--shu); color: var(--shu); background: var(--shu-soft); padding: 10px 14px; font-size: 14.5px; margin: 0 0 14px; }

/* book viewer */
.book-wrap { margin-top: 40px; }
.book-desk { background: radial-gradient(ellipse at 50% 40%, #6b5440, #3e2f23 75%); padding: 34px 16px 18px; border: 1px solid #2d2219; box-shadow: inset 0 0 60px rgba(0,0,0,.5); }
.book { position: relative; margin: 0 auto; max-width: 980px; user-select: none; -webkit-user-select: none; }
.book canvas { display: block; width: 100%; touch-action: pan-y; cursor: grab; }
.book canvas.dragging { cursor: grabbing; }
.book canvas:focus-visible { outline: 2px solid #f0c9a0; outline-offset: 6px; }
.book-ctl { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: 14px; color: #eadfcd; font-size: 13.5px; letter-spacing: .1em; }
.book-ctl button { background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.35); color: #f1e7d6; padding: 6px 14px; cursor: pointer; letter-spacing: .1em; }
.book-ctl button:disabled { opacity: .3; cursor: default; }
.book-ctl .where { font-family: var(--f-head); text-align: center; }
.book-hint { text-align: center; color: #c8b9a2; font-size: 12.5px; margin: 8px 0 0; letter-spacing: .08em; }
.last-zoom { display: block; margin: 12px auto 0; }

/* cash box (帳場の手提げ金庫) */
.kinko { position: fixed; inset: 0; z-index: 85; background: rgba(20, 16, 13, .94); display: grid; place-items: center; padding: 16px; overflow-y: auto; }
.kinko-in { width: min(820px, 100%); display: grid; gap: 12px; }
.kinko-view { position: relative; overflow: hidden; box-shadow: 0 16px 50px rgba(0,0,0,.6); }
.kinko-photo { position: relative; aspect-ratio: 1200 / 896; overflow: hidden; user-select: none; -webkit-user-select: none; }
@media (max-width: 700px) {
  /* on a phone the camera moves in on the lock, so the dials are big enough to turn with a finger */
  .kinko-view { aspect-ratio: 600 / 420; }
  .kinko-photo { position: absolute; width: 200%; left: -73.33%; top: -71.43%; }
}
.kinko-photo img { width: 100%; height: 100%; object-fit: cover; }
.wheel { position: absolute; transform: translate(-50%, -50%); background: none; border: 0; padding: 0; cursor: ns-resize; overflow: hidden; border-radius: 3px; touch-action: none; }
.wheel .digits { position: absolute; left: 0; right: 0; top: 0; transition: transform .18s cubic-bezier(.3,.8,.4,1); }
.wheel .digits span { display: grid; place-items: center; line-height: 1; font-family: "Shippori Mincho B1", serif; font-weight: 800; color: #2b241f; opacity: .86; }
.wheel::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: linear-gradient(180deg, rgba(40,30,20,.55), rgba(40,30,20,0) 32%, rgba(255,255,255,.08) 50%, rgba(40,30,20,0) 68%, rgba(40,30,20,.6)); }
.wheel:focus-visible { outline: 2px solid #f0c9a0; }
.knob { position: absolute; transform: translate(-50%, -50%); border-radius: 50%; border: 0; background: transparent; cursor: pointer; }
.knob:focus-visible { outline: 2px solid #f0c9a0; }
.kinko-photo.shake { animation: shake .45s; }
@keyframes shake { 20%, 60% { transform: translateX(-5px); } 40%, 80% { transform: translateX(5px); } }
.kinko-bar { display: flex; justify-content: space-between; align-items: center; gap: 10px; color: #e8dfcf; font-size: 14px; flex-wrap: wrap; }
.kinko-msg { min-height: 1.6em; color: #f1c3b3; font-size: 14.5px; }
.kinko-msg.ok { color: #cfe2b4; }
.kinko-open { position: absolute; inset: 0; opacity: 0; transition: opacity .9s; cursor: pointer; }
.kinko-open.on { opacity: 1; }
.kinko-open img { width: 100%; height: 100%; object-fit: cover; }
.hot { position: absolute; border: 0; background: transparent; cursor: zoom-in; padding: 0; }
.hot:focus-visible { outline: 2px dashed #fff; }
.choba-photo { position: relative; aspect-ratio: 1200 / 896; }

/* diary */
.nikki { display: grid; gap: 0; }
.entry { padding: 26px 0; border-bottom: 1px solid var(--rule-soft); display: grid; grid-template-columns: 7.5em 1fr; gap: 22px; }
.entry:first-child { border-top: 1px solid var(--rule-soft); }
.entry time { font-family: var(--f-head); font-size: 15px; letter-spacing: .08em; line-height: 1.6; }
.entry time small { display: block; color: var(--muted); font-family: var(--f-body); font-size: 12px; }
.entry h3 { font-family: var(--f-head); font-weight: 700; font-size: 19px; margin: 0 0 8px; letter-spacing: .08em; line-height: 1.5; }
.entry p { margin: 0 0 10px; color: var(--ink-2); font-size: 15px; }
.entry figure { max-width: 480px; margin-top: 10px; }
.entry.fresh { background: linear-gradient(90deg, var(--shu-soft), transparent 60%); padding-left: 14px; margin-left: -14px; }
.entry.fresh time { color: var(--shu); }

/* forms */
.form { display: grid; gap: 14px; max-width: 640px; }
.field { display: grid; gap: 4px; }
.field label { font-size: 14px; letter-spacing: .08em; }
.field label .req { color: var(--shu); font-size: 12px; margin-left: 6px; }
.field input, .field select, .field textarea { border: 1px solid var(--rule); background: var(--paper-3); padding: 9px 12px; font-size: 16px; width: 100%; border-radius: 0; }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 2px var(--shu-soft); }
.field .err { color: var(--shu); font-size: 13px; min-height: 0; }
.radios { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 14.5px; }
.form-msg { min-height: 1.6em; font-size: 14.5px; }
.form-msg.err { color: var(--shu); }
.done-box { border: 3px double var(--ink); background: var(--paper-3); padding: 24px; }
.done-box h3 { font-family: var(--f-head); margin: 0 0 6px; letter-spacing: .1em; }

/* search */
.s-form { display: grid; grid-template-columns: 1fr auto auto; gap: 10px; align-items: end; }
.s-form .field input, .s-form .field select { padding: 10px 12px; }
.s-checks { display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: 14px; color: var(--ink-2); margin-top: 10px; }
.s-count { font-size: 14px; color: var(--muted); margin: 26px 0 8px; letter-spacing: .06em; }
.s-none { padding: 30px 0; border-top: 1px solid var(--rule-soft); border-bottom: 1px solid var(--rule-soft); color: var(--ink-2); }
.mk-item.hit-hakushi .mk-title a { color: var(--ink); }
.mk-item.hit-hakushi .zaiko { color: var(--shu); font-weight: 700; }

/* cart */
.cart-list { list-style: none; padding: 0; margin: 0 0 18px; border-top: 2px solid var(--ink); }
.cart-list li { display: grid; grid-template-columns: 64px 1fr auto auto; gap: 14px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--rule-soft); }
.cart-list .thumb { width: 64px; height: 64px; padding: 3px; }
.cart-list .t { font-family: var(--f-head); font-weight: 700; }
.cart-list .rm { background: none; border: 1px solid var(--rule); padding: 2px 10px; cursor: pointer; font-size: 13px; color: var(--muted); }
.sum { display: grid; grid-template-columns: 1fr auto; gap: 4px 20px; max-width: 360px; margin-left: auto; font-size: 15px; }
.sum .total { font-family: var(--f-head); font-size: 20px; font-weight: 800; border-top: 1px solid var(--ink); padding-top: 6px; }

/* climax: the order slip and the book */
.rite { position: fixed; inset: 0; z-index: 90; background: #1b1612; color: #efe4d2; overflow-y: auto; display: grid; place-items: center; padding: 24px 16px; }
.rite-in { width: min(980px, 100%); display: grid; gap: 18px; text-align: center; }
.rite .slip { background: var(--paper-3); color: var(--ink); border: 3px double var(--ink); padding: 22px 24px; max-width: 520px; margin: 0 auto; text-align: left; font-size: 14.5px; }
.rite .slip h3 { font-family: var(--f-head); margin: 0 0 8px; letter-spacing: .14em; }
.rite .line { font-family: var(--f-head); font-weight: 800; font-size: clamp(20px, 3.4vw, 32px); letter-spacing: .14em; line-height: 1.6; text-wrap: balance; min-height: 1.6em; }
.rite .sub { color: #bcae98; font-size: 13.5px; letter-spacing: .1em; }
.rite .go { justify-self: center; }

/* alteration overlay */
.alter { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; cursor: pointer; background: #120e0b; }
.alter canvas { position: absolute; inset: 0; width: 100%; height: 100%; opacity: .5; }
.alter .msg { position: relative; text-align: center; color: #fff6ea; font-family: var(--f-head); font-weight: 800; font-size: clamp(22px, 4vw, 40px); letter-spacing: .16em; text-shadow: 3px 0 rgba(200, 40, 20, .9), -3px 0 rgba(40, 60, 90, .9); animation: jit .18s steps(2) infinite; padding: 0 16px; }
.alter .msg small { display: block; margin-top: 18px; font-family: var(--f-body); font-size: 13px; letter-spacing: .3em; text-shadow: none; color: #c9bba6; animation: none; }
@keyframes jit { 50% { transform: translate(1px, -1px); } }
html.glitching body { animation: gl .45s steps(3); }
@keyframes gl { 33% { transform: translateX(-3px); filter: contrast(1.3) sepia(.6); } 66% { transform: translateX(3px); filter: blur(.5px); } }

.toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); background: var(--ink); color: var(--paper-3); padding: 10px 20px; font-size: 14px; opacity: 0; transition: .3s; pointer-events: none; z-index: 70; max-width: calc(100vw - 32px); }
.toast.on { opacity: 1; transform: translate(-50%, 0); }

/* map */
.map { position: relative; aspect-ratio: 16 / 10; background: #e9dfc9; border: 1px solid var(--rule); overflow: hidden; }
.map svg { width: 100%; height: 100%; display: block; }

/* footer */
.site-footer { margin-top: 72px; border-top: 3px double var(--ink); background: var(--paper-2) var(--grain); padding-block: 40px 24px; font-size: 13.5px; color: var(--ink-2); }
.site-footer .container { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1.6fr; gap: 28px; }
.site-footer h4 { font-family: var(--f-head); font-size: 14px; letter-spacing: .2em; margin: 0 0 8px; color: var(--ink); border-bottom: 1px solid var(--rule); padding-bottom: 4px; }
.site-footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.site-footer .f-shop p { margin: 14px 0 0; }
.site-footer .legal { grid-column: 1 / -1; display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; border-top: 1px solid var(--rule); padding-top: 16px; font-size: 12px; color: var(--muted); }
.site-footer .legal button { background: none; border: 1px solid var(--rule); color: var(--muted); padding: 3px 12px; cursor: pointer; font-size: 12px; }

/* 404 */
.nf { min-height: 70vh; display: grid; place-items: center; text-align: center; padding: 40px 20px; }
.nf .code { font-family: var(--f-head); font-size: 84px; font-weight: 800; color: var(--rule); line-height: 1; letter-spacing: .1em; }

@media (max-width: 980px) {
  .nav { display: none; position: absolute; left: 0; right: 0; top: 100%; background: var(--paper-3); border-bottom: 3px double var(--ink); flex-direction: column; padding: 8px 20px 14px; }
  .nav.open { display: flex; }
  .nav a { border-left: 0; border-bottom: 1px dotted var(--rule); padding: 10px 4px; }
  .menu-btn { display: block; }
  .cart-link { margin-left: auto; }
  .hero-grid, .item-grid, .cols { grid-template-columns: 1fr; }
  .pick { grid-template-columns: repeat(2, 1fr); }
  .cols3 { grid-template-columns: 1fr; }
  .site-footer .container { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 640px) {
  body { font-size: 15.5px; }
  .site-header .container { min-height: 70px; gap: 12px; }
  .seal { width: 38px; height: 38px; }
  .logo .word { font-size: 21px; }
  .koujo { padding: 22px 18px; gap: 16px; flex-direction: column; }
  .koujo.toji { padding-right: 52px; }
  .koujo .tate { writing-mode: horizontal-tb; font-size: 23px; letter-spacing: .14em; }
  .koujo .tate br { display: none; }
  .mk-item { grid-template-columns: 76px 1fr; gap: 12px; }
  .mk-item .thumb { width: 76px; }
  .mk-price { grid-column: 2; justify-items: start; text-align: left; }
  .oshirase li { grid-template-columns: 1fr; gap: 0; }
  .entry { grid-template-columns: 1fr; gap: 6px; }
  .s-form { grid-template-columns: 1fr; }
  dl.def { grid-template-columns: 1fr; }
  dl.def dt { border-bottom: 0; padding-bottom: 0; }
  .cart-list li { grid-template-columns: 56px 1fr; }
  .cart-list li > :nth-child(3), .cart-list li > :nth-child(4) { grid-column: 2; justify-self: start; }
  .site-footer .container { grid-template-columns: 1fr; }
  .book-desk { padding: 18px 8px 12px; }
  .topbar .container { gap: 8px; font-size: 11.5px; }
}
