:root {
  --ink: #07060c;
  --radius: 24px;
  /* Names are set in a Caslon, questions in Baskerville italic. */
  --display: "Big Caslon", "Libre Caslon Display", Baskerville, "Hoefler Text", "Iowan Old Style", Palatino, Georgia, serif;
  --text: Baskerville, "Libre Baskerville", "Hoefler Text", "Iowan Old Style", Palatino, Georgia, serif;
  color-scheme: dark;
}

* { box-sizing: border-box; }

html {
  background: var(--ink);
  scrollbar-width: none;
}

html::-webkit-scrollbar { display: none; }

body {
  margin: 0;
  color: #fff;
  font-family: var(--text);
  -webkit-font-smoothing: antialiased;
  overscroll-behavior-y: none;
}

/* The scroll distance. The page itself never moves; flight.js reads the offset. */
.track { height: 480vh; }

.poster,
#stage {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  height: 100lvh;
}

/* The first frame, shown whole until the canvas takes over. flight.js sets its exact size. */
.poster { background: var(--ink) url(/frames/720/f0000.webp) center / contain no-repeat; }

#stage {
  display: block;
  opacity: 0;
  transition: opacity .6s ease;
}

#stage.on { opacity: 1; }

/* A row of tall plates. Their width also bows to the window height, so they always fit. */
.cards {
  position: fixed;
  z-index: 2;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  height: 100svh;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, min(262px, calc((100svh - 150px) / 1.76))));
  gap: 16px;
  place-content: center;
  padding: 24px;
  pointer-events: none;
}

/* The glass itself is painted by the stage shader under each plate's box. */
.card {
  container-type: inline-size;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  aspect-ratio: 1 / 1.76;
  padding: 26px 24px 28px;
  border-radius: var(--radius);
  color: #fff;
  text-decoration: none;
  opacity: 0;
  pointer-events: auto;
  will-change: transform, opacity;
  -webkit-tap-highlight-color: transparent;
}

.card:focus-visible {
  outline: 2px solid rgba(255, 255, 255, .9);
  outline-offset: 5px;
}

.card__no {
  font-size: 15px;
  letter-spacing: .12em;
  color: rgba(255, 255, 255, .64);
}

.card h2 {
  margin: 0;
  font-family: var(--display);
  font-size: clamp(23px, 17.2cqw, 38px);
  font-weight: 400;
  letter-spacing: -.005em;
  line-height: 1.04;
}

.card__rule {
  display: block;
  width: 26px;
  height: 1px;
  margin: 18px 0 15px;
  background: rgba(255, 255, 255, .5);
  transition: width .35s ease;
}

.card:hover .card__rule { width: 44px; }

.card p {
  margin: 0;
  font-size: clamp(15px, 8.7cqw, 19px);
  font-style: italic;
  line-height: 1.34;
  color: rgba(255, 255, 255, .82);
}

@media (max-width: 720px) {
  .track { height: 400vh; }

  .cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    padding: 16px;
  }

  .card {
    aspect-ratio: 1 / 1.44;
    max-height: calc((100svh - 44px) / 2);
    padding: 20px 18px 20px;
  }

  .card__rule { margin: 12px 0 11px; }
}

/* Without WebGL the plates fall back to plain frosted panels. */
.no-gl .card {
  background: rgba(14, 16, 28, .46);
  border: 1px solid rgba(255, 255, 255, .2);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .28), 0 24px 60px rgba(0, 0, 0, .4);
  -webkit-backdrop-filter: blur(22px) saturate(1.3);
  backdrop-filter: blur(22px) saturate(1.3);
}
