:root {
  --paper: #efeee9;
  --ink: #16141d;
  --accent: #ed178c; /* the projector's magenta */
  --accent-text: #b20f62;
  --ink-soft: color-mix(in srgb, var(--ink) 66%, var(--paper));
  --rule: color-mix(in srgb, var(--ink) 22%, var(--paper));

  /* spacing scale, 4px base */
  --s-2: 0.5rem;
  --s-3: 0.75rem;
  --s-6: 1.5rem;
  --s-8: 2rem;
  --s-12: 3rem;
  --s-16: 4rem;

  --gutter: clamp(1rem, 4.5vw, 4rem);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #0d0c12;
    --ink: #ecebf2;
    --accent: #ff38a8;
    --accent-text: #ff7cc2;
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }
::selection { background: var(--accent); color: #fff; }
html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: "Schibsted Grotesk", system-ui, sans-serif;
  font-size: clamp(1.125rem, 1rem + 0.45vw, 1.375rem);
  line-height: 1.5;
}

main {
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  /* The name sits where the original centred layout put it, anchored from the top so
     changing a paragraph never moves it. */
  padding: clamp(var(--s-12), 22vh, 14rem) var(--gutter) var(--s-16);
  padding-bottom: max(var(--s-16), env(safe-area-inset-bottom));
  container-type: inline-size;
}

/* The name. It's the screen the projector plays on, so it fills the width. */
.name, .credits { --size: 15.6cqi; }
.name {
  position: relative;
  margin: 0;
  font-family: "Big Shoulders Display", "Arial Narrow", sans-serif;
  font-weight: 900;
  font-size: var(--size);
  line-height: 0.86;
  text-transform: uppercase;
  /* Without the live projector, a still frame of it shows through the letters. */
  background: var(--ink) url(still.webp) center / cover;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.live .name { background: none; }
.moving .name { cursor: pointer; } /* click it: the projector cuts to the next shape */
.screen { position: absolute; pointer-events: none; }

/* Below the stage: the credits. Two columns cut on the name's own lines, so the words sit
   under DALTON and the links run under WILLARD and stop where its last D stops. The ratios are
   the letters' measured edges in units of the name's font size. */
.credits {
  --ink-in: calc(var(--size) * 0.04);      /* the D's stem, past the font's side bearing */
  --dalton: calc(var(--size) * 2.66);
  --willard: calc(var(--size) * 3.24);
  display: grid;
  grid-template-columns: var(--dalton) var(--willard);
  column-gap: calc(var(--size) * 0.27);
  /* The lead line and the first act share a baseline, so the two columns read as one row. */
  align-items: first baseline;
  margin-top: clamp(var(--s-12), 6cqi, 5.5rem);
  margin-left: var(--ink-in);
}

.words p { margin: 0; text-wrap: pretty; }
.words .nb { white-space: nowrap; }
/* The first line is who I am, so it leads; the rave line follows a step down. */
.words p:first-child {
  font-size: clamp(1.25rem, 0.875rem + 1cqi, 1.75rem);
  line-height: 1.32;
  letter-spacing: -0.012em;
  max-width: 34ch;
}
.words p + p {
  margin-top: var(--s-6);
  max-width: 40ch;
  color: var(--ink-soft);
}

/* The links are the setlist: one act per line in the name's own face, ruled like a running
   order, with where each one goes set small against the right edge. */
.links {
  list-style: none;
  margin: 0;
  padding: 0;
  border-bottom: 1px solid var(--rule);
}
.links a {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--s-6);
  padding: var(--s-3) 0 var(--s-2);
  border-top: 1px solid var(--rule);
  color: inherit;
  text-decoration: none;
  transition: border-color 160ms ease-out, box-shadow 160ms ease-out;
}
.links .to {
  font-family: "Big Shoulders Display", "Arial Narrow", sans-serif;
  font-weight: 900;
  font-size: clamp(1.875rem, 0.75rem + 2.2cqi, 2.75rem);
  line-height: 1;
  text-transform: uppercase;
  letter-spacing: 0.01em;
  transition: color 160ms ease-out;
}
.links .at {
  font-size: 0.8125rem;
  letter-spacing: 0.01em;
  color: var(--accent-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: color 160ms ease-out;
}
/* Hover lights the act's rule in the projector's magenta. */
.links a:hover { border-top-color: var(--accent); box-shadow: inset 0 1px 0 var(--accent); }
.links a:hover .to { color: var(--accent-text); }
.links a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Narrow: the name stacks and the words come back to the left edge. */
@container (max-width: 900px) {
  .name, .credits { --size: 30cqi; }
  .name span { display: block; }
  /* Stacked, the surname's letters hang below its line box, so the gap starts from the ink. */
  .credits {
    grid-template-columns: 1fr;
    row-gap: var(--s-12);
    margin-top: calc(var(--size) * 0.13 + clamp(var(--s-8), 6cqi, var(--s-12)));
  }
}

/* Phones: lift the name so the stage and its credits fit the first screen. */
@media (max-width: 600px) {
  main { padding-top: clamp(var(--s-12), 13vh, 14rem); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; }
}
