/* ═══════════════════════════════════════════════════════
   HAUTE CUISINE — the printed edition
   A three-dimensional book that turns in the light.
   ═══════════════════════════════════════════════════════ */

.book-stage {
  perspective: 2000px;
  perspective-origin: 50% 42%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-lg) 0;
  min-height: 520px;
}

.book3d {
  --bw: 300px;                      /* cover width  */
  --bh: 429px;                      /* 7 : 10 trim  */
  --bd: 52px;                       /* 1.22in spine */
  position: relative;
  width: var(--bw);
  height: var(--bh);
  transform-style: preserve-3d;
  transform: rotateX(6deg) rotateY(-28deg);
  animation: book-turn 16s cubic-bezier(0.45, 0, 0.55, 1) infinite;
  transition: transform 900ms cubic-bezier(0.16, 1, 0.3, 1);
  cursor: pointer;
}
.book-stage:hover .book3d {
  animation-play-state: paused;
  transform: rotateX(3deg) rotateY(-14deg) scale(1.05);
}

@keyframes book-turn {
  0%   { transform: rotateX(6deg)   rotateY(-30deg) translateY(0); }
  25%  { transform: rotateX(4deg)   rotateY(-18deg) translateY(-10px); }
  50%  { transform: rotateX(6.5deg) rotateY(-34deg) translateY(0); }
  75%  { transform: rotateX(5deg)   rotateY(-22deg) translateY(-7px); }
  100% { transform: rotateX(6deg)   rotateY(-30deg) translateY(0); }
}

.book3d .face {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  background-size: cover;
  background-position: center;
  border-radius: 1px 3px 3px 1px;
}

/* front, back, spine */
.book3d .front {
  transform: translateZ(calc(var(--bd) / 2));
  background-image: url('/book-cover.png');
  box-shadow: inset 0 0 40px rgba(26,21,12,0.10);
}
.book3d .back {
  transform: rotateY(180deg) translateZ(calc(var(--bd) / 2));
  background-image: url('/book-back.png');
  border-radius: 3px 1px 1px 3px;
}
.book3d .spine {
  width: var(--bd);
  left: calc(var(--bd) / -2);
  transform: rotateY(-90deg);
  background-image: url('/book-spine.png');
  border-radius: 2px 0 0 2px;
}

/* the fore-edge: a stack of pages, not a slab */
.book3d .pages {
  width: calc(var(--bd) - 3px);
  left: auto;
  right: calc((var(--bd) - 3px) / -2 + 1.5px);
  transform: rotateY(90deg);
  background:
    repeating-linear-gradient(to right,
      #f6f2e8 0px, #f6f2e8 1px, #e4ddcd 1px, #e4ddcd 2px);
  box-shadow: inset -8px 0 18px rgba(26,21,12,0.14);
  border-radius: 0 2px 2px 0;
}
.book3d .head, .book3d .tail {
  height: calc(var(--bd) - 3px);
  top: auto;
  background: repeating-linear-gradient(to right, #f6f2e8 0 1px, #e8e1d1 1px 2px);
}
.book3d .head { top: calc((var(--bd) - 3px) / -2 + 1.5px); transform: rotateX(90deg); }
.book3d .tail { bottom: calc((var(--bd) - 3px) / -2 + 1.5px); transform: rotateX(-90deg); }

/* light travelling across the cover */
.book3d .front::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(105deg,
    rgba(255,255,255,0) 30%,
    rgba(255,255,255,0.42) 47%,
    rgba(255,255,255,0) 62%);
  background-size: 260% 100%;
  background-position: 130% 0;
  animation: book-sheen 16s ease-in-out infinite;
  pointer-events: none;
  mix-blend-mode: soft-light;
}
@keyframes book-sheen {
  0%, 62%, 100% { background-position: 130% 0; }
  18%           { background-position: -40% 0; }
}

/* the shadow it casts */
.book-stage .book-shadow {
  position: absolute;
  width: 300px;
  height: 34px;
  border-radius: 50%;
  background: radial-gradient(ellipse at center, rgba(26,21,12,0.26) 0%, rgba(26,21,12,0) 70%);
  transform: translateY(240px) translateX(-14px) rotateX(74deg);
  filter: blur(7px);
  animation: book-shadow 16s cubic-bezier(0.45,0,0.55,1) infinite;
}
@keyframes book-shadow {
  0%, 50%, 100% { opacity: 0.9;  transform: translateY(240px) translateX(-14px) rotateX(74deg) scale(1); }
  25%           { opacity: 0.62; transform: translateY(246px) translateX(-8px)  rotateX(74deg) scale(0.92); }
  75%           { opacity: 0.74; transform: translateY(244px) translateX(-11px) rotateX(74deg) scale(0.95); }
}

/* ── Specification panel ─────────────────────────────── */
.spec-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1px;
  background: var(--blue-border);
  border: 0.5px solid var(--blue-border);
  border-radius: var(--r-sm);
  overflow: hidden;
  margin-top: var(--space-md);
}
.spec {
  background: var(--parchment);
  padding: var(--space-sm) var(--space-xs);
}
.spec .l {
  font-size: var(--t-label);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink-faint);
  display: block;
  margin-bottom: 0.35rem;
}
.spec .v {
  font-family: var(--ff-display);
  font-size: 1.5rem;
  color: var(--blue);
  line-height: 1.15;
}

/* ── Notify form ─────────────────────────────────────── */
.notify {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: var(--space-md);
  max-width: 540px;
}
.notify input[type="email"] {
  flex: 1 1 260px;
  min-width: 0;
  background: var(--cream);
  border: 0.5px solid var(--blue-border);
  border-radius: var(--r-xs);
  padding: 0.95rem 1rem;
  font-family: var(--ff-ui);
  font-size: var(--t-caption);
  color: var(--ink);
  transition: border-color 200ms, box-shadow 200ms;
}
.notify input[type="email"]:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 1px var(--blue);
}
.notify button { flex: 0 0 auto; }
.notify-msg {
  flex: 1 0 100%;
  font-size: var(--t-caption);
  color: var(--ink-muted);
  min-height: 1.4em;
}
.notify-msg.ok  { color: #15803d; }
.notify-msg.bad { color: #9f1239; }

/* ── Homepage teaser ─────────────────────────────────── */
.book-teaser {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: var(--space-xl);
  align-items: center;
}
.book-teaser .book-stage { min-height: 480px; padding: 0; }

@media (max-width: 900px) {
  .book-teaser { grid-template-columns: minmax(0,1fr); gap: var(--space-lg); }
  .book3d { --bw: 240px; --bh: 343px; --bd: 42px; }
  .book-stage { min-height: 420px; }
  .book-stage .book-shadow { transform: translateY(196px) translateX(-12px) rotateX(74deg); width: 240px; }
}

@media (prefers-reduced-motion: reduce) {
  .book3d { animation: none; transform: rotateX(4deg) rotateY(-22deg); }
  .book3d .front::after { animation: none; background-position: 130% 0; }
  .book-stage .book-shadow { animation: none; }
}

/* The teaser column is narrower than a full section, so the heading needs
   its own scale to stay at two lines rather than three. */
.book-teaser .section-header h2 { font-size: clamp(2.4rem, 4.4vw, 4.4rem); }
.book-teaser .section-desc { font-size: var(--t-body); }
