/* Layar peresmian PATEN SERASI — dioptimalkan untuk proyektor/TV 16:9,
   tetap rapi di layar kecil. Palet = brand portal (biru/hijau/oranye). */
:root {
  --brand-300: #8ab8ff;
  --brand-400: #5591f8;
  --brand-500: #2f70ea;
  --brand-700: #1a45a3;
  --brand-900: #193562;
  --brand-950: #10224a;
  --leaf-300: #6fe0a0;
  --leaf-500: #1fae5c;
  --sun-400: #ffb23d;
  --navy: #0f172a;
  --ink: #f8fafc;
}

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

html, body { height: 100%; }

body {
  font-family: 'Plus Jakarta Sans Variable', 'Segoe UI', system-ui, sans-serif;
  background: var(--navy);
  color: var(--ink);
  overflow: hidden;
}

#stage { position: fixed; inset: 0; }

/* ---------- Latar ---------- */
.bg { position: absolute; inset: 0; }
.bg-standby {
  background:
    radial-gradient(1200px 700px at 50% 32%, rgba(47, 112, 234, 0.22), transparent 65%),
    radial-gradient(900px 600px at 82% 88%, rgba(31, 174, 92, 0.12), transparent 60%),
    linear-gradient(180deg, #0b1222 0%, var(--navy) 55%, #0b1730 100%);
}
.bg-final {
  opacity: 0;
  background:
    radial-gradient(1100px 650px at 50% 20%, rgba(85, 145, 248, 0.45), transparent 65%),
    radial-gradient(900px 600px at 12% 90%, rgba(31, 174, 92, 0.28), transparent 60%),
    radial-gradient(700px 500px at 90% 85%, rgba(245, 145, 30, 0.18), transparent 60%),
    linear-gradient(180deg, var(--brand-950) 0%, var(--brand-900) 55%, var(--brand-700) 130%);
}

canvas#particles, canvas#confetti {
  position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none;
}
canvas#confetti { z-index: 40; }

#flash {
  position: absolute; inset: 0; background: #fff; opacity: 0;
  pointer-events: none; z-index: 30;
}

/* ---------- Scene umum ---------- */
.scene {
  position: absolute; inset: 0; z-index: 10;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; padding: 4vmin 6vmin; gap: 0;
}
.scene[hidden] { display: none; }

/* ---------- Scene A: standby ---------- */
.eyebrow {
  font-size: clamp(14px, 1.6vw, 22px);
  letter-spacing: 0.55em; text-indent: 0.55em;
  text-transform: uppercase; font-weight: 600;
  color: var(--brand-300);
  margin-bottom: 3.2vmin;
}
.standby-logo {
  width: clamp(96px, 15vmin, 190px); height: auto;
  filter: grayscale(0.55) brightness(1.05);
  opacity: 0.85;
  animation: breathe 4.2s ease-in-out infinite;
  margin-bottom: 2.4vmin;
}
@keyframes breathe {
  0%, 100% { transform: scale(1); filter: grayscale(0.55) brightness(1.0) drop-shadow(0 0 0 rgba(85,145,248,0)); }
  50% { transform: scale(1.045); filter: grayscale(0.25) brightness(1.15) drop-shadow(0 0 26px rgba(85,145,248,0.55)); }
}
.standby-title {
  font-size: clamp(34px, 7vw, 96px);
  font-weight: 800; letter-spacing: 0.04em;
  background: linear-gradient(92deg, #dbe7ff 0%, var(--brand-300) 55%, var(--leaf-300) 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.standby-sub {
  margin-top: 1.6vmin;
  font-size: clamp(14px, 1.8vw, 24px);
  color: #c7d5ee; max-width: 62ch; line-height: 1.5;
}
.standby-org {
  margin-top: 0.8vmin;
  font-size: clamp(12px, 1.4vw, 19px);
  color: #8ba3c9; font-weight: 600;
}
.standby-clock {
  margin-top: 4.6vmin;
  display: flex; align-items: center; gap: 1.4em;
  font-size: clamp(14px, 1.7vw, 23px);
  color: #dbe7ff; font-weight: 600;
  padding: 0.7em 1.6em;
  border: 1px solid rgba(138, 184, 255, 0.28);
  border-radius: 999px;
  background: rgba(16, 34, 74, 0.45);
  font-variant-numeric: tabular-nums;
}
.clock-sep { width: 1px; height: 1.2em; background: rgba(138, 184, 255, 0.35); }
.standby-wait {
  margin-top: 2.6vmin;
  display: flex; align-items: center; gap: 0.6em;
  font-size: clamp(12px, 1.4vw, 18px);
  color: #8ba3c9; letter-spacing: 0.12em; text-transform: uppercase; font-weight: 600;
}
.wait-dot {
  width: 0.62em; height: 0.62em; border-radius: 50%;
  background: var(--sun-400);
  animation: waitPulse 1.6s ease-in-out infinite;
}
@keyframes waitPulse {
  0%, 100% { opacity: 0.35; transform: scale(0.85); box-shadow: 0 0 0 0 rgba(255, 178, 61, 0.5); }
  50% { opacity: 1; transform: scale(1.05); box-shadow: 0 0 0 8px rgba(255, 178, 61, 0); }
}

/* ---------- Countdown ---------- */
#countdown {
  position: absolute; inset: 0; z-index: 20;
  display: none; align-items: center; justify-content: center;
}
#count-num {
  font-size: clamp(140px, 34vmin, 420px);
  font-weight: 800; line-height: 1;
  background: linear-gradient(180deg, #ffffff 20%, var(--brand-300) 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  text-shadow: 0 0 90px rgba(85, 145, 248, 0.35);
}
.count-ring {
  position: absolute;
  width: clamp(240px, 56vmin, 700px); height: clamp(240px, 56vmin, 700px);
  border-radius: 50%;
  border: 2px solid rgba(138, 184, 255, 0.35);
}

/* ---------- Scene C: final ---------- */
.final-logo {
  width: clamp(110px, 18vmin, 230px); height: auto;
  filter: drop-shadow(0 14px 44px rgba(6, 16, 40, 0.55));
  margin-bottom: 2.2vmin;
}
.final-title {
  font-size: clamp(40px, 8.4vw, 118px);
  font-weight: 800; letter-spacing: 0.03em;
  color: #fff;
  text-shadow: 0 8px 40px rgba(6, 16, 40, 0.45);
}
.final-title .ch { display: inline-block; white-space: pre; }
.final-badge {
  margin-top: 2vmin;
  display: inline-flex; align-items: center; gap: 0.55em;
  font-size: clamp(16px, 2.1vw, 30px);
  font-weight: 700; letter-spacing: 0.16em; text-transform: uppercase;
  color: #eafff3;
  padding: 0.5em 1.4em; border-radius: 999px;
  background: linear-gradient(92deg, rgba(31, 174, 92, 0.92), rgba(18, 128, 71, 0.92));
  box-shadow: 0 10px 34px rgba(15, 106, 60, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.25);
}
.final-badge svg { color: #d1fadf; }
.final-sub {
  margin-top: 2.4vmin;
  font-size: clamp(14px, 1.8vw, 23px);
  color: #dbe7ff; line-height: 1.55; max-width: 68ch;
}
.final-date {
  margin-top: 1.2vmin;
  font-size: clamp(13px, 1.5vw, 20px);
  color: var(--sun-400); font-weight: 700; letter-spacing: 0.06em;
}
.final-cta {
  margin-top: 3.4vmin;
  display: inline-flex; align-items: center; gap: 0.6em;
  font-size: clamp(16px, 2vw, 27px); font-weight: 700;
  color: var(--brand-950); text-decoration: none;
  background: linear-gradient(180deg, #ffffff, #dbe7ff);
  padding: 0.72em 1.8em; border-radius: 999px;
  box-shadow: 0 14px 40px rgba(6, 16, 40, 0.4);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  cursor: pointer;
}
.final-cta:hover { transform: translateY(-2px); box-shadow: 0 18px 48px rgba(6, 16, 40, 0.5); }
.final-cta:focus-visible { outline: 4px solid var(--sun-400); outline-offset: 4px; }
.final-url {
  margin-top: 1.4vmin;
  font-size: clamp(12px, 1.3vw, 17px);
  color: #a9c1e8; letter-spacing: 0.08em;
}

/* ---------- Tombol suara ---------- */
#sound-toggle {
  position: absolute; right: 22px; bottom: 20px; z-index: 60;
  display: inline-flex; align-items: center; gap: 10px;
  min-height: 48px; padding: 10px 18px;
  border-radius: 999px; cursor: pointer;
  font-family: inherit; font-size: 14px; font-weight: 700; letter-spacing: 0.06em;
  color: #dbe7ff;
  background: rgba(16, 34, 74, 0.55);
  border: 1px solid rgba(138, 184, 255, 0.35);
  backdrop-filter: blur(6px);
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}
#sound-toggle:hover { background: rgba(26, 69, 163, 0.6); }
#sound-toggle:focus-visible { outline: 3px solid var(--sun-400); outline-offset: 3px; }
#sound-toggle.on { color: #d1fadf; border-color: rgba(111, 224, 160, 0.5); }

@media (prefers-reduced-motion: reduce) {
  .standby-logo, .wait-dot { animation: none; }
}
