:root {
  --cream: #f4efe6;
  --ivory: #faf7f1;
  --navy: #0f172a;
  --gold: #c9a96a;
  --gold-deep: #a8874a;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: var(--cream);
  color: var(--navy);
  font-family: Manrope, "Segoe UI", sans-serif;
}

.splash {
  position: relative;
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 28px 20px calc(28px + env(safe-area-inset-bottom, 0px));
}

.splash.is-done {
  animation: splashOut 0.9s ease forwards;
}

.splash-bg {
  position: absolute;
  inset: -8%;
  background:
    linear-gradient(180deg, rgba(244, 239, 230, 0.42) 0%, rgba(250, 247, 241, 0.55) 48%, rgba(244, 239, 230, 0.78) 100%),
    url("../assets/justice-sculpture-bg.png") 20% 10% / cover no-repeat;
  animation: ken 8s ease-out forwards;
}

.gold-veil {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 50% 28%, rgba(201, 169, 106, 0.22), transparent 46%),
    radial-gradient(ellipse at 50% 100%, rgba(250, 247, 241, 0.7), transparent 42%);
  pointer-events: none;
}

.scan {
  position: absolute;
  left: 8%;
  right: 8%;
  height: 1px;
  top: -10%;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
  box-shadow: 0 0 18px rgba(201, 169, 106, 0.65);
  animation: scan 4.6s cubic-bezier(0.22, 1, 0.36, 1) infinite;
  pointer-events: none;
}

.dust i {
  position: absolute;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--gold);
  opacity: 0;
  animation: dust 4.8s ease-in-out infinite;
}

.dust i:nth-child(1) { left: 18%; top: 22%; animation-delay: 0.2s; }
.dust i:nth-child(2) { left: 72%; top: 18%; animation-delay: 0.8s; }
.dust i:nth-child(3) { left: 28%; top: 68%; animation-delay: 1.4s; }
.dust i:nth-child(4) { left: 80%; top: 62%; animation-delay: 0.4s; }
.dust i:nth-child(5) { left: 12%; top: 48%; animation-delay: 1.8s; }
.dust i:nth-child(6) { left: 88%; top: 36%; animation-delay: 1.1s; }

.stage {
  position: relative;
  z-index: 2;
  width: min(100%, 420px);
  text-align: center;
}

.scales {
  width: 148px;
  height: 148px;
  margin: 0 auto 8px;
  filter: drop-shadow(0 10px 24px rgba(168, 135, 74, 0.28));
}

.draw {
  stroke-dasharray: 360;
  stroke-dashoffset: 360;
  animation: draw 2.2s ease forwards;
}

.beam-group {
  transform-origin: 100px 56px;
  animation: balance 3.6s ease-in-out 0.6s infinite;
}

.kicker {
  margin: 4px 0 10px;
  color: var(--gold-deep);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  opacity: 0;
  animation: rise 0.9s ease 0.35s forwards;
}

h1 {
  margin: 0 0 28px;
  font-family: "Cormorant Garamond", Georgia, serif;
  font-weight: 600;
  line-height: 0.92;
}

.word {
  display: block;
  overflow: hidden;
}

.word-1 {
  font-size: clamp(3.4rem, 16vw, 4.6rem);
  letter-spacing: 0.08em;
  text-shadow: 0 8px 30px rgba(250, 247, 241, 0.65);
  animation: clip 1.1s cubic-bezier(0.16, 1, 0.3, 1) 0.2s both;
}

.word-2 {
  margin-top: 4px;
  font-size: clamp(1.05rem, 5.2vw, 1.35rem);
  letter-spacing: 0.34em;
  color: #3f4a5c;
  animation: clip 1.2s cubic-bezier(0.16, 1, 0.3, 1) 0.55s both;
}

.meter {
  position: relative;
  width: 132px;
  height: 132px;
  margin: 0 auto 18px;
}

.ring {
  width: 132px;
  height: 132px;
  transform: rotate(-90deg);
}

.ring-track,
.ring-bar {
  fill: none;
  stroke-width: 1.6;
}

.ring-track {
  stroke: rgba(201, 169, 106, 0.22);
}

.ring-bar {
  stroke: var(--gold);
  stroke-linecap: round;
  stroke-dasharray: 326.7;
  stroke-dashoffset: 326.7;
  filter: drop-shadow(0 0 6px rgba(201, 169, 106, 0.55));
  transition: stroke-dashoffset 80ms linear;
}

.pct {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  text-align: center;
}

.pct strong {
  font-family: Manrope, "Segoe UI", sans-serif;
  font-size: 2.05rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.04em;
  line-height: 1;
}

.pct em {
  font-style: normal;
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  color: var(--gold-deep);
}

.status {
  min-height: 1.4em;
  margin: 0 0 16px;
  color: #64748b;
  font-size: 0.86rem;
  letter-spacing: 0.04em;
}

.bar {
  width: 100%;
  height: 1px;
  background: rgba(201, 169, 106, 0.22);
  overflow: hidden;
}

.bar i {
  display: block;
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, transparent, var(--gold), var(--gold-deep));
  box-shadow: 0 0 10px rgba(201, 169, 106, 0.8);
}

@keyframes ken {
  from { transform: scale(1.12); }
  to { transform: scale(1); }
}

@keyframes scan {
  from { top: -8%; opacity: 0; }
  12% { opacity: 1; }
  to { top: 108%; opacity: 0; }
}

@keyframes dust {
  0%, 100% { opacity: 0; transform: translateY(12px); }
  40% { opacity: 0.9; }
  70% { opacity: 0.3; transform: translateY(-18px); }
}

@keyframes draw {
  to { stroke-dashoffset: 0; }
}

@keyframes balance {
  0%, 100% { transform: rotate(-7deg); }
  50% { transform: rotate(6deg); }
}

@keyframes rise {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

@keyframes clip {
  from { clip-path: inset(0 0 100% 0); transform: translateY(18px); }
  to { clip-path: inset(0 0 0 0); transform: none; }
}

@keyframes splashOut {
  to {
    opacity: 0;
    transform: scale(1.04);
    filter: blur(8px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .splash-bg,
  .scan,
  .dust i,
  .beam-group,
  .draw,
  .word-1,
  .word-2,
  .kicker {
    animation: none;
  }
  .draw { stroke-dashoffset: 0; }
  .word-1,
  .word-2,
  .kicker { opacity: 1; clip-path: none; transform: none; }
}
