/* kovil.mu coming soon - layout, typography, controls and layer geometry.
   Motion lives in animations.css. */

:root {
  --emerald-950: #04100b;
  --emerald-900: #06140f;
  --emerald-800: #0b2a20;
  --emerald-600: #1c5a44;
  --gold-300: #f6deaa;
  --gold-400: #ecc77f;
  --gold-500: #d9a441;
  --gold-700: #8a6420;
  --cream: #fbf1dc;
  --ink-shadow: 0 2px 18px rgba(2, 10, 7, 0.85), 0 0 2px rgba(2, 10, 7, 0.6);

  --font-tamil: 'Noto Serif Tamil', 'Latha', 'Nirmala UI', 'Tamil Sangam MN', serif;
  --font-serif: 'Cormorant Garamond', 'Cormorant', Georgia, 'Times New Roman', serif;

  /* Set by app.js: size of the 16:9 stage that covers the viewport. */
  --stage-w: 177.78vh;
  --stage-h: 100vh;
  --fade: 1.6s;
  --bar: clamp(22px, 6.5vh, 64px); /* letterbox bar height */
  --gutter: clamp(16px, 3vw, 40px);

  color-scheme: dark;
}

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

html,
body {
  margin: 0;
  height: 100%;
  background: var(--emerald-950);
  color: var(--cream);
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-serif);
  overflow: hidden;
}

p,
h1 {
  margin: 0;
}

button {
  font: inherit;
  color: inherit;
}

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

/* ------------------------------------------------------------- frame */

.experience {
  position: relative;
  width: 100%;
  height: 100vh;
  height: 100svh;
  min-height: 420px;
  overflow: hidden;
  isolation: isolate;
  background:
    radial-gradient(ellipse at 60% 40%, rgba(217, 164, 65, 0.16), transparent 60%),
    linear-gradient(180deg, var(--emerald-900), var(--emerald-950));
}

.fallback,
.scenes,
.scene,
.overlay,
.vignette {
  position: absolute;
  inset: 0;
}

.fallback img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 56% 50%;
  display: block;
}

.fallback {
  z-index: 0;
  transition: opacity 1.2s ease;
}

.js .fallback {
  opacity: 0;
}

/* Behind the loader: a dim, soft glimpse of the dawn. */
.js [data-stage='loader'] .fallback {
  opacity: 0.32;
  filter: blur(3px) saturate(0.85);
  transform: scale(1.04);
}

html.is-static .fallback,
html:not(.js) .fallback {
  opacity: 0.5;
  filter: none;
  transform: none;
}

.scenes {
  z-index: 1;
}

.scene {
  overflow: hidden;
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--fade) ease-in-out, visibility 0s linear var(--fade);
  contain: strict;
}

.scene.is-live {
  visibility: visible;
  transition: opacity var(--fade) ease-in-out, visibility 0s;
}

.scene.is-active {
  opacity: 1;
  z-index: 2;
}

.scene.is-leaving {
  z-index: 1;
}

/* The incoming doorway light is already bright: arrive quickly beneath the bloom. */
.scene[data-enter='light'].is-active {
  transition-duration: calc(var(--fade) * 0.5);
}

.scene.is-missing .stage {
  background:
    radial-gradient(ellipse at 55% 45%, rgba(236, 199, 127, 0.35), transparent 55%),
    linear-gradient(180deg, var(--emerald-800), var(--emerald-950));
}

/* The stage has the artwork's exact aspect ratio, so layers placed in % of
   the frame stay locked to the picture. The camera transforms the stage. */
.stage {
  position: absolute;
  left: 0;
  top: 0;
  width: var(--stage-w);
  height: var(--stage-h);
  transform-origin: 0 0;
  will-change: transform;
  backface-visibility: hidden;
}

.plate,
.plate-video,
.layers {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.plate,
.plate-video {
  display: block;
  object-fit: cover;
}

.plate-video {
  opacity: 0;
  transition: opacity 0.6s ease;
}

.has-video .plate-video {
  opacity: 1;
}

/* A playing video already contains the motion: keep only the light touches. */
.has-video .layers > :not(.fx-flames):not(.fx-mist) {
  display: none;
}

.layers > * {
  position: absolute;
  pointer-events: none;
}

/* --------------------------------------------------------- light layers */

.fx-sun {
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 251, 226, 0.95) 0%, rgba(255, 223, 140, 0.55) 9%, rgba(255, 186, 82, 0.2) 28%, transparent 60%);
  mix-blend-mode: screen;
}

.fx-sun--dusk {
  background: radial-gradient(circle, rgba(255, 233, 190, 0.55) 0%, rgba(255, 168, 92, 0.28) 18%, transparent 60%);
}

.fx-rays {
  border-radius: 50%;
  overflow: hidden;
  opacity: var(--o);
  mix-blend-mode: screen;
  -webkit-mask-image: radial-gradient(circle, #000 4%, rgba(0, 0, 0, 0.55) 22%, transparent 52%);
  mask-image: radial-gradient(circle, #000 4%, rgba(0, 0, 0, 0.55) 22%, transparent 52%);
}

.fx-rays-spin {
  position: absolute;
  inset: 0;
  background: repeating-conic-gradient(
    from 0deg,
    rgba(255, 216, 140, 0) 0deg,
    rgba(255, 216, 140, 0.55) 1.6deg,
    rgba(255, 216, 140, 0) 4.2deg,
    rgba(255, 216, 140, 0) 9deg,
    rgba(255, 230, 170, 0.35) 10.2deg,
    rgba(255, 216, 140, 0) 13deg
  );
}

.fx-shafts {
  height: 120%;
  transform-origin: 50% 0;
  transform: rotate(var(--angle));
  opacity: var(--o);
  mix-blend-mode: screen;
  background:
    linear-gradient(90deg, transparent 6%, rgba(255, 214, 140, 0.32) 14%, transparent 22%, transparent 36%, rgba(255, 224, 160, 0.22) 44%, transparent 55%, rgba(255, 210, 130, 0.28) 66%, transparent 78%);
  -webkit-mask-image: linear-gradient(180deg, #000 0%, rgba(0, 0, 0, 0.6) 55%, transparent 90%);
  mask-image: linear-gradient(180deg, #000 0%, rgba(0, 0, 0, 0.6) 55%, transparent 90%);
}

.fx-mist {
  left: -30%;
  width: 160%;
  opacity: var(--o);
  background:
    radial-gradient(ellipse 30% 50% at 20% 55%, rgba(222, 214, 176, 0.42), transparent 70%),
    radial-gradient(ellipse 26% 45% at 52% 45%, rgba(210, 220, 186, 0.36), transparent 70%),
    radial-gradient(ellipse 32% 55% at 82% 60%, rgba(226, 212, 170, 0.4), transparent 70%);
  mix-blend-mode: screen;
}

.fx-flames,
.fx-smoke {
  inset: 0;
}

.fx-flame {
  position: absolute;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 246, 200, 0.95) 0%, rgba(255, 200, 92, 0.55) 22%, rgba(255, 150, 40, 0.18) 48%, transparent 70%);
  mix-blend-mode: screen;
}

.fx-puff {
  position: absolute;
  width: 13.16%; /* 220 / 1672 */
  aspect-ratio: 0.8;
  border-radius: 50%;
  background: radial-gradient(ellipse at 50% 60%, rgba(230, 222, 200, 0.24), rgba(220, 210, 185, 0.09) 45%, transparent 70%);
  opacity: 0;
}

.fx-veil {
  inset: 0;
  background: var(--veil);
  opacity: 0;
}

/* ------------------------------------------------------------- the bell */

.fx-bell {
  will-change: transform;
}

.fx-bell-img {
  display: block;
  width: 100%;
  height: 100%;
}

.fx-bell-glint {
  position: absolute;
  inset: 0;
  mix-blend-mode: screen;
  background: linear-gradient(105deg, transparent 30%, rgba(255, 232, 170, 0.0) 38%, rgba(255, 238, 190, 0.38) 46%, rgba(255, 210, 120, 0.15) 52%, transparent 60%) no-repeat;
  background-size: 300% 100%;
  background-position: 100% 0;
  opacity: 0;
  /* Only the bell's body catches the glint, not the shackle above it. */
  -webkit-mask-image: linear-gradient(180deg, transparent 22%, #000 32%);
  mask-image: linear-gradient(180deg, transparent 22%, #000 32%);
}

/* ------------------------------------------------------------ the doors */

.fx-doors {
  inset: 0;
  perspective: calc(var(--stage-w) * 1.15);
}

.door-light {
  position: absolute;
  overflow: hidden;
  /* The sanctum beyond the doors: deep bronze walls lit from a warm source. */
  background:
    linear-gradient(180deg, rgba(40, 16, 2, 0.55) 0%, transparent 30%, transparent 78%, rgba(90, 40, 6, 0.45) 100%),
    radial-gradient(ellipse 30% 58% at 50% 50%, #fff6d8 0%, #ffd78a 30%, #e9a043 58%, #9c5514 82%, #4a2106 100%);
}

.door-light-core {
  position: absolute;
  inset: 4% 33% 6%;
  border-radius: 50%;
  background: radial-gradient(ellipse at 50% 48%, #fffef6 0%, rgba(255, 246, 214, 0.85) 30%, rgba(255, 226, 150, 0.35) 58%, transparent 74%);
  mix-blend-mode: screen;
  opacity: 0.55;
  transform: scale(0.6, 0.85);
}

.door {
  position: absolute;
  overflow: hidden;
  backface-visibility: hidden;
  transform-style: flat;
  box-shadow: 0 0 calc(var(--stage-w) * 0.01) rgba(0, 0, 0, 0.45);
}

.door--left {
  transform-origin: 0% 50%;
  transform: rotateY(0deg) scaleX(var(--closed));
}

.door--right {
  transform-origin: 100% 50%;
  transform: rotateY(0deg) scaleX(var(--closed));
}

.door-face {
  position: absolute;
  background-image: var(--plate);
  background-size: 100% 100%;
}

.door-shade {
  position: absolute;
  inset: 0;
  opacity: 0;
}

.door--left .door-shade {
  background: linear-gradient(90deg, rgba(20, 8, 2, 0.15), rgba(20, 8, 2, 0.75));
}

.door--right .door-shade {
  background: linear-gradient(270deg, rgba(20, 8, 2, 0.15), rgba(20, 8, 2, 0.75));
}

.door-seam {
  top: 0;
  background: linear-gradient(90deg, transparent 0%, rgba(255, 220, 140, 0.25) 35%, rgba(255, 252, 230, 1) 49%, rgba(255, 252, 230, 1) 51%, rgba(255, 220, 140, 0.25) 65%, transparent 100%);
  mix-blend-mode: screen;
  opacity: 0.9;
}

.door-rays {
  top: -8%;
  height: 116%;
  background: radial-gradient(ellipse 18% 62% at 50% 48%, rgba(255, 244, 205, 0.85), rgba(255, 205, 110, 0.32) 45%, transparent 75%);
  mix-blend-mode: screen;
  opacity: 0;
  transform: scaleX(0.15);
}

.door-floor {
  height: 18%;
  border-radius: 50%;
  background: radial-gradient(ellipse at 50% 40%, rgba(255, 236, 180, 0.8), rgba(255, 190, 90, 0.25) 45%, transparent 70%);
  mix-blend-mode: screen;
  opacity: 0;
  transform: scaleX(0.2);
}

/* -------------------------------------------------------------- particles */

.particles {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

.ember,
.petal {
  position: absolute;
  left: var(--x);
  top: var(--y);
  width: var(--size);
  height: var(--size);
  opacity: 0;
}

.ember {
  border-radius: 50%;
  background: radial-gradient(circle, #fff6d6 0%, #f8d48a 40%, rgba(240, 180, 80, 0) 72%);
  box-shadow: 0 0 calc(var(--size) * 2.5) rgba(255, 196, 100, 0.55);
}

.petal {
  top: -4%;
  height: calc(var(--size) * 0.62);
  border-radius: 60% 0 60% 0;
  background: var(--c);
  box-shadow: inset -2px -2px 4px rgba(0, 0, 0, 0.18);
}

/* --------------------------------------------------------------- overlays */

.overlay {
  z-index: 3;
  opacity: 0;
  pointer-events: none;
}

.overlay--light {
  background: radial-gradient(ellipse at 50% 46%, #fffef6 0%, #fff3cd 30%, #ffd98e 62%, #f2b75a 100%);
}

.overlay--smoke {
  background:
    radial-gradient(ellipse 60% 50% at 30% 60%, rgba(196, 190, 168, 0.55), transparent 70%),
    radial-gradient(ellipse 55% 60% at 70% 40%, rgba(170, 170, 150, 0.5), transparent 70%),
    rgba(10, 24, 18, 0.55);
}

.overlay--flash {
  background: radial-gradient(ellipse at 50% 50%, #fffaf0 0%, #ffe3a3 45%, rgba(242, 183, 90, 0.85) 100%);
}

.overlay--dawn {
  background:
    radial-gradient(ellipse 70% 45% at 70% 45%, rgba(120, 70, 20, 0.45), transparent 70%),
    linear-gradient(180deg, #071711, #04100b);
}

.vignette {
  z-index: 4;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(4, 16, 11, 0.6) 0%, rgba(4, 16, 11, 0) 22%, rgba(4, 16, 11, 0) 46%, rgba(4, 16, 11, 0.55) 74%, rgba(4, 16, 11, 0.9) 100%),
    radial-gradient(ellipse 120% 90% at 50% 50%, transparent 55%, rgba(2, 8, 5, 0.55) 100%);
}

/* ----------------------------------------------------------- typography */

.top,
.caption,
.bottom {
  position: absolute;
  z-index: 5;
  left: 0;
  right: 0;
}

.top {
  top: calc(max(env(safe-area-inset-top), var(--bar)) + clamp(8px, 2vh, 20px));
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 0 var(--gutter);
  text-align: center;
}

.motif {
  width: clamp(150px, 16vw, 220px);
  height: auto;
  color: var(--gold-400);
  opacity: 0.85;
  filter: drop-shadow(0 0 6px rgba(236, 199, 127, 0.45));
}

.saying {
  max-width: 44rem;
  display: flex;
  flex-direction: column;
  gap: 2px;
  text-shadow: var(--ink-shadow);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.saying-ta {
  font-family: var(--font-tamil);
  font-size: clamp(13px, 1.15vw, 17px);
  line-height: 1.6;
  color: var(--gold-300);
}

.saying-en {
  font-style: italic;
  font-size: clamp(13px, 1.05vw, 16px);
  letter-spacing: 0.03em;
  color: rgba(251, 241, 220, 0.78);
}

.caption {
  top: 56%;
  padding: 0 var(--gutter);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(6px, 1.2vh, 14px);
  text-align: center;
  pointer-events: none;
}

/* Soft dark pool behind the words so they read on bright frames (doorway light). */
.caption::before {
  content: '';
  position: absolute;
  z-index: -1;
  left: 50%;
  top: 50%;
  width: min(1100px, 100%);
  height: 240%;
  transform: translate(-50%, -50%);
  background: radial-gradient(closest-side, rgba(18, 10, 3, 0.5), rgba(18, 10, 3, 0.22) 55%, transparent);
  transition: opacity 0.9s ease;
}

.caption-ta {
  max-width: 22em;
  font-family: var(--font-tamil);
  font-weight: 500;
  font-size: clamp(22px, 3.1vw, 48px);
  line-height: 1.55;
  color: #ffe4ab;
  text-shadow: var(--ink-shadow), 0 0 28px rgba(255, 196, 100, 0.25);
  text-wrap: balance;
}

.caption-en {
  max-width: 34em;
  font-style: italic;
  font-weight: 500;
  font-size: clamp(16px, 1.65vw, 25px);
  letter-spacing: 0.02em;
  color: var(--cream);
  text-shadow: var(--ink-shadow);
  text-wrap: balance;
}

.caption-ta,
.caption-en,
.saying {
  transition: opacity 0.65s ease, transform 0.9s cubic-bezier(.2, .7, .2, 1), filter 0.9s ease;
}

.caption-en {
  transition-delay: 0.15s;
}

.caption.is-hidden .caption-ta,
.caption.is-hidden .caption-en,
.saying.is-hidden {
  opacity: 0;
  transform: translateY(10px);
  filter: blur(4px);
  transition-delay: 0s;
}

.caption.is-hidden::before {
  opacity: 0;
}

/* ----------------------------------------------------- letterbox, bars */

.letterbox {
  position: absolute;
  z-index: 6;
  left: 0;
  right: 0;
  height: var(--bar);
  background: #020806;
  pointer-events: none;
}

.letterbox--top {
  top: 0;
}

.letterbox--bottom {
  bottom: 0;
}

.progress {
  position: absolute;
  z-index: 7;
  left: 0;
  right: 0;
  bottom: var(--bar);
  height: 2px;
  background: rgba(251, 241, 220, 0.1);
  pointer-events: none;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--gold-700), var(--gold-400));
  box-shadow: 0 0 8px rgba(236, 199, 127, 0.7);
  transform: scaleX(var(--p, 0));
  transform-origin: 0 50%;
}

.bottom {
  position: absolute;
  z-index: 8;
  left: 0;
  right: 0;
  bottom: max(env(safe-area-inset-bottom), calc((var(--bar) - 40px) / 2), 4px);
  padding: 0 var(--gutter);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.scene-nav ol {
  list-style: none;
  display: flex;
  gap: 2px;
  margin: 0;
  padding: 0;
}

.nav-dot {
  position: relative;
  width: 38px;
  height: 40px;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
}

/* Thin track inside a comfortable hit area. */
.nav-dot::before,
.nav-fill {
  content: '';
  position: absolute;
  left: 5px;
  right: 5px;
  top: 50%;
  height: 2px;
  margin-top: -1px;
  border-radius: 2px;
}

.nav-dot::before {
  background: rgba(251, 241, 220, 0.28);
}

.nav-dot.is-current::before {
  background: rgba(251, 241, 220, 0.55);
}

.nav-fill {
  background: var(--gold-400);
  transform: scaleX(0);
  transform-origin: 0 50%;
  transition: transform 0.6s ease;
}

.nav-dot.is-done .nav-fill,
.nav-dot.is-current .nav-fill {
  transform: scaleX(1);
}

.controls {
  display: flex;
  gap: 10px;
}

.ctrl {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border-radius: 50%;
  border: 1px solid rgba(236, 199, 127, 0.4);
  background: rgba(6, 20, 15, 0.6);
  color: var(--gold-300);
  cursor: pointer;
  transition: background-color 0.25s ease, border-color 0.25s ease, color 0.25s ease;
}

.ctrl svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

.ctrl:hover {
  background: rgba(217, 164, 65, 0.22);
  border-color: var(--gold-400);
  color: var(--cream);
}

.nav-dot:focus-visible,
.ctrl:focus-visible,
.loader-ring:focus-visible,
.finale-replay:focus-visible {
  outline: 2px solid var(--gold-300);
  outline-offset: 3px;
}

#btn-play[data-state='playing'] .i-play,
#btn-play[data-state='paused'] .i-pause,
#btn-sound[data-state='off'] .i-sound-on,
#btn-sound[data-state='on'] .i-sound-off {
  display: none;
}

/* After the music ends there is nothing left to pause. */
[data-ended='true'] #btn-play {
  visibility: hidden;
}

/* ---------------------------------------------------- stage visibility */

.loader,
.finale {
  position: absolute;
  z-index: 7;
  inset: var(--bar) 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 16px var(--gutter);
  text-align: center;
  visibility: hidden;
  opacity: 0;
  transition: opacity 0.9s ease, visibility 0s linear 0.9s;
}

[data-stage='loader'] .loader,
[data-stage='finale'] .finale,
html:not(.js) .finale,
html.is-static .finale {
  visibility: visible;
  opacity: 1;
  transition: opacity 0.9s ease, visibility 0s;
}

[data-stage='loader'] .top,
[data-stage='loader'] .caption,
[data-stage='loader'] .bottom,
[data-stage='loader'] .progress,
[data-stage='finale'] .top,
[data-stage='finale'] .caption,
html:not(.js) .top,
html:not(.js) .caption,
html.is-static .top,
html.is-static .caption {
  visibility: hidden;
  opacity: 0;
}

.top,
.caption,
.bottom,
.progress {
  transition: opacity 0.8s ease, visibility 0s;
}

html:not(.js) .loader,
html.is-static .loader,
html:not(.js) .bottom,
html.is-static .bottom,
html:not(.js) .countdown,
html.is-static .countdown,
html:not(.js) .finale-replay,
html.is-static .finale-replay {
  display: none;
}

/* ----------------------------------------------------------- loader */

.loader {
  gap: clamp(14px, 3vh, 26px);
}

.loader-kicker {
  font-family: 'Cinzel', var(--font-serif);
  font-weight: 500;
  font-size: clamp(15px, 1.5vw, 20px);
  letter-spacing: 0.42em;
  margin-right: -0.42em;
  color: var(--cream);
  text-shadow: var(--ink-shadow);
}

.loader-kicker span {
  color: var(--gold-400);
}

/* Progress ring with a lamp flame; becomes the "enable sound" button. */
.loader-ring {
  position: relative;
  display: grid;
  place-items: center;
  width: clamp(104px, 15vh, 132px);
  aspect-ratio: 1;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(236, 199, 127, 0.2), rgba(6, 20, 15, 0.55) 68%);
  color: var(--gold-300);
  cursor: pointer;
  box-shadow: 0 0 40px rgba(236, 199, 127, 0.25);
}

.loader-progress {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.loader-track,
.loader-bar {
  fill: none;
  stroke-width: 2;
}

.loader-track {
  stroke: rgba(236, 199, 127, 0.18);
}

.loader-bar {
  stroke: var(--gold-400);
  stroke-linecap: round;
  stroke-dasharray: 100;
  stroke-dashoffset: calc(100 - var(--load, 0));
  filter: drop-shadow(0 0 4px rgba(255, 210, 130, 0.8));
  transition: stroke-dashoffset 0.35s ease;
}

.loader-flame {
  width: 26%;
  margin-top: -14%;
  fill: #f3c66b;
  filter: drop-shadow(0 0 10px rgba(255, 200, 100, 0.8));
}

.loader-flame-core {
  fill: #fff3d0;
}

.loader-speaker {
  display: none;
  width: 34%;
  fill: currentColor;
}

.loader-pct {
  position: absolute;
  bottom: 22%;
  font-family: 'Cinzel', var(--font-serif);
  font-size: 13px;
  letter-spacing: 0.12em;
  color: var(--gold-300);
  font-variant-numeric: tabular-nums;
}

/* Loaded, but the browser still needs one tap for sound. */
[data-load='waiting'] .loader-flame,
[data-load='waiting'] .loader-pct {
  display: none;
}

[data-load='waiting'] .loader-speaker {
  display: block;
}

[data-load='waiting'] .loader-ring {
  box-shadow: 0 0 60px rgba(236, 199, 127, 0.5), inset 0 0 24px rgba(236, 199, 127, 0.3);
}

.loader-status {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-height: 3.4em;
  text-shadow: var(--ink-shadow);
}

.loader-status [lang='ta'] {
  font-family: var(--font-tamil);
  font-size: clamp(14px, 1.3vw, 18px);
  color: var(--gold-300);
}

.loader-status span:last-child {
  font-size: clamp(11px, 0.9vw, 13px);
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: rgba(251, 241, 220, 0.75);
}

[data-load='waiting'] .loader-status [lang='ta'] {
  font-size: clamp(17px, 1.7vw, 22px);
}

/* ------------------------------------------------------------ finale */

.finale {
  gap: clamp(6px, 1.4vh, 14px);
}

/* Quiet the picture behind the words and countdown. */
.finale::before {
  content: '';
  position: absolute;
  z-index: -1;
  inset: 30% 10% -10%;
  background: radial-gradient(closest-side, rgba(3, 12, 8, 0.72), rgba(3, 12, 8, 0.4) 60%, transparent);
  pointer-events: none;
}

.finale-logo {
  position: relative;
  margin: 0 0 clamp(2px, 1vh, 10px);
  line-height: 0;
}

/* A disc of dawn light behind the logo (its red wordmark needs a light ground). */
.finale-logo::before,
.finale-logo::after {
  content: '';
  position: absolute;
  z-index: -1;
  left: 50%;
  top: 50%;
  aspect-ratio: 1;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.finale-logo::before {
  width: 185%;
  background: radial-gradient(circle, rgba(255, 250, 232, 0.97) 0%, rgba(255, 236, 190, 0.9) 30%, rgba(242, 183, 90, 0.4) 52%, rgba(242, 183, 90, 0.08) 66%, transparent 72%);
}

.finale-logo::after {
  width: 330%;
  opacity: 0.55;
  background: repeating-conic-gradient(from 0deg, rgba(255, 214, 140, 0) 0deg, rgba(255, 214, 140, 0.5) 2deg, rgba(255, 214, 140, 0) 5deg, rgba(255, 214, 140, 0) 11deg);
  -webkit-mask-image: radial-gradient(circle, transparent 16%, #000 24%, transparent 58%);
  mask-image: radial-gradient(circle, transparent 16%, #000 24%, transparent 58%);
}

.finale-logo img {
  position: relative;
  width: auto;
  height: clamp(130px, 26vh, 250px);
  filter: drop-shadow(0 6px 22px rgba(120, 60, 0, 0.35));
}

.finale-ta {
  position: relative;
  font-family: var(--font-tamil);
  font-weight: 500;
  font-size: clamp(18px, 2.2vw, 30px);
  line-height: 1.5;
  color: #ffe4ab;
  text-shadow: var(--ink-shadow);
}

.finale-en {
  position: relative;
  font-style: italic;
  font-size: clamp(15px, 1.4vw, 20px);
  color: var(--cream);
  text-shadow: var(--ink-shadow);
}

.finale-soon {
  position: relative;
  margin-top: clamp(4px, 1.4vh, 14px);
  display: flex;
  align-items: center;
  gap: 14px;
  font-family: 'Cinzel', var(--font-serif);
  font-weight: 500;
  font-size: clamp(12px, 1.1vw, 15px);
  letter-spacing: 0.5em;
  text-transform: uppercase;
  color: var(--gold-300);
}

.finale-soon::before,
.finale-soon::after {
  content: '';
  width: clamp(30px, 6vw, 80px);
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold-400));
}

.finale-soon::after {
  transform: scaleX(-1);
}

.finale-date {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.finale-date time {
  font-family: 'Cinzel', var(--font-serif);
  font-weight: 700;
  font-size: clamp(28px, 4.2vw, 60px);
  letter-spacing: 0.06em;
  line-height: 1.1;
  background: linear-gradient(180deg, #fff6dc 0%, #f3cf86 45%, #c48a2c 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 2px 12px rgba(0, 0, 0, 0.6));
}

.finale-date [lang='ta'] {
  font-family: var(--font-tamil);
  font-size: clamp(13px, 1.2vw, 17px);
  color: var(--gold-300);
  text-shadow: var(--ink-shadow);
}

.countdown {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: clamp(6px, 1.4vw, 18px);
  margin-top: clamp(2px, 1vh, 10px);
  padding: clamp(8px, 1.4vh, 14px) clamp(12px, 2vw, 26px);
  border-radius: 14px;
  background: rgba(4, 16, 11, 0.55);
  border: 1px solid rgba(236, 199, 127, 0.25);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}

.cd-unit {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 2.4em;
}

.cd-num {
  font-family: 'Cinzel', var(--font-serif);
  font-weight: 700;
  font-size: clamp(24px, 3.2vw, 44px);
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
  color: var(--gold-300);
  text-shadow: 0 0 18px rgba(236, 199, 127, 0.35);
}

.cd-sep {
  font-family: 'Cinzel', var(--font-serif);
  font-size: clamp(20px, 2.6vw, 36px);
  line-height: 1.25;
  color: rgba(236, 199, 127, 0.5);
}

.cd-label {
  display: flex;
  flex-direction: column;
  align-items: center;
  line-height: 1.3;
}

.cd-ta {
  font-family: var(--font-tamil);
  font-size: clamp(11px, 0.9vw, 13px);
  color: var(--gold-300);
}

.cd-en {
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(251, 241, 220, 0.6);
}

.finale-replay {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  margin-top: clamp(4px, 1.2vh, 12px);
  padding: 8px 18px;
  border-radius: 999px;
  border: 1px solid rgba(236, 199, 127, 0.45);
  background: rgba(6, 20, 15, 0.55);
  color: var(--gold-300);
  font-family: var(--font-serif);
  font-size: 16px;
  letter-spacing: 0.06em;
  cursor: pointer;
}

.finale-replay svg {
  width: 18px;
  height: 18px;
}

.finale-replay:hover {
  background: rgba(217, 164, 65, 0.22);
  color: var(--cream);
}

/* --------------------------------------------------------------- mobile */

@media (max-width: 700px) {
  .top {
    gap: 6px;
  }

  .saying {
    max-width: 22rem;
  }

  .caption {
    top: auto;
    bottom: calc(var(--bar) + max(env(safe-area-inset-bottom), 16px) + 64px);
  }

  .caption-ta {
    font-size: clamp(21px, 6vw, 28px);
  }

  .caption-en {
    font-size: clamp(16px, 4.4vw, 19px);
  }

  .nav-dot {
    width: 28px;
  }

  .nav-dot::before,
  .nav-fill {
    left: 3px;
    right: 3px;
  }

  .vignette {
    background:
      linear-gradient(180deg, rgba(4, 16, 11, 0.65) 0%, rgba(4, 16, 11, 0) 24%, rgba(4, 16, 11, 0) 40%, rgba(4, 16, 11, 0.7) 66%, rgba(4, 16, 11, 0.95) 100%);
  }

  .countdown {
    gap: 4px;
    padding: 8px 10px;
  }

  .cd-unit {
    min-width: 2.1em;
  }

  .finale-logo img {
    height: clamp(120px, 22vh, 190px);
  }
}

/* Short landscape phones */
@media (max-height: 500px) and (orientation: landscape) {
  .saying,
  .finale-ta,
  .finale-en {
    display: none;
  }

  .caption {
    top: 40%;
    bottom: auto;
  }

  .caption-ta {
    font-size: clamp(18px, 3vw, 26px);
  }

  .caption-en {
    font-size: 15px;
  }

  .finale-logo img {
    height: 26vh;
  }
}
