/* ===== SECTION 3 : DATE REVEAL + LIVE COUNTDOWN =====
   Fixed canvas = the client's main scene artwork (948:1659). Every item is placed in % of that canvas,
   so it is identical on every phone. --u = 1 artwork pixel of the scene (948 px wide).
   Artwork files (assets/date/):  scene.webp (main scene)  ·  scratch-card.webp (gold foil)  ·  card-frame.webp (card behind the foil)
   To re-position the card: change .date__well (left / top / width). Everything inside the card is in % of the card. */
.date{
  --u:calc(var(--W)/948);
  --gold:#a87818; --gold-hi:#f0cd72; --gold-lo:#9a6a14; --maroon:#8a1a20; --maroon-lo:#5e1015; --cream:#f6e7c8;
  position:relative;z-index:1;width:100%;height:calc(var(--W)*1.75);overflow:hidden;
  background:#f7d3bd;font-family:var(--font-serif);color:var(--gold);text-align:center}
.date *{box-sizing:border-box}

/* --- main scene (background + arch + lamps in one artwork) --- */
.date__scene{position:absolute;left:0;top:0;width:100%;height:100%;max-width:none;display:block}

/* lamp flames: soft flickering glow on top of the two brass lamps in the scene */
.date__glow{position:absolute;top:83.4%;width:calc(var(--u)*150);height:calc(var(--u)*150);margin:calc(var(--u)*-75) 0 0 calc(var(--u)*-75);border-radius:50%;
  background:radial-gradient(closest-side,rgba(255,206,110,.75),rgba(255,170,60,.25) 55%,rgba(255,170,60,0));mix-blend-mode:screen;pointer-events:none;animation:date-flame 2.6s ease-in-out infinite alternate}
.date__glow--l{left:9.4%}.date__glow--r{left:91.4%;animation-duration:3.1s;animation-delay:-1s}
@keyframes date-flame{0%{opacity:.55;transform:scale(.92)}35%{opacity:.95;transform:scale(1.05)}70%{opacity:.7;transform:scale(.97)}100%{opacity:1;transform:scale(1.08)}}

/* --- "SAVE THE DATE" kicker (sits in the arch, above the artwork's gold divider line) --- */
.date__kicker{position:absolute;left:10%;width:80%;top:34.4%;transform:translateY(-50%);margin:0;display:flex;align-items:center;justify-content:center;gap:calc(var(--u)*12);
  font-size:calc(var(--u)*38);font-weight:600;letter-spacing:.16em;text-transform:uppercase;line-height:1;color:var(--gold);white-space:nowrap;
  text-shadow:0 calc(var(--u)*1.5) 0 rgba(255,244,214,.9)}
.date__kicker i,.date__kicker b{display:none}        /* the artwork already has its own divider line */
.date__kicker span{margin-right:-.16em}

/* --- the well: the square card (foil + card behind it) --- */
.date__well{position:absolute;left:15.6%;width:68.6%;top:40.9%;height:39.2%}
.date__under{position:absolute;inset:0;transform-origin:50% 50%}
.date__halo{position:absolute;inset:-14%;border-radius:50%;pointer-events:none;opacity:calc(var(--p,0)*1.3);
  background:radial-gradient(closest-side,rgba(255,215,120,.55),rgba(255,215,120,0) 70%);transition:opacity .2s linear}
.date__card{position:absolute;inset:0;width:100%;height:100%;max-width:none;display:block}

/* date panel: weekday, big date, ornament (all live text). Card paper starts ~9% in from each side; Ganesha emblem fills the top ~22%. */
.date__panel{position:absolute;left:12%;width:76%;top:25%;height:33%}
.date__orn{position:absolute;left:50%;top:90%;width:calc(var(--u)*300);height:calc(var(--u)*26);transform:translate(-50%,-50%)}
.date__day{position:absolute;left:6%;width:88%;top:15%;transform:translateY(-50%);display:flex;align-items:center;gap:calc(var(--u)*14);
  font-size:calc(var(--u)*30);letter-spacing:.3em;font-weight:600;text-transform:uppercase;color:var(--gold);line-height:1}
.date__day i{flex:1;height:calc(var(--u)*2);background:#c9a04a}
.date__day span{margin-right:-.3em}
.date__date{position:absolute;left:0;right:0;top:51%;transform:translateY(-50%);display:flex;justify-content:center;line-height:1;white-space:nowrap}
.date__dateText{display:inline-flex;align-items:center;transform-origin:50% 50%;font-size:calc(var(--u)*76);font-weight:700;letter-spacing:.005em;
  background:linear-gradient(180deg,#e7b84a 0%,#c58f1c 45%,#8a5a08 100%);-webkit-background-clip:text;background-clip:text;color:transparent;-webkit-text-fill-color:transparent;
  filter:drop-shadow(0 calc(var(--u)*1.5) 0 rgba(255,244,214,.8))}
.date__dateText em{font-style:normal;margin:0 .22em;font-size:.55em}
.date__star{position:absolute;width:calc(var(--u)*14);height:calc(var(--u)*14);margin:calc(var(--u)*-7) 0 0 calc(var(--u)*-7);color:#d6a63e;animation:date-twinkle 2.8s ease-in-out infinite}
.date__star svg{width:100%;height:100%;display:block}
@keyframes date-twinkle{0%,100%{opacity:.25;transform:scale(.6)}50%{opacity:1;transform:scale(1.1)}}

/* countdown tiles (inside the card, under the date) */
.date__tiles{position:absolute;left:12.5%;width:75%;top:60.5%;height:18%;display:flex;justify-content:space-between}
.date__tile{position:relative;width:21.7%;height:100%;border-radius:calc(var(--u)*9);display:flex;flex-direction:column;align-items:center;justify-content:center;
  background:linear-gradient(160deg,#a02228,#6a1217);
  box-shadow:inset 0 0 0 calc(var(--u)*3.5) #d6a63e,inset 0 0 0 calc(var(--u)*5.5) #6a1217,inset 0 0 0 calc(var(--u)*6.5) #b8882c,0 calc(var(--u)*4) calc(var(--u)*8) rgba(90,20,10,.3)}
.date__tile b{display:block;font-size:calc(var(--u)*50);line-height:1;font-weight:700;color:#fff6dc;font-variant-numeric:tabular-nums;letter-spacing:-.01em;text-shadow:0 calc(var(--u)*2) calc(var(--u)*4) rgba(0,0,0,.35)}
.date__tile span{display:block;margin-top:calc(var(--u)*7);font-size:calc(var(--u)*19);line-height:1;font-weight:600;letter-spacing:.05em;text-transform:uppercase;color:#f3dca0}
.date__tile b.tick{animation:date-tick .45s cubic-bezier(.2,.8,.2,1)}
@keyframes date-tick{0%{opacity:0;transform:translateY(-32%) scale(.9)}100%{opacity:1;transform:none}}
.date__tiles > i{display:none}

/* the foil (the artwork is drawn on the canvas by js/sections/date.js) */
.date__scratch{position:absolute;inset:0;width:100%;height:100%;display:block;touch-action:none;cursor:grab;outline:none;
  -webkit-tap-highlight-color:transparent;user-select:none;-webkit-user-select:none;
  filter:drop-shadow(0 calc(var(--u)*8) calc(var(--u)*14) rgba(90,40,10,.4))}
.date__scratch:focus-visible{outline:calc(var(--u)*3) solid #fff3c4;outline-offset:calc(var(--u)*4);border-radius:8%}
.date__scratch:active{cursor:grabbing}
.date__shine{position:absolute;inset:3.4%;border-radius:6%;overflow:hidden;pointer-events:none}
.date__shine::before{content:"";position:absolute;top:-20%;bottom:-20%;width:34%;left:-50%;transform:skewX(-20deg);
  background:linear-gradient(90deg,rgba(255,255,255,0),rgba(255,250,220,.55),rgba(255,255,255,0));animation:date-shine 4.2s 1.2s ease-in-out infinite}
@keyframes date-shine{0%{left:-50%}45%,100%{left:130%}}

/* "Scratch to reveal" label: engraved into the blank gold band of the foil (band = 43.5% - 59% of the card) */
.date__ribbon{position:absolute;left:8%;width:84%;top:43.5%;height:15.5%;pointer-events:none;display:flex;align-items:center;justify-content:center;gap:calc(var(--u)*16);
  color:#8a5a08;font-size:calc(var(--u)*42);font-weight:600;letter-spacing:.02em;white-space:nowrap;
  text-shadow:0 calc(var(--u)*1.6) 0 rgba(255,240,170,.85),0 calc(var(--u)*-1.2) 0 rgba(110,65,0,.35);
  animation:date-breathe 2.4s ease-in-out infinite;transition:opacity .45s ease,transform .45s ease}
.date__hand{width:calc(var(--u)*50);height:calc(var(--u)*58);flex:none;transform-origin:50% 100%;animation:date-tap 1.6s ease-in-out infinite;filter:drop-shadow(0 calc(var(--u)*1.5) 0 rgba(255,240,170,.6))}
@keyframes date-breathe{0%,100%{transform:scale(1)}50%{transform:scale(1.025)}}
@keyframes date-tap{0%,100%{transform:translate(0,0) rotate(-6deg)}40%{transform:translate(calc(var(--u)*-5),calc(var(--u)*7)) rotate(0)}55%{transform:translate(calc(var(--u)*-5),calc(var(--u)*7)) rotate(0)}}
/* the label stays while scratching: js/sections/date.js erases it together with the foil (mask) and it only fades when the card opens */
.date__ribbon{-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat}
.date.is-scratching .date__shine,.date.is-open .date__shine{display:none}

/* lotus divider under the card: appears with the reveal (sits in the cream gap between the two lamps) */
.date__lotus{position:absolute;left:30%;width:40%;top:84.4%;height:calc(var(--u)*38);transform:translateY(-50%)}
.date__lotus svg{width:100%;height:100%;display:block}

/* effects canvas: petals + gold dust (fixed to the visible stage) */
.date__fx{position:fixed;top:0;left:50%;width:var(--W);height:100vh;height:100svh;transform:translateX(-50%);pointer-events:none;z-index:60}

/* ---------- states ---------- */
.js .date:not(.is-in) .date__kicker{opacity:0}
.js .date:not(.is-in) .date__well{opacity:0;transform:translateY(calc(var(--u)*30)) scale(.96)}
.date.is-in .date__kicker{transition:opacity 1.1s ease}
.date.is-in .date__well{transition:opacity 1s .25s ease,transform 1.1s .25s cubic-bezier(.2,.7,.2,1)}

.date__scratch{transition:opacity 1s ease,transform 1.1s cubic-bezier(.3,.7,.2,1),filter 1s ease}
.date.is-open .date__scratch{opacity:0;transform:scale(1.06);pointer-events:none;filter:blur(calc(var(--u)*6)) drop-shadow(0 0 0 rgba(0,0,0,0))}
.date.is-open .date__ribbon{opacity:0}
.date.is-open .date__halo{opacity:0;transition:opacity 1.4s ease}
.date__lotus{opacity:0;transform:translateY(-50%) scale(.7)}
.date.is-open .date__lotus{opacity:1;transform:translateY(-50%) scale(1);transition:opacity 1s .7s ease,transform 1.2s .7s cubic-bezier(.2,.8,.2,1)}
.date__under{transform:scale(.985);transition:transform 1.2s cubic-bezier(.2,.8,.2,1)}
.date.is-open .date__under{transform:scale(1)}
.date.is-open .date__dateText{animation:date-gleam 3.6s 1s ease-in-out infinite}
@keyframes date-gleam{0%,100%{filter:drop-shadow(0 calc(var(--u)*1.5) 0 rgba(255,244,214,.8)) brightness(1)}50%{filter:drop-shadow(0 calc(var(--u)*1.5) 0 rgba(255,244,214,.8)) brightness(1.2)}}
.date.is-open .date__panel{cursor:pointer}

@media (prefers-reduced-motion:reduce){
  .js .date:not(.is-in) .date__kicker,.js .date:not(.is-in) .date__well{opacity:1;transform:none}
  .date__glow,.date__ribbon,.date__hand,.date__star,.date__shine::before{animation:none}
}


/* =====================================================================================
   SCRATCH HINT  ·  low-opacity hand that demonstrates the scratching gesture over the foil
   Overlay only (pointer-events none, it never scratches). Shows when the card is in view and untouched,
   fades out when the guest touches the card, comes back after they have been idle for a few seconds (js/sections/date.js).
   ===================================================================================== */
.date__well{
  --hint-opacity: .6;            /* overall strength of the hand (0 = hidden ... 1 = solid) */
  --hint-speed: 4.8s;            /* one full demo loop */
  --hint-delay: 0s;              /* wait after the card appears before the demo starts (0 = starts immediately) */
  --hint-size: 1.5;              /* hand size multiplier */
  --hint-fill: rgba(255,255,255,.9);
  --hint-stroke: rgba(120,78,8,.55);
  --hint-glow: rgba(255,246,200,.95);
}
.date__hint{position:absolute;left:50%;top:50%;width:0;height:0;pointer-events:none;z-index:4;opacity:0;transition:opacity .2s ease}
.date.is-in:not(.is-open):not(.is-touched) .date__hint{opacity:var(--hint-opacity)}
.hint__mover{position:absolute;left:0;top:0;width:0;height:0;transform:translate(calc(var(--u)*-205),calc(var(--u)*-240));opacity:0}
.date.is-in:not(.is-open):not(.is-touched) .hint__mover{animation:date-hint var(--hint-speed) var(--hint-delay) ease-in-out infinite}
.hint__glow{position:absolute;left:calc(var(--u)*-34);top:calc(var(--u)*-34);width:calc(var(--u)*68);height:calc(var(--u)*68);border-radius:50%;
  background:radial-gradient(circle,var(--hint-glow) 0,rgba(255,246,200,.55) 30%,rgba(255,246,200,0) 70%);animation:date-hint-pulse 1.2s ease-in-out infinite}
.hint__hand{position:absolute;display:block;width:calc(var(--u)*66*var(--hint-size));height:calc(var(--u)*78*var(--hint-size));
  left:calc(var(--u)*-31.5*var(--hint-size));top:calc(var(--u)*-16.5*var(--hint-size));transform-origin:calc(var(--u)*31.5*var(--hint-size)) calc(var(--u)*16.5*var(--hint-size));
  fill:var(--hint-fill);stroke:var(--hint-stroke);stroke-width:1.5;stroke-linejoin:round;stroke-linecap:round;
  filter:drop-shadow(0 calc(var(--u)*6) calc(var(--u)*8) rgba(90,50,0,.35));animation:date-hint-tilt var(--hint-speed) var(--hint-delay) ease-in-out infinite}
.hint__lines{fill:none;stroke-width:1.2;opacity:.45}
@keyframes date-hint{
  0%{transform:translate(calc(var(--u)*-205),calc(var(--u)*-240));opacity:0}
  3%{transform:translate(calc(var(--u)*-205),calc(var(--u)*-240));opacity:1}
  19%{transform:translate(calc(var(--u)*205),calc(var(--u)*-230))}
  31%{transform:translate(calc(var(--u)*-205),calc(var(--u)*-160))}
  43%{transform:translate(calc(var(--u)*205),calc(var(--u)*-150))}
  55%{transform:translate(calc(var(--u)*-205),calc(var(--u)*-80))}
  67%{transform:translate(calc(var(--u)*205),calc(var(--u)*-70))}
  79%{transform:translate(calc(var(--u)*-205),calc(var(--u)*0))}
  89%{transform:translate(calc(var(--u)*205),calc(var(--u)*10));opacity:1}
  96%,100%{transform:translate(calc(var(--u)*205),calc(var(--u)*10));opacity:0}
}
@keyframes date-hint-tilt{0%,7%{transform:rotate(-4deg)}19%{transform:rotate(-14deg)}31%{transform:rotate(-2deg)}43%{transform:rotate(-14deg)}55%{transform:rotate(-2deg)}67%{transform:rotate(-14deg)}79%{transform:rotate(-2deg)}89%,100%{transform:rotate(-14deg)}}
@keyframes date-hint-pulse{0%,100%{transform:scale(.8);opacity:.7}50%{transform:scale(1.1);opacity:1}}
@media (prefers-reduced-motion:reduce){.date.is-in:not(.is-open):not(.is-touched) .hint__mover{animation:none;opacity:1;transform:translate(0,calc(var(--u)*-60))}.hint__hand,.hint__glow{animation:none}}
