/* =====================================================================
   for my ladybug — styles
   Palette notes: the ink is a deep warm brown (her eyes, her hair),
   the single accent is ladybug red, the ground is soft warm paper.
   ===================================================================== */

:root {
  --paper: #f6efe7;
  --card: #fffaf3;
  --ink: #3a2c23;
  --ink-soft: #8a7565;
  --red: #b23a32;
  --line: #e7d9ca;
  --shadow: 0 18px 40px -18px rgba(58, 44, 35, 0.35);
  --serif: "Cormorant Garamond", Georgia, "Times New Roman", serif;
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  font-family: var(--serif);
  color: var(--ink);
  background:
    radial-gradient(120% 90% at 50% 30%, #fbf6ee 0%, var(--paper) 60%);
  display: grid;
  grid-template-rows: 1fr auto;
  min-height: 100svh;
}

/* ---------- stage ---------- */
.stage {
  display: grid;
  place-items: center;
  padding: 2rem 1.5rem;
}

/* ---------- the box ---------- */
.gift {
  position: relative;
  width: min(11rem, 52vw);
  aspect-ratio: 1;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow);
  cursor: pointer;
  padding: 0;
  font: inherit;
  animation: float 5.5s ease-in-out infinite;
  transition: opacity 0.6s ease, transform 0.6s ease, box-shadow 0.3s ease;
}

.gift:hover { box-shadow: 0 24px 48px -18px rgba(58, 44, 35, 0.42); }

.gift:focus-visible {
  outline: 2px solid var(--red);
  outline-offset: 4px;
}

/* ribbons */
.ribbon { position: absolute; background: var(--red); opacity: 0.92; }
.ribbon-v { top: 0; bottom: 0; left: 50%; width: 9px; transform: translateX(-50%); }
.ribbon-h { left: 0; right: 0; top: 50%; height: 9px; transform: translateY(-50%); }

.knot {
  position: absolute;
  top: 50%; left: 50%;
  width: 17px; height: 17px;
  transform: translate(-50%, -50%);
  background: var(--red);
  border-radius: 50%;
  box-shadow: 0 0 0 3px var(--card);
}

/* the little "click me" tag, sat on the lower ribbon */
.tag {
  position: absolute;
  left: 50%;
  top: calc(50% + 26px);
  transform: translateX(-50%);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 12px;
  font-size: 0.68rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-soft);
  white-space: nowrap;
}

/* the ladybug perched on the box */
.gift-bug {
  position: absolute;
  top: -21px;
  right: 14px;
  width: 40px;
  height: 40px;
  transform: rotate(-10deg);
}

/* opening: the whole box fades softly away */
.gift.opened {
  animation: none;
  opacity: 0;
  transform: scale(0.94);
  pointer-events: none;
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-7px); }
}

/* ---------- the poem ---------- */
.reveal {
  max-width: 32rem;
  text-align: center;
  padding: 0 0.5rem;
  opacity: 0;
  transition: opacity 0.9s ease;
}

.reveal.shown { opacity: 1; }

.date {
  margin: 0 0 1.6rem;
  font-size: 0.72rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.poem {
  font-size: clamp(1.35rem, 4.6vw, 1.7rem);
  font-style: italic;
  font-weight: 500;
  line-height: 1.7;
}

.poem .line {
  display: block;
  opacity: 0;
  transform: translateY(9px);
  transition: opacity 0.8s ease, transform 0.8s ease;
  /* each line's transition-delay is set by script.js for a gentle stagger */
}

.reveal.shown .poem .line {
  opacity: 1;
  transform: translateY(0);
}

.signoff {
  width: 26px;
  height: 26px;
  margin-top: 2rem;
  opacity: 0.9;
}

/* ---------- footer ---------- */
.foot {
  text-align: center;
  padding: 1.2rem 1rem 1.6rem;
  font-size: 0.85rem;
  font-style: italic;
  color: var(--ink-soft);
  letter-spacing: 0.06em;
}

.noscript-note {
  text-align: center;
  color: var(--ink-soft);
  font-style: italic;
  padding: 1rem;
}

/* ---------- calm mode ---------- */
@media (prefers-reduced-motion: reduce) {
  .gift { animation: none; }
  .gift, .reveal, .poem .line { transition: none; }
  .poem .line { opacity: 1; transform: none; }
}
