:root {
  --bg: #0a0a0d;
  --ink: #f5f3ee;
  --dim: rgba(245, 243, 238, 0.24);
  --soft: rgba(245, 243, 238, 0.5);
  --line: rgba(255, 255, 255, 0.1);
  --accent: #ffd166;
  --size: clamp(24px, min(7.4vw, 8.4vh), 60px);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: "Mona Sans Variable", "Mona Sans", system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}

.stage {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  place-items: center;
  padding: 14px 18px;
}

.kr { width: min(800px, 100%); display: grid; gap: clamp(12px, 3.4vh, 26px); }
.kr__head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.kr__song { font-size: clamp(13px, 1.5vw, 17px); font-weight: 640; letter-spacing: 0.01em; white-space: nowrap; }
.kr__song i { margin-left: 8px; font-style: normal; font-weight: 460; color: var(--soft); }
.kr__next { height: 20px; overflow: hidden; font-size: clamp(11px, 1.2vw, 14px); line-height: 20px; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; color: var(--accent); white-space: nowrap; }
.kr__next span { display: block; }

/* three rows are in view: the line just sung, the one being sung, the one that comes next */
.kr__lines { position: relative; height: calc(var(--size) * 1.18 * 3); overflow: hidden; -webkit-mask-image: linear-gradient(180deg, transparent, #000 30%, #000 70%, transparent); mask-image: linear-gradient(180deg, transparent, #000 30%, #000 70%, transparent); }
.kr__roll { position: absolute; left: 0; right: 0; top: 0; will-change: transform; }
.line { height: calc(var(--size) * 1.18); font-size: var(--size); line-height: 1.18; font-weight: 300; font-stretch: 112%; letter-spacing: -0.02em; white-space: nowrap; transform-origin: 0% 50%; }
.line__in { display: inline-block; transform-origin: 0% 50%; }
.word { position: relative; display: inline-block; color: var(--dim); font-variation-settings: "wght" var(--w, 300); }
.word + .word { margin-left: 0.26em; }
/* each word is written twice: the dim one underneath, the bright one on top, uncovered from the left */
.word b { position: absolute; left: 0; top: 0; font-weight: inherit; color: var(--ink); white-space: nowrap; clip-path: inset(-10% calc(100% - var(--p, 0%)) -10% 0); }
.line.is-now .word b { color: var(--ink); }
.word.is-sung b { clip-path: none; }
.word i { position: absolute; left: 0; right: 0; bottom: -0.02em; height: 2px; border-radius: 2px; background: var(--accent); transform: scaleX(var(--u, 0)); transform-origin: 0% 50%; opacity: var(--uo, 0); }

.kr__foot { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 10px; }
.kr__time { font-size: 11.500px; font-weight: 520; font-variant-numeric: tabular-nums; color: var(--soft); }
.kr__bar { height: 2px; border-radius: 2px; background: var(--line); overflow: hidden; }
.kr__bar i { display: block; height: 100%; background: var(--accent); transform: scaleX(0); transform-origin: 0% 50%; }
