/* Opening animation. Static by default; .live rules pin it and js/intro.js drives it. */

.cover {
  display: grid;
  justify-items: center;
  gap: clamp(10px,2.2vh,22px);
  text-align: center;
  padding-block: calc(var(--bar) + 44px) 48px;
}

.filing { margin: 0; color: var(--ink-2); }

.wordmark {
  margin: 0;
  display: grid;
  justify-items: center;
  row-gap: .18em;
  font: 500 clamp(1.7rem,3.6vw,3.4rem)/.9 var(--display);
  font-stretch: 118%;
  text-transform: uppercase;
  white-space: nowrap;
}

/* Negative margin cancels the trailing letter-spacing so the word stays centered. */
.wm-name { letter-spacing: .42em; margin-right: -.42em; }

.wm-llc {
  font-size: 1.5em;
  font-weight: 900;
  font-stretch: 125%;
  letter-spacing: .02em;
  line-height: .85;
  color: var(--paper);
  -webkit-text-stroke: .09em var(--ink);
  paint-order: stroke fill;
  text-shadow: .05em .06em 0 var(--accent);
}

.star-slot { position: relative; width: var(--star); aspect-ratio: 1; }
.star-slot::before {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--logo-line);
  -webkit-mask: var(--logo-mask) center/contain no-repeat;
  mask: var(--logo-mask) center/contain no-repeat;
}

.tagline {
  margin: 0;
  font-family: var(--mono);
  font-size: clamp(.8rem,1.25vw,1rem);
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--ink-2);
}
.tagline b { font-weight: 500; color: var(--accent); }

.est { margin: 0; font-size: 1rem; color: var(--ink-2); }

.hint, .bar, .logo-lines { display: none; }

.scenes {
  display: grid;
  gap: 40px;
  max-width: 1180px;
  margin-inline: auto;
  padding: 0 max(var(--gut),env(safe-area-inset-right,0px)) 72px max(var(--gut),env(safe-area-inset-left,0px));
}
.scene { margin: 0; }
.scene img { width: 100%; height: auto; border-radius: 4px; }
.cap { padding-top: 14px; max-width: 40rem; }

@media (max-width:720px) {
  :root { --star: min(62vw,38vh); }
  .wordmark { font-size: min(7.2vw,3.2rem); }
  .tagline { letter-spacing: .12em; }
}

/* Scroll length of the animation. */
.live .journey { height: 420vh; }
.live.bar-drag .journey, .live.bar-drag .build { height: auto; }

.skip { display: none; }
.live .skip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  position: absolute;
  z-index: 5;
  right: max(var(--gut),env(safe-area-inset-right,0px));
  top: calc(var(--bar) + 18px);
  padding: 8px 14px;
  border: 1px solid var(--rule);
  border-radius: 999px;
  background: var(--paper);
  background: color-mix(in srgb,var(--paper) 82%,transparent);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  color: var(--ink);
  cursor: pointer;
  transition: background .18s,color .18s,border-color .18s;
}
.live .skip:hover { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }

.live .stage {
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100svh;
  overflow: hidden;
  background: var(--paper);
}

.live .cover {
  position: absolute;
  inset: 0;
  z-index: 1;
  align-content: center;
  padding-block: calc(var(--bar) + 12px) 64px;
  padding-left: max(var(--gut),env(safe-area-inset-left,0px));
  padding-right: max(var(--gut),env(safe-area-inset-right,0px));
}
.live .cover [data-fade] { will-change: opacity,transform; }
.live .star-slot::before { display: none; }

.live .scenes {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: block;
  max-width: none;
  margin: 0;
  padding: 0;
  will-change: clip-path;
}

.live .film {
  display: block;
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  pointer-events: none;
}
.live .film-on .film { opacity: 1; }

.live .scene { position: absolute; inset: 0; z-index: 1; will-change: opacity; }
.live .scene img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 0;
  transform-origin: 50% 50%;
}
.live .film-on .scene img { visibility: hidden; }

.live .scene::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to top,var(--scrim) 0%,rgba(6,12,22,.4) 32%,rgba(6,12,22,0) 60%);
  pointer-events: none;
}
.live .film-on .scene~.scene::after { display: none; }

.live .cap {
  position: absolute;
  z-index: 1;
  left: max(var(--gut),env(safe-area-inset-left,0px));
  right: max(var(--gut),env(safe-area-inset-right,0px));
  bottom: clamp(30px,8vh,84px);
  padding: 0;
  max-width: 38rem;
  color: var(--on-image);
  opacity: 0;
}
.live .cap .fig, .live .cap .cap-body { color: var(--on-image-2); }

.live .logo-lines {
  display: block;
  position: absolute;
  left: 0;
  top: 0;
  z-index: 3;
  transform-origin: 0 0;
  background: var(--logo-line);
  pointer-events: none;
}

.live .hint {
  display: flex;
  align-items: center;
  gap: 10px;
  position: absolute;
  z-index: 1;
  left: 0;
  right: 0;
  bottom: 22px;
  justify-content: center;
  margin: 0;
  color: var(--ink-2);
}
.live .hint::after {
  content: "";
  width: 1px;
  height: 22px;
  background: currentColor;
  animation: drop 1.8s ease-in-out infinite;
}
@keyframes drop {
  0%, 100% { transform: scaleY(.35); transform-origin: top; }
  50%      { transform: scaleY(1);   transform-origin: top; }
}

.live .bar { display: block; position: absolute; left: 0; right: 0; bottom: 0; height: 3px; z-index: 4; }
.live .bar i {
  display: block;
  height: 100%;
  background: var(--accent);
  transform-origin: 0 50%;
  transform: scaleX(0);
}

/* Castle build film (js/build.js) */

.build { margin-bottom: clamp(36px,5vw,64px); }
.build-stage { position: relative; }
.build-stage .b-first { display: none; }
.build-stage .b-last { width: 100%; height: auto; }
.build-hud {
  max-width: 1180px;
  margin-inline: auto;
  padding: 16px max(var(--gut),env(safe-area-inset-right,0px)) 0 max(var(--gut),env(safe-area-inset-left,0px));
}
.meter { display: none; }

/* Scroll length of the film. */
.live .build { height: 260vh; }

.live .build-stage {
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100svh;
  overflow: hidden;
  background: var(--paper-2);
}

.live .build-stage img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.live .build-stage .b-first { display: block; }
.live .build-stage .b-last { opacity: 0; }
.live .build-stage.film-on img { visibility: hidden; }

.live .build-stage::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(to top,var(--scrim) 0%,rgba(6,12,22,.4) 32%,rgba(6,12,22,0) 60%);
  pointer-events: none;
}

.live .build-hud {
  position: absolute;
  z-index: 2;
  left: 0;
  right: 0;
  bottom: clamp(30px,8vh,84px);
  max-width: none;
  margin: 0;
  padding-top: 0;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  color: var(--on-image);
}
.live .build-hud .fig, .live .build-hud .cap-body { color: var(--on-image-2); }

.live .meter { display: grid; justify-items: end; gap: 8px; min-width: 12rem; color: var(--on-image); }
.pct {
  font: 800 clamp(2.8rem,6vw,4.8rem)/.85 var(--display);
  font-stretch: 112%;
  font-variant-numeric: tabular-nums;
}
.track { display: block; width: 100%; height: 3px; background: var(--on-image-rule); }
.track i {
  display: block;
  height: 100%;
  background: var(--on-image);
  transform-origin: 0 50%;
  transform: scaleX(0);
}

@media (max-width:720px) {
  .live .build-hud { flex-direction: column; align-items: stretch; gap: 18px; }
  .live .meter { justify-items: start; }
}

@media (prefers-reduced-motion: reduce) {
  .live .hint::after { animation: none; }
}
