/* ------------------------------------------------------------------
   Daydreaming Petals — the original drawing, cut into pieces.
   The card's own coordinates (x 455–1215, y 60–1050 on the photo)
   map to the .card box; each piece's left/top/width is a percentage
   of it, so the layout is the drawing's own at any size.
   ------------------------------------------------------------------ */

:root {
  --paper: #FFFFFF;
  --pen:   #24357A;
  --red:   #CE2632;   /* the cleaned flower's red */
  --muted: #8A8F98;
  --hand:  "Gaegu", "Comic Sans MS", "Chalkboard SE", cursive;
}

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

html { background: var(--paper); }

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--paper);
  color: var(--pen);
  font-family: var(--hand);
  overflow-x: hidden;
}

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

.sheet {
  flex: 1;
  width: min(560px, 100% - 32px);
  margin: clamp(20px, 6vh, 64px) auto 0;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.card {
  position: relative;
  width: 100%;
  aspect-ratio: 760 / 990;
}

.piece {
  position: absolute;
  display: block;
  height: auto;
}
.piece img { display: block; width: 100%; height: auto; }

.dream  { left: 10.20%; top:  0.40%; width: 62.11%; }
.face   { left: 42.76%; top: 26.31%; width: 24.14%; }
.flower { left: 70.13%; top: 30.15%; width: 18.22%; }
.title1 { left:  0.86%; top: 49.29%; width: 98.09%; }
.title2 { left:  0.92%; top: 75.86%; width: 46.32%; }

/* The mouth hangs off the face piece: x 13–78, y 68.5–110 of 183.5×83. */
.face .mouth {
  position: absolute;
  left: 7.08%;
  top: 82.53%;
  width: 35.42%;
  transform-origin: 50% 50%;
  transition: transform 700ms cubic-bezier(.34, 1.56, .64, 1);
}
/* Enough petals in the daydream and the frown flips into a smile. */
.face.happy .mouth { transform: scaleY(-1) translateY(-18%); }

/* The daydream drifts a little, like it's being thought. */
.dream {
  transform-origin: 50% 100%;
  animation: drift 7s ease-in-out infinite;
}
@keyframes drift {
  0%, 100% { transform: translate(0, 0) rotate(0deg); }
  50%      { transform: translate(0.4%, -1.4%) rotate(-.6deg); }
}

.flower {
  cursor: pointer;
  outline: none;
  transform-origin: 50% 100%;
  transition: transform 400ms cubic-bezier(.34, 1.56, .64, 1);
}
.flower:hover, .flower:focus-visible { transform: rotate(-4deg) scale(1.03); }
.flower:focus-visible { outline: 2px dashed var(--pen); outline-offset: 6px; border-radius: 12px; }
.flower.puff { transform: rotate(5deg) scale(.97); }

/* Where petals leave from: the yellow centre of the drawn flower. */
.centre {
  position: absolute;
  left: 54%; top: 37%;
  width: 1px; height: 1px;
}

.hint {
  margin: 12px 0 0;
  font-size: 20px;
  color: var(--muted);
  transition: opacity 600ms ease;
}
.hint.gone { opacity: 0; }

.foot {
  padding: 40px 16px 28px;
  text-align: center;
  font-size: 19px;
  color: var(--muted);
}
.foot a { color: var(--pen); text-decoration-thickness: 1.5px; text-underline-offset: 3px; }

/* Floating petals (made by petal.js): marker red, like the flower. */
.loose {
  position: fixed;
  left: 0; top: 0;
  width: 20px; height: 28px;
  margin: -14px 0 0 -10px;
  border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
  background: var(--red);
  border: 1.5px solid #2a1c22;
  pointer-events: none;
  z-index: 5;
}

@media (prefers-reduced-motion: reduce) {
  .dream { animation: none; }
  .flower, .flower:hover, .face .mouth { transition: none; }
  .flower:hover { transform: none; }
}
