/* ============ SPECIAL · anniversaries dress the site, her birthday takes it over ============
   Scoped to html[data-special] / .sp-* (built by special.js). */

/* ---- ribbon under the nav ---- */
.sp-ribbon {
  position: absolute;
  top: 5.15rem;
  left: 50%;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  max-width: calc(100% - 2.4rem);
  padding: 0.42rem 1.05rem 0.42rem 0.8rem;
  border-radius: 999px;
  background: linear-gradient(160deg, var(--maroon), var(--maroon-deep));
  color: var(--maroon-paper);
  font-size: 0.76rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  line-height: 1.4;
  white-space: nowrap;
  overflow: hidden;
  box-shadow:
    0 16px 36px -14px rgba(82, 26, 40, 0.6),
    inset 0 1px 0 rgba(255, 249, 244, 0.16);
  opacity: 0;
  transform: translate3d(-50%, -10px, 0);
  transition: opacity 0.9s var(--ease-fluid), transform 0.9s var(--ease-fluid);
  pointer-events: none;
}
.sp-ribbon.is-in { opacity: 1; transform: translate3d(-50%, 0, 0); }
.sp-ribbon svg {
  width: 0.95rem;
  height: 0.95rem;
  flex: none;
  color: var(--rose-soft);
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.sp-ribbon-fill svg { fill: currentColor; stroke: none; }
.sp-ribbon .ar { color: #F9C9D7; font-weight: 700; font-size: 0.86rem; }
/* one sheen as it lands */
.sp-ribbon::after {
  content: '';
  position: absolute;
  inset: -20% -60%;
  background: linear-gradient(105deg, transparent 38%, rgba(255, 249, 244, 0.22) 50%, transparent 62%);
  transform: translateX(-80%);
  pointer-events: none;
}
.sp-ribbon.is-in::after { transform: translateX(80%); transition: transform 1.3s var(--ease-fluid) 0.5s; }
html[data-special="birthday"] .sp-ribbon { top: 6.8rem; }
@media (min-width: 768px) {
  .sp-ribbon { top: 5.7rem; }
  html[data-special="birthday"] .sp-ribbon { top: 7.3rem; }
}

/* ---- hero garnish canvas (petals / balloons) ---- */
.sp-garnish {
  position: absolute;
  inset: 0;
  z-index: -1;
  width: 100%;
  height: 100%;
  pointer-events: none;
  opacity: 0;
  transition: opacity 1.4s ease 0.3s;
}
.sp-garnish.is-on { opacity: 1; }

/* ---- birthday garland ---- */
.sp-garland {
  position: absolute;
  top: 74px;
  left: 0;
  right: 0;
  z-index: -1;
  height: 150px;
  overflow: visible;
  pointer-events: none;
}
.sp-garland svg { display: block; width: 100%; height: 150px; overflow: visible; }
.sp-cord { stroke: #8A3A4D; }
.sp-cord-shadow { stroke: rgba(82, 26, 40, 0.12); }
html[data-sky="night"] .sp-cord { stroke: rgba(255, 249, 244, 0.38); }
html[data-sky="night"] .sp-cord-shadow { stroke: rgba(0, 0, 0, 0.25); }
.sp-flag-sway {
  transform-box: fill-box;
  transform-origin: 50% 0;
  animation: sp-flag var(--fd, 4s) ease-in-out var(--fdl, 0s) infinite alternate;
}
.sp-garland.is-off .sp-flag-sway { animation-play-state: paused; }
@keyframes sp-flag {
  from { transform: rotate(-3.5deg); }
  to   { transform: rotate(3.5deg); }
}
@media (min-width: 768px) { .sp-garland { top: 82px; } }

/* ---- anniversary: the card that points at the vault ---- */
.sp-vault {
  display: flex;
  width: fit-content;
  align-items: center;
  gap: 0.8rem;
  max-width: 100%;
  margin: 1rem auto 0;
  padding: 0.5rem 1rem 0.5rem 0.5rem;
  border-radius: 999px;
  background: linear-gradient(160deg, var(--maroon), var(--maroon-deep));
  border: 1px solid rgba(255, 249, 244, 0.12);
  color: var(--maroon-paper);
  text-decoration: none;
  text-align: left;
  box-shadow: 0 18px 44px -16px rgba(82, 26, 40, 0.55), inset 0 1px 0 rgba(255, 249, 244, 0.12);
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.6s var(--ease-fluid), box-shadow 0.6s var(--ease-fluid), opacity 1s var(--ease-fluid), filter 1s var(--ease-fluid);
}
.sp-vault:active { transform: scale(0.98); }
@media (hover: hover) and (pointer: fine) {
  .sp-vault:hover { transform: translateY(-2px); box-shadow: 0 24px 50px -16px rgba(82, 26, 40, 0.65), inset 0 1px 0 rgba(255, 249, 244, 0.12); }
  .sp-vault:hover .sp-vault-arrow { transform: translateX(3px); }
}
.sp-vault-seal {
  flex: none;
  width: 2.4rem;
  height: 2.4rem;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: radial-gradient(circle at 35% 30%, #E07896, var(--rose) 60%, #B84F6C);
  box-shadow: inset 0 -2px 4px rgba(0, 0, 0, 0.25), 0 4px 10px -4px rgba(0, 0, 0, 0.5);
  color: #fff;
}
.sp-vault-seal svg { width: 1.05rem; height: 1.05rem; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.sp-vault-text { display: grid; line-height: 1.3; min-width: 0; }
.sp-vault-text strong { font-size: 0.9rem; font-weight: 700; }
.sp-vault-text span { font-size: 0.72rem; font-weight: 400; color: rgba(255, 249, 244, 0.62); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sp-vault-arrow { flex: none; width: 0.9rem; height: 0.9rem; color: rgba(255, 249, 244, 0.7); fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; transition: transform 0.5s var(--ease-spring); }
/* the hero's own reveal rhythm: after the CTA */
.sp-vault.reveal { transition-delay: 0.42s; }

/* ============ THE BIRTHDAY ROOM ============ */
html.sp-lock, html.sp-lock body { overflow: hidden; }

.sp-room {
  position: fixed;
  inset: 0;
  z-index: 150;
  display: flex;
  flex-direction: column;
  overflow: hidden auto;
  -webkit-overflow-scrolling: touch;
  background: radial-gradient(120% 70% at 50% -10%, #6E2436 0%, #3E1422 46%, #1B0910 100%);
  color: var(--maroon-paper);
  font-family: 'Thmanyah Sans', system-ui, sans-serif;
  text-align: center;
  line-height: 1.7;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  touch-action: none;
  -webkit-tap-highlight-color: transparent;
  opacity: 0;
  transition: opacity 0.9s ease;
  outline: none;
}
.sp-room.is-on { opacity: 1; }
.sp-room.is-closing { opacity: 0; transition: opacity 0.7s ease; pointer-events: none; }
.sp-room .grain { position: fixed; z-index: 1; opacity: 0.05; }

/* light layers (fixed so they never scroll with the stage) */
.sp-rose {
  position: fixed;
  inset: 0;
  background: radial-gradient(120% 80% at 50% 16%, #C75D7F 0%, #7C2B3F 46%, #3A1020 100%);
  opacity: 0;
  transition: opacity 1.9s ease;
  pointer-events: none;
}
.sp-room.is-rose .sp-rose { opacity: 1; }
.sp-light {
  position: fixed;
  left: 50%;
  top: 40%;
  width: min(160vw, 940px);
  aspect-ratio: 1;
  transform: translate(-50%, -50%);
  background: radial-gradient(circle, rgba(247, 178, 123, 0.42) 0%, rgba(217, 108, 138, 0.16) 26%, transparent 58%);
  animation: sp-breathe 2.6s ease-in-out infinite alternate;
  pointer-events: none;
  transition: opacity 0.9s ease;
  will-change: opacity, transform;
}
.sp-room.is-holding .sp-light { animation-duration: 0.7s; }
.sp-room.is-out .sp-light { opacity: 0; animation: none; }
@keyframes sp-breathe {
  from { opacity: 0.72; transform: translate(-50%, -50%) scale(0.97); }
  to   { opacity: 1; transform: translate(-50%, -50%) scale(1.04); }
}
.sp-rain {
  position: fixed;
  inset: 0;
  z-index: 1; /* behind the cake and his words, so they stay readable */
  width: 100%;
  height: 100%;
  pointer-events: none;
}

/* top bar */
.sp-top {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 4;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: max(env(safe-area-inset-top), 0.9rem) 1.1rem 0;
}
.sp-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-weight: 700;
  font-size: 0.95rem;
}
.sp-brand svg { width: 0.85rem; height: 0.85rem; fill: var(--rose-soft); animation: intro-pulse 1.6s var(--ease-fluid) infinite; }
.sp-skip {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  min-height: 44px;
  padding: 0.42rem 0.7rem 0.42rem 0.95rem;
  border-radius: 99px;
  border: 1px solid rgba(255, 249, 244, 0.16);
  background: rgba(255, 249, 244, 0.08);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  color: var(--maroon-paper);
  font: inherit;
  font-size: 0.78rem;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.2s ease, transform 0.16s var(--ease-fluid);
}
.sp-skip svg { width: 0.95rem; height: 0.95rem; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.sp-skip:active { transform: scale(0.96); }
@media (hover: hover) and (pointer: fine) { .sp-skip:hover { background: rgba(255, 249, 244, 0.16); } }

/* stage */
.sp-stage {
  position: relative;
  z-index: 2;
  margin: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(0.4rem, 1.6vh, 1rem);
  width: 100%;
  max-width: 40rem;
  padding: calc(env(safe-area-inset-top, 0px) + 4.2rem) 1.35rem calc(env(safe-area-inset-bottom, 0px) + 1.8rem);
}

/* the cake */
.sp-cake {
  width: min(74vw, 300px);
  flex: none;
  transform-origin: 50% 100%;
  transition: transform 1.4s var(--ease-fluid);
  opacity: 0;
  transform: translateY(18px) scale(0.96);
  animation: sp-cake-in 1.3s var(--ease-fluid) 0.25s both;
}
@keyframes sp-cake-in { to { opacity: 1; transform: none; } }
.sp-room.is-out .sp-cake { animation: none; opacity: 1; transform: scale(0.74) translateY(4%); }
@media (min-width: 768px) { .sp-room.is-out .sp-cake { transform: scale(0.8) translateY(2%); } }
.sp-cake-svg { display: block; width: 100%; height: auto; overflow: visible; }

.sp-flame-wind {
  transform-box: fill-box;
  transform-origin: 50% 100%;
  transition: transform 0.6s var(--ease-fluid);
}
.sp-flame {
  transform-box: fill-box;
  transform-origin: 50% 100%;
  animation: sp-flick var(--fd, 0.9s) ease-in-out var(--fs, 0s) infinite alternate;
  will-change: transform;
}
.sp-flame-glow {
  transform-box: fill-box;
  transform-origin: 50% 100%;
  animation: sp-glow var(--fd, 1.4s) ease-in-out infinite alternate;
}
@keyframes sp-flick {
  0%   { transform: scale(1, 1) rotate(0deg); }
  22%  { transform: scale(1.07, 0.93) rotate(-3.5deg); }
  46%  { transform: scale(0.94, 1.09) rotate(2.4deg); }
  70%  { transform: scale(1.03, 0.97) rotate(-1.6deg); }
  100% { transform: scale(0.97, 1.05) rotate(3deg); }
}
@keyframes sp-glow {
  from { opacity: 0.3; transform: scale(0.94); }
  to   { opacity: 0.5; transform: scale(1.06); }
}
/* her breath leans the flames */
.sp-room.is-holding .sp-flame { animation-duration: 0.3s; }
.sp-room.is-holding .sp-flame-wind { transform: skewX(-16deg) scaleY(1.16) scaleX(0.9); }
/* out */
.sp-room.is-out .sp-flame { animation: sp-gutter 0.62s cubic-bezier(0.55, 0, 0.6, 1) forwards; }
.sp-room.is-out .sp-flame-glow { animation: sp-glow-out 0.5s ease-out forwards; }
.sp-room.is-out .sp-flame-wind { transform: none; transition: none; }
@keyframes sp-gutter {
  0%   { transform: scale(1, 1) rotate(0deg); opacity: 1; }
  28%  { transform: scale(1.18, 1.34) skewX(10deg); opacity: 1; }
  55%  { transform: scale(0.72, 0.5) skewX(-8deg); opacity: 0.85; }
  100% { transform: scale(0.3, 0.04); opacity: 0; }
}
@keyframes sp-glow-out { to { opacity: 0; transform: scale(0.6); } }
.sp-smoke-path {
  fill: none;
  stroke: rgba(255, 249, 244, 0.6);
  stroke-width: 2.1;
  stroke-linecap: round;
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  opacity: 0;
  filter: url(#sp-blur-s);
  transform-box: fill-box;
  transform-origin: 50% 100%;
}
.sp-room.is-out .sp-smoke-path { animation: sp-smoke 2.7s ease-out var(--sd, 0.3s) forwards; }
@keyframes sp-smoke {
  0%   { stroke-dashoffset: 1; opacity: 0; transform: translateY(0) scaleX(1); }
  14%  { opacity: 0.8; }
  100% { stroke-dashoffset: 0; opacity: 0; transform: translateY(-16px) scaleX(1.35); }
}

/* copy */
.sp-copy {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.55rem;
  width: 100%;
}
.sp-kicker {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: var(--rose-soft);
  opacity: 0;
  animation: sp-fade 0.9s ease 0.6s both;
}
.sp-kicker::before,
.sp-kicker::after { content: ''; width: 1.4rem; height: 1px; background: currentColor; opacity: 0.5; }
@keyframes sp-fade { to { opacity: 1; } }
.sp-title {
  font-size: clamp(1.75rem, 7.4vw, 2.6rem);
  font-weight: 900;
  line-height: 1.3;
  letter-spacing: -0.01em;
  text-wrap: balance;
  /* drop-shadow (not text-shadow): the word masks would clip a text-shadow into boxes */
  filter: drop-shadow(0 8px 22px rgba(8, 4, 10, 0.45));
}
.sp-title .ar { color: #F9C9D7; }
.sp-w { display: inline-block; overflow: hidden; vertical-align: top; padding: 0.12em 0.04em 0.16em; margin: -0.12em -0.04em -0.16em; }
.sp-wi { display: inline-block; transform: translate3d(0, 108%, 0); transition: transform 1.05s var(--ease-out-strong, cubic-bezier(0.23, 1, 0.32, 1)) calc(0.55s + var(--i, 0) * 70ms); }
.sp-room.is-on .sp-wi { transform: none; }
.sp-sub {
  max-width: 31rem;
  font-size: clamp(0.92rem, 3.6vw, 1.02rem);
  font-weight: 300;
  color: rgba(255, 249, 244, 0.74);
  text-shadow: 0 4px 22px rgba(8, 4, 10, 0.5);
  opacity: 0;
  animation: sp-fade 0.9s ease 1.1s both;
  transition: opacity 0.5s ease, transform 0.5s var(--ease-fluid);
}
.sp-hold {
  position: relative;
  width: 66px;
  height: 66px;
  margin-top: 0.3rem;
  display: grid;
  place-items: center;
  opacity: 0;
  animation: sp-fade 0.9s ease 1.4s both;
  transition: transform 0.35s var(--ease-spring), opacity 0.5s ease;
}
.sp-hold svg { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); }
.sp-hold-track { fill: none; stroke: rgba(255, 249, 244, 0.16); stroke-width: 2; }
.sp-hold-prog { fill: none; stroke: var(--rose-soft); stroke-width: 2.4; stroke-linecap: round; }
.sp-hold span { font-size: 0.58rem; font-weight: 500; letter-spacing: 0.3em; text-transform: uppercase; color: rgba(255, 249, 244, 0.55); padding-left: 0.3em; }
.sp-room.is-holding .sp-hold { transform: scale(1.12); }
.sp-room.is-holding .sp-hold span { color: #F9C9D7; }
.sp-room.is-msg .sp-sub,
.sp-room.is-msg .sp-hold { position: absolute; opacity: 0; pointer-events: none; animation: none; }
.sp-room.is-msg .sp-skip { opacity: 0; pointer-events: none; transition: opacity 0.5s ease; }
/* the hold is over: let her scroll to the button if his words run long */
.sp-room.is-msg { touch-action: pan-y; }

/* after the wish */
.sp-after {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
}
.sp-after[hidden] { display: none; }
.sp-msg {
  max-width: 33rem;
  font-size: clamp(0.94rem, 3.7vw, 1.08rem);
  line-height: 1.7;
  font-weight: 400;
  color: rgba(255, 249, 244, 0.92);
  text-shadow: 0 3px 18px rgba(8, 4, 10, 0.4);
  text-wrap: pretty;
}
.sp-msg .ar { color: #F9C9D7; font-weight: 700; }
.sp-ink {
  display: inline-block;
  opacity: 0;
  filter: blur(6px);
  transform: translateY(5px);
  transition:
    opacity 0.9s ease calc(var(--i, 0) * 40ms),
    filter 0.9s ease calc(var(--i, 0) * 40ms),
    transform 0.9s var(--ease-fluid) calc(var(--i, 0) * 40ms);
}
.sp-room.is-msg-in .sp-ink { opacity: 1; filter: blur(0); transform: none; }
.sp-msg-ar {
  margin-top: 0.5rem;
  font-size: clamp(1.1rem, 4.6vw, 1.3rem);
  font-weight: 700;
  color: #F9C9D7;
}
.sp-sign { font-size: 1rem; color: rgba(255, 249, 244, 0.6); }
.sp-msg-ar, .sp-sign, .sp-open { opacity: 0; transform: translateY(10px); }
.sp-room.is-msg-in .sp-msg-ar { opacity: 1; transform: none; transition: opacity 0.9s ease var(--sp-tail, 3.6s), transform 0.9s var(--ease-fluid) var(--sp-tail, 3.6s); }
.sp-room.is-msg-in .sp-sign { opacity: 1; transform: none; transition: opacity 0.9s ease calc(var(--sp-tail, 3.6s) + 0.35s), transform 0.9s var(--ease-fluid) calc(var(--sp-tail, 3.6s) + 0.35s); }
.sp-room.is-msg-in .sp-open { opacity: 1; transform: none; transition: opacity 0.8s ease calc(var(--sp-tail, 3.6s) + 0.75s), transform 0.9s var(--ease-spring) calc(var(--sp-tail, 3.6s) + 0.75s); }
.sp-open {
  display: inline-flex;
  align-items: center;
  gap: 0.9rem;
  margin-top: 0.9rem;
  padding: 0.55rem 0.7rem 0.55rem 1.8rem;
  border: none;
  border-radius: 999px;
  background: var(--maroon-paper);
  color: var(--ink);
  font: inherit;
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  box-shadow: 0 20px 48px -16px rgba(0, 0, 0, 0.55);
  -webkit-tap-highlight-color: transparent;
}
.sp-open:active { transform: scale(0.97) !important; }
.sp-open-ico {
  width: 2.4rem;
  height: 2.4rem;
  border-radius: 999px;
  background: var(--rose);
  display: grid;
  place-items: center;
}
.sp-open-ico svg { width: 1.05rem; height: 1.05rem; fill: #fff; }

@media (max-height: 700px) {
  .sp-cake { width: min(62vw, 230px); }
  .sp-stage { gap: 0.3rem; }
  .sp-room.is-out .sp-cake { transform: scale(0.72) translateY(6%); }
}
@media (min-width: 768px) {
  .sp-cake { width: 320px; }
  .sp-stage { gap: 1.1rem; }
}

/* ---- reduced motion: no flicker, no rain (special.js skips it), fades only; the hold still works ---- */
@media (prefers-reduced-motion: reduce) {
  .sp-flame, .sp-flame-glow, .sp-light, .sp-brand svg, .sp-flag-sway { animation: none !important; }
  .sp-room.is-out .sp-flame { animation: none !important; opacity: 0; transition: opacity 0.4s ease; }
  .sp-room.is-out .sp-flame-glow { animation: none !important; opacity: 0; transition: opacity 0.4s ease; }
  .sp-room.is-out .sp-smoke-path { animation: none !important; }
  .sp-flame-wind, .sp-room.is-holding .sp-flame-wind { transform: none; }
  .sp-wi { transform: none; transition: none; }
  .sp-ink { transition-delay: 0s !important; }
  .sp-cake { animation: none; opacity: 1; transform: none; transition: none; }
  .sp-kicker, .sp-sub, .sp-hold { animation: none; opacity: 1; }
  .sp-room.is-msg-in .sp-msg-ar,
  .sp-room.is-msg-in .sp-sign,
  .sp-room.is-msg-in .sp-open { transition-delay: 0.2s, 0.2s; }
  .sp-ribbon { transition: opacity 0.4s ease; transform: translate3d(-50%, 0, 0); }
  .sp-ribbon::after { display: none; }
  .sp-garnish { display: none; }
}
