:root {
  --blue: #000cff;
  --ink: #0b0b12;
  --night: #07090e;
  --paper: #fafae1;
  --warm: #ffb86b;
  --lime: #d4ff3a;
  --coral: #ff5a4e;
  --lilac: #ece8f4;
  --plum: #4b4470;
  --sun: #ffd23f;
  --sans: "Source Sans 3", "Source Sans Pro", system-ui, sans-serif;
  --serif: "Libre Baskerville", Georgia, serif;
  --dur: 8s;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; background: var(--night); overflow: hidden; }
body { font-family: var(--sans); color: #fff; -webkit-font-smoothing: antialiased; }
a { color: inherit; }

#backdrop {
  position: fixed; inset: -10%;
  background: var(--card-bg, var(--night));
  filter: blur(60px) saturate(1.2) brightness(.55);
  transition: background .8s ease;
}

#stage {
  position: fixed; inset: 0; margin: auto;
  width: 100vw; height: 100dvh;
  overflow: hidden;
  container-type: size;
  background: var(--card-bg, var(--night));
  transition: background .6s ease;
  user-select: none; -webkit-user-select: none;
  touch-action: manipulation;
}
@media (min-aspect-ratio: 3/4) {
  #stage {
    height: min(94dvh, 1000px);
    width: calc(min(94dvh, 1000px) * 9 / 16);
    border-radius: 24px;
    box-shadow: 0 40px 120px rgba(0,0,0,.55), 0 0 0 1px rgba(255,255,255,.06);
  }
}

/* progress bars */
#bars {
  position: absolute; z-index: 20; top: 2.4cqh; left: 4cqw; right: 4cqw;
  display: flex; gap: 1cqw;
}
#bars span {
  flex: 1; height: 3px; border-radius: 2px; overflow: hidden;
  background: color-mix(in srgb, var(--card-fg, #fff) 28%, transparent);
}
#bars span i {
  display: block; height: 100%; width: 0; background: var(--card-fg, #fff);
}
#bars span.done i { width: 100%; }
#bars span.now i { animation: fill var(--dur) linear forwards; }
#stage.paused #bars span.now i { animation-play-state: paused; }
@keyframes fill { to { width: 100%; } }

#controls { position: absolute; z-index: 21; top: 4.4cqh; right: 3cqw; display: flex; gap: 1cqw; }
#controls button {
  font: 700 3.2cqw/1 var(--sans); color: var(--card-fg, #fff);
  background: none; border: 0; padding: 1.5cqw 2cqw; cursor: pointer; opacity: .8;
  border-radius: 99px;
}
#controls button:hover, #controls button:focus-visible { opacity: 1; background: color-mix(in srgb, var(--card-fg, #fff) 14%, transparent); }

.nav {
  position: absolute; z-index: 10; top: 10cqh; bottom: 0;
  background: none; border: 0; cursor: pointer;
}
.nav.prev { left: 0; width: 30%; cursor: w-resize; }
.nav.next { right: 0; width: 70%; cursor: e-resize; }
.nav:focus-visible { outline: 3px solid var(--card-fg, #fff); outline-offset: -6px; border-radius: 24px; }

/* cards */
.card {
  position: absolute; inset: 0;
  padding: 13cqh 7cqw 8cqh;
  display: flex; flex-direction: column;
  color: var(--fg, #fff);
  visibility: hidden; opacity: 0;
  transition: opacity .45s ease, visibility 0s linear .45s;
}
.card.active { visibility: visible; opacity: 1; transition: opacity .45s ease; }
.card > * { position: relative; z-index: 2; }
.card a, .card button.link { position: relative; z-index: 15; }

.kicker {
  font: 700 3.4cqw/1.2 var(--sans); letter-spacing: .14em; text-transform: uppercase;
  opacity: .85; margin-bottom: 2.5cqh;
}
.big {
  font: 900 21cqw/.86 var(--sans); letter-spacing: -.04em;
  font-variant-numeric: tabular-nums;
}
.huge { font: 900 34cqw/.8 var(--sans); letter-spacing: -.05em; }
h2 { font: 900 9.6cqw/.98 var(--sans); letter-spacing: -.025em; }
h2 em, .serif { font-family: var(--serif); font-weight: 400; font-style: italic; letter-spacing: -.01em; }
p.lede { font: 400 4.3cqw/1.42 var(--serif); margin-top: 2.6cqh; max-width: 82cqw; }
p.small { font: 600 3.3cqw/1.4 var(--sans); opacity: .8; margin-top: 1.6cqh; }
.foot { margin-top: auto; font: 600 3.1cqw/1.35 var(--sans); opacity: .75; }
.foot a { text-decoration-thickness: 1px; text-underline-offset: 3px; }
.pill {
  display: inline-block; font: 700 3.3cqw/1 var(--sans);
  padding: 1.3cqh 3.6cqw; border-radius: 99px;
  background: var(--fg, #fff); color: var(--bg, #000); text-decoration: none;
}

/* reveal animation */
.r { opacity: 0; transform: translateY(3cqh); }
.card.active .r {
  animation: rise .7s cubic-bezier(.2,.8,.2,1) forwards;
  animation-delay: calc(var(--i, 0) * 140ms + 150ms);
}
@keyframes rise { to { opacity: 1; transform: none; } }
.card.active .pop { animation: pop .8s cubic-bezier(.2,1.4,.3,1) forwards; animation-delay: calc(var(--i, 0) * 140ms + 150ms); }
@keyframes pop { from { opacity: 0; transform: scale(.6) rotate(-4deg); } to { opacity: 1; transform: none; } }

/* intro */
.c-intro { justify-content: flex-end; padding-bottom: 12cqh; }
.c-intro canvas, .c-time canvas, .c-quest .rain { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 0; }
.c-intro .name { font: 700 3.4cqw/1 var(--sans); letter-spacing: .3em; text-transform: uppercase; opacity: .9; }
.c-intro .year { font: 900 40cqw/.78 var(--sans); letter-spacing: -.06em; margin-top: 3cqh;
  background: linear-gradient(100deg, #fff 30%, #9db4ff 60%, var(--warm)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.c-intro .wrapped { font: 400 italic 15cqw/1 var(--serif); margin-top: -1cqh; }
.c-intro .tap { margin-top: 5cqh; font: 600 3.4cqw/1.4 var(--sans); opacity: .8; }

/* month bars */
.months { display: flex; align-items: flex-end; gap: 1.4cqw; height: 26cqh; margin-top: 5cqh; }
.months div { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; gap: .8cqh; }
.months b { display: block; width: 100%; height: 0; background: var(--fg); border-radius: 1.2cqw 1.2cqw 0 0; transition: height 1s cubic-bezier(.2,.8,.2,1); }
.months b.peak { background: var(--lime); }
.months small { font: 700 2.6cqw/1 var(--sans); opacity: .75; }
.months em { font: 900 3cqw/1 var(--sans); font-style: normal; opacity: 0; transition: opacity .4s 1s; }
.card.active .months em { opacity: 1; }

/* books */
.books { display: flex; align-items: flex-end; gap: 2cqw; height: 30cqh; margin: 4cqh 0 2cqh; }
.book {
  width: 21cqw; height: 100%; border-radius: 1.4cqw 3cqw 3cqw 1.4cqw;
  background: var(--ink); color: var(--lime);
  display: flex; align-items: center; justify-content: center;
  writing-mode: vertical-rl;
  font: 400 italic 4cqw/1 var(--serif);
  box-shadow: inset -1.4cqw 0 0 rgba(255,255,255,.12);
  transform-origin: bottom; scale: 1 0; transition: scale .8s cubic-bezier(.2,1.2,.3,1);
}
.card.active .book { scale: 1 1; }
.book:nth-child(2) { transition-delay: .25s; background: #1d1d8c; }
.book:nth-child(3) { transition-delay: .5s; background: var(--blue); }

/* ranked lists */
.rank { list-style: none; margin-top: 4cqh; display: grid; gap: 2.3cqh; }
.rank li { display: grid; grid-template-columns: 9cqw 1fr auto; align-items: center; gap: 3cqw; }
.rank .n { font: 900 7cqw/1 var(--sans); opacity: .55; }
.rank .w { font: 900 8.4cqw/1 var(--sans); letter-spacing: -.02em; }
.rank .c { font: 700 3.8cqw/1 var(--sans); opacity: .8; font-variant-numeric: tabular-nums; }
.rank.avatars li { grid-template-columns: 7cqw 13cqw 1fr auto; }
.disc {
  width: 13cqw; height: 13cqw; border-radius: 50%;
  display: grid; place-items: center; font: 900 5cqw/1 var(--sans); color: #fff;
  background: radial-gradient(circle, var(--paper) 0 9%, #111 10% 13%, var(--dc, #222) 14% 100%);
  box-shadow: 0 0 0 .5cqw rgba(0,0,0,.25);
}
.card.active .disc { animation: spin 3.2s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* genre bars */
.genres { margin-top: 4cqh; display: grid; gap: 2.2cqh; }
.genres .row span { display: block; font: 700 3.8cqw/1.1 var(--sans); margin-bottom: .9cqh; }
.genres .row i { display: block; height: 4.2cqh; border-radius: 1cqw; background: var(--fg); width: 0; transition: width 1.1s cubic-bezier(.2,.8,.2,1); position: relative; }
.genres .row i::after { content: attr(data-n); position: absolute; right: -9cqw; top: 50%; transform: translateY(-50%); font: 900 4cqw/1 var(--sans); font-style: normal; }
.genres .row:first-child i { background: var(--blue); }

/* week x hour dots */
.week { margin-top: 4.5cqh; display: grid; grid-template-columns: 8cqw repeat(15, 1fr); gap: .9cqw; align-items: center; }
.week .lbl { font: 700 2.7cqw/1 var(--sans); opacity: .7; }
.week .dot { aspect-ratio: 1; border-radius: 50%; background: rgba(255,255,255,.08); transform: scale(.3); transition: transform .5s cubic-bezier(.2,1.5,.3,1), background .5s; }
.card.active .week .dot { transform: scale(1); }
.week .hr { font: 700 2.4cqw/1 var(--sans); opacity: .6; text-align: center; }

/* questions */
.c-quest .rain span {
  position: absolute; top: -12cqh; font: 900 var(--s, 10cqw)/1 var(--serif); font-style: italic;
  color: var(--ink); opacity: var(--o, .15);
}
.card.active .rain span { animation: fall var(--t, 6s) linear infinite; animation-delay: var(--d, 0s); }
@keyframes fall { to { transform: translateY(125cqh) rotate(var(--r, 30deg)); } }

/* nokia lcd */
.c-nokia { font-family: "Courier New", ui-monospace, monospace; }
.lcd {
  margin-top: 4cqh; background: #9bbc0f; color: #0f380f; border-radius: 3cqw; padding: 4cqh 5cqw;
  box-shadow: inset 0 0 0 1.4cqw #8bac0f, inset 0 0 4cqw rgba(15,56,15,.35);
  font: 700 5.2cqw/1.35 ui-monospace, "Courier New", monospace;
}
.lcd .snake { display: flex; gap: .6cqw; margin-top: 2cqh; height: 2.6cqw; }
.lcd .snake i { width: 2.6cqw; background: #0f380f; opacity: 0; }
.card.active .lcd .snake i { animation: seg .1s steps(1) forwards; animation-delay: calc(var(--k) * 90ms + .6s); }
@keyframes seg { to { opacity: 1; } }

/* postcards */
.c-postcards { background: linear-gradient(180deg, #f2b06b 0%, #e8865a 46%, #2f6e8f 46.2%, #1f4c68 100%); }
.stamps { position: relative; height: 34cqh; margin: 3cqh 0 2cqh; }
.stamps img {
  position: absolute; width: 30cqw; top: 2cqh; left: 50%;
  filter: drop-shadow(0 1.4cqw 2cqw rgba(0,0,0,.35));
  opacity: 0; transform: translate(-50%, 8cqh) rotate(0);
  transition: transform .9s cubic-bezier(.2,1.2,.3,1), opacity .5s;
}
.card.active .stamps img { opacity: 1; transform: translate(calc(-50% + var(--x)), 0) rotate(var(--rot)); transition-delay: var(--dl); }
.facts { display: grid; grid-template-columns: 1fr 1fr; gap: 2cqh 4cqw; margin-top: 1cqh; }
.facts div b { display: block; font: 900 9cqw/1 var(--sans); letter-spacing: -.03em; }
.facts div span { font: 600 3.2cqw/1.2 var(--sans); opacity: .9; }
.eq { display: flex; gap: .9cqw; align-items: flex-end; height: 5cqh; margin-top: 2cqh; }
.eq i { width: 1.6cqw; background: var(--paper); border-radius: 1cqw; height: 30%; }
.card.active .eq i { animation: eq .9s ease-in-out infinite alternate; animation-delay: calc(var(--k) * -137ms); }
@keyframes eq { from { height: 15%; } to { height: 100%; } }

/* calendar strip */
.cal { margin-top: 4cqh; display: grid; grid-template-columns: 5cqw repeat(31, 1fr); gap: .45cqw; align-items: center; }
.cal .m { font: 700 2.5cqw/1 var(--sans); opacity: .65; }
.cal i { aspect-ratio: 1; border-radius: 22%; background: rgba(255,255,255,.07); opacity: 0; transition: opacity .3s; }
.card.active .cal i { opacity: 1; transition-delay: calc(var(--k) * 3ms); }
.cal i.hot { outline: .6cqw solid var(--warm); outline-offset: .3cqw; }

/* passing time */
.c-time .copy { margin-top: auto; background: color-mix(in srgb, var(--lilac) 86%, transparent); border-radius: 4cqw; padding: 3cqh 5cqw; backdrop-filter: blur(6px); }
.c-time .copy h2 { font-size: 7.6cqw; }

/* builds */
.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 3cqw; margin-top: 4cqh; }
.tile {
  border-radius: 4cqw; padding: 3cqh 4cqw; min-height: 19cqh;
  display: flex; flex-direction: column; justify-content: space-between; text-decoration: none;
  background: var(--tb); color: var(--tf);
}
.tile b { font: 900 5.4cqw/1 var(--sans); letter-spacing: -.02em; }
.tile span { font: 600 3cqw/1.3 var(--sans); opacity: .85; }
.tile.wide { grid-column: span 2; min-height: 13cqh; }
.tile .glyph { font: 400 7cqw/1 var(--serif); }

/* clock chart */
.radial { width: 82cqw; height: 82cqw; margin: 3cqh auto 0; display: block; overflow: visible; }
.radial .bar { transform-box: fill-box; transform-origin: center bottom; }
.legend { display: flex; gap: 5cqw; justify-content: center; margin-top: 2cqh; font: 700 3.3cqw/1 var(--sans); }
.legend i { display: inline-block; width: 3cqw; height: 3cqw; border-radius: 50%; vertical-align: -.4cqw; margin-right: 1.5cqw; }

/* persona */
.code { display: grid; grid-template-columns: repeat(4, 1fr); gap: 2.4cqw; margin-top: 4cqh; }
.code div { border-radius: 3cqw; padding: 2.2cqh 0 2cqh; text-align: center; background: var(--tb); color: var(--tf); }
.code b { display: block; font: 900 13cqw/1 var(--sans); }
.code span { display: block; font: 700 2.6cqw/1.15 var(--sans); margin-top: 1cqh; padding: 0 1cqw; }

/* summary */
.c-summary { padding-top: 11cqh; }
.sum { margin-top: 3cqh; display: grid; grid-template-columns: 1fr 1fr; gap: 3.5cqh 5cqw; }
.sum h3 { font: 700 3cqw/1 var(--sans); letter-spacing: .12em; text-transform: uppercase; opacity: .75; margin-bottom: 1.4cqh; }
.sum ol { list-style: none; counter-reset: s; }
.sum li { counter-increment: s; font: 900 4.6cqw/1.4 var(--sans); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sum li::before { content: counter(s) " "; opacity: .5; }
.sum .stat { font: 900 9cqw/1 var(--sans); letter-spacing: -.03em; }
.actions { display: flex; gap: 2.5cqw; flex-wrap: wrap; margin-top: 4cqh; }
.actions .pill { border: 0; cursor: pointer; }
.actions .pill.ghost { background: transparent; color: var(--fg); box-shadow: inset 0 0 0 2px var(--fg); }

@media (prefers-reduced-motion: reduce) {
  .r, .card.active .r, .card.active .pop { animation: none; opacity: 1; transform: none; }
  .card.active .disc, .card.active .eq i, .card.active .rain span { animation: none; }
  .book, .stamps img, .months b, .genres .row i, .week .dot { transition: none !important; }
  .rain { display: none; }
}

/* ?still=1: every animation at its end state (for screenshots and checks) */
.still *, .still *::before, .still *::after { transition: none !important; animation-duration: 1ms !important; animation-delay: 0s !important; animation-iteration-count: 1 !important; }
.still #bars span.now i { animation: none; width: 40%; }

/* interactive bits sit above the tap zones */
.card > :has(a, button), .card .tiles { z-index: 15; }

/* section label */
#section {
  position: absolute; z-index: 21; top: 5.2cqh; left: 4.5cqw;
  font: 700 2.9cqw/1 var(--sans); letter-spacing: .14em; text-transform: uppercase;
  color: var(--card-fg, #fff); opacity: .7; transition: opacity .4s;
}
#section b { display: inline-grid; place-items: center; width: 4.6cqw; height: 4.6cqw; border-radius: 50%; margin-right: 1.6cqw;
  background: var(--card-fg, #fff); color: var(--card-bg, #000); font-size: 2.8cqw; }
#section:empty { opacity: 0; }
#mute.hint { animation: hint 1.6s ease-in-out infinite; }
@keyframes hint { 50% { background: color-mix(in srgb, var(--card-fg, #fff) 22%, transparent); } }
#mute.off { opacity: .45; text-decoration: line-through; }

/* tracklist */
.c-tracks .vinyl {
  position: absolute; z-index: 0; width: 120cqw; height: 120cqw; right: -84cqw; top: 22cqh; opacity: .75; border-radius: 50%;
  background: repeating-radial-gradient(circle, #141414 0 .6cqw, #1d1d1d .6cqw 1.1cqw);
  box-shadow: 0 0 0 1px rgba(255,255,255,.05);
}
.c-tracks .vinyl::after { content: ""; position: absolute; inset: 36%; border-radius: 50%;
  background: radial-gradient(circle, #07090e 0 6%, var(--blue) 7% 100%); }
.card.active .vinyl { animation: spin 6s linear infinite; }
.tracks { list-style: none; margin-top: 5cqh; display: grid; gap: 3.4cqh; }
.tracks li { display: grid; grid-template-columns: 12cqw 1fr; align-items: start; }
.tracks .side { font: 900 9cqw/1 var(--sans); color: var(--lime); }
.tracks li:nth-child(2) .side { color: var(--warm); }
.tracks li:nth-child(3) .side { color: #8fa6ff; }
.tracks li:nth-child(4) .side { color: var(--coral); font-size: 6cqw; }
.tracks b { display: block; font: 900 7cqw/1.05 var(--sans); }
.tracks span { display: block; font: 400 3.7cqw/1.35 var(--serif); opacity: .8; margin-top: .6cqh; }
.c-tracks .listen { font: 600 3.2cqw/1.4 var(--sans); opacity: .7; }

.c-intro .start { display: flex; align-items: center; gap: 4cqw; margin-top: 4cqh; }
.c-intro .start .pill { font-size: 4.4cqw; padding: 2cqh 6cqw; white-space: nowrap; flex: none; background: #fff; color: #07090e; border: 0; cursor: pointer;
  box-shadow: 0 0 0 0 rgba(255,255,255,.5); animation: ping 2.2s ease-out infinite; }
.c-intro .start span { font: 600 3.1cqw/1.35 var(--sans); opacity: .7; }
@keyframes ping { 70% { box-shadow: 0 0 0 4cqw rgba(255,255,255,0); } 100% { box-shadow: 0 0 0 0 rgba(255,255,255,0); } }

/* inside the hortal.com takeover: transparent page, so the blurred blog frames the card */
.embedded, .embedded body { background: transparent; }
.embedded #backdrop { display: none; }

.c-intro .howto { margin-top: 3cqh; font: 600 3.1cqw/1.4 var(--sans); opacity: .65; }
#soundhint {
  align-self: center; font: 700 3cqw/1 var(--sans); color: var(--card-bg, #07090e);
  background: var(--card-fg, #fff); padding: 1.4cqw 2.6cqw; border-radius: 99px;
  animation: hint2 1.6s ease-in-out infinite; pointer-events: none;
}
#soundhint[hidden] { display: none; }
@keyframes hint2 { 50% { opacity: .55; } }
