@property --seam {
  syntax: "<percentage>";
  inherits: true;
  initial-value: 50%;
}

:root {
  color-scheme: light;
  --dc: #0d47d1;
  --dc-bright: #2f6bff;
  --dc-deep: #061f5c;
  --dc-light: #7aa7ff;
  --marvel: #d71920;
  --marvel-bright: #ff3b41;
  --marvel-deep: #5e070c;
  --marvel-light: #ff8087;
  --invincible: #ffd21f;
  --invincible-deep: #7a5c00;
  --manga: #16161c;
  --manga-accent: #ff3d7f;
  --walkingdead: #47692a;
  --walkingdead-deep: #1c2a10;
  --indie: #6b2fd6;
  --indie-deep: #26105a;
  --turtle: #2f9e44;
  --starwars: #0b8794;
  --starwars-deep: #03363c;
  --starwars-text: #086a74;
  --crawl: #ffe81f;
  --games: #f26419;
  --games-deep: #5a1e00;
  --games-text: #a8420a;
  --potter: #7b1e3a;
  --potter-deep: #2c0814;
  --potter-gold: #d4a63a;
  --tolkien: #9c6b1e;
  --tolkien-deep: #3a2606;
  --tolkien-text: #7a5212;
  --shire: #2e5b34;
  --ink: #111118;
  --ink-muted: #4a4a55;
  --paper: #f6f0e2;
  --paper-2: #ece2cc;
  --white: #fffdf7;
  --house: var(--dc);
  --house-deep: var(--dc-deep);
  --house-ink: var(--white);
  --house-text: var(--dc);
  --house-chart: var(--dc);
  --other: var(--marvel);
  --on-bg: var(--white);
  --on-bg-shadow: var(--ink);
  --left-hi: #1a5cf0;
  --left-mid: var(--dc);
  --left-deep: var(--dc-deep);
  --left-dot: rgba(255, 255, 255, 0.24);
  --right-hi: #f0262d;
  --right-mid: var(--marvel);
  --right-deep: var(--marvel-deep);
  --seam: 50%;
  --shadow: 8px 8px 0 var(--ink);
  --display: "Anton", Impact, "Haettenschweiler", "Arial Narrow Bold", sans-serif;
  --sans: "Archivo", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  --star: polygon(
    50% 0%, 60.09% 12.33%, 75% 6.7%, 77.58% 22.42%, 93.3% 25%, 87.67% 39.91%,
    100% 50%, 87.67% 60.09%, 93.3% 75%, 77.58% 77.58%, 75% 93.3%, 60.09% 87.67%,
    50% 100%, 39.91% 87.67%, 25% 93.3%, 22.42% 77.58%, 6.7% 75%, 12.33% 60.09%,
    0% 50%, 12.33% 39.91%, 6.7% 25%, 22.42% 22.42%, 25% 6.7%, 39.91% 12.33%
  );
}

* {
  box-sizing: border-box;
}

html {
  background: var(--dc-deep);
}

body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  color: var(--ink);
  font-family: var(--sans);
  font-weight: 420;
  line-height: 1.5;
  background: var(--dc-deep);
  transition: --seam 1.1s cubic-bezier(0.2, 0.8, 0.2, 1);
}

body[data-house] {
  --seam: 86%;
}

body[data-house="dc"] {
  --house: var(--dc);
  --house-deep: var(--dc-deep);
  --house-text: var(--dc);
  --house-chart: var(--dc);
  --other: var(--marvel);
}

body[data-house="marvel"] {
  --seam: 14%;
  --house: var(--marvel);
  --house-deep: var(--marvel-deep);
  --house-text: var(--marvel);
  --house-chart: var(--marvel);
  --other: var(--dc-bright);
}

body[data-house="invincible"] {
  --house: var(--invincible);
  --house-deep: var(--invincible-deep);
  --house-ink: var(--ink);
  --house-text: var(--invincible-deep);
  --house-chart: #b08400;
  --other: var(--dc);
  --on-bg: var(--ink);
  --on-bg-shadow: transparent;
  --left-hi: #ffe45c;
  --left-mid: var(--invincible);
  --left-deep: #b88a00;
  --left-dot: rgba(255, 255, 255, 0.35);
  --right-hi: #2a64f0;
  --right-mid: var(--dc);
  --right-deep: var(--dc-deep);
}

body[data-house="manga"] {
  --house: var(--manga);
  --house-deep: #000;
  --house-text: var(--ink);
  --house-chart: var(--manga-accent);
  --other: var(--manga-accent);
  --left-hi: #2a2a33;
  --left-mid: var(--manga);
  --left-deep: #050507;
  --left-dot: rgba(255, 255, 255, 0.3);
  --right-hi: var(--white);
  --right-mid: #f2ecdd;
  --right-deep: #cfc6b1;
}

body[data-house="walkingdead"] {
  --house: var(--walkingdead);
  --house-deep: var(--walkingdead-deep);
  --house-text: var(--walkingdead);
  --house-chart: var(--walkingdead);
  --other: var(--marvel);
  --left-hi: #5b8034;
  --left-mid: var(--walkingdead);
  --left-deep: var(--walkingdead-deep);
}

body[data-house="indie"] {
  --house: var(--indie);
  --house-deep: var(--indie-deep);
  --house-text: var(--indie);
  --house-chart: var(--indie);
  --other: var(--turtle);
  --left-hi: #8247f0;
  --left-mid: var(--indie);
  --left-deep: var(--indie-deep);
  --right-hi: #45c35c;
  --right-mid: var(--turtle);
  --right-deep: #13461d;
}

body[data-house="starwars"] {
  --house: var(--starwars);
  --house-deep: var(--starwars-deep);
  --house-text: var(--starwars-text);
  --house-chart: var(--starwars);
  --other: var(--crawl);
  --left-hi: #14a8b5;
  --left-mid: var(--starwars);
  --left-deep: var(--starwars-deep);
  --right-hi: #2a2d38;
  --right-mid: #14161d;
  --right-deep: #050608;
}

body[data-house="games"] {
  --house: var(--games);
  --house-deep: var(--games-deep);
  --house-ink: var(--ink);
  --house-text: var(--games-text);
  --house-chart: var(--games-text);
  --other: var(--dc-bright);
  --left-hi: #ff8a45;
  --left-mid: var(--games);
  --left-deep: #a83c05;
  --left-dot: rgba(255, 255, 255, 0.3);
  --right-hi: #2b3247;
  --right-mid: #1b2030;
  --right-deep: #0a0d16;
}

body[data-house="potter"] {
  --house: var(--potter);
  --house-deep: var(--potter-deep);
  --house-text: var(--potter);
  --house-chart: var(--potter);
  --other: var(--potter-gold);
  --left-hi: #9a2b4d;
  --left-mid: var(--potter);
  --left-deep: var(--potter-deep);
  --right-hi: #f0c85a;
  --right-mid: var(--potter-gold);
  --right-deep: #6b4e10;
}

body[data-house="tolkien"] {
  --house: var(--tolkien);
  --house-deep: var(--tolkien-deep);
  --house-text: var(--tolkien-text);
  --house-chart: var(--tolkien);
  --other: var(--shire);
  --left-hi: #bd8a33;
  --left-mid: var(--tolkien);
  --left-deep: var(--tolkien-deep);
  --right-hi: #3f7a46;
  --right-mid: var(--shire);
  --right-deep: #10260f;
}

/* Each universe's colour, for frames, labels and small text on paper */

.dc {
  --hue: var(--dc);
  --hue-ink: var(--white);
  --hue-text: var(--dc);
}

.marvel {
  --hue: var(--marvel);
  --hue-ink: var(--white);
  --hue-text: var(--marvel);
}

.invincible {
  --hue: var(--invincible);
  --hue-ink: var(--ink);
  --hue-text: var(--invincible-deep);
}

.manga {
  --hue: var(--manga);
  --hue-ink: var(--white);
  --hue-text: var(--manga);
}

.walkingdead {
  --hue: var(--walkingdead);
  --hue-ink: var(--white);
  --hue-text: var(--walkingdead);
}

.indie {
  --hue: var(--indie);
  --hue-ink: var(--white);
  --hue-text: var(--indie);
}

.starwars {
  --hue: var(--starwars);
  --hue-ink: var(--white);
  --hue-text: var(--starwars-text);
}

.games {
  --hue: var(--games);
  --hue-ink: var(--ink);
  --hue-text: var(--games-text);
}

.potter {
  --hue: var(--potter);
  --hue-ink: var(--white);
  --hue-text: var(--potter);
}

.tolkien {
  --hue: var(--tolkien);
  --hue-ink: var(--white);
  --hue-text: var(--tolkien-text);
}

body[data-screen="intro"],
body[data-screen="choose"],
body[data-screen="scene"],
body[data-screen="halfway"],
body[data-screen="reveal"] {
  display: flex;
  flex-direction: column;
}

/* The two sides of the page and the crack between them */

.universe {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

.side {
  position: absolute;
  inset: 0;
  overflow: hidden;
}

.side::before,
.side::after {
  content: "";
  position: absolute;
  inset: 0;
}

.side.dc {
  background:
    radial-gradient(120% 90% at 18% 8%, transparent 35%, rgba(3, 10, 40, 0.6) 100%),
    linear-gradient(160deg, var(--left-hi), var(--left-mid) 42%, var(--left-deep));
}

.side.dc::before {
  background-image: radial-gradient(circle, var(--left-dot) 0 1.8px, transparent 2.2px);
  background-size: 12px 12px;
  -webkit-mask-image: radial-gradient(110% 90% at 0% 0%, #000 0%, transparent 62%);
  mask-image: radial-gradient(110% 90% at 0% 0%, #000 0%, transparent 62%);
}

.side.dc::after {
  background-image: radial-gradient(circle, rgba(0, 4, 30, 0.38) 0 2.2px, transparent 2.6px);
  background-size: 10px 10px;
  -webkit-mask-image: linear-gradient(to top, #000, transparent 45%);
  mask-image: linear-gradient(to top, #000, transparent 45%);
}

.side.ink,
.side.marvel {
  clip-path: polygon(
    calc(var(--seam) + max(0.6%, 6px)) 0,
    100% 0,
    100% 100%,
    calc(var(--seam) - max(2%, 16px)) 100%,
    calc(var(--seam) + max(1.2%, 10px)) 88%,
    calc(var(--seam) - max(1.6%, 13px)) 76%,
    calc(var(--seam) + max(2.2%, 16px)) 61%,
    calc(var(--seam) - max(0.8%, 8px)) 47%,
    calc(var(--seam) + max(1.8%, 14px)) 33%,
    calc(var(--seam) - max(1.4%, 12px)) 19%,
    calc(var(--seam) + max(0.4%, 4px)) 8%
  );
}

.side.ink {
  background: var(--ink);
  transform: translateX(-8px);
}

.side.marvel {
  background:
    radial-gradient(120% 90% at 82% 8%, transparent 35%, rgba(40, 0, 4, 0.55) 100%),
    linear-gradient(200deg, var(--right-hi), var(--right-mid) 42%, var(--right-deep));
}

.side.marvel::before {
  background-image: radial-gradient(circle, rgba(255, 235, 230, 0.2) 0 1.8px, transparent 2.2px);
  background-size: 12px 12px;
  -webkit-mask-image: radial-gradient(110% 90% at 100% 0%, #000 0%, transparent 62%);
  mask-image: radial-gradient(110% 90% at 100% 0%, #000 0%, transparent 62%);
}

.side.marvel::after {
  background-image: radial-gradient(circle, rgba(30, 0, 2, 0.4) 0 2.2px, transparent 2.6px);
  background-size: 10px 10px;
  -webkit-mask-image: linear-gradient(to top, #000, transparent 45%);
  mask-image: linear-gradient(to top, #000, transparent 45%);
}

/* Masthead */

.mast,
main {
  position: relative;
  z-index: 1;
}

.mast {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.5rem max(16px, calc((100% - 74rem) / 2));
  background: var(--ink);
  color: var(--white);
}

.mast-house {
  padding: 0.18rem 0.65rem 0.12rem;
  font-family: var(--display);
  font-size: 1.05rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--white);
}

.mast-house.dc {
  background: var(--dc);
  border-radius: 999px;
  box-shadow: 0 0 0 2px var(--white);
}

.mast-house.marvel {
  background: var(--marvel);
}

.mast-title {
  font-family: var(--display);
  font-size: 1rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.mast-title em {
  margin-left: 0.6rem;
  font-family: var(--sans);
  font-size: 0.7rem;
  font-style: normal;
  font-weight: 700;
  letter-spacing: 0.2em;
  color: #b4b4c4;
}

/* Layout */

main {
  width: min(48rem, calc(100% - 32px));
  margin: 0 auto;
  padding: 2.4rem 0 4.5rem;
}

body[data-screen="intro"] main,
body[data-screen="choose"] main,
body[data-screen="scene"] main,
body[data-screen="halfway"] main,
body[data-screen="reveal"] main {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding-top: 1.6rem;
  padding-bottom: 2.6rem;
}

body[data-screen="intro"] main,
body[data-screen="shared"] main,
body[data-screen="result"] main {
  width: min(74rem, calc(100% - 32px));
}

h1,
h2,
h3,
p {
  margin: 0;
}

/* Shared comic pieces */

.panel {
  position: relative;
  color: var(--ink);
  background:
    radial-gradient(rgba(17, 17, 24, 0.05) 0.8px, transparent 1px) 0 0 / 5px 5px,
    var(--paper);
  border: 3px solid var(--ink);
  box-shadow: var(--shadow);
}

.caption {
  color: var(--ink);
  background: var(--white);
  border: 2.5px solid var(--ink);
  box-shadow: 4px 4px 0 var(--ink);
}

.kicker {
  display: inline-block;
  padding: 0.38rem 0.75rem 0.32rem;
  font-size: 0.76rem;
  font-weight: 700;
  font-stretch: 105%;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.section-label {
  display: inline-block;
  margin: 0 0 1rem;
  padding: 0.32rem 0.75rem 0.26rem;
  font-family: var(--display);
  font-size: 1.15rem;
  font-weight: 400;
  letter-spacing: 0.06em;
  line-height: 1.2;
  text-transform: uppercase;
  color: var(--white);
  background: var(--ink);
}

.actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.9rem;
  margin-top: 1.6rem;
}

button {
  font: inherit;
  color: var(--ink);
  cursor: pointer;
  padding: 0.62rem 1.35rem 0.52rem;
  font-family: var(--display);
  font-size: 1.15rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  background: var(--paper);
  border: 3px solid var(--ink);
  border-radius: 0;
  box-shadow: 5px 5px 0 var(--ink);
  transition:
    transform 0.1s ease,
    box-shadow 0.1s ease;
}

button:hover {
  transform: translate(-2px, -2px);
  box-shadow: 7px 7px 0 var(--ink);
}

button:active {
  transform: translate(4px, 4px);
  box-shadow: 1px 1px 0 var(--ink);
}

button:focus-visible {
  outline: 3px solid var(--ink);
  outline-offset: 4px;
}

main > .back:focus-visible,
main > .actions button:focus-visible,
.bank-more:focus-visible {
  outline-color: var(--on-bg);
}

.result-name:focus {
  outline: none;
}

.primary {
  color: var(--white);
  text-shadow: 2px 2px 0 var(--ink);
  background: linear-gradient(115deg, var(--dc) 0 50%, var(--marvel) 50% 100%);
}

.back {
  align-self: flex-start;
  margin-top: 1.4rem;
  padding: 0.42rem 0.9rem 0.34rem;
  font-size: 1rem;
  box-shadow: 3px 3px 0 var(--ink);
}

.actions .back {
  margin-top: 0;
}

/* Portrait thumbnails */

.thumb {
  position: relative;
  display: block;
  aspect-ratio: 3 / 4;
  overflow: hidden;
  padding: 3px;
  background: var(--hue);
  border: 2px solid var(--ink);
  --tint: color-mix(in srgb, var(--hue) 60%, transparent);
}

.thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: var(--ink);
}

.thumb::after {
  content: "";
  position: absolute;
  inset: 3px;
  pointer-events: none;
  background:
    radial-gradient(rgba(17, 17, 24, 0.4) 0.7px, transparent 0.95px) 0 0 / 4px 4px,
    linear-gradient(to top, var(--tint), transparent 42%);
  mix-blend-mode: multiply;
  opacity: 0.3;
}

.monogram {
  display: none;
  place-items: center;
  font-family: var(--display);
  color: var(--white);
  background: var(--ink);
}

.thumb .monogram {
  position: absolute;
  inset: 3px;
  font-size: 2rem;
}

.thumb.is-fallback img {
  visibility: hidden;
}

.thumb.is-fallback .monogram {
  display: grid;
}

/* Intro */

.intro-stage {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 2rem 1.4rem;
  align-items: end;
}

.cover-title {
  margin: 0.9rem 0 0.4rem;
  font-family: var(--display);
  font-size: clamp(4.6rem, 12.5vw, 9.6rem);
  font-weight: 400;
  line-height: 0.93;
  letter-spacing: 0.01em;
  text-transform: uppercase;
  color: var(--white);
}

.cover-title .line {
  display: block;
  -webkit-text-stroke: 4px var(--ink);
  paint-order: stroke fill;
  text-shadow:
    5px 5px 0 var(--ink),
    11px 11px 0 var(--marvel);
}

.cover-blurb {
  justify-self: end;
  max-width: 36rem;
  padding: 1.35rem 1.45rem 1.45rem;
}

.lede {
  font-size: 1.22rem;
  font-weight: 540;
  line-height: 1.45;
}

.note {
  margin-top: 0.85rem;
  color: var(--ink-muted);
}

.begin {
  padding: 0.7rem 2.3rem 0.6rem;
  font-size: 1.6rem;
}

.house-col {
  background: var(--paper);
  border: 3px solid var(--ink);
  box-shadow: var(--shadow);
}

.house-label {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.4rem 0.85rem 0.3rem;
  font-family: var(--display);
  font-size: 1.6rem;
  font-weight: 400;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--hue-ink);
  background: var(--hue);
  border-bottom: 3px solid var(--ink);
}

.house-count {
  font-family: var(--sans);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.14em;
}

.roster {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.8rem 0.65rem;
  margin: 0;
  padding: 0.8rem 0.8rem 0.9rem;
  list-style: none;
}

.roster.is-small {
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

.house-col {
  align-self: stretch;
}

.roster-name {
  display: block;
  margin-top: 0.35rem;
  font-size: 0.74rem;
  font-weight: 700;
  font-stretch: 85%;
  line-height: 1.15;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

/* Scenes */

.panel-band {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.6rem 1.1rem;
  color: var(--white);
  background: var(--ink);
}

.band-label {
  font-family: var(--display);
  font-size: 1.05rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
}

.progress {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(var(--steps, 16), minmax(0, 1fr));
  gap: 4px;
  height: 11px;
}

.progress span {
  background: rgba(255, 253, 247, 0.16);
  transform: skewX(-20deg);
}

.progress .dc.is-done,
.progress .dc.is-now {
  background: var(--dc-bright);
}

.progress .marvel.is-done,
.progress .marvel.is-now {
  background: var(--marvel-bright);
}

.progress .is-now {
  box-shadow: 0 0 0 2px var(--white);
}

.scene-panel {
  --tone: var(--dc);
}

.scene-panel.is-late {
  --tone: var(--marvel);
}

.panel-body {
  position: relative;
  padding: 1.4rem 1.5rem 1.6rem;
}

.scene-mark {
  position: absolute;
  top: 0.5rem;
  right: 1.1rem;
  font-family: var(--display);
  font-size: 7.5rem;
  line-height: 0.85;
  color: var(--paper-2);
  -webkit-text-stroke: 2px rgba(17, 17, 24, 0.32);
  pointer-events: none;
}

.scene-title {
  position: relative;
  padding-right: 6rem;
  font-family: var(--display);
  font-size: clamp(2.3rem, 6vw, 3.4rem);
  font-weight: 400;
  line-height: 0.95;
  letter-spacing: 0.01em;
  text-transform: uppercase;
}

.scene-prompt {
  position: relative;
  margin-top: 1.1rem;
  padding: 1rem 1.15rem;
  font-size: 1.3rem;
  font-weight: 520;
  line-height: 1.45;
  box-shadow: 6px 6px 0 var(--tone);
}

.options {
  display: grid;
  gap: 0.8rem;
  margin: 1.5rem 0 0;
  padding: 0;
  list-style: none;
}

.options li {
  --opt: var(--dc);
}

.options li:nth-child(3n + 2) {
  --opt: var(--ink);
}

.options li:nth-child(3n) {
  --opt: var(--marvel);
}

.option {
  display: grid;
  grid-template-columns: 2.4rem minmax(0, 1fr);
  gap: 0.95rem;
  align-items: center;
  width: 100%;
  padding: 0.85rem 1.05rem;
  text-align: left;
  font-family: var(--sans);
  font-size: 1.05rem;
  font-weight: 450;
  letter-spacing: 0;
  line-height: 1.45;
  text-transform: none;
  background: var(--white);
  border-width: 2.5px;
  box-shadow: 4px 4px 0 var(--ink);
  transition:
    transform 0.12s ease,
    box-shadow 0.12s ease,
    background-color 0.12s ease,
    color 0.12s ease,
    opacity 0.15s ease;
}

.option:hover {
  transform: translate(-3px, -3px);
  box-shadow: 7px 7px 0 var(--opt);
}

.badge {
  display: grid;
  place-items: center;
  width: 2.4rem;
  height: 2.4rem;
  font-family: var(--display);
  font-size: 1.25rem;
  line-height: 1;
  color: var(--white);
  background: var(--opt);
  border: 2.5px solid var(--ink);
  border-radius: 50%;
}

.option.is-picked {
  color: var(--white);
  background: var(--opt);
  transform: translate(3px, 3px);
  box-shadow: 1px 1px 0 var(--ink);
}

.option.is-picked .badge {
  color: var(--ink);
  background: var(--white);
}

.is-choosing .option:not(.is-picked) {
  opacity: 0.4;
}

/* Choosing who to be matched with */

.pool-card-text {
  display: grid;
  gap: 0.2rem;
}

.pool-card-title {
  font-family: var(--display);
  font-size: 1.5rem;
  line-height: 1;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.pool-card-meta {
  font-size: 0.85rem;
  font-weight: 650;
  color: var(--ink-muted);
}

.pool-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.3rem;
}

.chip {
  padding: 0.14rem 0.45rem 0.06rem;
  font-family: var(--display);
  font-size: 0.8rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--hue-ink);
  background: var(--hue);
  border: 2px solid var(--ink);
}

/* Halfway */

.splash {
  overflow: hidden;
  color: var(--white);
  background: linear-gradient(115deg, var(--dc) 0 50%, var(--ink) 50% calc(50% + 7px), var(--marvel) calc(50% + 7px));
}

.splash::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image: radial-gradient(circle, rgba(0, 0, 0, 0.22) 0 1.6px, transparent 2px);
  background-size: 9px 9px;
  -webkit-mask-image: linear-gradient(to top, #000, transparent 70%);
  mask-image: linear-gradient(to top, #000, transparent 70%);
}

.splash .panel-band {
  position: relative;
  z-index: 1;
}

.splash-body {
  position: relative;
  z-index: 1;
  padding: 1.8rem 1.6rem 2rem;
}

.splash-word {
  font-family: var(--display);
  font-size: clamp(4rem, 13vw, 7.6rem);
  line-height: 0.9;
  text-transform: uppercase;
  -webkit-text-stroke: 4px var(--ink);
  paint-order: stroke fill;
  text-shadow: 6px 6px 0 var(--ink);
}

.splash-title {
  margin-top: 1rem;
  font-family: var(--display);
  font-size: clamp(1.7rem, 4.4vw, 2.5rem);
  font-weight: 400;
  line-height: 1.05;
  text-transform: uppercase;
  text-shadow: 3px 3px 0 var(--ink);
}

.splash .lede {
  max-width: 34rem;
  margin-top: 1.3rem;
  padding: 0.9rem 1.1rem;
}

/* Result: hero */

.result-hero {
  display: grid;
  grid-template-columns: minmax(15rem, 22rem) minmax(0, 1fr);
  gap: 2rem 3.4rem;
  align-items: center;
  margin-bottom: 3rem;
}

.portrait {
  position: relative;
  margin: 1rem 0 0 0.6rem;
  transform: rotate(-2deg);
  animation: portrait-slam 0.55s cubic-bezier(0.2, 0.9, 0.25, 1.15) both;
}

.portrait-frame {
  position: relative;
  padding: 10px;
  background: var(--house);
  border: 3px solid var(--ink);
  box-shadow: 12px 12px 0 var(--ink);
}

.portrait img,
.portrait .monogram {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  background: var(--ink);
  border: 3px solid var(--ink);
}

.portrait .monogram {
  display: none;
  font-size: 6rem;
}

.portrait.is-fallback img {
  display: none;
}

.portrait.is-fallback .monogram {
  display: grid;
}

.portrait-shade {
  position: absolute;
  inset: 13px;
  pointer-events: none;
  background:
    radial-gradient(rgba(17, 17, 24, 0.45) 0.8px, transparent 1.1px) 0 0 / 5px 5px,
    linear-gradient(to top, var(--house) 0%, transparent 38%);
  mix-blend-mode: multiply;
  opacity: 0.3;
}

.seal {
  position: absolute;
  top: -1.1rem;
  left: -0.8rem;
  display: grid;
  place-items: center;
  font-family: var(--display);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
  color: var(--hue-ink);
  background: var(--hue);
  border: 3px solid var(--ink);
  box-shadow: 4px 4px 0 var(--ink);
  transform: rotate(-10deg);
}

.seal.dc {
  width: 4.6rem;
  height: 4.6rem;
  font-size: 1.9rem;
  border-radius: 50%;
}

.seal:not(.dc) {
  padding: 0.3rem 0.7rem 0.2rem;
  font-size: 1.5rem;
}

.burst {
  position: absolute;
  right: -1.6rem;
  bottom: 1.4rem;
  display: grid;
  place-content: center;
  width: 7.4rem;
  aspect-ratio: 1;
  text-align: center;
  transform: rotate(8deg);
  filter: drop-shadow(4px 4px 0 var(--ink));
}

.burst::before,
.burst::after {
  content: "";
  position: absolute;
  clip-path: var(--star);
}

.burst::before {
  inset: 0;
  background: var(--ink);
}

.burst::after {
  inset: 5px;
  background: var(--white);
}

.burst small,
.burst strong {
  position: relative;
  z-index: 1;
  font-family: var(--display);
  font-weight: 400;
  text-transform: uppercase;
  line-height: 1;
}

.burst small {
  font-size: 0.85rem;
  letter-spacing: 0.1em;
}

.burst strong {
  font-size: 2rem;
  color: var(--house-text);
}

.result-name {
  margin: 0.9rem 0 1.4rem;
  font-family: var(--display);
  font-size: clamp(3.3rem, 8.4vw, 7rem);
  font-weight: 400;
  line-height: 0.88;
  letter-spacing: 0.01em;
  text-transform: uppercase;
  color: var(--white);
  -webkit-text-stroke: 3px var(--ink);
  paint-order: stroke fill;
  text-shadow:
    5px 5px 0 var(--ink),
    10px 10px 0 var(--other);
}

.thesis {
  max-width: 40rem;
  padding: 1rem 1.2rem;
  font-size: 1.22rem;
  font-style: italic;
  font-weight: 500;
  line-height: 1.45;
  box-shadow: 6px 6px 0 var(--ink);
}

/* Result: charts */

.alignment {
  margin: 0;
  padding: 1.3rem 1.4rem 1.4rem;
}

.alignment-grid {
  display: grid;
  grid-template-columns: minmax(16rem, 25rem) minmax(0, 1fr);
  gap: 1.5rem 2.2rem;
  align-items: center;
}

.radar {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
}

.ring,
.spoke {
  fill: none;
  stroke: rgba(17, 17, 24, 0.22);
  stroke-width: 1;
}

.ring-mid {
  stroke: rgba(17, 17, 24, 0.5);
  stroke-dasharray: 4 4;
}

.radar-dot {
  fill: var(--ink);
}

.you-fill {
  fill: url(#you-dots);
}

.you-line {
  fill: none;
  stroke: var(--ink);
  stroke-width: 2.5;
  stroke-linejoin: round;
}

.them-shape {
  fill: var(--house-chart);
  fill-opacity: 0.16;
  stroke: var(--house-chart);
  stroke-width: 3.5;
  stroke-linejoin: round;
}

.you-pt {
  fill: var(--ink);
}

.them-pt {
  fill: var(--paper);
  stroke: var(--house-chart);
  stroke-width: 3;
}

.radar-label {
  font-family: var(--display);
  font-size: 16px;
  letter-spacing: 0.05em;
  fill: var(--ink);
}

.matrix {
  display: grid;
  gap: 0.95rem;
}

.matrix-row {
  display: grid;
  grid-template-columns: 4.6rem minmax(6rem, 8rem) minmax(6rem, 1fr) minmax(6rem, 8.2rem);
  gap: 0.6rem;
  align-items: center;
}

.matrix-name {
  font-family: var(--display);
  font-size: 1.05rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.matrix-low,
.matrix-high {
  font-size: 0.8rem;
  font-weight: 560;
  line-height: 1.2;
  color: var(--ink-muted);
}

.matrix-low {
  text-align: right;
}

.matrix-track {
  position: relative;
  height: 18px;
}

.matrix-track::before,
.matrix-track::after,
.matrix-link {
  content: "";
  position: absolute;
}

.matrix-track::before {
  left: 0;
  right: 0;
  top: 7px;
  height: 4px;
  background: rgba(17, 17, 24, 0.14);
}

.matrix-track::after {
  left: 50%;
  top: 1px;
  width: 2px;
  height: 16px;
  background: rgba(17, 17, 24, 0.45);
}

.matrix-link {
  top: 7px;
  height: 4px;
  background: var(--house-chart);
}

.dot {
  position: absolute;
  top: 1px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  transform: translateX(-50%);
}

.dot.you {
  z-index: 2;
  width: 12px;
  height: 12px;
  top: 3px;
  background: var(--ink);
}

.dot.them {
  z-index: 1;
  background: var(--paper);
  box-shadow: inset 0 0 0 3px var(--house-chart);
}

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem 1.4rem;
  margin-top: 1.2rem;
  font-weight: 650;
  font-size: 0.92rem;
}

.swatch {
  display: inline-block;
  width: 0.85rem;
  height: 0.85rem;
  margin-right: 0.45rem;
  border-radius: 50%;
  transform: translateY(0.1rem);
}

.swatch.you {
  background: var(--ink);
}

.swatch.them {
  background: var(--paper);
  box-shadow: inset 0 0 0 3px var(--house-chart);
}

.chart-note {
  margin-top: 0.5rem;
  max-width: 46rem;
  font-size: 0.92rem;
  color: var(--ink-muted);
}

/* Result: reading */

.story {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  gap: 1.6rem;
  align-items: start;
  margin-top: 2.6rem;
}

.essay {
  padding: 1.3rem 1.6rem 1.5rem;
}

.essay p {
  max-width: 42rem;
  font-size: 1.14rem;
  line-height: 1.65;
}

.essay p + p {
  margin-top: 1rem;
}

.essay .lead::first-letter {
  float: left;
  margin: 0.35rem 0.4rem 0 0;
  font-family: var(--display);
  font-size: 4.6rem;
  line-height: 0.8;
  color: var(--house-text);
  text-shadow: 3px 3px 0 var(--ink);
}

.story-side {
  display: grid;
  gap: 1.6rem;
}

.cost-panel {
  padding: 1.3rem 1.4rem 1.4rem;
  color: var(--white);
  background: var(--ink);
  border: 3px solid var(--ink);
  border-left: 12px solid var(--house-chart);
  box-shadow: 8px 8px 0 var(--paper);
}

.cost-panel .section-label {
  color: var(--house-ink);
  background: var(--house);
}

.cost {
  font-size: 1.06rem;
  line-height: 1.6;
}

.shadow {
  padding: 1.3rem 1.4rem 1.4rem;
}

.shadow p {
  line-height: 1.55;
}

.shadow-row {
  display: grid;
  grid-template-columns: 5.4rem minmax(0, 1fr);
  gap: 1rem;
  align-items: start;
}

.shadow-name {
  margin-bottom: 0.3rem;
  font-family: var(--display);
  font-size: 1.5rem;
  line-height: 1;
  text-transform: uppercase;
}

/* Result: pattern */

.pattern {
  margin-top: 2.8rem;
}

.traits {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1.1rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.traits li {
  padding: 0.9rem 1rem 1.05rem;
  background: var(--paper);
  border: 2.5px solid var(--ink);
  box-shadow: 5px 5px 0 var(--ink);
}

.trait-head {
  display: grid;
  gap: 0.1rem;
}

.trait-name {
  font-family: var(--display);
  font-size: 1.45rem;
  line-height: 1;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.trait-lean {
  font-size: 0.74rem;
  font-weight: 750;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--house-text);
}

.mark {
  display: block;
  height: 12px;
  margin: 0.65rem 0 0.7rem;
  background:
    linear-gradient(90deg, var(--house) 0 var(--extent), transparent var(--extent)),
    var(--paper-2);
  border: 2px solid var(--ink);
}

.traits p {
  font-size: 0.95rem;
  line-height: 1.5;
}

/* Universe toggle */

.pool-toggle {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: stretch;
  margin-top: 1.2rem;
  background: var(--white);
  border: 2.5px solid var(--ink);
  box-shadow: 4px 4px 0 var(--ink);
}

.pool-label {
  display: flex;
  align-items: center;
  padding: 0.4rem 0.75rem 0.35rem;
  font-size: 0.72rem;
  font-weight: 750;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  border-right: 2.5px solid var(--ink);
}

.pool-option {
  padding: 0.42rem 0.9rem 0.34rem;
  font-size: 1rem;
  background: transparent;
  border: 0;
  border-right: 2.5px solid var(--ink);
  box-shadow: none;
}

.pool-option:last-child {
  border-right: 0;
}

.pool-option:hover,
.pool-option:active {
  transform: none;
  box-shadow: none;
  background: var(--paper-2);
}

.pool-option[aria-pressed="true"] {
  color: var(--white);
  background: var(--ink);
}

.pool-option:focus-visible {
  outline-offset: -6px;
  outline-color: var(--marvel);
}

/* Five choices wrap unevenly on a phone, so lay them out as a tidy grid with ink rules between cells. */
@media (max-width: 560px) {
  .pool-toggle {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 2.5px;
    background: var(--ink);
  }

  .pool-label,
  .pool-option {
    border-right: 0;
    background: var(--white);
  }

  .pool-label,
  .pool-option:last-child {
    grid-column: 1 / -1;
  }
}

/* Result: alternate results */

.alternates {
  margin-top: 2.8rem;
}

.alt-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(13.5rem, 1fr));
  gap: 1rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.alt-card {
  padding: 0.6rem;
  background: var(--paper);
  border: 2.5px solid var(--ink);
  box-shadow: 5px 5px 0 var(--ink);
}

.alt-card .peek-btn {
  display: grid;
  grid-template-columns: 4.6rem minmax(0, 1fr);
  gap: 0.8rem;
  align-items: center;
}

.alt-text {
  display: grid;
  gap: 0.2rem;
}

.alt-house {
  justify-self: start;
  padding: 0.12rem 0.45rem 0.06rem;
  font-family: var(--display);
  font-size: 0.82rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--hue-ink);
  background: var(--hue);
}

.alt-name {
  font-family: var(--display);
  font-size: 1.3rem;
  line-height: 1.05;
  text-transform: uppercase;
}

.alt-pct {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--hue-text);
}

/* Result: whole bank */

.bank {
  margin-top: 2.8rem;
}

.bank-note {
  margin: -0.4rem 0 1.1rem;
  font-weight: 650;
  color: var(--on-bg);
  text-shadow: 1px 1px 0 var(--on-bg-shadow);
}

.bank-more {
  margin-top: 1.4rem;
}

.bank-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(6.6rem, 1fr));
  gap: 1rem 0.8rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.tile {
  position: relative;
  display: grid;
  padding: 5px 5px 8px;
  background: var(--paper);
  border: 2.5px solid var(--ink);
  box-shadow: 4px 4px 0 var(--ink);
}

.tile[hidden] {
  display: none;
}

.tile-art {
  position: relative;
}

.tile-rank {
  position: absolute;
  top: 0;
  left: 0;
  padding: 0.12rem 0.32rem 0.05rem;
  font-family: var(--display);
  font-size: 0.82rem;
  color: var(--white);
  background: var(--ink);
}

.tile-burst {
  position: absolute;
  top: -1.1rem;
  right: -1.1rem;
  display: grid;
  place-items: center;
  width: 3.4rem;
  aspect-ratio: 1;
  font-family: var(--display);
  font-size: 1rem;
  text-transform: uppercase;
  color: var(--hue-ink);
  background: var(--hue);
  clip-path: var(--star);
  transform: rotate(-12deg);
}

.tile-name {
  margin-top: 0.4rem;
  font-size: 0.74rem;
  font-weight: 750;
  font-stretch: 85%;
  line-height: 1.15;
  text-transform: uppercase;
}

.tile-pct {
  margin-top: 0.15rem;
  font-family: var(--display);
  font-size: 1.25rem;
  line-height: 1.05;
  color: var(--hue-text);
}

.tile-bar {
  display: block;
  height: 6px;
  margin-top: 0.3rem;
  background:
    linear-gradient(90deg, var(--ink) 0 var(--extent), transparent var(--extent)),
    var(--paper-2);
}

.tile.is-match {
  background: var(--white);
  outline: 4px solid var(--on-bg);
  outline-offset: 3px;
}

.tile.is-far {
  background: #d8d3c7;
}

.tile.is-far img {
  filter: grayscale(1) contrast(0.85) brightness(0.85);
}

/* Result: footer */

.disclaimer {
  margin-top: 2.6rem;
  font-size: 0.92rem;
  font-weight: 650;
  color: var(--on-bg);
  text-shadow: 1px 1px 0 var(--on-bg-shadow);
}

body[data-screen="result"] .actions {
  margin-top: 1rem;
}

/* Motion */

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes slam {
  from {
    opacity: 0;
    transform: scale(1.05) rotate(-1.2deg);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes portrait-slam {
  from {
    opacity: 0;
    transform: scale(1.18) rotate(-7deg);
  }
  to {
    opacity: 1;
    transform: rotate(-2deg);
  }
}

.rise {
  animation: rise 0.45s ease-out both;
  animation-delay: calc(var(--i, 0) * 70ms);
}

.panel-enter {
  animation: slam 0.3s cubic-bezier(0.2, 0.9, 0.3, 1.15) both;
}

@supports (animation-timeline: view()) {
  .reveal {
    animation: rise linear both;
    animation-timeline: view();
    animation-range: entry 0% entry 35%;
  }
}

/* Reaction after each answer */

.reaction {
  position: relative;
  margin-top: 1.1rem;
  padding: 0.85rem 1.1rem 1rem;
  overflow: hidden;
  font-size: 1.15rem;
  font-style: italic;
  font-weight: 600;
  line-height: 1.4;
  color: var(--white);
  background: var(--ink);
  border: 3px solid var(--ink);
  box-shadow: 5px 5px 0 var(--tone);
  animation: rise 0.25s ease-out both;
}

.reaction::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  height: 4px;
  width: 100%;
  background: var(--tone);
  transform-origin: left;
  animation: read-timer var(--read, 1600ms) linear both;
}

@keyframes read-timer {
  from {
    transform: scaleX(0);
  }
  to {
    transform: scaleX(1);
  }
}

/* Halfway teaser */

.teaser {
  display: grid;
  grid-template-columns: 5.6rem minmax(0, 1fr);
  gap: 1rem;
  align-items: center;
  max-width: 34rem;
  margin-top: 1.3rem;
  padding: 0.75rem;
  color: var(--ink);
  background: var(--white);
  border: 2.5px solid var(--ink);
  box-shadow: 4px 4px 0 var(--ink);
}

.teaser-card {
  position: relative;
}

.teaser-card img {
  filter: blur(7px) grayscale(0.35) brightness(0.8);
  transform: scale(1.15);
}

.teaser-mark {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-family: var(--display);
  font-size: 2.6rem;
  color: var(--white);
  text-shadow: 3px 3px 0 var(--ink);
}

.teaser-kicker {
  font-size: 0.72rem;
  font-weight: 750;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-muted);
}

.teaser-hint {
  margin-top: 0.2rem;
  font-family: var(--display);
  font-size: 1.25rem;
  line-height: 1.15;
  text-transform: uppercase;
}

/* The reveal */

.reveal-panel {
  display: grid;
  justify-items: center;
  gap: 0.6rem;
  padding: 1.6rem 1.4rem 1.2rem;
  text-align: center;
}

.reveal-kicker {
  font-family: var(--display);
  font-size: clamp(1.8rem, 5vw, 2.8rem);
  line-height: 1;
  text-transform: uppercase;
}

.reveal-kicker::after {
  content: "...";
  display: inline-block;
  width: 1.4em;
  text-align: left;
  animation: dots 1.2s steps(4, end) infinite;
  overflow: hidden;
  vertical-align: bottom;
}

@keyframes dots {
  from {
    width: 0;
  }
  to {
    width: 1.4em;
  }
}

.reveal-web {
  width: min(22rem, 100%);
}

.reveal-web .you-fill,
.reveal-web .you-line,
.reveal-web .you-pt {
  transform-box: view-box;
  transform-origin: 50% 50%;
  animation: web-grow 1.7s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.reveal-web .ring,
.reveal-web .spoke,
.reveal-web .radar-label {
  animation: rise 0.6s ease-out both;
}

@keyframes web-grow {
  from {
    opacity: 0;
    transform: scale(0);
  }
  60% {
    opacity: 1;
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.reveal-note {
  font-size: 0.78rem;
  font-weight: 650;
  color: var(--ink-muted);
}

body.is-revealing::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 60;
  pointer-events: none;
  background: var(--white);
  animation: impact 0.6s ease-out both;
}

@keyframes impact {
  from {
    opacity: 0.9;
  }
  to {
    opacity: 0;
  }
}

/* A friend's shared result */

.shared-note {
  max-width: 40rem;
  margin-top: 1rem;
  padding: 0.7rem 1rem;
  font-weight: 600;
}

/* You vs a friend */

.compare {
  margin-bottom: 2.6rem;
  padding: 1.3rem 1.4rem 1.4rem;
}

.compare-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem 3rem;
}

.compare-pair {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.compare-card {
  display: grid;
  width: 6.4rem;
  gap: 0.15rem;
}

.compare-who {
  margin-top: 0.3rem;
  font-size: 0.7rem;
  font-weight: 750;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-muted);
}

.compare-name {
  font-family: var(--display);
  font-size: 1.05rem;
  line-height: 1.05;
  text-transform: uppercase;
}

.compare-vs {
  font-family: var(--display);
  font-size: 2rem;
  color: var(--white);
  -webkit-text-stroke: 2px var(--ink);
  paint-order: stroke fill;
  text-shadow: 3px 3px 0 var(--ink);
}

.compare-score {
  font-family: var(--display);
  font-size: 1.6rem;
  text-transform: uppercase;
}

.compare-score strong {
  margin-right: 0.3rem;
  font-size: 3.6rem;
  font-weight: 400;
  color: var(--house-chart);
  -webkit-text-stroke: 2px var(--ink);
  paint-order: stroke fill;
}

.compare-grid {
  display: grid;
  grid-template-columns: minmax(16rem, 23rem) minmax(0, 1fr);
  gap: 1.4rem 2.2rem;
  align-items: center;
  margin-top: 1.2rem;
}

.compare-label {
  margin-top: 1rem;
  font-size: 0.72rem;
  font-weight: 750;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-muted);
}

.compare-label:first-child {
  margin-top: 0;
}

.compare-list {
  display: grid;
  gap: 0.45rem;
  margin: 0.4rem 0 0;
  padding: 0;
  list-style: none;
}

.compare-list li {
  padding: 0.55rem 0.75rem;
  font-weight: 560;
  line-height: 1.4;
  background: var(--white);
  border: 2px solid var(--ink);
}

/* Share with friends */

.share {
  margin-top: 2.8rem;
  padding: 1.3rem 1.4rem 1.4rem;
}

.share-note {
  max-width: 40rem;
  line-height: 1.5;
}

.share-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.9rem;
  margin-top: 1rem;
}

.share-field {
  display: grid;
  gap: 0.3rem;
  flex: 1 1 14rem;
  max-width: 22rem;
}

.share-field-label {
  font-size: 0.72rem;
  font-weight: 750;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-muted);
}

.share-field input,
.share-link {
  width: 100%;
  padding: 0.6rem 0.75rem;
  font: inherit;
  font-weight: 560;
  color: var(--ink);
  background: var(--white);
  border: 2.5px solid var(--ink);
  border-radius: 0;
}

.share-field input:focus-visible,
.share-link:focus-visible {
  outline: 3px solid var(--ink);
  outline-offset: 2px;
}

.share-link {
  margin-top: 0.8rem;
  font-size: 0.85rem;
}

@media (max-width: 860px) {
  .compare-grid {
    grid-template-columns: 1fr;
  }

  .compare-grid .web {
    max-width: 24rem;
    width: 100%;
    margin: 0 auto;
  }
}

@media (max-width: 560px) {
  .reaction {
    font-size: 1.02rem;
  }

  .compare,
  .share {
    padding: 1.1rem 1rem 1.2rem;
  }

  .compare-card {
    width: 5.2rem;
  }

  .compare-score strong {
    font-size: 2.8rem;
  }
}

/* Saving the page as an image or PDF: freeze every animation at its finished state */

body.is-capturing *,
body.is-capturing *::before,
body.is-capturing *::after {
  animation: none !important;
  transition: none !important;
}

body.is-capturing .no-capture {
  display: none !important;
}

button:disabled {
  cursor: progress;
  opacity: 0.75;
}

/* Character cards: tap a portrait to read who they are */

.cast-hint {
  grid-column: 1 / -1;
  justify-self: start;
  margin-bottom: -0.8rem;
}

.peek-btn {
  display: block;
  width: 100%;
  margin: 0;
  padding: 0;
  font: inherit;
  letter-spacing: inherit;
  text-align: inherit;
  text-transform: inherit;
  color: inherit;
  background: none;
  border: 0;
  box-shadow: none;
}

.peek-btn:hover,
.peek-btn:active {
  transform: none;
  box-shadow: none;
}

.peek-btn:hover .thumb,
.peek-btn[aria-expanded="true"] .thumb {
  outline: 3px solid var(--ink);
  outline-offset: 2px;
}

.peek-btn:focus-visible {
  outline: 3px solid var(--ink);
  outline-offset: 4px;
}

.tile .peek-btn {
  display: grid;
}

.peek-card {
  position: fixed;
  inset: auto;
  z-index: 50;
  width: min(23rem, calc(100vw - 24px));
  max-height: min(72vh, 34rem);
  margin: 0;
  overflow: auto;
  padding: 1rem 1.1rem 1.1rem;
  color: var(--ink);
  background: var(--white);
  border: 3px solid var(--ink);
  box-shadow: 8px 8px 0 var(--hue, var(--ink));
}

.peek-card:focus {
  outline: none;
}

.peek-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.55rem;
}

.peek-name {
  font-family: var(--display);
  font-size: 1.6rem;
  line-height: 1;
  text-transform: uppercase;
}

.peek-tagline {
  margin-top: 0.55rem;
  font-weight: 600;
  line-height: 1.4;
}

.peek-label {
  margin-top: 0.85rem;
  font-size: 0.72rem;
  font-weight: 750;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--hue-text);
}

.peek-thesis {
  margin-top: 0.25rem;
  font-style: italic;
  line-height: 1.5;
}

.peek-traits {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin: 0.85rem 0 0;
  padding: 0;
  list-style: none;
}

.peek-traits li {
  padding: 0.2rem 0.5rem 0.15rem;
  font-size: 0.78rem;
  font-weight: 650;
  background: var(--paper-2);
  border: 2px solid var(--ink);
}

.peek-traits strong {
  margin-right: 0.35rem;
  font-family: var(--display);
  font-weight: 400;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.peek-match {
  margin-top: 0.85rem;
  font-family: var(--display);
  font-size: 1.2rem;
  color: var(--hue-text);
}

.peek-note {
  margin-top: 0.85rem;
  font-size: 0.85rem;
  color: var(--ink-muted);
}

@media (max-width: 560px) {
  .peek-card {
    top: auto;
    right: 12px;
    bottom: 12px;
    left: 12px;
    width: auto;
  }
}

/* Screen-reader only */

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Smaller screens */

@media (max-width: 1080px) {
  .traits {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .alignment-grid,
  .story {
    grid-template-columns: 1fr;
  }

  .web {
    max-width: 26rem;
    width: 100%;
    margin: 0 auto;
  }
}

@media (max-width: 860px) {
  .intro-stage,
  .result-hero {
    grid-template-columns: 1fr;
  }

  .cover-title {
    font-size: clamp(5rem, 25vw, 9rem);
  }

  .cover-blurb {
    justify-self: stretch;
    max-width: none;
  }

  .roster {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .roster.is-small {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .portrait {
    max-width: 17rem;
  }

  .matrix-row {
    grid-template-columns: 1fr 1fr;
    gap: 0.2rem 0.6rem;
  }

  .matrix-name,
  .matrix-track {
    grid-column: 1 / -1;
  }

  .matrix-name {
    grid-row: 1;
  }

  .matrix-track {
    grid-row: 2;
  }

  .matrix-low {
    grid-row: 3;
    grid-column: 1;
    text-align: left;
  }

  .matrix-high {
    grid-row: 3;
    grid-column: 2;
    text-align: right;
  }
}

@media (max-width: 560px) {
  :root {
    --shadow: 5px 5px 0 var(--ink);
  }

  .mast-title em {
    display: none;
  }

  .cover-title .line {
    -webkit-text-stroke-width: 3px;
    text-shadow:
      4px 4px 0 var(--ink),
      8px 8px 0 var(--marvel);
  }

  .roster {
    gap: 0.7rem 0.5rem;
    padding: 0.7rem;
  }

  .panel-band {
    flex-wrap: wrap;
    gap: 0.5rem;
  }

  .progress {
    flex-basis: 100%;
  }

  .panel-body {
    padding: 1.1rem 1rem 1.2rem;
  }

  .scene-mark {
    font-size: 4.6rem;
    right: 0.7rem;
  }

  .scene-title {
    padding-right: 3.6rem;
  }

  .scene-prompt,
  .lede,
  .thesis {
    font-size: 1.1rem;
  }

  .option {
    grid-template-columns: 2.1rem minmax(0, 1fr);
    gap: 0.75rem;
    padding: 0.75rem 0.85rem;
    font-size: 1rem;
  }

  .badge {
    width: 2.1rem;
    height: 2.1rem;
    font-size: 1.1rem;
  }

  .splash-word {
    -webkit-text-stroke-width: 3px;
  }

  .result-name {
    -webkit-text-stroke-width: 2px;
    text-shadow:
      4px 4px 0 var(--ink),
      7px 7px 0 var(--other);
  }

  .portrait {
    max-width: 15rem;
  }

  .burst {
    right: -1rem;
    width: 6.2rem;
  }

  .burst strong {
    font-size: 1.7rem;
  }

  .alignment,
  .essay,
  .shadow,
  .cost-panel {
    padding: 1.1rem 1rem 1.2rem;
  }

  .radar-label {
    font-size: 19px;
  }

  .traits {
    grid-template-columns: 1fr;
  }

  .bank-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

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