/* FORGED IN SILENCE · 静鍛 — charcoal & ember, steel accents, wide caps, massive kanji */
:root {
  --bg: #0a0705; --ink: #ece4d4;
  --ink-dim: rgba(236,228,212,.62); --ink-faint: rgba(236,228,212,.32);
  --gold: #cfa55c; --gold-bright: #e8c37e; --ember: #f07a2e;
  --panel: rgba(16,12,9,.86);
  --serif: 'Cormorant Garamond', Georgia, 'Times New Roman', serif;
  --caps: 'Marcellus', 'Cormorant Garamond', Georgia, serif;
  --jp: 'Noto Serif JP', 'Hiragino Mincho ProN', serif;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { height: 100%; overflow: hidden; background: var(--bg); }
body { color: var(--ink); font-family: var(--serif); -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility; }
::selection { background: rgba(207,165,92,.4); }
#scene { position: fixed; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; cursor: grab; z-index: 0; }
#scene:active { cursor: grabbing; }

/* ——— cinematic overlays ——— */
#warm-glow { position: fixed; inset: 0; z-index: 1; pointer-events: none;
  background: radial-gradient(ellipse 62% 48% at 50% 58%, rgba(240,122,46,.055), transparent 70%); }
#vignette { position: fixed; inset: 0; z-index: 2; pointer-events: none;
  background:
    radial-gradient(ellipse at 50% 44%, transparent 46%, rgba(4,2,1,.38) 82%, rgba(2,1,0,.66) 100%),
    linear-gradient(180deg, rgba(4,2,1,.35) 0%, transparent 14%, transparent 84%, rgba(4,2,1,.5) 100%); }
#grain { position: fixed; inset: -50%; z-index: 3; pointer-events: none; opacity: .5;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix type='matrix' values='0 0 0 0 0.9 0 0 0 0 0.85 0 0 0 0 0.78 0 0 0 0.05 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: grainShift 0.9s steps(4) infinite; }
@keyframes grainShift {
  0% { transform: translate(0, 0); } 25% { transform: translate(-2%, 1.5%); }
  50% { transform: translate(1.5%, -2%); } 75% { transform: translate(-1%, -1%); } 100% { transform: translate(0, 0); } }
#ghost { position: fixed; z-index: 1; pointer-events: none; right: 2vw; top: 50%;
  transform: translateY(-52%); font-family: var(--jp); font-weight: 600; font-size: 46vh;
  line-height: 1; color: transparent; user-select: none;
  -webkit-text-stroke: 1px rgba(236,228,212,.055);
  text-shadow: 0 0 90px rgba(207,165,92,.06);
  transition: opacity .6s ease; }

/* ——— scroll progress ——— */
#progress { position: fixed; z-index: 9; top: 0; left: 0; right: 0; height: 2px;
  background: rgba(236,228,212,.07); }
#progress i { display: block; height: 100%; width: 0%;
  background: linear-gradient(90deg, var(--gold), var(--gold-bright));
  box-shadow: 0 0 8px rgba(207,165,92,.7); }

#topbar { position: fixed; z-index: 8; top: 0; left: 0; right: 0;
  display: flex; justify-content: space-between; align-items: center; padding: 20px 34px 18px; pointer-events: none; }
#topbar::after { content: ''; position: absolute; left: 34px; right: 34px; bottom: 0; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(236,228,212,.1) 20%, rgba(236,228,212,.1) 80%, transparent); }
#topbar > * { pointer-events: auto; }
.brand { display: flex; align-items: center; gap: 16px; }
.brand-seal { font-family: var(--jp); font-size: 15px; font-weight: 600; color: var(--gold);
  width: 40px; height: 40px; display: grid; place-items: center; letter-spacing: 0;
  border: 1px solid rgba(207,165,92,.5); border-radius: 4px;
  background: linear-gradient(145deg, rgba(207,165,92,.12), rgba(207,165,92,.03));
  box-shadow: inset 0 0 12px rgba(207,165,92,.08); }
.brand-text { display: flex; flex-direction: column; gap: 3px; }
.brand-kanji { font-family: var(--jp); font-size: 13px; color: var(--gold); letter-spacing: .34em; }
.brand-name { font-family: var(--caps); font-size: 11px; letter-spacing: .46em; color: var(--ink-dim); }
.top-actions { display: flex; gap: 10px; }
.ghost-btn { font-family: var(--caps); font-size: 10px; letter-spacing: .28em;
  color: var(--ink-dim); border: 1px solid rgba(236,228,212,.18); padding: 10px 18px;
  background: rgba(12,9,7,.5); backdrop-filter: blur(10px); transition: all .25s ease; cursor: pointer; }
.ghost-btn:hover { color: var(--ink); border-color: rgba(207,165,92,.6); background: rgba(207,165,92,.06); }
.ghost-btn.on { color: var(--gold); border-color: rgba(207,165,92,.65); }
#cart-count { color: var(--gold); margin-left: 6px; }

#copy { position: fixed; inset: 0; z-index: 5; pointer-events: none; }
.chapter { position: absolute; left: 8vw; bottom: 14vh; width: min(520px, 82vw);
  opacity: 0; visibility: hidden; }
.chapter[data-ch="4"] { bottom: auto; top: 15vh; }
.kicker { font-family: var(--caps); font-size: 11px; letter-spacing: .42em; color: var(--gold);
  display: flex; align-items: center; gap: 14px; margin-bottom: 20px; }
.kicker::before { content: ''; width: 40px; height: 1px;
  background: linear-gradient(90deg, var(--gold), transparent); opacity: .75; }
.chapter h2 { font-family: var(--caps); font-weight: 400; font-size: clamp(32px, 4.2vw, 54px);
  line-height: 1.06; letter-spacing: .015em; margin-bottom: 18px;
  text-shadow: 0 2px 30px rgba(0,0,0,.55); }
.chapter h2.title-big { font-size: clamp(44px, 6.8vw, 92px); letter-spacing: .05em; line-height: 1; }
.sub { font-style: italic; font-size: clamp(15px, 1.25vw, 18px); line-height: 1.7;
  color: var(--ink-dim); max-width: 46ch;
  border-left: 1px solid rgba(207,165,92,.22); padding-left: 18px; }
.tline { display: inline-block; }
.tch { display: inline-block; opacity: .12; transform: translateY(16px); transition: opacity 1s ease, transform 1s cubic-bezier(.2,.7,.2,1); }
h2.lit .tch { opacity: 1; transform: translateY(0); }

#rail { position: fixed; z-index: 6; left: 30px; top: 50%; transform: translateY(-50%);
  display: flex; flex-direction: column; gap: 26px; }
.rail-line { position: absolute; left: 30px; top: 8px; bottom: 8px; width: 1px;
  background: linear-gradient(180deg, transparent, rgba(236,228,212,.12) 15%, rgba(236,228,212,.12) 85%, transparent);
  pointer-events: none; }
#rail button { position: relative; display: flex; align-items: center; gap: 12px; padding: 0; cursor: pointer;
  background: none; border: none; text-align: left; }
.rail-no { font-family: var(--caps); font-size: 8px; letter-spacing: .2em; color: var(--ink-faint);
  width: 18px; flex: none; transition: color .35s ease; }
#rail i { width: 7px; height: 7px; border-radius: 50%; border: 1px solid var(--ink-faint);
  background: var(--bg); transition: all .35s ease; flex: none; }
#rail .rail-label { font-family: var(--caps); font-size: 9px; letter-spacing: .3em; color: var(--ink-faint);
  display: flex; flex-direction: column; line-height: 1.6; transition: color .35s ease;
  opacity: 0; transform: translateX(-6px); transition: opacity .35s ease, transform .35s ease, color .35s ease; }
#rail .rail-label em { font-family: var(--jp); font-style: normal; font-size: 11px; letter-spacing: .3em; }
#rail button:hover .rail-label, #rail button.on .rail-label { opacity: 1; transform: translateX(0); }
#rail button:hover i { border-color: var(--gold); }
#rail button.on i { background: var(--gold); border-color: var(--gold);
  box-shadow: 0 0 14px rgba(207,165,92,.9); }
#rail button.on .rail-no { color: var(--gold); }
#rail button.on .rail-label { color: var(--ink); }

#hint { position: fixed; z-index: 6; left: 50%; bottom: 4.5vh; transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center; gap: 12px;
  font-family: var(--caps); font-size: 10px; letter-spacing: .42em; color: var(--ink-faint);
  transition: opacity .8s ease; pointer-events: none; }
#hint .hint-line { width: 1px; height: 44px; background: linear-gradient(var(--gold), transparent);
  animation: hintDrop 2.2s ease-in-out infinite; transform-origin: top; }
#hint.gone { opacity: 0; }
@keyframes hintDrop { 0% { transform: scaleY(0); opacity: 0; } 35% { transform: scaleY(1); opacity: 1; }
  100% { transform: scaleY(1); opacity: 0; transform: translateY(14px); } }

#store { position: fixed; z-index: 7; left: 0; right: 0; bottom: 0; padding: 22px 4vw 34px;
  transform: translateY(112%); transition: transform 1.1s cubic-bezier(.2,.8,.2,1); pointer-events: none;
  background: linear-gradient(0deg, rgba(5,3,2,.78) 30%, rgba(5,3,2,.4) 70%, transparent); }
#store.on { transform: translateY(0); pointer-events: auto; }
#cards { display: flex; gap: 18px; justify-content: center; }
.card { position: relative; overflow: hidden; width: 244px; flex: none; padding: 22px 22px 20px; cursor: pointer;
  background: var(--panel); backdrop-filter: blur(14px);
  border: 1px solid rgba(236,228,212,.1);
  transition: transform .4s cubic-bezier(.2,.8,.2,1), border-color .35s ease, box-shadow .35s ease; }
.card::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(207,165,92,.55), transparent);
  opacity: 0; transition: opacity .35s ease; }
.card:hover::before, .card.selected::before { opacity: 1; }
.card:hover { transform: translateY(-6px); border-color: rgba(207,165,92,.45);
  box-shadow: 0 16px 44px rgba(0,0,0,.55); }
.card.selected { border-color: var(--gold);
  box-shadow: 0 0 0 1px rgba(207,165,92,.7), 0 20px 54px rgba(0,0,0,.6); }
.card-kanji { position: absolute; right: 10px; top: 2px; font-family: var(--jp); font-size: 64px;
  color: rgba(207,165,92,.09); pointer-events: none; line-height: 1; }
.card-name { font-family: var(--caps); font-weight: 400; font-size: 17px; letter-spacing: .14em;
  margin-top: 30px; }
.card-tag { font-style: italic; font-size: 14px; color: var(--ink-dim); margin: 5px 0 16px; }
.card-price { font-family: var(--caps); font-size: 18px; color: var(--gold-bright); margin-bottom: 16px; }
.card-btn { width: 100%; font-family: var(--caps); font-size: 10px; letter-spacing: .3em; padding: 12px 0;
  background: transparent; cursor: pointer;
  border: 1px solid rgba(236,228,212,.22); color: var(--ink-dim); transition: all .25s ease; }
.card:hover .card-btn { border-color: var(--gold); color: var(--gold); }
.card.selected .card-btn { background: var(--gold); border-color: var(--gold); color: #1a1409; }

#detail { position: fixed; z-index: 7; right: 3vw; bottom: 258px; width: 316px; padding: 26px 26px 24px;
  background: var(--panel); backdrop-filter: blur(14px); border: 1px solid rgba(207,165,92,.3);
  opacity: 0; transform: translateY(14px); pointer-events: none;
  transition: opacity .5s ease, transform .5s cubic-bezier(.2,.8,.2,1); }
.corner { position: absolute; width: 14px; height: 14px; pointer-events: none; }
.c-tl { top: -1px; left: -1px; border-top: 1px solid var(--gold); border-left: 1px solid var(--gold); }
.c-br { bottom: -1px; right: -1px; border-bottom: 1px solid var(--gold); border-right: 1px solid var(--gold); }
#detail.on { opacity: 1; transform: translateY(0); pointer-events: auto; }
#detail .kicker { margin-bottom: 12px; font-size: 10px; }
#detail-name { font-family: var(--caps); font-weight: 400; font-size: 26px; letter-spacing: .1em; margin-bottom: 10px; }
#detail-desc { font-style: italic; font-size: 15px; color: var(--ink-dim); line-height: 1.6; margin-bottom: 18px; }
#detail-specs { list-style: none; margin-bottom: 22px; }
#detail-specs li { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0;
  border-bottom: 1px solid rgba(236,228,212,.09); font-size: 14px; }
#detail-specs li span:first-child { color: var(--ink-faint); letter-spacing: .1em;
  font-family: var(--caps); font-size: 11px; }
#detail-specs li span:last-child { color: var(--ink); text-align: right; }
.cta { width: 100%; font-family: var(--caps); font-size: 10px; letter-spacing: .3em; padding: 15px 0;
  background: var(--gold); color: #1a1409; border: 1px solid var(--gold); cursor: pointer; transition: all .25s ease; }
.cta:hover { background: var(--gold-bright); border-color: var(--gold-bright);
  box-shadow: 0 8px 28px rgba(207,165,92,.4); transform: translateY(-1px); }

#drawer { position: fixed; z-index: 9; top: 0; right: 0; height: 100%; width: 360px; max-width: 92vw;
  background: linear-gradient(180deg, #13100c, #0c0a08);
  border-left: 1px solid rgba(236,228,212,.12); box-shadow: -24px 0 60px rgba(0,0,0,.5);
  transform: translateX(102%); transition: transform .6s cubic-bezier(.2,.8,.2,1);
  display: flex; flex-direction: column; }
#drawer.on { transform: translateX(0); }
#drawer header { display: flex; justify-content: space-between; align-items: center; padding: 26px 26px 20px;
  border-bottom: 1px solid rgba(236,228,212,.09); }
#drawer h3 { font-family: var(--caps); font-weight: 400; font-size: 15px; letter-spacing: .3em; }
#drawer-items { flex: 1; overflow-y: auto; padding: 12px 26px; }
.empty { color: var(--ink-faint); font-style: italic; font-size: 15px; line-height: 1.7; padding: 24px 0; }
.drawer-item { display: flex; justify-content: space-between; align-items: center; gap: 10px;
  padding: 15px 0; border-bottom: 1px solid rgba(236,228,212,.08); }
.drawer-item strong { font-family: var(--caps); font-weight: 400; font-size: 14px; letter-spacing: .1em; display: block; }
.drawer-item span { font-style: italic; font-size: 13px; color: var(--ink-dim); }
.drawer-item-right { display: flex; align-items: center; gap: 12px; font-family: var(--caps); font-size: 14px; }
.drawer-item-right button { background: none; border: none; color: var(--ink-faint); font-size: 18px;
  padding: 2px 6px; cursor: pointer; transition: color .2s ease; }
.drawer-item-right button:hover { color: var(--ember); }
#drawer footer { padding: 22px 26px 28px; border-top: 1px solid rgba(236,228,212,.09); }
.drawer-total { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 18px; }
.drawer-total span { font-family: var(--caps); font-size: 10px; letter-spacing: .3em; color: var(--ink-dim); }
.drawer-total strong { font-family: var(--caps); font-weight: 400; font-size: 26px; color: var(--gold); }
.drawer-note { margin-top: 12px; font-size: 12px; font-style: italic; color: var(--ink-faint); }

#toast { position: fixed; z-index: 10; left: 34px; bottom: 34px; max-width: 340px;
  padding: 15px 22px; background: rgba(20,16,13,.94); backdrop-filter: blur(10px);
  border: 1px solid rgba(207,165,92,.45); border-left: 3px solid var(--gold);
  font-style: italic; font-size: 15px; box-shadow: 0 14px 40px rgba(0,0,0,.5);
  opacity: 0; transform: translateY(10px); pointer-events: none; transition: all .4s ease; }
#toast.show { opacity: 1; transform: translateY(0); }

#loading { position: fixed; inset: 0; z-index: 100; background: var(--bg);
  display: flex; align-items: center; justify-content: center;
  transition: opacity 1.1s ease; }
#loading::after { content: ''; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(ellipse at 50% 50%, transparent 40%, rgba(2,1,0,.6) 100%); }
#loading.done { opacity: 0; pointer-events: none; }
.load-inner { text-align: center; position: relative; z-index: 1; }
.load-seal { width: 108px; height: 108px; margin: 0 auto 22px; display: grid; place-items: center;
  border: 1px solid rgba(207,165,92,.4); border-radius: 6px;
  background: linear-gradient(145deg, rgba(207,165,92,.1), rgba(207,165,92,.02));
  animation: loadPulse 2.4s ease-in-out infinite; }
.load-kanji { font-family: var(--jp); font-size: 62px; font-weight: 600; color: var(--gold); }
@keyframes loadPulse { 0%,100% { opacity: .6; } 50% { opacity: 1; box-shadow: 0 0 34px rgba(207,165,92,.22); } }
.load-brand { font-family: var(--caps); font-size: 15px; letter-spacing: .5em; margin-bottom: 8px; }
.load-sub { font-family: var(--jp); font-size: 11px; letter-spacing: .4em; color: var(--ink-faint); margin-bottom: 36px; }
.load-bar { width: 240px; height: 1px; background: rgba(236,228,212,.14); margin: 0 auto 14px; }
.load-bar i { display: block; height: 100%; width: 0%;
  background: linear-gradient(90deg, var(--gold), var(--gold-bright));
  box-shadow: 0 0 10px rgba(207,165,92,.8); transition: width .3s ease; }
.load-label { font-style: italic; font-size: 14px; color: var(--ink-dim); }

@media (max-width: 820px) {
  #rail, #progress { display: none; }
  #grain { opacity: .35; }
  #ghost { font-size: 30vh; right: 4vw; }
  .chapter { left: 6vw; bottom: 26vh; }
  .chapter[data-ch="4"] { top: 13vh; }
  .sub { border-left: none; padding-left: 0; }
  #store { padding: 14px 0 18px; overflow-x: auto; }
  #cards { justify-content: flex-start; padding: 0 6vw; }
  .card { width: 214px; }
  #detail { right: auto; left: 50%; transform: translate(-50%, 12px); bottom: auto; top: 9.5vh;
    width: min(400px, 92vw); max-height: 46vh; overflow-y: auto; }
  #detail.on { transform: translate(-50%, 0); }
  #topbar { padding: 14px 16px; }
  #topbar::after { left: 16px; right: 16px; }
  .brand-seal { width: 34px; height: 34px; font-size: 12px; }
  .brand-text { display: none; }
  .ghost-btn { padding: 8px 13px; }
  #toast { left: 18px; bottom: 18px; right: 18px; max-width: none; }
}
