:root {
  --paper: #101217;
  --ink: #dbceb0;
  --f-sans: 'Unbounded', system-ui, sans-serif;
  --f-serif: 'Cormorant Garamond', 'Times New Roman', serif;
  --pad: clamp(16px, 2.2vw, 40px);
  --fs-label: clamp(10px, .7vw, 12px);
  --ease: cubic-bezier(.22, 1, .36, 1);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { background: var(--paper); color: var(--ink); -webkit-font-smoothing: antialiased; }
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
body { background: var(--paper); color: var(--ink); font-family: var(--f-sans); overflow-x: clip; }
body.is-loading { overflow: hidden; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
::selection { background: var(--ink); color: var(--paper); }

/* ---------------------------------------------------------------- stage */
.stage { position: fixed; inset: 0; width: 100vw; height: 100vh; height: 100lvh; display: block; z-index: 0; }
main { position: relative; z-index: 1; }
.ch { position: relative; }
#end { position: absolute; bottom: 0; left: 0; }

/* ---------------------------------------------------------------- captions */
.beat {
  position: fixed; left: 50%; bottom: 13vh; z-index: 5;
  width: max-content; max-width: min(24em, 86vw); text-align: center;
  font-family: var(--f-serif); font-weight: 500; font-size: clamp(24px, 2.7vw, 50px); line-height: 1.08;
  letter-spacing: -.005em; text-wrap: balance;
  opacity: 0; visibility: hidden; transform: translate(-50%, 14px);
  pointer-events: none;
}
.beat--top { bottom: auto; top: 13vh; }
.beat.on-light, .finale.on-light { color: var(--paper); }
.finale.on-light .finale__btn { background: var(--paper); color: var(--ink); }
.beat--title { bottom: auto; top: 33vh; font-style: italic; font-size: clamp(20px, 1.9vw, 34px); }

/* ---------------------------------------------------------------- chrome */
.top { position: fixed; top: 0; left: 0; right: 0; z-index: 10; display: flex; justify-content: space-between; align-items: center; padding: calc(var(--pad) * .7) var(--pad); font-size: var(--fs-label); text-transform: uppercase; letter-spacing: .1em; transition: opacity .8s, transform .8s var(--ease); }
body.is-loading .top { opacity: 0; transform: translateY(-100%); }
.top__logo { font-weight: 900; font-size: clamp(13px, 1.1vw, 18px); letter-spacing: .08em; transition: opacity .6s; }
body.at-start .top__logo { opacity: 0; }
.top__btn { background: var(--ink); color: var(--paper); border-radius: 99px; padding: .95em 1.6em; transition: opacity .3s; }
.top__btn:hover { opacity: .85; }

.rail { position: fixed; right: calc(var(--pad) * .9); top: 50%; transform: translateY(-50%); z-index: 10; display: flex; flex-direction: column; gap: 4px; transition: opacity .8s; }
body.is-loading .rail { opacity: 0; }
.rail button { display: flex; align-items: center; justify-content: flex-end; gap: 10px; height: 16px; padding-left: 12px; }
.rail i { display: block; width: 14px; height: 1px; background: var(--ink); opacity: .45; transition: width .5s var(--ease), opacity .3s; }
.rail span { order: -1; font-size: var(--fs-label); text-transform: uppercase; letter-spacing: .1em; white-space: nowrap; opacity: 0; transform: translateX(6px); transition: opacity .3s, transform .4s var(--ease); background: var(--paper); padding: 2px 6px; }
.rail button.is-on i { width: 30px; opacity: 1; }
.rail button:hover span, .rail button:focus-visible span { opacity: 1; transform: none; }
.rail button:hover i { opacity: 1; }

/* ---------------------------------------------------------------- finale */
.finale { position: fixed; left: 0; right: 0; top: 32vh; z-index: 6; display: flex; justify-content: center; opacity: 0; visibility: hidden; pointer-events: none; }
.finale__inner { display: flex; flex-direction: column; align-items: center; gap: 18px; text-align: center; width: min(28em, 86vw); }
.finale__line { font-family: var(--f-serif); font-weight: 500; font-size: clamp(22px, 2.2vw, 40px); line-height: 1.1; text-wrap: balance; }
.finale__meta { font-size: var(--fs-label); text-transform: uppercase; letter-spacing: .12em; opacity: .8; }
.finale__btn { margin-top: 6px; background: var(--ink); color: var(--paper); border-radius: 99px; padding: 1.1em 2.2em; font-size: var(--fs-label); text-transform: uppercase; letter-spacing: .1em; transition: opacity .3s; }
.finale__btn:hover { opacity: .85; }

/* ---------------------------------------------------------------- preloader */
.pre { position: fixed; inset: 0; z-index: 100; background: #101217; color: #dbceb0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3vh; }
.pre__horse { width: min(60vw, 760px); aspect-ratio: 16 / 10; }
.pre__meta { display: flex; gap: 3em; font-size: var(--fs-label); text-transform: uppercase; letter-spacing: .1em; opacity: .75; }
.pre__meta b { font-weight: 400; font-variant-numeric: tabular-nums; }

@media (max-width: 820px) {
  .beat { bottom: 11vh; font-size: 24px; }
  .finale { top: 37vh; }
  .rail { right: 6px; gap: 2px; }
  .rail i { width: 8px; }
  .rail button.is-on i { width: 16px; }
  .rail span { display: none; }
  .pre__horse { width: 80vw; }
}
