:root {
  --bg: #0c0c0c;
  --bg-soft: #161616;
  --ink: #f2f2ef;
  --muted: #9a9a94;
  --panel: #1c1c1c;
  --accent: #f2f2ef;
  --button-bg: #f2f2ef;
  --button-ink: #111;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  background: var(--bg);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  overflow-x: hidden;
}

.hero {
  position: relative;
  min-height: 100svh;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(340px, 44vw);
  align-items: center;
  padding: clamp(24px, 5vw, 80px);
  isolation: isolate;
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(circle at 72% 45%, rgba(255,255,255,.07), transparent 34%),
    linear-gradient(120deg, var(--bg), var(--bg-soft));
}

.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: .22;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 160 160' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.16'/%3E%3C/svg%3E");
}

.copy { max-width: 780px; }
.copy--intro { z-index: 2; }
.copy--detail {
  position: absolute;
  left: clamp(24px, 5vw, 80px);
  bottom: clamp(32px, 8vh, 110px);
  width: min(36rem, 42vw);
  opacity: 0;
  transform: translateY(24px);
}

.eyebrow {
  margin: 0 0 1rem;
  color: var(--muted);
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .18em;
  text-transform: uppercase;
}

h1, h2 {
  margin: 0;
  color: var(--ink);
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 500;
  line-height: .92;
  letter-spacing: -.045em;
}

h1 { font-size: clamp(3.35rem, 7.8vw, 9rem); }
h2 { font-size: clamp(2.5rem, 6vw, 6.8rem); }

.lead, .copy--detail p, .content > p:last-child {
  max-width: 52ch;
  color: var(--muted);
  font-size: clamp(1rem, 1.35vw, 1.28rem);
  line-height: 1.6;
}

.button {
  display: inline-flex;
  margin-top: 1.5rem;
  padding: .9rem 1.2rem;
  color: var(--button-ink);
  background: var(--button-bg);
  border-radius: 999px;
  text-decoration: none;
  transition: transform .2s ease, background .2s ease, color .2s ease;
}
.button:hover {
  transform: translateY(-2px);
  background: #fff;
}

.book-stage {
  position: relative;
  width: 100%;
  height: min(76svh, 840px);
  min-height: 480px;
  cursor: grab;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}
.book-stage:active,
.book-stage.is-dragging { cursor: grabbing; }
#book-canvas {
  display: block;
  width: 100%;
  height: 100%;
  outline: none;
  opacity: 0;
  transition: opacity .6s ease;
}
.book-ready #book-canvas { opacity: 1; }

.loader {
  position: absolute;
  inset: 50% auto auto 50%;
  transform: translate(-50%, -50%);
  padding: .65rem .85rem;
  border: 1px solid rgba(255,255,255,.16);
  background: rgba(20,20,20,.72);
  color: var(--ink);
  backdrop-filter: blur(8px);
  font-size: .75rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  transition: opacity .3s ease;
}
.book-ready .loader { opacity: 0; pointer-events: none; }

.hint {
  position: absolute;
  right: 0;
  bottom: 0;
  margin: 0;
  color: var(--muted);
  font-size: .68rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  pointer-events: none;
}

.error-message {
  position: absolute;
  inset: 50% 10% auto;
  transform: translateY(-50%);
  margin: 0;
  padding: 1rem;
  color: var(--ink);
  background: rgba(20,20,20,.9);
  border: 1px solid rgba(255,255,255,.16);
  text-align: center;
  line-height: 1.45;
}

.content {
  min-height: 100svh;
  display: grid;
  align-content: center;
  gap: 2rem;
  padding: clamp(48px, 9vw, 150px);
  background: var(--bg);
}
.content h2 { max-width: 13ch; }
.content--dark {
  color: var(--ink);
  background: var(--panel);
}

@media (max-width: 820px) {
  .hero {
    grid-template-columns: 1fr;
    align-content: start;
    padding-top: 72px;
  }
  .copy--intro { max-width: 96%; }
  .book-stage {
    height: 58svh;
    min-height: 390px;
    margin-top: 1rem;
  }
  .copy--detail {
    left: 24px;
    right: 24px;
    bottom: 36px;
    width: auto;
  }
  .hint { right: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .hint { display: none; }
}
