/* =============================================================
   The Whale & The Coffee Person — Hellenic picture-book.
   Direction B: BIG picture-book. One hero image per page,
   lean caption strip, large book filling the viewport.
   ============================================================= */

:root {
  /* Strict Cycladic palette — only blue + white, plus a pink accent.
     No greens, no teals, no warm browns. Comic-book newsprint paper. */
  --aegean:        #1c6ea4;     /* blue of the domes */
  --aegean-deep:   #0c3a5e;     /* deep sea, slightly bluer */
  --aegean-mute:   #4f93c6;     /* midday water — pure blue, no teal */
  --aegean-soft:   #c9deef;     /* far haze */
  --whitewash:     #ffffff;     /* pure whitewashed wall */
  --paper:         #ffffff;     /* white book paper — comic book bright */
  --paper-edge:    #d8e4ec;
  --paper-shadow:  rgba(12, 58, 94, .14);
  /* Single accent — bougainvillea pink (used very sparingly) */
  --bougainvillea: #d66890;
  /* Replace olive entirely. References to --olive now resolve to a soft
     mid-blue so the site reads as pure blue + white + tiny pink. */
  --olive:         var(--aegean-mute);
  --honey:         #c5933a;     /* almost-unused; kept only for legacy refs */
  --terracotta:    var(--bougainvillea);
  --saffron:       var(--bougainvillea);
  --ink:           #15243d;     /* deep blue-black, not warm */
  --ink-soft:      #2a3a52;
  --ink-mute:      #6a7689;

  --display: "Fraunces", "Cormorant Garamond", "Georgia", serif;
  --body:    "Lora", "Georgia", serif;
  --hand:    "Caveat", cursive;
  --inscription: "Cinzel", "Trajan Pro", serif;

  /* Book sizing — smaller, leaves room for mascots in the bottom corners. */
  --book-w: min(80vw, 1280px);
  --book-h: min(72svh, 820px);
  --book-radius: 6px;

  --flip-ms: 950ms;
  --ease: cubic-bezier(.4,.05,.2,1);
}

@media (prefers-reduced-motion: reduce) {
  :root { --flip-ms: 0ms; }
  *, *::before, *::after { animation-duration: 0ms !important; transition-duration: 0ms !important; }
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: var(--body);
  font-size: clamp(15px, .9vw + 12px, 18px);
  line-height: 1.55;
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow: hidden;
}

/* =============================================================
   STAGE — sea + sky behind the book
   ============================================================= */
.stage {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  padding-top: 80px;     /* space for the topbar so the book never sits under it */
  padding-bottom: 56px;  /* space for the page indicator */
  background: var(--aegean-deep);
}
@media (max-width: 760px) {
  .stage { padding-top: 130px; padding-bottom: 64px; }
}
/* Cinematic vignette + film grain over the whole stage */
.stage::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 50;
  background:
    radial-gradient(ellipse at center, transparent 45%, rgba(0,0,0,.55) 100%);
}
.stage__bg { position: absolute; inset: 0; z-index: 0; pointer-events: none; }

/* Looping background video — sits below the CSS sky/clouds. When the
   video plays, it covers the static CSS background. When it doesn't
   (autoplay blocked, slow network, prefers-reduced-motion), the CSS
   sky stays visible underneath. */
.stage__video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 1;
}

/* The CSS sky lives behind the video as a fallback. When the video is
   present and playing the user sees the video; the sky is hidden. */
.stage__video ~ .stage__sky { z-index: 0; }

/* Soften clouds when video is the hero — keep them as a gentle overlay
   that adds extra motion, but reduce opacity so the video reads. */
.stage__video ~ .stage__clouds { z-index: 2; opacity: .55; }
.stage__video ~ .stage__stars  { z-index: 2; opacity: .55; }

@media (prefers-reduced-motion: reduce) {
  /* Don't autoplay the video if the user opted out of motion. */
  .stage__video { display: none; }
}
/* ONE continuous Aegean sky — saturated noon blue from top to bottom.
   White clouds sit against this so it must NOT go pure white at the top. */
.stage__sky {
  position: absolute; inset: 0;
  background: linear-gradient(180deg,
    #9dcfee 0%,
    #6fb8e3 22%,
    #3a93cf 50%,
    #1f73a8 78%,
    #0d4f80 100%);
}
.stage__sea, .stage__horizon { display: none; }

/* ---------- White clouds (synefa) drifting across the sky ---------- */
.stage__clouds {
  position: absolute;
  inset: 0 0 30% 0;
  pointer-events: none;
  overflow: hidden;
}
.cloud {
  position: absolute;
  background: #ffffff;
  border-radius: 999px;
  /* Box-shadow trick — the cloud silhouette is one element's body
     plus several offset shadows that act as additional puffs.
     No blur — crisp white shapes against the blue sky. */
  box-shadow:
     90px -55px 0 -10px #ffffff,
    180px -22px 0 -18px #ffffff,
   -100px -38px 0 -14px #ffffff,
   -180px  -6px 0 -28px #ffffff,
    250px  18px 0 -36px #ffffff;
  animation: cloud-drift linear infinite;
  will-change: transform;
}
@keyframes cloud-drift {
  from { translate: -340px 0; }
  to   { translate: 110vw   0; }
}
.cloud--1 { width: 220px; height: 80px; top:  9%; animation-duration: 110s; animation-delay:   0s; }
.cloud--2 { width: 160px; height: 60px; top: 22%; animation-duration: 150s; animation-delay: -55s; opacity: .85; }
.cloud--3 { width: 300px; height: 110px; top: 14%; animation-duration: 95s;  animation-delay: -65s; }
.cloud--4 { width: 200px; height: 75px; top: 30%; animation-duration: 130s; animation-delay: -100s; opacity: .8; }
.cloud--5 { width: 260px; height: 95px; top:  4%; animation-duration: 105s; animation-delay: -30s; }

@media (prefers-reduced-motion: reduce) {
  .cloud { animation: none; }
}
.stage__sea::after {
  content: "";
  position: absolute; inset: 0;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='240' height='240'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' seed='9' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 1   0 0 0 0 1   0 0 0 0 1   0 0 0 0.05 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
  opacity: .35;
  /* Slow horizontal drift for a feeling of motion on the water. */
  animation: sea-drift 18s linear infinite;
}
@keyframes sea-drift {
  from { background-position: 0 0; }
  to   { background-position: 240px 0; }
}

/* Sun glints on the sea — pure CSS, twinkling specks of light. */
.stage__stars {
  position: absolute;
  inset: 60% 0 0 0;     /* lives over the sea, not the sky */
  pointer-events: none;
  background-image:
    radial-gradient(2px 2px at 6%  18%, rgba(255,255,255,.95), transparent 60%),
    radial-gradient(1.5px 1.5px at 14% 38%, rgba(255,255,255,.85), transparent 60%),
    radial-gradient(2px 2px at 22% 14%, rgba(255,255,255,.9), transparent 60%),
    radial-gradient(1px 1px at 28% 32%, rgba(255,255,255,.7), transparent 60%),
    radial-gradient(1.5px 1.5px at 36% 22%, rgba(255,255,255,.85), transparent 60%),
    radial-gradient(2px 2px at 47% 8%,  rgba(255,255,255,.9), transparent 60%),
    radial-gradient(1px 1px at 56% 30%, rgba(255,255,255,.7), transparent 60%),
    radial-gradient(2px 2px at 64% 17%, rgba(255,255,255,.95), transparent 60%),
    radial-gradient(1.5px 1.5px at 73% 36%, rgba(255,255,255,.8), transparent 60%),
    radial-gradient(1px 1px at 81% 12%, rgba(255,255,255,.7), transparent 60%),
    radial-gradient(2px 2px at 88% 27%, rgba(255,255,255,.9), transparent 60%),
    radial-gradient(1.5px 1.5px at 94% 18%, rgba(255,255,255,.85), transparent 60%);
  animation: twinkle 5.5s ease-in-out infinite alternate;
  mix-blend-mode: screen;
}
@keyframes twinkle {
  0%   { opacity: .35; }
  50%  { opacity: .85; }
  100% { opacity: .55; }
}

@media (prefers-reduced-motion: reduce) {
  .stage__stars,
  .stage__sea::after { animation: none; }
}

/* =============================================================
   TOPBAR — chunky pill tags above the book
   ============================================================= */
.topbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: clamp(.7rem, 1.2vw, 1.1rem) clamp(1rem, 2vw, 1.8rem);
  pointer-events: none; /* let book/hotspots receive events */
}
.topbar > * { pointer-events: auto; }
.topbar::before {
  /* soft top gradient so tags are legible over any background */
  content: "";
  position: absolute;
  inset: 0 0 -30px 0;
  background: linear-gradient(180deg, rgba(0,0,0,.45) 0%, rgba(0,0,0,0) 100%);
  pointer-events: none;
  z-index: -1;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: .55rem;
  text-decoration: none;
  color: var(--paper);
  font-family: var(--display);
  line-height: 1;
}
.brand__amp {
  font-family: var(--display);
  font-style: italic;
  font-weight: 800;
  font-size: 2.2rem;
  color: var(--saffron);
  text-shadow: 0 2px 6px rgba(0,0,0,.5);
  line-height: 1;
}
.brand__text { display: grid; gap: .15em; }
.brand__line {
  font-weight: 800;
  font-style: italic;
  font-size: 1.1rem;
  letter-spacing: -.005em;
  text-shadow: 0 2px 6px rgba(0,0,0,.5);
}
.brand__line--small {
  font-size: .8rem;
  font-weight: 500;
  font-style: italic;
  color: rgba(251,246,232,.85);
}

.topbar__nav {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: .5rem;
}

.tag {
  font: inherit;
  font-family: var(--display);
  font-weight: 700;
  font-size: 1.02em;
  padding: .55rem 1rem .55rem .85rem;
  background: rgba(255,250,232,.16);
  color: var(--paper);
  border: 2px solid rgba(255,250,232,.35);
  border-radius: 999px;
  cursor: pointer;
  text-decoration: none;
  letter-spacing: .005em;
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: transform .2s ease, background .2s ease, border-color .2s ease;
  white-space: nowrap;
  box-shadow: 0 4px 16px -8px rgba(0,0,0,.5);
}
.tag:hover {
  transform: translateY(-2px);
  background: rgba(255,250,232,.28);
  border-color: var(--saffron);
}
.tag__dot {
  width: 9px; height: 9px;
  border-radius: 50%;
  background: var(--dot, var(--saffron));
  box-shadow: 0 0 0 2px rgba(255,250,232,.25);
  display: inline-block;
}
.tag__star {
  font-family: var(--inscription);
  color: var(--saffron);
  font-size: 1em;
  line-height: 1;
}
.tag--featured {
  background: linear-gradient(135deg, var(--bougainvillea), #e58aaf);
  color: #fff;
  border-color: rgba(255,255,255,.85);
  box-shadow:
    0 4px 16px -6px rgba(0,0,0,.5),
    0 0 0 0 rgba(214,102,144,.55);
  animation: pulse-tag 2.6s ease-in-out infinite;
}
.tag--featured:hover {
  background: linear-gradient(135deg, #c95281, #e09cb9);
  border-color: #fff;
}
.tag--featured .tag__star { color: #fff; }
@keyframes pulse-tag {
  0%, 100% { box-shadow: 0 4px 16px -6px rgba(0,0,0,.5), 0 0 0 0 rgba(214,102,144,.6); }
  50%      { box-shadow: 0 4px 16px -6px rgba(0,0,0,.5), 0 0 0 14px rgba(214,102,144,0); }
}

@media (prefers-reduced-motion: reduce) {
  .tag--featured { animation: none; }
}

@media (max-width: 760px) {
  .topbar {
    flex-direction: column;
    gap: .55rem;
    padding: .6rem;
  }
  .brand__line { font-size: 1rem; }
  .brand__line--small { font-size: .72rem; }
  .tag { font-size: .9em; padding: .45rem .8rem; }
}

/* =============================================================
   BOOK
   ============================================================= */
.book {
  position: relative;
  z-index: 2;
  width: var(--book-w);
  height: var(--book-h);
  perspective: 2800px;
  perspective-origin: 50% 60%;
  transform-style: preserve-3d;
  /* NOTE: do NOT use `filter: drop-shadow(...)` here — `filter` flattens
     the 3D rendering context and breaks `backface-visibility: hidden` on
     descendants, causing flipped pages to appear mirrored. */
}

/* spine shadow */
.book::before {
  content: "";
  position: absolute;
  left: 50%; top: 0; bottom: 0;
  width: 36px;
  transform: translateX(-50%);
  background: linear-gradient(90deg, rgba(0,0,0,0) 0%, rgba(0,0,0,.22) 50%, rgba(0,0,0,0) 100%);
  pointer-events: none;
  z-index: 60;
}

/* =============================================================
   LEAVES
   ============================================================= */
.leaf {
  position: absolute;
  top: 0; bottom: 0;
  right: 0;
  width: 50%;
  transform-origin: left center;
  transform-style: preserve-3d;
  transition: transform var(--flip-ms) var(--ease);
  will-change: transform;
}
.leaf--cover {
  right: auto;
  left: 0;
  transform-origin: right center;
}
.leaf.is-flipped { transform: rotateY(-180deg); }

.face {
  position: absolute;
  inset: 0;
  /* `transform-style: flat` (the default) is what we want here so the
     children are flattened into the face's plane — that lets
     `backface-visibility: hidden` hide everything inside this face when
     it's rotated away from the viewer. Do NOT set preserve-3d here. */
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  /* translateZ(0) forces each face onto its own compositing layer, which
     fixes intermittent backface-visibility leaks in Chrome where two
     coplanar faces share a layer and both end up visible. */
  transform: translateZ(0);
  -webkit-transform: translateZ(0);
}
.face--front { transform: translateZ(0.01px); }
.face--back  { transform: rotateY(180deg) translateZ(0.01px); }

/* =============================================================
   PAGE — full-bleed image-led pages by default
   ============================================================= */
.page {
  position: relative;
  width: 100%;
  height: 100%;
  background-color: var(--paper);
  color: var(--ink);
  overflow: hidden;
  border-radius: var(--book-radius) 0 0 var(--book-radius);
}
.page--right { border-radius: 0 var(--book-radius) var(--book-radius) 0; }
.page--cover { border-radius: var(--book-radius) 0 0 var(--book-radius); }
.page--back-cover { border-radius: 0 var(--book-radius) var(--book-radius) 0; }

/* Comic-book newsprint paper — visible grain + halftone dots + warm tint.
   NO `mix-blend-mode` (breaks 3D backface-visibility). Two layered
   pseudo-elements: ::before for grain, the dot pattern is layered on
   the page background itself via background-image. */
.page::before {
  content: "";
  position: absolute; inset: 0;
  pointer-events: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='280' height='280'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' seed='4' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.55   0 0 0 0 0.45   0 0 0 0 0.18   0 0 0 0.08 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
  opacity: 1;
  z-index: 1;
}
/* Halftone dots — Ben-Day pattern across the page for the comic-book feel. */
.page {
  background-image:
    radial-gradient(circle at 50% 50%, rgba(12,58,94,.13) 0.7px, transparent 1.4px),
    linear-gradient(0deg, var(--paper), var(--paper));
  background-size: 7px 7px, auto;
}
.page--cover, .page--back-cover {
  background-image: none; /* covers keep their painted look */
}
/* spine shadow on inner edges */
.page--right::after {
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0; width: 60px;
  background: linear-gradient(90deg, rgba(0,0,0,.16), transparent);
  pointer-events: none;
  z-index: 5;
}
.page--left::after {
  content: "";
  position: absolute;
  right: 0; top: 0; bottom: 0; width: 60px;
  background: linear-gradient(270deg, rgba(0,0,0,.16), transparent);
  pointer-events: none;
  z-index: 5;
}

/* =============================================================
   COMIC-BOOK PAGES — hero is a panel with a thick black ink border,
   caption is a narration box overlaying the bottom of the panel.
   ============================================================= */
.page--portrait {
  padding: clamp(14px, 1.4vw, 22px);
  position: relative;
  display: block;
}
.hero {
  position: absolute;
  inset: clamp(14px, 1.4vw, 22px);    /* show paper "gutter" around the panel */
  margin: 0;
  background: var(--ink);
  overflow: hidden;
  z-index: 2;
  /* Comic-panel ink border + hard shadow */
  border: 4px solid var(--ink);
  box-shadow:
    0 0 0 1px var(--ink) inset,
    6px 6px 0 0 var(--ink);
}
.hero img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.hero::after { display: none; }   /* drop the dark gradient — caption sits in its own box now */

/* Narration box: classic comic-book caption rectangle.
   White paper, thick black border, hard offset shadow, slight tilt. */
.caption {
  position: absolute;
  left: clamp(28px, 3vw, 50px);
  right: auto;
  bottom: clamp(28px, 3vw, 50px);
  z-index: 4;
  max-width: min(58%, 460px);
  padding: clamp(.85rem, 1.2vw, 1.15rem) clamp(1.1rem, 1.5vw, 1.4rem);
  background: var(--whitewash);
  color: var(--ink);
  text-align: left;
  border: 3px solid var(--ink);
  box-shadow: 5px 5px 0 0 var(--ink);
  transform: rotate(-1.2deg);
  transform-origin: left bottom;
}
.caption__eyebrow {
  margin: 0 0 .2em;
  font-family: var(--display);
  font-weight: 700;
  font-style: italic;
  font-size: clamp(.85em, .35vw + .7em, 1em);
  color: var(--bougainvillea);
  line-height: 1;
  letter-spacing: .01em;
  text-transform: uppercase;
}
.caption__title {
  margin: 0 0 .25em;
  font-family: var(--display);
  font-weight: 800;
  font-variation-settings: "SOFT" 100, "opsz" 144;
  font-size: clamp(1.6rem, 2.4vw, 2.4rem);
  color: var(--aegean-deep);
  line-height: 1;
  letter-spacing: -.01em;
}
.caption__line {
  margin: 0;
  max-width: 42ch;
  font-style: italic;
  color: var(--ink-soft);
  font-size: clamp(.95rem, .35vw + .8rem, 1rem);
  line-height: 1.45;
}

/* Comic-style page-number stamp at top-right of every panel */
.page--portrait::after {
  content: "";
  /* hidden default — opted-in via JS if we add page numbers per leaf later */
  display: none;
}

/* =============================================================
   TEXT PAGES — for episodes / find us / guestbook
   ============================================================= */
.page--text {
  padding: clamp(1.6rem, 2.6vw, 2.8rem) clamp(1.6rem, 2.6vw, 2.8rem) clamp(1.4rem, 2vw, 2rem);
  display: flex;
  flex-direction: column;
  gap: .75rem;
}
.page-eyebrow {
  margin: 0;
  font-family: var(--inscription);
  font-weight: 500;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--terracotta);
  font-size: .82em;
  position: relative; z-index: 2;
}
.page-title {
  margin: 0 0 .5em;
  font-family: var(--display);
  font-weight: 700;
  font-variation-settings: "SOFT" 100, "opsz" 144;
  font-size: clamp(1.9rem, 2.6vw, 2.6rem);
  color: var(--aegean-deep);
  line-height: 1;
  letter-spacing: -.01em;
  position: relative; z-index: 2;
}
.page-blurb {
  margin: 0 0 .25em;
  color: var(--ink-soft);
  font-style: italic;
  position: relative; z-index: 2;
}

/* episodes */
.episodes {
  list-style: none;
  padding: 0;
  margin: .4rem 0 0;
  display: grid;
  gap: 1rem;
  position: relative; z-index: 2;
}
.episode {
  background: #fffaef;
  border: 1px solid var(--paper-edge);
  border-left: 4px solid var(--terracotta);
  padding: .85rem 1.1rem;
  border-radius: 2px;
}
.episode__no {
  font-family: var(--inscription);
  font-size: .72em;
  letter-spacing: .15em;
  color: var(--terracotta);
  text-transform: uppercase;
}
.episode__title {
  font-family: var(--display);
  font-weight: 600;
  font-style: italic;
  font-size: 1.25em;
  color: var(--aegean-deep);
  margin: .15em 0 .3em;
  line-height: 1.1;
}
.episode__line {
  margin: 0;
  font-size: .95em;
  color: var(--ink-soft);
  font-style: italic;
}
.episode__status {
  margin: .35em 0 0;
  font-family: var(--hand);
  font-size: 1.05em;
  color: var(--olive);
}

/* stamps + email */
.links {
  list-style: none;
  padding: 0;
  margin: 1rem 0 .5rem;
  display: flex;
  flex-wrap: wrap;
  gap: .65rem .8rem;
  position: relative; z-index: 2;
}
.stamp {
  display: inline-block;
  padding: .45rem .9rem;
  font-family: var(--inscription);
  font-weight: 500;
  font-size: .78em;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--aegean-deep);
  text-decoration: none;
  background: #fffaef;
  border: 2px solid var(--aegean-deep);
  transition: transform 200ms ease, color 200ms ease, border-color 200ms ease;
  transform: rotate(-1deg);
  box-shadow: 3px 3px 0 0 rgba(13,79,139,.25);
}
.links li:nth-child(2n) .stamp { transform: rotate(1deg); border-color: var(--terracotta); color: var(--terracotta); box-shadow: 3px 3px 0 0 rgba(201,73,44,.25); }
.stamp:hover { transform: rotate(0deg) translateY(-2px); }

.email-line {
  font-family: var(--hand);
  font-size: 1.3em;
  color: var(--olive);
  margin: .5rem 0 0;
  position: relative; z-index: 2;
}
.email-line a { color: inherit; text-decoration: underline solid rgba(125,133,81,.5); text-underline-offset: 3px; }

/* Kids' Corner CTA — bougainvillea-pink block at the bottom of the page */
.kids-cta {
  position: relative; z-index: 2;
  display: block;
  margin: auto 0 0;
  padding: 1rem 1.2rem;
  background: linear-gradient(135deg, var(--bougainvillea), #e58aaf);
  color: #fff;
  text-decoration: none;
  border: 3px solid var(--aegean-deep);
  border-radius: 4px;
  box-shadow: 5px 5px 0 0 var(--aegean-deep);
  transform: rotate(-1deg);
  transition: transform 220ms ease, box-shadow 220ms ease;
}
.kids-cta:hover { transform: rotate(0deg) translate(-1px, -1px); box-shadow: 7px 7px 0 0 var(--aegean-deep); }
.kids-cta__label {
  display: block;
  font-family: var(--display);
  font-weight: 800;
  font-size: 1.4em;
  line-height: 1.05;
  letter-spacing: -.01em;
}
.kids-cta__sub {
  display: block;
  margin-top: .25em;
  font-family: var(--hand);
  font-size: 1.15em;
  color: #fff5d8;
  letter-spacing: .005em;
}

/* =============================================================
   GUESTBOOK
   ============================================================= */
.guestbook-form {
  display: grid;
  gap: .7rem;
  margin-top: .3rem;
  position: relative; z-index: 2;
}
.field { display: grid; gap: .3rem; }
.field__label {
  font-family: var(--hand);
  font-size: 1.15em;
  color: var(--ink-soft);
}
.field input, .field textarea {
  font: inherit;
  font-family: var(--body);
  padding: .55rem .75rem;
  background: rgba(255,255,255,.7);
  border: 1px solid rgba(13,79,139,.35);
  border-radius: 2px;
  color: var(--ink);
  resize: vertical;
}
.field input:focus, .field textarea:focus {
  outline: none;
  border-color: var(--aegean);
  box-shadow: 0 0 0 3px rgba(13,79,139,.18);
}
.form-row {
  display: flex;
  align-items: center;
  gap: .8rem;
  flex-wrap: wrap;
}
.btn {
  font-family: var(--inscription);
  font-weight: 500;
  font-size: .82em;
  letter-spacing: .14em;
  text-transform: uppercase;
  padding: .6rem 1.1rem;
  background: var(--aegean-deep);
  color: var(--paper);
  border: 0;
  border-radius: 2px;
  cursor: pointer;
  transition: transform 200ms ease, background 200ms ease;
  box-shadow: 0 4px 0 -1px rgba(6,48,79,.6);
}
.btn:hover { transform: translateY(-1px); background: var(--terracotta); }
.btn:disabled { opacity: .6; cursor: progress; }
.form-status { margin: 0; font-family: var(--hand); font-size: 1.05em; color: var(--olive); }
.form-status[data-state="error"] { color: var(--terracotta); }

.page--guestbook-list {
  overflow: hidden;
}
.guestbook {
  position: relative; z-index: 2;
  margin-top: .3rem;
  flex: 1;
  min-height: 0;
  overflow: auto;
  display: grid;
  gap: .6rem;
  padding-right: .25rem;
}
.guestbook__loading {
  text-align: center;
  font-size: 1.15em;
  margin: 1rem 0;
}
.note {
  background: #fffaef;
  padding: .65rem .85rem;
  border: 1px solid var(--paper-edge);
  border-left: 3px solid var(--aegean-mute);
  border-radius: 2px;
}
.note__head {
  display: flex; justify-content: space-between; align-items: baseline;
  gap: .8rem;
  margin-bottom: .25em;
}
.note__name { font-family: var(--display); font-weight: 600; color: var(--aegean-deep); }
.note__date { font-family: var(--hand); color: var(--ink-mute); font-size: .98em; }
.note__text { margin: 0; color: var(--ink); font-size: .95em; white-space: pre-wrap; word-wrap: break-word; }

/* =============================================================
   COVER + BACK COVER
   ============================================================= */
.page--cover, .page--back-cover {
  background:
    radial-gradient(140% 90% at 30% 18%, rgba(255,255,255,.10), transparent 55%),
    linear-gradient(160deg, #1f73ab 0%, #1c6ea4 48%, #0d3a5a 100%);
  color: var(--whitewash);
  border: 8px solid var(--aegean-deep);
  border-image: linear-gradient(180deg, #1f5f88, #0d3a5a) 1;
}
/* Drop-shadow is applied to the always-visible cover pages (box-shadow on
   a 3D-positioned element doesn't break the rendering context the way
   `filter: drop-shadow` on the parent does). */
.page--cover {
  border-radius: var(--book-radius) 0 0 var(--book-radius);
  box-shadow:
    inset 0 0 0 1px rgba(230,179,55,.25),
    -6px 36px 50px rgba(0,0,0,.5),
    -2px 10px 14px rgba(0,0,0,.3);
}
.page--back-cover {
  border-radius: 0 var(--book-radius) var(--book-radius) 0;
  box-shadow:
    inset 0 0 0 1px rgba(230,179,55,.25),
    6px 36px 50px rgba(0,0,0,.5),
    2px 10px 14px rgba(0,0,0,.3);
}

.cover-stack, .back-stack {
  position: relative; z-index: 2;
  height: 100%;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: .55rem;
  text-align: center;
  padding: clamp(1.6rem, 3vw, 3rem);
}
.cover-stack { gap: .5rem; }

/* gold ornament around cover stack */
.cover-stack::before, .back-stack::before {
  content: "";
  position: absolute;
  inset: 24px;
  border: 1px solid rgba(230,179,55,.55);
  pointer-events: none;
}
.cover-stack::after, .back-stack::after {
  content: "";
  position: absolute;
  inset: 30px;
  border: 1px solid rgba(230,179,55,.25);
  pointer-events: none;
}

.cover-stack > .cinzel {
  color: var(--saffron);
  font-family: var(--inscription);
  font-weight: 500;
  letter-spacing: .28em;
  text-transform: uppercase;
  font-size: .82em;
  margin: 0;
}
.cover-title {
  font-family: var(--display);
  font-weight: 900;
  font-variation-settings: "SOFT" 100, "opsz" 144;
  color: var(--paper);
  font-size: clamp(1.8rem, 3.4vw, 3rem);
  line-height: .95;
  letter-spacing: -.015em;
  margin: .15em 0;
  display: grid;
  gap: .05em;
  text-shadow: 0 2px 0 rgba(0,0,0,.3), 0 6px 18px rgba(0,0,0,.25);
}
.cover-title .amp {
  display: block;
  font-family: var(--display);
  font-style: italic;
  font-weight: 400;
  color: var(--bougainvillea);
  font-size: 1.1em;
  line-height: 1;
  margin: .05em 0;
}
.cover-tagline {
  margin: 0;
  font-family: var(--display);
  font-weight: 500;
  font-style: italic;
  color: rgba(251,246,232,.85);
  font-size: clamp(1rem, 1.1vw + .6rem, 1.3rem);
}
.cover-illustration {
  width: min(90%, 460px);
  margin: .4rem auto .2rem;
  padding: 0;
  border: 3px solid var(--saffron);
  background: var(--aegean-deep);
  box-shadow:
    0 0 0 1px rgba(0,0,0,.4),
    0 22px 36px -18px rgba(0,0,0,.65);
  overflow: hidden;
}
.cover-illustration img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}
.cover-byline {
  font-family: var(--hand);
  color: rgba(251,246,232,.85);
  font-size: 1.2em;
  margin: 0;
}
.cover-cta {
  margin: 0;
  font-family: var(--hand);
  font-size: 1.5em;
  color: var(--saffron);
}

.back-stack { gap: 1rem; }
.back-stack .cinzel {
  color: var(--saffron);
  font-family: var(--inscription);
  font-weight: 500;
  letter-spacing: .26em;
  text-transform: uppercase;
  font-size: 1em;
  margin: 0;
}
.back-blurb {
  font-family: var(--display);
  font-weight: 500;
  font-style: italic;
  font-size: clamp(1.4rem, 2.4vw, 2.2rem);
  color: rgba(251,246,232,.95);
  line-height: 1.25;
  margin: 0;
}
.colophon {
  margin: 1.25rem 0 0;
  font-family: var(--body);
  font-size: .82em;
  font-style: italic;
  color: rgba(251,246,232,.7);
  max-width: 32ch;
}

/* hand utility */
.hand { font-family: var(--hand); color: var(--terracotta); }

/* =============================================================
   CONTROLS — bottom centre
   ============================================================= */
.controls {
  position: fixed;
  left: 50%; bottom: clamp(.5rem, 1.4vh, 1rem);
  transform: translateX(-50%);
  z-index: 100;
  display: flex;
  align-items: center;
  gap: .55rem;
  padding: .3rem .6rem;
  background: rgba(0,0,0,.4);
  border: 1px solid rgba(230,179,55,.4);
  border-radius: 999px;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: rgba(255,255,255,.92);
}
.ctrl {
  background: transparent;
  border: 0;
  padding: .15rem .3rem;
  color: inherit;
  cursor: pointer;
  border-radius: 999px;
  transition: background .2s ease, transform .2s ease;
  display: inline-flex; align-items: center; justify-content: center;
}
.ctrl:hover:not(:disabled) { background: rgba(255,255,255,.14); transform: translateY(-1px); }
.ctrl:disabled { opacity: .35; cursor: default; }
.page-indicator {
  margin: 0;
  font-family: var(--inscription);
  font-size: .68em;
  letter-spacing: .14em;
  color: var(--saffron);
}

/* =============================================================
   MASCOTS — Plexoulis (left) and Eleni (right) at the bottom corners
   ============================================================= */
.mascot {
  position: fixed;
  bottom: clamp(12px, 2vh, 26px);
  z-index: 6;
  width: clamp(120px, 13vw, 180px);
  height: clamp(120px, 13vw, 180px);
  border-radius: 50%;
  overflow: hidden;
  pointer-events: none;
  border: 4px solid var(--whitewash);
  background: var(--whitewash);
  box-shadow:
    0 0 0 2px var(--aegean-deep),
    0 14px 28px -10px rgba(0,0,0,.55);
  animation: mascot-bob 5s ease-in-out infinite alternate;
}
.mascot--left  { left:  clamp(10px, 1.6vw, 24px); transform: rotate(-4deg); }
.mascot--right { right: clamp(10px, 1.6vw, 24px); transform: rotate(4deg); animation-duration: 6.5s; }
.mascot img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 28%;
  display: block;
}
.mascot__label {
  position: absolute;
  bottom: -10px;
  left: 50%;
  transform: translateX(-50%) rotate(-2deg);
  font-family: var(--display);
  font-weight: 700;
  font-style: italic;
  font-size: .78rem;
  letter-spacing: .02em;
  background: var(--bougainvillea);
  color: #fff;
  padding: .15em .65em;
  border-radius: 999px;
  border: 2px solid var(--whitewash);
  white-space: nowrap;
}
.mascot--right .mascot__label { transform: translateX(-50%) rotate(2deg); }
@keyframes mascot-bob {
  from { translate: 0 0; }
  to   { translate: 0 -6px; }
}
@media (max-width: 760px) {
  .mascot { display: none; }   /* tight on phones — drop them */
}
@media (prefers-reduced-motion: reduce) {
  .mascot { animation: none; }
}

/* =============================================================
   HOTSPOTS — narrow click zones on outer page corners only
   This avoids the "click anywhere on the form turns the page" bug.
   ============================================================= */
.hotspot {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  width: clamp(34px, 4vw, 56px);
  height: clamp(120px, 18vh, 220px);
  z-index: 90;
  cursor: pointer;
  background: transparent;
}
.hotspot--left {
  left: max(8px, calc((100vw - var(--book-w)) / 2 - 6px));
}
.hotspot--right {
  right: max(8px, calc((100vw - var(--book-w)) / 2 - 6px));
}
.hotspot::before {
  content: "";
  position: absolute;
  top: 50%; transform: translateY(-50%);
  width: 32px; height: 32px;
  border-radius: 50%;
  background: rgba(255,255,255,.0);
  border: 1px solid rgba(230,179,55,0);
  transition: background .2s ease, border-color .2s ease;
}
.hotspot--left::before { right: 6px; }
.hotspot--right::before { left: 6px; }
.hotspot:hover::before {
  background: rgba(0,0,0,.25);
  border-color: rgba(230,179,55,.6);
}
.hotspot.is-disabled { pointer-events: none; opacity: .3; }

/* =============================================================
   MOBILE — single page, swap (no 3D flip).
   We hide alternate faces and show pages one at a time.
   ============================================================= */
@media (max-width: 760px) {
  :root {
    --book-w: 96vw;
    --book-h: 78svh;
  }
  .leaf, .leaf--cover, .leaf--back-cover {
    width: 100%;
    left: 0; right: 0;
    transform-origin: center center;
    transition: opacity .35s ease, transform .35s var(--ease);
  }
  .book::before { display: none; }
  .page--right::after, .page--left::after { display: none; }
  .leaf.is-flipped { transform: translateX(-12%); opacity: 0; pointer-events: none; }
  /* When flipped past, hide both faces cleanly. When unflipped (active),
     show the FRONT face on top. The BACK face sits behind for animation. */
  .face--back { transform: rotateY(180deg) translateZ(-1px); }
  .controls { bottom: 1rem; }
  .page--portrait {
    grid-template-rows: minmax(0, 1fr) auto;
  }
}

/* =============================================================
   SELECTION
   ============================================================= */
::selection { background: rgba(230,179,55,.4); color: var(--ink); }
