/* ============================================================================
   LOVE LETTER — warm vintage scene
   ============================================================================ */


/* ---------- The entry: a wooden door before you reach the letter ---------- */

.entry {
  position: relative;
  min-height: 100vh;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: auto;
  opacity: 1;
  transition: opacity 1.4s ease;
}

.entry::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 8;
  pointer-events: none;
  opacity: 0;
  background:
    radial-gradient(ellipse 88% 78% at 50% 52%,
      rgba(255, 255, 255, 0.72) 0%,
      rgba(255, 255, 255, 0.42) 45%,
      rgba(255, 255, 255, 0.12) 78%,
      rgba(255, 255, 255, 0) 100%),
    linear-gradient(180deg,
      rgba(255, 255, 255, 0.12) 0%,
      rgba(255, 255, 255, 0.36) 100%);
}

.entry__wall {
  position: relative;
  width: 100%;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 4vh 4vw;
  /* Dark wooden wall — vertical planks under a warm dim light */
  background:
    /* warm pool of light from above-center */
    radial-gradient(ellipse 70% 55% at 50% 45%,
      rgba(255, 190, 110, 0.18) 0%,
      rgba(255, 160, 80, 0.06) 30%,
      rgba(0,0,0,0) 65%),
    /* vertical seams between planks */
    repeating-linear-gradient(90deg,
      rgba(0,0,0,0) 0px,
      rgba(0,0,0,0) 138px,
      rgba(20, 8, 4, 0.7) 139px,
      rgba(60, 28, 14, 0.0) 142px),
    /* finer wood grain */
    repeating-linear-gradient(89deg,
      rgba(30, 14, 6, 0.0) 0px,
      rgba(30, 14, 6, 0.0) 8px,
      rgba(20, 10, 4, 0.25) 9px,
      rgba(20, 10, 4, 0.0) 11px),
    /* base wood */
    linear-gradient(180deg, #1d0e07 0%, #2a160a 35%, #1a0c06 100%);
  overflow: hidden;
}

/* a faint film grain on the wall, same trick as the room */
.entry__wall::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.10;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='220' height='220'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2'/></filter><rect width='100%25' height='100%25' filter='url(%23n)' opacity='0.6'/></svg>");
}

/* Title block above the door */
.entry__title {
  position: relative;
  text-align: center;
  margin-bottom: 4vh;
  z-index: 2;
}

.entry__eyebrow {
  font-family: 'Cinzel', Georgia, serif;
  letter-spacing: 0.5em;
  text-transform: uppercase;
  font-size: 12px;
  color: rgba(245, 215, 160, 0.7);
  margin: 0 0 14px 0;
}

.entry__heading {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-style: italic;
  font-weight: 500;
  font-size: clamp(28px, 4.2vw, 44px);
  color: #f5e2b9;
  margin: 0 0 8px 0;
  text-shadow: 0 1px 2px rgba(0,0,0,0.5);
}

.entry__sub {
  font-family: 'Pinyon Script', 'Brush Script MT', cursive;
  font-size: clamp(20px, 2.4vw, 28px);
  color: #f3dca6;
  margin: 0;
  opacity: 0.92;
  text-shadow: 0 1px 1px rgba(0,0,0,0.45);
}

/* The caption beneath the door */
.entry__caption {
  position: relative;
  text-align: center;
  margin-top: 3vh;
  max-width: 560px;
  z-index: 2;
}

.entry__caption-text {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-style: italic;
  font-size: clamp(15px, 1.4vw, 17px);
  line-height: 1.6;
  color: rgba(245, 215, 165, 0.78);
  margin: 0 0 12px 0;
}

.entry__hint {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-style: italic;
  font-size: 14px;
  letter-spacing: 0.25em;
  text-transform: lowercase;
  color: rgba(245, 215, 165, 0.55);
  margin: 0;
  animation: hint-pulse 2.4s ease-in-out infinite;
}

@keyframes hint-pulse {
  0%, 100% { opacity: 0.55; }
  50%      { opacity: 0.95; }
}


/* ---------- The door ---------------------------------------------------- */

.door {
  position: relative;
  width: clamp(240px, 32vw, 360px);
  aspect-ratio: 5 / 7.5;
  padding: 0;
  perspective: 1400px;
  z-index: 3;
  filter: drop-shadow(0 30px 50px rgba(0,0,0,0.7));
  transition: filter 0.6s ease;
}

.door:hover {
  filter: drop-shadow(0 30px 50px rgba(0,0,0,0.7))
          drop-shadow(0 0 30px rgba(255, 180, 90, 0.18));
}

.door__frame {
  position: relative;
  width: 100%;
  height: 100%;
  /* the dark doorway gap visible when the leaf swings */
  background: radial-gradient(ellipse at center,
    rgba(255, 220, 160, 0.55) 0%,
    rgba(255, 180, 90, 0.25) 25%,
    rgba(20, 10, 4, 0.95) 85%);
  border-radius: 4px;
  /* the wooden trim around the door, attached to the wall (does not swing) */
  box-shadow:
    0 0 0 6px #2c1608,
    0 0 0 7px rgba(60, 28, 14, 0.7),
    0 0 0 10px rgba(0,0,0,0.55),
    inset 0 0 24px rgba(0,0,0,0.75);
  transform-style: preserve-3d;
}

/* The door leaf — the part that swings */
.door__leaf {
  position: absolute;
  inset: 0;
  border-radius: 3px;
  /* warm brown wood with vertical grain */
  background:
    /* subtle highlight from light source */
    radial-gradient(ellipse 60% 50% at 30% 25%,
      rgba(255, 210, 150, 0.10) 0%,
      rgba(0,0,0,0) 60%),
    /* vertical grain streaks */
    repeating-linear-gradient(90deg,
      rgba(30, 14, 6, 0.0) 0px,
      rgba(30, 14, 6, 0.0) 14px,
      rgba(20, 8, 4, 0.22) 15px,
      rgba(20, 8, 4, 0.0) 18px),
    /* base wood color — slightly redder/warmer than the wall */
    linear-gradient(180deg, #6a361b 0%, #4e2511 60%, #371a0b 100%);
  box-shadow:
    inset 0 0 0 1px rgba(20, 8, 4, 0.6),
    inset 0 0 30px rgba(20, 8, 4, 0.55);
  transform-origin: left center;
  transform: rotateY(0deg);
  transition: transform 2.15s cubic-bezier(0.48, 0.04, 0.2, 1);
  backface-visibility: hidden;
  will-change: transform;
}

/* The two recessed panels on the door */
.door__panel {
  position: absolute;
  left: 10%;
  right: 10%;
  border-radius: 3px;
  background:
    /* deeper recessed wood, slightly darker */
    linear-gradient(180deg, #3c1c0c 0%, #2c150a 100%);
  box-shadow:
    /* the bevel: dark on top-left, light on bottom-right (recessed look) */
    inset 2px 2px 4px rgba(0,0,0,0.7),
    inset -2px -2px 3px rgba(255, 170, 110, 0.10),
    /* outer raised lip */
    0 0 0 1px rgba(20, 8, 4, 0.6),
    0 0 0 2px rgba(120, 70, 30, 0.18);
}

.door__panel--top {
  top: 7%;
  height: 30%;
}

.door__panel--bottom {
  top: 42%;
  bottom: 6%;
}

/* The brass doorknob */
.door__knob {
  position: absolute;
  right: 8%;
  top: 50%;
  width: 14%;
  aspect-ratio: 1;
  border-radius: 50%;
  background:
    radial-gradient(circle at 30% 28%,
      #fff2b8 0%,
      #e8c065 22%,
      #b8862a 55%,
      #6a4814 90%,
      #3a2608 100%);
  box-shadow:
    inset -2px -3px 6px rgba(40, 20, 0, 0.6),
    inset 2px 2px 4px rgba(255, 240, 200, 0.5),
    0 3px 6px rgba(0,0,0,0.5);
}

.door__knob-shadow {
  position: absolute;
  left: -10%;
  top: 65%;
  width: 60%;
  height: 18%;
  background: radial-gradient(ellipse at center, rgba(0,0,0,0.4) 0%, rgba(0,0,0,0) 70%);
  border-radius: 50%;
  filter: blur(2px);
}

/* warm light leaking from the cracks once the door opens */
.door__lightleak {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(ellipse at 50% 50%,
    rgba(255, 220, 160, 0.6) 0%,
    rgba(255, 180, 90, 0.3) 30%,
    rgba(255, 180, 90, 0) 65%);
  opacity: 0;
  pointer-events: none;
  transition: opacity 1.15s ease 0.55s;
}

/* --- door-opening state -------------------------------------------------- */

body.is-opening .door__leaf {
  transform: rotateY(-82deg);
}

body.is-opening .door__lightleak {
  opacity: 1;
}

body.is-opening .entry {
  animation: entry-fade-after-open 2.15s linear forwards;
  pointer-events: none;
}

body.is-opening .entry::before {
  animation: entry-brighten-after-crack 2.15s ease-out forwards;
}

@keyframes entry-brighten-after-crack {
  0%   { opacity: 0; }
  26%  { opacity: 0; }
  50%  { opacity: 0.28; }
  72%  { opacity: 0.62; }
  100% { opacity: 1; }
}

@keyframes entry-fade-after-open {
  0%   { opacity: 1; }
  62%  { opacity: 1; }
  84%  { opacity: 0.6; }
  100% { opacity: 0; }
}

/* Once the entry has faded we can stop rendering it entirely so the room can
   receive focus and clicks cleanly. */
body.is-entered .entry {
  display: none;
}

/* While the entry is up, hide the room behind it from screen readers/tab order */
body.is-entry .room,
body.is-entry .lockbox,
body.is-entry .fold-back,
body.is-entry .room-exit,
body.is-entry .clue-count,
body.is-entry .clue-pop {
  visibility: hidden;
}

body.is-entry {
  overflow: hidden;
  height: 100vh;
}

body:not(.is-entry) .room {
  animation: room-fade-in 1.2s ease 0.1s both;
}

@keyframes room-fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}


/* ---------- The doorstep: door + doormat group ------------------------- */

.entry__doorstep {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  z-index: 3;
}


/* ---------- The doormat lying in front of the door --------------------- */

.doormat {
  position: relative;
  /* slightly wider than the door so it reads as a real mat in front of it */
  width: clamp(280px, 38vw, 420px);
  /* a thin slab, foreshortened — the floor is seen at a shallow angle */
  height: clamp(40px, 5.6vw, 62px);
  /* tuck the back edge under the door's bottom so it looks set against it */
  margin-top: clamp(-22px, -2.5vw, -14px);
  perspective: 900px;
  cursor: pointer;
  z-index: 4;
  -webkit-tap-highlight-color: transparent;
}

.doormat:focus { outline: none; }

.doormat:focus-visible .doormat__flap {
  box-shadow:
    inset 0 0 0 1px rgba(255, 220, 170, 0.4),
    inset 0 0 18px rgba(0, 0, 0, 0.55),
    0 6px 14px rgba(0, 0, 0, 0.6);
}

/* The mat surface — this is the part that lifts on the X axis.
   transform-origin is at the BACK edge (closer to the door),
   so the front edge hinges UP toward the viewer like a real mat being lifted. */
.doormat__flap {
  position: absolute;
  inset: 0;
  border-radius: 3px;
  transform-origin: center top;
  transform: rotateX(0deg);
  transition: transform 0.95s cubic-bezier(0.22, 0.85, 0.3, 1),
              filter 0.4s ease;
  z-index: 2;
  /* dark woven fiber + warm undertone, sympathetic to the wood */
  background:
    /* warm pool of candlelight from upper center */
    radial-gradient(ellipse 60% 130% at 50% 0%,
      rgba(255, 180, 100, 0.10) 0%,
      rgba(255, 160, 80, 0.0)  55%),
    /* tight horizontal weave */
    repeating-linear-gradient(0deg,
      rgba(0, 0, 0, 0.40) 0px,
      rgba(0, 0, 0, 0.40) 1px,
      rgba(255, 200, 140, 0.04) 2px,
      rgba(0, 0, 0, 0.0) 3px,
      rgba(0, 0, 0, 0.0) 5px),
    /* vertical weave threads */
    repeating-linear-gradient(90deg,
      rgba(20, 8, 4, 0.0)  0px,
      rgba(20, 8, 4, 0.0)  3px,
      rgba(20, 8, 4, 0.55) 4px,
      rgba(60, 28, 14, 0.0) 6px),
    /* base color — deep coffee brown, a touch warmer than the wall */
    linear-gradient(180deg, #2a1608 0%, #1a0c05 50%, #0e0703 100%);
  box-shadow:
    /* inner rim, like the mat is pressed into the floor */
    inset 0 0 0 1px rgba(20, 8, 4, 0.7),
    inset 0 0 22px rgba(0, 0, 0, 0.55);
  backface-visibility: hidden;
  will-change: transform;
}

/* underside of the mat — visible once it tips far enough to show its back.
   Plain darker fiber, no border or fringe, slightly different texture. */
.doormat__flap::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 3px;
  transform: rotateX(180deg);
  backface-visibility: hidden;
  background:
    repeating-linear-gradient(0deg,
      rgba(0, 0, 0, 0.35) 0px,
      rgba(0, 0, 0, 0.35) 1px,
      rgba(120, 70, 30, 0.06) 2px,
      rgba(0, 0, 0, 0.0) 3px,
      rgba(0, 0, 0, 0.0) 6px),
    linear-gradient(180deg, #1a0e06 0%, #120804 100%);
  box-shadow:
    inset 0 0 0 1px rgba(20, 8, 4, 0.8),
    inset 0 0 18px rgba(0, 0, 0, 0.65);
}

/* a faint film grain on the mat surface */
.doormat__weave {
  position: absolute;
  inset: 0;
  border-radius: 3px;
  pointer-events: none;
  opacity: 0.18;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='200' height='200'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='1.6' numOctaves='2'/></filter><rect width='100%25' height='100%25' filter='url(%23n)' opacity='0.7'/></svg>");
}

/* a slim raised border around the mat */
.doormat__border {
  position: absolute;
  inset: 6%;
  border-radius: 1px;
  pointer-events: none;
  box-shadow:
    inset 0 0 0 1px rgba(120, 70, 30, 0.35),
    inset 0 0 0 2px rgba(20, 8, 4, 0.55);
}

/* tasselled fringe along the front and back edges */
.doormat__fringe {
  position: absolute;
  left: 1.5%;
  right: 1.5%;
  height: 6px;
  pointer-events: none;
  background:
    repeating-linear-gradient(90deg,
      rgba(120, 70, 30, 0.0)  0px,
      rgba(120, 70, 30, 0.6)  1px,
      rgba(40, 22, 10, 0.8)   2px,
      rgba(0, 0, 0, 0.0)      3px,
      rgba(0, 0, 0, 0.0)      5px);
  filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.45));
}

.doormat__fringe--front {
  bottom: -5px;
}

.doormat__fringe--back {
  top: -5px;
  opacity: 0.7;
}

/* Cast shadow on the floor — present while flat, deepens as the mat lifts. */
.doormat__floor-shadow {
  position: absolute;
  left: 2%;
  right: 2%;
  top: 70%;
  height: 70%;
  border-radius: 50%;
  background: radial-gradient(ellipse at center,
    rgba(0, 0, 0, 0.55) 0%,
    rgba(0, 0, 0, 0.25) 45%,
    rgba(0, 0, 0, 0) 75%);
  filter: blur(6px);
  opacity: 0.55;
  pointer-events: none;
  transform: scaleX(1);
  transition: opacity 0.6s ease, transform 0.9s cubic-bezier(0.22, 0.85, 0.3, 1);
  z-index: 0;
}

/* The folded note tucked under the mat. Hidden until the mat lifts. */
.doormat__note-peek {
  position: absolute;
  /* centered horizontally; sits "behind" the mat in stacking */
  left: 50%;
  top: 50%;
  width: 60%;
  height: 64%;
  transform: translate(-50%, -55%) rotate(-3deg);
  border-radius: 2px;
  background:
    radial-gradient(circle at 30% 25%, rgba(120, 80, 40, 0.10), transparent 50%),
    radial-gradient(circle at 80% 70%, rgba(120, 80, 40, 0.08), transparent 50%),
    linear-gradient(180deg, #f4e7c8 0%, #e6d2a3 100%);
  box-shadow:
    inset 0 0 8px rgba(120, 70, 30, 0.25),
    0 2px 4px rgba(0, 0, 0, 0.5);
  opacity: 0;
  pointer-events: none;
  /* peek note revealed once the mat is well off the floor */
  transition: opacity 0.45s ease 0.15s;
  z-index: 1;
}

/* the fold crease running across the middle of the peek note */
.doormat__note-peek-fold {
  position: absolute;
  left: 4%;
  right: 4%;
  top: 50%;
  height: 1px;
  background: linear-gradient(90deg,
    rgba(120, 70, 30, 0.0) 0%,
    rgba(120, 70, 30, 0.5) 20%,
    rgba(120, 70, 30, 0.5) 80%,
    rgba(120, 70, 30, 0.0) 100%);
  box-shadow: 0 1px 1px rgba(255, 240, 200, 0.35);
}

/* --- subtle hover hint --- */
@media (hover: hover) and (pointer: fine) {
  .doormat:hover .doormat__flap {
    transform: rotateX(-6deg);
  }
  .doormat:hover .doormat__floor-shadow {
    opacity: 0.75;
    transform: scaleX(0.96);
  }
}

/* --- lifted state ------------------------------------------------------- */

.doormat.is-lifted {
  cursor: default;
}

.doormat.is-lifted .doormat__flap {
  transform: rotateX(-78deg);
}

.doormat.is-lifted .doormat__floor-shadow {
  opacity: 1;
  transform: scaleX(0.78);
}

.doormat.is-lifted .doormat__note-peek {
  opacity: 1;
}

/* once the note has flown up to be read, hide the under-mat peek
   so it doesn't visually duplicate the centered paper */
.doormat.is-lifted.is-reading .doormat__note-peek {
  opacity: 0;
  transition: opacity 0.3s ease;
}


/* ---------- The note, picked up and read at center --------------------- */

.under-note {
  position: fixed;
  inset: 0;
  z-index: 140;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.45s ease;
}

.under-note.is-visible {
  opacity: 1;
  pointer-events: auto;
}

/* dim wash behind the note — keeps the door/landing visible underneath */
.under-note__backdrop {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at center,
    rgba(8, 4, 2, 0.30) 0%,
    rgba(8, 4, 2, 0.65) 100%);
  backdrop-filter: blur(1.5px);
  -webkit-backdrop-filter: blur(1.5px);
}

/* the folded paper itself, animated up from the mat to the center */
.under-note__paper {
  position: relative;
  width: min(520px, 88vw);
  max-height: min(78vh, 720px);
  padding: 44px 44px 38px;
  background:
    radial-gradient(circle at 15% 20%, rgba(120, 80, 40, 0.10), transparent 45%),
    radial-gradient(circle at 85% 80%, rgba(120, 80, 40, 0.10), transparent 45%),
    radial-gradient(circle at 60% 30%, rgba(80, 50, 20, 0.06), transparent 40%),
    linear-gradient(180deg, #fbf3df 0%, #f4e7c8 70%, #ecdab2 100%);
  border-radius: 3px;
  box-shadow:
    inset 0 0 40px rgba(120, 80, 30, 0.22),
    0 30px 60px rgba(0, 0, 0, 0.65),
    0 8px 18px rgba(0, 0, 0, 0.4);
  color: #2c1a0a;
  text-align: left;
  /* starting state: small, low, gently tilted, as if just lifted from the mat.
     translateY(22vh) drops it near the bottom of the screen where the mat sits. */
  transform: translateY(22vh) scale(0.14) rotate(-4deg);
  transform-origin: center center;
  opacity: 0;
  transition:
    transform 0.85s cubic-bezier(0.2, 0.7, 0.2, 1),
    opacity 0.45s ease;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.under-note.is-visible .under-note__paper {
  transform: translateY(0) scale(1) rotate(0deg);
  opacity: 1;
}

/* a faint horizontal crease, as if the note was folded in half */
.under-note__crease {
  position: absolute;
  left: 8%;
  right: 8%;
  top: 50%;
  height: 1px;
  pointer-events: none;
  background: linear-gradient(90deg,
    rgba(120, 70, 30, 0.0) 0%,
    rgba(120, 70, 30, 0.28) 25%,
    rgba(120, 70, 30, 0.28) 75%,
    rgba(120, 70, 30, 0.0) 100%);
  box-shadow:
    0 -1px 0 rgba(255, 240, 200, 0.5),
    0 1px 0 rgba(80, 40, 10, 0.05);
}

.under-note__inner {
  position: relative;
}

.under-note__eyebrow {
  font-family: 'Cinzel', Georgia, serif;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  font-size: 11px;
  color: rgba(122, 80, 36, 0.75);
  text-align: center;
  margin: 0 0 22px 0;
}

.under-note__text {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-style: italic;
  font-size: clamp(16px, 1.5vw, 19px);
  line-height: 1.65;
  color: #2c1a0a;
  margin: 0;
  white-space: pre-line;
}

.under-note__close {
  position: absolute;
  top: 6px;
  right: 12px;
  font-size: 26px;
  line-height: 1;
  color: #6b4a26;
  opacity: 0.55;
  padding: 4px 8px;
  transition: opacity 0.2s ease;
}

.under-note__close:hover { opacity: 1; }


*,
*::before,
*::after { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  overflow-x: hidden;
  overflow-y: auto;
  font-family: 'Cormorant Garamond', Georgia, 'Times New Roman', serif;
  color: #3a2818;
  background: #0c0703;
}

button {
  background: none;
  border: none;
  font: inherit;
  color: inherit;
  cursor: pointer;
}


/* ---------- The room ------------------------------------------------------ */

.room {
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse 60% 50% at 35% 40%,
      rgba(255, 200, 130, 0.35) 0%,
      rgba(255, 170, 90, 0.18) 25%,
      rgba(60, 30, 15, 0.0) 55%,
      rgba(20, 10, 5, 0.55) 100%),
    radial-gradient(ellipse at center,
      #2b1a0e 0%,
      #1a0f08 60%,
      #0c0703 100%);
  overflow: hidden;
}

/* Subtle dust / film grain over the whole room */
.room::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.08;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='200' height='200'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/></filter><rect width='100%25' height='100%25' filter='url(%23n)' opacity='0.6'/></svg>");
}


/* ---------- Room wall + wall art ----------------------------------------- */

.room__wall {
  position: absolute;
  inset: 0 0 62% 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 55% 70% at 35% 55%,
      rgba(255, 200, 130, 0.22) 0%,
      rgba(255, 170, 90, 0.08) 35%,
      rgba(0, 0, 0, 0) 70%),
    repeating-linear-gradient(90deg,
      rgba(0, 0, 0, 0) 0px,
      rgba(0, 0, 0, 0) 42px,
      rgba(20, 8, 4, 0.35) 43px,
      rgba(20, 8, 4, 0) 46px),
    linear-gradient(180deg, #241208 0%, #1a0c06 100%);
}

.room__wall-rail {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 10px;
  background: linear-gradient(180deg, #5a3418 0%, #3e2210 100%);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.45);
}

.room__wall-skirt {
  position: absolute;
  left: 0;
  right: 0;
  bottom: -18px;
  height: 18px;
  background:
    repeating-linear-gradient(90deg,
      #4a2812 0px,
      #4a2812 16px,
      #3a1e0c 16px,
      #3a1e0c 32px);
}

.frame {
  position: absolute;
  top: 10%;
  z-index: 4;
  padding: 0;
  border: none;
  background: none;
  cursor: pointer;
  filter: drop-shadow(0 10px 18px rgba(0, 0, 0, 0.45));
  transition: transform 0.25s ease, filter 0.25s ease;
}

.frame:hover,
.frame:focus-visible {
  transform: translateY(-2px);
  filter: drop-shadow(0 14px 22px rgba(0, 0, 0, 0.5))
          drop-shadow(0 0 16px rgba(255, 180, 90, 0.15));
}

.frame--landscape {
  left: 8%;
  width: clamp(110px, 14vw, 170px);
}

.frame--photo {
  left: 50%;
  transform: translateX(-50%);
  width: clamp(140px, 18vw, 220px);
}

.frame--photo:hover,
.frame--photo:focus-visible {
  transform: translateX(-50%) translateY(-2px);
}

.frame--lyric {
  right: 8%;
  width: clamp(100px, 12vw, 150px);
}

.frame__cord {
  position: absolute;
  top: -28px;
  width: 1px;
  height: 28px;
  background: rgba(120, 90, 50, 0.55);
}

.frame__cord--left { left: 22%; }
.frame__cord--right { right: 22%; }

.frame__nail {
  position: absolute;
  top: -4px;
  left: 50%;
  width: 8px;
  height: 8px;
  transform: translateX(-50%);
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, #d4a34a 0%, #6a4814 100%);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

.frame__moulding {
  position: relative;
  padding: 6px;
  border-radius: 2px;
  background: linear-gradient(145deg, #8a6030 0%, #5a3818 55%, #3a220e 100%);
  box-shadow:
    inset 0 0 0 1px rgba(255, 220, 170, 0.25),
    inset 0 0 10px rgba(0, 0, 0, 0.35);
}

.frame__moulding--gilt {
  background: linear-gradient(145deg, #c9a052 0%, #8a6030 50%, #5a3818 100%);
}

.frame__moulding--ornate {
  padding: 8px;
  background:
    linear-gradient(145deg, #b8924a 0%, #7a5228 45%, #4a2812 100%);
}

.frame__moulding--dark {
  background: linear-gradient(145deg, #4a2812 0%, #2a1608 100%);
}

.frame__matte {
  position: relative;
  padding: 8px;
  background: #f3ead8;
  box-shadow: inset 0 0 0 1px rgba(80, 50, 20, 0.2);
}

.frame__matte--cream {
  background: #f7f0df;
}

.frame__art {
  position: relative;
  overflow: hidden;
  aspect-ratio: 4 / 3;
  border-radius: 1px;
}

.frame__art--landscape {
  background: linear-gradient(180deg, #8ec5e8 0%, #c8e6b0 55%, #7a9a48 100%);
}

.frame__art-sky {
  position: absolute;
  inset: 0 0 45% 0;
  background: linear-gradient(180deg, #9fd0ef 0%, #d8eef8 100%);
}

.frame__art-sun {
  position: absolute;
  top: 16%;
  right: 18%;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: radial-gradient(circle, #fff6c2 0%, #ffd76a 100%);
}

.frame__art-hills {
  position: absolute;
  left: -10%;
  right: -10%;
  border-radius: 50%;
}

.frame__art-hills--far {
  bottom: 28%;
  height: 40%;
  background: #6f8f58;
  opacity: 0.75;
}

.frame__art-hills--near {
  bottom: 18%;
  height: 34%;
  background: #55743f;
}

.frame__art-field {
  position: absolute;
  inset: auto 0 0 0;
  height: 34%;
  background: linear-gradient(180deg, #8aa956 0%, #6d8740 100%);
}

.frame__art-tree {
  position: absolute;
  bottom: 24%;
  width: 10px;
  height: 22px;
  background: #2f4a22;
  border-radius: 50% 50% 2px 2px;
}

.frame__art-tree--a { left: 18%; }
.frame__art-tree--b { right: 22%; height: 18px; }

.frame__art-road {
  position: absolute;
  left: 34%;
  bottom: 0;
  width: 18%;
  height: 34%;
  background: linear-gradient(180deg, rgba(120, 90, 50, 0.2) 0%, #9a8050 100%);
  transform: skewX(-8deg);
}

.frame__photo-window {
  position: relative;
  overflow: hidden;
  aspect-ratio: 4 / 5;
  background: #e8dcc8;
}

.frame__photo-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.frame__photo-img.is-loaded:not(.is-missing) {
  opacity: 1;
}

.frame__photo-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 8px;
  text-align: center;
  background: linear-gradient(180deg, #efe4cf 0%, #dccdb4 100%);
}

.frame__photo-img.is-loaded:not(.is-missing) + .frame__photo-placeholder {
  display: none;
}

.frame__photo-placeholder-mark {
  font-family: 'Pinyon Script', cursive;
  font-size: 22px;
  color: #6a4a28;
}

.frame__photo-placeholder-hint,
.frame__photo-placeholder-sub {
  font-size: 10px;
  line-height: 1.3;
  color: rgba(58, 40, 24, 0.72);
}

.frame__photo-caption {
  margin-top: 6px;
  font-family: 'Pinyon Script', cursive;
  font-size: 13px;
  text-align: center;
  color: #5a3818;
}

.frame__art--lyric {
  aspect-ratio: 3 / 4;
  padding: 10px 8px;
  background: linear-gradient(180deg, #f7f0df 0%, #ebe0cc 100%);
}

.frame__lyric-clef {
  font-size: 22px;
  line-height: 1;
  color: rgba(58, 40, 24, 0.55);
}

.frame__lyric-line {
  margin: 6px 0 0;
  font-size: 11px;
  line-height: 1.35;
  color: #4a3018;
}

.frame__lyric-line--a { font-style: italic; }

.frame__lyric-petal {
  position: absolute;
  right: 10px;
  bottom: 10px;
  width: 14px;
  height: 10px;
  border-radius: 50% 50% 40% 40%;
  background: #c96a72;
  transform: rotate(18deg);
  opacity: 0.85;
}

.frame__hint {
  position: absolute;
  left: 50%;
  bottom: -22px;
  transform: translateX(-50%);
  white-space: nowrap;
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-style: italic;
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: lowercase;
  color: rgba(245, 215, 165, 0.55);
  opacity: 0;
  transition: opacity 0.25s ease;
  pointer-events: none;
}

.frame:hover .frame__hint,
.frame:focus-visible .frame__hint {
  opacity: 1;
}


/* ---------- The table ---------------------------------------------------- */

.table {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 62%;
  background:
    /* soft top edge highlight from candlelight */
    linear-gradient(180deg,
      rgba(255, 200, 130, 0.18) 0%,
      rgba(255, 180, 100, 0.0) 12%,
      rgba(0,0,0,0) 100%),
    /* wood grain — repeating darker streaks */
    repeating-linear-gradient(92deg,
      rgba(60, 30, 12, 0.0)  0px,
      rgba(60, 30, 12, 0.0)  18px,
      rgba(40, 20, 8, 0.35) 19px,
      rgba(40, 20, 8, 0.0)  22px,
      rgba(0,0,0,0.0)       40px),
    repeating-linear-gradient(91deg,
      rgba(90, 50, 20, 0.0)  0px,
      rgba(90, 50, 20, 0.0)  60px,
      rgba(90, 50, 20, 0.25) 62px,
      rgba(90, 50, 20, 0.0)  68px),
    /* base wood color gradient */
    linear-gradient(180deg, #5a3418 0%, #3e2210 70%, #2a1608 100%);
  box-shadow: 0 -20px 40px rgba(0,0,0,0.6) inset;
}


/* ---------- The candle --------------------------------------------------- */

.candle {
  position: absolute;
  left: 15%;
  bottom: 28%;
  width: 60px;
  height: 200px;
  z-index: 2;
  filter: drop-shadow(0 10px 14px rgba(0, 0, 0, 0.45));
  transform-style: preserve-3d;
}

.candle::before {
  /* wax tray / saucer under the candle */
  content: "";
  position: absolute;
  left: 50%;
  bottom: -10px;
  width: 92px;
  height: 20px;
  transform: translateX(-50%);
  border-radius: 50%;
  background:
    radial-gradient(ellipse at 50% 35%,
      rgba(255, 232, 182, 0.85) 0%,
      rgba(232, 194, 126, 0.72) 48%,
      rgba(114, 72, 30, 0.92) 100%);
  box-shadow:
    inset 0 2px 2px rgba(255, 240, 200, 0.55),
    inset 0 -4px 7px rgba(60, 30, 10, 0.45),
    0 6px 10px rgba(0, 0, 0, 0.45);
  z-index: 1;
}

.candle::after {
  /* soft grounding shadow from candle + tray */
  content: "";
  position: absolute;
  left: 50%;
  bottom: -20px;
  width: 120px;
  height: 28px;
  transform: translateX(-50%);
  border-radius: 50%;
  background: radial-gradient(ellipse at center,
    rgba(0, 0, 0, 0.42) 0%,
    rgba(0, 0, 0, 0.12) 58%,
    rgba(0, 0, 0, 0) 100%);
  filter: blur(1px);
  z-index: 0;
}

.candle__stick {
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 36px;
  height: 130px;
  background:
    linear-gradient(180deg,
      #f7e6c4 0%,
      #e8d3a5 30%,
      #c9ad7a 100%);
  border-radius: 4px 4px 2px 2px / 8px 8px 2px 2px;
  box-shadow:
    inset -6px 0 12px rgba(80, 50, 20, 0.35),
    inset 4px 0 8px rgba(255, 240, 200, 0.4),
    0 4px 18px rgba(0,0,0,0.5);
  z-index: 2;
}

.candle__stick::before {
  /* drip running down one side */
  content: "";
  position: absolute;
  top: -6px;
  right: 6px;
  width: 6px;
  height: 24px;
  background: linear-gradient(180deg, #f7e6c4, #d8be8a);
  border-radius: 3px 3px 6px 6px;
}

.candle__wick {
  position: absolute;
  bottom: 130px;
  left: 50%;
  transform: translateX(-50%);
  width: 2px;
  height: 10px;
  background: #1c1208;
  z-index: 4;
}

.candle__flame {
  position: absolute;
  bottom: 138px;
  left: 50%;
  transform: translateX(-50%);
  width: 18px;
  height: 36px;
  background: radial-gradient(ellipse at center bottom,
    #fff7c2 0%,
    #ffd76a 30%,
    #ff9533 60%,
    rgba(255,80,20,0.0) 100%);
  border-radius: 50% 50% 45% 45% / 70% 70% 30% 30%;
  filter: blur(0.4px);
  transform-origin: center bottom;
  animation: flame-flicker 1.6s ease-in-out infinite;
  z-index: 5;
}

.candle__flame-inner {
  position: absolute;
  inset: 8px 4px 4px 4px;
  background: radial-gradient(ellipse at center bottom,
    #fffaf0 0%,
    #ffe69a 50%,
    rgba(255, 200, 100, 0) 100%);
  border-radius: 50% 50% 45% 45% / 70% 70% 30% 30%;
}

.candle__glow {
  position: absolute;
  bottom: 80px;
  left: 50%;
  width: 360px;
  height: 360px;
  transform: translateX(-50%);
  background: radial-gradient(circle,
    rgba(255, 190, 110, 0.55) 0%,
    rgba(255, 160, 80, 0.25) 25%,
    rgba(255, 140, 60, 0.0) 60%);
  pointer-events: none;
  animation: glow-breathe 3.2s ease-in-out infinite;
  z-index: 1;
  mix-blend-mode: screen;
}

@keyframes flame-flicker {
  0%, 100% { transform: translateX(-50%) scaleY(1)   scaleX(1)    rotate(-1deg); }
  20%      { transform: translateX(-50%) scaleY(1.08) scaleX(0.96) rotate(1deg); }
  45%      { transform: translateX(-50%) scaleY(0.94) scaleX(1.04) rotate(-2deg); }
  70%      { transform: translateX(-50%) scaleY(1.05) scaleX(0.98) rotate(2deg); }
}

@keyframes glow-breathe {
  0%, 100% { opacity: 0.95; }
  50%      { opacity: 0.75; }
}

.candle__hint {
  position: absolute;
  left: 50%;
  bottom: -28px;
  transform: translateX(-50%);
  white-space: nowrap;
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-style: italic;
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: lowercase;
  color: rgba(245, 215, 165, 0.55);
  opacity: 0;
  transition: opacity 0.25s ease;
  pointer-events: none;
}

.candle:hover .candle__hint,
.candle:focus-visible .candle__hint {
  opacity: 1;
}


/* ---------- Mantel clock ------------------------------------------------- */

.clock {
  position: absolute;
  left: 28%;
  bottom: 42%;
  width: 92px;
  z-index: 3;
  filter: drop-shadow(0 12px 16px rgba(0, 0, 0, 0.45));
  transition: transform 0.25s ease, filter 0.25s ease;
}

.clock:hover,
.clock:focus-visible {
  transform: translateY(-3px);
  filter: drop-shadow(0 16px 20px rgba(0, 0, 0, 0.5));
}

.clock__roof {
  width: 72%;
  height: 14px;
  margin: 0 auto -2px;
  border-radius: 3px 3px 0 0;
  background: linear-gradient(180deg, #6a361b 0%, #4a2812 100%);
}

.clock__case {
  position: relative;
  padding: 8px 8px 10px;
  border-radius: 4px;
  background: linear-gradient(180deg, #5a3418 0%, #3e2210 100%);
  box-shadow: inset 0 0 0 1px rgba(255, 220, 170, 0.15);
}

.clock__bezel {
  padding: 4px;
  border-radius: 50%;
  background: linear-gradient(145deg, #c9a052 0%, #7a5228 100%);
}

.clock__face {
  position: relative;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #fff8ea 0%, #ead8b8 100%);
  box-shadow: inset 0 0 8px rgba(80, 50, 20, 0.25);
}

.clock__tick {
  position: absolute;
  left: 50%;
  top: 4px;
  width: 1px;
  height: 6px;
  transform: translateX(-50%);
  background: rgba(58, 40, 24, 0.65);
}

.clock__tick--3  { top: 50%; left: auto; right: 4px; transform: translateY(-50%) rotate(90deg); }
.clock__tick--6  { top: auto; bottom: 4px; }
.clock__tick--9  { top: 50%; left: 4px; transform: translateY(-50%) rotate(90deg); }

.clock__numeral {
  position: absolute;
  font-family: 'Cinzel', Georgia, serif;
  font-size: 7px;
  color: rgba(58, 40, 24, 0.75);
}

.clock__numeral--12 { top: 8px; left: 50%; transform: translateX(-50%); }
.clock__numeral--3  { top: 50%; right: 8px; transform: translateY(-50%); }
.clock__numeral--6  { bottom: 8px; left: 50%; transform: translateX(-50%); }
.clock__numeral--9  { top: 50%; left: 8px; transform: translateY(-50%); }

.clock__hand {
  position: absolute;
  left: 50%;
  bottom: 50%;
  transform-origin: center bottom;
  background: #2a1608;
  border-radius: 2px;
}

.clock__hand--hour {
  width: 3px;
  height: 18px;
  margin-left: -1.5px;
  transform: rotate(35deg);
}

.clock__hand--minute {
  width: 2px;
  height: 24px;
  margin-left: -1px;
  transform: rotate(120deg);
}

.clock__hand--second {
  width: 1px;
  height: 26px;
  margin-left: -0.5px;
  background: #8a2a20;
  transform: rotate(250deg);
}

.clock__pin {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 5px;
  height: 5px;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: #6a4814;
}

.clock__pendulum-window {
  height: 28px;
  margin-top: 4px;
  overflow: hidden;
}

.clock__pendulum {
  width: 2px;
  height: 100%;
  margin: 0 auto;
  transform-origin: top center;
  animation: pendulum-swing 2.8s ease-in-out infinite;
}

.clock__pendulum-rod {
  width: 2px;
  height: 18px;
  margin: 0 auto;
  background: #c9a052;
}

.clock__pendulum-bob {
  width: 12px;
  height: 12px;
  margin: -1px auto 0;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, #e8c878 0%, #8a6030 100%);
}

.clock__feet {
  display: flex;
  justify-content: space-between;
  padding: 0 10px;
  margin-top: 2px;
}

.clock__feet span {
  width: 10px;
  height: 6px;
  border-radius: 2px;
  background: #3e2210;
}

@keyframes pendulum-swing {
  0%, 100% { transform: rotate(-8deg); }
  50%      { transform: rotate(8deg); }
}


/* ---------- Little book ------------------------------------------------ */

.book {
  position: absolute;
  right: 24%;
  bottom: 36%;
  width: 78px;
  height: 58px;
  z-index: 4;
  transform: rotate(-8deg);
  filter: drop-shadow(0 10px 14px rgba(0, 0, 0, 0.45));
  transition: transform 0.25s ease, filter 0.25s ease;
}

.book:hover,
.book:focus-visible {
  transform: rotate(-6deg) translateY(-3px);
  filter: drop-shadow(0 14px 18px rgba(0, 0, 0, 0.5));
}

.book__shadow {
  position: absolute;
  inset: auto 4px -8px 4px;
  height: 10px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.35);
  filter: blur(2px);
}

.book__cover {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: 2px 6px 6px 2px;
  background: linear-gradient(145deg, #5a2818 0%, #3a1608 100%);
  box-shadow: inset 0 0 0 1px rgba(255, 220, 170, 0.12);
}

.book__spine {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 10px;
  background: linear-gradient(90deg, #2a1006 0%, #4a2010 100%);
  border-radius: 2px 0 0 2px;
}

.book__title {
  position: absolute;
  inset: 10px 8px 10px 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  color: rgba(245, 215, 165, 0.88);
  text-align: center;
}

.book__title-top,
.book__title-bottom {
  font-family: 'Cinzel', Georgia, serif;
  font-size: 9px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.book__title-rule {
  width: 70%;
  height: 1px;
  background: rgba(245, 215, 165, 0.45);
}

.book__corner {
  position: absolute;
  width: 8px;
  height: 8px;
  border: 1px solid rgba(245, 215, 165, 0.25);
}

.book__corner--tl { top: 6px; left: 12px; border-right: none; border-bottom: none; }
.book__corner--tr { top: 6px; right: 6px; border-left: none; border-bottom: none; }
.book__corner--bl { bottom: 6px; left: 12px; border-right: none; border-top: none; }
.book__corner--br { bottom: 6px; right: 6px; border-left: none; border-top: none; }

.book__pages-edge {
  position: absolute;
  right: -3px;
  top: 4px;
  bottom: 4px;
  width: 5px;
  border-radius: 0 2px 2px 0;
  background: linear-gradient(180deg, #f7f0df 0%, #e8dcc8 100%);
}

.book__bookmark {
  position: absolute;
  top: -2px;
  right: 18px;
  width: 8px;
  height: 18px;
  background: #8a2a20;
  clip-path: polygon(0 0, 100% 0, 100% 100%, 50% 82%, 0 100%);
}


/* ---------- Tulip vase --------------------------------------------------- */

.vase {
  position: absolute;
  right: 10%;
  bottom: 34%;
  width: 110px;
  height: 150px;
  z-index: 4;
  filter: drop-shadow(0 10px 14px rgba(0, 0, 0, 0.4));
  transition: transform 0.25s ease, filter 0.25s ease;
}

.vase:hover,
.vase:focus-visible {
  transform: translateY(-3px);
  filter: drop-shadow(0 14px 18px rgba(0, 0, 0, 0.48));
}

.vase__shadow {
  position: absolute;
  left: 10%;
  right: 10%;
  bottom: -6px;
  height: 12px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.35);
  filter: blur(2px);
}

.vase__hint {
  position: absolute;
  left: 50%;
  bottom: -24px;
  transform: translateX(-50%);
  white-space: nowrap;
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-style: italic;
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: lowercase;
  color: rgba(245, 215, 165, 0.55);
  opacity: 0;
  transition: opacity 0.25s ease;
  pointer-events: none;
}

.vase:hover .vase__hint,
.vase:focus-visible .vase__hint {
  opacity: 1;
}

.tulip {
  position: absolute;
  bottom: 28px;
  width: 34px;
  height: 90px;
}

.tulip--left   { left: 8px;  transform: rotate(-8deg); }
.tulip--center { left: 38px; transform: rotate(2deg); }
.tulip--right  { right: 8px; transform: rotate(10deg); }

.tulip__stem {
  position: absolute;
  left: 50%;
  bottom: 0;
  width: 3px;
  height: 58px;
  transform: translateX(-50%);
  background: linear-gradient(180deg, #5a8a38 0%, #3a6028 100%);
  border-radius: 2px;
}

.tulip__leaf {
  position: absolute;
  width: 16px;
  height: 8px;
  background: #4a7828;
  border-radius: 0 80% 0 80%;
}

.tulip__leaf--low  { bottom: 18px; left: 8px; transform: rotate(-28deg); }
.tulip__leaf--high { bottom: 34px; right: 4px; transform: rotate(32deg) scaleX(-1); }

.tulip__bloom {
  position: absolute;
  left: 50%;
  bottom: 52px;
  width: 22px;
  height: 28px;
  transform: translateX(-50%);
}

.tulip__petal {
  position: absolute;
  border-radius: 50% 50% 45% 45%;
  background: linear-gradient(180deg, #e87882 0%, #c24a58 100%);
}

.tulip__petal--back {
  inset: 4px 2px 0;
  opacity: 0.75;
  transform: scale(0.92);
}

.tulip__petal--side {
  top: 2px;
  width: 10px;
  height: 22px;
}

.tulip__petal--left  { left: -2px; transform: rotate(-18deg); }
.tulip__petal--right { right: -2px; transform: rotate(18deg); }

.tulip__petal--front {
  inset: 0 4px 2px;
  background: linear-gradient(180deg, #f08a92 0%, #d45a68 100%);
}

.vase__glass {
  position: absolute;
  left: 50%;
  bottom: 0;
  width: 52px;
  height: 42px;
  transform: translateX(-50%);
  border-radius: 4px 4px 14px 14px;
  background: linear-gradient(180deg, rgba(255,255,255,0.22) 0%, rgba(180,220,240,0.18) 100%);
  box-shadow:
    inset 0 0 0 1px rgba(255,255,255,0.25),
    inset 0 -8px 12px rgba(80, 120, 140, 0.18);
  overflow: hidden;
}

.vase__water {
  position: absolute;
  left: 3px;
  right: 3px;
  bottom: 4px;
  height: 24px;
  border-radius: 0 0 10px 10px;
  background: rgba(120, 180, 210, 0.35);
}

.vase__highlight {
  position: absolute;
  left: 8px;
  top: 8px;
  width: 8px;
  height: 24px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.35);
}

.vase__rim {
  position: absolute;
  left: -2px;
  right: -2px;
  top: 0;
  height: 6px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.28);
}

.vase__fallen-petal {
  position: absolute;
  left: 18px;
  bottom: -2px;
  width: 10px;
  height: 7px;
  border-radius: 50%;
  background: #d45a68;
  transform: rotate(24deg);
  opacity: 0.85;
}

.vase__back-stems,
.vase__stem-back {
  display: none;
}


/* ---------- Clue UI (hidden until wired up) ---------------------------- */

.clue-count,
.clue-pop {
  display: none;
}


/* ---------- The envelope ------------------------------------------------- */

.envelope {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%) rotate(-4deg);
  width: 440px;
  height: 280px;
  padding: 0;
  z-index: 5;
  transition: transform 0.5s cubic-bezier(0.2, 0.7, 0.2, 1),
              filter 0.5s ease;
  filter: drop-shadow(0 30px 40px rgba(0,0,0,0.55));
}

.envelope:hover {
  transform: translate(-50%, calc(-50% - 8px)) rotate(-3deg);
  filter: drop-shadow(0 38px 50px rgba(0,0,0,0.6))
          drop-shadow(0 0 24px rgba(255, 180, 90, 0.25));
}

.envelope:focus-visible {
  outline: none;
}
.envelope:focus-visible .envelope__front {
  box-shadow:
    inset 0 0 0 1px rgba(255, 220, 170, 0.6),
    inset 0 0 60px rgba(120, 70, 30, 0.25),
    0 4px 14px rgba(0,0,0,0.4);
}

.envelope__body {
  position: relative;
  width: 100%;
  height: 100%;
  perspective: 1200px;
  transform-style: preserve-3d;
}

/* Common paper look for envelope sides */
.envelope__back,
.envelope__front,
.envelope__flap {
  position: absolute;
  inset: 0;
  background:
    /* paper fibers / blotches */
    radial-gradient(circle at 20% 30%, rgba(120, 80, 40, 0.10), transparent 40%),
    radial-gradient(circle at 80% 70%, rgba(120, 80, 40, 0.08), transparent 45%),
    radial-gradient(circle at 60% 20%, rgba(80, 50, 20, 0.06), transparent 30%),
    linear-gradient(180deg, #f1e1c4 0%, #e8d4ad 60%, #d9c193 100%);
  box-shadow:
    inset 0 0 60px rgba(120, 70, 30, 0.25),
    inset 0 -10px 20px rgba(80, 40, 10, 0.18);
}

.envelope__back {
  border-radius: 4px;
}

.envelope__front {
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 3;
}

/* The address (To: name) hand-written across the front */
.envelope__address {
  text-align: center;
  transform: rotate(-2deg);
  padding-top: 20px;
}

.envelope__to-label {
  display: block;
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-style: italic;
  font-size: 22px;
  color: #5a3a1c;
  opacity: 0.6;
  letter-spacing: 0.05em;
  margin-bottom: 4px;
}

.envelope__to-name {
  display: block;
  font-family: 'Pinyon Script', 'Brush Script MT', cursive;
  font-size: var(--envelope-recipient-font-size, 56px);
  color: #3a2410;
  line-height: 1;
  margin-top: 22px;
  text-shadow: 0 1px 0 rgba(255,255,255,0.2);
}

/* The flap is the top triangle that opens */
.envelope__flap {
  height: 60%;
  clip-path: polygon(0 0, 100% 0, 50% 95%);
  transform-origin: top center;
  transition: transform 1.1s cubic-bezier(0.55, 0.05, 0.25, 1);
  z-index: 6;
  /* slightly darker so it reads as the outer face */
  background:
    linear-gradient(180deg, #e8d4ad 0%, #d9c193 100%);
  box-shadow:
    inset 0 0 40px rgba(120, 70, 30, 0.3),
    0 2px 6px rgba(0,0,0,0.25);
}

/* ---------- The wax seal ------------------------------------------------- */

/* The seal sits on top of the flap, holding it closed.
   Its internal -7deg tilt is baked into the SVG itself. */
.envelope__seal {
  position: absolute;
  left: 35%;
  top: 35%;
  /* viewBox is 155 wide x 195 tall.
     The blob center (335, 335) sits at (48.4%, 39.5%) of the SVG box,
     so we translate by that amount to land the blob exactly on (left, top). */
  width: clamp(80px, 15%, 120px);
  height: auto;
  transform: translate(-48.4%, -39.5%);
  transform-origin: center center;
  z-index: 7;
  pointer-events: none;
  filter: none;
  transition: opacity 0.5s ease 0.1s, transform 0.6s ease;
}

/* When the envelope opens, the seal "breaks" — fades and tips away with the flap */
body.is-open .envelope__seal {
  opacity: 0;
  transform: translate(-48.4%, -56%) rotate(-3deg) scale(0.96);
  transition: opacity 0.45s ease, transform 0.8s cubic-bezier(0.55, 0.05, 0.25, 1);
}

/* The pressed monogram, set in italic serif to match the letter typography */
.envelope__seal-letter {
  font-family: 'Cormorant Garamond', Garamond, 'Times New Roman', serif;
  font-style: italic;
  font-weight: 500;
  font-size: 34px;
}

.envelope__seal-letter--dark {
  fill: #3a0604;
  fill-opacity: 0.85;
}

.envelope__seal-letter--light {
  fill: #d4503a;
  fill-opacity: 0.35;
}


/* tiny hover hint */
.envelope__hint {
  position: absolute;
  left: 50%;
  bottom: -40px;
  transform: translateX(-50%);
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-style: italic;
  font-size: 16px;
  color: rgba(255, 220, 180, 0.5);
  letter-spacing: 0.3em;
  text-transform: lowercase;
  opacity: 0;
  transition: opacity 0.5s ease;
  pointer-events: none;
}

.envelope:hover .envelope__hint { opacity: 1; }


/* ---------- The folded letter, hidden inside the envelope --------------- */

.letter-paper {
  position: absolute;
  left: 6%;
  top: 8%;
  width: 88%;
  height: 84%;
  background:
    radial-gradient(circle at 15% 25%, rgba(120, 80, 40, 0.06), transparent 40%),
    radial-gradient(circle at 85% 80%, rgba(120, 80, 40, 0.08), transparent 40%),
    linear-gradient(180deg, #fbf3df 0%, #f4e7c8 70%, #ecdab2 100%);
  border-radius: 2px;
  box-shadow:
    inset 0 0 40px rgba(120, 80, 30, 0.18),
    0 2px 6px rgba(0,0,0,0.25);
  z-index: 4;
  opacity: 0;
  transition: opacity 0.6s ease 0.6s;
  overflow: hidden;
}

.letter-paper__inner {
  position: absolute;
  inset: 0;
  padding: 30px 36px;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  opacity: 0;
  transition: opacity 0.3s ease;
}


/* ---------- Open state — when the password is correct ------------------ */

body.is-open .envelope {
  transform: translate(-50%, -50%) rotate(0deg);
  filter: drop-shadow(0 30px 40px rgba(0,0,0,0.55));
  pointer-events: none;
}

body.is-open .envelope__flap {
  transform: rotateX(180deg);
}

body.is-open .letter-paper {
  /* Letter rises out of envelope and expands to a centered paper view */
  opacity: 1;
  z-index: 20;
  pointer-events: auto;
  animation: letter-rise 1.4s cubic-bezier(0.2, 0.7, 0.2, 1) 0.5s forwards;
}

body.is-open .letter-paper__inner {
  opacity: 1;
  transition: opacity 0.6s ease 1.8s;
}

@keyframes letter-rise {
  0% {
    left: 6%;
    top: 8%;
    width: 88%;
    height: 84%;
    transform: translate(0, 0) rotate(0deg);
  }
  40% {
    left: 6%;
    top: -40%;
    width: 88%;
    height: 84%;
    transform: translate(0, 0) rotate(0deg);
  }
  100% {
    left: 50%;
    top: calc(100% - 50dvh);
    width: min(620px, 92vw);
    height: min(780px, 88vh);
    transform: translate(-50%, -50%) rotate(0deg);
  }
}


/* ---------- The letter text --------------------------------------------- */

.letter__date {
  font-style: italic;
  font-size: 18px;
  color: #6b4a26;
  margin: 0 0 24px 0;
  text-align: right;
}

.letter__greeting {
  font-family: 'Pinyon Script', 'Brush Script MT', cursive;
  font-size: 42px;
  color: #2c1a0a;
  margin: 0 0 18px 0;
  line-height: 1;
}

.letter__body p {
  font-size: 19px;
  line-height: 1.65;
  color: #2c1a0a;
  margin: 0 0 14px 0;
  text-indent: 24px;
}

.letter__closing {
  font-style: italic;
  font-size: 20px;
  margin: 24px 0 6px 0;
  color: #2c1a0a;
}

.letter__signature {
  font-family: 'Pinyon Script', 'Brush Script MT', cursive;
  font-size: 38px;
  color: #2c1a0a;
  margin: 0;
  line-height: 1;
}


/* ---------- The password prompt ----------------------------------------- */

.lockbox {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.4s ease;
}

.lockbox.is-visible {
  pointer-events: auto;
  opacity: 1;
}

.lockbox__backdrop {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at center,
    rgba(10, 4, 2, 0.55) 0%,
    rgba(10, 4, 2, 0.85) 100%);
  backdrop-filter: blur(2px);
}

.lockbox__card {
  position: relative;
  width: min(420px, 90vw);
  padding: 36px 32px 28px;
  background:
    radial-gradient(circle at 10% 20%, rgba(120, 80, 40, 0.10), transparent 40%),
    linear-gradient(180deg, #fbf3df 0%, #f1e1c0 100%);
  border-radius: 4px;
  box-shadow:
    inset 0 0 40px rgba(120, 80, 30, 0.22),
    0 30px 60px rgba(0,0,0,0.6);
  text-align: center;
  transform: translateY(8px) scale(0.98);
  transition: transform 0.45s cubic-bezier(0.2, 0.7, 0.2, 1);
}

.lockbox.is-visible .lockbox__card {
  transform: translateY(0) scale(1);
}

.lockbox__card.is-shaking {
  animation: shake 0.55s cubic-bezier(0.36, 0.07, 0.19, 0.97);
}

@keyframes shake {
  10%, 90%  { transform: translateX(-2px); }
  20%, 80%  { transform: translateX(4px); }
  30%, 50%, 70% { transform: translateX(-8px); }
  40%, 60%  { transform: translateX(8px); }
}

.lockbox__close {
  position: absolute;
  top: 10px;
  right: 14px;
  font-size: 24px;
  color: #6b4a26;
  opacity: 0.6;
  line-height: 1;
  padding: 4px 8px;
}
.lockbox__close:hover { opacity: 1; }

.lockbox__title {
  font-family: 'Cinzel', Georgia, serif;
  letter-spacing: 0.35em;
  text-transform: uppercase;
  font-size: 14px;
  color: #8a1c14;
  margin: 0 0 14px 0;
}

.lockbox__sub {
  font-style: italic;
  font-size: 18px;
  color: #4a3018;
  margin: 0 0 22px 0;
  line-height: 1.4;
}

.lockbox__input {
  width: 100%;
  padding: 12px 14px;
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 20px;
  text-align: center;
  letter-spacing: 0.3em;
  color: #2c1a0a;
  background: rgba(255, 250, 235, 0.7);
  border: none;
  border-bottom: 1px solid rgba(60, 30, 10, 0.4);
  outline: none;
  transition: border-color 0.2s ease;
}

.lockbox__input:focus {
  border-bottom-color: #8a1c14;
}

.lockbox__hint {
  font-style: italic;
  font-size: 14px;
  color: #7a5631;
  margin: 10px 0 0 0;
  min-height: 1em;
}

.lockbox__error {
  font-style: italic;
  font-size: 15px;
  color: #8a1c14;
  margin: 6px 0 0 0;
  min-height: 1.2em;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.lockbox__error.is-visible { opacity: 1; }

.lockbox__submit {
  margin-top: 18px;
  padding: 10px 28px;
  font-family: 'Cinzel', Georgia, serif;
  font-size: 14px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: #fbf3df;
  background: linear-gradient(180deg, #a8261b 0%, #7a1610 100%);
  border-radius: 2px;
  box-shadow: 0 4px 10px rgba(0,0,0,0.3),
              inset 0 1px 0 rgba(255,255,255,0.15);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.lockbox__submit:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 14px rgba(0,0,0,0.4),
              inset 0 1px 0 rgba(255,255,255,0.2);
}


/* ---------- Fold-back-up button ----------------------------------------- */

.fold-back {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%);
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-style: italic;
  font-size: 16px;
  color: rgba(255, 220, 180, 0.6);
  letter-spacing: 0.2em;
  text-transform: lowercase;
  padding: 8px 18px;
  border: 1px solid rgba(255, 220, 180, 0.15);
  border-radius: 2px;
  z-index: 60;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.5s ease 2.4s, color 0.2s ease, border-color 0.2s ease;
}

.fold-back:hover {
  color: rgba(255, 220, 180, 0.95);
  border-color: rgba(255, 220, 180, 0.5);
}

body.is-open .fold-back {
  opacity: 1;
  pointer-events: auto;
}

/* ---------- Return-to-entry button -------------------------------------- */

.room-exit {
  position: fixed;
  top: 20px;
  left: 20px;
  width: 42px;
  height: 54px;
  z-index: 70;
  opacity: 0.86;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.room-exit:hover {
  opacity: 1;
  transform: translateY(-1px);
}

.room-exit:focus-visible {
  outline: 1px solid rgba(255, 220, 180, 0.6);
  outline-offset: 3px;
}

.room-exit span {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 3px;
  background:
    linear-gradient(180deg, #6a361b 0%, #4b2612 62%, #371a0b 100%);
  box-shadow:
    inset 0 0 0 1px rgba(26, 10, 4, 0.8),
    inset 0 0 14px rgba(0, 0, 0, 0.45),
    0 8px 16px rgba(0, 0, 0, 0.35);
}

.room-exit span::before {
  content: "";
  position: absolute;
  left: 18%;
  right: 18%;
  top: 12%;
  bottom: 12%;
  border-radius: 2px;
  box-shadow:
    inset 0 0 0 1px rgba(20, 8, 4, 0.55),
    inset 0 0 0 2px rgba(120, 70, 30, 0.15);
}

.room-exit span::after {
  content: "";
  position: absolute;
  right: 14%;
  top: 50%;
  width: 7px;
  height: 7px;
  transform: translateY(-50%);
  border-radius: 50%;
  background:
    radial-gradient(circle at 28% 28%, #fff2b8 0%, #d4a34a 45%, #6a4814 100%);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}


/* ---------- Mobile ------------------------------------------------------- */

@media (hover: none) and (pointer: coarse) {
  .envelope__hint { opacity: 0.75; }
  .fold-back { opacity: 0.9; }
}

@media (max-width: 640px) {
  .entry__wall {
    justify-content: space-evenly;
    padding: 24px 18px max(18px, env(safe-area-inset-bottom));
  }

  .entry__title { margin-bottom: 20px; }

  .entry__eyebrow {
    letter-spacing: 0.28em;
    font-size: 11px;
    margin-bottom: 10px;
  }

  .entry__caption {
    max-width: 92vw;
    margin-top: 18px;
  }

  .entry__caption-text {
    font-size: 15px;
    line-height: 1.45;
  }

  .door {
    width: min(76vw, 320px);
    filter: drop-shadow(0 18px 26px rgba(0,0,0,0.72));
  }

  .doormat {
    width: min(88vw, 376px);
    height: clamp(44px, 11vw, 60px);
    margin-top: -16px;
  }

  .under-note__paper {
    width: min(440px, 92vw);
    padding: 32px 24px 26px;
    max-height: min(82dvh, 640px);
  }

  .under-note__text {
    font-size: 17px;
    line-height: 1.55;
  }

  .under-note__close {
    top: 4px;
    right: 8px;
    font-size: 28px;
    padding: 6px 10px;
  }

  .room { background-position: 30% 35%, center; }

  .table { height: 66%; }

  .envelope {
    width: 90vw;
    height: min(58vw, 320px);
    top: 53%;
  }

  .envelope__hint {
    bottom: -32px;
    letter-spacing: 0.2em;
  }

  .envelope__to-label { font-size: 18px; }
  .envelope__to-name { font-size: var(--envelope-recipient-font-size-mobile, 40px); }

  .envelope__seal {
    /* Match desktop seal/envelope ratio (~80/440 = 18.2%) while staying slightly smaller in absolute size on phones */
    width: clamp(52px, 18.2%, 78px);
    top: 35%;
  }

  body.is-open .envelope__seal {
    transform: translate(-48.4%, -56%) rotate(-3deg) scale(0.96);
  }

  .candle {
    left: 9%;
    bottom: 60%;
    transform: scale(0.48);
    transform-origin: bottom left;
    z-index: 7;
  }

  .candle__glow {
    width: 320px;
    height: 320px;
    bottom: -6px;
  }

  .lockbox {
    align-items: flex-end;
    padding: 16px 12px max(12px, env(safe-area-inset-bottom));
  }

  .lockbox__card {
    width: min(520px, 100%);
    max-height: min(78dvh, 560px);
    overflow-y: auto;
    padding: 24px 20px 20px;
  }

  .lockbox__sub { font-size: 17px; }

  .lockbox__input {
    font-size: 18px;
    letter-spacing: 0.2em;
  }

  .lockbox__submit {
    width: 100%;
    min-height: 44px;
  }

  .fold-back {
    bottom: max(14px, env(safe-area-inset-bottom));
    letter-spacing: 0.12em;
    padding: 8px 12px;
    font-size: 15px;
  }

  .room-exit {
    top: max(12px, env(safe-area-inset-top));
    left: 12px;
    width: 36px;
    height: 46px;
  }

  body.is-open .letter-paper {
    animation: letter-rise-mobile 1.2s cubic-bezier(0.2, 0.7, 0.2, 1) 0.45s forwards;
  }

  .letter-paper__inner {
    padding: 30px 18px 34px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  .letter__date {
    font-size: 16px;
    margin-bottom: 18px;
  }

  .letter__greeting { font-size: 34px; }

  .letter__body p {
    font-size: 17px;
    line-height: 1.55;
    text-indent: 16px;
    margin-bottom: 10px;
  }

  .letter__closing {
    font-size: 18px;
    margin-top: 18px;
  }

  .letter__signature { font-size: 30px; }
}

@media (max-width: 640px) and (max-height: 780px) {
  .entry__title { margin-bottom: 14px; }
  .entry__caption-text { display: none; }
  .entry__hint { font-size: 13px; }
  .table { height: 70%; }
  .envelope { top: 56%; }
  .candle { bottom: 62%; }
}

@keyframes letter-rise-mobile {
  0% {
    left: 6%;
    top: 8%;
    width: 88%;
    height: 84%;
    transform: translate(0, 0) rotate(0deg);
  }
  40% {
    left: 6%;
    top: -36%;
    width: 88%;
    height: 84%;
    transform: translate(0, 0) rotate(0deg);
  }
  100% {
    left: 50%;
    top: calc(100% - 50dvh + 10px);
    width: 94vw;
    height: min(76dvh, 700px);
    transform: translate(-50%, -50%) rotate(0deg);
  }
}
