/* ============================================================
   Prachi & Ishank — Layered Invitation
   Sources:
   - Cover Slide.psd, 1080 x 3840 px.
   - Envelope Slide.psd, 1080 x 1920 px.
   - Scratch to reveal slide.psd, 1080 x 1920 px.
   - Bhaat.psd, 1080 x 1920 px.
   - Sangeet Slide.psd, 1080 x 1920 px.
   - Haldi Slide.psd, 1080 x 1920 px.
   - Wedding Slide.psd, 1080 x 1920 px.
   - Rsvp Slide.psd, 1080 x 1920 px.
   - Last Slide: background + address art + live map (1080 x 1920).
   Visible PSD leaf layers are positioned at their original
   coordinates, expressed as % of each PSD canvas.
   ============================================================ */

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

html,
body {
  margin: 0;
  padding: 0;
  overflow-x: hidden;
}

body {
  min-height: 100vh;
  background: #d2e6ed;
  color: #1f3f48;
}

@supports (height: 100svh) {
  body {
    min-height: 100svh;
  }
}

.invite {
  --viewport-height: 100vh;
  --stage-width: min(100vw, calc(var(--viewport-height) * 1080 / 1920), 540px);
  --motion-fast: 180ms;
  --motion-medium: 480ms;
  --ease-standard: cubic-bezier(0.22, 1, 0.36, 1);
  min-height: var(--viewport-height);
}

@supports (height: 100svh) {
  .invite {
    --viewport-height: 100svh;
  }
}

.slide {
  display: flex;
  justify-content: center;
}

.stage {
  position: relative;
  width: var(--stage-width);
  overflow: hidden;
  background: #d2e6ed;
  isolation: isolate;
  contain: layout paint style;
}

.stage--cover {
  aspect-ratio: 1080 / 3840;
}

.stage--sangeet,
.stage--haldi,
.stage--wedding,
.stage--rsvp {
  aspect-ratio: 1080 / 1920;
}

.stage--scratch {
  aspect-ratio: 1080 / 1920;
}

.stage--last {
  aspect-ratio: 1080 / 1920;
}

/* Full-bleed last-slide background (00-last-composite-base.png).
   Cropped to the same 1080×1920 frame as the other event slides. */
.last-bg {
  z-index: 0;
  object-fit: cover;
  object-position: center top;
}

/* Address artwork slot — drop an <img> inside when ready. */
.last-address {
  --last-address-left: 27%;
  --last-address-top: 10%;
  --last-address-width: 45%;
  --last-address-height: 15%;

  position: absolute;
  left: var(--last-address-left);
  top: var(--last-address-top);
  z-index: 1;
  width: var(--last-address-width);
  height: var(--last-address-height);
  pointer-events: none;
}

.last-address img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  -webkit-user-drag: none;
  user-select: none;
}

/* Map screenshot + directions — under the address art.
   Tweak --last-map-* below to resize/reposition. */
.last-map-block {
  --last-map-left: 18%;
  --last-map-top: 28%;
  --last-map-width: 64%;
  --last-map-radius: 0.018; /* fraction of stage width */

  position: absolute;
  left: var(--last-map-left);
  top: var(--last-map-top);
  z-index: 2;
  width: var(--last-map-width);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: calc(var(--stage-width) * 0.08);
  pointer-events: auto;
}

.last-map {
  display: block;
  width: 100%;
  overflow: hidden;
  border-radius: calc(var(--stage-width) * var(--last-map-radius));
  box-shadow: 0 8px 24px rgba(40, 55, 70, 0.18);
  line-height: 0;
  transition: transform 180ms ease, box-shadow 180ms ease;
}

.last-map:hover,
.last-map:focus-visible {
  transform: translateY(-1px);
  box-shadow: 0 10px 28px rgba(40, 55, 70, 0.22);
}

.last-map:focus-visible {
  outline: 2px solid #bf2857;
  outline-offset: 3px;
}

.last-map__img {
  display: block;
  width: 100%;
  height: auto;
  -webkit-user-drag: none;
  user-select: none;
}

.last-directions {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45em;
  padding: 0.72em 1.35em;
  border-radius: 999px;
  background: #d65c82;
  color: #fffaf4;
  font-family: "AP Playfair", Georgia, "Times New Roman", serif;
  font-size: clamp(0.82rem, calc(var(--stage-width) * 0.036), 1.05rem);
  font-weight: 500;
  letter-spacing: 0.03em;
  text-decoration: none;
  box-shadow: 0 6px 16px rgba(191, 40, 87, 0.28);
  transition: background 180ms ease, transform 180ms ease;
}

.last-directions:hover,
.last-directions:focus-visible {
  background: #a01f48;
  transform: translateY(-1px);
}

.last-directions:focus-visible {
  outline: 2px solid #bf2857;
  outline-offset: 3px;
}

.last-directions__icon {
  width: 1.1em;
  height: 1.1em;
  flex-shrink: 0;
}

.ly {
  position: absolute;
  display: block;
  /* left / top / width / height set inline per layer from PSD bbox */
  -webkit-user-drag: none;
  user-select: none;
  pointer-events: none;
}

.scratch-date-card {
  position: absolute;
  left: 19.8148%;
  top: 32.2396%;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 60.3704%;
  height: 7.3958%;
  border-radius: calc(var(--stage-width) * 0.024);
  background: #fff;
  color: #c1446c;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(calc(1.35rem - 2px), calc(var(--stage-width) * 0.052 - 2px), calc(2rem - 2px));
  font-weight: 700;
  line-height: 1;
  pointer-events: none;
}

.live-countdown {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
}

.countdown-value {
  position: absolute;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #c1446c;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(0.85rem, calc(var(--stage-width) * 0.043), 1.45rem);
  font-variant-numeric: tabular-nums;
  font-weight: 400;
  line-height: 1;
  text-align: center;
  white-space: nowrap;
}

.countdown-value--days {
  font-size: clamp(0.85rem, calc(var(--stage-width) * 0.044), 1.5rem);
}

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

.scratch-canvas {
  position: absolute;
  z-index: 2;
  display: block;
  cursor: grab;
  touch-action: none;
  transition:
    opacity var(--motion-medium) var(--ease-standard),
    transform var(--motion-fast) var(--ease-standard);
  user-select: none;
  will-change: transform, opacity;
}

.scratch-canvas:active,
.scratch-canvas.is-scratching {
  cursor: grabbing;
  transform: scale(0.992);
}

.scratch-canvas:focus-visible {
  outline: 4px solid rgba(176, 70, 108, 0.9);
  outline-offset: 6px;
}

.stage--scratch.is-scratch-complete .scratch-canvas {
  opacity: 0;
  pointer-events: none;
}

@media (prefers-reduced-motion: reduce) {
  .scratch-canvas {
    transition: none;
  }
}

/* ============================================================
   Send your blessings — a tap-to-bless "altar" slide.
   Static layout & appearance live here; motion is in animations.css.
   ============================================================ */
.stage--blessings {
  aspect-ratio: 1080 / 1920;
  background: radial-gradient(
    120% 80% at 50% 26%,
    #fdf7ec 0%,
    #fbefdd 42%,
    #f7e0c9 74%,
    #f3d2c2 100%
  );
}

/* Positioning context so the controls overlay sits exactly on the stage. */
.bless-frame {
  position: relative;
  width: var(--stage-width);
}

/* Soft halo behind the monogram (the blessing "target"). */
.bless-halo {
  position: absolute;
  left: 50%;
  top: 17.75%;
  width: 54%;
  aspect-ratio: 1;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: radial-gradient(
    circle,
    rgba(255, 224, 158, 0.55) 0%,
    rgba(255, 214, 150, 0.22) 42%,
    rgba(255, 214, 150, 0) 70%
  );
  pointer-events: none;
  z-index: 0;
}

.bless-monogram {
  z-index: 1;
}

.bless-garland {
  z-index: 0;
}

/* Overlay holds the accessible controls; only the controls catch input,
   so vertical scrolling still passes through everywhere else. */
.bless-ui {
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
}

.bless-panel {
  position: absolute;
  left: 50%;
  top: 30%;
  transform: translateX(-50%);
  width: min(90%, 384px);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: calc(var(--stage-width) * 0.032);
}

.bless-title {
  margin: 0;
  font-family: "AP Playfair", Georgia, "Times New Roman", serif;
  font-weight: 500;
  line-height: 1.05;
  font-size: clamp(1.5rem, calc(var(--stage-width) * 0.076), 2.3rem);
  color: #9c2f53;
}

.bless-hint {
  margin: 0;
  margin-top: calc(var(--stage-width) * -0.014);
  font-family: Georgia, "Times New Roman", serif;
  font-style: italic;
  font-size: clamp(0.72rem, calc(var(--stage-width) * 0.03), 0.92rem);
  color: #7a5a48;
}

.bless-tray {
  display: flex;
  align-items: flex-start;
  gap: 1.6%;
  width: 100%;
  margin-top: calc(var(--stage-width) * 0.004);
}

.bless-token {
  pointer-events: auto;
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5em;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

/* Cream double-ring frame around each token illustration. */
.bless-token__disc {
  position: relative;
  display: grid;
  place-items: center;
  width: 100%;
  max-width: clamp(48px, calc(var(--stage-width) * 0.168), 86px);
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle at 50% 38%, #fffdf8 0%, #fdf4e3 68%, #f5e6cf 100%);
  border: 1px solid rgba(196, 158, 96, 0.55);
  box-shadow:
    0 5px 14px rgba(150, 95, 60, 0.16),
    inset 0 1px 0 rgba(255, 255, 255, 0.85);
}

.bless-token__disc::after {
  content: "";
  position: absolute;
  inset: 7.5%;
  border-radius: 50%;
  border: 1px solid rgba(196, 158, 96, 0.4);
  pointer-events: none;
}

.bless-token__art {
  display: block;
  width: 68%;
  height: auto;
  aspect-ratio: 1;
  pointer-events: none;
  filter: drop-shadow(0 1px 1px rgba(120, 70, 40, 0.16));
}

.bless-token__label {
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(0.55rem, calc(var(--stage-width) * 0.0265), 0.74rem);
  letter-spacing: 0.01em;
  line-height: 1.1;
  color: #7a4b39;
  text-align: center;
}

.bless-token:focus-visible {
  outline: none;
}

.bless-token:focus-visible .bless-token__disc {
  outline: 3px solid rgba(193, 68, 108, 0.85);
  outline-offset: 3px;
}

.bless-thanks {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4em;
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(0.74rem, calc(var(--stage-width) * 0.032), 0.95rem);
  color: #7a4b39;
}

.bless-thanks[hidden] {
  display: none;
}

.bless-thanks__icon {
  flex: none;
  width: 1.05em;
  height: 1.05em;
  color: #d98a86;
}

.bless-thanks__n {
  color: #e0645a;
  font-weight: 700;
}
