:root {
  color-scheme: dark;
  font-family: "Arial Narrow", "Helvetica Neue", "Aptos", sans-serif;
  --bg: #050505;
  --bg-soft: #0d0d0d;
  --text: #f1eee8;
  --muted: #b8b1a5;
  --muted-soft: #7e7a73;
  --paper: #f1ede3;
  --paper-deep: #e5dece;
  --board: #171615;
  --board-deep: #080808;
  --board-edge: #2a2926;
  --shadow: rgba(0, 0, 0, 0.52);
  --gutter: 0px;
  --bleed-overlap: 0px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  min-height: 100dvh;
  background:
    radial-gradient(circle at 18% 12%, rgba(255, 255, 255, 0.03), transparent 18%),
    linear-gradient(180deg, #020202 0%, #070707 45%, #030303 100%);
}

body {
  color: var(--text);
}

button {
  font: inherit;
}

.hidden {
  display: none !important;
}

.page-shell {
  position: relative;
  display: grid;
  min-height: 100vh;
  min-height: 100dvh;
  place-items: center;
  padding: 24px;
  overflow: hidden;
}

.page-shell::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.015) 0, rgba(255, 255, 255, 0.015) 1px, transparent 1px, transparent 96px),
    linear-gradient(180deg, rgba(255, 255, 255, 0.01), transparent 22%, transparent 78%, rgba(0, 0, 0, 0.22));
  opacity: 0.1;
  pointer-events: none;
}

.hero-screen,
.book-shell {
  position: relative;
  width: min(1280px, 100%);
}

.hero-screen {
  min-height: 84vh;
  min-height: 84dvh;
  padding: clamp(28px, 4vw, 52px);
  border-radius: 38px;
  background:
    radial-gradient(circle at 82% 22%, rgba(255, 255, 255, 0.04), transparent 24%),
    linear-gradient(145deg, rgba(10, 10, 10, 0.98), rgba(4, 4, 4, 0.96));
  border: 1px solid rgba(255, 255, 255, 0.04);
  box-shadow: 0 40px 120px rgba(0, 0, 0, 0.46);
  overflow: hidden;
}

.hero-screen::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 26%;
  background: linear-gradient(180deg, transparent, rgba(0, 0, 0, 0.18));
  pointer-events: none;
}

.hero-scene {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 0.9fr);
  gap: clamp(28px, 5vw, 64px);
  align-items: center;
  min-height: 100%;
  z-index: 1;
}

.hero-copy {
  max-width: 700px;
}

.eyebrow {
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.22em;
  font-size: 0.72rem;
  color: var(--muted-soft);
}

h1,
h2,
.book-title strong {
  font-family: "Arial Narrow", "Helvetica Neue", "Aptos", sans-serif;
  font-weight: 800;
  text-transform: uppercase;
}

h1 {
  margin: 18px 0 0;
  font-size: clamp(3.6rem, 5.2vw, 6.8rem);
  line-height: 0.9;
  letter-spacing: -0.06em;
  max-width: 9ch;
}

.subtitle {
  margin: 24px 0 0;
  max-width: 26rem;
  color: var(--muted);
  line-height: 1.65;
  font-size: 0.96rem;
}

.hero-actions {
  margin-top: 34px;
}

.hero-preview {
  position: relative;
  min-height: 460px;
  display: grid;
  place-items: center;
}

.closed-book-shadow {
  position: absolute;
  width: min(420px, 82%);
  aspect-ratio: 1.08;
  background: radial-gradient(circle, rgba(0, 0, 0, 0.44), transparent 68%);
  filter: blur(22px);
  transform: translateY(24px);
}

.closed-book {
  position: relative;
  width: min(400px, 84%);
  aspect-ratio: 0.8;
  transform: rotate(-12deg) translateY(8px);
  transform-style: preserve-3d;
}

.closed-book::before {
  content: "";
  position: absolute;
  inset: 10px -10px -10px 18px;
  border-radius: 22px;
  background: linear-gradient(145deg, rgba(17, 14, 12, 0.96), rgba(0, 0, 0, 0.84));
  transform: translateZ(-24px);
}

.closed-book-spine {
  position: absolute;
  inset: 3% auto 3% -4%;
  width: 14%;
  border-radius: 18px 8px 8px 18px;
  background: linear-gradient(180deg, #7a624f 0%, #3b2c22 36%, #1b140f 100%);
  box-shadow: inset -2px 0 0 rgba(255, 255, 255, 0.08), inset 2px 0 0 rgba(0, 0, 0, 0.22);
}

.closed-book-cover {
  position: absolute;
  inset: 0;
  border-radius: 20px;
  overflow: hidden;
  background: #050505;
  border: 1px solid rgba(255, 255, 255, 0.05);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.04),
    inset 0 -14px 26px rgba(0, 0, 0, 0.28),
    0 32px 48px rgba(0, 0, 0, 0.28);
}

.closed-book-cover > img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
  padding: 126px 62px 40px;
  filter: saturate(0.88) contrast(1.02) brightness(0.82);
  background: #050505;
}

.closed-book-cover .cover-image-frame {
  left: 18%;
  right: 18%;
  top: 42%;
  bottom: 14%;
  border-width: 4px;
}

.closed-book-cover .cover-tape {
  left: 18%;
  right: 18%;
  top: 34px;
}

.closed-book-cover .cover-tape-title {
  font-size: clamp(1rem, 1.15vw, 1.42rem);
  line-height: 0.88;
  letter-spacing: -0.06em;
  max-width: 7ch;
}

.closed-book-cover .cover-tape-note {
  margin-top: 6px;
  font-size: 0.38rem;
  letter-spacing: 0.14em;
  line-height: 1.15;
  max-width: none;
  white-space: nowrap;
}

.closed-book-cover .cover-spine-note {
  left: 14px;
  bottom: 18px;
  font-size: 0.52rem;
}

.book-shell {
  display: grid;
  gap: 28px;
}

.book-meta {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
}

.book-title {
  display: grid;
  gap: 0.3rem;
}

.book-title span {
  color: var(--muted-soft);
  letter-spacing: 0.22em;
  text-transform: uppercase;
  font-size: 0.72rem;
}

.book-title strong {
  font-size: clamp(1.8rem, 2.7vw, 2.8rem);
  line-height: 0.92;
  letter-spacing: -0.05em;
}

.book-progress {
  color: var(--muted-soft);
  font-variant-numeric: tabular-nums;
}

.book-stage {
  position: relative;
  padding: clamp(8px, 2vw, 24px) 0;
}

.book-drop-shadow {
  position: absolute;
  inset: auto 6% -5% 6%;
  height: 22%;
  background: radial-gradient(circle, rgba(0, 0, 0, 0.45), transparent 64%);
  filter: blur(34px);
}

.book {
  position: relative;
  width: min(1180px, 100%);
  margin: 0 auto;
  aspect-ratio: 1.58;
  perspective: 2800px;
}

.book-board {
  position: absolute;
  inset: 0;
  padding: clamp(14px, 1.6vw, 22px);
  border-radius: 34px;
  background:
    radial-gradient(circle at top left, rgba(255, 255, 255, 0.04), transparent 20%),
    linear-gradient(135deg, #151515 0%, #090909 34%, #1a1a1a 100%);
  border: 1px solid rgba(255, 255, 255, 0.04);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    inset 0 -26px 34px rgba(0, 0, 0, 0.22),
    0 42px 74px rgba(0, 0, 0, 0.34);
  transform: rotateX(7deg);
  transform-style: preserve-3d;
}

.book-board::before {
  content: "";
  position: absolute;
  inset: 10px;
  border-radius: 28px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.04);
  pointer-events: none;
}

.page-bed {
  position: relative;
  height: 100%;
  transform-style: preserve-3d;
}

.page-stack {
  position: absolute;
  top: 24px;
  bottom: 24px;
  width: calc(50% - (var(--gutter) / 2));
  pointer-events: none;
  border-radius: 16px;
  background:
    repeating-linear-gradient(
      180deg,
      rgba(244, 238, 225, 0.48) 0,
      rgba(244, 238, 225, 0.48) 2px,
      rgba(228, 220, 201, 0.62) 2px,
      rgba(228, 220, 201, 0.62) 4px
    );
  filter: saturate(0.72);
  opacity: 0.78;
}

.page-stack-left {
  left: 0;
  transform: translate(-6px, 6px) rotate(-0.25deg);
  box-shadow: -10px 12px 20px rgba(0, 0, 0, 0.12);
}

.page-stack-right {
  right: 0;
  transform: translate(6px, 6px) rotate(0.25deg);
  box-shadow: 10px 12px 20px rgba(0, 0, 0, 0.12);
}

.spine-glow {
  position: absolute;
  top: 18px;
  bottom: 18px;
  left: 50%;
  width: 8px;
  transform: translateX(-50%);
  border-radius: 999px;
  background:
    linear-gradient(90deg, rgba(0, 0, 0, 0.14), rgba(255, 255, 255, 0.04), rgba(0, 0, 0, 0.16));
  filter: blur(2px);
  opacity: 0.26;
  z-index: 1;
}

.spine-glow::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 1px;
  transform: translateX(-50%);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.1), rgba(0, 0, 0, 0.18), rgba(255, 255, 255, 0.08));
  opacity: 0.55;
}

.page,
.sheet-face {
  position: absolute;
  overflow: hidden;
  background:
    linear-gradient(180deg, #f8f1e4 0%, #f0e5d3 100%);
  border: 1px solid rgba(62, 48, 38, 0.08);
  box-shadow:
    0 18px 34px rgba(0, 0, 0, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.6);
  will-change: transform;
  backface-visibility: hidden;
  transform: translateZ(0);
}

.page::before,
.sheet-face::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.14), transparent 16%, transparent 84%, rgba(0, 0, 0, 0.05)),
    radial-gradient(circle at 20% 0%, rgba(255, 255, 255, 0.26), transparent 24%);
  pointer-events: none;
  z-index: 3;
}

.page[data-side="left"]::after,
.sheet-face[data-side="left"]::after,
.page[data-side="right"]::after,
.sheet-face[data-side="right"]::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 3;
}

.page[data-side="left"]::after,
.sheet-face[data-side="left"]::after {
  background: linear-gradient(90deg, transparent 88%, rgba(73, 55, 39, 0.05) 96%, rgba(23, 17, 12, 0.08) 100%);
}

.page[data-side="right"]::after,
.sheet-face[data-side="right"]::after {
  background: linear-gradient(270deg, transparent 88%, rgba(73, 55, 39, 0.05) 96%, rgba(23, 17, 12, 0.08) 100%);
}

.page[data-bleed="true"]::before,
.sheet-face[data-bleed="true"]::before,
.page[data-bleed="true"]::after,
.sheet-face[data-bleed="true"]::after {
  opacity: 0;
}

.page[data-kind="image"]::before,
.sheet-face[data-kind="image"]::before,
.page[data-kind="image"]::after,
.sheet-face[data-kind="image"]::after {
  opacity: 0;
}

.page {
  top: 18px;
  bottom: 18px;
  width: calc(50% - (var(--gutter) / 2));
  z-index: 2;
}

.page-left {
  left: 0;
  border-radius: 18px 10px 10px 18px;
  cursor: w-resize;
}

.page-right {
  right: 0;
  border-radius: 10px 18px 18px 10px;
  cursor: e-resize;
}

.page-content {
  position: absolute;
  inset: 0;
}

.page-content-image {
  padding: clamp(7px, 0.9vw, 12px);
}

.page-content-image.is-bleed {
  padding: 3px 0;
}

.page-media {
  position: relative;
  width: 100%;
  height: 100%;
  margin: 0;
  border-radius: 10px;
  overflow: hidden;
  background: linear-gradient(180deg, rgba(249, 245, 236, 0.96), rgba(239, 233, 221, 0.98));
  box-shadow:
    inset 0 0 0 1px rgba(87, 69, 49, 0.05),
    0 6px 12px rgba(47, 34, 21, 0.05);
}

.page-media img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
}

.page-media.is-bleed {
  border-radius: 0;
  box-shadow: none;
}

.page[data-side="left"] .page-content-image.is-bleed {
  padding-left: 3px;
  padding-right: 0;
}

.page[data-side="right"] .page-content-image.is-bleed {
  padding-left: 0;
  padding-right: 3px;
}

.page[data-side="left"] .page-media.is-bleed {
  width: 100%;
  margin-right: 0;
}

.page[data-side="right"] .page-media.is-bleed {
  width: 100%;
  margin-left: 0;
}

.page[data-bleed="true"],
.sheet-face[data-bleed="true"] {
  border-color: transparent;
}

.page[data-bleed="true"][data-side="left"],
.sheet-face[data-bleed="true"][data-side="left"] {
  border-right-color: transparent;
  border-radius: 18px 0 0 18px;
}

.page[data-bleed="true"][data-side="right"],
.sheet-face[data-bleed="true"][data-side="right"] {
  border-left-color: transparent;
  border-radius: 0 18px 18px 0;
}

.page-media.is-bleed img {
  width: 200%;
  max-width: none;
  object-fit: cover;
}

.page-media.is-bleed.bleed-right img {
  transform: translateX(-50%);
}

.book[data-spread-bleed="true"] .spine-glow {
  width: 4px;
  opacity: 0.08;
}

.book[data-spread-bleed="true"] .spine-glow::after {
  opacity: 0.14;
}

.page-content-blank {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.18), transparent 18%),
    linear-gradient(180deg, #f5edde 0%, #efe3d1 100%);
}

.page-content-title,
.page-content-endpaper,
.page-content-frontmatter {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(24px, 3vw, 40px);
}

.page-content-endpaper {
  background:
    linear-gradient(145deg, #2d241d 0%, #16110e 100%);
  color: rgba(244, 239, 228, 0.9);
}

.page-content-frontmatter {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.2), transparent 20%),
    linear-gradient(180deg, #f4ebdb 0%, #e9deca 100%);
}

.page-content-frontmatter .page-copy {
  gap: 12px;
  max-width: 22rem;
}

.page-content-frontmatter .page-copy h2 {
  font-size: clamp(1.6rem, 2.3vw, 2.3rem);
}

.page-content-frontmatter .page-copy p {
  color: rgba(72, 54, 39, 0.8);
}

.page-content-cover {
  padding: 14px;
  background:
    linear-gradient(145deg, #090909 0%, #020202 100%);
}

.page-content-insidecover {
  padding: 8px;
  background:
    radial-gradient(circle at top left, rgba(255, 255, 255, 0.06), transparent 28%),
    linear-gradient(145deg, #36281f 0%, #17110d 100%);
}

.page[data-kind="cover"],
.sheet-face[data-kind="cover"],
.page[data-kind="insidecover"],
.sheet-face[data-kind="insidecover"] {
  background:
    radial-gradient(circle at top left, rgba(255, 255, 255, 0.05), transparent 20%),
    linear-gradient(145deg, #141414 0%, #060606 100%);
  border-color: rgba(255, 255, 255, 0.04);
  box-shadow:
    0 20px 34px rgba(0, 0, 0, 0.22),
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    inset 0 -18px 24px rgba(0, 0, 0, 0.18);
}

.page[data-kind="insidecover"]::before,
.sheet-face[data-kind="insidecover"]::before,
.page[data-kind="cover"]::before,
.sheet-face[data-kind="cover"]::before {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.08), transparent 16%, transparent 84%, rgba(0, 0, 0, 0.08)),
    radial-gradient(circle at 14% 0%, rgba(255, 255, 255, 0.12), transparent 24%);
}

.inside-cover-board {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: 12px 8px 8px 12px;
  background:
    radial-gradient(circle at top left, rgba(255, 255, 255, 0.04), transparent 24%),
    linear-gradient(145deg, #231a14 0%, #110d0a 100%);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.04),
    inset 0 -18px 28px rgba(0, 0, 0, 0.2);
}

.inside-cover-board::before {
  content: "";
  position: absolute;
  inset: 18px;
  border-radius: 8px 4px 4px 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.03), transparent 18%),
    linear-gradient(145deg, rgba(137, 109, 84, 0.18), rgba(29, 20, 15, 0.08));
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.03);
}

.cover-frame {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: 8px 16px 16px 8px;
  overflow: hidden;
  background: #050505;
  border: 1px solid rgba(255, 255, 255, 0.04);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.04),
    0 18px 26px rgba(0, 0, 0, 0.24);
}

.cover-frame img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
  padding: 98px 44px 28px;
  filter: saturate(0.88) contrast(1.02) brightness(0.82);
  background: #050505;
}

.cover-frame::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.02), transparent 18%, transparent 76%, rgba(0, 0, 0, 0.28)),
    linear-gradient(90deg, rgba(0, 0, 0, 0.1), transparent 20%, transparent 80%, rgba(0, 0, 0, 0.18));
  pointer-events: none;
}

.cover-grid {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(transparent 95%, rgba(255, 255, 255, 0.06) 95%),
    linear-gradient(90deg, transparent 95%, rgba(255, 255, 255, 0.04) 95%);
  background-size: 100% 42px, 36px 100%;
  opacity: 0.05;
  mix-blend-mode: normal;
  pointer-events: none;
}

.cover-vignette {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 38%, transparent 0%, transparent 46%, rgba(0, 0, 0, 0.2) 100%);
  pointer-events: none;
}

.cover-tape {
  position: absolute;
  left: 12%;
  right: 12%;
  top: 28px;
  padding: 0;
  background: none;
  color: #f7f3ec;
  transform: none;
  box-shadow: none;
}

.cover-tape::before,
.cover-tape::after {
  display: none;
}

.cover-tape-title {
  display: block;
  font-family: "Arial Narrow", "Helvetica Neue", "Aptos", sans-serif;
  font-size: clamp(2rem, 2.7vw, 2.9rem);
  line-height: 0.88;
  font-weight: 800;
  letter-spacing: -0.07em;
  text-transform: uppercase;
  max-width: 9ch;
}

.cover-tape-note {
  display: block;
  margin-top: 8px;
  font-size: 0.58rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  opacity: 0.74;
  line-height: 1.1;
  white-space: nowrap;
}

.cover-image-frame {
  position: absolute;
  left: 12%;
  right: 12%;
  top: 31%;
  bottom: 12%;
  border: 6px solid #f2efe8;
  pointer-events: none;
  opacity: 0.96;
}

.cover-spine-note {
  position: absolute;
  left: 18px;
  bottom: 24px;
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-size: 0.62rem;
  color: rgba(255, 245, 223, 0.46);
}

.cover-hinge-shadow {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 18px;
  background: linear-gradient(90deg, rgba(0, 0, 0, 0.34), rgba(0, 0, 0, 0.1), transparent);
  pointer-events: none;
}

.book.is-closed-cover .page-left,
.book.is-closed-cover .page-stack-left,
.book.is-closed-cover .spine-glow {
  opacity: 0;
  pointer-events: none;
}

.book.is-closed-cover .book-board {
  background: transparent;
  border-color: transparent;
  box-shadow: none;
}

.book.is-closed-cover .book-board::before {
  opacity: 0;
}

.book.is-closed-cover .page-stack-right {
  left: 50%;
  right: auto;
  transform: translateX(-50%) translate(6px, 6px) rotate(0.25deg);
}

.book.is-closed-cover .page-right {
  left: 50%;
  right: auto;
  transform: translateX(-50%);
  border-radius: 10px 16px 16px 10px;
  box-shadow:
    0 22px 36px rgba(0, 0, 0, 0.24),
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    inset 0 -18px 28px rgba(0, 0, 0, 0.16);
}

.book.is-opening-cover .page-left,
.book.is-opening-cover .spine-glow,
.book.is-opening-cover .page-stack-left {
  opacity: 1;
}

.page-copy {
  position: relative;
  z-index: 2;
  display: grid;
  gap: 16px;
  max-width: 28rem;
}

.page-copy .eyebrow {
  color: inherit;
  opacity: 0.58;
}

.page-copy h2 {
  margin: 0;
  font-size: clamp(2rem, 3vw, 3.2rem);
  line-height: 0.96;
  letter-spacing: -0.04em;
}

.page-copy p {
  margin: 0;
  line-height: 1.75;
  color: rgba(60, 44, 30, 0.82);
}

.page-content-endpaper .page-copy p {
  color: rgba(244, 239, 228, 0.72);
}

.page-copy-overlay {
  position: absolute;
  left: clamp(20px, 3vw, 34px);
  bottom: clamp(22px, 3.2vw, 40px);
  z-index: 4;
  max-width: min(56%, 22rem);
  gap: 10px;
  color: #f4f1eb;
  text-shadow:
    0 1px 2px rgba(0, 0, 0, 0.6),
    0 6px 24px rgba(0, 0, 0, 0.65);
}

.page-copy-overlay::before {
  content: "";
  position: absolute;
  inset: -40px -32px -28px -26px;
  background:
    radial-gradient(circle at 22% 100%, rgba(0, 0, 0, 0.68), transparent 64%),
    linear-gradient(0deg, rgba(0, 0, 0, 0.58), rgba(0, 0, 0, 0.22) 52%, transparent 100%);
  border-radius: 24px;
  z-index: -1;
  pointer-events: none;
}

.page-copy-overlay h2 {
  font-size: clamp(1.5rem, 2.2vw, 2.25rem);
  line-height: 0.96;
}

.page-copy-overlay p {
  color: rgba(244, 241, 235, 0.92);
  line-height: 1.55;
  white-space: pre-line;
  max-width: 21rem;
}

.flip-sheet {
  position: absolute;
  top: 18px;
  bottom: 18px;
  width: calc(50% - (var(--gutter) / 2));
  transform-style: preserve-3d;
  z-index: 5;
  pointer-events: none;
  will-change: transform;
  backface-visibility: hidden;
}

.flip-sheet.is-next {
  right: 0;
  transform-origin: left center;
}

.flip-sheet.is-prev {
  left: 0;
  transform-origin: right center;
}

.flip-sheet::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(0, 0, 0, 0.12), transparent 24%, transparent 74%, rgba(255, 255, 255, 0.05));
  opacity: 0.18;
  mix-blend-mode: multiply;
  pointer-events: none;
  z-index: 6;
}

.sheet-face {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
}

.sheet-front {
  transform: rotateY(0deg);
}

.sheet-back {
  transform: rotateY(180deg);
}

.book.is-turning-next .page-right,
.book.is-turning-prev .page-left {
  box-shadow: inset 0 0 14px rgba(0, 0, 0, 0.04);
}

.flip-sheet.animate-next {
  animation: turnNext 1320ms cubic-bezier(0.22, 0.61, 0.2, 1) forwards;
}

.flip-sheet.animate-prev {
  animation: turnPrev 1320ms cubic-bezier(0.22, 0.61, 0.2, 1) forwards;
}

@keyframes turnNext {
  0% {
    transform: rotateY(0deg) translateX(0);
  }
  16% {
    transform: rotateY(-7deg) translateX(-1px);
  }
  34% {
    transform: rotateY(-24deg) translateX(-2px);
  }
  56% {
    transform: rotateY(-72deg) translateX(-4px);
  }
  76% {
    transform: rotateY(-136deg) translateX(-2px);
  }
  100% {
    transform: rotateY(-180deg) translateX(0);
  }
}

@keyframes turnPrev {
  0% {
    transform: rotateY(0deg) translateX(0);
  }
  16% {
    transform: rotateY(7deg) translateX(1px);
  }
  34% {
    transform: rotateY(24deg) translateX(2px);
  }
  56% {
    transform: rotateY(72deg) translateX(4px);
  }
  76% {
    transform: rotateY(136deg) translateX(2px);
  }
  100% {
    transform: rotateY(180deg) translateX(0);
  }
}

.button {
  border: none;
  padding: 12px 18px;
  border-radius: 2px;
  cursor: pointer;
  transition: transform 180ms ease, box-shadow 180ms ease, background-color 180ms ease, opacity 180ms ease;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 0.72rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.button:hover,
.button:focus-visible {
  transform: translateY(-1px);
  box-shadow: 0 16px 34px rgba(0, 0, 0, 0.2);
}

.button:disabled,
.button[disabled] {
  opacity: 0.42;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.button-primary {
  background: #f2efe8;
  color: #050505;
}

.button-secondary {
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.button-icon {
  display: none;
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
}

.button-icon svg {
  width: 100%;
  height: 100%;
  display: block;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.book-controls {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  flex-wrap: nowrap;
  width: fit-content;
  margin: 4px auto 0;
}

.book-controls .button {
  width: 44px;
  height: 44px;
  padding: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid rgba(255, 255, 255, 0.07);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.04),
    0 8px 18px rgba(0, 0, 0, 0.16);
}

.book-controls .button:hover,
.book-controls .button:focus-visible {
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.06),
    0 10px 20px rgba(0, 0, 0, 0.18);
}

.book-controls .button-label {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.book-controls .button-icon {
  display: block;
  width: 17px;
  height: 17px;
}

@media (min-width: 1180px) {
  .hero-scene {
    grid-template-columns: minmax(0, 1.08fr) minmax(340px, 0.72fr);
    gap: clamp(40px, 4vw, 76px);
  }

  .hero-copy {
    max-width: 660px;
  }

  h1 {
    font-size: clamp(3.3rem, 4.4vw, 5.8rem);
    max-width: 8ch;
  }

  .hero-preview {
    justify-items: end;
    padding-right: clamp(6px, 1vw, 18px);
  }

  .closed-book {
    width: min(360px, 78%);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 1ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 1ms !important;
    scroll-behavior: auto !important;
  }
}

@media (max-width: 980px) {
  .hero-scene {
    grid-template-columns: 1fr;
  }

  .hero-copy {
    max-width: none;
  }

  .hero-preview {
    min-height: 320px;
  }

  .book {
    aspect-ratio: 1.3;
  }
}

@media (max-width: 720px) {
  .page-shell {
    padding: 14px;
  }

  .hero-screen {
    min-height: auto;
    padding: 22px 18px 24px;
  }

  h1 {
    font-size: clamp(2.45rem, 9.6vw, 4.1rem);
    max-width: 7.5ch;
  }

  .subtitle {
    max-width: 22rem;
    font-size: 0.94rem;
  }

  .hero-preview {
    min-height: 250px;
  }

  .closed-book {
    width: min(270px, 76vw);
    transform: rotate(-10deg) translateY(4px);
  }

  .closed-book-cover > img {
    padding: 118px 54px 34px;
  }

  .closed-book-cover .cover-image-frame {
    left: 18%;
    right: 18%;
    top: 42%;
    bottom: 15%;
    border-width: 4px;
  }

  .closed-book-cover .cover-tape {
    left: 18%;
    right: 18%;
    top: 30px;
  }

  .closed-book-cover .cover-tape-title {
    font-size: clamp(0.96rem, 4.5vw, 1.28rem);
  }

  .closed-book-cover .cover-tape-note {
    font-size: 0.4rem;
    letter-spacing: 0.12em;
    white-space: nowrap;
  }

  .book-shell {
    gap: 8px;
  }

  .book-meta {
    align-items: baseline;
    flex-direction: row;
    justify-content: space-between;
    gap: 10px;
  }

  .book-title {
    gap: 0.1rem;
  }

  .book-title span {
    font-size: 0.62rem;
  }

  .book-title strong {
    font-size: 1.9rem;
  }

  .book-progress {
    font-size: 0.86rem;
    white-space: nowrap;
  }

  .book {
    width: min(100%, calc((100dvh - 206px) * 1.48));
    max-width: 100%;
    aspect-ratio: 1.48;
  }

  .book-stage {
    padding: 0;
  }

  .book-board {
    padding: 10px;
    border-radius: 24px;
    transform: rotateX(4deg);
  }

  .page,
  .flip-sheet,
  .page-stack,
  .spine-glow {
    top: 10px;
    bottom: 10px;
  }

  .page-content-image {
    padding: 4px;
  }

  .page-content-image.is-bleed {
    padding: 2px 0;
  }

  .page[data-side="left"] .page-content-image.is-bleed {
    padding-left: 2px;
  }

  .page[data-side="right"] .page-content-image.is-bleed {
    padding-right: 2px;
  }

  .page-media {
    border-radius: 6px;
  }

  .page-media.is-bleed {
    background: #050505;
  }

  .page-media.is-bleed img {
    object-fit: contain;
  }

  .page-copy-overlay {
    left: 14px;
    bottom: 14px;
    max-width: min(72%, 14rem);
  }

  .page-copy-overlay::before {
    inset: -18px -14px -16px -14px;
    border-radius: 18px;
  }

  .page-copy-overlay h2 {
    font-size: clamp(1rem, 4vw, 1.35rem);
  }

  .page-copy-overlay p {
    font-size: 0.82rem;
    line-height: 1.45;
  }

  .cover-frame img {
    padding: 126px 48px 34px;
  }

  .cover-image-frame {
    left: 16%;
    right: 16%;
    top: 44%;
    bottom: 14%;
    border-width: 5px;
  }

  .cover-tape {
    left: 16%;
    right: 16%;
    top: 30px;
  }

  .cover-tape-title {
    font-size: clamp(1.25rem, 5vw, 1.85rem);
    max-width: 8ch;
  }

  .cover-tape-note {
    margin-top: 6px;
    font-size: 0.34rem;
    letter-spacing: 0.12em;
    line-height: 1.15;
    max-width: none;
    white-space: nowrap;
  }

  .cover-spine-note {
    left: 12px;
    bottom: 18px;
    font-size: 0.52rem;
  }

  .book.is-closed-cover {
    width: min(74vw, 320px);
    aspect-ratio: 0.8;
  }

  .book.is-closed-cover .page-right,
  .book.is-closed-cover .page-stack-right {
    left: 0;
    right: auto;
    width: 100%;
    transform: none;
  }

  .book-controls {
    gap: 8px;
    margin-top: 0;
  }

  .book-controls .button {
    width: 40px;
    height: 40px;
  }
}

@media (max-width: 980px) and (orientation: landscape) {
  .page-shell {
    padding: 12px;
  }

  .book-shell {
    gap: 8px;
  }

  .book-meta {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
  }

  .book-title span {
    font-size: 0.62rem;
  }

  .book-title strong {
    font-size: 1.65rem;
  }

  .book-progress {
    font-size: 0.82rem;
    white-space: nowrap;
  }

  .book-stage {
    padding: 0;
  }

  .book {
    width: min(100%, calc((100dvh - 118px) * 1.58));
    max-width: calc(100dvw - 24px);
    aspect-ratio: 1.58;
  }

  .book.is-closed-cover {
    width: min(calc(100dvh - 160px), 240px);
    aspect-ratio: 0.8;
  }

  .book.is-closed-cover .page-right,
  .book.is-closed-cover .page-stack-right {
    left: 0;
    right: auto;
    width: 100%;
    transform: none;
  }

  .book-board {
    padding: 8px;
    border-radius: 22px;
  }

  .page,
  .flip-sheet,
  .page-stack,
  .spine-glow {
    top: 8px;
    bottom: 8px;
  }

  .book-controls {
    gap: 8px;
    margin-top: 0;
  }

  .book-controls .button {
    width: 38px;
    height: 38px;
  }

  .book-controls .button-icon {
    width: 15px;
    height: 15px;
  }

  .page-content-image {
    padding: 3px;
  }

  .page-media.is-bleed {
    background: #050505;
  }

  .page-media.is-bleed img {
    object-fit: contain;
  }

  .page-copy-overlay {
    max-width: min(52%, 16rem);
  }
}
