/* =============================================================
   easter.css · hidden delights
   - a floating wedding ring you can click for a secret note
   - a toast + modal system for revealed secrets
   - heart confetti canvas
   - a "MISO" cat cameo that pads across the screen
   - a secret hidden gallery unlocked by code / Konami
   ============================================================= */

/* ---------- Confetti canvas (drawn on demand) ---------- */
.confetti-canvas {
  position: fixed;
  inset: 0;
  z-index: 900;
  pointer-events: none;
}

/* ============================================================
   FLOATING WEDDING RING  (bottom-left charm, desktop + mobile)
   ============================================================ */
.ring-egg {
  position: fixed;
  left: clamp(0.8rem, 2vw, 1.4rem);
  bottom: clamp(0.8rem, 2vw, 1.4rem);
  z-index: 130;
  width: 52px; height: 52px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(251,247,240,0.7);
  backdrop-filter: blur(8px);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: transform 0.4s var(--ease-out), box-shadow 0.4s var(--ease-out), opacity 0.4s;
  animation: ringFloat 4s var(--ease-inout) infinite;
}
.ring-egg:hover { transform: translateY(-4px) scale(1.08) rotate(-8deg); box-shadow: var(--shadow-lg); }
.ring-egg:active { transform: scale(0.94); }
.ring-egg svg { width: 30px; height: 30px; overflow: visible; }
.ring-egg .ring-band { fill: none; stroke: var(--gold-deep); stroke-width: 3.4; }
.ring-egg .ring-gem  { fill: var(--gold-light); stroke: var(--gold-deep); stroke-width: 1.5; }
/* twinkle on the gem */
.ring-egg .ring-spark { fill: #fff; transform-origin: center; animation: ringSpark 2.6s ease-in-out infinite; }
@keyframes ringSpark { 0%,100% { opacity: 0; } 50% { opacity: 0.9; } }
@keyframes ringFloat { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }

/* count how many secrets found — tiny badge */
.ring-egg__badge {
  position: absolute;
  top: -4px; right: -4px;
  min-width: 18px; height: 18px;
  padding: 0 4px;
  border-radius: 10px;
  background: var(--terracotta);
  color: var(--cream);
  font-family: var(--font-sans);
  font-size: 0.6rem;
  font-weight: 600;
  display: none;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 10px -3px rgba(0,0,0,0.4);
}
.ring-egg.has-finds .ring-egg__badge { display: flex; }

@media (max-width: 720px) {
  /* keep it clear of the mobile tabbar */
  .ring-egg { bottom: calc(env(safe-area-inset-bottom, 0px) + 5.4rem); width: 46px; height: 46px; }
  .ring-egg svg { width: 26px; height: 26px; }
}

/* ============================================================
   FLOATING "MAGIC" DOCK  (bottom-right — the delights, in plain sight)
   A persistent pill that fans out three actions. Far harder to miss
   than a footer row, and it echoes the floating-ring language.
   ============================================================ */
.fun-dock {
  position: fixed;
  right: clamp(0.8rem, 2vw, 1.4rem);
  bottom: clamp(0.8rem, 2vw, 1.4rem);
  z-index: 130;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.7rem;
}

.fun-dock__toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.7rem 1.15rem;
  border-radius: 100px;
  border: 1px solid var(--gold-deep);
  background: var(--gold-deep);
  color: var(--cream);
  font-family: var(--font-sans);
  font-size: 0.8rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
  box-shadow: var(--shadow-lg);
  transition: transform 0.4s var(--ease-out), box-shadow 0.4s var(--ease-out), background 0.3s var(--ease-out);
  animation: funDockPulse 3.6s var(--ease-inout) infinite;
}
.fun-dock__toggle:hover { transform: translateY(-3px); background: var(--terracotta); border-color: var(--terracotta); }
.fun-dock__toggle:active { transform: scale(0.96); }
.fun-dock__toggle:focus-visible { outline: 2px solid var(--gold-light); outline-offset: 3px; }
.fun-dock__toggle-icon { font-size: 1.05rem; display: inline-block; transition: transform 0.5s var(--ease-out); }
.fun-dock.is-open .fun-dock__toggle-icon { transform: rotate(180deg) scale(1.1); }
.fun-dock.is-open .fun-dock__toggle { animation: none; }

/* subtle attract-loop so a first-time visitor's eye lands on it */
@keyframes funDockPulse {
  0%, 100% { box-shadow: var(--shadow-lg); }
  50% { box-shadow: 0 8px 30px -6px rgba(166,124,51,0.65); }
}

.fun-dock__menu {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.55rem;
  /* collapsed by default */
  opacity: 0;
  transform: translateY(10px) scale(0.96);
  transform-origin: bottom right;
  pointer-events: none;
  transition: opacity 0.35s var(--ease-out), transform 0.35s var(--ease-out);
}
.fun-dock.is-open .fun-dock__menu {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.fun-dock__item {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.6rem 1rem;
  border-radius: 100px;
  border: 1px solid var(--line);
  background: rgba(251,247,240,0.92);
  backdrop-filter: blur(8px);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 0.8rem;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  white-space: nowrap;
  transition: transform 0.3s var(--ease-out), border-color 0.3s var(--ease-out), background 0.3s var(--ease-out), color 0.3s var(--ease-out);
}
.fun-dock__item:hover { transform: translateX(-3px); border-color: var(--gold-deep); background: var(--cream); }
.fun-dock__item:focus-visible { outline: 2px solid var(--gold-deep); outline-offset: 2px; }
.fun-dock__emoji { font-size: 1rem; }

@media (max-width: 720px) {
  /* sit above the mobile tabbar, mirror the ring's safe-area offset */
  .fun-dock { bottom: calc(env(safe-area-inset-bottom, 0px) + 5.4rem); }
  .fun-dock__toggle { padding: 0.6rem 1rem; font-size: 0.72rem; }
}

@media (prefers-reduced-motion: reduce) {
  .fun-dock__toggle { animation: none; transition: background 0.3s; }
  .fun-dock__toggle:hover { transform: none; }
  .fun-dock__toggle-icon,
  .fun-dock__menu,
  .fun-dock__item { transition: none; }
  .fun-dock__item:hover { transform: none; }
}

/* ============================================================
   TOAST  (small, transient hint bottom-center)
   ============================================================ */
.egg-toast {
  position: fixed;
  left: 50%;
  bottom: 2rem;
  transform: translate(-50%, 130%);
  z-index: 950;
  max-width: min(90vw, 420px);
  padding: 0.9rem 1.4rem;
  border-radius: 100px;
  background: var(--charcoal);
  color: var(--cream);
  font-family: var(--font-sans);
  font-size: 0.82rem;
  letter-spacing: 0.02em;
  text-align: center;
  box-shadow: var(--shadow-lg);
  border: 1px solid rgba(230,207,156,0.3);
  opacity: 0;
  transition: transform 0.55s var(--ease-out), opacity 0.4s;
  pointer-events: none;
}
.egg-toast.is-visible { transform: translate(-50%, 0); opacity: 1; }
.egg-toast b { color: var(--gold-light); font-weight: 600; }
@media (max-width: 720px) {
  .egg-toast { bottom: calc(env(safe-area-inset-bottom, 0px) + 5.4rem); }
}

/* ============================================================
   SECRET MODAL  (the ring's love note, hidden album, etc.)
   ============================================================ */
.egg-modal {
  position: fixed;
  inset: 0;
  z-index: 960;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.5s var(--ease-out), visibility 0.5s;
}
.egg-modal.is-open { opacity: 1; visibility: visible; }
.egg-modal__scrim {
  position: absolute;
  inset: 0;
  background: rgba(20,17,14,0.72);
  backdrop-filter: blur(8px);
}
.egg-modal__box {
  position: relative;
  width: min(92vw, 560px);
  max-height: 86vh;
  overflow: auto;
  background: var(--cream);
  border-radius: 16px;
  padding: clamp(2rem, 5vw, 3.2rem);
  box-shadow: var(--shadow-lg);
  text-align: center;
  transform: translateY(24px) scale(0.96);
  transition: transform 0.6s var(--ease-out);
  border: 1px solid rgba(230,207,156,0.6);
}
.egg-modal.is-open .egg-modal__box { transform: translateY(0) scale(1); }
.egg-modal__box::before {                 /* inner frame */
  content: "";
  position: absolute;
  inset: 12px;
  border: 1px solid var(--gold);
  border-radius: 10px;
  opacity: 0.45;
  pointer-events: none;
}
.egg-modal__seal {
  font-family: var(--font-script);
  font-size: 3rem;
  color: var(--gold-deep);
  line-height: 0.8;
  margin-bottom: 0.4rem;
}
.egg-modal__tag {
  font-family: var(--font-sans);
  font-size: 0.66rem;
  letter-spacing: 0.34em;
  text-transform: uppercase;
  color: var(--gold-deep);
  display: block;
  margin-bottom: 1rem;
}
.egg-modal__title { font-size: clamp(1.8rem, 5vw, 2.6rem); font-weight: 500; line-height: 1.1; margin-bottom: 1rem; }
.egg-modal__title .script { color: var(--gold-deep); font-size: 1.2em; }
.egg-modal__body { color: var(--ink-soft); font-size: 1.12rem; font-style: italic; line-height: 1.7; }
.egg-modal__body p + p { margin-top: 0.9rem; }
.egg-modal__sign { font-family: var(--font-script); font-size: 1.9rem; color: var(--ink); margin-top: 1.2rem; font-style: normal; }
.egg-modal__close {
  position: absolute;
  top: 10px; right: 14px;
  z-index: 2;
  font-size: 2rem;
  line-height: 1;
  width: 44px; height: 44px;
  border-radius: 50%;
  color: var(--ink-soft);
  transition: background 0.3s, transform 0.3s, color 0.3s;
}
.egg-modal__close:hover { background: rgba(43,38,34,0.08); transform: rotate(90deg); color: var(--ink); }

/* mini gallery grid inside the modal (hidden album) */
.egg-modal__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.6rem;
  margin-top: 1.4rem;
}
.egg-modal__grid img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 8px;
  box-shadow: var(--shadow-sm);
  transition: transform 0.5s var(--ease-out);
}
.egg-modal__grid img:hover { transform: scale(1.05) rotate(-1.5deg); }

/* a hint field for typing the code, shown inside the modal */
.egg-modal__note { font-family: var(--font-sans); font-size: 0.8rem; letter-spacing: 0.04em; color: var(--ink-soft); margin-top: 1.4rem; }
.egg-modal__note kbd {
  font-family: var(--font-sans);
  background: var(--cream-2);
  border: 1px solid var(--line);
  border-bottom-width: 2px;
  border-radius: 5px;
  padding: 0.1rem 0.5rem;
  font-size: 0.78rem;
  color: var(--ink);
}

/* ============================================================
   MISO the cat cameo  (walks across the bottom of the screen)
   ============================================================ */
.miso {
  position: fixed;
  bottom: 8px;
  left: -120px;
  z-index: 940;
  width: 92px;
  pointer-events: none;
  filter: drop-shadow(0 8px 10px rgba(0,0,0,0.25));
}
.miso.is-walking { animation: misoWalk 7s linear forwards; }
@keyframes misoWalk {
  0%   { left: -120px; transform: scaleX(1); }
  48%  { left: calc(100% + 20px); transform: scaleX(1); }
  49%  { left: calc(100% + 20px); transform: scaleX(-1); }
  50%  { transform: scaleX(-1); }
  100% { left: -140px; transform: scaleX(-1); }
}
.miso__tail { transform-origin: 82px 44px; animation: misoTail 0.6s ease-in-out infinite; }
@keyframes misoTail { 0%,100% { transform: rotate(-8deg); } 50% { transform: rotate(12deg); } }
.miso__leg   { transform-origin: top; animation: misoLegs 0.4s ease-in-out infinite; }
.miso__leg--b { animation-delay: 0.2s; }
@keyframes misoLegs { 0%,100% { transform: rotate(-10deg); } 50% { transform: rotate(10deg); } }

@media (prefers-reduced-motion: reduce) {
  .ring-egg, .ring-egg .ring-spark, .miso.is-walking, .miso__tail, .miso__leg { animation: none; }
  .miso.is-walking { left: 50%; transform: translateX(-50%); }
}
