:root {
  --bg: #111111;            /* the first background, ink */
  --ink: #f7f4ee;           /* the type on dark backgrounds */
  --ink-dark: #141210;      /* the type on light backgrounds */
  --soft: color-mix(in srgb, var(--ink) 58%, transparent);
  --pill: var(--ink);       /* the Shuffle pill takes the colour of the type */
  --pill-ink: var(--bg);
  --size: min(13.8vw, 8rem, 14.5vh);
  --sans: "Bricolage Grotesque Variable", system-ui, sans-serif;
  --serif: "Fraunces Variable", Georgia, serif;
  --cond: "Archivo Variable", "Arial Narrow", sans-serif;
  --mono: "Geist Mono Variable", ui-monospace, monospace;
}

* { box-sizing: border-box; margin: 0; }
html, body { height: 100%; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

.page {
  position: relative;
  height: 100vh;
  display: grid;
  grid-template-rows: auto 1fr auto;
  padding: clamp(14px, 3.2vh, 32px) clamp(16px, 3.4vw, 44px);
  background: var(--bg);
  color: var(--ink);
}
.page::after {
  /* a very faint grain over the colour, like printed stock */
  content: "";
  position: absolute; inset: 0;
  pointer-events: none;
  opacity: .07;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  mix-blend-mode: overlay;
}

.bar, .foot { position: relative; z-index: 2; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.brand { display: flex; align-items: center; gap: 8px; font-size: 15px; font-weight: 600; letter-spacing: -.01em; }
.brand svg { width: 18px; height: 18px; }
.brand__sub { font-weight: 400; color: var(--soft); }
.bar__label, .meta__label { font-family: var(--mono); font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--soft); }

.stage { position: relative; display: grid; align-items: center; min-height: 0; overflow: hidden; }

/* the specimen */
.seq { position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: center; gap: .06em; font-size: calc(var(--size) * .78); line-height: 1; pointer-events: none; }
.seq__row { white-space: nowrap; display: flex; align-items: center; }
.seq__row span, .seq__row i { display: inline-block; font-style: inherit; }
.seq__name { font-family: var(--sans); font-weight: 500; letter-spacing: -.04em; }
.seq__cond { font-family: var(--cond); font-stretch: 62%; font-weight: 900; text-transform: uppercase; letter-spacing: 0; }
.seq__cond > span { display: inline-flex; }
.seq__arrow { width: .9em; height: .55em; flex: none; margin-right: .14em; }
.seq__serif { font-family: var(--serif); font-weight: 300; letter-spacing: -.03em; gap: .24em; }
.seq__italic { font-family: var(--serif); font-style: italic; font-weight: 300; letter-spacing: -.03em; gap: .24em; }

/* the tester */
.tester { position: relative; }
.tester__text {
  font-family: var(--sans);
  font-weight: 400;
  font-size: var(--size);
  letter-spacing: -.04em;
  line-height: 1;
  outline: none;
  caret-color: var(--ink);
  min-height: 1em;
  max-height: 100%;
  overflow-wrap: anywhere;
  padding-bottom: .08em;
}
.tester[data-face="serif"] .tester__text { font-family: var(--serif); font-weight: 300; letter-spacing: -.05em; }
.tester[data-face="cond"] .tester__text { font-family: var(--cond); font-stretch: 62%; font-weight: 900; letter-spacing: 0; text-transform: uppercase; font-size: calc(var(--size) * 1.08); line-height: .92; }
.tester__text em { font-style: italic; font-family: var(--serif); font-weight: 300; letter-spacing: -.04em; }
.tester[data-face="cond"] .tester__text em { font-family: inherit; font-style: normal; }

.caret {
  position: absolute; left: 0; top: 0;
  width: max(2px, .035em);
  height: 1em;
  font-size: var(--size);
  background: var(--ink);
  border-radius: 1px;
  pointer-events: none;
  opacity: 0;
}

/* the foot */
.foot { align-items: flex-end; }
.meta { display: grid; gap: 6px; min-width: 0; }
.meta--hex { margin-right: auto; margin-left: clamp(16px, 6vw, 96px); }
.roll { position: relative; overflow: hidden; height: 1.25em; font-size: 15px; font-weight: 500; letter-spacing: -.01em; white-space: nowrap; }
.roll span { display: block; }
.roll span + span { position: absolute; left: 0; top: 0; }
.roll--mono { font-family: var(--mono); font-weight: 400; letter-spacing: .02em; }

.shuffle {
  position: relative;
  display: inline-flex; align-items: center; gap: 8px;
  height: 44px; padding: 0 20px 0 16px;
  border: 0; border-radius: 999px;
  background: none;
  color: var(--pill-ink);
  font: 500 15px/1 var(--cond);
  font-stretch: 100%;
  letter-spacing: .01em;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  flex: none;
}
.shuffle__bg { position: absolute; inset: 0; border-radius: inherit; background: var(--pill); box-shadow: 0 1px 0 rgba(255,255,255,.35) inset, 0 8px 22px -10px rgba(0,0,0,.45); }
.shuffle__icon { position: relative; width: 18px; height: 18px; }
.shuffle__label { position: relative; }
.shuffle:focus-visible { outline: 1.5px solid var(--ink); outline-offset: 4px; }

@media (max-width: 520px) {
  .brand__sub { display: none; }
  .meta--hex { margin-left: 14px; }
  .roll { font-size: 13px; }
  .shuffle { height: 40px; padding: 0 16px 0 13px; font-size: 14px; }
}
@media (max-height: 460px) {
  .bar__label, .meta__label { font-size: 10px; }
}
