/* =========================================================
   SECTION 3 - DATE REVEAL + LIVE COUNTDOWN  (prefix .s3-)
   Everything sized in cqw (1cqw = 1% of section width), so the
   layout is identical on every screen. Section proportions come
   from the reference: 557 x 856.
   ========================================================= */
.s3-reveal{
  position:relative;
  width:100%;
  aspect-ratio:557/856;
  container-type:inline-size;
  overflow:hidden;
  background:#fcf0de;
  isolation:isolate;
  font-family:Georgia,"Times New Roman",serif;
}
.s3-reveal img{position:absolute;max-width:none;pointer-events:none}
.s3-paper{left:0;top:0;width:100%;height:100%;object-fit:fill;z-index:0}
.s3-arch{left:-2.5cqw;top:-1.5cqw;width:105cqw;height:50.6cqw;object-fit:fill;z-index:1}
/* narrower vines, as in the reference: edge copies of the paper squeezed to 90% width */
.s3-vine{left:0;top:0;width:100%;height:100%;object-fit:fill;z-index:0}
.s3-vine--l{transform-origin:0 50%;transform:scaleX(.9);-webkit-mask-image:linear-gradient(90deg,#000 0,#000 13%,transparent 19%);mask-image:linear-gradient(90deg,#000 0,#000 13%,transparent 19%)}
.s3-vine--r{transform-origin:100% 50%;transform:scaleX(.9);-webkit-mask-image:linear-gradient(270deg,#000 0,#000 13%,transparent 19%);mask-image:linear-gradient(270deg,#000 0,#000 13%,transparent 19%)}
.s3-temple{left:0;bottom:0;width:100%;height:auto;z-index:1;transition:opacity 1.6s ease .6s}
.s3-reveal.is-revealed .s3-temple{opacity:.62}

.s3-t{position:absolute;left:0;right:0;text-align:center;transform:translateY(-50%);z-index:3;white-space:nowrap}
.s3-t > span{display:inline-block}

.s3-shubh{top:28.4%;color:#C00000;font-weight:500}
.s3-await{top:33.2%;color:#0a2278;font-weight:500;transition:opacity .6s ease,transform .8s ease}
.s3-reveal.is-revealed .s3-await{opacity:0;transform:translateY(-70%)}

/* ---- the revealed content (hidden until scratched) ---- */
.s3-day,.s3-year{color:#B3832F;font-weight:600;line-height:1;
  background:linear-gradient(180deg,#c99a47 0%,#a97a2c 100%);-webkit-background-clip:text;background-clip:text;-webkit-text-fill-color:transparent}
.s3-day{top:42.9%}
.s3-year{top:51.9%}
.s3-orn{position:absolute;left:0;right:0;top:47.5%;transform:translateY(-50%);z-index:3;
  display:flex;align-items:center;justify-content:center;gap:1.4cqw}
.s3-orn i{display:block;height:.26cqw;width:12cqw;background:linear-gradient(90deg,transparent,#B3832F 35%,#B3832F)}
.s3-orn i:last-child{background:linear-gradient(270deg,transparent,#B3832F 35%,#B3832F)}
.s3-orn svg{width:4cqw;height:4cqw;fill:#B3832F}

.s3-tiles{position:absolute;left:0;right:0;top:61.4%;transform:translateY(-50%);z-index:3;
  display:flex;justify-content:center;gap:3.3cqw}
.s3-tile{
  position:relative;width:13.4cqw;height:14.6cqw;border-radius:2.1cqw;
  display:flex;flex-direction:column;align-items:center;justify-content:center;
  color:#fff;text-align:center;
  background:
    radial-gradient(circle at 14% 14%,#ef5a5a 0 .45cqw,#f6cf74 .55cqw .9cqw,transparent 1cqw),
    radial-gradient(circle at 86% 86%,#ef5a5a 0 .45cqw,#f6cf74 .55cqw .9cqw,transparent 1cqw),
    radial-gradient(circle at 86% 14%,#f6cf74 0 .45cqw,transparent .6cqw),
    radial-gradient(circle at 14% 86%,#f6cf74 0 .45cqw,transparent .6cqw),
    radial-gradient(circle at 50% 9%,#f6cf74 0 .4cqw,transparent .55cqw),
    radial-gradient(ellipse at 50% 35%,#1e55ad 0%,#12408f 55%,#0a2f80 100%);
  box-shadow:
    inset 0 0 0 .32cqw #f1cf7a,
    inset 0 0 0 .7cqw #0a2f80,
    inset 0 0 0 .95cqw rgba(241,207,122,.55),
    0 0 0 .5cqw #c9a24a,
    0 .9cqw 1.8cqw rgba(60,35,0,.35);
}
.s3-tile b{font-size:7.2cqw;font-weight:500;line-height:1;letter-spacing:.01em;display:block;font-variant-numeric:lining-nums tabular-nums;margin-top:-.8cqw}
.s3-tile small{font-size:2.5cqw;font-weight:500;letter-spacing:.02em;text-transform:uppercase;margin-top:.3cqw;display:block;color:#f3dc98}
.s3-tile b.is-tick{animation:s3-tick .45s cubic-bezier(.2,.8,.2,1)}
@keyframes s3-tick{from{transform:translateY(22%);opacity:.2}to{transform:none;opacity:1}}

.s3-until{top:72.5%;color:#0a2a78;font-style:italic;font-weight:700}

/* The date + countdown sit BEHIND the card from the start, so scratched holes show them.
   They are clipped to the card's visible shape until the reveal, then the clip opens up. */
.s3-date-wrap{
  position:absolute;inset:0;z-index:3;pointer-events:none;
  clip-path:inset(58.3cqw 10.5cqw 50.9cqw 12.5cqw round 5cqw);
  transition:clip-path 1s cubic-bezier(.4,0,.2,1) .15s;
}
.s3-reveal.is-revealed .s3-date-wrap{clip-path:inset(0cqw 0cqw 0cqw 0cqw round 0cqw)}
.s3-reveal:not(.is-revealed) .s3-diya{opacity:0;visibility:hidden}

/* ---- scratch card ---- */
.s3-card{position:absolute;left:10cqw;top:54.7cqw;width:82cqw;height:52.4cqw;z-index:4;touch-action:none}
.s3-card canvas{position:absolute;inset:0;width:100%;height:100%;display:block;touch-action:none;cursor:grab}
.s3-card.is-idle canvas{animation:s3-breathe 3.2s ease-in-out infinite}
@keyframes s3-breathe{0%,100%{transform:scale(1)}50%{transform:scale(1.014)}}
.s3-card::after{ /* soft light sweep to invite touch */
  content:"";position:absolute;inset:5.5% 3.4% 6.5%;border-radius:5cqw;pointer-events:none;
  background:linear-gradient(105deg,transparent 35%,rgba(255,255,255,.55) 50%,transparent 65%) -120% 0/60% 100% no-repeat;
  mix-blend-mode:soft-light;opacity:0;
}
.s3-card.is-idle::after{opacity:1;animation:s3-sweep 3.6s ease-in-out 1s infinite}
@keyframes s3-sweep{0%{background-position:-120% 0}60%,100%{background-position:220% 0}}
.s3-reveal.is-revealed .s3-card{pointer-events:none;animation:s3-card-out 1s cubic-bezier(.4,0,.2,1) forwards}
.s3-reveal.is-revealed .s3-card::after{display:none}
@keyframes s3-card-out{to{opacity:0;transform:scale(1.07);filter:blur(5px)}}

/* ---- reveal choreography ---- */
.s3-until{opacity:0;transition:opacity 1.1s ease 1s}
.s3-reveal.is-revealed .s3-until{opacity:1}
.s3-reveal.is-revealed .s3-diya{animation:s3-fade 1.2s ease 1.2s both}
.s3-reveal.is-revealed .s3-tile{animation:s3-settle .7s cubic-bezier(.2,.9,.3,1.2) both}
.s3-reveal.is-revealed .s3-tile:nth-child(2){animation-delay:.08s}.s3-reveal.is-revealed .s3-tile:nth-child(3){animation-delay:.16s}.s3-reveal.is-revealed .s3-tile:nth-child(4){animation-delay:.24s}
@keyframes s3-fade{from{opacity:0}to{opacity:1}}
@keyframes s3-settle{0%{transform:scale(.94)}100%{transform:none}}

/* ---- brass diyas ---- */
.s3-diya{position:absolute;top:85.2%;width:15cqw;transform:translateX(-50%);z-index:3;pointer-events:none}
.s3-diya--l{left:25.2cqw}.s3-diya--r{left:77.6cqw}
.s3-diya svg{display:block;width:100%;height:auto;overflow:visible}
.s3-flame{transform-origin:50% 100%;animation:s3-flicker 1.6s ease-in-out infinite alternate}
.s3-diya--r .s3-flame{animation-delay:-.7s}
@keyframes s3-flicker{0%{transform:scale(1,1) rotate(-1.5deg)}35%{transform:scale(.94,1.05) rotate(1.2deg)}70%{transform:scale(1.04,.97) rotate(-.8deg)}100%{transform:scale(.97,1.04) rotate(1.6deg)}}
.s3-glow{animation:s3-glow 1.6s ease-in-out infinite alternate}
@keyframes s3-glow{from{opacity:.55}to{opacity:.9}}

/* ---- full-screen throw layer (created by JS) ---- */
.s3-fx{position:fixed;top:0;z-index:100;pointer-events:none}

/* =====================================================================================
   SCRATCH HINT  ·  low-opacity hand that demonstrates the scratching gesture over the card
   Overlay only (pointer-events none, it never scratches). Shows as soon as the card is in view and untouched,
   fades out when the guest touches the card, comes back after a few idle seconds (js/s3-reveal.js).
   ===================================================================================== */
.s3-card{
  --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 comes into view before the demo starts (0 = 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);
  --hu: calc(82cqw / 600);       /* 1 hint unit = 1/600 of the card width */
}
.s3-hint{position:absolute;left:50%;top:50%;width:0;height:0;pointer-events:none;z-index:2;opacity:0;transition:opacity .2s ease}
.s3-reveal.is-in:not(.is-revealed):not(.is-touched) .s3-hint{opacity:var(--hint-opacity)}
.s3-hint__mover{position:absolute;left:0;top:0;width:0;height:0;transform:translate(calc(var(--hu)*-205),calc(var(--hu)*-135));opacity:0}
.s3-reveal.is-in:not(.is-revealed):not(.is-touched) .s3-hint__mover{animation:s3-hint var(--hint-speed) var(--hint-delay) ease-in-out infinite}
.s3-hint__glow{position:absolute;left:calc(var(--hu)*-34);top:calc(var(--hu)*-34);width:calc(var(--hu)*68);height:calc(var(--hu)*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:s3-hint-pulse 1.2s ease-in-out infinite}
.s3-hint__hand{position:absolute;display:block;width:calc(var(--hu)*66*var(--hint-size));height:calc(var(--hu)*78*var(--hint-size));
  left:calc(var(--hu)*-31.5*var(--hint-size));top:calc(var(--hu)*-16.5*var(--hint-size));transform-origin:calc(var(--hu)*31.5*var(--hint-size)) calc(var(--hu)*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(--hu)*6) calc(var(--hu)*8) rgba(90,50,0,.35));animation:s3-hint-tilt var(--hint-speed) var(--hint-delay) ease-in-out infinite}
.s3-hint__lines{fill:none;stroke-width:1.2;opacity:.45}
@keyframes s3-hint{
  0%{transform:translate(calc(var(--hu)*-205),calc(var(--hu)*-135));opacity:0}
  3%{transform:translate(calc(var(--hu)*-205),calc(var(--hu)*-135));opacity:1}
  19%{transform:translate(calc(var(--hu)*205),calc(var(--hu)*-125))}
  31%{transform:translate(calc(var(--hu)*-205),calc(var(--hu)*-57))}
  43%{transform:translate(calc(var(--hu)*205),calc(var(--hu)*-47))}
  55%{transform:translate(calc(var(--hu)*-205),calc(var(--hu)*22))}
  67%{transform:translate(calc(var(--hu)*205),calc(var(--hu)*32))}
  79%{transform:translate(calc(var(--hu)*-205),calc(var(--hu)*100))}
  89%{transform:translate(calc(var(--hu)*205),calc(var(--hu)*110));opacity:1}
  96%,100%{transform:translate(calc(var(--hu)*205),calc(var(--hu)*110));opacity:0}
}
@keyframes s3-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 s3-hint-pulse{0%,100%{transform:scale(.8);opacity:.7}50%{transform:scale(1.1);opacity:1}}
@media (prefers-reduced-motion:reduce){.s3-reveal.is-in:not(.is-revealed):not(.is-touched) .s3-hint__mover{animation:none;opacity:1;transform:translate(0,calc(var(--hu)*-30))}.s3-hint__hand,.s3-hint__glow{animation:none}}

