/* =====================================================================
   SHREYA JEWELLERS — Cinematic Showroom Display
   Designed for Smart TVs (1366x768 and 1920x1080). Pure CSS + Web
   Animations, so it runs smoothly on older built-in TV browsers.
   ===================================================================== */

:root {
  --bg-0: #070603;              /* deep near-black */
  --bg-1: #1a1206;              /* warm brown-black */
  --bg-2: #2a1c0b;              /* lit brown */
  --gold-1: #fbedc0;            /* light champagne gold */
  --gold-2: #e9c96f;            /* gold */
  --gold-3: #b8902f;            /* deep gold */
  --gold-4: #7c5a16;            /* bronze shadow */
  --gold-line: rgba(233, 201, 111, 0.42);
  --gold-grad: linear-gradient(100deg, var(--gold-4), var(--gold-1) 30%, var(--gold-2) 55%, var(--gold-1) 78%, var(--gold-3));
  --text: #f8f2e6;
  --muted: rgba(248, 242, 230, 0.68);
  --ink: #120c04;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  width: 100%; height: 100%;
  overflow: hidden;
  background:
    radial-gradient(120% 130% at 50% -10%, var(--bg-2) 0%, var(--bg-1) 42%, var(--bg-0) 78%);
  color: var(--text);
  font-family: "Poppins", "Segoe UI", system-ui, sans-serif;
  cursor: none;
  -webkit-user-select: none; user-select: none;
  -webkit-font-smoothing: antialiased;
}

/* ===================== Atmosphere overlays ========================= */
#vignette {
  position: fixed; inset: 0; z-index: 22; pointer-events: none;
  background:
    radial-gradient(130% 105% at 50% 45%, transparent 55%, rgba(0,0,0,0.62) 100%);
}
#grain {
  position: fixed; inset: -50%; z-index: 23; pointer-events: none; opacity: 0.05;
  background-image:
    repeating-radial-gradient(circle at 17% 37%, rgba(255,255,255,0.9) 0 1px, transparent 1px 3px),
    repeating-radial-gradient(circle at 71% 61%, rgba(255,255,255,0.7) 0 1px, transparent 1px 4px);
  animation: grain 3.2s steps(4) infinite;
}
#bokeh { position: fixed; inset: 0; z-index: 2; pointer-events: none; }
.spark {
  position: absolute; bottom: -4vh; border-radius: 50%;
  background: radial-gradient(circle, var(--gold-1) 0%, rgba(233,201,111,0.55) 35%, rgba(233,201,111,0) 70%);
  filter: blur(0.3px);
  animation: floaty linear infinite;
}

/* ===================== Ornamental gold frame ======================= */
#frame {
  position: fixed; inset: 1.6vh 1.4vw; z-index: 24; pointer-events: none;
  border: 1px solid rgba(233,201,111,0.28);
  border-radius: 6px;
  box-shadow:
    inset 0 0 0 3px rgba(0,0,0,0.35),
    inset 0 0 44px rgba(0,0,0,0.55);
}
#frame::before {
  content: ""; position: absolute; inset: 5px;
  border: 1px solid rgba(233,201,111,0.16); border-radius: 4px;
}
.corner {
  position: absolute; width: 4.2vw; height: 4.2vw; min-width: 46px; min-height: 46px;
}
.corner::before, .corner::after {
  content: ""; position: absolute; background: var(--gold-grad);
  box-shadow: 0 0 10px rgba(233,201,111,0.45);
}
.corner::before { width: 100%; height: 2px; top: 0; }
.corner::after  { width: 2px; height: 100%; left: 0; }
.corner.tl { top: -1px; left: -1px; }
.corner.tr { top: -1px; right: -1px; transform: scaleX(-1); }
.corner.bl { bottom: -1px; left: -1px; transform: scaleY(-1); }
.corner.br { bottom: -1px; right: -1px; transform: scale(-1, -1); }

/* ===================== Top bar (brand + clock) ===================== */
#topbar {
  position: fixed; top: 0; left: 0; right: 0; height: 13.5vh;
  display: flex; align-items: center; justify-content: space-between;
  padding: 1.4vh 5.4vw 0 5.4vw;   /* clears the ornamental frame + corner flourishes */
  background: linear-gradient(180deg, rgba(0,0,0,0.72) 0%, rgba(0,0,0,0.28) 60%, rgba(0,0,0,0));
  z-index: 30;
}
#brand { display: flex; align-items: center; gap: 1.5vw; }
.emblem { width: 8.4vh; height: 8.4vh; flex: 0 0 auto; filter: drop-shadow(0 2px 8px rgba(0,0,0,0.6)); }
.emblem--spin { animation: spin 26s linear infinite; }
.brand-logo-img {
  height: 9.4vh; width: auto;
  /* layered dark shadow so the gold reads even over a bright photo */
  filter: drop-shadow(0 1px 2px rgba(0,0,0,0.9)) drop-shadow(0 0 14px rgba(0,0,0,0.55));
}

.brand-text { display: flex; flex-direction: column; line-height: 1; }
.brand-word {
  font-family: "Cinzel", "Cormorant Garamond", serif;
  font-weight: 700; font-size: 4.4vh; letter-spacing: 0.12em;
  background: var(--gold-grad); background-size: 220% 100%;
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: var(--gold-2);
  animation: shimmer 7s linear infinite;
}
.brand-tag {
  font-size: 1.55vh; letter-spacing: 0.42em; text-transform: uppercase;
  color: var(--muted); margin-top: 0.9vh; padding-left: 0.2vh;
}

#clock { text-align: right; }
#clock-time {
  font-family: "Cormorant Garamond", serif; font-size: 4.4vh; font-weight: 600;
  color: var(--gold-1); line-height: 1; letter-spacing: 0.02em;
}
#clock-date { font-size: 1.6vh; color: var(--muted); margin-top: 0.6vh; letter-spacing: 0.14em; }

/* ===================== Stage ======================================= */
#stage {
  position: absolute; top: 0; bottom: 0; left: 0; right: 0;
  overflow: hidden;
}
#loading {
  position: absolute; inset: 0; display: flex; gap: 1.2vh;
  align-items: center; justify-content: center; z-index: 4;
}
#loading .dot {
  width: 1.1vh; height: 1.1vh; border-radius: 50%; background: var(--gold-2);
  animation: pulse 1.2s ease-in-out infinite;
}
#loading .dot:nth-child(2) { animation-delay: 0.18s; }
#loading .dot:nth-child(3) { animation-delay: 0.36s; }

/* ===================== Slides (base) =============================== */
.slide {
  position: absolute; inset: 0; opacity: 0; z-index: 1;
  transition: opacity 1100ms ease;
  will-change: opacity;
}
.slide.active { opacity: 1; z-index: 5; }
.slide.leaving { z-index: 4; }

/* Ambient background copy (fills any aspect ratio, premium feel) */
.media-bg {
  position: absolute; inset: -6%;
  background-size: cover; background-position: center;
  filter: blur(26px) brightness(0.42) saturate(1.15);
  transform: scale(1.12);
}
.media-dark { position: absolute; inset: 0;
  background: radial-gradient(80% 80% at 50% 45%, rgba(40,26,10,0.55), rgba(0,0,0,0.9)); }

/* Bottom cinematic gradient so any caption / bars read cleanly */
.grad {
  position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(0deg, rgba(0,0,0,0.55) 0%, rgba(0,0,0,0.12) 26%, rgba(0,0,0,0) 46%);
}

/* ---- Photo slides: full-bleed, sharp, slow parallax Ken Burns ---- */
.slide.photo .media-fg {
  position: absolute; inset: 0;
  background-size: cover; background-position: center;
  transform-origin: center;
}
.slide.photo.active .media-fg { animation: kenburns 13s ease-out both; }

/* ---- Video slides: framed cinema window, sharp inside a gold frame ---- */
.slide.video .cinema {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
  /* 16:9 window that always fits in the band between top bar and rate bar */
  width: min(78vw, 108vh); height: min(60.75vh, 43.9vw);
  border-radius: 8px; overflow: hidden;
  background: #0a0805;
  box-shadow: 0 3vh 8vh rgba(0,0,0,0.7), 0 0 0 1px rgba(0,0,0,0.6);
}
.slide.video.active .cinema { animation: cinemaIn 1200ms cubic-bezier(.16,1,.3,1) both; }
.slide.video video {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: contain; background: #0a0805;   /* show the whole clip, never overflow the frame */
}
.slide.video .cinema-frame {
  position: absolute; inset: 0; pointer-events: none; border-radius: 8px;
  border: 2px solid rgba(233,201,111,0.55);
  box-shadow: inset 0 0 0 6px rgba(0,0,0,0.35), inset 0 0 60px rgba(0,0,0,0.5);
}

/* ---- Optional item caption (pure-visual mode keeps this hidden) ---- */
.caption {
  position: absolute; left: 0; right: 0; bottom: 15vh; text-align: center;
  z-index: 6; padding: 0 8vw;
}
.caption .kicker {
  font-family: "Cinzel", serif; font-size: 1.7vh; letter-spacing: 0.5em;
  text-transform: uppercase; color: var(--gold-2); margin-bottom: 1.4vh;
}
.caption .name {
  font-family: "Cormorant Garamond", serif; font-weight: 600;
  font-size: 5.4vh; color: var(--gold-1); text-shadow: 0 2px 26px rgba(0,0,0,0.8);
}
.slide.active .caption { animation: rise 1100ms 300ms both; }

/* ===================== Brand intro slide =========================== */
.slide.brand {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center;
}
.brand-bg {
  position: absolute; inset: -6%; background-size: cover; background-position: center;
  filter: blur(18px) brightness(0.24) saturate(1.1); transform: scale(1.14);
}
.slide.brand .glow {
  position: absolute; width: 96vh; height: 96vh; border-radius: 50%;
  /* dark core to lift the gold logo off the background, faint gold halo around */
  background: radial-gradient(circle, rgba(0,0,0,0.55) 0%, rgba(0,0,0,0.30) 24%, rgba(233,201,111,0.10) 46%, transparent 66%);
}
.slide.brand.active .glow { animation: breathe 7s ease-in-out infinite; }

.brand-emblem-lg { width: 26vh; height: 26vh; margin-bottom: 3.2vh; position: relative; }
.slide.brand.active .brand-emblem-lg { animation: emblemIn 1400ms cubic-bezier(.16,1,.3,1) both; }
.brand-logo-lg {
  max-height: 68vh; max-width: 76vw; margin-bottom: 1vh; position: relative;
  filter: drop-shadow(0 8px 40px rgba(0,0,0,0.5));
}
.slide.brand.active .brand-logo-lg { animation: emblemIn 1400ms cubic-bezier(.16,1,.3,1) both; }
/* When the real logo lockup is used, it already carries emblem + wordmark */
.slide.brand--logo { justify-content: center; }
.slide.brand--logo .brand-subline { margin-top: 0.5vh; }

.brand-headline {
  font-family: "Cinzel", "Cormorant Garamond", serif; font-weight: 700;
  font-size: 12.5vh; line-height: 1; letter-spacing: 0.06em; position: relative;
  background: var(--gold-grad); background-size: 220% 100%;
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: var(--gold-1);
  filter: drop-shadow(0 3px 30px rgba(0,0,0,0.55));
}
.brand-headline .ltr { display: inline-block; white-space: pre; opacity: 1; }
.slide.brand.active .brand-headline { animation: shimmer 7s linear infinite 1.6s; }
/* letter-by-letter reveal (per-letter delay set inline by app.js) */
.slide.brand.active .brand-headline .ltr {
  animation-name: letterIn; animation-duration: 760ms;
  animation-fill-mode: both; animation-timing-function: cubic-bezier(.16, 1, .3, 1);
}

.brand-rule {
  display: flex; align-items: center; justify-content: center; gap: 1.6vh;
  margin: 3.4vh 0 2vh; color: var(--gold-2);
}
.brand-rule .ln { width: 16vh; height: 1px; background: linear-gradient(90deg, transparent, var(--gold-2)); }
.brand-rule .ln.r { background: linear-gradient(90deg, var(--gold-2), transparent); }
.brand-rule .dia { font-size: 2vh; filter: drop-shadow(0 0 8px rgba(233,201,111,0.6)); }
.slide.brand.active .brand-rule { animation: rise 1000ms 1.15s both; }

.brand-subline {
  font-family: "Cormorant Garamond", serif; font-style: italic;
  font-size: 3.6vh; color: var(--gold-1); letter-spacing: 0.04em;
}
.slide.brand.active .brand-subline { animation: rise 1000ms 1.4s both; }

/* ===================== Bottom rate bar (far-readable) ============== */
#ratebar {
  position: fixed; left: 0; right: 0; bottom: 0; height: 14vh;
  display: flex; align-items: stretch; z-index: 30;
  background:
    linear-gradient(180deg, rgba(0,0,0,0) 0%, rgba(7,6,3,0.88) 26%, rgba(7,6,3,0.97) 100%);
  border-top: 2px solid transparent;
  border-image: var(--gold-grad) 1;
  box-shadow: 0 -1vh 4vh rgba(0,0,0,0.5);
}
/* Big fixed "most-asked" rate — legible clear across the room */
#rate-pod {
  flex: 0 0 auto; display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  padding: 0 3vw; min-width: 26vw;
  background: linear-gradient(180deg, rgba(233,201,111,0.16), rgba(184,144,47,0.04));
  border-right: 1px solid var(--gold-line);
  position: relative;
}
#rate-pod::after {
  content: ""; position: absolute; right: -1px; top: 18%; bottom: 18%; width: 2px;
  background: var(--gold-grad);
}
#rate-pod-karat {
  font-family: "Cinzel", serif; font-size: 2.1vh; font-weight: 600;
  letter-spacing: 0.28em; color: var(--gold-2); text-transform: uppercase;
}
#rate-pod-value {
  font-family: "Cormorant Garamond", serif; font-weight: 700; font-size: 8vh;
  line-height: 1; color: #fff; letter-spacing: 0.01em;
  text-shadow: 0 0 26px rgba(233,201,111,0.55), 0 2px 4px rgba(0,0,0,0.7);
}
#rate-pod-unit { font-size: 1.7vh; color: var(--muted); letter-spacing: 0.24em; text-transform: uppercase; margin-top: 0.4vh; }

#ticker-track { flex: 1 1 auto; overflow: hidden; white-space: nowrap; display: flex; align-items: center; }
#ticker-content {
  display: inline-block; white-space: nowrap; padding-left: 100%;
  font-size: 4vh; font-weight: 500; color: var(--gold-1); letter-spacing: 0.02em;
  animation: scroll-left 40s linear infinite;
  text-shadow: 0 2px 10px rgba(0,0,0,0.8);
}
#ticker-content .rate b { color: #fff; font-weight: 600; }
#ticker-content .rate { color: var(--gold-1); }
#ticker-content .msg { color: var(--gold-2); }
#ticker-content .sep { color: var(--gold-3); margin: 0 2vw; font-size: 3vh; vertical-align: middle; }

/* ===================== Keyframes ================================== */
@keyframes shimmer { 0% { background-position: 0% 0; } 100% { background-position: 220% 0; } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes rise { from { opacity: 0; transform: translateY(30px); } to { opacity: 1; transform: translateY(0); } }
@keyframes pulse { 0%,100% { opacity: 0.25; transform: scale(0.8); } 50% { opacity: 1; transform: scale(1); } }
@keyframes scroll-left { from { transform: translateX(0); } to { transform: translateX(-100%); } }
@keyframes grain { 0%{transform:translate(0,0)} 25%{transform:translate(-4%,3%)} 50%{transform:translate(3%,-4%)} 75%{transform:translate(-3%,-2%)} 100%{transform:translate(2%,4%)} }
@keyframes breathe { 0%,100% { transform: scale(0.94); opacity: 0.75; } 50% { transform: scale(1.06); opacity: 1; } }

@keyframes kenburns {
  from { transform: scale(var(--kb-s0,1.02)) translate(var(--kb-x0,0), var(--kb-y0,0)); }
  to   { transform: scale(var(--kb-s1,1.14)) translate(var(--kb-x1,0), var(--kb-y1,0)); }
}
@keyframes cinemaIn {
  from { opacity: 0; transform: translate(-50%, -50%) scale(0.92); }
  to   { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}
@keyframes emblemIn {
  from { opacity: 0; transform: scale(0.6) rotate(-12deg); filter: blur(6px); }
  to   { opacity: 1; transform: scale(1) rotate(0); filter: blur(0); }
}
@keyframes floaty {
  0%   { transform: translateY(0) scale(1); opacity: 0; }
  12%  { opacity: 0.9; }
  88%  { opacity: 0.7; }
  100% { transform: translateY(-92vh) scale(0.35); opacity: 0; }
}
@keyframes letterIn {
  from { opacity: 0; transform: translateY(0.5em) scale(0.8); filter: blur(4px); }
  to   { opacity: 1; transform: translateY(0) scale(1); filter: blur(0); }
}
