/* ═══════════════════════════════════════════════════════════════════════════
   RAVEN HOUSE · KINETIC 3D SANCTUARY ENGINE
   ──────────────────────────────────────────────────────────────────────────
   Production-grade 3D scroll effects, physics-based raven flight,
   tactile hardcover books, and fluttering manuscripts.

   Design Principles (impeccable.style):
   ✦ Zero AI slop — no generic gradients, no cards-in-cards
   ✦ Physical metaphor — every shadow has a light source, every tilt obeys
     perspective, every animation follows spring physics
   ✦ Respectful layering — effects enhance reading, never obstruct it
   ✦ GPU-composited transforms only — translateZ, rotateX/Y, scale, opacity
   ✦ Reduced-motion always respected

   Palette Integration:
   Surfaces: --bg-base (#FAF3F0), --bg-surface (#FFFDFD)
   Accent:   --peach (#C25B74), --peach-border (#E4C7C2)
   Ink:      --ink (#2E1E24), --ink-mid (#684F57)
   Shadow:   plum-tinted rgba(46,30,36,α)
   ═══════════════════════════════════════════════════════════════════════════ */

/* ─── DESIGN TOKENS: 3D DEPTH SYSTEM ────────────────────────────────────── */
:root {
  /* Perspective & Depth */
  --depth-stage: 1400px;
  --depth-card: 900px;
  --depth-book: 1200px;

  /* Elevation Shadows (Plum-tinted, no black) */
  --elev-0: 0 1px 2px rgba(46,30,36,0.04);
  --elev-1: 0 2px 6px -1px rgba(46,30,36,0.06),
            0 1px 2px rgba(46,30,36,0.04);
  --elev-2: 0 6px 16px -3px rgba(46,30,36,0.10),
            0 2px 6px -1px rgba(46,30,36,0.06),
            0 0 0 1px rgba(228,199,194,0.35);
  --elev-3: 0 16px 36px -8px rgba(46,30,36,0.14),
            0 6px 14px -3px rgba(46,30,36,0.08),
            0 0 0 1px rgba(228,199,194,0.45);
  --elev-4: 0 28px 56px -12px rgba(46,30,36,0.18),
            0 10px 22px -5px rgba(46,30,36,0.10);

  /* Physical Aerodynamic Easings (Exponential deceleration — zero rubber bounce) */
  --ease-expo: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-quart: cubic-bezier(0.25, 1, 0.5, 1);
  --ease-gentle: cubic-bezier(0.22, 1, 0.36, 1);
  --decel: cubic-bezier(0, 0, 0.2, 1);
  --accel: cubic-bezier(0.4, 0, 1, 1);

  /* Raven Anatomy Colors */
  --raven-primary: #0F0D11;
  --raven-secondary: #1A161D;
  --raven-iridescent: #2D2433;
  --raven-eye: #C25B74;

  /* Paper Materiality */
  --paper-base: #FAF5F0;
  --paper-white: #FFFDFD;
  --paper-aged: #F0E4DA;
  --paper-line: rgba(46,30,36,0.06);
  --gilding: #B89A6A;
}

/* ═══════════════════════════════════════════════════════════════════════════
   1. FLIGHT STAGE — fullscreen non-interactive overlay for ravens & feathers
   ═══════════════════════════════════════════════════════════════════════════ */
.raven-flight-stage {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 998;
  overflow: hidden;
  contain: strict;
}

/* ─── INDIVIDUAL FLYING RAVEN ────────────────────────────────────────────── */
.flying-raven {
  position: absolute;
  width: 110px;
  height: 72px;
  pointer-events: none;
  will-change: transform, opacity;
  contain: layout style;
}

.flying-raven svg {
  width: 100%;
  height: 100%;
  overflow: visible;
  filter: drop-shadow(0 8px 16px rgba(15,13,17,0.25));
}

/* Wing animation uses a multi-step keyframe for organic stroke rhythm:
   downstroke is fast & powerful, upstroke is slow & feathered */
.raven-wing-l {
  transform-origin: 55px 36px; /* shoulder joint */
  animation: wingL var(--flap-dur, 0.5s) cubic-bezier(0.4, 0, 0.2, 1) infinite;
}
.raven-wing-r {
  transform-origin: 55px 36px;
  animation: wingR var(--flap-dur, 0.5s) cubic-bezier(0.4, 0, 0.2, 1) infinite;
}

@keyframes wingL {
  0%   { transform: rotateZ(-28deg) rotateX(18deg) scaleY(0.78); }
  15%  { transform: rotateZ(2deg)   rotateX(4deg)  scaleY(1.02); }   /* downstroke snap */
  35%  { transform: rotateZ(40deg)  rotateX(-22deg) scaleY(0.88); }  /* full extension */
  55%  { transform: rotateZ(32deg)  rotateX(-15deg) scaleY(0.92); }  /* hold at top */
  100% { transform: rotateZ(-28deg) rotateX(18deg) scaleY(0.78); }   /* return */
}
@keyframes wingR {
  0%   { transform: rotateZ(28deg)  rotateX(18deg) scaleY(0.78); }
  15%  { transform: rotateZ(-2deg)  rotateX(4deg)  scaleY(1.02); }
  35%  { transform: rotateZ(-40deg) rotateX(-22deg) scaleY(0.88); }
  55%  { transform: rotateZ(-32deg) rotateX(-15deg) scaleY(0.92); }
  100% { transform: rotateZ(28deg)  rotateX(18deg) scaleY(0.78); }
}

/* Soaring glide — wings held wide, slow gentle undulation */
.flying-raven.is-gliding .raven-wing-l {
  animation-name: glidingL;
  animation-duration: 2.4s;
  animation-timing-function: ease-in-out;
}
.flying-raven.is-gliding .raven-wing-r {
  animation-name: glidingR;
  animation-duration: 2.4s;
  animation-timing-function: ease-in-out;
}

@keyframes glidingL {
  0%, 100% { transform: rotateZ(32deg) rotateX(-8deg) scaleY(0.94); }
  50%      { transform: rotateZ(28deg) rotateX(-4deg) scaleY(0.97); }
}
@keyframes glidingR {
  0%, 100% { transform: rotateZ(-32deg) rotateX(-8deg) scaleY(0.94); }
  50%      { transform: rotateZ(-28deg) rotateX(-4deg) scaleY(0.97); }
}

/* Tail rudder — gentle yaw correction */
.raven-tail-group {
  transform-origin: 55px 50px;
  animation: tailRudder 1.8s ease-in-out infinite alternate;
}
@keyframes tailRudder {
  0%   { transform: rotateZ(-2.5deg) scaleX(1); }
  100% { transform: rotateZ(2.5deg)  scaleX(0.97); }
}

/* ─── RAVEN DEPTH SCALING (z-distance simulation) ────────────────────────── */
.flying-raven[data-depth="near"]  { --scale: 1.15; filter: drop-shadow(0 20px 30px rgba(15,13,17,0.32)); }
.flying-raven[data-depth="mid"]   { --scale: 0.85; filter: drop-shadow(0 12px 18px rgba(15,13,17,0.22)); opacity: 0.92; }
.flying-raven[data-depth="far"]   { --scale: 0.55; filter: drop-shadow(0 6px 10px rgba(15,13,17,0.12)); opacity: 0.72; }

/* ─── PERCHED RAVEN (idle sentinel on section headers) ───────────────────── */
.perched-raven {
  position: relative;
  display: inline-flex;
  align-items: flex-end;
  cursor: pointer;
  pointer-events: auto;
  z-index: 10;
  transition: transform 0.35s var(--ease-quart);
}
.perched-raven svg {
  width: 42px;
  height: 36px;
  fill: var(--raven-primary);
  filter: drop-shadow(0 3px 6px rgba(46,30,36,0.16));
  transition: filter 0.3s ease, transform 0.3s var(--ease-quart);
}
.perched-raven:hover svg {
  transform: translateY(-3px) rotate(-4deg);
  filter: drop-shadow(0 8px 14px rgba(194,91,116,0.22));
}
/* Tooltip label */
.perched-raven::after {
  content: attr(data-label);
  position: absolute;
  bottom: -24px;
  left: 50%;
  transform: translateX(-50%) translateY(4px);
  background: var(--bg-surface);
  border: 1px solid var(--peach-border);
  padding: 2px 10px;
  border-radius: 4px;
  font-family: 'Quicksand', sans-serif;
  font-size: 11px;
  font-weight: 600;
  color: var(--ink-mid);
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s, transform 0.2s;
  box-shadow: var(--elev-1);
}
.perched-raven:hover::after {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* Startle animation — launches raven off perch with aerodynamic ascent */
.perched-raven.is-startled svg {
  animation: startleLaunch 0.65s var(--ease-expo) forwards;
}
@keyframes startleLaunch {
  0%   { transform: translateY(0) rotate(0) scale(1); opacity: 1; }
  35%  { transform: translateY(-24px) rotate(-14deg) scale(1.05); opacity: 1; }
  100% { transform: translateY(-80px) rotate(-22deg) scale(0.6); opacity: 0; }
}

/* ═══════════════════════════════════════════════════════════════════════════
   2. FEATHER PARTICLES — drift physics via CSS custom properties
   ═══════════════════════════════════════════════════════════════════════════ */
.feather-particle {
  position: fixed;
  width: var(--fw, 18px);
  height: var(--fh, 28px);
  pointer-events: none;
  z-index: 999;
  will-change: transform, opacity;
  opacity: 0;
  animation: featherDrift var(--fdur, 2.2s) var(--fdelay, 0s) var(--ease-gentle) forwards;
}
.feather-particle svg {
  width: 100%;
  height: 100%;
  filter: drop-shadow(0 2px 4px rgba(15,13,17,0.12));
}

@keyframes featherDrift {
  0% {
    transform: translate3d(0, 0, 0) rotateZ(var(--frot0, 0deg)) rotateX(0deg) scale(var(--fscale, 0.8));
    opacity: 0.9;
  }
  25% {
    transform: translate3d(var(--fdx1, 20px), var(--fdy1, -30px), 10px)
               rotateZ(var(--frot1, 45deg)) rotateX(20deg) scale(var(--fscale, 0.8));
    opacity: 0.85;
  }
  60% {
    transform: translate3d(var(--fdx2, 35px), var(--fdy2, 10px), 5px)
               rotateZ(var(--frot2, 90deg)) rotateX(-15deg) scale(var(--fscale, 0.8));
    opacity: 0.6;
  }
  100% {
    transform: translate3d(var(--fdx3, 50px), var(--fdy3, 60px), 0px)
               rotateZ(var(--frot3, 140deg)) rotateX(25deg) scale(calc(var(--fscale, 0.8) * 0.7));
    opacity: 0;
  }
}

/* ─── TAP RIPPLE — concentric peach pulse ────────────────────────────────── */
.tap-ripple {
  position: fixed;
  width: 40px;
  height: 40px;
  margin: -20px 0 0 -20px;
  border-radius: 50%;
  pointer-events: none;
  z-index: 997;
}
.tap-ripple::before,
.tap-ripple::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 1px solid var(--peach);
  opacity: 0;
  animation: rippleOut 0.8s var(--decel) forwards;
}
.tap-ripple::after {
  animation-delay: 0.12s;
  border-color: var(--peach-border);
}
@keyframes rippleOut {
  0%   { transform: scale(0.3); opacity: 0.7; }
  100% { transform: scale(3.2);  opacity: 0; }
}

/* ═══════════════════════════════════════════════════════════════════════════
   3. 3D HARDCOVER BOOKS — multi-face CSS solid with correct transforms
   ═══════════════════════════════════════════════════════════════════════════ */

/* Anchor provides per-book perspective */
.book-3d-anchor {
  display: inline-block;
  perspective: var(--depth-book);
  perspective-origin: 60% 40%;
  margin: 1.5rem auto;
  z-index: 5;
  position: relative;
}

/* Hover-target wrapper */
.book-3d-wrap {
  --book-w: 160px;
  --book-h: 225px;
  --book-d: 22px; /* spine thickness */
  width: var(--book-w);
  height: var(--book-h);
  position: relative;
  cursor: pointer;
  transform-style: preserve-3d;
  transition: transform 0.55s var(--ease-gentle);
}
.book-3d-wrap:hover {
  transform: translateZ(18px) rotateY(-8deg) rotateX(3deg);
}

/* Floor shadow — elliptical blur, shifts on hover */
.book-floor-shadow {
  position: absolute;
  bottom: -18px;
  left: 8%;
  right: 8%;
  height: 20px;
  background: radial-gradient(ellipse at center,
    rgba(46,30,36,0.22) 0%,
    rgba(46,30,36,0.06) 60%,
    transparent 100%);
  border-radius: 50%;
  filter: blur(5px);
  transition: transform 0.55s var(--ease-gentle), opacity 0.55s ease;
  pointer-events: none;
}
.book-3d-wrap:hover .book-floor-shadow {
  transform: translateY(6px) scaleX(1.12);
  opacity: 0.65;
}

/* 3D solid — preserves child face transforms */
.book-solid {
  width: 100%;
  height: 100%;
  position: absolute;
  transform-style: preserve-3d;
  transform: rotateY(-22deg) rotateX(8deg);
  transition: transform 0.55s var(--ease-gentle);
}
.book-3d-wrap:hover .book-solid {
  transform: rotateY(-10deg) rotateX(4deg) translateZ(14px);
}

/* FRONT COVER */
.book-face-front {
  position: absolute;
  inset: 0;
  background: linear-gradient(155deg, var(--paper-white) 0%, var(--paper-base) 80%);
  border: 1px solid var(--peach-border);
  border-radius: 3px 7px 7px 3px;
  box-shadow:
    inset 4px 0 8px rgba(46,30,36,0.05),
    inset -1px 0 3px rgba(255,255,255,0.9),
    var(--elev-2);
  padding: 1.2rem 1rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transform: translateZ(calc(var(--book-d) / 2));
  overflow: hidden;
  user-select: none;
  backface-visibility: hidden;
}

/* Decorative frame inlay (gilded border) */
.book-face-front::before {
  content: '';
  position: absolute;
  inset: 8px;
  border: 1px solid rgba(184,154,106,0.28);
  border-radius: 2px 5px 5px 2px;
  pointer-events: none;
}
.book-face-front::after {
  content: '';
  position: absolute;
  inset: 12px;
  border: 0.5px dashed rgba(194,91,116,0.16);
  pointer-events: none;
}

/* Specular highlight sweep */
.book-specular {
  position: absolute;
  inset: 0;
  background: linear-gradient(110deg, transparent 30%, rgba(255,255,255,0.55) 44%, transparent 58%);
  border-radius: inherit;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease;
  transform: translateX(-100%);
}
.book-3d-wrap:hover .book-specular {
  opacity: 1;
  animation: glintSweep 1.4s ease-in-out;
}
@keyframes glintSweep {
  0%   { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

/* Cover typography */
.book-tag {
  font-family: 'Quicksand', sans-serif;
  font-size: 9px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--peach);
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 5px;
}
.book-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.3rem;
  line-height: 1.18;
  color: var(--ink);
  font-weight: 600;
  margin: 0.3rem 0;
}
.book-subtitle {
  font-family: 'EB Garamond', serif;
  font-size: 0.82rem;
  font-style: italic;
  color: var(--ink-mid);
}
.book-seal {
  align-self: flex-end;
  color: var(--peach);
  opacity: 0.6;
}

/* SPINE — left face */
.book-face-spine {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: var(--book-d);
  background: linear-gradient(to right,
    rgba(228,199,194,0.6) 0%,
    var(--paper-white) 40%,
    var(--paper-base) 100%);
  border: 1px solid var(--peach-border);
  border-radius: 3px 0 0 3px;
  transform: rotateY(-90deg) translateZ(0);
  transform-origin: left center;
  display: flex;
  align-items: center;
  justify-content: center;
  backface-visibility: hidden;
}
.book-spine-label {
  writing-mode: vertical-rl;
  text-orientation: mixed;
  transform: rotate(180deg);
  font-family: 'Cormorant Garamond', serif;
  font-size: 10px;
  letter-spacing: 0.16em;
  color: var(--ink-mid);
  font-weight: 600;
  text-transform: uppercase;
}

/* PAGE EDGES — right face */
.book-face-pages {
  position: absolute;
  top: 3px;
  bottom: 3px;
  right: 0;
  width: var(--book-d);
  background:
    repeating-linear-gradient(to bottom,
      var(--paper-base) 0px, var(--paper-base) 1.2px,
      rgba(220,200,188,0.5) 1.2px, var(--paper-base) 1.8px);
  border-left: 1px solid rgba(200,175,160,0.6);
  box-shadow: inset 0 0 5px rgba(46,30,36,0.10);
  transform: rotateY(90deg) translateZ(calc(var(--book-w) - var(--book-d)));
  transform-origin: right center;
  backface-visibility: hidden;
}

/* BACK COVER */
.book-face-back {
  position: absolute;
  inset: 0;
  background: var(--paper-base);
  border: 1px solid var(--peach-border);
  border-radius: 3px 7px 7px 3px;
  transform: translateZ(calc(var(--book-d) / -2));
  backface-visibility: hidden;
}

/* SATIN BOOKMARK RIBBON */
.book-ribbon {
  position: absolute;
  bottom: -28px;
  left: 54%;
  width: 9px;
  height: 48px;
  background: linear-gradient(to right, #A94660, #D87A90 55%, #C25B74);
  clip-path: polygon(0 0, 100% 0, 100% 82%, 50% 100%, 0 82%);
  box-shadow: 1px 3px 6px rgba(46,30,36,0.18);
  transform: translateZ(calc(var(--book-d) / 2 + 2px)) rotateZ(3deg);
  transform-origin: top center;
  transition: transform 0.45s var(--ease-quart);
  pointer-events: none;
  z-index: 6;
}
.book-3d-wrap:hover .book-ribbon {
  transform: translateZ(calc(var(--book-d) / 2 + 2px)) rotateZ(10deg) scaleY(1.06);
}

/* ═══════════════════════════════════════════════════════════════════════════
   4. FLOATING PARCHMENT SHEETS
   ═══════════════════════════════════════════════════════════════════════════ */
.parchment-sheet {
  position: absolute;
  width: 180px;
  min-height: 220px;
  background: var(--paper-white);
  background-image:
    linear-gradient(to bottom, transparent 23px, var(--paper-line) 23px),
    linear-gradient(var(--paper-base) 0%, var(--paper-white) 50%);
  background-size: 100% 24px, 100% 100%;
  border: 1px solid var(--peach-border);
  border-radius: 3px;
  box-shadow: var(--elev-3);
  padding: 1.1rem 1rem;
  font-family: 'EB Garamond', serif;
  font-size: 0.92rem;
  line-height: 1.55;
  color: var(--ink-mid);
  pointer-events: auto;
  cursor: default;
  will-change: transform;
  transition: transform 0.4s var(--ease-gentle), box-shadow 0.4s ease;
  z-index: 4;
}
.parchment-sheet:hover {
  transform: translateY(-6px) rotateZ(0deg) scale(1.02) !important;
  box-shadow: var(--elev-4);
}

/* Deckle edge simulation */
.parchment-sheet::before {
  content: '';
  position: absolute;
  inset: 0;
  border: 1px dashed rgba(194,91,116,0.18);
  border-radius: 2px;
  pointer-events: none;
}

.parchment-tag {
  font-family: 'Special Elite', monospace;
  font-size: 9px;
  color: var(--peach);
  letter-spacing: 0.1em;
  margin-bottom: 0.5rem;
  display: block;
  text-transform: uppercase;
}

.parchment-seal {
  position: absolute;
  bottom: 10px;
  right: 10px;
  width: 22px;
  height: 22px;
  color: var(--peach);
  opacity: 0.5;
}

/* ═══════════════════════════════════════════════════════════════════════════
   5. BOOK INSPECTOR MODAL — two-page spread
   ═══════════════════════════════════════════════════════════════════════════ */
.book-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(46,30,36,0.45);
  backdrop-filter: blur(12px) saturate(0.85);
  -webkit-backdrop-filter: blur(12px) saturate(0.85);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s var(--decel);
}
.book-modal-backdrop.is-open {
  opacity: 1;
  pointer-events: auto;
}

.book-spread {
  width: min(92vw, 800px);
  min-height: 460px;
  background: var(--paper-white);
  border: 1px solid var(--peach-border);
  border-radius: 10px;
  box-shadow: var(--elev-4);
  position: relative;
  display: flex;
  overflow: hidden;
  transform: scale(0.88) translateY(28px) rotateX(8deg);
  transition: transform 0.5s var(--ease-quart);
}
.book-modal-backdrop.is-open .book-spread {
  transform: scale(1) translateY(0) rotateX(0);
}

/* Central spine crease shadow */
.book-spread::before {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 28px;
  transform: translateX(-50%);
  background: linear-gradient(to right,
    rgba(46,30,36,0.06) 0%,
    rgba(46,30,36,0.15) 42%,
    rgba(46,30,36,0.20) 50%,
    rgba(46,30,36,0.15) 58%,
    rgba(46,30,36,0.06) 100%);
  pointer-events: none;
  z-index: 3;
}
/* Subtle page curl highlight on right */
.book-spread::after {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  right: 0;
  width: 30px;
  background: linear-gradient(to left, rgba(46,30,36,0.03), transparent);
  pointer-events: none;
  z-index: 2;
}

.book-page {
  flex: 1;
  padding: 2.5rem 2.2rem;
  display: flex;
  flex-direction: column;
  position: relative;
  z-index: 1;
  min-height: 0;
}
.book-page-left {
  border-right: 1px solid rgba(228,199,194,0.4);
  background: linear-gradient(to right, var(--paper-base) 0%, var(--paper-white) 95%);
}
.book-page-right {
  background: linear-gradient(to left, var(--paper-base) 0%, var(--paper-white) 95%);
}

/* Close button — petite circle, top-right */
.book-close {
  position: absolute;
  top: 14px;
  right: 16px;
  width: 30px;
  height: 30px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 50%;
  color: var(--ink-faded);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  transition: all 0.2s ease;
}
.book-close:hover {
  color: var(--peach);
  background: var(--peach-pale);
  border-color: var(--peach-border);
}
.book-close svg {
  width: 16px;
  height: 16px;
}

/* ═══════════════════════════════════════════════════════════════════════════
   6. 3D CARD TILT — mouse-tracking perspective rotation
   ═══════════════════════════════════════════════════════════════════════════ */
.card-3d {
  position: relative;
  transform-style: preserve-3d;
  transition: transform 0.32s var(--ease-gentle), box-shadow 0.32s ease;
  will-change: transform;
}
.card-3d:hover {
  box-shadow: var(--elev-3) !important;
}

/* Sheen glaze — follows cursor */
.card-3d-sheen {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.35s ease;
  background: radial-gradient(
    ellipse at var(--sx, 50%) var(--sy, 50%),
    rgba(255,255,255,0.38) 0%,
    transparent 55%);
  mix-blend-mode: overlay;
  z-index: 2;
}
.card-3d:hover .card-3d-sheen { opacity: 1; }

/* ═══════════════════════════════════════════════════════════════════════════
   7. CRAFT CONTROLS — floating instrument strip
   ═══════════════════════════════════════════════════════════════════════════ */
.craft-strip {
  position: fixed;
  bottom: 22px;
  right: 22px;
  z-index: 995;
  display: flex;
  align-items: center;
  background: rgba(255,253,253,0.88);
  border: 1px solid var(--peach-border);
  border-radius: 28px;
  padding: 5px 8px;
  box-shadow: var(--elev-3),
              0 0 0 1px rgba(255,255,255,0.7);
  backdrop-filter: blur(16px) saturate(1.1);
  -webkit-backdrop-filter: blur(16px) saturate(1.1);
  transition: transform 0.35s var(--ease-quart), opacity 0.35s ease;
  user-select: none;
  gap: 2px;
}
.craft-strip.is-minimized .craft-strip-body { display: none; }
.craft-strip.is-minimized { padding: 5px; }

.craft-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: transparent;
  border: none;
  padding: 5px 10px;
  border-radius: 18px;
  font-family: 'Quicksand', sans-serif;
  font-size: 11px;
  font-weight: 600;
  color: var(--ink-mid);
  cursor: pointer;
  transition: background 0.18s, color 0.18s, transform 0.12s;
  white-space: nowrap;
}
.craft-btn:hover {
  background: var(--peach-pale);
  color: var(--peach);
  transform: translateY(-1px);
}
.craft-btn:active { transform: translateY(0) scale(0.97); }
.craft-btn.is-on {
  background: var(--peach);
  color: #fff;
}
.craft-btn.is-on:hover {
  background: var(--peach-hover);
  color: #fff;
}

.craft-sep {
  width: 1px;
  height: 14px;
  background: var(--peach-border);
  margin: 0 3px;
  flex-shrink: 0;
}

.craft-toggle {
  background: transparent;
  border: none;
  color: var(--peach);
  cursor: pointer;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  flex-shrink: 0;
  transition: transform 0.25s var(--ease-quart), background 0.2s;
}
.craft-toggle:hover {
  background: var(--peach-pale);
  transform: rotate(15deg);
}

/* ═══════════════════════════════════════════════════════════════════════════
   8. SCROLL-LINKED PARALLAX SECTIONS
   ═══════════════════════════════════════════════════════════════════════════ */

/* Sections get subtle depth-shift on scroll, driven by JS custom properties */
[data-parallax] {
  will-change: transform;
  transition: transform 0.1s linear;
}

/* Section dividers get a gentle 3D rotation */
.hk-ribbon-divider {
  perspective: 600px;
}
.hk-ribbon-divider .ribbon-bow {
  transition: transform 0.3s var(--ease-gentle);
}

/* ═══════════════════════════════════════════════════════════════════════════
   9. RESPONSIVE & ACCESSIBILITY
   ═══════════════════════════════════════════════════════════════════════════ */
@media (max-width: 768px) {
  .craft-strip {
    bottom: 14px;
    right: 14px;
    padding: 4px 6px;
  }
  .craft-btn .craft-label { display: none; }
  .parchment-sheet { display: none; }
  .book-spread {
    flex-direction: column;
    width: 95vw;
    min-height: auto;
    max-height: 85vh;
    overflow-y: auto;
  }
  .book-page { padding: 1.8rem 1.4rem; }
  .book-3d-wrap {
    --book-w: 130px;
    --book-h: 185px;
  }
  .flying-raven { width: 80px; height: 52px; }
}

@media (max-width: 480px) {
  .book-3d-anchor { transform: scale(0.85); }
  .craft-strip { bottom: 10px; right: 10px; }
}

@media (prefers-reduced-motion: reduce) {
  .flying-raven,
  .feather-particle,
  .book-3d-wrap,
  .parchment-sheet,
  .perched-raven svg,
  .card-3d {
    transition: none !important;
    animation: none !important;
  }
  .raven-wing-l, .raven-wing-r, .raven-tail-group {
    animation: none !important;
  }
  .book-specular { display: none; }
  .raven-flight-stage { display: none; }
}

/* Print — hide all decorative layers */
@media print {
  .raven-flight-stage,
  .craft-strip,
  .book-3d-anchor,
  .parchment-sheet,
  .perched-raven,
  .book-modal-backdrop { display: none !important; }
}
