:root {
  color-scheme: dark;
  --bg: #050505;
  --ink: #f4efe5;
  --muted: #bcb4a6;
  --gold: #d6bd85;
  --line: rgba(214, 189, 133, 0.28);
  --panel: rgba(18, 17, 16, 0.78);
  --cream: #f0ebe1;
  --shadow: rgba(0, 0, 0, 0.55);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at 50% -10%, rgba(238, 229, 207, 0.20), transparent 34rem),
    linear-gradient(180deg, #141311 0%, #050505 54%, #000 100%);
}

button,
input,
select,
textarea {
  font: inherit;
}

a {
  color: inherit;
}

.site-shell {
  min-height: 100vh;
  padding-left: 6.2rem;
}

.shelf {
  position: fixed;
  inset: 0 auto 0 0;
  width: 6.2rem;
  display: grid;
  grid-template-rows: repeat(3, 1fr);
  gap: 1px;
  padding: 1rem 0.8rem;
  background: linear-gradient(180deg, rgba(240,235,225,0.10), rgba(0,0,0,0.42));
  border-right: 1px solid var(--line);
  z-index: 20;
}

.shelf-tier {
  border: 1px solid rgba(214, 189, 133, 0.25);
  background: rgba(18, 17, 16, 0.70);
  color: var(--muted);
  border-radius: 0;
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  cursor: pointer;
}

.shelf-tier span {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.05rem;
}

.shelf-tier small {
  font-size: 0.68rem;
  letter-spacing: 0.18em;
}

.shelf-tier.active,
.shelf-tier:hover {
  color: var(--ink);
  background: linear-gradient(180deg, rgba(214, 189, 133, 0.20), rgba(18, 17, 16, 0.82));
}

.topbar {
  position: fixed;
  top: 0;
  left: 6.2rem;
  right: 0;
  height: 5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2.5rem;
  z-index: 18;
  pointer-events: none;
}

.brand,
.menu-button,
.top-menu {
  pointer-events: auto;
}

.brand {
  display: flex;
  align-items: baseline;
  gap: 1rem;
  text-decoration: none;
  letter-spacing: 0.28em;
  text-transform: uppercase;
}

.brand span {
  font-size: 0.72rem;
  color: var(--muted);
}

.brand strong {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.65rem;
  font-weight: 400;
}

.brand em {
  font-style: normal;
  font-size: 0.78rem;
  font-weight: 800;
  color: var(--ink);
  letter-spacing: 0.16em;
}

.menu-button {
  width: 3rem;
  height: 3rem;
  border: 1px solid var(--line);
  background: rgba(8, 8, 8, 0.64);
  display: grid;
  place-content: center;
  gap: 0.28rem;
  cursor: pointer;
}

.menu-button i {
  display: block;
  width: 1.25rem;
  height: 1px;
  background: var(--ink);
}

.top-menu {
  position: absolute;
  top: 4.2rem;
  right: 2.5rem;
  display: none;
  min-width: 13rem;
  padding: 0.85rem;
  background: rgba(10, 10, 10, 0.92);
  border: 1px solid var(--line);
  box-shadow: 0 24px 80px var(--shadow);
}

.top-menu.open {
  display: grid;
}

.top-menu a {
  padding: 0.72rem 0.8rem;
  color: var(--muted);
  text-decoration: none;
  border-bottom: 1px solid rgba(214, 189, 133, 0.11);
}

.top-menu a:hover {
  color: var(--ink);
}

.room {
  min-height: 100vh;
  position: relative;
  display: grid;
  grid-template-columns: minmax(20rem, 0.72fr) minmax(28rem, 1.28fr);
  align-items: center;
  gap: 2rem;
  padding: 7rem 4rem 4rem;
  overflow: hidden;
}

.room-glow {
  position: absolute;
  inset: auto 10% 10% auto;
  width: 40vw;
  height: 40vw;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(214, 189, 133, 0.14), transparent 65%);
  filter: blur(10px);
}

.room-copy {
  max-width: 31rem;
  position: relative;
  z-index: 2;
}

.eyebrow {
  margin: 0 0 0.8rem;
  color: var(--gold);
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.25em;
  text-transform: uppercase;
}

h1,
h2 {
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 400;
  margin: 0;
}

h1 {
  font-size: clamp(3.1rem, 7vw, 7.6rem);
  line-height: 0.92;
  max-width: 9ch;
}

h2 {
  font-size: clamp(2.2rem, 4vw, 4.8rem);
  line-height: 0.96;
}

.room-copy p:last-child,
.character-text p,
.character-points dd,
.reader-head p,
.cms-panel p,
.legal-panel p {
  color: var(--muted);
  line-height: 1.6;
  font-size: 1rem;
}

.table-scene {
  min-height: 36rem;
  perspective: 1100px;
  position: relative;
}

.back-wall {
  position: absolute;
  inset: 4rem 0 auto;
  height: 20rem;
  border: 1px solid rgba(214, 189, 133, 0.10);
  background:
    linear-gradient(90deg, transparent 49%, rgba(214,189,133,0.13) 50%, transparent 51%),
    radial-gradient(circle at 50% 20%, rgba(240,235,225,0.16), transparent 20rem);
  transform: translateZ(-10rem);
}

.table-top {
  position: absolute;
  left: 4%;
  right: 2%;
  bottom: 8rem;
  height: 17rem;
  border: 1px solid rgba(214, 189, 133, 0.22);
  background:
    linear-gradient(90deg, rgba(255,255,255,0.08), transparent 28%, rgba(255,255,255,0.05) 56%, transparent),
    linear-gradient(145deg, #24211c, #0e0d0c 70%);
  transform: rotateX(64deg) rotateZ(-2deg);
  transform-origin: center bottom;
  box-shadow: 0 4rem 8rem rgba(0,0,0,0.72);
}

.table-edge {
  position: absolute;
  left: 8%;
  right: 7%;
  bottom: 5.3rem;
  height: 3.2rem;
  background: linear-gradient(180deg, #171411, #070606);
  border: 1px solid rgba(214, 189, 133, 0.16);
}

.magazine-deck {
  position: absolute;
  inset: 1.4rem 2rem;
  transform-style: preserve-3d;
}

.magazine {
  --cover: linear-gradient(145deg, #f0ebe1 0%, #b9b2a5 38%, #191817 39%, #070707 100%);
  position: absolute;
  width: 12rem;
  height: 16rem;
  padding: 1.15rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  color: var(--ink);
  background: var(--cover);
  background-size: cover;
  background-position: center;
  border: 1px solid rgba(255,255,255,0.22);
  box-shadow: 0 2rem 3rem rgba(0,0,0,0.50);
  cursor: pointer;
  transform: translate3d(var(--x), var(--y), var(--z)) rotateZ(var(--r));
  transition: transform 220ms ease, filter 220ms ease;
}

.magazine:hover,
.magazine.active {
  filter: brightness(1.08);
  transform: translate3d(var(--x), calc(var(--y) - 1rem), calc(var(--z) + 1rem)) rotateZ(var(--r));
}

.magazine small {
  color: #f0ebe1;
  text-shadow: 0 1px 12px rgba(0,0,0,0.85);
  letter-spacing: 0.24em;
  text-transform: uppercase;
  font-size: 0.58rem;
  font-weight: 800;
}

.magazine strong {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 2rem;
  line-height: 0.95;
  max-width: 7ch;
  color: #f6f1e7;
}

.magazine span {
  font-size: 0.72rem;
  color: #cec7ba;
  line-height: 1.3;
}

.character-panel {
  margin: 0 4rem 4rem;
  padding: 5rem 0 4.4rem;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid rgba(214, 189, 133, 0.18);
  display: grid;
  grid-template-columns: minmax(22rem, 0.9fr) minmax(28rem, 1.1fr);
  gap: 4rem;
}

.character-lead h2 {
  max-width: 11ch;
}

.character-text {
  max-width: 43rem;
}

.character-text p {
  margin: 0;
  font-size: 1.03rem;
}

.character-text p + p {
  margin-top: 1.15rem;
}

.character-points {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  margin: 0;
  background: rgba(214, 189, 133, 0.18);
  border: 1px solid rgba(214, 189, 133, 0.18);
}

.character-points div {
  padding: 1.5rem;
  background: rgba(8, 8, 8, 0.58);
}

.character-points dt {
  margin-bottom: 0.72rem;
  color: var(--gold);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}

.character-points dd {
  margin: 0;
  font-size: 0.94rem;
}

.reader-panel,
.media-panel,
.cms-panel,
.legal-panel {
  margin: 0 4rem 4rem;
  padding: 3rem;
  border: 1px solid var(--line);
  background: var(--panel);
  backdrop-filter: blur(18px);
}

.media-panel {
  display: grid;
  grid-template-columns: minmax(18rem, 0.8fr) minmax(24rem, 1.2fr);
  gap: 2rem;
  align-items: end;
}

.media-panel p:last-child {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.reader-head {
  display: flex;
  justify-content: space-between;
  gap: 2rem;
  align-items: flex-end;
  margin-bottom: 2rem;
}

.reader-actions {
  display: flex;
  border: 1px solid var(--line);
}

.reader-mode {
  border: 0;
  padding: 0.8rem 1rem;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
}

.reader-mode.active {
  color: #111;
  background: var(--gold);
}

.reader-pages.book-mode {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(18rem, 28rem);
  gap: 1.2rem;
  overflow-x: auto;
  padding-bottom: 1rem;
}

.reader-pages.scroll-mode {
  display: grid;
  gap: 1rem;
  max-width: 54rem;
}

.page-card {
  min-height: 24rem;
  padding: 2rem;
  background: linear-gradient(145deg, #efe8da, #bbb19f);
  color: #151412;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  box-shadow: 0 2rem 4rem rgba(0,0,0,0.28);
}

.page-card.image-page {
  min-height: unset;
  padding: 0;
  background: #111;
  justify-content: center;
}

.page-card.image-page img {
  display: block;
  width: 100%;
  height: auto;
  background: #111;
}

.reader-pages.book-mode .image-page {
  max-width: 28rem;
}

.page-card p {
  margin: 0;
}

.page-card .kicker {
  color: #856b35;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}

.page-card h3 {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 2.4rem;
  font-weight: 400;
  line-height: 0.98;
  margin: 0.7rem 0 1rem;
}

.cms-panel {
  display: grid;
  grid-template-columns: minmax(20rem, 1fr) minmax(20rem, 0.9fr);
  gap: 2rem;
}

.cms-panel code {
  color: var(--cream);
  background: rgba(255,255,255,0.08);
  padding: 0.15rem 0.35rem;
}

.cms-form {
  display: grid;
  gap: 1rem;
}

.cms-form label {
  display: grid;
  gap: 0.45rem;
  color: var(--muted);
  font-size: 0.9rem;
}

.cms-form input,
.cms-form select,
.cms-form textarea {
  width: 100%;
  border: 1px solid rgba(214, 189, 133, 0.24);
  background: rgba(255,255,255,0.06);
  color: var(--ink);
  padding: 0.85rem;
}

.cms-form textarea {
  min-height: 6rem;
  resize: vertical;
}

.cms-form button {
  border: 1px solid var(--gold);
  color: #16130c;
  background: var(--gold);
  padding: 0.9rem 1rem;
  cursor: pointer;
  font-weight: 800;
}

.legal-panel {
  margin-bottom: 0;
}

.legal-panel a {
  color: var(--gold);
  text-decoration: none;
}

@media (max-width: 900px) {
  .site-shell {
    padding-left: 0;
    padding-bottom: 4.5rem;
  }

  .shelf {
    inset: auto 0 0 0;
    width: auto;
    height: 4.5rem;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: 1fr;
    padding: 0.6rem;
    border-right: 0;
    border-top: 1px solid var(--line);
  }

  .shelf-tier {
    writing-mode: horizontal-tb;
    transform: none;
    gap: 0.35rem;
  }

  .shelf-tier span {
    font-size: 0.82rem;
  }

  .shelf-tier small {
    display: none;
  }

  .topbar {
    left: 0;
    height: 4.5rem;
    padding: 0 1rem;
  }

  .brand span {
    display: none;
  }

  .top-menu {
    right: 1rem;
  }

  .room {
    grid-template-columns: 1fr;
    padding: 6rem 1rem 2rem;
  }

  .table-scene {
    min-height: 28rem;
  }

  .table-top {
    left: -8%;
    right: -8%;
  }

  .magazine {
    width: 9rem;
    height: 12.5rem;
  }

  .reader-panel,
  .character-panel,
  .media-panel,
  .cms-panel,
  .legal-panel {
    margin: 0 1rem 2rem;
    padding: 1.3rem;
  }

  .character-panel {
    grid-template-columns: 1fr;
    gap: 1.7rem;
  }

  .character-lead h2 {
    max-width: 12ch;
  }

  .character-points {
    grid-template-columns: 1fr;
  }

  .reader-head,
  .media-panel,
  .cms-panel {
    grid-template-columns: 1fr;
    display: grid;
  }

  .reader-pages.book-mode {
    grid-auto-columns: 82vw;
  }
}
