/* ==========================================================================
   Rather — the house site

   One contrast, repeated: grey for what's made for everyone, ink and colour
   for what's yours. The badges, "Best" and the plain squares are grey; the
   name, "Rather" and the shapes in the field are ink and colour. Heavy sans
   throughout; a serif italic, in colour, only for a phrase about you.
   One design, with dark and bright in it, whatever the system prefers. Dark
   is only the two ends, a deep pine: the headline and the name. Everything
   between them is bright: a pale sage for what feels off and for Best
   against Rather, then two bands in the products' own colours, Tuesdays'
   lime and Second Draft's pink. The name is lime; what's yours on the light
   ground is rose. The pictures play their idea when left alone, and hand
   over at a tap. No scripts.
   ========================================================================== */

@font-face {
  font-family: "Geist";
  src: url("fonts/geist.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}
/* Only for the two products' names, each set as it is on its own site. */
@font-face {
  font-family: "Fraunces";
  src: url("fonts/fraunces.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}
@font-face {
  font-family: "Source Serif 4";
  src: url("fonts/source-serif-4-italic.woff2") format("woff2");
  font-style: italic;
  font-weight: 200 900;
  font-display: swap;
}
@font-face {
  font-family: "Literata";
  src: url("fonts/literata-italic.woff2") format("woff2");
  font-style: italic;
  font-weight: 200 900;
  font-display: swap;
}

:root {
  /* The page is dark; the band and the panels are light. Every colour that
     differs between them is one pair: light-dark(light, dark). */
  color-scheme: dark;

  /* Two voices, and they contrast hard. The sans, heavy and plain, is how
     things are said to everyone, and how I say what I do. The serif italic,
     in colour, is only ever what's yours. */
  --serif: "Literata", ui-serif, Georgia, serif;
  --sans:
    "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;

  --bg: light-dark(#ecefe4, #0f1f1a);
  --text: light-dark(#14211b, #ecf2ee);
  --soft: light-dark(#3f4a44, #c0cdc6);
  --muted: light-dark(#5a645e, #9db0a6);
  --thing-solid: light-dark(#dde2d3, #1f362e);
  --outline: light-dark(#848b86, #9db0a6);
  /* Stars and chips, the marks of a good badge: quiet, never heavy. */
  --mark-grey: light-dark(#bfc3be, #8da097);
  --chip-bg: light-dark(#eef0ec, #1f362e);
  --chip-line: light-dark(#d9dcd7, transparent);
  --chip-star: light-dark(#a3a9a3, #c0cdc6);
  /* "Best asks everyone" is set in grey: the many. Display sizes only, where
     3:1 is enough. */
  --grey-line: light-dark(#7c847e, #6f857a);
  --hairline: light-dark(rgba(20, 33, 27, 0.12), rgba(236, 242, 238, 0.14));
  --mark-thing: light-dark(#c3c9c4, #4a6a5c);

  /* Two colours run through the page, and both come from the family: lime
     (Tuesdays) wherever the ground is dark, pink and its rose (Second Draft)
     wherever it is light. So what's yours is lime in the headline and the
     name, and rose on stone; the two bands near the end say whose they are.
     Four inks in all: the two above, amber and blue. They colour the shapes
     in the field and the squares you claim. On the light ground the fills
     are a little deeper so the shapes hold. */
  --ink-1: light-dark(#dc9d22, #e3a93c);
  --ink-2: light-dark(#b4d232, #d4f25c);
  --ink-3: light-dark(#de7fa4, #edb9cf);
  --ink-4: light-dark(#2a78d6, #4c93ea);
  --ink-text-1: light-dark(#8a5d00, #e3a93c);
  --ink-text-2: light-dark(#4a5c00, #d4f25c);
  --ink-text-3: light-dark(#965673, #edb9cf);
  --ink-text-4: light-dark(#2468d0, #6aa6f0);
  --yours-1: light-dark(#de7fa4, #d4f25c);
  --yours-text: light-dark(#965673, #d4f25c);

  /* The two ways wear their example's own colours, as the products use
     them: Tuesdays' lime with its ink, Second Draft's pink with its plum. */
  --choose-bg: #d4f25c;
  --choose-ink: #17191c;
  --choose-ink-2: #2e3a00;
  --choose-mass: rgba(23, 25, 28, 0.15);
  --choose-ring: transparent;
  --make-bg: #f7d6de;
  --make-ink: #4a2138;
  --make-ink-2: #6a3c55;

  /* A plain star: a good badge. */
  --star: url("data:image/svg+xml,%3Csvg%20xmlns=%27http://www.w3.org/2000/svg%27%20viewBox=%270%200%20100%20100%27%3E%3Cpolygon%20points=%2750.0%2C10.0%2060.3%2C35.8%2088.0%2C37.6%2066.6%2C55.4%2073.5%2C82.4%2050.0%2C67.5%2026.5%2C82.4%2033.4%2C55.4%2012.0%2C37.6%2039.7%2C35.8%27%20stroke=%27black%27%20stroke-width=%279%27%20stroke-linejoin=%27round%27/%3E%3C/svg%3E");

  /* One square, as a mask: the average. */
  --tile: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E%3Crect x='27' y='27' width='46' height='46' rx='10'/%3E%3C/svg%3E");

  /* Four sizes and the name. A display size for every heading; one size
     for the promise under the name, which says what I make; a large text
     size for what is said plainly; and a text size nothing goes below. */
  --display: clamp(34px, 5vw, 72px);
  --text-xl: clamp(24px, 3.1vw, 46px);
  --text-l: clamp(20px, 2.1vw, 30px);
  --text-m: clamp(17px, 1.45vw, 21px);

  --wide: 1360px;
  --gutter: clamp(20px, 5vw, 72px);
  --section: clamp(80px, 10vw, 144px);
  --gap: clamp(16px, 2vw, 28px);
  /* Where the site's wrapped content begins, for full-bleed panels. */
  --edge: max(var(--gutter), calc((100vw - var(--wide)) / 2 + var(--gutter)));
}

/* The middle of the page is the opposite of its ends. Every colour is a
   light-dark() pair, so flipping the scheme here flips them all. */
.off,
.versus {
  color-scheme: light;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 18px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1,
h2,
p {
  margin: 0;
}

h1,
h2 {
  font-weight: 760;
  letter-spacing: -0.045em;
  line-height: 0.98;
}

p {
  text-wrap: pretty;
}

a {
  color: inherit;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
}

/* What's yours: the serif italic, in colour. Inside heavy sans it is set a
   little larger and bolder, so the two sit on one line as equals. */
em {
  font-family: var(--serif);
  font-style: italic;
  font-optical-sizing: auto;
  color: var(--yours-text);
}

:focus-visible {
  outline: 2px solid var(--yours-text);
  outline-offset: 4px;
  border-radius: 2px;
}

::selection {
  background: var(--yours-1);
  color: #1e1b21;
}

.wrap {
  max-width: var(--wide);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.skip {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 10;
  padding: 10px 16px;
  background: var(--yours-1);
  color: #1e1b21;
  font-size: 15px;
  transform: translateY(-200%);
}

.skip:focus {
  transform: none;
}

/* --------------------------------------------------------------------------
   Wordmark, masthead, colophon
   -------------------------------------------------------------------------- */

.masthead {
  padding-block: 24px;
}

/* The name: lowercase, heavy, plain. */
.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 0.4em;
  min-height: 44px;
  font-size: 40px;
  font-weight: 820;
  line-height: 1;
  letter-spacing: -0.055em;
  color: var(--text);
  text-decoration: none;
}

.wordmark .mark {
  width: 1.05em;
  height: 1.05em;
  flex-shrink: 0;
}

.wordmark:hover {
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 0.18em;
}

/* --------------------------------------------------------------------------
   Hero: the badges, in grey, say what everyone says. Then the page asks you,
   and the name is as large as the page allows, in the colour that's yours.
   -------------------------------------------------------------------------- */

.hero {
  padding-top: clamp(20px, 3.4vw, 56px);
  padding-bottom: clamp(56px, 7.5vw, 112px);
}

.hero h1 > span {
  display: block;
}

.hero .badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45em 0.5em;
  margin-bottom: clamp(22px, 3vw, 44px);
  font-size: clamp(17px, 2.3vw, 32px);
  letter-spacing: -0.02em;
  line-height: 1;
}

.hero .badges .chip {
  margin: 0;
  padding: 0.34em 0.8em 0.38em 0.6em;
  font-size: 1em;
  font-weight: 560;
  letter-spacing: -0.02em;
  line-height: 1;
  color: var(--muted);
  vertical-align: baseline;
}

.hero .ask {
  font-size: var(--display);
  font-weight: 780;
  letter-spacing: -0.045em;
  line-height: 1;
}

/* The name, wherever it is set this large. */
.giant {
  display: block;
  margin-top: 0.02em;
  margin-left: -0.045em;
  font-weight: 820;
  letter-spacing: -0.06em;
  line-height: 0.86;
  white-space: nowrap;
}

.hero .giant {
  font-size: min(30vw, 420px);
  color: var(--yours-1);
}

/* Under it, the same contrast in a sentence: the badges and what they say in
   grey, what I do in ink, what's yours in colour. */
.lede {
  max-width: 21em;
  margin-top: clamp(24px, 3vw, 44px);
  font-size: var(--text-xl);
  font-weight: 560;
  line-height: 1.18;
  letter-spacing: -0.032em;
}

.lede .grey {
  color: var(--muted);
}

/* The badges are set as badges, in grey: the voice of the many. */
.chip {
  display: inline-block;
  margin-block: 0.06em;
  margin-right: -0.04em;
  padding: 0.14em 0.6em 0.16em 0.44em;
  border-radius: 999px;
  background: var(--chip-bg);
  box-shadow: inset 0 0 0 1px var(--chip-line);
  font-size: 0.7em;
  font-weight: 520;
  letter-spacing: -0.005em;
  line-height: 1.25;
  color: var(--soft);
  white-space: nowrap;
  vertical-align: 0.12em;
}

.nb {
  white-space: nowrap;
}

.chip::before {
  content: "";
  display: inline-block;
  width: 0.7em;
  height: 0.7em;
  margin-right: 0.3em;
  vertical-align: -0.05em;
  background: var(--chip-star);
  -webkit-mask: var(--star) center / contain no-repeat;
  mask: var(--star) center / contain no-repeat;
}

/* --------------------------------------------------------------------------
   The turn: identical squares from edge to edge, and your piece loose in one
   of them. An arch in a square, gaps at the corners. You notice before you
   can say why. Hover it, or tap, and it tries to settle, and can't.
   -------------------------------------------------------------------------- */

.off {
  background: var(--bg);
  color: var(--text);
  padding-bottom: var(--section);
}

.offgrid {
  --sq-gap: clamp(6px, 0.9vw, 14px);
  display: grid;
  grid-template-columns: repeat(var(--cols), minmax(0, 1fr));
  gap: var(--sq-gap);
  padding: var(--sq-gap);
}

.offgrid > * {
  position: relative;
  aspect-ratio: 1;
}

/* The exceptions are placed by hand; the plain squares flow around them. */
.offgrid > [class*="e-"] {
  grid-column: var(--x) / span var(--w, 1);
  grid-row: var(--y) / span var(--h, 1);
}

.offgrid .big {
  --w: 2;
  --h: 2;
}

.offgrid .pill {
  --w: 2;
  aspect-ratio: auto;
}

.offgrid {
  --cols: 16;
}

.offgrid label:nth-of-type(n + 61) {
  display: none;
}

.e-big1 {
  --x: 3;
  --y: 1;
}

.e-pill1 {
  --x: 7;
  --y: 1;
}

.e-mpill {
  --x: 12;
  --y: 1;
}

.e-ucircle {
  --x: 16;
  --y: 2;
}

.e-mdiamond {
  --x: 8;
  --y: 2;
}

.e-pill2 {
  --x: 1;
  --y: 3;
}

.e-odd {
  --x: 10;
  --y: 3;
}

.e-big2 {
  --x: 13;
  --y: 3;
}

.e-uarch {
  --x: 6;
  --y: 4;
}

.e-mcircle {
  --x: 4;
  --y: 5;
}

.e-chosen {
  --x: 9;
  --y: 5;
}

.e-udiamond {
  --x: 15;
  --y: 5;
}

.cell,
.odd {
  border-radius: 22%;
  background: var(--thing-solid);
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  -webkit-user-select: none;
  user-select: none;
}

.cell input,
.odd input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
}

/* The piece that is you: an arch, loose in a square slot. */
.odd b {
  position: absolute;
  inset: 13% 14% 7%;
  border-radius: 999px 999px 0 0;
  background: var(--yours-1);
  rotate: 7deg;
  transform-origin: 50% 100%;
  box-shadow: 4px 4px 0 color-mix(in srgb, var(--yours-1) 40%, var(--bg));
  pointer-events: none;
}

/* Made for everyone, and big enough to dominate. They wear a good badge: a
   plain star, in grey. Colour is only ever what's yours. */
.big {
  border-radius: 13%;
  background: var(--thing-solid);
}

.big::after {
  content: "";
  position: absolute;
  top: 9%;
  right: 9%;
  width: 13%;
  height: 13%;
  background: var(--mark-grey);
  -webkit-mask: var(--star) center / contain no-repeat;
  mask: var(--star) center / contain no-repeat;
}

/* Chosen because it fits: a ring, around one of the big ones and around a
   small plain one. */
.big.ring,
.chosen::before {
  box-shadow:
    0 0 0 calc(var(--sq-gap) * 0.32) var(--bg),
    0 0 0 calc(var(--sq-gap) * 0.32 + 2px) var(--yours-1);
}

.chosen::before {
  content: "";
  position: absolute;
  inset: 17%;
  border-radius: 20%;
  background: var(--thing-solid);
}

/* Never made: an outline, and nothing in it. */
.unmade::before,
.made::before {
  content: "";
  position: absolute;
  inset: 12%;
}

.unmade::before {
  border: 1.5px dashed var(--outline);
}

.pill::before {
  inset: 24% 5%;
  border-radius: 999px;
}

.circle::before {
  border-radius: 50%;
}

.arch::before {
  inset: 12% 16% 10%;
  border-radius: 999px 999px 0 0;
}

.diamond::before {
  inset: 22%;
  border-radius: 12%;
  rotate: 45deg;
}

/* Made your way: the colour is the point, and it's placed by hand, a little
   tilted, with a flat second layer a hair off register, like a print pulled
   by a person. The grey ones are perfect copies. */
.made::before {
  background: var(--c);
  rotate: var(--r, 0deg);
  box-shadow: 3px 3px 0 color-mix(in srgb, var(--c) 40%, var(--bg));
}

.made.diamond::before {
  rotate: calc(45deg + var(--r, 0deg));
}

/* Claim a square. Hover shows what it could be (in dashes); a click makes
   it, in colour; another click puts it back. No two claimed ones are alike:
   each has its own shape, tilt, size and nudge, where the grey are copies. */
.cell {
  --c: var(--ink-1);
  --ghost: color-mix(in srgb, var(--c) 40%, var(--bg));
  transition: background-color 0.12s;
}

.cell.c2 {
  --c: var(--ink-2);
}

.cell.c3 {
  --c: var(--ink-3);
}

.cell.c4 {
  --c: var(--ink-4);
}

.cell::before {
  content: "";
  position: absolute;
  inset: 12%;
  opacity: 0;
  scale: 0.55;
  transition:
    scale 0.28s cubic-bezier(0.3, 1.5, 0.5, 1),
    rotate 0.28s cubic-bezier(0.3, 1.5, 0.5, 1),
    translate 0.28s cubic-bezier(0.3, 1.5, 0.5, 1),
    opacity 0.12s;
  pointer-events: none;
}

.cell.sq::before {
  border-radius: 22%;
}

.cell.ci::before {
  border-radius: 50%;
}

.cell.ar::before {
  border-radius: 999px 999px 0 0;
}

.cell.di::before {
  inset: 19%;
  border-radius: 12%;
  rotate: 45deg;
}

@media (hover: hover) {
  .cell:hover {
    background: transparent;
  }

  .cell:hover::before {
    opacity: 1;
    scale: 0.92;
    border: 1.5px dashed var(--outline);
  }
}

/* Until you've claimed one, two squares show now and then what a tap or a
   click would do. */
@keyframes beckon {
  0%,
  22%,
  100% {
    opacity: 0;
    scale: 0.55;
  }
  6%,
  16% {
    opacity: 1;
    scale: 0.92;
  }
}

@keyframes clear {
  6%,
  16% {
    background-color: transparent;
  }
}

@media (prefers-reduced-motion: no-preference) {
  .offgrid:not(:has(.cell input:checked)) .cell.nudge {
    animation: clear 9s ease var(--d, 1.4s) infinite;
  }

  .offgrid:not(:has(.cell input:checked)) .cell.nudge::before {
    border: 1.5px dashed var(--outline);
    animation: beckon 9s ease var(--d, 1.4s) infinite;
  }
}

.cell:has(input:checked) {
  background: transparent;
}

.cell:has(input:checked)::before {
  opacity: 1;
  scale: var(--k, 1);
  rotate: var(--r, 0deg);
  translate: var(--dx, 0) var(--dy, 0);
  border: 0;
  background: var(--c);
  box-shadow: 3px 3px 0 var(--ghost);
}

.cell.di:has(input:checked)::before {
  rotate: calc(45deg + var(--r, 0deg));
}

@keyframes try-a {
  0%,
  100% {
    rotate: 7deg;
  }
  20% {
    rotate: -8deg;
  }
  42% {
    rotate: 13deg;
  }
  64% {
    rotate: -4deg;
  }
  82% {
    rotate: 10deg;
  }
}

@keyframes try-b {
  0%,
  100% {
    rotate: 7deg;
  }
  20% {
    rotate: -8deg;
  }
  42% {
    rotate: 13deg;
  }
  64% {
    rotate: -4deg;
  }
  82% {
    rotate: 10deg;
  }
}

/* Left alone, the piece tries again every few seconds, and still can't. */
@keyframes try-loop {
  0%,
  86%,
  100% {
    rotate: 7deg;
  }
  89% {
    rotate: -8deg;
  }
  92% {
    rotate: 13deg;
  }
  95% {
    rotate: -4deg;
  }
  98% {
    rotate: 10deg;
  }
}

@media (prefers-reduced-motion: no-preference) {
  .odd b {
    animation: try-loop 7s ease-in-out 2.5s infinite;
  }
}

@media (hover: hover) {
  .odd:hover b {
    animation: try-a 0.9s ease;
  }
}

.odd:has(input:checked) b {
  animation: try-b 0.9s ease;
}

.off-copy {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: var(--gap);
  padding-top: clamp(48px, 6.5vw, 104px);
}

.off-line {
  grid-column: 1 / span 10;
  font-size: var(--display);
  font-weight: 760;
  letter-spacing: -0.045em;
  line-height: 1;
  text-wrap: balance;
}

.off-line em {
  font-weight: 620;
  letter-spacing: -0.03em;
  white-space: nowrap;
}

/* One word sits a little off, like the piece above it. */
.offbeat {
  display: inline-block;
  rotate: 6deg;
  translate: 0.02em 0.05em;
  transform-origin: 0 100%;
}

/* The relief, said plainly; then why. */
.off-relief {
  grid-column: 4 / span 7;
  margin-top: clamp(32px, 3.8vw, 56px);
  font-size: var(--text-l);
  font-weight: 600;
  letter-spacing: -0.028em;
  line-height: 1.22;
}

.off-why {
  grid-column: 4 / span 6;
  margin-top: clamp(16px, 1.6vw, 24px);
  font-size: var(--text-m);
  line-height: 1.5;
  color: var(--soft);
}

.off-why em {
  font-size: 1.04em;
}

/* "small" is set small: the idea, in the type. */
.off-why .small {
  font-size: 0.74em;
}

/* --------------------------------------------------------------------------
   Best against Rather: the headline, unpacked. Two columns, grey for the
   many and ink for you; a question starts each row. It is the one thing on
   the page set side by side.
   -------------------------------------------------------------------------- */

.versus {
  background: var(--bg);
  color: var(--text);
  padding-bottom: var(--section);
}

/* It follows the band on the same stone, so a rule starts it. In the markup
   each name is a row of four answers; on the page each name is a column. */
.versus table {
  display: grid;
  /* Three left edges and no more, shared down the page: the page's own, the
     fourth column (the text above, and Best) and the eighth (Rather, and
     the text in the two bands below). */
  --col: calc((100% - 11 * var(--gap)) / 12);
  grid-template-columns:
    calc(3 * var(--col) + 3 * var(--gap))
    calc(4 * var(--col) + 4 * var(--gap))
    minmax(0, 1fr);
  padding-top: clamp(40px, 5vw, 72px);
  border-top: 1px solid var(--hairline);
}

.versus thead,
.versus tbody,
.versus tr {
  display: contents;
}

.versus thead td {
  display: none;
}

.versus th,
.versus td {
  padding: 0;
  text-align: left;
}

/* The two names, across the top. */
.versus tbody th {
  grid-row: 1;
  padding-bottom: clamp(12px, 1.6vw, 24px);
  font-size: var(--display);
  font-weight: 780;
  letter-spacing: -0.052em;
  line-height: 1;
}

.versus .best > * {
  grid-column: 2;
}

.versus .rather > * {
  grid-column: 3;
}

.versus .best th {
  color: var(--grey-line);
}

/* The name is set larger than what it's compared with. */
.versus tbody th {
  align-self: end;
}

.versus .rather th {
  font-size: min(calc(var(--display) * 1.5), 12.4vw);
}

/* The questions, down the left; each row is a question and its two answers. */
.versus thead th {
  grid-column: 1;
  display: flex;
  align-items: center;
  padding-right: 16px;
  font-size: var(--text-m);
  font-weight: 450;
  line-height: 1.3;
  color: var(--muted);
}

.versus thead th,
.versus tbody td {
  border-top: 1px solid var(--hairline);
}

.versus thead th:nth-of-type(1),
.versus tbody td:nth-of-type(1) {
  grid-row: 2;
}

.versus thead th:nth-of-type(2),
.versus tbody td:nth-of-type(2) {
  grid-row: 3;
}

.versus thead th:nth-of-type(3),
.versus tbody td:nth-of-type(3) {
  grid-row: 4;
}

.versus thead th:nth-of-type(4),
.versus tbody td:nth-of-type(4) {
  grid-row: 5;
}

.versus tbody td {
  padding: clamp(16px, 1.9vw, 28px) clamp(12px, 2vw, 32px) clamp(16px, 1.9vw, 28px) 0;
  font-size: var(--text-l);
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 1.08;
}

/* Body-size grey needs more contrast than the headline's. */
.versus .best td {
  color: var(--muted);
}

/* --------------------------------------------------------------------------
   How it happens: two bands, one after the other and equal. In each, the
   question and its answer on the left, how it works on the right.
   -------------------------------------------------------------------------- */

/* In each band, two rows. Above, the idea: the picture, and beside it how
   it works. Below, in bold, what to do and what does it: the answer, and
   level with it the example's name. */
.panel {
  --u: clamp(1.1px, 0.155vw, 2.3px);
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: clamp(28px, 3.6vw, 56px) var(--gap);
  align-items: start;
  padding: clamp(56px, 6.5vw, 104px) var(--edge);
}

.what,
.how {
  display: contents;
}

.what > *  {
  grid-column: 1 / span 7;
}

.how > * {
  grid-column: 8 / span 5;
}

.what > .fig,
.how > p {
  grid-row: 1;
}

.what > h2,
.how > .example {
  grid-row: 2;
}

.what > .fig {
  margin-bottom: 0;
}

/* The text sits beside the shapes, centred on them. */
.how > p {
  align-self: center;
}

/* The example's name stands level with the answer, past the question. */
.how > .example {
  padding-top: calc(1.55 * var(--text-l) + (0.98 * var(--display) - 44px) / 2);
}

.how > .example::before {
  display: none;
}

.panel-choose {
  background: var(--choose-bg);
  color: var(--choose-ink);
}

.panel-make {
  background: var(--make-bg);
  color: var(--make-ink);
}

/* The question is asked at text size; the answer is the heading. */
.panel h2 {
  font-size: var(--display);
}

.panel h2 span {
  display: block;
}

.panel h2 span:first-child {
  margin-bottom: 0.35em;
  font-size: var(--text-l);
  font-weight: 600;
  letter-spacing: -0.028em;
  line-height: 1.2;
}

.panel p {
  font-size: var(--text-m);
  line-height: 1.42;
}

.panel-choose p {
  color: var(--choose-ink-2);
}

.panel-make p {
  color: var(--make-ink-2);
}

/* Touch: taps should feel immediate, with no grey flash, no double-tap zoom
   and no accidental text selection while playing. */
.hole {
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  -webkit-user-select: none;
  user-select: none;
}

/* The fit. The piece is you: an arch, a doorway. Choose: try it in slots that
   already exist, and only one takes it. Make: the slot can change, so change
   it until the piece sits. Seated is solid; perched is an outline. */
.fig {
  display: flex;
  align-items: center;
  height: calc(80 * var(--u));
  margin-bottom: clamp(28px, 4vw, 44px);
  margin-left: calc(-10 * var(--u));
}

.fig-choose {
  --slot: var(--choose-mass);
  --piece: var(--choose-ink);
}

/* One slot, not five, so it is set larger to carry the same weight. */
.fig-make {
  --slot: rgba(74, 33, 56, 0.13);
  --piece: var(--make-ink);
  width: calc(60 * var(--u));
  scale: 1.4;
  transform-origin: 0 50%;
  margin-block: calc(16 * var(--u));
}

.hole {
  position: relative;
  flex: none;
  width: calc(60 * var(--u));
  height: calc(80 * var(--u));
  cursor: pointer;
}

.hole input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
}

/* The slot... */
.hole::before,
.hole::after {
  content: "";
  position: absolute;
  inset: 0;
  margin: auto;
  box-sizing: border-box;
  pointer-events: none;
}

.fig-choose .hole::before {
  background: var(--slot);
}

/* The slot that's being made: a tinted shape with a dashed edge, so each
   change of shape is easy to see under the piece. */
.fig-make .hole::before {
  background: var(--slot);
  border: 2px dashed color-mix(in srgb, var(--piece) 50%, transparent);
}

.hole.sq::before {
  width: calc(42 * var(--u));
  height: calc(42 * var(--u));
  border-radius: 20%;
}

.hole.ci::before {
  width: calc(44 * var(--u));
  height: calc(44 * var(--u));
  border-radius: 50%;
}

.hole.pi::before {
  width: calc(56 * var(--u));
  height: calc(26 * var(--u));
  border-radius: 999px;
}

.hole.di::before {
  width: calc(30 * var(--u));
  height: calc(30 * var(--u));
  border-radius: 10%;
  rotate: 45deg;
}

.hole.ar::before {
  width: calc(38 * var(--u));
  height: calc(44 * var(--u));
  border-radius: 999px 999px 0 0;
}

/* ...and the piece, always the same arch. */
.hole::after {
  width: calc(38 * var(--u));
  height: calc(44 * var(--u));
  border: 2px solid var(--piece);
  border-radius: 999px 999px 0 0;
  opacity: 0;
  scale: 0.8;
  rotate: -9deg;
  translate: 0 calc(-7 * var(--u));
  transition:
    opacity 0.15s,
    scale 0.25s cubic-bezier(0.3, 1.5, 0.5, 1);
}

.hole:has(input:checked)::after,
.fig-make .hole::after {
  opacity: 1;
  scale: 1;
}

/* It fits: seated, and solid. */
.hole.fits:has(input:checked)::after,
.fig-make .hole.fits::after {
  background: var(--piece);
  rotate: 0deg;
  translate: 0 0;
  animation: settle 0.34s ease;
}

@keyframes settle {
  0% {
    translate: 0 calc(-10 * var(--u));
  }
  60% {
    translate: 0 calc(2 * var(--u));
  }
  100% {
    translate: 0 0;
  }
}

@keyframes fidget {
  0%,
  72%,
  100% {
    rotate: -9deg;
  }
  80% {
    rotate: -3deg;
  }
  88% {
    rotate: -13deg;
  }
  94% {
    rotate: -6deg;
  }
}

@keyframes arrive {
  from {
    scale: 0.7;
    opacity: 0.3;
  }
}

@media (hover: hover) {
  .fig-choose .hole:hover::before {
    background: color-mix(in srgb, var(--piece) 32%, transparent);
  }
}

/* Make: one slot at a time; click it and it changes. */
.fig-make input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.fig-make .hole {
  display: none;
}

.fig-make .hole::before {
  animation: arrive 0.28s cubic-bezier(0.3, 1.5, 0.5, 1);
}

.fig-make .hole:not(.fits)::after {
  animation: fidget 5s ease-in-out 1.5s infinite;
}

#slot-1:checked ~ .sq,
#slot-2:checked ~ .pi,
#slot-3:checked ~ .di,
#slot-4:checked ~ .ci,
#slot-5:checked ~ .ar {
  display: block;
}

/* Left alone, each picture plays its own idea, over and over, half a turn
   apart, so while one is trying the other is at rest.
   Choose: the piece goes from slot to slot, perches on each, and sits in the
   one that fits. Make: the piece stays where it is and the slot changes
   under it until it fits. A tap or a click takes over: the playing stops
   and the toy is yours (it starts again if you put it back as it was). */
@keyframes demo-try {
  0% {
    opacity: 0;
    scale: 0.8;
  }
  1.5% {
    opacity: 1;
    scale: 1;
    rotate: -9deg;
  }
  6% {
    rotate: -14deg;
  }
  10% {
    rotate: -5deg;
  }
  13% {
    opacity: 1;
    scale: 1;
    rotate: -9deg;
  }
  14.5%,
  100% {
    opacity: 0;
    scale: 0.8;
  }
}

@keyframes demo-fit {
  0%,
  57.5% {
    opacity: 0;
    scale: 0.8;
    background-color: transparent;
    rotate: -9deg;
    translate: 0 calc(-10 * var(--u));
  }
  59.5% {
    opacity: 1;
    scale: 1;
    background-color: transparent;
    rotate: -9deg;
    translate: 0 calc(-10 * var(--u));
  }
  63% {
    background-color: var(--piece);
    rotate: 0deg;
    translate: 0 calc(2 * var(--u));
  }
  65%,
  96% {
    opacity: 1;
    scale: 1;
    background-color: var(--piece);
    rotate: 0deg;
    translate: 0 0;
  }
  100% {
    opacity: 0;
    scale: 1;
    background-color: var(--piece);
    rotate: 0deg;
    translate: 0 0;
  }
}

@keyframes demo-slot {
  0%,
  14.4% {
    opacity: 1;
  }
  14.5%,
  100% {
    opacity: 0;
  }
}

@keyframes demo-slot-fit {
  0%,
  57.9% {
    opacity: 0;
  }
  58%,
  100% {
    opacity: 1;
  }
}

@keyframes demo-pop {
  0% {
    scale: 0.5;
  }
  3% {
    scale: 1.08;
  }
  5%,
  100% {
    scale: 1;
  }
}

@keyframes demo-seat {
  0%,
  60% {
    background-color: transparent;
    rotate: -9deg;
    translate: 0 calc(-7 * var(--u));
  }
  64% {
    background-color: var(--piece);
    rotate: 0deg;
    translate: 0 calc(2 * var(--u));
  }
  66%,
  100% {
    background-color: var(--piece);
    rotate: 0deg;
    translate: 0 0;
  }
}

@media (prefers-reduced-motion: no-preference) {
  .fig-choose:has(.sq input:checked) .hole::after {
    opacity: 0;
    animation: demo-try 9s ease var(--dd, 0s) infinite;
  }

  .fig-choose .hole.ci {
    --dd: 1.305s;
  }

  .fig-choose .hole.di {
    --dd: 2.61s;
  }

  .fig-choose .hole.pi {
    --dd: 3.915s;
  }

  .fig-choose:has(.sq input:checked) .hole.fits::after {
    animation: demo-fit 9s ease infinite;
  }

  .fig-make {
    position: relative;
  }

  .fig-make:has(#slot-1:checked) .hole {
    display: block;
    position: absolute;
    left: 0;
    top: 0;
    opacity: 0;
    pointer-events: none;
    animation: demo-slot 9s linear calc(var(--dd, 0s) - 4.5s) infinite;
  }

  .fig-make:has(#slot-1:checked) .hole::before {
    animation: demo-pop 9s ease calc(var(--dd, 0s) - 4.5s) infinite;
  }

  /* The first slot is the one a tap reaches, whichever is showing. */
  .fig-make:has(#slot-1:checked) .hole.sq {
    z-index: 1;
    pointer-events: auto;
  }

  .fig-make .hole.pi {
    --dd: 1.305s;
  }

  .fig-make .hole.di {
    --dd: 2.61s;
  }

  .fig-make .hole.ci {
    --dd: 3.915s;
  }

  .fig-make .hole.fits {
    --dd: 5.22s;
  }

  .fig-make:has(#slot-1:checked) .hole.fits {
    animation: demo-slot-fit 9s linear -4.5s infinite;
  }

  .fig-make:has(#slot-1:checked) .hole::after {
    animation: none;
  }

  .fig-make:has(#slot-1:checked) .hole.fits::after {
    animation: demo-seat 9s ease -4.5s infinite;
  }
}

.example {
  padding-top: clamp(36px, 4vw, 56px);
}

.example::before {
  content: "";
  display: block;
  width: 48px;
  height: 1px;
  margin-bottom: 24px;
  background: currentColor;
  opacity: 0.35;
}

.example-name {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  font-size: var(--text-l);
  font-weight: 720;
  letter-spacing: -0.035em;
  text-decoration: none;
}

/* Each product's name is set as it is on its own site: Tuesdays in Source
   Serif italic, Second Draft in Fraunces. Rather itself has no serif. */
.panel-choose .example-name {
  font-family: "Source Serif 4", Georgia, serif;
  font-style: italic;
  font-weight: 650;
  letter-spacing: 0;
}

.panel-make .example-name {
  font-family: "Fraunces", Georgia, "Times New Roman", serif;
  font-weight: 500;
  letter-spacing: -0.02em;
}

.example-name svg {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
}

/* Tuesdays' tile is dark: on its dark panel it needs a thin ring. */
.panel-choose .example-name svg {
  border-radius: 28%;
  box-shadow: 0 0 0 1px var(--choose-ring);
}

.example-name .arrow {
  font-size: 0.75em;
  opacity: 0.6;
  transition: transform 0.2s;
}

.example-name:hover {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}

.example-name:hover .arrow {
  opacity: 1;
  transform: translate(2px, -2px);
}

.panel :focus-visible {
  outline-color: currentColor;
}

/* --------------------------------------------------------------------------
   The close: the name once more, as a signature. Under it, a plain footer
   with room for the small print.
   -------------------------------------------------------------------------- */

.close {
  padding-top: var(--section);
  padding-bottom: clamp(56px, 7vw, 96px);
}

.close .giant {
  margin-top: 0;
  font-size: min(30vw, 420px);
  color: var(--yours-1);
}

.colophon {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 32px;
  padding-top: 24px;
  padding-bottom: 40px;
  border-top: 1px solid var(--hairline);
  font-size: 15px;
  color: var(--muted);
}

.colophon .wordmark {
  font-size: 24px;
}

/* --------------------------------------------------------------------------
   Smaller screens
   -------------------------------------------------------------------------- */

@media (min-width: 1700px) {
  .offgrid {
    --cols: 20;
  }

  .offgrid label:nth-of-type(n + 61) {
    display: block;
  }

  .e-big1 {
    --x: 4;
    --y: 1;
  }

  .e-pill1 {
    --x: 9;
    --y: 1;
  }

  .e-mpill {
    --x: 15;
    --y: 1;
  }

  .e-ucircle {
    --x: 20;
    --y: 2;
  }

  .e-mdiamond {
    --x: 10;
    --y: 2;
  }

  .e-pill2 {
    --x: 1;
    --y: 3;
  }

  .e-odd {
    --x: 12;
    --y: 3;
  }

  .e-big2 {
    --x: 16;
    --y: 3;
  }

  .e-uarch {
    --x: 7;
    --y: 4;
  }

  .e-mcircle {
    --x: 5;
    --y: 5;
  }

  .e-chosen {
    --x: 11;
    --y: 5;
  }

  .e-udiamond {
    --x: 18;
    --y: 5;
  }
}

@media (max-width: 1040px) {
  .offgrid {
    --cols: 12;
  }

  .offgrid label:nth-of-type(n + 41) {
    display: none;
  }

  .e-big1 {
    --x: 2;
    --y: 1;
  }

  .e-pill1 {
    --x: 5;
    --y: 1;
  }

  .e-mpill {
    --x: 9;
    --y: 1;
  }

  .e-ucircle {
    --x: 12;
    --y: 2;
  }

  .e-mdiamond {
    --x: 7;
    --y: 2;
  }

  .e-pill2 {
    --x: 1;
    --y: 3;
  }

  .e-odd {
    --x: 8;
    --y: 3;
  }

  .e-big2 {
    --x: 10;
    --y: 3;
  }

  .e-uarch {
    --x: 5;
    --y: 4;
  }

  .e-mcircle {
    --x: 3;
    --y: 5;
  }

  .e-chosen {
    --x: 7;
    --y: 5;
  }

  .e-udiamond {
    --x: 12;
    --y: 5;
  }

  .off-line {
    grid-column: 1 / -1;
  }

  .off-relief,
  .off-why {
    grid-column: 4 / -1;
  }
}

@media (max-width: 860px) {
  .panel {
    --u: clamp(0.95px, 0.2vw, 1.5px);
    display: block;
  }

  .what,
  .how {
    display: block;
    max-width: 34rem;
  }

  .what > .fig {
    margin-bottom: clamp(28px, 4vw, 44px);
  }

  .panel h2 {
    margin-bottom: clamp(20px, 2.2vw, 30px);
  }

  .how > .example {
    padding-top: clamp(36px, 4vw, 56px);
  }

  .how > .example::before {
    display: block;
  }
}

@media (max-width: 640px) {
  .masthead {
    padding-block: 14px;
  }

  .wordmark {
    font-size: 32px;
  }


  /* Ten small squares across, so the field stays a strip and the plain
     squares still outnumber the exceptions. */
  .offgrid {
    --cols: 10;
    --sq-gap: 5px;
  }

  .offgrid label:nth-of-type(n + 31) {
    display: none;
  }

  .e-big1 {
    --x: 2;
    --y: 1;
  }

  .e-pill1 {
    --x: 5;
    --y: 1;
  }

  .e-mpill {
    --x: 8;
    --y: 1;
  }

  .e-ucircle {
    --x: 10;
    --y: 2;
  }

  .e-mdiamond {
    --x: 6;
    --y: 2;
  }

  .e-pill2 {
    --x: 1;
    --y: 3;
  }

  .e-odd {
    --x: 5;
    --y: 3;
  }

  .e-big2 {
    --x: 8;
    --y: 3;
  }

  .e-uarch {
    --x: 4;
    --y: 4;
  }

  .e-mcircle {
    --x: 3;
    --y: 5;
  }

  .e-chosen {
    --x: 6;
    --y: 5;
  }

  .e-udiamond {
    --x: 10;
    --y: 5;
  }

  .odd b {
    box-shadow: 3px 3px 0 color-mix(in srgb, var(--yours-1) 40%, var(--bg));
  }

  .off-relief,
  .off-why {
    grid-column: 1 / -1;
  }

  /* The table: the two names side by side; each question on a line of its
     own, its two answers under it. */
  .versus table {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: 16px;
  }

  .versus .best > * {
    grid-column: 1;
  }

  .versus .rather > * {
    grid-column: 2;
  }

  .versus thead th {
    grid-column: 1 / -1;
    padding: 16px 0 0;
  }

  .versus tbody td {
    padding: 6px 0 18px;
    border: 0;
  }

  .versus thead th:nth-of-type(1) { grid-row: 2; }
  .versus tbody td:nth-of-type(1) { grid-row: 3; }
  .versus thead th:nth-of-type(2) { grid-row: 4; }
  .versus tbody td:nth-of-type(2) { grid-row: 5; }
  .versus thead th:nth-of-type(3) { grid-row: 6; }
  .versus tbody td:nth-of-type(3) { grid-row: 7; }
  .versus thead th:nth-of-type(4) { grid-row: 8; }
  .versus tbody td:nth-of-type(4) { grid-row: 9; }

  .panel {
    --u: 0.95px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .example-name .arrow {
    transition: none;
  }

  .cell,
  .cell::before,
  .hole::after {
    transition: none;
  }

  .cell.nudge,
  .cell.nudge::before,
  .hole::before,
  .hole::after,
  .odd b {
    animation: none !important;
  }
}
