:root {
  --night: #17130f;
  --night-2: #231c18;
  --ink: #f2eadb;
  --paper: #efe2cd;
  --muted: #b5a58e;
  --gold: #c58b47;
  --rust: #9d4f3f;
  --teal: #4f7f79;
  --line: rgba(239, 226, 205, 0.2);
  --shadow: 0 1.4rem 4rem rgba(0, 0, 0, 0.36);
  --serif: "Fraunces", Georgia, serif;
  --sans: "Inter", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--sans);
  color: var(--ink);
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px) 0 0 / 42px 42px,
    radial-gradient(circle at 75% 15%, rgba(197, 139, 71, 0.14), transparent 35rem),
    var(--night);
  line-height: 1.55;
}

body.modal-open { overflow: hidden; }
img { max-width: 100%; display: block; }
button, input, select, textarea { font: inherit; }
.wrap { width: min(1180px, calc(100% - 2.4rem)); margin-inline: auto; }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

h1, h2, h3, p { margin: 0; }
h1, h2, h3 { font-family: var(--serif); font-weight: 500; line-height: 0.98; }
.kicker {
  margin-bottom: 0.65rem;
  font-size: 0.68rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gold);
}

.btn {
  display: inline-flex;
  min-height: 3.1rem;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  padding: 0.78rem 1.15rem;
  border: 1px solid currentColor;
  border-radius: 6px;
  color: inherit;
  background: transparent;
  text-decoration: none;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  transition: transform 180ms ease, color 180ms ease, background-color 180ms ease, border-color 180ms ease;
}
.btn:hover { transform: translateY(-2px); }
.btn-solid {
  color: #17130f;
  border-color: var(--gold);
  background: var(--gold);
}
.btn-line { color: var(--ink); border-color: rgba(239, 226, 205, 0.45); }
.btn-line:hover { border-color: var(--ink); background: rgba(239, 226, 205, 0.08); }

/* Hero */
.hero {
  position: relative;
  min-height: 88svh;
  display: grid;
  align-items: end;
  overflow: clip;
  isolation: isolate;
  padding: clamp(6rem, 11vw, 9rem) 0 clamp(3rem, 6vw, 5rem);
  background: #130f0c;
}
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -3;
  background:
    linear-gradient(90deg, rgba(19, 15, 12, 0.94) 0%, rgba(19, 15, 12, 0.68) 42%, rgba(19, 15, 12, 0.34) 70%, rgba(19, 15, 12, 0.62) 100%),
    linear-gradient(0deg, rgba(19, 15, 12, 0.92) 0%, transparent 38%),
    url("../../assets/demos/books/author-elias.webp") center 34% / cover no-repeat;
}
.hero-grain,
.stage-grain {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.16;
  background-image:
    linear-gradient(0deg, transparent 0 92%, rgba(255, 255, 255, 0.16) 92% 100%),
    radial-gradient(rgba(255, 255, 255, 0.42) 0.55px, transparent 0.9px);
  background-size: 100% 6px, 12px 12px;
  mix-blend-mode: overlay;
}
.hero-glow {
  position: absolute;
  inset: auto -10% -26% 10%;
  height: 46%;
  background: linear-gradient(90deg, rgba(197, 139, 71, 0.24), rgba(79, 127, 121, 0.13), transparent);
  filter: blur(42px);
  pointer-events: none;
}
.hero-inner { position: relative; z-index: 1; }
.hero-kicker {
  font-size: 0.78rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 1rem;
}
.hero-headline {
  max-width: 12ch;
  font-size: clamp(3.6rem, 10vw, 9.3rem);
  letter-spacing: 0;
}
.hero-sub {
  max-width: 42rem;
  margin-top: 1.35rem;
  color: #d8c9b4;
  font-family: var(--serif);
  font-size: clamp(1.12rem, 2vw, 1.55rem);
  line-height: 1.45;
}
.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  margin-top: 2rem;
}
.hero-cue {
  display: inline-flex;
  align-items: center;
  gap: 0.8rem;
  margin-top: clamp(3rem, 10vh, 6rem);
  color: rgba(239, 226, 205, 0.72);
  text-decoration: none;
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}
.hero-cue-line {
  width: min(20vw, 9rem);
  height: 1px;
  background: rgba(239, 226, 205, 0.38);
}

/* Collection */
.collection { position: relative; background: var(--night); }
.collection-rail { height: 520vh; min-height: 240rem; }
.collection-stage {
  position: sticky;
  top: 0;
  min-height: 100svh;
  display: grid;
  place-items: center;
  overflow: hidden;
  background:
    radial-gradient(ellipse at center 40%, rgba(197, 139, 71, 0.13), transparent 32rem),
    linear-gradient(180deg, #19130f 0%, #251c17 50%, #17130f 100%);
}
.stage-spot {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, transparent 0%, rgba(239, 226, 205, 0.075) 50%, transparent 100%),
    radial-gradient(ellipse at 50% 52%, rgba(197, 139, 71, 0.16), transparent 30rem),
    radial-gradient(ellipse at 50% 44%, rgba(239, 226, 205, 0.14), transparent 34rem);
  pointer-events: none;
}
.stage-inner {
  position: relative;
  z-index: 1;
  width: min(1180px, calc(100% - 2.4rem));
  min-height: min(880px, 100svh);
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: clamp(1rem, 2vw, 1.6rem);
  padding: clamp(5rem, 8vw, 7rem) 0 clamp(1.6rem, 4vw, 3rem);
}
.stage-head {
  display: grid;
  justify-items: center;
  text-align: center;
  gap: 0.5rem;
}
.stage-head h2 {
  max-width: 18ch;
  font-size: clamp(2.3rem, 5.5vw, 5.4rem);
  letter-spacing: 0;
}
.wheel-wrap {
  position: relative;
  min-height: clamp(27rem, 58svh, 42rem);
  perspective: 1200px;
}
.wheel {
  position: absolute;
  inset: 0;
  outline: none;
  transform-style: preserve-3d;
  touch-action: pan-y;
  cursor: grab;
}
.wheel.is-dragging { cursor: grabbing; }
.wheel:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 6px;
  border-radius: 12px;
}
.book {
  position: absolute;
  top: 52%;
  left: 50%;
  width: clamp(8.5rem, 15.5vw, 13.4rem);
  list-style: none;
  opacity: var(--book-opacity, 0.44);
  filter: saturate(var(--book-sat, 0.72)) brightness(var(--book-bright, 0.72)) blur(var(--book-blur, 0));
  transform:
    translate(calc(-50% + var(--book-x, 0px)), calc(-50% + var(--book-y, 0px)))
    translateZ(var(--book-tz, 0px))
    rotateY(var(--book-ry, 0deg))
    rotate(var(--book-rot, 0deg))
    scale(var(--book-scale, 0.78));
  transform-origin: 50% 50%;
  z-index: var(--book-z, 1);
  transition: opacity 260ms ease, filter 260ms ease, transform 360ms cubic-bezier(.2,.8,.2,1);
  will-change: transform, opacity, filter;
}
.book.is-active .cover {
  border-color: rgba(197, 139, 71, 0.55);
  box-shadow:
    0 2.2rem 3.8rem rgba(0, 0, 0, 0.6),
    0 0 0 1px rgba(197, 139, 71, 0.45),
    0 0 44px rgba(197, 139, 71, 0.16),
    inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}
.book-btn {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  color: inherit;
  background: transparent;
  cursor: pointer;
}
.book-btn:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 4px;
  border-radius: 6px;
}
.cover {
  position: relative;
  display: grid;
  min-height: clamp(13rem, 24vw, 20rem);
  overflow: hidden;
  border-radius: 4px;
  border: 1px solid rgba(239, 226, 205, 0.24);
  background: #31251d;
  box-shadow: 0 1.3rem 2.6rem rgba(0, 0, 0, 0.45), inset 0 0 0 1px rgba(255,255,255,0.08);
  transition: box-shadow 320ms ease, border-color 320ms ease;
}
.cover::before {
  content: "";
  position: absolute;
  inset: 0.5rem auto 0.5rem 0.52rem;
  width: 0.18rem;
  background: rgba(0, 0, 0, 0.24);
  box-shadow: 1px 0 rgba(255, 255, 255, 0.08);
  z-index: 4;
}
.cv-art,
.cv-grain,
.cv-face { position: absolute; inset: 0; }
.cv-grain {
  opacity: 0.18;
  background-image:
    linear-gradient(0deg, rgba(255,255,255,0.16) 1px, transparent 1px),
    radial-gradient(rgba(255,255,255,0.7) 0.5px, transparent 0.8px);
  background-size: 100% 7px, 10px 10px;
  mix-blend-mode: overlay;
}
.cv-face {
  z-index: 3;
  display: grid;
  align-content: space-between;
  padding: 1rem 1rem 1.1rem 1.18rem;
}
.cv-author,
.cv-genre {
  font-size: clamp(0.48rem, 0.8vw, 0.62rem);
  letter-spacing: 0.16em;
  text-transform: uppercase;
}
.cv-title {
  align-self: center;
  max-width: 9ch;
  font-family: var(--serif);
  font-size: clamp(1.32rem, 2.15vw, 2.05rem);
  line-height: 0.9;
  letter-spacing: 0;
}
.cv-rule {
  align-self: end;
  display: block;
  width: 48%;
  height: 1px;
  background: currentColor;
  opacity: 0.55;
}
.cover--orchard { color: #f7ebd8; background: #353221; }
.cover--orchard .cv-art {
  background:
    radial-gradient(circle at 48% 36%, rgba(255,255,255,0.45) 0 2rem, transparent 2.05rem),
    linear-gradient(110deg, transparent 0 35%, rgba(134, 49, 39, 0.82) 35% 44%, transparent 44%),
    repeating-linear-gradient(90deg, rgba(246,232,206,0.18) 0 1px, transparent 1px 22px),
    linear-gradient(145deg, #263421, #4d4a2b 62%, #8a4b37);
}
.cover--fires { color: #efe7d3; background: #1d2527; }
.cover--fires .cv-art {
  background:
    radial-gradient(circle at 58% 46%, rgba(197,139,71,0.9) 0 0.5rem, transparent 0.55rem),
    conic-gradient(from 25deg at 54% 48%, transparent 0 18%, rgba(197,139,71,0.8) 18% 21%, transparent 21% 42%, rgba(79,127,121,0.8) 42% 45%, transparent 45%),
    linear-gradient(145deg, #172325, #22373b 58%, #8b4437);
}
.cover--meridian { color: #f3e7d2; background: #2a211e; }
.cover--meridian .cv-art {
  background:
    linear-gradient(90deg, transparent 0 26%, rgba(239,226,205,0.18) 26% 28%, transparent 28% 70%, rgba(239,226,205,0.16) 70% 72%, transparent 72%),
    linear-gradient(0deg, transparent 0 48%, rgba(0,0,0,0.38) 48% 52%, transparent 52%),
    radial-gradient(ellipse at 50% 78%, rgba(157,79,63,0.64), transparent 34%),
    #261d1a;
}
.cover--satellites { color: #1f1914; background: #e1caa7; }
.cover--satellites .cv-art {
  background:
    radial-gradient(circle at 38% 38%, #1f1914 0 0.35rem, transparent 0.4rem),
    radial-gradient(circle at 67% 64%, #1f1914 0 0.22rem, transparent 0.27rem),
    linear-gradient(155deg, transparent 0 47%, rgba(31,25,20,0.58) 47% 48%, transparent 48%),
    repeating-linear-gradient(0deg, rgba(31,25,20,0.06) 0 1px, transparent 1px 12px),
    #e0c59c;
}
.cover--bluehour { color: #e8f4f3; background: #0d1b23; }
.cover--bluehour .cv-art {
  background:
    radial-gradient(circle at 72% 32%, rgba(108,176,180,0.82), transparent 4rem),
    linear-gradient(140deg, transparent 0 38%, rgba(79,127,121,0.62) 38% 42%, transparent 42%),
    linear-gradient(180deg, #071015 0%, #102431 48%, #42343b 100%);
}
.cover--saltwater { color: #f7ead8; background: #28443f; }
.cover--saltwater .cv-art {
  background:
    repeating-radial-gradient(ellipse at 50% 82%, rgba(239,226,205,0.2) 0 1px, transparent 1px 11px),
    linear-gradient(180deg, #1c3936 0 55%, #8c6845 55% 100%);
}
.cover--vanishing { color: #f4eadc; background: #201b20; }
.cover--vanishing .cv-art {
  background:
    linear-gradient(90deg, rgba(244,234,220,0.08) 0 12%, transparent 12% 22%, rgba(244,234,220,0.11) 22% 38%, transparent 38%),
    radial-gradient(ellipse at 62% 50%, rgba(157,79,63,0.7), transparent 36%),
    #1d1820;
}
.cover--storms { color: #17130f; background: #d4c4ad; }
.cover--storms .cv-art {
  background:
    radial-gradient(ellipse at 62% 34%, rgba(79,127,121,0.62), transparent 32%),
    radial-gradient(ellipse at 34% 72%, rgba(157,79,63,0.5), transparent 26%),
    repeating-linear-gradient(110deg, rgba(23,19,15,0.16) 0 1px, transparent 1px 18px),
    #d8c3a5;
}

.stage-foot {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 1.2rem;
  align-items: end;
}
.readout { min-height: 5.6rem; }
.readout-genre,
.readout-meta {
  color: var(--muted);
  font-size: 0.75rem;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}
.readout-title {
  margin: 0.15rem 0 0.25rem;
  font-size: clamp(1.8rem, 3.8vw, 4rem);
}
.stage-controls {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.65rem;
  flex-wrap: wrap;
}
.wheel-nav {
  width: 3rem;
  height: 3rem;
  display: grid;
  place-items: center;
  border: 1px solid rgba(239, 226, 205, 0.42);
  border-radius: 50%;
  color: var(--ink);
  background: rgba(239, 226, 205, 0.06);
  cursor: pointer;
}
.wheel-nav:hover { border-color: var(--gold); color: var(--gold); }
.btn:focus-visible,
.wheel-nav:focus-visible,
.stage-open:focus-visible,
.bm-close:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
}
.stage-count {
  min-width: 3.6rem;
  color: var(--muted);
  font-size: 0.8rem;
  text-align: center;
}
.stage-open { border-radius: 6px; }
.stage-hint {
  grid-column: 1 / -1;
  justify-self: end;
  color: rgba(239, 226, 205, 0.42);
  font-size: 0.74rem;
}

/* Author and inquiry */
.author,
.inquiry {
  border-top: 1px solid var(--line);
  padding: clamp(4.5rem, 9vw, 8rem) 0;
}
.author {
  background:
    linear-gradient(180deg, #17130f, #241b16);
}
.author-grid {
  display: grid;
  grid-template-columns: minmax(16rem, 0.72fr) minmax(0, 1.28fr);
  gap: clamp(2rem, 7vw, 7rem);
  align-items: center;
}
.author-portrait {
  margin: 0;
  position: relative;
}
.author-portrait img {
  aspect-ratio: 4 / 5;
  width: 100%;
  object-fit: cover;
  border-radius: 4px;
  box-shadow: var(--shadow);
}
.author-portrait figcaption,
.inquiry-note {
  margin-top: 0.65rem;
  color: var(--muted);
  font-size: 0.78rem;
}
.author-copy h2,
.inquiry-copy h2 {
  max-width: 12ch;
  margin-bottom: 1.3rem;
  font-size: clamp(2.3rem, 5vw, 5.4rem);
}
.author-copy p {
  max-width: 42rem;
  color: #d3c4af;
  font-size: 1.02rem;
}
.author-copy p + p { margin-top: 1rem; }
.author-facts {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  padding: 0;
  margin: 2rem 0 0;
  background: rgba(239, 226, 205, 0.18);
}
.author-facts li {
  display: grid;
  gap: 0.2rem;
  padding: 1rem;
  background: #211915;
}
.author-facts b {
  font-family: var(--serif);
  color: var(--gold);
  font-size: 2rem;
  line-height: 1;
}
.author-facts span { color: var(--muted); font-size: 0.78rem; }

.inquiry {
  background: var(--paper);
  color: #241b16;
}
.inquiry .kicker { color: var(--rust); }
.inquiry-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.72fr) minmax(0, 1.28fr);
  gap: clamp(2rem, 7vw, 7rem);
}
.inquiry-copy p:not(.kicker) { max-width: 34rem; color: #5f5144; }
.inq-form {
  display: grid;
  gap: 1rem;
  padding: clamp(1.1rem, 3vw, 2rem);
  border: 1px solid rgba(36, 27, 22, 0.22);
  border-radius: 6px;
  background: rgba(255, 251, 243, 0.54);
}
.f-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}
.inq-form label {
  display: grid;
  gap: 0.36rem;
  color: #6a5748;
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}
.inq-form input,
.inq-form select,
.inq-form textarea {
  width: 100%;
  min-width: 0;
  border: 1px solid rgba(36, 27, 22, 0.28);
  border-radius: 4px;
  background: #fbf4e8;
  color: #241b16;
  padding: 0.78rem 0.85rem;
  text-transform: none;
  letter-spacing: 0;
}
.inq-form textarea { resize: vertical; }
.inq-form input:focus,
.inq-form select:focus,
.inq-form textarea:focus {
  outline: 2px solid rgba(197, 139, 71, 0.34);
  outline-offset: 2px;
}
.form-note { color: #6a5748; font-size: 0.82rem; }

/* Modal */
.book-modal[hidden] { display: none; }
.book-modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 1.2rem;
}
.bm-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(12, 9, 7, 0.74);
  backdrop-filter: blur(10px);
}
.bm-panel {
  position: relative;
  z-index: 1;
  width: min(880px, 100%);
  max-height: min(720px, calc(100svh - 2.4rem));
  overflow: auto;
  display: grid;
  grid-template-columns: minmax(12rem, 0.72fr) minmax(0, 1.28fr);
  gap: clamp(1.2rem, 3vw, 2.2rem);
  padding: clamp(1.1rem, 3vw, 2rem);
  border: 1px solid rgba(239, 226, 205, 0.24);
  border-radius: 8px;
  background: #241b16;
  box-shadow: var(--shadow);
}
.bm-close {
  position: absolute;
  top: 0.6rem;
  right: 0.6rem;
  width: 2.4rem;
  height: 2.4rem;
  border: 1px solid rgba(239, 226, 205, 0.35);
  border-radius: 50%;
  color: var(--ink);
  background: rgba(239, 226, 205, 0.06);
  cursor: pointer;
  font-size: 1.35rem;
  line-height: 1;
}
.bm-cover .cover { min-height: clamp(18rem, 44vw, 28rem); }
.bm-info {
  align-self: center;
  padding-right: 1.3rem;
}
.bm-genre,
.bm-meta {
  color: var(--gold);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.bm-title {
  margin: 0.5rem 0 1rem;
  font-size: clamp(2.4rem, 6vw, 5rem);
}
.bm-synopsis {
  color: #d6c7b3;
  max-width: 33rem;
}
.bm-excerpt {
  margin: 1.2rem 0 0;
  padding: 1rem 1.1rem;
  border-left: 2px solid var(--gold);
  color: #eadcc9;
  background: rgba(239, 226, 205, 0.05);
}
.bm-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.4rem;
}

.biz-foot {
  padding: 2.4rem 0;
  border-top: 1px solid var(--line);
  background: #17130f;
  color: var(--muted);
  text-align: center;
}
.biz-name {
  color: var(--ink);
  font-family: var(--serif);
  font-size: 1.25rem;
}

@media (max-width: 900px) {
  .collection-rail { height: 430vh; min-height: 190rem; }
  .stage-inner { min-height: 100svh; padding-top: 5rem; }
  .stage-head,
  .stage-foot,
  .author-grid,
  .inquiry-grid,
  .bm-panel {
    grid-template-columns: 1fr;
  }
  .stage-foot { align-items: start; }
  .stage-controls { justify-content: flex-start; }
  .stage-hint { justify-self: start; }
  .author-portrait { max-width: 28rem; }
  .bm-info { padding-right: 0; }
}

@media (max-width: 620px) {
  .wrap,
  .stage-inner { width: min(100% - 1.3rem, 1180px); }
  .hero { min-height: 84svh; padding-top: 5rem; }
  .hero::before {
    background:
      linear-gradient(0deg, rgba(19, 15, 12, 0.96) 0%, rgba(19, 15, 12, 0.62) 54%, rgba(19, 15, 12, 0.45) 100%),
      url("../../assets/demos/books/author-elias.webp") center top / cover no-repeat;
  }
  .hero-headline { font-size: clamp(3rem, 16vw, 5.5rem); max-width: 10ch; }
  .hero-actions .btn { width: 100%; }
  .hero-cue { gap: 0.55rem; }
  .stage-inner { gap: 0.4rem; }
  .stage-head h2 { font-size: clamp(2rem, 13vw, 4rem); }
  .wheel-wrap { min-height: 24rem; }
  .wheel { --wheel-radius: clamp(8.8rem, 42vw, 13rem); }
  .book { width: clamp(7.2rem, 32vw, 9.5rem); top: 52%; }
  .cover { min-height: clamp(11rem, 50vw, 14rem); }
  .cv-face { padding: 0.78rem 0.78rem 0.86rem 0.95rem; }
  .cv-title { font-size: clamp(1.06rem, 5.2vw, 1.5rem); }
  .stage-count { order: -1; width: 100%; text-align: left; }
  .stage-open { width: 100%; }
  .author-facts,
  .f-row { grid-template-columns: 1fr; }
  .bm-panel { padding-top: 3.5rem; }
  .bm-cover { max-width: 14rem; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.001ms !important;
  }
  .collection-rail {
    height: auto;
    min-height: 0;
  }
  .collection-stage {
    position: relative;
    min-height: auto;
    padding: 4rem 0;
  }
}
