/* ============================================================================
   Period Support Dept. — v9 styles
   Relative paths only, so this works from the domain root or a /repo-name/
   subpath. Mobile-first: the base rules are the phone layout and the media
   queries only add width.

   Two grounds, one page. The page opens at night — the title card, the parcel
   crossing the map — and the box opening floods it to cream: the department
   is a daytime room. "I miss you" and "leave me alone" dim it back down, so
   the light always says which register we're in: dark is sincere, cream is
   service-with-a-smile.
   ========================================================================== */

:root {
  /* ---- Fonts (same three faces as every version) ----------------------- */
  --font-hand: "Caveat", "Kalam", "Segoe Script", cursive;
  --font-stamp: "Special Elite", "Courier New", monospace;
  --font-serif: "EB Garamond", Georgia, "Times New Roman", serif;

  /* ---- The two grounds -------------------------------------------------- */
  --night: #0d0a08;
  --paper: #f3e8d4;

  /* ---- Type on the dark -------------------------------------------------- */
  --film-ink: #f4ead9;
  --film-ink-soft: #b5a58d;

  /* ---- Type on the cream ------------------------------------------------- */
  --ink: #332a20;
  --ink-soft: #8b7c64;

  /* ---- Accents ----------------------------------------------------------
     Marigold is this version's colour — the yellow heart, made paint. Deep
     marigold carries text on cream; the bright one is fills and glows. Kraft
     is the cardboard. Gold and rose continue from the earlier versions. */
  --marigold: #eab038;
  --marigold-deep: #a97b14;
  --kraft: #c09a66;
  --kraft-deep: #8a6a3e;
  --gold: #d8b273;
  --gold-soft: #a98b58;
  --rose: #e3a99f;

  --card: #f8efdd;
  --card-edge: #dcc7a4;
  --shadow: rgba(51, 42, 32, 0.16);

  /* ---- Motion ------------------------------------------------------------
     One spring and one glide for the whole page, so everything moves like it
     was built by the same hands. */
  --spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --glide: cubic-bezier(0.22, 1, 0.36, 1);

  /* ---- Textures (no image files) ----------------------------------------- */
  --grain:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='f'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23f)' opacity='0.05'/%3E%3C/svg%3E");
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100dvh;
  font-family: var(--font-serif);
  color: var(--film-ink);
  background-color: var(--night);
  background-image: var(--grain);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
  transition: background-color 1.1s ease, color 1.1s ease;
}

/* A warm pool of light at night; it fades away when the day comes up. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(58% 42% at 50% 46%, rgba(234, 176, 56, 0.13), transparent 70%),
    radial-gradient(125% 95% at 50% 48%, transparent 40%, rgba(0, 0, 0, 0.55) 100%);
  transition: opacity 1.1s ease;
}

body.day { background-color: var(--paper); color: var(--ink); }
body.day::before { opacity: 0; }

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap; border: 0;
}

[hidden] { display: none !important; }

.wrap {
  width: 100%;
  max-width: 34rem;
  margin: 0 auto;
  padding-inline: clamp(1rem, 5vw, 2rem);
}

/* ---------------------------------------------------------------------------
   Buttons — one family for the whole page. Courier face, quiet borders; the
   primary is marigold. Context (dark sections) only recolours them.
   ------------------------------------------------------------------------- */
.btn {
  appearance: none;
  padding: 0.6rem 1.15rem;
  border: 1px solid rgba(51, 42, 32, 0.25);
  border-radius: 999px;
  background: transparent;
  color: var(--ink);
  font-family: var(--font-stamp);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  cursor: pointer;
  transition: transform 0.45s var(--spring), background-color 0.3s ease,
              color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}
.btn:hover { border-color: rgba(51, 42, 32, 0.5); }
.btn:active { transform: scale(0.94); transition-duration: 0.1s; }
.btn:focus-visible { outline: 2px solid var(--marigold-deep); outline-offset: 3px; }
.btn:disabled { opacity: 0.35; cursor: default; }

.btn.is-primary {
  background: var(--marigold);
  border-color: transparent;
  color: #3b2b08;
  box-shadow: 0 6px 18px rgba(234, 176, 56, 0.35);
}
.btn.is-primary:hover { box-shadow: 0 8px 24px rgba(234, 176, 56, 0.5); }

/* The same buttons standing in a dark room. */
.missyou .btn {
  border-color: rgba(244, 234, 217, 0.3);
  color: var(--film-ink-soft);
}
.missyou .btn:hover { border-color: rgba(244, 234, 217, 0.6); color: var(--film-ink); }
.missyou .btn.is-primary {
  background: var(--marigold);
  border-color: transparent;
  color: #3b2b08;
}

/* ---------------------------------------------------------------------------
   Intro — the title card, dark, same bones as every version.
   ------------------------------------------------------------------------- */
.intro { display: none; }

html.js .intro {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.4rem;
  padding: 2rem;
  text-align: center;
  background-color: var(--night);
  background-image: var(--grain);
  transition: opacity 0.9s ease;
}
html.js .intro.is-done { opacity: 0; pointer-events: none; }

.intro-eyebrow {
  font-family: var(--font-stamp);
  font-size: 0.72rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--marigold);
  opacity: 0;
  transition: opacity 1.1s ease;
}
.intro-eyebrow.in { opacity: 0.92; }

.intro-stack { display: grid; gap: 1.05rem; max-width: 26rem; }

.intro-line {
  margin: 0;
  font-size: clamp(1.2rem, 4.6vw, 1.45rem);
  line-height: 1.5;
  color: var(--film-ink);
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.9s ease, transform 0.9s var(--glide);
}
.intro-line.in { opacity: 1; transform: none; }

.intro-line.stamp {
  font-family: var(--font-stamp);
  font-size: 0.72rem;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--film-ink-soft);
}

/* ---------------------------------------------------------------------------
   The arrival — waybill on top, the map in the middle, the manifest ticking
   underneath, and the landed box over it all.
   ------------------------------------------------------------------------- */
.arrival {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  height: 100dvh;
  padding: max(1.25rem, env(safe-area-inset-top)) 1.25rem
           max(1.5rem, env(safe-area-inset-bottom));
  overflow: hidden;
}

.waybill {
  margin: 0.4rem 3.5rem 0 0;   /* right gutter clears the music pill */
  font-family: var(--font-stamp);
  font-size: 0.66rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--film-ink-soft);
  opacity: 0;
  transition: opacity 0.9s ease;
}
.arrival.is-on .waybill { opacity: 0.85; }

.route {
  flex: 1 1 0%;
  min-height: 0;
  width: min(100%, 26rem);
  display: flex;
  align-items: center;
}

.route-map { width: 100%; height: auto; }

.route-line {
  stroke: var(--gold-soft);
  stroke-width: 1.6;
  stroke-dasharray: 4 8;
  stroke-linecap: round;
  opacity: 0;
  transition: opacity 1.2s ease;
}
.arrival.is-on .route-line { opacity: 0.75; }

.route-dot { fill: var(--marigold); opacity: 0; transition: opacity 0.9s ease 0.3s; }
.route-dot-end { transition-delay: 0.6s; }
.arrival.is-on .route-dot { opacity: 1; }

.route-label {
  font-family: var(--font-stamp);
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  fill: var(--film-ink-soft);
  text-anchor: middle;
  opacity: 0;
  transition: opacity 0.9s ease 0.4s;
}
.arrival.is-on .route-label { opacity: 0.9; }

.flyer-box { fill: var(--kraft); stroke: rgba(0, 0, 0, 0.4); stroke-width: 0.8; }
.flyer-tape { stroke: #e5d3ae; stroke-width: 3; }

/* The manifest keeps its height whether it holds one line or five, so the
   landing box never shoves the map around. */
.manifest {
  min-height: 9.5rem;
  width: 100%;
  max-width: 24rem;
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  align-items: center;
  text-align: center;
}
.manifest li {
  margin: 0;
  font-family: var(--font-stamp);
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--film-ink-soft);
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.7s ease, transform 0.7s var(--glide);
}
.manifest li.in { opacity: 0.9; transform: none; }

/* ---- The landed box ---------------------------------------------------- */
.parcel {
  position: absolute;
  inset: 0;
  margin: auto;
  width: fit-content;
  height: fit-content;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  border: 0;
  background: transparent;
  cursor: pointer;
  -webkit-user-select: none;
  user-select: none;
}
.parcel:focus-visible { outline: 2px solid var(--marigold); outline-offset: 6px; border-radius: 12px; }

.parcel-box {
  position: relative;
  display: block;
  width: min(58vw, 15rem);
  aspect-ratio: 15 / 11;
  border-radius: 10px;
  background:
    linear-gradient(160deg, #cfa871, var(--kraft) 45%, #a98352);
  box-shadow:
    inset 0 2px 0 rgba(255, 255, 255, 0.25),
    inset 0 -14px 24px rgba(0, 0, 0, 0.18),
    0 24px 50px rgba(0, 0, 0, 0.55);
  transform-origin: 50% 100%;
}
.parcel.is-landing .parcel-box { animation: parcel-drop 0.9s var(--glide) both; }
@keyframes parcel-drop {
  0%   { transform: translateY(-58vh) rotate(-7deg); }
  68%  { transform: translateY(0) rotate(0deg); }
  80%  { transform: translateY(0) scale(1.06, 0.92); }
  92%  { transform: translateY(-7px) scale(0.99, 1.02); }
  100% { transform: translateY(0) scale(1, 1); }
}

/* The lid: a flap across the top that swings open on tap. */
.parcel-box::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 26%;
  border-radius: 10px 10px 4px 4px;
  background: linear-gradient(170deg, #dbb57e, #c09a66);
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.28);
  transform-origin: 50% 0%;
  transition: transform 0.55s var(--spring);
}
.parcel { perspective: 700px; }
.parcel.is-opening .parcel-box::before { transform: rotateX(-125deg); }
.parcel.is-opening .parcel-box {
  animation: parcel-burst 0.7s var(--glide) 0.25s both;
}
@keyframes parcel-burst {
  0%   { transform: scale(1); }
  55%  { transform: scale(1.05); }
  100% { transform: scale(1.12); opacity: 0.9; }
}

.parcel-tape {
  position: absolute;
  top: 0; bottom: 0;
  left: 50%;
  width: 14%;
  transform: translateX(-50%);
  background: linear-gradient(90deg, rgba(245, 227, 190, 0.55), rgba(245, 227, 190, 0.85), rgba(245, 227, 190, 0.55));
  mix-blend-mode: screen;
  pointer-events: none;
}

.parcel-stamp {
  position: absolute;
  top: 9%;
  right: 6%;
  padding: 0.3rem 0.45rem;
  border: 1.5px dashed rgba(90, 30, 20, 0.65);
  border-radius: 4px;
  transform: rotate(6deg);
  font-family: var(--font-stamp);
  font-size: 0.5rem;
  letter-spacing: 0.12em;
  line-height: 1.5;
  text-transform: uppercase;
  color: rgba(90, 30, 20, 0.8);
}

.parcel-to {
  position: absolute;
  left: 8%;
  bottom: 8%;
  font-family: var(--font-hand);
  font-size: clamp(1.05rem, 4vw, 1.3rem);
  line-height: 1.25;
  color: #4a3212;
  text-align: left;
}
.parcel-to em { font-style: normal; font-size: 0.72em; opacity: 0.75; }

.parcel-hint {
  font-family: var(--font-stamp);
  font-size: 0.66rem;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--marigold);
  opacity: 0;
  animation: hint-pulse 2.2s ease-in-out 1s infinite;
}
@keyframes hint-pulse {
  0%, 100% { opacity: 0.45; }
  50% { opacity: 1; }
}

/* Once the box has landed, the journey furniture steps back. */
.arrival.is-landed .route,
.arrival.is-landed .manifest,
.arrival.is-landed .waybill { opacity: 0.22; transition: opacity 0.9s ease; }

/* ---------------------------------------------------------------------------
   The flood — the cream that pours out of the box and becomes the day.
   ------------------------------------------------------------------------- */
.flood {
  position: fixed;
  left: 50%;
  top: 50%;
  z-index: 35;
  width: 220vmax;
  height: 220vmax;
  border-radius: 50%;
  background: var(--paper);
  transform: translate(-50%, -50%) scale(0);
  pointer-events: none;
  transition: transform 0.85s var(--glide), opacity 0.6s ease;
}
.flood.is-on { transform: translate(-50%, -50%) scale(1); }
.flood.is-fading { opacity: 0; }

/* ---------------------------------------------------------------------------
   The department — cream, warm, and built to be pressed.
   ------------------------------------------------------------------------- */
.dept {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: clamp(1.25rem, 4vh, 2.2rem);
  height: 100dvh;
  padding: max(1.25rem, env(safe-area-inset-top)) 1.25rem
           max(1.25rem, env(safe-area-inset-bottom));
  overflow: hidden;
}

.dept-head { text-align: center; }

.dept-eyebrow {
  margin: 0 0 0.7rem;
  font-family: var(--font-stamp);
  font-size: 0.62rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--marigold-deep);
}

.dept-title {
  margin: 0;
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: clamp(2rem, 8.5vw, 3rem);
  letter-spacing: 0.02em;
  color: var(--ink);
}

.dept-sub {
  margin: 0.55rem 0 0;
  font-family: var(--font-stamp);
  font-size: 0.66rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

/* Entrance: the head and buttons pop in one after another once .is-in. */
.dept-head,
.dept-foot { opacity: 0; transform: translateY(14px); transition: opacity 0.7s ease, transform 0.7s var(--glide); }
.dept.is-in .dept-head,
.dept.is-in .dept-foot { opacity: 1; transform: none; }
.dept.is-in .dept-foot { transition-delay: 0.75s; }

.board {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(0.7rem, 2.5vw, 1rem);
  width: min(100%, 24rem);
}

.mood {
  appearance: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  min-height: clamp(5.4rem, 13vh, 7rem);
  padding: 0.9rem 0.6rem;
  border: 1px solid rgba(51, 42, 32, 0.12);
  border-radius: 18px;
  background: var(--card);
  box-shadow: 0 10px 26px var(--shadow), inset 0 1px 0 rgba(255, 255, 255, 0.7);
  cursor: pointer;
  opacity: 0;
  transform: translateY(16px) scale(0.96);
  transition: opacity 0.6s ease, box-shadow 0.35s ease, border-color 0.35s ease,
              transform 0.55s var(--spring);
}
.dept.is-in .mood { opacity: 1; transform: none; }
.dept.is-in .mood:nth-child(1) { transition-delay: 0.12s; }
.dept.is-in .mood:nth-child(2) { transition-delay: 0.2s; }
.dept.is-in .mood:nth-child(3) { transition-delay: 0.28s; }
.dept.is-in .mood:nth-child(4) { transition-delay: 0.36s; }
.dept.is-in .mood:nth-child(5) { transition-delay: 0.44s; }
.dept.is-in .mood:nth-child(6) { transition-delay: 0.52s; }

/* Once in, presses answer instantly — the entrance delay must not linger. */
.dept.is-settled .mood { transition-delay: 0s; }

.mood:hover {
  border-color: rgba(169, 123, 20, 0.45);
  box-shadow: 0 14px 32px var(--shadow), inset 0 1px 0 rgba(255, 255, 255, 0.7);
}
.mood:active { transform: scale(0.94); transition: transform 0.1s ease; }
.mood:focus-visible { outline: 2px solid var(--marigold-deep); outline-offset: 3px; }

.mood-ic { font-size: 1.7rem; line-height: 1; }

.mood-label {
  font-family: var(--font-hand);
  font-weight: 600;
  font-size: clamp(1.2rem, 4.6vw, 1.4rem);
  color: var(--ink);
}

.mood.is-miss {
  background: linear-gradient(155deg, #f6c95e, var(--marigold));
  border-color: transparent;
  box-shadow: 0 12px 30px rgba(234, 176, 56, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.55);
}
.mood.is-miss .mood-label { color: #3b2b08; }

.dept-foot { display: flex; flex-direction: column; align-items: center; gap: 0.5rem; }

.menu-link {
  appearance: none;
  border: 0;
  background: transparent;
  padding: 0.35rem 0.5rem;
  font-family: var(--font-stamp);
  font-size: 0.68rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--marigold-deep);
  text-decoration: underline;
  text-underline-offset: 4px;
  text-decoration-color: rgba(169, 123, 20, 0.4);
  cursor: pointer;
}
.menu-link:hover { text-decoration-color: var(--marigold-deep); }
.menu-link:focus-visible { outline: 2px solid var(--marigold-deep); outline-offset: 3px; }

.dept-sign {
  margin: 0;
  font-family: var(--font-hand);
  font-size: 1.05rem;
  color: var(--ink-soft);
}

@media (min-width: 40rem) {
  .board { grid-template-columns: repeat(3, minmax(0, 1fr)); width: min(100%, 38rem); }
}

/* ---------------------------------------------------------------------------
   The dispatch — the service ticket that answers a pressed button.
   ------------------------------------------------------------------------- */
.dispatch {
  position: fixed;
  inset: 0;
  z-index: 25;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  background: rgba(13, 10, 8, 0.42);
  -webkit-backdrop-filter: blur(7px);
  backdrop-filter: blur(7px);
  opacity: 0;
  transition: opacity 0.4s ease;
}
.dispatch.is-open { opacity: 1; }

.ticket-card {
  width: min(100%, 26rem);
  max-height: calc(100dvh - 4rem);
  overflow-y: auto;
  padding: 1.4rem 1.5rem 1.3rem;
  border: 1px solid rgba(51, 42, 32, 0.12);
  border-radius: 20px;
  background-color: var(--card);
  background-image: var(--grain);
  box-shadow: 0 30px 70px rgba(0, 0, 0, 0.45);
  transform: translateY(30px) scale(0.95);
  transition: transform 0.55s var(--spring);
}
.dispatch.is-open .ticket-card { transform: none; }

.ticket-head {
  margin: 0 0 0.3rem;
  font-family: var(--font-stamp);
  font-size: 0.6rem;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--marigold-deep);
}

.ticket-title {
  margin: 0 0 0.9rem;
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: 1.35rem;
  color: var(--ink);
}

.ticket-lines { display: grid; gap: 0.55rem; }

.tline {
  margin: 0;
  font-family: var(--font-stamp);
  font-size: 0.76rem;
  line-height: 1.65;
  letter-spacing: 0.06em;
  color: var(--ink);
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.55s ease, transform 0.55s var(--glide);
}
.tline.in { opacity: 0.92; transform: none; }

/* The joke deck's last card: her own face, dealt like evidence. */
.ticket-photo {
  margin: 0.9rem 0 0;
  opacity: 0;
  transform: translateY(10px) rotate(-1.5deg);
  transition: opacity 0.6s ease, transform 0.6s var(--spring);
}
.ticket-photo.in { opacity: 1; transform: rotate(-1.5deg); }
.ticket-photo img {
  display: block;
  width: min(100%, 15rem);
  height: auto;
  margin-inline: auto;
  border: 5px solid #fff;
  border-bottom-width: 22px;
  border-radius: 3px;
  box-shadow: 0 12px 28px rgba(51, 42, 32, 0.3);
}
.ticket-caption {
  margin: 0.7rem 0 0;
  text-align: center;
  font-family: var(--font-stamp);
  font-size: 0.62rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.ticket-closer {
  margin: 1.1rem 0 0;
  padding-top: 0.9rem;
  border-top: 1px dashed rgba(51, 42, 32, 0.25);
  font-family: var(--font-hand);
  font-size: clamp(1.25rem, 4.8vw, 1.45rem);
  line-height: 1.4;
  color: var(--marigold-deep);
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.7s ease, transform 0.7s var(--glide);
}
.ticket-closer.in { opacity: 1; transform: none; }

.ticket-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.6rem;
  margin-top: 1.2rem;
}

/* ---------------------------------------------------------------------------
   The hush — "leave me alone". The room goes dark and waits.
   ------------------------------------------------------------------------- */
.hush {
  position: fixed;
  inset: 0;
  z-index: 26;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  background: rgba(13, 10, 8, 0.96);
  opacity: 0;
  transition: opacity 0.8s ease;
  cursor: pointer;
}
.hush.is-open { opacity: 1; }

.hush-body { max-width: 22rem; text-align: center; }

.hush-title {
  margin: 0 0 1.2rem;
  font-family: var(--font-stamp);
  font-size: 0.72rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--film-ink-soft);
}

.hush-snacks {
  display: flex;
  justify-content: center;
  gap: 0.9rem;
  margin: 0 0 1.2rem;
  font-size: 1.5rem;
}
.hush-snacks span {
  opacity: 0;
  transform: translateY(10px) scale(0.8);
  transition: opacity 0.5s ease, transform 0.55s var(--spring);
}
.hush.is-open .hush-snacks span { opacity: 1; transform: none; }
.hush.is-open .hush-snacks span:nth-child(1) { transition-delay: 0.5s; }
.hush.is-open .hush-snacks span:nth-child(2) { transition-delay: 0.62s; }
.hush.is-open .hush-snacks span:nth-child(3) { transition-delay: 0.74s; }
.hush.is-open .hush-snacks span:nth-child(4) { transition-delay: 0.86s; }

.hush-note {
  margin: 0 0 1.6rem;
  font-family: var(--font-hand);
  font-size: clamp(1.3rem, 5vw, 1.5rem);
  line-height: 1.45;
  color: var(--film-ink);
}

.hush-hint {
  margin: 0;
  font-family: var(--font-stamp);
  font-size: 0.62rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--film-ink-soft);
  animation: hint-pulse 2.4s ease-in-out 1.4s infinite;
  opacity: 0.45;
}

/* ---------------------------------------------------------------------------
   I miss you — dark again. One photo at a time, uncropped, then the verse.
   ------------------------------------------------------------------------- */
.missyou {
  display: flex;
  flex-direction: column;
  height: 100dvh;
  padding: max(1rem, env(safe-area-inset-top)) 1rem
           max(1rem, env(safe-area-inset-bottom));
  /* The slide-in overshoots by 26px; on a phone that must not become a
     horizontal scroll. */
  overflow: hidden;
}

.my-reel {
  flex: 1 1 0%;
  min-height: 0;
  display: flex;
  align-items: stretch;
  justify-content: center;
}

.moment {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.9rem;
  width: min(100%, 30rem);
  min-height: 0;
}
.moment.enter { animation: moment-in 0.65s var(--glide) both; }
.moment.enter-back { animation: moment-in-back 0.65s var(--glide) both; }
@keyframes moment-in {
  from { opacity: 0; transform: translateX(26px); }
  to   { opacity: 1; transform: none; }
}
@keyframes moment-in-back {
  from { opacity: 0; transform: translateX(-26px); }
  to   { opacity: 1; transform: none; }
}

.moment-slate {
  margin: 0.2rem 3.5rem 0 0;
  font-family: var(--font-stamp);
  font-size: 0.62rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--film-ink-soft);
}

/* The photo takes whatever height the text leaves and the image fits whole
   inside it — pictures are never cropped (a v8 rule worth keeping). */
.moment-photo {
  flex: 1 1 0%;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
}
.moment-photo img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  border-radius: 6px;
  box-shadow: 0 22px 60px rgba(0, 0, 0, 0.65);
}

.moment-line {
  margin: 0;
  max-width: 28rem;
  text-align: center;
  font-family: var(--font-hand);
  font-size: clamp(1.25rem, 4.8vw, 1.5rem);
  line-height: 1.4;
  color: var(--film-ink);
}

/* The last moment: no photo, the verse alone in the dark. */
.moment-verse {
  margin: auto 0;
  display: grid;
  gap: 0.35rem;
  text-align: center;
}
.moment-verse .verse-line {
  margin: 0;
  font-family: var(--font-serif);
  font-style: italic;
  font-size: clamp(1.1rem, 4.4vw, 1.3rem);
  line-height: 1.7;
  color: var(--rose);
}
.moment-signoff {
  margin: 1.4rem 0 0;
  font-family: var(--font-stamp);
  font-size: 0.62rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--film-ink-soft);
}

.my-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  width: min(100%, 30rem);
  margin: 0.9rem auto 0;
}

.my-dots {
  display: flex;
  gap: 0.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
}
.my-dots li { display: flex; }
.dot-btn {
  appearance: none;
  width: 9px;
  height: 9px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(244, 234, 217, 0.25);
  cursor: pointer;
  transition: background-color 0.3s ease, transform 0.4s var(--spring);
}
.my-dots li.is-current .dot-btn { background: var(--marigold); transform: scale(1.35); }
.my-dots li.is-seen .dot-btn { background: rgba(234, 176, 56, 0.45); }
.dot-btn:focus-visible { outline: 2px solid var(--marigold); outline-offset: 3px; }

/* ---------------------------------------------------------------------------
   The service menu — a bottom sheet in the courier face.
   ------------------------------------------------------------------------- */
.menu-sheet {
  position: fixed;
  inset: 0;
  z-index: 25;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  background: rgba(13, 10, 8, 0.42);
  -webkit-backdrop-filter: blur(7px);
  backdrop-filter: blur(7px);
  opacity: 0;
  transition: opacity 0.4s ease;
}
.menu-sheet.is-open { opacity: 1; }

.menu-card {
  width: min(100%, 30rem);
  max-height: 86dvh;
  overflow-y: auto;
  padding: 1.5rem 1.5rem max(1.4rem, env(safe-area-inset-bottom));
  border: 1px solid rgba(51, 42, 32, 0.12);
  border-bottom: 0;
  border-radius: 22px 22px 0 0;
  background-color: var(--card);
  background-image: var(--grain);
  box-shadow: 0 -20px 60px rgba(0, 0, 0, 0.4);
  transform: translateY(100%);
  transition: transform 0.6s var(--spring);
}
.menu-sheet.is-open .menu-card { transform: none; }

.menu-title {
  margin: 0 0 1.1rem;
  font-family: var(--font-stamp);
  font-size: 0.72rem;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: var(--marigold-deep);
  text-align: center;
}

.menu-rows { margin: 0; display: grid; gap: 0.7rem; }

.menu-row {
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
}
.menu-row dt {
  font-family: var(--font-hand);
  font-weight: 600;
  font-size: 1.2rem;
  color: var(--ink);
  white-space: nowrap;
}
.menu-row .menu-dots {
  flex: 1;
  border-bottom: 1px dotted rgba(51, 42, 32, 0.35);
  transform: translateY(-4px);
}
.menu-row dd {
  margin: 0;
  font-family: var(--font-stamp);
  font-size: 0.62rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-align: right;
  color: var(--ink-soft);
}

.menu-foot {
  margin: 1.3rem 0 1.1rem;
  text-align: center;
  font-family: var(--font-hand);
  font-size: 1.15rem;
  color: var(--marigold-deep);
}

.menu-close { display: block; margin-inline: auto; }

/* ---------------------------------------------------------------------------
   Music pill — carried over from the earlier versions.
   ------------------------------------------------------------------------- */
.music-toggle {
  position: fixed;
  right: max(0.75rem, env(safe-area-inset-right));
  top: max(0.75rem, env(safe-area-inset-top));
  z-index: 30;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 0.85rem;
  border: 1px solid rgba(216, 178, 115, 0.28);
  border-radius: 999px;
  background: rgba(23, 19, 16, 0.72);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  color: var(--film-ink-soft);
  cursor: pointer;
  font-family: var(--font-serif);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.45);
  transition: transform 0.15s ease, box-shadow 0.3s ease,
              border-color 0.3s ease, color 0.3s ease;
}
.music-toggle:hover {
  border-color: rgba(216, 178, 115, 0.5);
  color: var(--film-ink);
  box-shadow: 0 8px 26px rgba(0, 0, 0, 0.55);
}
.music-toggle:active { transform: scale(0.96); }
.music-toggle:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }
.music-toggle .speaker { display: inline-flex; }

.eq { display: inline-flex; align-items: flex-end; gap: 2px; height: 14px; }
.eq span {
  display: block;
  width: 2.5px;
  height: 40%;
  background: var(--gold);
  border-radius: 1px;
  transform-origin: bottom;
}
.music-toggle.is-playing .eq span { animation: eq-bounce 0.9s ease-in-out infinite; }
.music-toggle.is-playing .eq span:nth-child(2) { animation-delay: 0.2s; }
.music-toggle.is-playing .eq span:nth-child(3) { animation-delay: 0.4s; }
@keyframes eq-bounce {
  0%, 100% { height: 30%; }
  50% { height: 100%; }
}
.music-toggle.is-muted .eq span,
.music-toggle:not(.is-playing) .eq span { height: 30%; }

/* ---------------------------------------------------------------------------
   No-JS fallback — cream cards lying in the dark, like the old ticket.
   ------------------------------------------------------------------------- */
.nojs { padding-block: 2.5rem 3rem; }

.nojs-card {
  margin-bottom: 1.75rem;
  padding: 1.1rem 1.35rem;
  border: 1px solid rgba(0, 0, 0, 0.12);
  border-radius: 4px;
  background-color: var(--card);
  background-image: var(--grain);
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.5);
}
.nojs-card img {
  display: block;
  width: 100%;
  height: auto;
  margin-bottom: 0.75rem;
  border-radius: 2px;
}
.nojs-card h2 {
  margin: 0 0 0.4rem;
  font-family: var(--font-serif);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.85rem;
  color: var(--ink);
}
.nojs-meta {
  margin: 0 0 0.5rem;
  font-family: var(--font-stamp);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
.nojs-note {
  margin: 0 0 0.4rem;
  font-family: var(--font-hand);
  font-size: 1.25rem;
  line-height: 1.45;
  color: var(--ink);
}
.nojs-verse {
  margin: 0.6rem 0 0.4rem;
  font-family: var(--font-serif);
  font-style: italic;
  line-height: 1.7;
  color: #9c5b50;
}

/* ---------------------------------------------------------------------------
   Reduced motion — every state change stays, all movement goes.
   ------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .intro-line, .tline, .ticket-closer, .manifest li, .mood,
  .dept-head, .dept-foot, .hush-snacks span {
    transform: none !important;
    transition: opacity 0.2s ease !important;
  }
  .parcel-hint, .hush-hint { animation: none !important; opacity: 0.8; }
}
