/* ==========================================================================
   Brewed Witches — Design tokens
   ========================================================================== */
:root {
  /* Brand colors — warm parchment, espresso brown (not black), deep plum/wine
     as the signature color, with dusty sage + antique gold as small accents. */
  --color-ink:        #2A1810;  /* espresso brown, replaces near-black */
  --color-wine-900:   #3B1D33;  /* deep plum, dark */
  --color-wine-800:   #4C2340;  /* deep plum */
  --color-wine-700:   #5C2A4D;  /* signature plum/wine */
  --color-wine-600:   #71365F;
  --color-wine-500:   #8B4571;

  --color-cream-50:   #FBF6EC;
  --color-cream-100:  #F3E8D6;
  --color-cream-200:  #E9D8BC;

  --color-gold:        #AD8A46;  /* antique gold, muted */
  --color-gold-deep:   #7C5E2C;
  --color-gold-light:  #D4B876;

  --color-sage:       #8B9A7C;  /* dusty sage */
  --color-sage-dark:  #5E6A52;   /* darkened a touch so small sage text passes 4.5:1 on cream */

  --color-text:        #2B1A14;  /* warm espresso-toned text, not cool black */
  --color-text-muted:  #6B584C;
  --color-text-on-dark: #F3E8D6;
  --color-text-on-dark-muted: #CBB9A9;

  --color-border: rgba(43, 26, 20, 0.12);
  --color-border-dark: rgba(243, 232, 214, 0.16);
  --color-field-border: #8A7767;                    /* form fields: 3:1 against the page, so the box can be seen */
  --color-field-border-dark: rgba(243, 232, 214, 0.6);

  /* Type */
  --font-display: "Playfair Display", Georgia, serif;
  --font-body: "Jost", "Segoe UI", sans-serif;

  --fs-xs: 0.8125rem;
  --fs-sm: 0.9375rem;
  --fs-base: 1rem;
  --fs-md: 1.125rem;
  --fs-lg: clamp(1.25rem, 1.1rem + 0.6vw, 1.5rem);
  --fs-xl: clamp(1.6rem, 1.3rem + 1.2vw, 2.1rem);
  --fs-2xl: clamp(2rem, 1.6rem + 1.8vw, 2.75rem);
  --fs-3xl: clamp(2.5rem, 1.9rem + 2.6vw, 3.5rem);
  --fs-4xl: clamp(3rem, 2rem + 4vw, 4.75rem);

  /* Space */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.5rem;
  --space-6: 2rem;
  --space-7: 3rem;
  --space-8: 4rem;
  --space-9: 6rem;
  --space-10: 8rem;

  --radius-sm: 8px;
  --radius-md: 16px;
  --radius-lg: 28px;
  --radius-pill: 999px;

  --shadow-sm: 0 2px 10px rgba(42, 24, 16, 0.08);
  --shadow-md: 0 12px 32px rgba(42, 24, 16, 0.14);
  --shadow-lg: 0 24px 60px rgba(42, 24, 16, 0.22);

  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --dur-fast: 180ms;
  --dur-base: 320ms;
  --dur-slow: 600ms;

  --header-h: 76px;
}

/* ==========================================================================
   Reset
   ========================================================================== */
*, *::before, *::after { box-sizing: border-box; }
html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}
body {
  margin: 0;
  font-family: var(--font-body);
  font-size: var(--fs-base);
  line-height: 1.65;
  color: var(--color-text);
  background: var(--color-cream-50);
  overflow-x: hidden;
  position: relative;
}
/* Faint parchment grain — a very quiet paper texture, not a flat digital cream */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.05;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 180px 180px;
}
img { max-width: 100%; display: block; }
h1, h2, h3, h4 { font-family: var(--font-display); line-height: 1.15; margin: 0 0 var(--space-4); font-weight: 700; }
p { margin: 0 0 var(--space-4); }
a { color: inherit; text-decoration: none; }
ul { list-style: none; margin: 0; padding: 0; }
button { font: inherit; cursor: pointer; }
input, textarea { font: inherit; }
address { font-style: normal; }

section[id] { scroll-margin-top: var(--header-h); }

.container {
  width: 100%;
  max-width: 1180px;
  margin-inline: auto;
  padding-inline: var(--space-5);
}

.sr-only, .visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  left: var(--space-4);
  top: -60px;
  background: var(--color-wine-700);
  color: var(--color-cream-50);
  padding: var(--space-3) var(--space-5);
  border-radius: var(--radius-sm);
  z-index: 1000;
  transition: top var(--dur-fast) var(--ease-out);
}
.skip-link:focus { top: var(--space-4); }

/* Accessible, visible focus rings everywhere */
/* Two-tone focus ring: a plum line for light backgrounds plus a cream halo that shows on the dark plum sections */
a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--color-wine-700);
  outline-offset: 3px;
  box-shadow: 0 0 0 3px var(--color-cream-50);
  border-radius: 4px;
}

/* The native [hidden] behaviour must win over any author display rule below */
[hidden] { display: none !important; }

/* ==========================================================================
   Reusable bits
   ========================================================================== */
.icon { flex-shrink: 0; }
.icon-lg { width: 28px; height: 28px; }
.icon-xl { width: 36px; height: 36px; }
.moon-rating .icon { width: 20px; height: 20px; }

/* Signature motifs: a steaming cup (coffee) and a gently turning page (books).
   Both are transform/opacity only, and both freeze under reduced motion. */
.steam-cup { position: relative; display: inline-flex; }
.steam-wisp {
  position: absolute;
  left: 50%;
  bottom: 78%;
  width: 2px;
  height: 10px;
  border-radius: 2px;
  background: linear-gradient(180deg, transparent, currentColor 55%, transparent);
  opacity: 0.55;
  transform-origin: bottom center;
}
.steam-wisp:nth-child(1) { transform: translateX(-4px); }
.steam-wisp:nth-child(2) { transform: translateX(0px); }
.steam-wisp:nth-child(3) { transform: translateX(4px); }
@media (prefers-reduced-motion: no-preference) {
  .steam-wisp { animation: steam-rise 2.6s ease-in-out infinite; }
  .steam-wisp:nth-child(1) { animation-delay: 0s; }
  .steam-wisp:nth-child(2) { animation-delay: 0.5s; }
  .steam-wisp:nth-child(3) { animation-delay: 1s; }
}
@keyframes steam-rise {
  0%   { opacity: 0; transform: translate(-4px, 0) scaleY(0.6) skewX(0deg); }
  30%  { opacity: 0.6; }
  65%  { opacity: 0.4; transform: translate(-6px, -9px) scaleY(1.1) skewX(-6deg); }
  100% { opacity: 0; transform: translate(-2px, -16px) scaleY(0.8) skewX(4deg); }
}

/* Twinkling star clusters — used by The Coven eyebrow and the header brand mark */
.twinkle-set .icon { color: var(--color-gold); }
@media (prefers-reduced-motion: no-preference) {
  .twinkle-set .icon { animation: twinkle 2.4s ease-in-out infinite; transform-origin: center; }
  .twinkle-a { animation-delay: 0s !important; }
  .twinkle-b { animation-delay: 0.5s !important; }
  .twinkle-c { animation-delay: 1s !important; }
}
@keyframes twinkle {
  0%, 100% { opacity: 0.35; transform: scale(0.7); }
  50% { opacity: 1; transform: scale(1.2); }
}

.star-cluster {
  position: relative;
  display: inline-flex;
  width: 24px; height: 16px;
}
.star-cluster .twinkle-a { position: absolute; left: 0; top: 1px; }
.star-cluster .twinkle-b { position: absolute; left: 13px; top: -2px; }
.star-cluster .twinkle-c { position: absolute; left: 17px; top: 9px; }

.brand-sparkle {
  position: relative;
  display: inline-flex;
  width: 14px; height: 16px;
  margin-left: -2px;
}
.brand-sparkle .twinkle-a { position: absolute; left: 0; top: 0; }
.brand-sparkle .twinkle-b { position: absolute; left: 6px; top: 9px; }

/* A grimoire whose cover swings open on its spine, then closes again */
.grimoire-flip { display: inline-flex; perspective: 40px; color: var(--color-wine-700); }
.grimoire-cover { transform-box: fill-box; transform-origin: 0% 50%; backface-visibility: hidden; }
@media (prefers-reduced-motion: no-preference) {
  .grimoire-cover { animation: grimoire-cover-flip 6s ease-in-out infinite; }
}
@keyframes grimoire-cover-flip {
  0%, 55%, 100% { transform: rotateY(0deg); }
  70%, 85% { transform: rotateY(-155deg); }
}

/* A cauldron with little bubbles popping up */
.cauldron-pot { position: relative; display: inline-flex; color: var(--color-wine-700); }
.cauldron-bubble {
  position: absolute;
  left: 50%;
  bottom: 82%;
  width: 3px; height: 3px;
  border-radius: 50%;
  background: var(--color-sage-dark);
  opacity: 0;
}
@media (prefers-reduced-motion: no-preference) {
  .cauldron-bubble { animation: bubble-rise 2.4s ease-in infinite; }
  .cauldron-bubble:nth-child(2) { animation-delay: 0.7s; }
  .cauldron-bubble:nth-child(3) { animation-delay: 1.4s; }
}
@keyframes bubble-rise {
  0%   { opacity: 0; transform: translate(-4px, 0) scale(0.6); }
  25%  { opacity: 0.9; }
  70%  { opacity: 0.5; transform: translate(2px, -9px) scale(1); }
  100% { opacity: 0; transform: translate(-2px, -15px) scale(0.4); }
}

/* A calendar page that flips over, then reverts back */
.calendar-flip { display: inline-flex; perspective: 34px; }
.calendar-page { transform-box: fill-box; transform-origin: 50% 0%; backface-visibility: hidden; }
@media (prefers-reduced-motion: no-preference) {
  .calendar-page { animation: calendar-page-flip 5s ease-in-out infinite; }
}
@keyframes calendar-page-flip {
  0%, 74%, 100% { transform: rotateX(0deg); }
  84%, 90% { transform: rotateX(-165deg); }
}

/* A cat that perks up and tilts its head every so often */
.cat-wiggle { display: inline-flex; }
@media (prefers-reduced-motion: no-preference) {
  .cat-wiggle .icon { animation: cat-tilt 5s ease-in-out infinite; transform-origin: 50% 85%; }
}
@keyframes cat-tilt {
  0%, 82%, 100% { transform: rotate(0deg); }
  86% { transform: rotate(-10deg); }
  90% { transform: rotate(7deg); }
  94% { transform: rotate(-4deg); }
  97% { transform: rotate(0deg); }
}

/* An envelope whose flap lifts open, holds for ~2s, then closes again */
.mail-flutter { display: inline-flex; }
.mail-flutter .mail-flap { d: path("M4 6 12 13 20 6"); }
@media (prefers-reduced-motion: no-preference) {
  .mail-flutter .mail-flap { animation: mail-open-close 6.3s ease-in-out infinite; }
}
@keyframes mail-open-close {
  0%, 55%   { d: path("M4 6 12 13 20 6"); }
  62%, 94%  { d: path("M4 6 12 1 20 6"); }
  100%      { d: path("M4 6 12 13 20 6"); }
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.4em;
  font-family: var(--font-body);
  font-size: var(--fs-xs);
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--color-wine-700);
  margin-bottom: var(--space-3);
}
.eyebrow-light { color: var(--color-gold-light); }

.section-head { max-width: 620px; margin-bottom: var(--space-7); }
.section-head.split {
  max-width: none;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--space-5);
  flex-wrap: wrap;
}
.section-lede { color: var(--color-text-muted); font-size: var(--fs-md); margin-bottom: 0; }

.section { padding-block: var(--space-9); }

.text-link {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-weight: 600;
  color: var(--color-wine-700);
  border-bottom: 1px solid transparent;
  transition: gap var(--dur-fast) var(--ease-out), border-color var(--dur-fast);
  min-height: 44px;
  align-items: center;
}
.text-link:hover, .text-link:focus-visible { gap: var(--space-3); border-color: currentColor; }
.text-link .icon { transition: transform var(--dur-fast) var(--ease-out); }
.text-link:hover .icon { transform: translateX(2px); }

.section-cta { text-align: center; margin-top: var(--space-8); }

/* Buttons — min 44px touch target */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  min-height: 48px;
  padding: 0 var(--space-6);
  border-radius: var(--radius-pill);
  font-weight: 600;
  font-size: var(--fs-sm);
  border: 1px solid transparent;
  transition: transform var(--dur-fast) var(--ease-out), box-shadow var(--dur-fast) var(--ease-out), background var(--dur-fast), color var(--dur-fast);
  white-space: nowrap;
}
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0); }

.btn-primary { background: var(--color-wine-700); color: var(--color-cream-50); }
.btn-primary:hover { background: var(--color-wine-600); box-shadow: var(--shadow-md); }

.btn-outline { background: transparent; color: var(--color-wine-700); border-color: var(--color-wine-700); }
.btn-outline:hover { background: var(--color-wine-700); color: var(--color-cream-50); }

.btn-outline-light { color: var(--color-cream-50); border-color: rgba(243,233,215,0.55); }
.btn-outline-light:hover { background: var(--color-cream-50); color: var(--color-wine-800); }

.btn-gold { background: var(--color-gold); color: var(--color-ink); }
.btn-gold:hover { background: var(--color-gold-light); box-shadow: 0 10px 26px rgba(201,162,39,0.35); }

/* The raven: a flock of front-facing silhouettes (built by initRavens in
   js/main.js) that burst off the "Send the Raven" button on hover / focus and
   when a message is sent, each following its own curved flight path. */
.raven-slot {
  position: relative;
  display: flex;
  align-items: center;
  width: fit-content;
  max-width: 100%;
  min-height: 60px;
}
.raven-flock {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  z-index: 3;
  pointer-events: none;
}
.raven-fly {
  position: absolute;
  top: 0;
  left: 0;
  opacity: 0;
  offset-distance: 0%;
  offset-rotate: 0deg;
  transform: scale(0.25);
}
.raven-svg { display: block; overflow: visible; fill: var(--color-ink); }
.rv-wing { transform-box: view-box; transform-origin: 58px 12px; }
@media (prefers-reduced-motion: no-preference) {
  .raven-btn:hover ~ .raven-flock .raven-fly,
  .raven-btn:focus-visible ~ .raven-flock .raven-fly,
  .raven-slot.is-launching .raven-fly {
    animation: raven-launch 1.5s cubic-bezier(0.36, 0.66, 0.4, 1) both;
  }
  .raven-btn:hover ~ .raven-flock .rv-wing,
  .raven-btn:focus-visible ~ .raven-flock .rv-wing,
  .raven-slot.is-launching .rv-wing {
    animation: raven-wing-flap 0.22s ease-in-out infinite alternate;
  }
  .raven-sent { animation: raven-sent-in 0.6s var(--ease-out) both; }
  .raven-sent-icon svg { animation: raven-settle 0.9s var(--ease-out) both; }
}
@keyframes raven-launch {
  0%   { offset-distance: 0%;   opacity: 0; transform: scale(0.25); }
  10%  { offset-distance: 8%;   opacity: 1; transform: scale(0.7); }
  60%  { offset-distance: 60%;  opacity: 1; transform: scale(1); }
  100% { offset-distance: 100%; opacity: 0; transform: scale(1.25); }
}
@keyframes raven-wing-flap {
  from { transform: rotate(20deg); }
  to   { transform: rotate(-14deg); }
}
@keyframes raven-sent-in {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes raven-settle {
  from { transform: translateY(-10px) scale(0.85); opacity: 0; }
  to   { transform: translateY(0) scale(1); opacity: 1; }
}

/* "The raven has been sent." — takes the button's place */
.raven-sent { margin: 0; gap: var(--space-3); flex-wrap: wrap; }
.raven-sent-icon { flex: none; display: inline-flex; }
.raven-sent-icon .raven-svg { width: 58px; height: auto; }
.raven-sent-text { line-height: 1.35; }
.raven-sent-text strong { font-family: var(--font-display); font-size: var(--fs-md); font-weight: 700; display: block; }
.raven-again {
  background: none; border: 0; padding: 0; margin-left: var(--space-2);
  font: inherit; font-size: var(--fs-sm); font-weight: 600;
  color: var(--color-wine-700); text-decoration: underline; text-underline-offset: 3px;
  cursor: pointer;
}
.raven-again:hover { color: var(--color-wine-800); }

@media (prefers-reduced-motion: no-preference) {
  .reveal {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity var(--dur-slow) var(--ease-out), transform var(--dur-slow) var(--ease-out);
  }
  .reveal.is-visible { opacity: 1; transform: translateY(0); }
}

/* ==========================================================================
   Header
   ========================================================================== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 500;
  height: var(--header-h);
  display: flex;
  align-items: center;
  background: rgba(251, 246, 236, 0.7);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid transparent;
  transition: background var(--dur-base), border-color var(--dur-base), box-shadow var(--dur-base);
}
.site-header.is-scrolled {
  background: rgba(251, 246, 236, 0.92);
  border-color: var(--color-border);
  box-shadow: var(--shadow-sm);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
}

.brand { display: inline-flex; align-items: center; gap: var(--space-3); flex-shrink: 0; }
.brand-mark {
  width: 44px; height: 44px;
  border-radius: 50%;
  object-fit: contain;
  transform: scale(0.78);
  flex-shrink: 0;
}
.brand-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--color-wine-800);
  letter-spacing: 0.01em;
  white-space: nowrap;
}

.primary-nav ul {
  display: flex;
  align-items: center;
  gap: clamp(1rem, 2vw, 2rem);
}
.primary-nav a:not(.nav-cta) {
  font-size: clamp(0.85rem, 0.7rem + 0.3vw, var(--fs-sm));
  font-weight: 500;
  color: var(--color-text);
  position: relative;
  padding: var(--space-2) 0;
  white-space: nowrap;
  display: inline-block;
  transition: color var(--dur-fast) var(--ease-out), transform var(--dur-fast) var(--ease-out);
}
.primary-nav a:not(.nav-cta):hover,
.primary-nav a:not(.nav-cta):focus-visible {
  color: var(--color-wine-700);
  transform: translateY(-1px);
}
.primary-nav a:not(.nav-cta)::after {
  content: "";
  position: absolute;
  left: 0; right: 100%;
  bottom: 0;
  height: 2px;
  background: var(--color-gold);
  transition: right var(--dur-base) var(--ease-out);
}
.primary-nav a:not(.nav-cta):hover::after,
.primary-nav a:not(.nav-cta):focus-visible::after { right: 0; }

.nav-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 44px;
  padding: 0 var(--space-6);
  font-size: clamp(0.85rem, 0.7rem + 0.3vw, var(--fs-sm));
  font-weight: 600;
  background: var(--color-wine-700);
  color: var(--color-cream-50) !important;
  border-radius: var(--radius-pill);
  flex-shrink: 0;
  white-space: nowrap;
  letter-spacing: 0.01em;
  position: relative;
  transition: background var(--dur-fast), transform var(--dur-fast), box-shadow var(--dur-fast);
}
.nav-cta:hover { background: var(--color-wine-600); transform: translateY(-1px); }
.nav-cta .icon { animation: none !important; color: var(--color-gold-light); transform-origin: center; }
@media (prefers-reduced-motion: no-preference) {
  .nav-cta { animation: nav-cta-glow 2.6s ease-in-out infinite; }
  .nav-cta .icon { animation: twinkle 2.6s ease-in-out infinite !important; }
  .nav-cta-star-a { animation-delay: 0s !important; }
  .nav-cta-star-b { animation-delay: 0.9s !important; }
}
@keyframes nav-cta-glow {
  0%, 100% { box-shadow: 0 0 0 rgba(212, 184, 118, 0); transform: scale(1); }
  50% { box-shadow: 0 0 22px 5px rgba(212, 184, 118, 0.65); transform: scale(1.04); }
}

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 44px; height: 44px;
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
}
.nav-toggle-bar {
  width: 22px; height: 2px;
  background: var(--color-wine-800);
  border-radius: 2px;
  transition: transform var(--dur-fast) var(--ease-out), opacity var(--dur-fast) var(--ease-out);
}
.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ==========================================================================
   Hero
   ========================================================================== */
.hero {
  position: relative;
  min-height: 92vh;
  display: flex;
  align-items: center;
  overflow: hidden;
  background: radial-gradient(120% 100% at 50% 0%, var(--color-wine-800) 0%, var(--color-ink) 70%);
  isolation: isolate;
}
.hero-media { position: absolute; inset: 0; z-index: -1; }
.hero-video {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 900ms var(--ease-out);
}
.hero-video.is-loaded { opacity: 0.55; }
.hero-media-overlay {
  position: absolute; inset: 0;
  background:
    linear-gradient(180deg, rgba(36,16,26,0.55) 0%, rgba(36,16,26,0.75) 55%, var(--color-ink) 100%),
    radial-gradient(80% 60% at 50% 20%, rgba(122,41,68,0.35), transparent 70%);
}

.sparkles { position: absolute; inset: 0; overflow: hidden; }
.spark {
  position: absolute;
  width: 4px; height: 4px;
  background: var(--color-gold-light);
  border-radius: 50%;
  box-shadow: 0 0 8px 2px rgba(228, 199, 102, 0.7);
  opacity: 0;
}
@media (prefers-reduced-motion: no-preference) {
  .spark { animation: drift 9s ease-in-out infinite; }
  .spark:nth-child(1) { left: 8%;  top: 70%; animation-delay: 0s;   animation-duration: 10s; }
  .spark:nth-child(2) { left: 18%; top: 30%; animation-delay: 1.2s; animation-duration: 8s; }
  .spark:nth-child(3) { left: 27%; top: 55%; animation-delay: 2.4s; animation-duration: 11s; }
  .spark:nth-child(4) { left: 38%; top: 20%; animation-delay: 0.6s; animation-duration: 9s; }
  .spark:nth-child(5) { left: 48%; top: 65%; animation-delay: 3s;   animation-duration: 12s; }
  .spark:nth-child(6) { left: 58%; top: 35%; animation-delay: 1.8s; animation-duration: 8.5s; }
  .spark:nth-child(7) { left: 67%; top: 75%; animation-delay: 2.6s; animation-duration: 10.5s; }
  .spark:nth-child(8) { left: 76%; top: 25%; animation-delay: 0.3s; animation-duration: 9.5s; }
  .spark:nth-child(9) { left: 85%; top: 60%; animation-delay: 3.4s; animation-duration: 11.5s; }
  .spark:nth-child(10){ left: 93%; top: 40%; animation-delay: 1.5s; animation-duration: 8.8s; }
  .spark:nth-child(11){ left: 12%; top: 45%; animation-delay: 4s;   animation-duration: 13s; }
  .spark:nth-child(12){ left: 62%; top: 15%; animation-delay: 2s;   animation-duration: 9.2s; }
}
@keyframes drift {
  0%   { opacity: 0; transform: translate(0,0) scale(0.6); }
  15%  { opacity: 0.9; }
  50%  { transform: translate(6px, -34px) scale(1); }
  85%  { opacity: 0.6; }
  100% { opacity: 0; transform: translate(-4px, -68px) scale(0.5); }
}

.hero-content { position: relative; text-align: center; padding-block: var(--space-9); }
.hero-content h1 {
  color: var(--color-cream-50);
  font-size: var(--fs-4xl);
  font-style: normal;
  max-width: 16ch;
  margin-inline: auto;
  margin-bottom: var(--space-5);
  text-wrap: balance;
}
.hero-sub {
  color: var(--color-text-on-dark-muted);
  font-size: var(--fs-md);
  max-width: 46ch;
  margin-inline: auto;
  margin-bottom: var(--space-7);
}
/* One main action (the big gold button), a short reassurance line, and a quiet link */
.hero-actions { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--space-3); }
.btn-hero { min-height: 56px; padding-inline: var(--space-7); font-size: var(--fs-md, 1.1rem); box-shadow: 0 10px 30px rgba(0, 0, 0, 0.28); }
.hero-note { margin: 0; font-size: var(--fs-sm); color: var(--color-text-on-dark); opacity: 0.92; }
.hero-link {
  display: inline-flex; align-items: center; gap: 6px; margin-top: var(--space-2);
  color: var(--color-text-on-dark); font-weight: 500; text-decoration: underline; text-underline-offset: 4px; text-decoration-thickness: 1px;
}
.hero-link:hover, .hero-link:focus-visible { color: var(--color-gold-light); }

.scroll-cue {
  position: absolute;
  left: 50%;
  bottom: var(--space-6);
  transform: translateX(-50%);
  color: var(--color-cream-100);
  opacity: 0.7;
  width: 44px; height: 44px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  border: 1px solid var(--color-border-dark);
  transition: opacity var(--dur-fast), border-color var(--dur-fast);
}
.scroll-cue:hover, .scroll-cue:focus-visible { opacity: 1; border-color: var(--color-gold-light); }
@media (prefers-reduced-motion: no-preference) {
  .scroll-cue { animation: bob 2.4s ease-in-out infinite; }
}
@keyframes bob { 0%,100% { transform: translate(-50%, 0); } 50% { transform: translate(-50%, 8px); } }

/* ==========================================================================
   The Coven
   ========================================================================== */
.coven { background: var(--color-cream-50); }
.coven-copy-solo { max-width: 760px; margin-inline: auto; text-align: center; }
.coven-copy-solo .eyebrow { justify-content: center; }
.coven-copy p { color: var(--color-text-muted); }
.coven-copy-solo p { max-width: 62ch; margin-inline: auto; }
.coven-values {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-5);
  margin-top: var(--space-7);
  text-align: left;
}
.value-card {
  padding: var(--space-5);
  background: var(--color-cream-100);
  border-radius: var(--radius-md);
  border-top: 3px solid var(--accent, var(--color-wine-700));
  transition: transform var(--dur-base) var(--ease-out), box-shadow var(--dur-base) var(--ease-out);
}
.value-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-sm); }
.value-card .icon-lg { color: var(--accent, var(--color-wine-700)); margin-bottom: var(--space-3); }
.value-card h3 { font-size: var(--fs-md); margin-bottom: var(--space-2); }
.value-card p { color: var(--color-text-muted); font-size: var(--fs-sm); margin-bottom: 0; }

/* ==========================================================================
   The Grimoire
   ========================================================================== */
.grimoire { background: var(--color-cream-100); }
.book-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-5);
}
.book-card {
  background: var(--color-cream-50);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: transform var(--dur-base) var(--ease-out), box-shadow var(--dur-base) var(--ease-out);
}
.book-card:hover { transform: translateY(-6px) rotate(-0.4deg); box-shadow: var(--shadow-md); }
.book-cover {
  aspect-ratio: 3 / 4;
  padding: var(--space-5);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  background: linear-gradient(160deg, var(--cover-a, #6E1E3A), var(--cover-b, #2B0F1C));
  color: var(--cover-fg, var(--color-cream-50));   /* lib/views.php cover_vars() keeps this readable on any colour */
  position: relative;
}
.book-cover::before {
  content: "";
  position: absolute; inset: 10px;
  border: 1px solid rgba(243,233,215,0.35);
  border-radius: 6px;
  pointer-events: none;
}
.book-genre {
  align-self: flex-start;
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: var(--cover-chip, rgba(251,246,236,0.16));
  border: 1px solid var(--cover-chip-line, rgba(251,246,236,0.4));
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  margin-bottom: var(--space-4);
}
.book-cover h3 { font-size: var(--fs-md); margin-bottom: var(--space-1); }
.book-author { font-size: var(--fs-xs); color: var(--cover-fg, var(--color-cream-50)); margin: 0; }
.book-body { padding: var(--space-5); }
.moon-rating { display: flex; gap: 7px; margin-bottom: var(--space-3); }
.moon-rating .icon { filter: drop-shadow(0 1px 2px rgba(42, 24, 16, 0.3)); }
.book-body p { color: var(--color-text-muted); font-size: var(--fs-sm); }

/* ==========================================================================
   Currently Brewing
   ========================================================================== */
.brewing { background: var(--color-cream-50); }
.brewing-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-5);
}
.brew-card {
  padding: var(--space-6);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  transition: transform var(--dur-base) var(--ease-out), border-color var(--dur-base);
}
.brew-card:hover { transform: translateY(-4px); border-color: var(--color-gold); }
.brew-tag {
  display: inline-block;
  font-size: var(--fs-xs);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-wine-700);
  background: var(--color-cream-200);
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  margin-bottom: var(--space-4);
}
.brew-card h3 { font-size: var(--fs-md); margin-bottom: var(--space-2); }
.brew-card time { display: block; font-size: var(--fs-xs); color: var(--color-text-muted); margin-bottom: var(--space-3); }
.brew-card p { color: var(--color-text-muted); font-size: var(--fs-sm); margin-bottom: 0; }

/* ==========================================================================
   The Cauldron
   ========================================================================== */
.cauldron { background: var(--color-cream-100); }
.location-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-5);
}
.location-card {
  background: var(--color-cream-50);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: transform var(--dur-base) var(--ease-out), box-shadow var(--dur-base) var(--ease-out);
}
.location-card:hover { transform: translateY(-6px); box-shadow: var(--shadow-md); }
.location-media {
  aspect-ratio: 16 / 9;
  display: flex; align-items: center; justify-content: center;
  background: radial-gradient(120% 120% at 20% 0%, rgba(122,41,68,0.16), transparent 60%), var(--color-cream-200);
  color: var(--color-wine-700);
}
.location-body { padding: var(--space-5); }
.location-body h3 { font-size: var(--fs-md); margin-bottom: var(--space-1); }
.location-area { color: var(--color-gold-deep); font-size: var(--fs-xs); font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; margin-bottom: var(--space-3); }
.location-review { font-size: var(--fs-sm); color: var(--color-text-muted); margin-bottom: 0; }
.location-tags { display: flex; flex-wrap: wrap; gap: var(--space-2); margin-top: var(--space-4); }
.location-tags li {
  font-size: var(--fs-xs);
  padding: 4px 10px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-pill);
  color: var(--color-text-muted);
}

/* ==========================================================================
   Gatherings
   ========================================================================== */
.gatherings { background: var(--color-cream-50); }
.gatherings-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: var(--space-6);
  align-items: stretch;
}
.gathering-featured {
  background: linear-gradient(150deg, var(--color-wine-700), var(--color-wine-900));
  color: var(--color-cream-50);
  padding: var(--space-7);
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
}
.gathering-featured .brew-tag { background: rgba(251,246,236,0.14); color: var(--color-gold-light); }
.gathering-featured h3 { font-size: var(--fs-xl); }
.gathering-featured p { color: var(--color-text-on-dark-muted); }
.gathering-meta { display: flex; gap: var(--space-8); margin: var(--space-3) 0 var(--space-6); }
.gathering-meta dt { font-size: var(--fs-xs); text-transform: uppercase; letter-spacing: 0.06em; color: var(--color-gold-light); margin-bottom: var(--space-1); }
.gathering-meta dd { margin: 0; font-weight: 500; }
.gathering-featured .btn-primary { align-self: flex-start; margin-top: auto; background: var(--color-gold); color: var(--color-ink); }
.gathering-featured .btn-primary:hover { background: var(--color-gold-light); }

.gathering-list {
  background: var(--color-cream-100);
  border-radius: var(--radius-lg);
  padding: var(--space-7);
  display: flex;
  flex-direction: column;
}
.gathering-list h3 { font-size: var(--fs-md); margin-bottom: var(--space-4); }
.gathering-list ul { margin-bottom: var(--space-5); }
.gathering-list li {
  display: flex;
  justify-content: space-between;
  gap: var(--space-3);
  padding: var(--space-4) 0;
  border-bottom: 1px solid var(--color-border);
  font-size: var(--fs-sm);
}
.gathering-list li:last-child { border-bottom: none; }
.gathering-list time { color: var(--color-text-muted); }
.gathering-list .text-link { margin-top: auto; }

/* ==========================================================================
   The Witch List (dark band)
   ========================================================================== */
.witch-list {
  background: radial-gradient(120% 140% at 50% 0%, var(--color-wine-800), var(--color-ink) 70%);
  color: var(--color-cream-50);
  text-align: center;
  position: relative;
  overflow: hidden;
}
.witch-list-inner { max-width: 560px; }

/* A moon that slowly waxes and wanes on loop, above "Join the Coven" */
.phase-moon {
  position: relative;
  display: block;
  width: 40px; height: 40px;
  margin: 0 auto var(--space-4);
  border-radius: 50%;
  overflow: hidden;
  background: radial-gradient(circle at 35% 30%, #F0DBA0, #C9A24B 55%, #7C5E2C 100%);
  box-shadow: 0 0 16px rgba(212, 184, 118, 0.45);
}
.phase-moon-shadow {
  position: absolute;
  inset: 0;
  background: var(--color-ink);
  border-radius: 50%;
}
@media (prefers-reduced-motion: no-preference) {
  .phase-moon-shadow { animation: moon-phase-cycle 9s ease-in-out infinite; }
}
@keyframes moon-phase-cycle {
  0%   { transform: translateX(0%); }
  50%  { transform: translateX(-100%); }
  100% { transform: translateX(0%); }
}

.witch-list h2 { color: var(--color-cream-50); }
.witch-list p { color: var(--color-text-on-dark-muted); }

.newsletter-form {
  display: flex;
  gap: var(--space-3);
  margin: var(--space-6) 0 var(--space-4);
}
.newsletter-form input {
  flex: 1;
  min-height: 48px;
  padding: 0 var(--space-5);
  border-radius: var(--radius-pill);
  border: 1px solid var(--color-field-border-dark);
  background: rgba(251,246,236,0.08);
  color: var(--color-cream-50);
}
.newsletter-form input::placeholder { color: var(--color-text-on-dark-muted); }
.newsletter-form input:focus-visible { outline: 2px solid var(--color-gold); outline-offset: 2px; }

.form-note { font-size: var(--fs-xs); color: var(--color-text-on-dark-muted); }
.form-note a { text-decoration: underline; color: var(--color-gold-light); }
.form-success {
  display: flex; align-items: center; justify-content: center; gap: var(--space-2);
  color: var(--color-gold-light);
  font-weight: 500;
  margin-top: var(--space-3);
}

/* ==========================================================================
   Our Familiar Favourites
   ========================================================================== */
.favourites { background: var(--color-cream-50); }
.favourites-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-5);
}
.favourite-card {
  position: relative;
  padding: var(--space-6) var(--space-5) var(--space-5);
  background: var(--color-cream-100);
  border-radius: var(--radius-md);
  border-top: 3px solid var(--accent, var(--color-wine-700));
  transition: transform var(--dur-base) var(--ease-out), box-shadow var(--dur-base) var(--ease-out);
}
.favourite-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-sm); }
.favourite-card .icon-xl { color: var(--accent, var(--color-wine-700)); margin-bottom: var(--space-4); }
.favourite-card h3 { font-size: var(--fs-md); margin-bottom: var(--space-2); }
.favourite-card p { color: var(--color-text-muted); font-size: var(--fs-sm); margin-bottom: 0; }
.favourite-tag {
  display: inline-block;
  font-size: 0.7rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent, var(--color-wine-700));
  font-weight: 600;
  margin-bottom: var(--space-2);
}

/* ==========================================================================
   Summon Us
   ========================================================================== */
.summon-us { background: var(--color-cream-100); }
.summon-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: var(--space-9);
}
.form-row { margin-bottom: var(--space-5); }
.form-row label {
  display: block;
  font-size: var(--fs-sm);
  font-weight: 600;
  margin-bottom: var(--space-2);
  color: var(--color-wine-800);
}
.form-row input, .form-row textarea {
  width: 100%;
  padding: var(--space-3) var(--space-4);
  min-height: 48px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--color-field-border);
  background: var(--color-cream-50);
  color: var(--color-text);
  transition: border-color var(--dur-fast);
}
.form-row textarea { min-height: 120px; resize: vertical; }
.form-row input:focus-visible, .form-row textarea:focus-visible { border-color: var(--color-wine-700); }
#contactForm .form-success { color: var(--color-wine-700); justify-content: flex-start; }

/* Form error messages — shown under the field instead of the browser pop-up */
.field-error {
  display: flex; align-items: flex-start; gap: var(--space-2);
  margin: var(--space-2) 0 0;
  font-size: var(--fs-sm); font-weight: 500; line-height: 1.4;
  color: var(--color-wine-700);
}
.field-error::before {
  content: "\2726";            /* a little four-point star */
  flex: none;
  color: var(--color-gold);
  font-size: 0.85em;
  line-height: 1.6;
}
input[aria-invalid="true"], textarea[aria-invalid="true"] {
  border-color: var(--color-wine-600);
  box-shadow: 0 0 0 3px rgba(92, 42, 77, 0.14);
}
/* on the dark newsletter band */
.newsletter-form + .field-error {
  justify-content: center;
  margin: calc(var(--space-2) * -1) 0 var(--space-4);
  color: var(--color-gold-light);
}
.newsletter-form input[aria-invalid="true"] {
  border-color: var(--color-gold-light);
  box-shadow: 0 0 0 3px rgba(212, 184, 118, 0.22);
}
@media (prefers-reduced-motion: no-preference) {
  .field-error:not([hidden]) { animation: field-error-in 0.35s var(--ease-out) both; }
  input[aria-invalid="true"], textarea[aria-invalid="true"] { animation: field-nudge 0.4s var(--ease-out); }
}
@keyframes field-error-in { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: translateY(0); } }
@keyframes field-nudge {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-4px); }
  60% { transform: translateX(3px); }
}

.summon-info {
  background: var(--color-cream-50);
  border-radius: var(--radius-lg);
  padding: var(--space-7);
  height: fit-content;
}
.summon-info h3 { font-size: var(--fs-md); margin-bottom: var(--space-5); }
.summon-info ul { display: flex; flex-direction: column; gap: var(--space-4); }
.summon-info li { display: flex; align-items: center; gap: var(--space-3); font-size: var(--fs-sm); color: var(--color-text-muted); }
.summon-info .icon { color: var(--color-wine-700); }
.summon-info a { font-weight: 600; color: var(--color-wine-700); }
.summon-info a:hover { text-decoration: underline; }

/* ==========================================================================
   Footer
   ========================================================================== */
.site-footer { background: var(--color-ink); color: var(--color-text-on-dark-muted); padding-top: var(--space-9); }
.footer-inner { display: grid; grid-template-columns: 1fr 2fr; gap: var(--space-8); padding-bottom: var(--space-8); border-bottom: 1px solid var(--color-border-dark); }
.footer-brand .brand-name { color: var(--color-cream-50); }
.footer-brand p { margin-top: var(--space-4); font-size: var(--fs-sm); max-width: 32ch; }
.footer-nav { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--space-6); }
.footer-nav h4 { font-family: var(--font-body); font-size: var(--fs-xs); text-transform: uppercase; letter-spacing: 0.08em; color: var(--color-gold-light); margin-bottom: var(--space-4); }
.footer-nav li { margin-bottom: var(--space-3); font-size: var(--fs-sm); }
.footer-nav a:hover { color: var(--color-cream-50); text-decoration: underline; }
.footer-social { display: flex; gap: var(--space-3); }
.footer-social a {
  width: 40px; height: 40px;
  display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--color-border-dark);
  border-radius: 50%;
  transition: background var(--dur-fast), border-color var(--dur-fast);
}
.footer-social a:hover { background: var(--color-wine-700); border-color: var(--color-wine-700); }

.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-3);
  padding-block: var(--space-5);
  font-size: var(--fs-xs);
}
.footer-legal { display: flex; flex-wrap: wrap; gap: var(--space-2) var(--space-5); }
.footer-legal a:hover { text-decoration: underline; }

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 1024px) {
  .book-grid { grid-template-columns: repeat(2, 1fr); }
  .location-grid { grid-template-columns: repeat(2, 1fr); }
  .favourites-grid { grid-template-columns: repeat(2, 1fr); }
  .gatherings-grid { grid-template-columns: 1fr; }
  .summon-grid { grid-template-columns: 1fr; }
  .footer-inner { grid-template-columns: 1fr; }
  .footer-nav { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 1180px) {
  .primary-nav {
    position: fixed;
    inset: var(--header-h) 0 0 0;
    height: calc(100vh - var(--header-h));
    background: var(--color-cream-50);
    transform: translateY(-12px);
    opacity: 0;
    visibility: hidden;
    transition: opacity var(--dur-base) var(--ease-out), transform var(--dur-base) var(--ease-out), visibility var(--dur-base);
    overflow-y: auto;
  }
  .primary-nav.is-open { opacity: 1; transform: translateY(0); visibility: visible; }
  .primary-nav ul { flex-direction: column; align-items: stretch; gap: 0; padding: var(--space-5); }
  .primary-nav li { border-bottom: 1px solid var(--color-border); }
  .primary-nav a:not(.nav-cta) { display: block; padding: var(--space-5) var(--space-2); font-size: var(--fs-md); }
  .primary-nav a:not(.nav-cta)::after { display: none; }

  /* Staggered entrance for each menu item as the mobile menu opens */
  @media (prefers-reduced-motion: no-preference) {
    .primary-nav li {
      opacity: 0;
      transform: translateX(-12px);
      transition: opacity var(--dur-base) var(--ease-out), transform var(--dur-base) var(--ease-out);
    }
    .primary-nav.is-open li { opacity: 1; transform: translateX(0); }
    .primary-nav li:nth-child(1) { transition-delay: 0.04s; }
    .primary-nav li:nth-child(2) { transition-delay: 0.08s; }
    .primary-nav li:nth-child(3) { transition-delay: 0.12s; }
    .primary-nav li:nth-child(4) { transition-delay: 0.16s; }
    .primary-nav li:nth-child(5) { transition-delay: 0.2s; }
    .primary-nav li:nth-child(6) { transition-delay: 0.24s; }
    .primary-nav li:nth-child(7) { transition-delay: 0.28s; }
    .primary-nav li:nth-child(8) { transition-delay: 0.32s; }
  }
  .nav-cta { width: 100%; margin-top: var(--space-4); justify-content: center; font-size: var(--fs-md); }
  .nav-toggle { display: inline-flex; }
}

@media (max-width: 720px) {
  .brewing-grid { grid-template-columns: 1fr; }
  .book-grid { grid-template-columns: 1fr; max-width: 380px; margin-inline: auto; }
  .location-grid { grid-template-columns: 1fr; }
  .favourites-grid { grid-template-columns: 1fr 1fr; }
  .footer-nav { grid-template-columns: 1fr 1fr; }
  .newsletter-form { flex-direction: column; }
  .coven-values { grid-template-columns: 1fr; }
  .section { padding-block: var(--space-8); }
  .gathering-meta { gap: var(--space-5); flex-wrap: wrap; }
}

@media (max-width: 480px) {
  .footer-nav { grid-template-columns: 1fr; }
}

/* ==========================================================================
   Detail pages (individual reviews, journal index, event page)
   ========================================================================== */
.detail-main { padding-top: var(--space-7); }
.breadcrumb-row { padding-block: var(--space-5); }

.detail-head { max-width: 720px; margin-bottom: var(--space-8); }
.detail-head h1 { font-size: var(--fs-3xl); margin-bottom: var(--space-4); }
.detail-byline { display: flex; flex-wrap: wrap; gap: var(--space-2) var(--space-5); align-items: center; color: var(--color-text-muted); font-size: var(--fs-sm); }
.detail-byline .moon-rating { margin-bottom: 0; }

.review-hero {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-8);
  align-items: start;
  margin-bottom: var(--space-8);
}
/* The side picture only exists once a cover photo has been added
   (main.js then adds .has-side-photo); before that the text uses the full width. */
.review-hero > .book-cover:not(.has-photo),
.review-hero > .location-media:not(.has-photo) { display: none; }
.review-hero.has-side-photo { grid-template-columns: 1fr minmax(0, 420px); }
/* the picture sits on the right; the markup keeps it first so it stacks on top on phones */
@media (min-width: 721px) {
  .review-hero.has-side-photo > .book-cover,
  .review-hero.has-side-photo > .location-media { grid-column: 2; grid-row: 1; }
  .review-hero.has-side-photo > :not(.book-cover):not(.location-media) { grid-column: 1; grid-row: 1; }
}
.review-hero .book-cover { aspect-ratio: 3 / 4; height: auto; }
.review-lede { font-size: var(--fs-md); color: var(--color-text-muted); margin-bottom: var(--space-5); }

.review-body { max-width: 68ch; }
.review-body p { color: var(--color-text); margin-bottom: var(--space-5); }
.review-body h2 { font-size: var(--fs-xl); margin-top: var(--space-8); margin-bottom: var(--space-4); }

.review-pullquote {
  margin: var(--space-7) 0;
  padding-left: var(--space-6);
  border-left: 3px solid var(--color-gold);
  font-family: var(--font-display);
  font-style: italic;
  font-size: var(--fs-lg);
  color: var(--color-wine-700);
}

.review-tags { display: flex; flex-wrap: wrap; gap: var(--space-2); margin-top: var(--space-6); }
.review-tags li {
  font-size: var(--fs-xs);
  padding: 4px 12px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-pill);
  color: var(--color-text-muted);
}

.more-reviews { margin-top: var(--space-9); padding-top: var(--space-8); border-top: 1px solid var(--color-border); }
.more-reviews h2 { font-size: var(--fs-lg); margin-bottom: var(--space-5); }

.event-hero {
  background: linear-gradient(150deg, var(--color-wine-700), var(--color-wine-900));
  color: var(--color-cream-50);
  padding: var(--space-7);
  border-radius: var(--radius-lg);
  margin-bottom: var(--space-8);
}
.event-hero h1 { color: var(--color-cream-50); font-size: var(--fs-3xl); }
.event-hero p { color: var(--color-text-on-dark-muted); }
.event-hero .gathering-meta dt { color: var(--color-gold-light); }

.rsvp-card {
  background: var(--color-cream-100);
  border-radius: var(--radius-lg);
  padding: var(--space-7);
  max-width: 520px;
}
.rsvp-card h2 { font-size: var(--fs-lg); margin-bottom: var(--space-5); }

.journal-full-grid { margin-top: var(--space-7); }

/* Currently Brewing cards are whole-card links: the title link stretches over
   the card, and the "thing we love" link sits above it so it stays clickable. */
.brew-card { position: relative; display: flex; flex-direction: column; align-items: flex-start; }
.brew-card p { flex: 1; }
.brew-link { color: inherit; }
.brew-link::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }
.brew-link:focus-visible { outline: none; }
.brew-link:focus-visible::after { outline: 2px solid var(--color-wine-700); outline-offset: 3px; }
.brew-card:hover .brew-link { color: var(--color-wine-700); }
.brew-more {
  display: inline-flex; align-items: center; gap: 6px;
  margin-top: var(--space-4);
  font-size: var(--fs-sm); font-weight: 600; color: var(--color-wine-700);
}
.brew-more .icon { transition: transform var(--dur-base) var(--ease-out); }
.brew-card:hover .brew-more .icon { transform: translateX(4px); }
.brew-love {
  position: relative; z-index: 2;
  display: flex; align-items: center; gap: 6px;
  width: fit-content; max-width: 100%;
  margin-top: var(--space-3); padding-top: var(--space-3);
  border-top: 1px dashed var(--color-border);
  font-size: var(--fs-xs); font-weight: 600; letter-spacing: 0.02em;
  color: var(--color-gold-deep);
}
.brew-love .icon { flex: none; }
.brew-love:hover { color: var(--color-wine-700); text-decoration: underline; text-underline-offset: 3px; }

.journal-more-grid { grid-template-columns: repeat(2, 1fr); }
@media (max-width: 720px) { .journal-more-grid { grid-template-columns: 1fr; } }

/* Privacy page and the small consent notes next to the forms */
.legal-body h2 { font-size: var(--fs-lg); margin-top: var(--space-7); }
.legal-body h2:first-child { margin-top: 0; }
.legal-body ul.legal-list { list-style: disc; margin: 0 0 var(--space-5) 1.25rem; padding: 0; }
.legal-body ul.legal-list li { margin-bottom: var(--space-2); padding-left: 4px; }
.legal-body ul.legal-list li::marker { color: var(--color-gold); }
.legal-body a { color: var(--color-wine-700); text-decoration: underline; text-underline-offset: 3px; }
.legal-meta { color: var(--color-text-muted); font-size: var(--fs-sm); margin: 0; }
.legal-meta a { color: var(--color-wine-700); text-decoration: underline; text-underline-offset: 3px; }
.legal-todo { background: #F7E6B8; color: var(--color-ink); padding: 0 6px; border-radius: 6px; }
/* the cookie table: a real table on wide screens, one small card per row on phones */
.legal-table-wrap { margin: 0 0 var(--space-5); border: 1px solid var(--color-border); border-radius: var(--radius-md); background: var(--color-cream-50); overflow: hidden; }
.legal-table { width: 100%; border-collapse: collapse; font-size: var(--fs-sm); text-align: left; }
.legal-table th, .legal-table td { padding: var(--space-3) var(--space-4); vertical-align: top; border-bottom: 1px solid var(--color-border); line-height: 1.5; }
.legal-table thead th { background: var(--color-cream-100); color: var(--color-wine-700); font-weight: 600; }
.legal-table tbody th { font-weight: 600; color: var(--color-wine-700); white-space: nowrap; }
.legal-table tbody tr:last-child > * { border-bottom: 0; }
@media (max-width: 720px) {
  .legal-table, .legal-table tbody, .legal-table tr, .legal-table th, .legal-table td { display: block; }
  .legal-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .legal-table tbody tr { padding: var(--space-3) 0; border-bottom: 1px solid var(--color-border); }
  .legal-table tbody tr:last-child { border-bottom: 0; }
  .legal-table th, .legal-table td { border: 0; padding: var(--space-2) var(--space-4); }
  .legal-table tbody th { white-space: normal; font-size: var(--fs-base, 1rem); }
  .legal-table td::before { content: attr(data-label); display: block; font-size: var(--fs-xs); font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: var(--color-text-muted); margin-bottom: 2px; }
}
.form-fineprint { margin: var(--space-3) 0 0; font-size: var(--fs-xs); color: var(--color-text-muted); }
.form-fineprint a { text-decoration: underline; text-underline-offset: 2px; color: var(--color-wine-700); }
.rsvp-card .form-fineprint { margin-top: var(--space-4); }

/* Hidden trap field in the forms: people never see it, spam programs fill it in (submit.php) */
.hp-field { position: absolute !important; left: -10000px; top: auto; width: 1px; height: 1px; overflow: hidden; }

/* Cookie banner (lib/consent.php + js/consent.js). Hidden until the script shows it. */
.consent[hidden], .footer-link-btn[hidden] { display: none !important; }
.consent {
  position: fixed;
  left: var(--space-4);
  bottom: var(--space-4);
  z-index: 1500;
  width: min(380px, calc(100vw - 2 * var(--space-4)));
  display: flex;
  gap: var(--space-3);
  padding: var(--space-5);
  background: var(--color-cream-50);
  color: var(--color-text);
  border: 1px solid var(--color-border);
  border-top: 3px solid var(--color-gold);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
}
.consent-moon { flex: none; margin-top: 2px; color: var(--color-gold); }
.consent-title { margin: 0 0 var(--space-2); font-family: var(--font-display); font-size: 1.15rem; line-height: 1.25; color: var(--color-wine-800); }
.consent-text { margin: 0 0 var(--space-4); font-size: var(--fs-sm, 0.95rem); line-height: 1.5; color: var(--color-text-muted); }
.consent-text a { color: var(--color-wine-700); text-decoration: underline; text-underline-offset: 2px; }
.consent-actions { display: flex; gap: var(--space-3); }
.consent-btn { flex: 1; justify-content: center; padding-inline: var(--space-4); }
@media (prefers-reduced-motion: no-preference) {
  .consent.consent-in { animation: consent-rise 0.5s cubic-bezier(0.2, 0.7, 0.2, 1) both; }
  @keyframes consent-rise { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
}
@media (max-width: 520px) { .consent { left: var(--space-3); right: var(--space-3); bottom: var(--space-3); width: auto; padding: var(--space-4); } }
.footer-link-btn { background: none; border: 0; padding: 0; font: inherit; color: inherit; cursor: pointer; }
.footer-link-btn:hover { text-decoration: underline; }

/* Error pages (lib/errors.php): a big 4 [moon] 4 with a raven that has flown off */
.e404 { padding-block: var(--space-9) var(--space-8); text-align: center; overflow: hidden; }
.e404-inner { display: flex; flex-direction: column; align-items: center; max-width: 720px; }
.e404-art {
  position: relative; display: inline-flex; align-items: center; justify-content: center;
  font-family: var(--font-display); font-weight: 700; font-size: clamp(5.5rem, 24vw, 10.5rem); line-height: 1;
  color: var(--color-wine-700); margin-bottom: var(--space-5); padding-inline: 0.15em;
}
.e404-moon { display: inline-flex; width: 0.82em; height: 0.82em; margin-inline: 0.04em; color: var(--color-gold); }
.e404-moon .icon { width: 100%; height: 100%; fill: currentColor; stroke: none; }
.e404-raven { position: absolute; right: -0.15em; top: -0.32em; line-height: 0; }
.e404-raven .raven-svg { width: clamp(58px, 11vw, 96px); height: auto; }
.e404-spark { position: absolute; color: var(--color-gold); }
.e404-s1 { left: 6%; top: 8%; } .e404-s2 { right: 26%; bottom: 6%; width: 10px; height: 10px; } .e404-s3 { left: 30%; top: -4%; width: 9px; height: 9px; }
@media (prefers-reduced-motion: no-preference) {
  .e404-raven { animation: e404-drift 5s ease-in-out infinite alternate; }
  .e404-raven .rv-wing { animation: raven-wing-flap 0.55s ease-in-out infinite alternate; }
  .e404-spark { animation: e404-twinkle 2.6s ease-in-out infinite; }
  .e404-s2 { animation-delay: 0.8s; } .e404-s3 { animation-delay: 1.5s; }
}
@keyframes e404-drift { from { transform: translate(0, 0) rotate(-3deg); } to { transform: translate(16px, -14px) rotate(3deg); } }
@keyframes e404-twinkle { 0%, 100% { opacity: 0.35; transform: scale(0.8); } 50% { opacity: 1; transform: scale(1.15); } }
.e404-title { font-size: clamp(1.9rem, 5vw, 2.8rem); margin-bottom: var(--space-3); }
.e404-lede { color: var(--color-text-muted); font-size: var(--fs-md); max-width: 52ch; margin: 0 0 var(--space-4); }
.e404-path { font-size: var(--fs-sm); color: var(--color-text-muted); margin: 0 0 var(--space-5); overflow-wrap: anywhere; }
.e404-path code { background: var(--color-cream-100); padding: 2px 8px; border-radius: 6px; font-size: 0.95em; }
.e404-actions { display: flex; flex-wrap: wrap; gap: var(--space-3); justify-content: center; margin-bottom: var(--space-7); }
.e404-links h2 { font-size: var(--fs-md); margin-bottom: var(--space-4); }
.e404-links ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: var(--space-3); justify-content: center; }
.e404-chip {
  display: inline-flex; align-items: center; gap: 8px; padding: 9px 16px; min-height: 44px;
  border: 1px solid var(--color-field-border); border-radius: var(--radius-pill);
  background: var(--color-cream-50); color: var(--color-wine-800); font-weight: 500; text-decoration: none;
  transition: background var(--dur-fast), color var(--dur-fast), border-color var(--dur-fast);
}
.e404-chip:hover, .e404-chip:focus-visible { background: var(--color-wine-700); color: var(--color-cream-50); border-color: var(--color-wine-700); }

/* Content that only loads after the visitor accepts (embedded videos etc.) */
.consent-embed { position: relative; aspect-ratio: 16 / 9; width: 100%; display: grid; place-items: center; text-align: center; gap: var(--space-3); padding: var(--space-5); background: var(--color-cream-100); border: 1px dashed var(--color-gold); border-radius: var(--radius-md); color: var(--color-text-muted); }
.consent-embed iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; border-radius: var(--radius-md); }

/* Article photos — added by js/main.js when files exist in
   assets/images/articles/<page-name>/ (see the README there). */
.has-photo { position: relative; overflow: hidden; }
.cover-photo { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.location-media.has-photo > svg { display: none; }
.book-cover.has-photo::before { z-index: 2; }
.book-cover.has-photo::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(26,13,8,0.88), rgba(26,13,8,0.1) 62%);
}
.book-cover.has-photo > :not(.cover-photo) { position: relative; z-index: 3; }
/* words on a photo always sit on the dark fade, so they stay light whatever the cover colours are */
.book-cover.has-photo { --cover-fg: var(--color-cream-50); --cover-chip: rgba(251,246,236,0.16); --cover-chip-line: rgba(251,246,236,0.4); }
/* on the article's own page the title sits beside the photo, so keep it clean */
.review-hero .book-cover.has-photo::before,
.review-hero .book-cover.has-photo::after { display: none; }
.review-hero .book-cover.has-photo > :not(.cover-photo) { display: none; }
.review-hero .has-photo { box-shadow: var(--shadow-md); }

/* Side picture on journal entries and the event page: coloured placeholder
   until a cover photo is added, then the photo takes its place. */
.journal-side {
  position: relative;
  aspect-ratio: 3 / 4;
  border-radius: var(--radius-md);
  color: var(--color-cream-50);
  background: linear-gradient(160deg, var(--cover-a), var(--cover-b));
  box-shadow: var(--shadow-md);
}
.journal-side::before {
  content: ""; position: absolute; inset: 10px;
  border: 1px solid rgba(243,233,215,0.35);
  border-radius: 6px;
  pointer-events: none;
}
.journal-side .icon { width: 56px; height: 56px; }
.journal-side.has-photo::before { display: none; }

.brew-photo {
  display: block;
  width: calc(100% + var(--space-6) * 2);
  max-width: none;
  margin: calc(var(--space-6) * -1) calc(var(--space-6) * -1) var(--space-5);
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: calc(var(--radius-md) - 1px) calc(var(--radius-md) - 1px) 0 0;
}

.article-cover {
  margin: 0 0 var(--space-7);
  border-radius: var(--radius-lg);
  overflow: hidden;
  aspect-ratio: 16 / 9;
  max-height: 480px;
  box-shadow: var(--shadow-md);
}
.article-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }

.article-gallery { margin-top: var(--space-8); max-width: 900px; }
.article-gallery h2 { font-size: var(--fs-lg); margin-bottom: var(--space-5); }
.gallery-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: var(--space-4); }
.gallery-item {
  padding: 0; border: 0; background: var(--color-cream-200);
  border-radius: var(--radius-md); overflow: hidden; cursor: zoom-in;
  aspect-ratio: 4 / 3;
  box-shadow: var(--shadow-sm);
  transition: transform var(--dur-base) var(--ease-out), box-shadow var(--dur-base) var(--ease-out);
}
.gallery-item:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.gallery-item:focus-visible { outline: 2px solid var(--color-wine-700); outline-offset: 3px; }
.gallery-item img { width: 100%; height: 100%; object-fit: cover; display: block; }

.lightbox {
  position: fixed; inset: 0; z-index: 2000;
  display: flex; align-items: center; justify-content: center;
  padding: var(--space-6);
  background: rgba(26, 13, 8, 0.93);
}
.lightbox-img { max-width: min(92vw, 1200px); max-height: 82vh; border-radius: var(--radius-md); box-shadow: 0 20px 60px rgba(0,0,0,0.5); }
.lightbox-count { position: absolute; bottom: var(--space-5); left: 0; right: 0; text-align: center; color: var(--color-text-on-dark-muted); font-size: var(--fs-sm); margin: 0; }
.lightbox-close, .lightbox-nav {
  position: absolute;
  display: grid; place-items: center;
  width: 46px; height: 46px;
  border: 1px solid rgba(251,246,236,0.35); border-radius: 50%;
  background: rgba(251,246,236,0.08); color: var(--color-cream-50);
  font-size: 1.8rem; line-height: 1; cursor: pointer;
  transition: background var(--dur-base);
}
.lightbox-close:hover, .lightbox-nav:hover { background: rgba(251,246,236,0.2); }
.lightbox-close:focus-visible, .lightbox-nav:focus-visible { outline: 2px solid var(--color-gold-light); outline-offset: 2px; }
.lightbox-close { top: var(--space-5); right: var(--space-5); }
.lightbox-nav { top: 50%; transform: translateY(-50%); padding-bottom: 4px; }
.lightbox-prev { left: var(--space-5); }
.lightbox-next { right: var(--space-5); }
@media (prefers-reduced-motion: no-preference) {
  .lightbox { animation: lightbox-in 0.25s var(--ease-out) both; }
}
@keyframes lightbox-in { from { opacity: 0; } to { opacity: 1; } }
@media (max-width: 720px) {
  .lightbox { padding: var(--space-4); }
  .lightbox-nav { top: auto; bottom: var(--space-5); transform: none; }
  .lightbox-prev { left: var(--space-5); }
  .lightbox-next { right: var(--space-5); }
  .lightbox-img { max-height: 74vh; }
}

/* Our Familiar Favourites: cards are whole-card links (same title-link trick as
   Currently Brewing) and can carry a photo in place of the icon. */
.favourite-card { display: flex; flex-direction: column; align-items: flex-start; }
.favourite-card p { flex: 1; }
.favourite-card:hover .brew-link { color: var(--color-wine-700); }
.favourite-card:hover .brew-more .icon { transform: translateX(4px); }
.fav-photo {
  display: block;
  width: calc(100% + var(--space-5) * 2);
  max-width: none;
  margin: calc(var(--space-6) * -1) calc(var(--space-5) * -1) var(--space-4);
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: calc(var(--radius-md) - 1px) calc(var(--radius-md) - 1px) 0 0;
}
.favourite-card.has-card-photo > .icon-xl { display: none; }

/* "Where to Find It" — the links to the things we like */
.find-section { margin-top: var(--space-8); max-width: 820px; }
.find-section h2 { font-size: var(--fs-lg); margin-bottom: var(--space-3); }
.find-note { color: var(--color-text-muted); font-size: var(--fs-sm); margin-bottom: var(--space-5); }
.find-list { display: grid; gap: var(--space-3); }
.find-link {
  display: flex; align-items: center; justify-content: space-between; gap: var(--space-4);
  padding: var(--space-4) var(--space-5);
  background: var(--color-cream-100);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  color: inherit;
  transition: transform var(--dur-base) var(--ease-out), border-color var(--dur-base), box-shadow var(--dur-base);
}
.find-link:hover { transform: translateY(-2px); border-color: var(--color-gold); box-shadow: var(--shadow-sm); }
.find-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.find-title { font-weight: 600; color: var(--color-wine-700); }
.find-blurb { font-size: var(--fs-sm); color: var(--color-text-muted); }
.find-link .icon { color: var(--color-wine-700); transition: transform var(--dur-base) var(--ease-out); }
.find-link:hover .icon { transform: translate(2px, -2px); }

/* "The Thing We Love" on a journal entry */
.loved-section { margin-top: var(--space-8); max-width: 820px; }
.loved-section h2 { font-size: var(--fs-lg); margin-bottom: var(--space-5); }
.loved-list { display: grid; gap: var(--space-4); }
.loved-card {
  display: grid;
  grid-template-columns: 76px 1fr auto;
  gap: var(--space-5);
  align-items: center;
  padding: var(--space-5);
  background: var(--color-cream-100);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  color: inherit;
  transition: transform var(--dur-base) var(--ease-out), border-color var(--dur-base), box-shadow var(--dur-base);
}
.loved-card:hover { transform: translateY(-3px); border-color: var(--color-gold); box-shadow: 0 10px 26px rgba(42,24,16,0.08); }
.loved-icon {
  display: grid; place-items: center;
  width: 76px; height: 100px;
  border-radius: var(--radius-md);
  background: linear-gradient(160deg, var(--cover-a), var(--cover-b));
  color: var(--color-cream-50);
}
.loved-body { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.loved-kicker { font-size: var(--fs-xs); font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--color-gold-deep); }
.loved-title { font-family: var(--font-display); font-size: var(--fs-lg); font-weight: 700; color: var(--color-ink); }
.loved-body .moon-rating { margin: 2px 0; }
.loved-blurb { font-size: var(--fs-sm); color: var(--color-text-muted); }
.loved-cta {
  display: inline-flex; align-items: center; gap: 6px; white-space: nowrap;
  font-size: var(--fs-sm); font-weight: 600; color: var(--color-wine-700);
}
.loved-cta .icon { transition: transform var(--dur-base) var(--ease-out); }
.loved-card:hover .loved-cta .icon { transform: translateX(4px); }
@media (max-width: 720px) {
  .loved-card { grid-template-columns: 64px 1fr; }
  .loved-icon { width: 64px; height: 88px; }
  .loved-cta { grid-column: 1 / -1; }
}

@media (max-width: 720px) {
  .review-hero, .review-hero.has-side-photo { grid-template-columns: 1fr; }
  .review-hero .book-cover,
  .review-hero .location-media { max-width: 420px; margin-inline: auto; width: 100%; }
}

/* ==========================================================================
   Reduced motion: keep essential transitions, kill decorative animation
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; }
  .hero-video { transition: none; }
}
