/* Cruxd — the website's design system.
 *
 * The app's riso palette (ios/Cruxd/Design/Palette.swift), its dot screen
 * (Mesh.swift) and its parts (22 pt cards, pills, the stats strip, the glass tab
 * bar), translated to the web. Three rules carry over unchanged:
 *   1. Nothing is drawn on the dots. Words sit on a flat colour or a card.
 *   2. Solid vermilion means "act" or "achieved": the primary action, a send.
 *   3. Words on vermilion are Riso Black, never white; vermilion never carries
 *      small text (3.1:1 on paper).
 * Archivo Black is for the wordmark and h1/h2 only; everything else is the
 * system face, as in the app (SF Pro), with rounded numerals for stats.
 */

@font-face {
  font-family: "Archivo Black";
  src: url(/assets/fonts/archivo-black-latin.woff?v=25902bf80d) format("woff");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

/* ── tokens ─────────────────────────────────────────────────────────────── */

:root {
  color-scheme: light dark;
  --brand: #f36438;
  --on-brand: #0e0c0c;
  --ink: #0e0c0c;
  --secondary-ink: #57524f;
  --tertiary-ink: #77716d;
  --paper: #fffefa;
  --canvas: #f6f4ef;
  --card: #fffefa;
  --field: #fffefa;
  --hairline: rgb(14 12 12 / 0.12);
  --divider: rgb(14 12 12 / 0.12);
  --outline: rgb(14 12 12 / 0.18);
  /* The edge of a field, a search pill or a checkbox. A field's fill is the
   * card's own colour, so its edge is the only thing that shows where it is:
   * 3:1 against both (WCAG 1.4.11). --outline stays for decorative hairlines. */
  --field-edge: rgb(14 12 12 / 0.45);
  --plan-backing: rgb(14 12 12 / 0.05);
  --flat15: #fde6dd;
  --flat22: #fcd8ca;
  --flat30: #fbc8b5;
  --flat42: #f9b39e;
  --glass: rgb(255 254 250 / 0.78);
  --glass-edge: rgb(14 12 12 / 0.1);
  --shadow-float: 0 8px 24px rgb(14 12 12 / 0.1);
  --shadow-phone: 0 40px 80px -32px rgb(14 12 12 / 0.34), 0 16px 32px -16px rgb(14 12 12 / 0.16);
  --lift: 0 6px 16px rgb(243 100 56 / 0.35), 0 1px 2px rgb(14 12 12 / 0.12);

  --font-sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", system-ui, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-display: "Archivo Black", "Arial Black", "Helvetica Neue", Arial, sans-serif;
  --font-round: ui-rounded, "SF Pro Rounded", -apple-system, BlinkMacSystemFont, system-ui, sans-serif;

  --gutter: 16px;
  --max: 1200px;
  --section: clamp(72px, 11vw, 144px);
}

@media (prefers-color-scheme: dark) {
  :root {
    --ink: #f6f1ea;
    --secondary-ink: #b3aba5;
    --tertiary-ink: #9a938d;
    --paper: #0e0c0c;
    --canvas: #0e0c0c;
    --card: #1c1a19;
    --field: #2c2a29;
    --hairline: rgb(246 241 234 / 0.08);
    --divider: rgb(246 241 234 / 0.12);
    --outline: rgb(246 241 234 / 0.22);
    --field-edge: rgb(246 241 234 / 0.4);
    --plan-backing: rgb(246 241 234 / 0.05);
    --flat15: #3c251e;
    --flat22: #4b2a20;
    --flat30: #5d3022;
    --flat42: #763926;
    --glass: rgb(28 26 25 / 0.72);
    --glass-edge: rgb(246 241 234 / 0.12);
    --shadow-float: 0 8px 24px rgb(0 0 0 / 0.45);
    --shadow-phone: 0 40px 80px -32px rgb(0 0 0 / 0.8), 0 16px 32px -16px rgb(0 0 0 / 0.5);
    --lift: 0 6px 18px rgb(243 100 56 / 0.22), 0 1px 2px rgb(0 0 0 / 0.5);
  }
}

@media (prefers-contrast: more) {
  :root {
    --ink: #000;
    --tertiary-ink: var(--secondary-ink);
    --outline: rgb(14 12 12 / 0.45);
    --field-edge: rgb(14 12 12 / 0.6);
  }
}
@media (prefers-contrast: more) and (prefers-color-scheme: dark) {
  :root {
    --ink: #fff;
    --outline: rgb(246 241 234 / 0.5);
    --field-edge: rgb(246 241 234 / 0.6);
  }
}

@media (min-width: 720px) {
  :root {
    --gutter: 32px;
  }
}

/* ── base ───────────────────────────────────────────────────────────────── */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: 96px;
}

@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 17px/1.5 var(--font-sans);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

main {
  display: block;
  overflow-x: clip;
}

h1,
h2,
h3,
p,
ul,
ol,
dl,
dd,
figure {
  margin: 0;
}

ul,
ol {
  padding: 0;
  list-style: none;
}

img,
svg {
  display: block;
  max-width: 100%;
}

img {
  height: auto;
}

a {
  color: inherit;
  text-decoration-line: underline;
  text-decoration-color: var(--brand);
  text-decoration-thickness: 2px;
  text-underline-offset: 0.22em;
}

a:hover {
  text-decoration-thickness: 3px;
}

button,
input,
textarea,
select {
  font: inherit;
  color: inherit;
}

:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 3px;
  border-radius: 6px;
}

::selection {
  background: var(--flat30);
  color: var(--ink);
}

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

.skip {
  position: absolute;
  left: 16px;
  top: -64px;
  z-index: 100;
  padding: 10px 16px;
  border-radius: 20px;
  background: var(--card);
  color: var(--ink);
  box-shadow: var(--shadow-float);
  text-decoration: none;
  font-weight: 600;
}

.skip:focus {
  top: 16px;
}

.wrap {
  width: min(100% - 2 * var(--gutter), var(--max));
  margin-inline: auto;
}

/* ── type ───────────────────────────────────────────────────────────────── */

.display,
h1,
h2 {
  font-family: var(--font-display);
  font-weight: 400;
  font-synthesis: none;
  text-wrap: balance;
}

/* One rule per heading on every page, and each only grows with the width:
 * 50 px on a phone, 72 at 768, 87 at 1024, 104 from 1300. */
h1 {
  font-size: clamp(50px, 6vw + 26px, 104px);
  line-height: 0.95;
  letter-spacing: -0.045em;
}

h2 {
  font-size: clamp(36px, 3.6vw + 22px, 68px);
  line-height: 0.95;
  letter-spacing: -0.04em;
}

h3 {
  font: 700 clamp(26px, 2.7vw, 36px) / 1.12 var(--font-sans);
  letter-spacing: -0.02em;
  text-wrap: balance;
}

.lead {
  font-size: clamp(18px, 1.55vw, 21px);
  line-height: 1.45;
  color: var(--secondary-ink);
  text-wrap: pretty;
}

.label {
  font: 600 15px/1.2 var(--font-sans);
  color: var(--secondary-ink);
  letter-spacing: 0.01em;
}

.fine {
  font-size: 14px;
  line-height: 1.4;
  color: var(--secondary-ink);
}

.wordmark {
  font-family: var(--font-display);
  font-weight: 400;
  font-synthesis: none;
  letter-spacing: -0.035em;
  line-height: 1;
  white-space: nowrap;
}

.wordmark .x {
  color: var(--brand);
}

/* ── the dot screen (Mesh.swift) ────────────────────────────────────────────
 * A cell with a dot at each corner and one in the middle: a 45° lattice.
 * The cell is the app's (Mesh.cell = 8 pt) at every size — a coarser one
 * reads as pop-art halftone beside the screenshots' own screen. Densities are
 * coverage of that cell. Dots stay vermilion in both themes; only the ground
 * between them changes. */

.mesh {
  --cell: 8px;
  --d: calc(var(--cell) * 0.2185);
  --ground: transparent;
  background-color: var(--ground);
  background-image:
    radial-gradient(circle, var(--brand) var(--d), rgb(243 100 56 / 0) calc(var(--d) + 0.6px)),
    radial-gradient(circle, var(--brand) var(--d), rgb(243 100 56 / 0) calc(var(--d) + 0.6px));
  background-size: var(--cell) var(--cell);
  background-position:
    0 0,
    calc(var(--cell) / 2) calc(var(--cell) / 2);
}

.m15 {
  --d: calc(var(--cell) * 0.1545);
}
.m22 {
  --d: calc(var(--cell) * 0.1871);
}
.m30 {
  --d: calc(var(--cell) * 0.2185);
}
.m42 {
  --d: calc(var(--cell) * 0.2585);
}

/* ── buttons and fields ─────────────────────────────────────────────────── */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 50px;
  padding: 0 24px;
  border: 0;
  border-radius: 25px;
  font: 600 17px/1 var(--font-sans);
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition:
    transform 0.12s ease,
    background-color 0.12s ease,
    box-shadow 0.12s ease,
    opacity 0.12s ease;
}

.btn:focus-visible {
  border-radius: 999px;
}

.btn-primary {
  background: var(--brand);
  color: var(--on-brand);
  box-shadow: var(--lift);
}

.btn-primary:hover {
  transform: translateY(-1px);
}

.btn-primary:active {
  transform: scale(0.98);
}

.btn-outline {
  background: transparent;
  color: var(--ink);
  box-shadow: inset 0 0 0 1px var(--outline);
}

.btn-outline:hover {
  background: var(--flat15);
}

.btn-outline:active {
  background: var(--flat22);
}

.btn-sm {
  height: 44px;
  padding: 0 18px;
  border-radius: 22px;
  font-size: 15px;
}

.btn-block {
  width: 100%;
}

.btn:disabled,
.btn[aria-disabled="true"] {
  opacity: 0.45;
  cursor: progress;
  transform: none;
}

.link-btn {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0;
  border: 0;
  background: none;
  font-weight: 600;
  text-decoration: underline;
  text-decoration-color: var(--brand);
  text-decoration-thickness: 2px;
  text-underline-offset: 0.22em;
  cursor: pointer;
}

/* The inline "is your gym on?" form: one pill holding a field and a button. */
.check {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  max-width: 460px;
  padding: 5px;
  border-radius: 31px;
  background: var(--card);
  box-shadow: inset 0 0 0 1px var(--field-edge);
}

.check:focus-within {
  box-shadow: inset 0 0 0 2px var(--ink);
}

.check input {
  flex: 1;
  width: 0; /* an input's intrinsic width would otherwise set the row's minimum */
  min-width: 0;
  height: 50px;
  padding: 0 8px 0 18px;
  border: 0;
  background: transparent;
  font-size: 17px;
  appearance: none;
  -webkit-appearance: none;
}

.check input:focus {
  outline: none;
}

.check input::placeholder {
  color: var(--tertiary-ink);
  opacity: 1;
}

.check input::-webkit-search-cancel-button {
  display: none;
}

.tag {
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 9px;
  border-radius: 11px;
  background: var(--flat22);
  color: var(--ink);
  font: 700 12px/1 var(--font-sans);
  letter-spacing: 0.03em;
  white-space: nowrap;
}

/* ── nav: the app's floating glass bar ──────────────────────────────────── */

.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  padding: 10px var(--gutter) 0;
  pointer-events: none;
}

.nav-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  max-width: calc(var(--max) + 16px);
  height: 60px;
  margin: 0 auto;
  padding: 0 7px 0 12px;
  border-radius: 30px;
  background: var(--glass);
  -webkit-backdrop-filter: blur(18px) saturate(1.5);
  backdrop-filter: blur(18px) saturate(1.5);
  box-shadow:
    inset 0 0 0 1px var(--glass-edge),
    var(--shadow-float);
  pointer-events: auto;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-height: 44px;
  color: var(--ink);
  text-decoration: none;
}

.brand img {
  width: 32px;
  height: 32px;
}

.brand .wordmark {
  font-size: 25px;
  margin-top: -2px;
}

.nav-links {
  display: none;
  gap: 2px;
  margin-left: auto;
}

.nav-links a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 14px;
  border-radius: 22px;
  font: 500 15px/1 var(--font-sans);
  text-decoration: none;
}

.nav-links a:hover {
  background: var(--flat15);
}

.nav-links a[aria-current="page"] {
  background: var(--flat22);
}

.nav-cta {
  margin-left: auto;
  height: 44px;
  padding: 0 18px;
  border-radius: 22px;
  font-size: 16px;
}

/* At 320 the wordmark stays (the brand should not lose to its own button);
 * the button gives up a little width instead, never its 44 pt height. */
@media (max-width: 359px) {
  .nav-bar {
    padding-left: 10px;
  }
  .brand {
    gap: 7px;
  }
  .brand .wordmark {
    font-size: 20px;
  }
  .nav-cta {
    padding: 0 14px;
    font-size: 15px;
  }
}

@media (min-width: 880px) {
  .nav-links {
    display: flex;
  }
  .nav-cta {
    margin-left: 10px;
  }
}

/* ── phone frames ───────────────────────────────────────────────────────── */

.phone {
  --pw: 280px;
  position: relative;
  width: var(--pw);
  padding: calc(var(--pw) * 0.024);
  border-radius: 13% / 6.1%;
  background: #0e0c0c;
  box-shadow:
    0 0 0 1px var(--outline),
    var(--shadow-phone);
}

/* A plain Riso Black edge, as thin as the real one: no gloss, no notch.
 * The inner corner is the outer one less the edge (0.13 − 0.024 of the
 * width, over the screen's own width and height). */
.phone img {
  width: 100%;
  height: auto;
  border-radius: 11.1% / 5%;
  background: var(--canvas);
}

/* ── home: hero ─────────────────────────────────────────────────────────── */

.hero {
  padding-top: clamp(32px, 6vw, 72px);
}

.hero-grid {
  display: grid;
  gap: 40px;
}

.hero-copy {
  display: grid;
  justify-items: start;
  align-content: center;
  gap: 22px;
}

.kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 30px;
  padding: 0 13px 0 11px;
  border-radius: 15px;
  background: var(--flat22);
  font: 600 14px/1 var(--font-sans);
}

.kicker::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--brand);
}

.hero h1 {
  margin-top: 4px;
}

.hero .lead {
  max-width: 31em;
}

.hero-stage {
  display: grid;
  place-items: center;
  overflow: hidden;
  margin-inline: calc(-1 * var(--gutter));
  padding: 44px 0 52px;
}

.hero-stage .phone {
  --pw: min(74vw, 300px);
}

/* From 720 the phone moves beside the words. Between 720 and 959 its panel is
 * only as wide as the phone plus a margin of dots, so the copy keeps the room. */
@media (min-width: 720px) {
  .hero-grid {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 28px;
    align-items: center;
  }
  .hero-stage {
    margin-inline: 0;
    padding: 44px 24px;
    border-radius: 32px;
  }
  /* Small enough that "is the map." still fits on one line beside it. */
  .hero-stage .phone {
    --pw: 26vw;
  }
}

@media (min-width: 960px) {
  .hero {
    padding-top: 40px;
  }
  .hero-grid {
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.8fr);
    gap: clamp(32px, 4vw, 64px);
  }
  .hero-stage {
    padding: 56px 0;
  }
  .hero-stage .phone {
    --pw: 300px;
  }
}

/* ── home: essence ──────────────────────────────────────────────────────── */

.essence {
  padding-block: var(--section);
}

.essence-text {
  max-width: 21em;
  font: 700 clamp(29px, 4.3vw, 56px) / 1.1 var(--font-sans);
  letter-spacing: -0.028em;
  text-wrap: pretty;
}

.essence-text .muted {
  color: var(--tertiary-ink);
}

/* ── home: how it works ─────────────────────────────────────────────────── */

.how {
  padding-bottom: var(--section);
}

.section-head {
  display: grid;
  gap: 18px;
  margin-bottom: clamp(40px, 6vw, 80px);
}

.section-head .lead {
  max-width: 34em;
}

.rows {
  display: grid;
  gap: clamp(64px, 9vw, 128px);
}

.row {
  display: grid;
  gap: 28px;
}

.row-copy {
  display: grid;
  align-content: center;
  gap: 14px;
  order: -1;
}

.row-copy > p:not(.label) {
  max-width: 30em;
  font-size: 18px;
  color: var(--secondary-ink);
  text-wrap: pretty;
}

.stage {
  display: grid;
  place-items: center;
  overflow: hidden; /* keeps the phone's shadow on its own panel */
  padding: 40px 0;
  border-radius: 28px;
}

.stage .phone {
  --pw: min(66vw, 280px);
}

.stage-flat {
  background: var(--flat15);
}

@media (min-width: 720px) {
  .row {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: clamp(32px, 6vw, 96px);
    align-items: center;
  }
  .row-copy {
    order: 0;
  }
  .row:nth-child(even) .stage {
    order: 2;
  }
  .stage {
    padding: 48px 0;
    border-radius: 32px;
  }
  .stage .phone {
    --pw: min(280px, 30vw);
  }
}

@media (min-width: 960px) {
  .stage {
    padding: 56px 0;
  }
}

/* What a filled and a dashed ring mean on the map. */
.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 6px;
}

.legend li,
.badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 36px;
  padding: 0 14px 0 10px;
  border-radius: 18px;
  box-shadow: inset 0 0 0 1px var(--outline);
  font: 600 15px/1 var(--font-sans);
}

.legend svg,
.badge svg {
  width: 20px;
  height: 20px;
  color: var(--brand);
  flex: none;
}

.badges {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 6px;
}

/* ── home: with friends ─────────────────────────────────────────────────── */

/* No phone here: the screens that hold the social side (Search, a gym's page,
 * the bell) are lists, and three of them in a row would read as one. An icon
 * on a flat disc stands in, the way the badges do above. */
.social {
  padding-block: var(--section);
  background: var(--canvas);
}

.scards {
  display: grid;
  gap: 16px;
}

.scard {
  display: grid;
  align-content: start;
  gap: 12px;
  padding: 28px 24px 30px;
  border-radius: 22px;
  background: var(--card);
  box-shadow: inset 0 0 0 1px var(--hairline);
}

.scard-icon {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  margin-bottom: 6px;
  border-radius: 26px;
  background: var(--flat15);
  color: var(--brand);
}

.scard-icon svg {
  width: 28px;
  height: 28px;
}

.scard h3 {
  font-size: 23px;
}

.scard p {
  font-size: 16px;
  color: var(--secondary-ink);
  text-wrap: pretty;
}

@media (min-width: 900px) {
  .scards {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

/* ── home: the wall ─────────────────────────────────────────────────────── */

/* The approved lockup at its own shape (2840 × 1250) at every width: a
 * narrower ratio would cut the c and the d at the screen's edges. */
.wall img {
  width: 100%;
  aspect-ratio: 2840 / 1250;
  object-fit: cover;
  background: #6b6b6b;
}

/* ── home: facts, the app's stats strip ─────────────────────────────────── */

.facts {
  padding-block: clamp(48px, 7vw, 88px);
}

.strip {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  border-radius: 22px;
  background: var(--flat15);
}

.strip > div {
  position: relative;
  display: grid;
  align-content: start;
  gap: 4px;
  padding: 22px 16px;
  text-align: center;
}

/* Words, not numbers: the system face. The app keeps rounded type for the
 * numerals in its strip. */
.strip dt {
  font: 600 19px/1.2 var(--font-sans);
  letter-spacing: -0.01em;
  text-wrap: balance;
}

.strip dd {
  font-size: 14px;
  line-height: 1.35;
  color: var(--secondary-ink);
  text-wrap: balance;
}

.strip > div:nth-child(even)::before,
.strip > div:nth-child(n + 3)::after {
  content: "";
  position: absolute;
  background: var(--divider);
}

.strip > div:nth-child(even)::before {
  left: 0;
  top: 22px;
  bottom: 22px;
  width: 1px;
}

/* One rule across the 2 × 2, drawn in two halves that meet in the middle;
 * the vertical one stops short of it on both sides. */
.strip > div:nth-child(n + 3)::after {
  top: 0;
  height: 1px;
}

.strip > div:nth-child(3)::after {
  left: 16px;
  right: 0;
}

.strip > div:nth-child(4)::after {
  left: 0;
  right: 16px;
}

@media (min-width: 860px) {
  .strip {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    padding: 8px 0;
  }
  .strip > div {
    padding: 22px 20px;
  }
  .strip dt {
    font-size: 22px;
  }
  .strip > div:nth-child(n + 3)::after {
    display: none;
  }
  .strip > div + div::before {
    content: "";
    position: absolute;
    left: 0;
    top: 26px;
    bottom: 26px;
    width: 1px;
    background: var(--divider);
  }
}

/* ── home: for gyms ─────────────────────────────────────────────────────── */

.for-gyms {
  padding-block: var(--section);
  background: var(--canvas);
}

.gcards {
  display: grid;
  gap: 16px;
}

.gcard {
  display: grid;
  grid-template-rows: auto 1fr;
  overflow: hidden;
  border-radius: 22px;
  background: var(--card);
  box-shadow: inset 0 0 0 1px var(--hairline);
}

/* 390 px shows a 236 px phone down past the New boulder sheet's Grade row
 * and the line under it, so the whole form reads and the cut falls in the
 * empty paper below — not 1 px under the last control. */
.gcard-media {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  height: 390px;
  padding-top: 36px;
  overflow: hidden;
  background: var(--flat15);
}

.gcard-media .phone {
  --pw: 236px;
  flex: none;
  box-shadow:
    0 0 0 1px var(--outline),
    0 24px 48px -24px rgb(14 12 12 / 0.3);
}

.gcard-body {
  display: grid;
  align-content: start;
  gap: 10px;
  padding: 24px 24px 28px;
  border-top: 1px solid var(--hairline);
}

.gcard h3 {
  font-size: 23px;
}

.gcard p {
  font-size: 16px;
  color: var(--secondary-ink);
  text-wrap: pretty;
}

.cta-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px 20px;
  margin-top: clamp(32px, 4vw, 48px);
}

/* On a tablet a card lies on its side: phone left, words right. */
@media (min-width: 720px) and (max-width: 899px) {
  .gcard {
    grid-template-columns: 300px minmax(0, 1fr);
    grid-template-rows: none;
  }
  .gcard-body {
    align-content: center;
    padding: 28px 32px;
    border-top: 0;
    box-shadow: inset 1px 0 0 var(--hairline);
  }
}

@media (min-width: 900px) {
  .gcards {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

/* ── home: closing ──────────────────────────────────────────────────────── */

.closing {
  padding-block: clamp(64px, 10vw, 120px);
}

.closing-card {
  display: grid;
  justify-items: center;
  gap: 18px;
  max-width: 640px;
  margin: 0 auto;
  padding: clamp(32px, 5vw, 56px) clamp(20px, 5vw, 56px);
  border-radius: 32px;
  background: var(--card);
  box-shadow:
    inset 0 0 0 1px var(--hairline),
    var(--shadow-float);
  text-align: center;
}

.closing-card .tile {
  width: 64px;
  height: 64px;
}

.closing-card h2 {
  font-size: clamp(34px, 5vw, 56px);
}

.closing-card .lead {
  max-width: 24em;
}

.closing-card .check {
  margin-top: 6px;
}

/* ── footer ─────────────────────────────────────────────────────────────── */

.foot {
  padding: 40px 0 48px;
  border-top: 1px solid var(--hairline);
}

.foot-grid {
  display: grid;
  gap: 22px;
}

.foot .brand .wordmark {
  font-size: 22px;
}

.foot-tag {
  margin-top: 8px;
  font-size: 15px;
  color: var(--secondary-ink);
}

.foot-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0 22px;
  font-size: 15px;
  font-weight: 500;
}

.foot-links a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  text-decoration: none;
}

.foot-links a:hover {
  text-decoration: underline;
  text-decoration-color: var(--brand);
}

.foot .copy {
  font-size: 14px;
  color: var(--secondary-ink);
}

@media (min-width: 860px) {
  /* Top-aligned, so the links and the year sit on the wordmark's line
     rather than halfway down the wordmark-and-tagline block. */
  .foot-grid {
    grid-template-columns: 1fr auto auto;
    align-items: start;
    gap: 40px;
  }

  .foot .copy {
    display: flex;
    align-items: center;
    min-height: 44px;
  }
}

/* ── /gyms ──────────────────────────────────────────────────────────────── */

.find {
  padding-block: clamp(40px, 7vw, 96px) clamp(56px, 8vw, 104px);
}

.find-wrap {
  --max: 760px;
  display: grid;
  gap: 22px;
}

.find .lead {
  max-width: 32em;
}

@media (min-width: 960px) {
  .find h1,
  .find .lead {
    text-align: center;
  }
  .find .lead {
    margin-inline: auto;
  }
}

.search {
  position: relative;
  margin-top: 8px;
}

.search svg {
  position: absolute;
  left: 20px;
  top: 50%;
  width: 22px;
  height: 22px;
  color: var(--secondary-ink);
  transform: translateY(-50%);
  pointer-events: none;
}

.search input {
  width: 100%;
  height: 60px;
  padding: 0 20px 0 54px;
  border: 0;
  border-radius: 30px;
  background: var(--card);
  box-shadow: inset 0 0 0 1px var(--field-edge);
  font-size: 18px;
  appearance: none;
  -webkit-appearance: none;
}

.search input:focus {
  outline: none;
  box-shadow: inset 0 0 0 2px var(--ink);
}

.search input::placeholder {
  color: var(--tertiary-ink);
  opacity: 1;
}

.search input::-webkit-search-cancel-button {
  -webkit-appearance: none;
}

.results {
  display: grid;
  gap: 12px;
  min-height: 112px;
}

.gym-list {
  display: grid;
  gap: 12px;
}

.gym {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr);
  gap: 16px;
  align-items: start;
  padding: 18px;
  border-radius: 22px;
  background: var(--card);
  box-shadow: inset 0 0 0 1px var(--hairline);
}

.avatar {
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  overflow: hidden;
  border-radius: 50%;
  background: var(--flat30);
  font: 700 22px/1 var(--font-sans);
}

.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.gym-main {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.gym-name {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
  font: 700 19px/1.25 var(--font-sans);
  letter-spacing: -0.01em;
}

.gym-addr {
  font-size: 15px;
  color: var(--secondary-ink);
}

.gym-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.state {
  display: grid;
  justify-items: start;
  gap: 8px;
  padding: 22px 22px 24px;
  border-radius: 22px;
  background: var(--flat15);
}

.state-title {
  font: 700 20px/1.3 var(--font-sans);
  letter-spacing: -0.01em;
}

.state p:not(.state-title) {
  color: var(--secondary-ink);
}

.state .btn {
  margin-top: 8px;
}

.skeleton {
  pointer-events: none;
}

.skeleton .avatar {
  background: var(--plan-backing);
}

.bar {
  height: 14px;
  border-radius: 7px;
  background: var(--plan-backing);
}

.bar-1 {
  width: 46%;
  height: 18px;
  margin-top: 4px;
}

.bar-2 {
  width: 68%;
}

@media (prefers-reduced-motion: no-preference) {
  .skeleton .bar,
  .skeleton .avatar {
    animation: breathe 1.4s ease-in-out infinite alternate;
  }
}

@keyframes breathe {
  to {
    opacity: 0.45;
  }
}

.dont-see {
  font-weight: 600;
}

.dont-see a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
}

.mesh-rule {
  height: 44px;
}

/* request */

.request {
  padding-block: var(--section);
  background: var(--canvas);
}

.request-grid {
  display: grid;
  gap: 28px;
}

.request-intro {
  display: grid;
  gap: 16px;
  align-content: start;
}

.request-intro h2 {
  max-width: 9em;
}

.request-intro .lead {
  max-width: 24em;
}

@media (min-width: 960px) {
  .request-grid {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
    align-items: start;
    column-gap: clamp(48px, 6vw, 96px);
  }
}

.panel {
  padding: clamp(20px, 3vw, 32px);
  border-radius: 22px;
  background: var(--card);
  box-shadow: inset 0 0 0 1px var(--hairline);
}

.form {
  display: grid;
  gap: 20px;
}

.field {
  display: grid;
  gap: 7px;
}

.field label,
.check-row {
  font: 600 15px/1.3 var(--font-sans);
}

.opt {
  font-weight: 400;
  color: var(--secondary-ink);
}

.field input,
.field textarea,
.field select {
  width: 100%;
  min-height: 50px;
  padding: 13px 16px;
  border: 0;
  border-radius: 14px;
  background: var(--field);
  box-shadow: inset 0 0 0 1px var(--field-edge);
  font-size: 17px;
  line-height: 1.4;
}

.field textarea {
  min-height: 96px;
  resize: vertical;
}

.field input::placeholder,
.field textarea::placeholder {
  color: var(--tertiary-ink);
  opacity: 1;
}

.field input:focus,
.field textarea:focus,
.field select:focus {
  outline: none;
  box-shadow: inset 0 0 0 2px var(--ink);
}

.field [aria-invalid="true"] {
  box-shadow: inset 0 0 0 2px var(--brand);
}

/* The OS menu, drawn as a field: its own chevron, in the ink of a hint. */
.select {
  position: relative;
  display: block;
}

.select::after {
  content: "";
  position: absolute;
  top: 50%;
  right: 20px;
  width: 9px;
  height: 9px;
  border-right: 2px solid var(--secondary-ink);
  border-bottom: 2px solid var(--secondary-ink);
  transform: translateY(-70%) rotate(45deg);
  pointer-events: none;
}

.field select {
  padding-right: 48px;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
}

/* "Choose one" reads as a placeholder; the choices themselves don't. */
.field select:invalid {
  color: var(--tertiary-ink);
}

.field select option {
  color: var(--ink);
}

.hint {
  font-size: 14px;
  color: var(--secondary-ink);
}

.err {
  display: flex;
  align-items: center;
  gap: 7px;
  font: 600 14px/1.35 var(--font-sans);
}

.err::before,
.form-error::before {
  content: "";
  flex: none;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--brand);
}

.form-error {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 14px 16px;
  border-radius: 14px;
  background: var(--flat22);
  font-weight: 600;
}

.form-error::before {
  transform: translateY(-1px);
}

[hidden] {
  display: none !important;
}

.check-row {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 50px;
  padding: 0 16px;
  border-radius: 14px;
  box-shadow: inset 0 0 0 1px var(--field-edge);
  cursor: pointer;
}

/* Not the OS square: the app's ring. Empty, an edge; checked, solid
 * vermilion with a Riso Black tick (words and marks on vermilion are never
 * white). */
.check-row input {
  flex: none;
  width: 24px;
  height: 24px;
  margin: 0;
  border-radius: 50%;
  background: var(--field);
  box-shadow: inset 0 0 0 2px var(--field-edge);
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
}

.check-row input:checked {
  background: var(--brand) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M6.5 12.5l3.6 3.6 7.4-8' fill='none' stroke='%230e0c0c' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 100% no-repeat;
  box-shadow: none;
}

.check-row input:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 3px;
  border-radius: 50%;
}

/* Forced colours drop backgrounds and shadows: give the box back. */
@media (forced-colors: active) {
  .check-row input {
    appearance: auto;
    -webkit-appearance: checkbox;
  }
}

.check-row:has(input:checked) {
  background: var(--flat15);
}

/* "I work here": one box with the tick on top, and Email and Position
 * unfolded inside it once ticked. */
.fold {
  border-radius: 14px;
  box-shadow: inset 0 0 0 1px var(--field-edge);
}

/* The box draws the edge and the tint; the row's own would cover its top. */
.fold .check-row,
.fold .check-row:has(input:checked) {
  background: none;
  box-shadow: none;
}

.fold:has(.check-row input:checked) {
  background: var(--flat15);
}

.fold-body {
  display: grid;
  gap: 20px;
  padding: 4px 16px 18px;
}

.hp {
  position: absolute;
  left: -10000px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.form .fine a {
  font-weight: 600;
}

.done {
  display: grid;
  justify-items: start;
  gap: 14px;
}

.done:focus {
  outline: none;
}

.done-mark {
  width: 44px;
  height: 44px;
  color: var(--brand);
}

.done h3 {
  font-size: clamp(30px, 3.4vw, 40px);
}

.share {
  display: flex;
  gap: 8px;
  width: 100%;
}

.share input {
  flex: 1;
  min-width: 0;
  height: 44px;
  padding: 0 16px;
  border: 0;
  border-radius: 22px;
  background: var(--field);
  box-shadow: inset 0 0 0 1px var(--field-edge);
  font-size: 14px;
  color: var(--secondary-ink);
}

.copy-status {
  min-height: 1.4em;
  /* The line is kept for "Link copied." so nothing jumps when it appears;
     pulled into the gaps either side so, empty, it isn't a hole. */
  margin-block: -8px;
  font-size: 14px;
  color: var(--secondary-ink);
}

/* ── /privacy, /terms, /support ─────────────────────────────────────────── */

/* A document, read top to bottom: one measure, and section heads in the
 * system face at h3's weight. Seven h2s at display size would shout over
 * paragraphs two or three lines long. */
.legal {
  --max: 760px;
  padding-block: clamp(40px, 7vw, 96px) var(--section);
}

.legal-head {
  display: grid;
  gap: 14px;
  padding-bottom: clamp(28px, 4vw, 44px);
  border-bottom: 1px solid var(--divider);
}

.legal section {
  padding-top: clamp(28px, 3.5vw, 40px);
}

.legal h2 {
  font: 700 clamp(21px, 0.8vw + 17px, 26px) / 1.2 var(--font-sans);
  letter-spacing: -0.015em;
}

.legal section p {
  margin-top: 10px;
  max-width: 38em;
  text-wrap: pretty;
}

.legal section p + p {
  margin-top: 14px;
}

.legal strong {
  font-weight: 600;
}

.legal code {
  font: 0.88em/1 ui-monospace, SFMono-Regular, Menlo, monospace;
}

/* A list inside a legal page (/privacy, /terms): the paragraph measure, a
 * small dash so items read as items without a bullet's weight. */
.legal-list {
  display: grid;
  gap: 10px;
  margin-top: 12px;
  max-width: 38em;
}

.legal-list li {
  position: relative;
  padding-left: 18px;
  text-wrap: pretty;
}

.legal-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.75em;
  width: 8px;
  height: 2px;
  background: var(--secondary-ink);
}

/* ── 404 ────────────────────────────────────────────────────────────────── */

.lost {
  display: grid;
  justify-items: start;
  gap: 22px;
  padding-block: clamp(56px, 10vw, 128px);
}

.lost .actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 6px;
}

.lost-band {
  height: clamp(120px, 18vw, 220px);
}

/* ── /join/<code> (2026-10-24) ──────────────────────────────────────────────
 * The staff invite page, laid out as the 404. The code sits on a flat card in
 * monospaced capitals, so a 2 is never read as a Z when somebody types it. */

.join-card {
  display: grid;
  gap: 8px;
  padding: 18px 22px 20px;
  border-radius: 22px;
  background: var(--flat15);
}

.join-code {
  font: 700 clamp(40px, 5vw + 20px, 64px) / 1 ui-monospace, SFMono-Regular, Menlo, monospace;
  letter-spacing: 0.12em;
  color: var(--ink);
}

.join .lead {
  max-width: 32em;
}

/* ── motion: a one-time fade-up for what is below the fold ──────────────── */

.pending {
  opacity: 0;
  transform: translateY(18px);
}

.revealed {
  transition:
    opacity 0.7s ease,
    transform 0.7s cubic-bezier(0.2, 0.7, 0.2, 1);
}

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

@media print {
  .pending {
    opacity: 1;
    transform: none;
  }
}
