/* ============================================================
   The Nowhere Bookshop — foundations
   ============================================================ */

*, *::before, *::after { box-sizing: border-box; }

:root {
  /* type */
  --font-display: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --font-body: Charter, Georgia, Cambria, "Times New Roman", serif;
  --font-ui: Optima, Candara, "Gill Sans", "Segoe UI", system-ui, -apple-system, sans-serif;
  --font-mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  /* shop chrome — warm, lamplit, constant across rooms */
  --ink: #f2e6d2;
  --ink-dim: #bda98c;
  --ink-faint: #8b7a63;
  --paper: #efe3cd;
  --brass: #d9a44f;
  --brass-soft: #b98b3f;
  --night: #150f0d;
  --shadow: 0 24px 60px -18px rgba(0,0,0,.85);

  /* The room-theme defaults (--wall, --floor, --wood, --glow, --accent,
     --haze, --lamp-size) and the CSS-3D world box (--world-w/h, --fit)
     lived here until phase 10. Every one of them existed for scene.css
     and themes.css, which are gone: a room's palette now goes straight
     from rooms.js's `pal` into three.js materials and canvas textures,
     with no CSS custom property in between. Phase 8's rule — a rule that
     matches nothing is the thing that actually rots, because the next
     person to read it believes it still does something. (--oxblood and
     --night-2 went with them; both had already been unused for longer
     than this phase.) */

  --ease: cubic-bezier(.22,.61,.36,1);
  --ease-in-out: cubic-bezier(.65,.05,.36,1);
}

html, body {
  height: 100%;
  margin: 0;
}

body {
  background: var(--night);
  color: var(--ink);
  font-family: var(--font-body);
  overflow: hidden;
  overscroll-behavior: none;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
a { color: inherit; }
input { font: inherit; }
svg { fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
[hidden] { display: none !important; }

::selection { background: var(--brass); color: #1a1210; }

:focus-visible {
  outline: 2px solid var(--brass);
  outline-offset: 3px;
  border-radius: 3px;
}

/* thin, warm scrollbars inside panels */
.scroll { scrollbar-width: thin; scrollbar-color: rgba(217,164,79,.42) transparent; }
.scroll::-webkit-scrollbar { width: 9px; height: 9px; }
.scroll::-webkit-scrollbar-track { background: transparent; }
.scroll::-webkit-scrollbar-thumb {
  background: rgba(217,164,79,.34);
  border-radius: 99px;
  border: 2px solid transparent;
  background-clip: padding-box;
}
.scroll::-webkit-scrollbar-thumb:hover { background: rgba(217,164,79,.6); background-clip: padding-box; }

/* ─── The door ─────────────────────────────────────────────── */

.door {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: grid;
  place-items: center;
  padding: 6vh 6vw;
  background:
    radial-gradient(120% 90% at 50% 108%, rgba(255,176,88,.24), transparent 62%),
    radial-gradient(80% 60% at 50% -10%, rgba(120,150,170,.10), transparent 70%),
    linear-gradient(#0d0a09, #191110 55%, #0c0808);
  text-align: center;
  transition: opacity .9s var(--ease), transform 1.1s var(--ease), filter .9s var(--ease);
}
.door.is-open {
  opacity: 0;
  transform: scale(1.35);
  filter: blur(6px);
  pointer-events: none;
}

.door__inner { position: relative; z-index: 2; max-width: 40rem; }

.door__eyebrow {
  font-family: var(--font-ui);
  font-size: .72rem;
  letter-spacing: .42em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin: 0 0 1.6rem;
}

.door__title {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(2.9rem, 9vw, 5.4rem);
  line-height: .95;
  margin: 0 0 1.4rem;
  color: var(--paper);
  text-shadow: 0 0 60px rgba(255,190,120,.28), 0 2px 0 rgba(0,0,0,.5);
}
.door__title em {
  font-style: italic;
  color: var(--brass);
  text-shadow: 0 0 70px rgba(255,180,90,.5);
}

.door__blurb {
  font-size: clamp(1rem, 2.1vw, 1.16rem);
  line-height: 1.7;
  color: var(--ink-dim);
  margin: 0 0 2.6rem;
}

.door__btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: .8rem;
  padding: 1rem 2.2rem;
  font-family: var(--font-ui);
  font-size: 1rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: #1c1310;
  background: linear-gradient(180deg, #f0c274, var(--brass) 60%, #a97a34);
  border-radius: 999px;
  box-shadow: 0 0 0 1px rgba(255,220,160,.35) inset, 0 14px 40px -12px rgba(255,170,80,.55), 0 3px 0 #7d5722;
  transition: transform .2s var(--ease), box-shadow .3s var(--ease);
}
.door__btn:hover { transform: translateY(-2px); box-shadow: 0 0 0 1px rgba(255,230,180,.5) inset, 0 20px 50px -12px rgba(255,180,90,.7), 0 5px 0 #7d5722; }
.door__btn:active { transform: translateY(1px); box-shadow: 0 0 0 1px rgba(255,220,160,.35) inset, 0 8px 24px -10px rgba(255,170,80,.5), 0 1px 0 #7d5722; }
.door__bell { font-size: 1.05rem; filter: saturate(.6); }

.door__meta {
  margin: 2.4rem 0 0;
  font-family: var(--font-ui);
  font-size: .78rem;
  letter-spacing: .06em;
  color: var(--ink-faint);
}

.door__rain {
  position: absolute;
  inset: 0;
  opacity: .5;
  background-image:
    repeating-linear-gradient(76deg, transparent 0 22px, rgba(190,215,235,.10) 22px 23px, transparent 23px 46px),
    repeating-linear-gradient(74deg, transparent 0 39px, rgba(190,215,235,.06) 39px 40px, transparent 40px 78px);
  animation: rainfall 1.1s linear infinite;
  mask-image: radial-gradient(120% 100% at 50% 0%, #000 30%, transparent 85%);
}
@keyframes rainfall { to { background-position: 220px 900px, -160px 900px; } }

/* ─── Shop root ────────────────────────────────────────────── */

.shop {
  position: fixed;
  inset: 0;
  opacity: 0;
  transition: opacity 1.2s var(--ease);
}
.shop.is-in { opacity: 1; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .12s !important;
  }
  .door__rain { display: none; }
}
