/* Book of quotes: realistic page turn. Built 2026-11-05.
   All classes are prefixed bt-. Geometry (sizes) is set from book-turn.js via --bt-* variables. */

.bt-root {
  --bt-w: 340px;
  --bt-h: 480px;
  --bt-pad: 10px;
  --bt-cpad: 0px;
  --bt-scale: .62;
  --bt-leather: linear-gradient(170deg, #7a5638 0%, #5c3d25 50%, #6d4c30 100%);
  --bt-noise: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='300' height='300' filter='url(%23n)' opacity='.09'/%3E%3C/svg%3E");
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: calc(var(--bt-h) + var(--bt-pad) * 2 + 40px);
  transition: height .9s cubic-bezier(.5, 0, .2, 1);
  -webkit-tap-highlight-color: transparent;
}
.bt-root[data-mode="single"] { --bt-pad: 6px; --bt-cpad: 6px; --bt-scale: .8; }
.bt-root[data-state="closed"] {
  height: calc((var(--bt-h) + var(--bt-pad) * 2) * var(--bt-scale) + 76px);
}

/* ---------- book ---------- */
.bt-book {
  position: relative;
  flex: none;
  width: calc(var(--bt-w) * 2);
  height: var(--bt-h);
  transform-origin: 50% 50%;
  transition: transform 1.1s cubic-bezier(.55, .05, .25, 1);
}
.bt-root[data-mode="single"] .bt-book {
  width: var(--bt-w);
  clip-path: inset(-90px -40px -90px calc(var(--bt-pad) * -1));
}
.bt-root[data-state="closed"] .bt-book {
  transform: translateX(calc(var(--bt-w) * var(--bt-scale) * -.5)) scale(var(--bt-scale));
}
.bt-root[data-state="closed"][data-mode="single"] .bt-book {
  transform: scale(var(--bt-scale));
}

.bt-ground {
  position: absolute;
  left: 2%; right: 2%; bottom: -30px; height: 40px;
  background: radial-gradient(50% 50% at 50% 50%, rgba(44, 36, 22, .38), rgba(44, 36, 22, 0) 100%);
  filter: blur(4px);
  transition: left .9s cubic-bezier(.5, 0, .2, 1);
  pointer-events: none;
}
.bt-root[data-state="closed"] .bt-ground { left: 50%; }
.bt-root[data-mode="single"] .bt-ground,
.bt-root[data-state="closed"][data-mode="single"] .bt-ground { left: 2%; }

.bt-spread {
  position: absolute;
  left: 0; top: 0;
  width: calc(var(--bt-w) * 2);
  height: var(--bt-h);
  perspective: 2200px;
  perspective-origin: 50% 50%;
  touch-action: pan-y;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  cursor: grab;
  outline: none;
}
.bt-root[data-mode="single"] .bt-spread { left: calc(var(--bt-w) * -1); }
.bt-root[data-state="closed"] .bt-spread { cursor: default; touch-action: auto; }
.bt-spread:focus-visible {
  outline: 2px solid var(--accent-gold, #c4a35a);
  outline-offset: 10px;
  border-radius: 4px;
}
.bt-spread.bt-dragging { cursor: grabbing; }

/* ---------- leather boards ---------- */
.bt-board {
  position: absolute;
  top: calc(var(--bt-pad) * -1);
  height: calc(var(--bt-h) + var(--bt-pad) * 2);
  background: var(--bt-noise), var(--bt-leather);
  box-shadow: inset 0 0 0 1px rgba(196, 163, 90, .28), 0 10px 26px rgba(44, 36, 22, .35), 0 2px 5px rgba(0, 0, 0, .25);
  transition: opacity .35s ease;
}
.bt-board-l {
  left: calc(var(--bt-pad) * -1);
  width: calc(var(--bt-w) + var(--bt-pad));
  border-radius: 6px 0 0 6px;
}
.bt-board-r {
  left: var(--bt-w);
  width: calc(var(--bt-w) + var(--bt-pad));
  border-radius: 0 6px 6px 0;
}
.bt-root[data-mode="single"] .bt-board-l { display: none; }
.bt-root[data-mode="single"] .bt-board-r {
  left: calc(var(--bt-w) - var(--bt-pad));
  width: calc(var(--bt-w) + var(--bt-pad) * 2);
  border-radius: 4px 6px 6px 4px;
}
.bt-root[data-state="closed"] .bt-board-l { opacity: 0; }
.bt-root[data-state="open"] .bt-board-l { transition-delay: .8s; }

/* ---------- paper ---------- */
.bt-sheet {
  position: absolute;
  top: 0;
  width: var(--bt-w);
  height: var(--bt-h);
  box-sizing: border-box;
  overflow: hidden;
  isolation: isolate;
  transform-origin: 0 0;
  background:
    var(--bt-noise),
    linear-gradient(180deg, #fcfaf3 0%, #f8f3e5 55%, #f4eddb 100%);
  background-blend-mode: multiply, normal;
  box-shadow: inset 0 0 38px rgba(139, 111, 71, .13);
  color: var(--ink, #2c2416);
}
.bt-page.bt-l { left: 0; transition: opacity .3s ease; }
.bt-page.bt-r { left: var(--bt-w); }
.bt-page.bt-l { border-radius: 2px 0 0 2px; }
.bt-page.bt-r { border-radius: 0 2px 2px 0; }
/* page-stack edges */
.bt-page.bt-r { box-shadow: inset 0 0 38px rgba(139, 111, 71, .13), 1px 1px 0 #e7dec8, 2px 2px 0 #d9cfb6, 3px 3px 0 #e4dbc3; }
.bt-page.bt-l { box-shadow: inset 0 0 38px rgba(139, 111, 71, .13), -1px 1px 0 #e7dec8, -2px 2px 0 #d9cfb6, -3px 3px 0 #e4dbc3; }
.bt-root[data-state="closed"] .bt-page.bt-l { opacity: 0; }
.bt-root[data-state="open"] .bt-page.bt-l { transition-delay: .8s; }
.bt-root[data-mode="single"] .bt-page.bt-l { display: none; }
.bt-leaf { left: 0; }

/* gutter shadow */
.bt-sheet::after {
  content: "";
  position: absolute; inset: 0;
  z-index: 1;
  pointer-events: none;
}
.bt-sheet.bt-l::after {
  background: linear-gradient(to left, rgba(70, 48, 18, .34) 0, rgba(70, 48, 18, .13) 6%, rgba(70, 48, 18, .04) 17%, rgba(70, 48, 18, 0) 30%);
}
.bt-sheet.bt-r::after {
  background: linear-gradient(to right, rgba(70, 48, 18, .34) 0, rgba(70, 48, 18, .13) 6%, rgba(70, 48, 18, .04) 17%, rgba(70, 48, 18, 0) 30%);
}

.bt-inner {
  position: relative;
  z-index: 0;
  box-sizing: border-box;
  height: 100%;
  padding: 34px clamp(24px, 9%, 38px) 54px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 30px;
  text-align: center;
}
.bt-inner.bt-ghost { transform: scaleX(-1); opacity: .075; }

.bt-quote blockquote {
  margin: 0 0 9px;
  font-family: 'EB Garamond', Georgia, serif;
  font-size: clamp(1.02rem, 1.7vw, 1.2rem);
  font-style: italic;
  line-height: 1.62;
  color: var(--ink, #2c2416);
  text-wrap: pretty;
}
.bt-context {
  display: block;
  font-family: 'Lora', serif;
  font-size: .68rem;
  font-weight: 700;
  font-style: normal;
  letter-spacing: 1.3px;
  text-transform: uppercase;
  color: var(--accent, #8b6f47);
}
.bt-quote + .bt-quote::before {
  content: "";
  display: block;
  width: 56px; height: 1px;
  margin: 0 auto 28px;
  background: linear-gradient(90deg, transparent, var(--accent-gold, #c4a35a), transparent);
}
.bt-folio {
  position: absolute;
  left: 0; right: 0; bottom: 20px;
  display: flex; justify-content: center; align-items: center; gap: 10px;
  font-family: 'Playfair Display', serif;
  font-size: .78rem;
  letter-spacing: .14em;
  color: var(--accent, #8b6f47);
}
.bt-folio::before, .bt-folio::after {
  content: ""; width: 18px; height: 1px;
  background: var(--accent-gold, #c4a35a); opacity: .6;
}

/* ---------- curl layers ---------- */
.bt-flapwrap {
  position: absolute;
  left: 0; top: 0;
  width: calc(var(--bt-w) * 2);
  height: var(--bt-h);
  pointer-events: none;
  filter: drop-shadow(0 3px 7px rgba(30, 20, 6, .4));
}
.bt-leaf { pointer-events: none; box-shadow: none; }
.bt-back { left: 0; }
.bt-active .bt-front, .bt-active .bt-back { will-change: clip-path, transform; }

.bt-strip {
  position: absolute;
  left: 0; top: -1000px;
  height: 2000px;
  width: 90px;
  z-index: 2;
  opacity: 0;
  transform-origin: 0 50%;
  pointer-events: none;
}
.bt-s-under { background: linear-gradient(90deg, rgba(36, 24, 8, .4), rgba(36, 24, 8, .15) 38%, rgba(36, 24, 8, 0)); }
.bt-s-front { width: 46px; background: linear-gradient(90deg, rgba(36, 24, 8, .22), rgba(36, 24, 8, 0)); }
.bt-s-back  { width: 120px; background: linear-gradient(90deg, rgba(50, 34, 12, .36) 0, rgba(255, 255, 255, .62) 13px, rgba(255, 255, 255, .2) 46px, rgba(255, 255, 255, 0)); }

.bt-spread.bt-fading .bt-page { opacity: 0 !important; transition: opacity .15s ease; }

/* ---------- cover ---------- */
.bt-cover {
  position: absolute;
  left: calc(var(--bt-w) - var(--bt-cpad));
  top: calc(var(--bt-pad) * -1);
  width: calc(var(--bt-w) + var(--bt-pad) + var(--bt-cpad));
  height: calc(var(--bt-h) + var(--bt-pad) * 2);
  margin: 0; padding: 0; border: 0;
  background: none;
  font: inherit;
  color: inherit;
  cursor: pointer;
  transform-origin: 0 50%;
  transform-style: preserve-3d;
  -webkit-tap-highlight-color: transparent;
  transition: transform 1.1s cubic-bezier(.55, .05, .25, 1);
}
.bt-cover:focus-visible { outline: 2px solid var(--accent-gold, #c4a35a); outline-offset: 6px; }
.bt-root[data-state="closed"] .bt-cover:hover { transform: rotateY(-9deg); transition-duration: .45s; }
.bt-root[data-state="open"] .bt-cover {
  transform: rotateY(-180deg);
  visibility: hidden;
  pointer-events: none;
  transition: transform 1.1s cubic-bezier(.55, .05, .25, 1), visibility 0s linear 1.25s;
}
/* fade the faces (not the 3D parent: an opacity animation on it would flatten the 3D and show the mirrored front) */
.bt-cover-face { opacity: 1; transition: opacity .2s ease; }
.bt-root[data-state="open"] .bt-cover-face { opacity: 0; transition: opacity .4s ease .8s; }
.bt-cover-face {
  position: absolute; inset: 0;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  box-sizing: border-box;
}
.bt-cover-front {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 0 12% 0 18%;
  border-radius: 2px 7px 7px 2px;
  background: var(--bt-noise), var(--bt-leather);
  box-shadow: 4px 5px 16px rgba(0, 0, 0, .34), 1px 1px 3px rgba(0, 0, 0, .2), inset 0 0 0 1px rgba(255, 255, 255, .05);
  text-align: center;
}
.bt-cover-front::before { /* spine hinge */
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 8%;
  border-radius: 2px 0 0 2px;
  background: linear-gradient(90deg, #3a2716, #5a3e28 55%, #4a3320);
  box-shadow: inset -2px 0 6px rgba(0, 0, 0, .45), 2px 0 5px rgba(0, 0, 0, .18);
}
.bt-cover-front::after { /* gold frame */
  content: ""; position: absolute; left: 13%; right: 6%; top: 5%; bottom: 5%;
  border: 1px solid rgba(196, 163, 90, .55);
  outline: 1px solid rgba(196, 163, 90, .25); outline-offset: 4px;
  pointer-events: none;
}
.bt-cover-ornament { font-size: calc(var(--bt-w) * .06); color: var(--accent-gold, #c4a35a); opacity: .75; margin-bottom: 4%; }
.bt-cover-title {
  font-family: 'Playfair Display', serif;
  font-size: calc(var(--bt-w) * .092);
  line-height: 1.25;
  color: var(--accent-gold, #c4a35a);
  text-shadow: 0 1px 3px rgba(0, 0, 0, .45), 0 0 1px rgba(255, 235, 170, .35);
  margin-bottom: 5%;
}
.bt-cover-rule { width: 22%; height: 1px; background: var(--accent-gold, #c4a35a); opacity: .55; margin-bottom: 5%; }
.bt-cover-author { font-family: 'EB Garamond', serif; font-style: italic; font-size: calc(var(--bt-w) * .052); color: rgba(196, 163, 90, .9); }
.bt-cover-date { margin-top: 2%; font-family: 'Lora', serif; font-size: calc(var(--bt-w) * .036); letter-spacing: .2em; color: rgba(196, 163, 90, .55); }
.bt-cover-back {
  transform: rotateY(180deg);
  border-radius: 7px 2px 2px 7px;
  background:
    var(--bt-noise),
    radial-gradient(120% 90% at 30% 20%, #e5d8b6, #cdbb92 70%, #bca97d);
  box-shadow: inset 0 0 0 1px rgba(139, 111, 71, .35);
}

.bt-prompt {
  position: absolute;
  left: 0; right: 0; bottom: 6px;
  margin: 0; text-align: center;
  font-size: .85rem; font-style: italic;
  color: var(--ink-light, #5a4a35);
  animation: btPulse 2.2s ease-in-out infinite;
  transition: opacity .3s ease;
  pointer-events: none;
}
.bt-root[data-state="open"] .bt-prompt { opacity: 0; animation: none; }
@keyframes btPulse { 0%, 100% { opacity: .5; } 50% { opacity: 1; } }

/* ---------- controls ---------- */
.bt-controls {
  display: flex; justify-content: center; align-items: center; gap: 18px;
  margin-top: 14px;
}
.bt-btn {
  font-family: 'Lora', serif;
  font-size: .88rem; font-weight: 600;
  color: var(--accent, #8b6f47);
  background: none;
  border: 1.5px solid var(--border, #c9b99a);
  border-radius: var(--radius, 4px);
  min-height: 44px;
  padding: 10px 20px;
  cursor: pointer;
  transition: background .25s ease, color .25s ease, border-color .25s ease, transform .15s ease;
}
.bt-btn:hover:not(:disabled) { background: var(--accent, #8b6f47); color: var(--cream, #faf7f0); border-color: var(--accent, #8b6f47); }
.bt-btn:active:not(:disabled) { transform: scale(.97); }
.bt-btn:disabled { opacity: .35; cursor: default; }
.bt-btn:focus-visible, .bt-close:focus-visible { outline: 2px solid var(--accent-gold, #c4a35a); outline-offset: 3px; }
.bt-indicator { min-width: 8.5em; text-align: center; font-size: .82rem; color: var(--ink-light, #5a4a35); font-style: italic; }
.bt-hint { margin: 10px 0 0; text-align: center; font-size: .76rem; letter-spacing: .02em; color: var(--ink-light, #5a4a35); opacity: .7; font-style: italic; }
.bt-close {
  display: block; margin: 6px auto 0;
  min-height: 44px;
  font-family: 'Lora', serif; font-size: .85rem;
  color: var(--ink-light, #5a4a35);
  background: none; border: none; cursor: pointer;
  padding: 8px 16px;
  transition: color .25s ease;
}
.bt-close:hover { color: var(--accent, #8b6f47); }
.bt-root[data-state="closed"] ~ .bt-controls,
.bt-root[data-state="closed"] ~ .bt-hint,
.bt-root[data-state="closed"] ~ .bt-close { display: none; }

@media (max-width: 699px) {
  .bt-controls { gap: 8px; }
  .bt-btn { padding: 10px 14px; }
  .bt-indicator { min-width: 6.5em; }
}

/* ---------- reduced motion: crossfade, no curl ---------- */
@media (prefers-reduced-motion: reduce) {
  .bt-book, .bt-ground, .bt-root { transition: none !important; }
  .bt-cover, .bt-root[data-state="open"] .bt-cover { transition: visibility 0s linear .35s !important; }
  .bt-cover-face, .bt-root[data-state="open"] .bt-cover-face { transition: opacity .35s ease !important; }
  .bt-root[data-state="open"] .bt-cover, .bt-root[data-state="closed"] .bt-cover:hover { transform: none; }
  .bt-board, .bt-page { transition-delay: 0s !important; }
  .bt-prompt { animation: none; opacity: .8; }
}
