/* ---------- reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
h1, h2, h3, p, ol, ul, fieldset, figure { margin: 0; padding: 0; }
ol, ul { list-style: none; }
fieldset { border: 0; min-width: 0; }
button, input { font: inherit; color: inherit; }
button { background: none; border: 0; cursor: pointer; }
a { color: inherit; text-decoration: none; }
img, canvas { display: block; }

html {
  background: var(--night);
  color: var(--light);
  -webkit-text-size-adjust: 100%;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--f-display);
  font-size: var(--t-body);
  font-weight: 400;
  font-stretch: 100%;
  line-height: 1.5;
  background: var(--night);
  overflow-x: clip;
}

::selection { background: var(--light); color: var(--night); }

:focus-visible {
  outline: 1px solid var(--light);
  outline-offset: 4px;
}

.sr-only {
  position: absolute !important;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

.skip {
  position: fixed;
  left: var(--pad); top: 12px;
  z-index: 100;
  padding: 10px 14px;
  background: var(--light);
  color: var(--night);
  font: 500 12px/1 var(--f-mono);
  transform: translateY(-160%);
  transition: transform var(--dur-ui) var(--ease-out);
}
.skip:focus { transform: none; }

/* ---------- shared type ---------- */
.label {
  font-family: var(--f-mono);
  font-size: var(--t-label);
  font-weight: 400;
  line-height: 1.4;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ash);
}

.mask {
  display: block;
  overflow: hidden;
  /* room for descenders and wide glyph overshoot */
  padding: 0.04em 0.06em 0.1em;
  margin: -0.04em -0.06em -0.1em;
}
.mask > span { display: block; will-change: transform; }

.link {
  display: inline-flex;
  align-items: center;
  gap: 0.6em;
  font-family: var(--f-mono);
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--light);
  padding: 10px 0;
  background-image: linear-gradient(var(--light), var(--light));
  background-size: 100% 1px;
  background-position: 0 100%;
  background-repeat: no-repeat;
  transition: background-size 380ms var(--ease-out), color var(--dur-ui);
}
.link:hover { background-size: 30% 1px; }
.link--button { cursor: pointer; }

/* ---------- stage ---------- */
.stage {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  height: 100lvh;
  z-index: 1;
  background: var(--night);
}

.grain {
  position: fixed;
  inset: 0;
  z-index: 40;
  pointer-events: none;
  overflow: hidden;
  opacity: 0.06;
  mix-blend-mode: screen;
}
.grain::before {
  content: "";
  position: absolute;
  inset: -100%;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='220' height='220'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 1  0 0 0 0 1  0 0 0 0 1  0 0 0 1.4 -0.2'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
  animation: grain 900ms steps(6) infinite;
}
@keyframes grain {
  0% { transform: translate(0, 0); }
  20% { transform: translate(-7%, 4%); }
  40% { transform: translate(5%, -6%); }
  60% { transform: translate(-3%, 8%); }
  80% { transform: translate(8%, 2%); }
  100% { transform: translate(0, 0); }
}

/* ---------- masthead ---------- */
.masthead {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 30;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: calc(var(--pad) * 0.6) var(--pad);
  pointer-events: none;
}
.masthead > * { pointer-events: auto; }
.masthead::before {
  content: "";
  position: absolute;
  inset: 0 0 -40px 0;
  z-index: -1;
  background: linear-gradient(var(--night) 35%, rgba(4, 5, 6, 0));
  opacity: 0;
  transition: opacity 400ms var(--ease-out);
  pointer-events: none;
}
.masthead.is-solid::before { opacity: 1; }

.wordmark {
  display: inline-flex;
  align-items: baseline;
  gap: 10px;
  justify-self: start;
}
.wordmark__name {
  font-family: var(--f-display);
  font-weight: 600;
  font-stretch: 125%;
  font-size: 14px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
}
.wordmark__sub {
  font-family: var(--f-mono);
  font-size: 10px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--ash);
}

.masthead__place {
  font-family: var(--f-mono);
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ash-2);
}

.masthead__cta {
  justify-self: end;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 11px 16px 11px 14px;
  border: 1px solid var(--hair-2);
  border-radius: 999px;
  font-family: var(--f-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  background: rgba(4, 5, 6, 0.35);
  transition: background var(--dur-ui) var(--ease-out), color var(--dur-ui) var(--ease-out), border-color var(--dur-ui);
}
.masthead__cta .dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--light);
  box-shadow: 0 0 10px 2px rgba(243, 241, 234, 0.55);
}
.masthead__cta:hover { background: var(--light); color: var(--night); border-color: var(--light); }
.masthead__cta:hover .dot { background: var(--night); box-shadow: none; }

/* ---------- HUD ---------- */
.hud {
  position: fixed;
  left: var(--pad);
  bottom: calc(var(--pad) * 0.6);
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 14px;
  font-family: var(--f-mono);
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ash);
}
.hud__index { color: var(--light); }
.hud__bar {
  position: relative;
  width: 72px; height: 1px;
  background: var(--hair);
  overflow: hidden;
}
.hud__fill {
  position: absolute; inset: 0;
  background: var(--light);
  transform-origin: 0 50%;
  transform: scaleX(0);
}

/* ---------- scenes ---------- */
main { position: relative; z-index: 2; }

.scene {
  position: relative;
  height: calc(var(--len) * 1vh);
}

.frame {
  position: fixed;
  inset: 0;
  z-index: 2;
  pointer-events: none;
}
.frame a, .frame button { pointer-events: auto; }

/* Beats start hidden; the master timeline reveals them. */
.js [data-beat],
.js [data-intro] { visibility: hidden; opacity: 0; }

@media (max-width: 760px) {
  .masthead { grid-template-columns: 1fr auto; }
  .masthead__place { display: none; }
  .masthead__cta { padding: 9px 12px 9px 11px; font-size: 10px; letter-spacing: 0.1em; }
  .wordmark__name { font-size: 12px; letter-spacing: 0.26em; }
  .wordmark__sub { display: none; }
  .hud__name { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .grain::before { animation: none; }
  *, *::before, *::after { transition-duration: 1ms !important; }
}
