:root {
  --bg: #FFF8EE;
  --bg-2: #FBEBD3;
  --ink: #5A0F1C;
  --ink-soft: #7D3A44;
  --muted: #9A7A6A;
  --gold: #C08A24;
  --gold-2: #E7C36A;
  --gold-3: #F6E2A8;
  --maroon: #6A1222;
  --card: rgba(255, 255, 255, .62);
  --card-line: rgba(192, 138, 36, .28);
  --shadow: 0 18px 50px -18px rgba(106, 18, 34, .28), 0 2px 6px rgba(106, 18, 34, .06);
  --serif: "Cormorant Garamond", "Playfair Display", "Didot", "Bodoni 72", "Book Antiqua", "Palatino Linotype", Palatino, Georgia, serif;
  --sans: "Inter", "SF Pro Display", -apple-system, BlinkMacSystemFont, "Segoe UI Variable Display", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --telugu: "Noto Sans Telugu", "Nirmala UI", "Gautami", "Kohinoor Telugu", "Telugu Sangam MN", sans-serif;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1B0A10;
    --bg-2: #2A1016;
    --ink: #F7E6C4;
    --ink-soft: #E9CFA3;
    --muted: #BFA585;
    --card: rgba(255, 240, 215, .06);
    --card-line: rgba(231, 195, 106, .28);
    --shadow: 0 20px 60px -20px rgba(0, 0, 0, .7), 0 2px 6px rgba(0, 0, 0, .3);
  }
}

* { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }

html, body { min-height: 100%; overflow-x: hidden; overflow-x: clip; }

body {
  min-height: 100vh;
  min-height: 100svh;
  color: var(--ink);
  font-family: var(--sans);
  background:
    radial-gradient(520px 380px at 0% 0%, rgba(243, 154, 30, .14) 0%, transparent 70%),
    radial-gradient(520px 380px at 100% 0%, rgba(243, 154, 30, .14) 0%, transparent 70%),
    radial-gradient(1200px 600px at 50% -10%, var(--gold-3) 0%, transparent 60%),
    radial-gradient(900px 500px at 50% 115%, var(--bg-2) 0%, transparent 65%),
    var(--bg);
  background-attachment: fixed;
  cursor: pointer;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  -webkit-tap-highlight-color: transparent;
}

@media (prefers-color-scheme: dark) {
  body {
    background:
      radial-gradient(1100px 600px at 50% -10%, rgba(192, 138, 36, .22) 0%, transparent 60%),
      radial-gradient(900px 500px at 50% 115%, rgba(106, 18, 34, .55) 0%, transparent 65%),
      var(--bg);
    background-attachment: fixed;
  }
}

.svg-defs { position: absolute; width: 0; height: 0; overflow: hidden; }

.grain {
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: .35;
  mix-blend-mode: multiply;
  background-image: repeating-radial-gradient(circle at 0 0, rgba(192, 138, 36, .035) 0 1px, transparent 1px 3px);
}

/* Toran */
.toran { position: fixed; inset-block-start: 0; inset-inline: 0; height: 86px; z-index: 3; pointer-events: none; }
.toran svg { width: 100%; height: 100%; display: block; overflow: visible; }
.sway { transform-box: fill-box; transform-origin: 50% 0; animation: sway 6s ease-in-out infinite; }

/* Layout */
.stage {
  position: relative;
  z-index: 2;
  min-height: 100vh;
  min-height: 100svh;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 740px) minmax(0, 1fr);
  align-items: center;
}

.side { position: relative; height: 100vh; height: 100svh; pointer-events: none; }
.side svg { position: absolute; inset-block-end: 0; height: min(98vh, 940px); height: min(98svh, 940px); width: auto; max-width: 118%; overflow: visible; }
.side.left svg { inset-inline-start: -4%; }
.side.right svg { inset-inline-end: -4%; }
.parallax { transition: transform .6s cubic-bezier(.2, .8, .2, 1); will-change: transform; }

.center {
  position: relative;
  z-index: 2;
  text-align: center;
  padding: 120px 24px 60px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* Heading */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  font-size: 12px;
  letter-spacing: .42em;
  text-transform: uppercase;
  color: var(--gold);
  font-weight: 600;
}
.eyebrow::before, .eyebrow::after { content: ""; width: 44px; height: 1px; background: linear-gradient(90deg, transparent, var(--gold)); }
.eyebrow::after { transform: scaleX(-1); }

.telugu {
  font-family: var(--telugu);
  font-size: clamp(22px, 2.6vw, 30px);
  color: var(--maroon);
  margin-block: 18px 4px;
  font-weight: 600;
  letter-spacing: .02em;
}
@media (prefers-color-scheme: dark) { .telugu { color: var(--gold-2); } }

.motif { width: 120px; height: 22px; margin-block: 10px 6px; color: var(--gold); }

.date {
  font-family: var(--serif);
  font-weight: 500;
  line-height: .95;
  letter-spacing: -.01em;
  font-size: clamp(46px, 7.2vw, 104px);
  background: linear-gradient(180deg, var(--ink) 0%, var(--maroon) 55%, var(--gold) 140%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
@media (prefers-color-scheme: dark) {
  .date {
    background: linear-gradient(180deg, #FFF3D6 0%, var(--gold-2) 70%, var(--gold) 120%);
    -webkit-background-clip: text;
    background-clip: text;
  }
}
.date .yr { display: block; font-size: .62em; letter-spacing: .24em; margin-top: .12em; font-weight: 400; }

.day { margin-top: 16px; font-size: 13px; letter-spacing: .38em; text-transform: uppercase; color: var(--muted); font-weight: 500; }

/* Countdown tiles */
.timer {
  margin-top: 42px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(10px, 1.6vw, 18px);
  width: min(640px, 100%);
}

.unit {
  position: relative;
  padding: 22px 8px 18px;
  border-radius: 22px;
  background: var(--card);
  border: 1px solid var(--card-line);
  box-shadow: var(--shadow);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  backdrop-filter: blur(14px) saturate(140%);
  transition: transform .35s cubic-bezier(.2, .8, .2, 1);
  overflow: hidden;
}
.unit::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background: linear-gradient(160deg, rgba(255, 255, 255, .7), transparent 42%);
}
@media (prefers-color-scheme: dark) { .unit::before { background: linear-gradient(160deg, rgba(255, 235, 200, .10), transparent 42%); } }
.unit::after {
  content: "";
  position: absolute;
  inset-inline: 22%;
  inset-block-start: 0;
  height: 2px;
  border-radius: 2px;
  background: linear-gradient(90deg, transparent, var(--gold-2), transparent);
}
@media (hover: hover) { .unit:hover { transform: translateY(-4px); } }

.num {
  position: relative;
  display: block;
  font-weight: 300;
  font-variant-numeric: tabular-nums;
  font-size: clamp(34px, 5.4vw, 64px);
  line-height: 1;
  letter-spacing: -.02em;
  color: var(--ink);
  height: 1em;
  overflow: hidden;
}
.num span { display: inline-block; }
.num span.tick { animation: tick .55s cubic-bezier(.2, .9, .25, 1); }

.lbl {
  display: block;
  margin-top: 12px;
  font-size: 11px;
  letter-spacing: .32em;
  text-transform: uppercase;
  color: var(--gold);
  font-weight: 600;
  padding-inline-start: .32em;
}

.note { margin-top: 30px; font-family: var(--serif); font-style: italic; font-size: clamp(17px, 1.7vw, 21px); color: var(--ink-soft); }
.hint { margin-top: 10px; font-size: 11px; letter-spacing: .2em; text-transform: uppercase; color: var(--muted); opacity: .75; }

.done { margin-top: 40px; font-family: var(--serif); font-size: clamp(30px, 4vw, 48px); line-height: 1.15; color: var(--maroon); }
.done span { display: block; margin-top: 10px; font-style: italic; font-size: .5em; color: var(--ink-soft); }
@media (prefers-color-scheme: dark) { .done { color: var(--gold-2); } }
body.is-today .timer, body.is-today .note { display: none; }

/* Rangoli */
.rangoli {
  position: fixed;
  inset-block-end: -120px;
  inset-inline-start: 50%;
  width: 420px;
  height: 420px;
  transform: translateX(-50%);
  z-index: 1;
  opacity: .5;
  pointer-events: none;
  color: var(--gold);
}
.rangoli svg { width: 100%; height: 100%; animation: spin 120s linear infinite; }

#fx, #petals { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; }
#fx { z-index: 4; }
#petals { z-index: 5; }

/* Ambient motion */
.lf { animation: leaf 7s ease-in-out infinite; }
.garland { transform-box: fill-box; transform-origin: 50% 0; animation: sway 5.5s ease-in-out infinite; }
.garland.g2 { animation-duration: 6.4s; animation-delay: -1.5s; }
.flame { transform-box: fill-box; transform-origin: 50% 100%; animation: flame 1.6s ease-in-out infinite; }
.glow { animation: glow 2.4s ease-in-out infinite; }

/* Entrance */
.reveal { opacity: 0; transform: translateY(18px); animation: reveal 1.1s cubic-bezier(.2, .8, .2, 1) forwards; }
.r1 { animation-delay: .1s; }
.r2 { animation-delay: .25s; }
.r3 { animation-delay: .4s; }
.r4 { animation-delay: .6s; }
.r5 { animation-delay: .8s; }
.r6 { animation-delay: 1s; }
.side .parallax { opacity: 0; animation: fadeSide 1.6s .2s cubic-bezier(.2, .8, .2, 1) forwards; }

@keyframes reveal { to { opacity: 1; transform: none; } }
@keyframes fadeSide { from { opacity: 0; filter: blur(6px); } to { opacity: 1; filter: none; } }
@keyframes tick { 0% { transform: translateY(-70%); opacity: 0; filter: blur(4px); } 100% { transform: none; opacity: 1; filter: none; } }
@keyframes sway { 0%, 100% { transform: rotate(-1.2deg); } 50% { transform: rotate(1.2deg); } }
@keyframes leaf { 0%, 100% { transform: rotate(-.8deg); } 50% { transform: rotate(1.6deg); } }
@keyframes flame { 0%, 100% { transform: scale(1, 1); } 30% { transform: scale(.92, 1.08) skewX(2deg); } 60% { transform: scale(1.05, .95) skewX(-2deg); } }
@keyframes glow { 0%, 100% { opacity: .55; } 50% { opacity: .9; } }
@keyframes spin { to { transform: rotate(360deg); } }

/* Responsive */
@media (max-width: 1100px) {
  .stage { grid-template-columns: minmax(0, 1fr) minmax(0, 600px) minmax(0, 1fr); }
}

@media (max-width: 860px) {
  .stage { grid-template-columns: 1fr; }
  .side { position: fixed; inset-block-end: 0; width: 48vw; height: 52vh; height: 52svh; z-index: 1; opacity: .95; }
  .side.left { inset-inline-start: -8vw; }
  .side.right { inset-inline-end: -8vw; }
  .side svg { height: 100%; max-width: none; }
  .center { padding: 104px 18px 40vh; padding-bottom: 40svh; }
  .rangoli { width: 300px; height: 300px; inset-block-end: -90px; }
}

@media (max-width: 520px) {
  .timer { gap: 8px; }
  .unit { padding: 16px 2px 13px; border-radius: 16px; }
  .lbl { font-size: 9px; letter-spacing: .2em; padding-inline-start: .2em; }
  .eyebrow { font-size: 10px; letter-spacing: .3em; }
  .eyebrow::before, .eyebrow::after { width: 24px; }
  .day { font-size: 11px; letter-spacing: .26em; }
  .side { width: 56vw; height: 40vh; height: 40svh; }
  .center { padding-bottom: 30vh; padding-bottom: 30svh; }
  .note { margin-top: 24px; }
  .hint { font-size: 10px; letter-spacing: .18em; opacity: .85; }
}

@media (max-height: 700px) and (min-width: 861px) {
  .center { padding-top: 96px; }
  .timer { margin-top: 28px; }
  .note { margin-top: 20px; }
}

/* Phones in landscape: keep the date and full countdown above the fold. */
@media (max-height: 520px) and (orientation: landscape) {
  .center { padding: 76px max(18px, env(safe-area-inset-right)) 16px max(18px, env(safe-area-inset-left)); }
  .eyebrow, .motif { display: none; }
  .telugu { font-size: 18px; margin-block: 0 4px; }
  .date { font-size: 38px; }
  .day { margin-top: 8px; font-size: 10px; }
  .timer { margin-top: 14px; width: min(500px, 100%); gap: 10px; }
  .unit { padding: 10px 4px 9px; border-radius: 14px; }
  .num { font-size: 30px; }
  .lbl { margin-top: 6px; font-size: 9px; }
  .note { margin-top: 10px; font-size: 15px; }
  .hint { margin-top: 6px; }
  .done { margin-top: 16px; font-size: 26px; }
  .side { width: 30vw; height: 92vh; height: 92svh; }
  .side.left { inset-inline-start: -6vw; }
  .side.right { inset-inline-end: -6vw; }
  .rangoli { width: 220px; height: 220px; inset-block-end: -80px; }
}

/* Reduced motion: no entrance, spin or digit motion; décor keeps a slow, small sway. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; }
  .reveal, .side .parallax, .num span.tick, .rangoli svg { animation: none; }
  .reveal, .side .parallax { opacity: 1; transform: none; }
  .sway, .garland, .garland.g2 { animation: sway-soft 10s ease-in-out infinite; }
  .lf { animation: leaf-soft 12s ease-in-out infinite; }
  .flame { animation-duration: 3.2s; }
}
@keyframes sway-soft { 0%, 100% { transform: rotate(-.5deg); } 50% { transform: rotate(.5deg); } }
@keyframes leaf-soft { 0%, 100% { transform: rotate(-.4deg); } 50% { transform: rotate(.7deg); } }
