/*
 * Colours are the tokens in theme.css, which the build writes from theme.json (the same values as
 * the app's globals.css, so the site and the product read as one). test/site.test.mjs holds every
 * text and surface pair to 4.5:1 in both themes. Type, space and widths are the app's scale too.
 */

:root {
  --font-sans: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --text-sm: 0.875rem;
  --text-base: 1rem;
  --text-lg: 1.125rem;
  --text-xl: 1.375rem;
  --text-2xl: clamp(1.75rem, 1.35rem + 1.4vw, 2.5rem);
  --text-3xl: 2.5rem;
  --text-hero: clamp(2.25rem, 1.45rem + 3.2vw, 3.75rem);
  /* The hero's size beside its phone, following its own column (a container): each sentence one line in English. */
  --text-hero-fit: min(var(--text-hero), 6.8cqi);
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.5rem;
  --space-6: 2rem;
  --space-7: 3rem;
  --space-8: 4.5rem;
  --radius-sm: 0.375rem;
  --radius-md: 0.625rem;
  --radius-lg: 1rem;
  --tap: 2.75rem;
  --page-width: 72rem;
  --reading: 40rem;
  --shadow: 0 1.25rem 2.5rem -1rem var(--shadow-color);
  --phone-overlap: 4rem;
  --gutter: var(--space-4);
}

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

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

body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: 1.55;
}

main {
  flex: 1;
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

h1,
h2,
h3 {
  margin: 0;
  line-height: 1.2;
  text-wrap: balance;
}

h2 {
  font-size: var(--text-2xl);
  font-weight: 750;
  letter-spacing: -0.015em;
}

h3 {
  font-size: var(--text-lg);
  font-weight: 650;
}

p,
figure {
  margin: 0;
}

p {
  text-wrap: pretty;
}

a {
  color: var(--link);
  text-underline-offset: 0.18em;
}

a:focus-visible,
button:focus-visible,
summary:focus-visible,
main:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

main:focus:not(:focus-visible) {
  outline: none;
}

/* The page column keeps clear of a phone's notch and rounded corners (viewport-fit=cover lets the
   bands run to the edges; PWA-6). */
.wrap {
  width: 100%;
  max-width: var(--page-width);
  margin-inline: auto;
  padding-inline: max(var(--gutter), env(safe-area-inset-left)) max(var(--gutter), env(safe-area-inset-right));
}

.narrow > * {
  max-width: 46rem;
}

.skip-link {
  position: absolute;
  left: var(--space-4);
  top: -4rem;
  z-index: 10;
  display: inline-flex;
  align-items: center;
  min-height: var(--tap);
  padding-inline: var(--space-4);
  background: var(--surface);
  color: var(--link);
  border-radius: var(--radius-md);
}

.skip-link:focus {
  top: var(--space-2);
}

/* Header */

/* The header stays at the top while the page scrolls; sections land below it. */
.masthead {
  position: sticky;
  top: 0;
  z-index: 5;
  padding-top: env(safe-area-inset-top);
  border-bottom: 1px solid var(--border);
  background: var(--bg);
}

/* Below 64rem the section links sit behind the menu button, in a panel under the header. */
.menu summary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: var(--tap);
  height: var(--tap);
  border-radius: var(--radius-md);
  color: var(--text);
  cursor: pointer;
  list-style: none;
}

.menu summary::-webkit-details-marker {
  display: none;
}

.menu summary:hover,
.menu[open] summary {
  background: var(--surface-muted);
}

/* A closed menu lays out nothing, so no probe or reader meets its links. */
.menu:not([open]) .menu-panel {
  display: none;
}

.menu-panel {
  position: absolute;
  top: 100%;
  right: max(var(--space-4), env(safe-area-inset-right));
  left: max(var(--space-4), env(safe-area-inset-left));
  display: flex;
  flex-direction: column;
  padding: var(--space-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.menu-panel a {
  display: flex;
  align-items: center;
  min-height: var(--tap);
  padding-inline: var(--space-3);
  border-radius: var(--radius-md);
  color: var(--text);
  font-weight: 600;
  text-decoration: none;
}

.menu-panel a:hover {
  background: var(--surface-muted);
}

.masthead-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  column-gap: var(--space-2);
  padding-block: var(--space-2);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  min-height: var(--tap);
  color: var(--text);
  font-size: var(--text-lg);
  font-weight: 750;
  letter-spacing: -0.01em;
  text-decoration: none;
}

/* Below 64rem the header keeps one row (brand, language, theme), and the sections follow in order. */
.sections {
  display: none;
}

.sections a,
.site-footer nav a {
  display: inline-flex;
  align-items: center;
  min-height: var(--tap);
  min-width: var(--tap);
  padding-inline: var(--space-3);
  color: var(--text-muted);
  font-weight: 550;
  text-decoration: none;
}

.sections a:hover,
.site-footer nav a:hover {
  color: var(--text);
  text-decoration: underline;
}

.masthead-tools {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  margin-left: auto;
}

.lang-switch {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: var(--tap);
  min-width: var(--tap);
  padding-inline: var(--space-2);
  color: var(--text);
  font-weight: 600;
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: var(--tap);
  height: var(--tap);
  padding: 0;
  border: 0;
  border-radius: var(--radius-md);
  background: transparent;
  color: var(--text);
  cursor: pointer;
}

.theme-toggle[hidden] {
  display: none;
}

.theme-toggle:hover {
  background: var(--surface-muted);
}

.icon-sun,
:root[data-theme-now='dark'] .icon-moon {
  display: none;
}

:root[data-theme-now='dark'] .icon-sun {
  display: block;
}

/* Buttons */

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: var(--tap);
  padding: var(--space-2) var(--space-5);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  background: var(--surface);
  color: var(--text);
  /* A <button> takes the page's type like a link does (the forms' Send drew at the browser's 13.3 px). */
  font: inherit;
  font-weight: 650;
  line-height: 1.25;
  text-align: center;
  text-decoration: none;
}

.btn:hover {
  background: var(--surface-muted);
}

.btn-primary {
  border-color: var(--accent);
  background: var(--accent);
  color: var(--on-accent);
}

.btn-primary:hover {
  border-color: var(--accent-hover);
  background: var(--accent-hover);
}

.btn-quiet {
  padding-inline: 0;
  border-color: transparent;
  background: transparent;
  color: var(--link);
  text-decoration: underline;
}

.btn-quiet:hover {
  background: var(--surface-muted);
}

/* Hero */

.hero {
  padding-top: var(--space-6);
  overflow-x: clip;
}

.hero-grid {
  display: grid;
  gap: var(--space-6);
}

.hero h1 {
  font-size: var(--text-hero);
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -0.03em;
}

.hero h1 span {
  display: block;
  text-wrap: balance;
}

.hero h1 span + span {
  margin-top: 0.12em;
}

.kicker {
  margin-bottom: var(--space-3);
  color: var(--link);
  font-weight: 650;
}

.lead {
  max-width: 38rem;
  margin-top: var(--space-5);
  font-size: var(--text-lg);
}

.hero .actions {
  margin-top: var(--space-6);
}

.hero-or {
  margin-top: var(--space-3);
  color: var(--text-muted);
}

/* On a phone the two hero actions take the full width, the primary under the thumb first. */
@media (max-width: 39.99rem) {
  .hero .actions .btn {
    width: 100%;
  }
}

/* The phone stands on the band below it: it runs past the hero by --phone-overlap. */
.hero-shot {
  position: relative;
  z-index: 1;
  justify-self: center;
  width: min(17rem, 85%);
  margin: 0 0 calc(-1 * var(--phone-overlap));
}

.hero-shot figcaption {
  margin: 0 0 var(--space-3);
}

/* The hero's phone shows the top of the check-in, its heading and the rent question, and stops
   there: never its send bar, whose filled button would be a second primary action beside the page's
   own (blind audit r13), and no taller than the copy beside it, so a wide hero has no empty quarter
   under its words (design audit r15). Phones show the top 22rem of every screen the same way. */
@media (min-width: 40rem) {
  .hero-shot .frame img {
    max-height: 26rem;
    object-fit: cover;
    object-position: top;
  }
}

/* A screen cut to its top fades out over its last lines, so the cut reads as a page that goes on,
   never as a card broken off mid-way (design audit r15: the Spanish report's fourth card). Only the
   alpha of a mask counts, so it is drawn in currentColor. */
.hero-shot .frame img {
  mask-image: linear-gradient(to bottom, currentColor calc(100% - 2.5rem), transparent);
}

/* Screens from the app */

.device .frame {
  overflow: hidden;
  box-shadow: var(--shadow);
}

/* Until its screenshot arrives, the image's own box (width and height on the img) is a slot of its
   size tinted in the brand's soft colour: never an empty box, and no drawn bars that read as a
   broken page (design audit r14). The image covers it once loaded. */
.device .frame img {
  background: var(--brand-soft);
}

/* Behind a screen cut to its top (and faded, below), a phone's glass is its bezel's colour and a
   window's its page's, so the fade reads as the screen going on. */
.device-phone .frame {
  border: 0.5rem solid var(--frame);
  border-bottom-width: 1.25rem;
  border-radius: 2rem;
  background: var(--frame);
}

.device-screen .frame {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
}

/* About the app's own width, so the coach's page reads at close to its real size. */
.coach-shot {
  max-width: 58rem;
}

.device figcaption {
  margin-top: var(--space-3);
  color: var(--text-muted);
  font-size: var(--text-sm);
}

/* The band the hero stands on, and the contact band at the end */

.band {
  background: var(--ink);
  color: var(--on-ink);
  padding-block: var(--space-8);
}

.band h2 {
  color: var(--on-ink);
}

.band h3 {
  color: var(--ink-muted);
}

/* On an ink band every focus ring takes the band's light ink: the page's focus green is dark on its
   dark green (the keyboard walk, check-keys.mjs, found a fold's title ringed at under 3:1). A form's
   card on the band is the page's own surface again, so its ring is the page's. */
.band :is(a, button, summary):focus-visible {
  outline-color: var(--ink-muted);
}

.band .contact-form :is(a, button, summary, input, select, textarea):focus-visible {
  outline-color: var(--focus);
}

/* A link on an ink band reads in the band's own ink, never the page's link green, which is dark on
   dark there (blind audit r10: the trial link in the contact steps). :where keeps it below any
   rule that names its link, and the buttons keep their own colours. */
.band :where(a:not(.btn)) {
  color: var(--on-ink);
}

.who-more {
  margin-top: var(--space-6);
}

.band-who {
  padding-top: calc(var(--phone-overlap) + var(--space-7));
}

.who-grid {
  display: grid;
  gap: var(--space-6);
  margin-top: var(--space-6);
}

.who-item {
  padding-top: var(--space-4);
  border-top: 2px solid var(--ink-muted);
}

.who-item p {
  margin-top: var(--space-2);
}

.who-item a {
  display: inline-flex;
  align-items: center;
  min-height: var(--tap);
  margin-top: var(--space-1);
  color: var(--ink-muted);
  font-weight: 650;
}

/* Sections */

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

.section-alt {
  background: var(--surface);
  border-block: 1px solid var(--border);
}

.section-lead {
  max-width: var(--reading);
  margin-top: var(--space-3);
  color: var(--text-muted);
  font-size: var(--text-lg);
}

.band .section-lead {
  color: var(--on-ink);
}

.split {
  display: grid;
  gap: var(--space-7);
  align-items: start;
}

.split > .device-phone {
  justify-self: center;
  width: min(15rem, 80%);
}

/* On a phone a screen shows its top, as the app opens: a tall page stops at the frame. Sections
   and the gap beside a screen are a step tighter there, so the page reads in fewer screens. */
@media (max-width: 47.99rem) {
  .section,
  .band {
    padding-block: var(--space-7);
  }

  /* The two priced plans side by side from 360 px, the larger programs' card under them. */
  .plans {
    grid-template-columns: repeat(auto-fit, minmax(min(9.5rem, 100%), 1fr));
    gap: var(--space-3);
  }

  .plan {
    padding: var(--space-4);
  }

  .plan:last-child {
    grid-column: 1 / -1;
  }
}

/* On a phone a section's own breathing room is a step tighter again, so the page reads in fewer screens. */
@media (max-width: 39.99rem) {
  .section,
  .band {
    padding-block: var(--space-6);
  }

  .band-who {
    padding-top: calc(var(--phone-overlap) + var(--space-6));
  }

  /* The who band still starts under the hero phone that stands on it. */
  .band-who {
    padding-top: calc(var(--phone-overlap) + var(--space-7));
  }

  .split {
    gap: var(--space-6);
  }

  .device-phone .frame img,
  .device-screen .frame img {
    max-height: 22rem;
    object-fit: cover;
    object-position: top;
    mask-image: linear-gradient(to bottom, currentColor calc(100% - 2.5rem), transparent);
  }
}

.steps {
  display: grid;
  gap: var(--space-5);
  margin: var(--space-6) 0 0;
  padding: 0;
  list-style: none;
  counter-reset: step;
}

.steps li {
  position: relative;
  padding-left: 3rem;
  counter-increment: step;
}

.steps li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: -0.1rem;
  display: grid;
  place-items: center;
  width: 2.125rem;
  height: 2.125rem;
  border-radius: 50%;
  background: var(--brand-soft);
  color: var(--on-brand-soft);
  font-weight: 750;
}

.steps p {
  margin-top: var(--space-1);
}


.points,
.choices {
  display: grid;
  gap: var(--space-5);
  margin: var(--space-6) 0;
  padding: 0;
  list-style: none;
}

.points li,
.choices li {
  padding-top: var(--space-4);
  border-top: 1px solid var(--border);
}

.points p,
.choices p {
  margin-top: var(--space-1);
}

.choices li {
  border-top: 0;
  padding: var(--space-4) var(--space-5);
  border-left: 4px solid var(--link);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  background: var(--surface-muted);
}

.honest {
  max-width: var(--reading);
  margin-bottom: var(--space-4);
  font-weight: 600;
}

.note {
  max-width: var(--reading);
  margin-top: var(--space-3);
  color: var(--text-muted);
  font-size: var(--text-sm);
}

/* Pricing */

.plans {
  display: grid;
  gap: var(--space-4);
  margin-top: var(--space-6);
}

.plan {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  padding: var(--space-5);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--bg);
}

.plan .btn {
  align-self: flex-start;
  margin-top: auto;
}

.price {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.amount {
  font-size: var(--text-3xl);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.02em;
}

.amount-words {
  font-size: var(--text-2xl);
}

.per {
  color: var(--text-muted);
}

.limits {
  font-weight: 600;
}

.checks {
  display: grid;
  gap: var(--space-2) var(--space-6);
  margin: var(--space-4) 0 0;
  padding: 0;
  list-style: none;
}

.checks li {
  position: relative;
  padding-left: 1.75rem;
}

.checks li::before {
  content: '';
  position: absolute;
  left: 0.25rem;
  top: 0.3em;
  width: 0.45rem;
  height: 0.8rem;
  border: solid var(--link);
  border-width: 0 3px 3px 0;
  transform: rotate(45deg);
}

.terms-line {
  max-width: var(--reading);
  margin-top: var(--space-5);
  font-weight: 600;
}

/* Why not a spreadsheet or a cheaper tool: one answer under the plans, from the stored quotes. The
   example's figures are the estimate's alone, below (design audit r14). */
.plans-why {
  max-width: var(--reading);
  margin-top: var(--space-4);
}

/* The trial, what every plan includes and when a plan is full: one fold under the plans, closed at
   every width (data-fold="always"); the trial link opens it (#trial). */
.trial-fold {
  margin-top: var(--space-4);
  border-top: 1px solid var(--border);
}

.trial-fold > summary h3 {
  font-size: var(--text-lg);
}

.trial-fold > .note:first-of-type {
  margin-top: 0;
}

.trial-fold h4 {
  margin: var(--space-4) 0 0;
  font-size: var(--text-base);
  font-weight: 650;
}

.trial-fold > :last-child {
  padding-bottom: var(--space-4);
}

/* Questions */

/* One line on a phone (the section's body is one fold, like the comparison's); on a wide screen the
   list sits beside its heading, so it spans the page's width instead of a narrow column with an
   empty third beside it (VIS-7, blind audit r13). */
.faq-all {
  margin-top: var(--space-5);
}

@media (min-width: 64rem) {
  .faq-section {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 2fr);
    column-gap: var(--space-8);
    align-items: start;
  }

  .faq-section > .faq-all {
    margin-top: 0;
  }
}

.faq {
  margin-top: var(--space-5);
  border-top: 1px solid var(--border);
}

.faq-all > .faq {
  margin-top: var(--space-3);
}

.faq details {
  border-bottom: 1px solid var(--border);
}

.faq summary {
  position: relative;
  display: flex;
  align-items: center;
  min-height: var(--tap);
  padding: var(--space-3) 0 var(--space-3) 2rem;
  font-weight: 650;
  cursor: pointer;
  list-style: none;
}

.faq summary::-webkit-details-marker {
  display: none;
}

.faq summary::before {
  content: '';
  position: absolute;
  left: 0.35rem;
  top: 50%;
  width: 0.55rem;
  height: 0.55rem;
  border: solid var(--text);
  border-width: 0 2px 2px 0;
  transform: translateY(-70%) rotate(45deg);
}

.faq details[open] summary::before {
  transform: translateY(-30%) rotate(-135deg);
}

.faq details p {
  max-width: var(--reading);
  padding: 0 0 var(--space-4) 2rem;
}

/* Contact */

.band-contact .actions {
  margin-top: var(--space-5);
}

/* A closing band's one action is the page's green primary, as in the hero (design audit r14: a white
   button on the ink band read as a second kind); its light edge marks it on the band's own green. */
.btn-ink-primary {
  border: 2px solid var(--ink-muted);
  background: var(--accent);
  color: var(--on-accent);
}

.btn-ink-primary:hover {
  background: var(--accent-hover);
}

.btn-ink {
  border-color: var(--ink-muted);
  background: transparent;
  color: var(--on-ink);
}

.btn-ink:hover {
  background: var(--ink-ghost-hover);
}

.contact-promise {
  margin-top: var(--space-4);
  font-weight: 600;
}

.contact-where {
  margin-top: var(--space-2);
}

/* The contact band's forms stand on a card of the page's own surface, so their fields, labels and
   green primary read as every other form and the hero's action (design audit r14); one column
   (src/contact.js). */
.contact-form {
  display: grid;
  gap: var(--space-2);
  max-width: 34rem;
  margin-top: var(--space-5);
  padding: var(--space-5);
  border-radius: var(--radius-lg);
  background: var(--surface);
  color: var(--text);
}

/* A question, under the trial request: its own quiet fold with the message form. */
.question {
  max-width: 34rem;
  margin-top: var(--space-5);
  border-top: 1px solid var(--ink-muted);
}

.question > summary {
  font-weight: 650;
}

.question > .contact-promise {
  margin-top: 0;
}

.contact-form[hidden],
.band-contact .actions[hidden] {
  display: none;
}

.contact-field {
  display: grid;
  gap: var(--space-1);
  margin-top: var(--space-2);
  font-weight: 600;
}

.contact-field input,
.contact-field select,
.contact-field textarea {
  width: 100%;
  min-height: var(--tap);
  padding: var(--space-2) var(--space-3);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  background: var(--field);
  color: var(--text);
  font: inherit;
  font-weight: 400;
}

.contact-field textarea {
  resize: vertical;
}

.contact-field input:focus-visible,
.contact-field select:focus-visible,
.contact-field textarea:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

.contact-field [aria-invalid='true'] {
  border-width: 2px;
  border-color: var(--text);
}

.contact-hint {
  color: var(--text-muted);
  font-size: var(--text-sm);
  font-weight: 400;
}

.contact-error,
.contact-status {
  font-weight: 600;
}

/* A field people never see and cannot reach; bots that fill every input fill it in. */
.contact-trap {
  display: none;
}

.contact-check:empty {
  display: none;
}

.contact-form button[type='submit'] {
  justify-self: start;
  margin-top: var(--space-2);
}

.contact-sent {
  margin-top: var(--space-5);
  padding: var(--space-4);
  border: 1px solid var(--ink-muted);
  border-radius: var(--radius-lg);
  font-weight: 600;
}

@media (max-width: 40rem) {
  .contact-form {
    padding: var(--space-4);
  }

  .contact-form button[type='submit'] {
    justify-self: stretch;
  }
}

.next {
  padding: var(--space-5);
  border: 1px solid var(--ink-muted);
  border-radius: var(--radius-lg);
}

.next .steps {
  margin-top: var(--space-4);
}

/* The first month as a timeline: when, then what happens, on one line down the card's left. */
.timeline {
  display: grid;
  gap: var(--space-4);
  margin: var(--space-4) 0 0 0.45rem;
  padding: 0 0 0 1.25rem;
  border-left: 2px solid var(--ink-muted);
  list-style: none;
}

.timeline li {
  position: relative;
}

.timeline li::before {
  content: '';
  position: absolute;
  left: calc(-1.25rem - 1px - 0.4rem);
  top: 0.35rem;
  width: 0.8rem;
  height: 0.8rem;
  border-radius: 50%;
  background: var(--ink-muted);
}

.next-when {
  color: var(--ink-muted);
  font-weight: 700;
}

.timeline p + p {
  margin-top: var(--space-1);
}

.next-ready {
  margin-top: var(--space-3);
  font-weight: 600;
}

/* The segment page's hero: its phone stands inside it, not on a band below it. */
.hero-plain {
  padding-bottom: var(--space-8);
}

.hero-plain .hero-shot {
  margin-bottom: 0;
}

/* What the report covers, and what it does not: two columns that stay readable at 320 px. */
.covers {
  max-width: 52rem;
  margin-top: var(--space-6);
  border-top: 1px solid var(--border);
}

.covers > summary h3 {
  font-size: var(--text-lg);
}

.covers-table {
  width: 100%;
  margin-top: var(--space-2);
  border-collapse: collapse;
}

.covers-table th,
.covers-table td {
  padding: var(--space-2) var(--space-3) var(--space-2) 0;
  border-top: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
}

.covers-table thead th {
  border-top: 0;
  color: var(--text-muted);
  font-size: var(--text-sm);
  font-weight: 600;
}

.covers-table th[scope='row'] {
  width: 38%;
  font-weight: 650;
}

.covers-small {
  margin-top: var(--space-3);
  color: var(--text-muted);
}

/* Legal pages and the 404 */

.legal h1 {
  font-size: var(--text-2xl);
  font-weight: 750;
}

.legal h2 {
  margin-top: var(--space-6);
  font-size: var(--text-xl);
}

.legal p {
  margin-top: var(--space-2);
}

.legal .actions {
  margin-top: var(--space-5);
}

.updated {
  color: var(--text-muted);
}

/* A long legal page: on a phone each section folds under its title, so the titles are its contents
   on one screen (an address naming a section opens it, theme.js); a wide screen opens every
   section and shows the contents in a column beside the reading column, which keeps the page's
   left edge (VIS-22) while the header's width holds no empty third beside it (VIS-7, blind audit
   r13). The closing questions line stays open. */
.contents {
  display: none;
}

.contents-title {
  color: var(--text-muted);
  font-size: var(--text-sm);
  font-weight: 650;
}

@media (min-width: 64rem) {
  .legal-page {
    display: grid;
    grid-template-columns: minmax(0, 46rem) minmax(0, 1fr);
    grid-template-areas: 'head contents' 'body contents';
    grid-template-rows: auto 1fr;
    column-gap: var(--space-8);
    align-items: start;
  }

  .legal-head {
    grid-area: head;
  }

  .legal-body {
    grid-area: body;
  }

  .legal-page > .contents {
    display: block;
    grid-area: contents;
    position: sticky;
    top: var(--space-8);
    padding-left: var(--space-5);
    border-left: 1px solid var(--border);
  }
}

.contents ul {
  display: grid;
  margin: var(--space-2) 0 0;
  padding: 0;
  list-style: none;
}

/* Each link a 44 px target from its padding, so a title on two lines keeps the same space to its
   neighbours as a title on one. */
.contents a {
  display: block;
  padding-block: 0.625rem;
}

/* The list's own mark (.faq) opens these folds; the card folds' chevron is not drawn twice (the
   legal pages' sections, and the questions' "More questions", blind audit r13). */
.legal-folds [data-fold] > summary::after,
.faq [data-fold] > summary::after {
  content: none;
}

.legal .legal-folds summary h2 {
  margin: 0;
  font-size: var(--text-lg);
}

.legal .legal-folds details p {
  margin-top: 0;
}

.legal .back {
  margin: 0 0 var(--space-4);
}

.legal .back a {
  display: inline-flex;
  align-items: center;
  min-height: var(--tap);
  font-weight: 600;
}

/* A link inside a sentence wraps with its words, so a bracket or a full stop never sits alone on a
   line (blind audit r11); its padding makes a 44 px target without moving the lines (an inline box's
   vertical padding takes no room). */
.inline-target {
  padding-block: 0.8rem;
}

/* A phone number is one run: "(863)" never ends a line above the rest (design audit r15). */
.tel {
  white-space: nowrap;
}

/* Footer */

.site-footer {
  border-top: 1px solid var(--border);
  padding-block: var(--space-5) max(var(--space-5), env(safe-area-inset-bottom));
  color: var(--text-muted);
  font-size: var(--text-sm);
}

.footer-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2) var(--space-5);
}

.site-footer nav {
  display: flex;
  flex-wrap: wrap;
  margin-inline: calc(-1 * var(--space-3));
}

.site-footer nav [aria-current='page'] {
  color: var(--text);
  text-decoration: underline;
}

/* Sections and folds a link or the menu jumps to land below the sticky header. */
section[id],
details[id] {
  scroll-margin-top: 4.5rem;
}

/* The header's copy of the page's one action (theme.js shows it once the hero's is out of sight).
   With it in, a narrow header keeps the mark and moves the product's name to screen readers. */
.header-cta {
  min-height: var(--tap);
  padding-inline: var(--space-3);
  border-color: var(--accent);
  background: var(--accent);
  color: var(--on-accent);
  white-space: nowrap;
}

.header-cta:hover {
  border-color: var(--accent-hover);
  background: var(--accent-hover);
}

.header-cta[hidden] {
  display: none;
}

@media (max-width: 47.99rem) {
  .has-cta .brand span {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }
}

.text-link {
  display: inline-flex;
  align-items: center;
  min-height: var(--tap);
  font-weight: 650;
}

/* Folds: a card's words behind its title on a narrow screen (theme.js opens them on a wide one). */
[data-fold] > summary {
  position: relative;
  display: flex;
  align-items: center;
  min-height: var(--tap);
  padding-right: 2rem;
  cursor: pointer;
  list-style: none;
}

[data-fold] > summary::-webkit-details-marker {
  display: none;
}

[data-fold] > summary::after {
  content: '';
  position: absolute;
  right: 0.5rem;
  top: 50%;
  width: 0.55rem;
  height: 0.55rem;
  border: solid var(--text-muted);
  border-width: 0 2px 2px 0;
  transform: translateY(-70%) rotate(45deg);
}

[data-fold][open] > summary::after {
  transform: translateY(-30%) rotate(-135deg);
}

/* On the ink bands a fold's chevron takes the band's quiet colour. */
.band [data-fold] > summary::after {
  border-color: var(--ink-muted);
}

.steps-fold li::before {
  top: 0.3rem;
}

.steps-fold p,
.points-fold p {
  margin-top: 0;
  padding-bottom: var(--space-2);
}

/* The estimate under the plans: one fold, open on a wide screen (theme.js), its title on a phone. */

.estimate-fold {
  margin-top: var(--space-4);
  border-top: 1px solid var(--border);
}

.estimate-fold > summary h3 {
  font-size: var(--text-lg);
}

.estimate {
  margin-top: var(--space-3);
  padding: var(--space-5);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--bg);
}

.estimate-label {
  margin-top: var(--space-1);
  color: var(--text-muted);
}

/* Participants and coaches side by side on a phone, the hourly cost under them; three across wider.
   Each box is three rows of the grid (its label, the field, its range line), so the boxes in a row
   stay level whatever their labels wrap to, and the range line keeps its room whether it shows or
   not, so a message never pushes its box out of line (blind audit r13). */
.estimate-inputs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: var(--space-4);
  row-gap: var(--space-4);
  margin-top: var(--space-5);
}

.estimate-inputs[hidden] {
  display: none;
}

/* At 320 px a Spanish label's longest word ("administradores") is wider than half the box. */
@media (max-width: 23.99rem) {
  .estimate-inputs {
    grid-template-columns: minmax(0, 1fr);
  }
}

.estimate-inputs label {
  display: grid;
  grid-row: span 3;
  grid-template-rows: subgrid;
  row-gap: var(--space-1);
  align-items: end;
  font-weight: 600;
}

.estimate-inputs input {
  width: 100%;
  min-height: var(--tap);
  padding: var(--space-2) var(--space-3);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  background: var(--field);
  color: var(--text);
  font: inherit;
}

.estimate-inputs input:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

/* A box out of range takes a heavier edge drawn inside its border, so it keeps its size and its row stays level. */
.estimate-inputs input[aria-invalid='true'] {
  border-color: var(--text);
  box-shadow: inset 0 0 0 1px var(--text);
}

.estimate-range {
  align-self: start;
  font-weight: 600;
  visibility: hidden;
}

.estimate-range.is-shown {
  visibility: visible;
}

.estimate-wait {
  font-weight: 600;
}

.estimate-year,
.estimate-grant {
  max-width: var(--reading);
  margin-top: var(--space-4);
}

/* The break-even lines read at the same measure as the lines under them. */
.estimate-results [data-when='large'],
.estimate-results [data-when='small'] {
  max-width: var(--reading);
}

.estimate-results {
  margin-top: var(--space-5);
}

.estimate-results dl {
  display: grid;
  gap: var(--space-4);
  margin: var(--space-4) 0;
}

.estimate-results dt {
  color: var(--text-muted);
  font-size: var(--text-sm);
}

.estimate-results dd {
  margin: var(--space-1) 0 0;
  font-size: var(--text-lg);
  font-weight: 650;
}

.estimate-results p + p {
  margin-top: var(--space-2);
}

.estimate-how {
  margin-top: var(--space-4);
  border-top: 1px solid var(--border);
}

.estimate-how > summary {
  font-weight: 650;
}

.estimate-parts {
  display: grid;
  gap: var(--space-3);
  margin: var(--space-3) 0;
}

.estimate-parts dt {
  color: var(--text-muted);
  font-size: var(--text-sm);
}

.estimate-parts dd {
  margin: var(--space-1) 0 0;
  font-weight: 650;
}

.estimate-how > p {
  margin-bottom: var(--space-2);
  color: var(--text-muted);
  font-size: var(--text-sm);
}

.estimate-how ol {
  display: grid;
  gap: var(--space-2);
  margin: var(--space-2) 0 0;
  padding-left: 1.25rem;
  color: var(--text-muted);
  font-size: var(--text-sm);
}

/* What else programs use */

.compare-all {
  margin-top: var(--space-5);
}

.compare {
  display: grid;
  gap: var(--space-3);
  margin-top: var(--space-4);
}

/* Side by side, the closed cards are one height whatever their titles wrap to; once one opens, each
   keeps its own height so a closed neighbour is not drawn as an empty card beside it. */
.compare:has(> .compare-item[open]) {
  align-items: start;
}

.compare-item {
  padding-inline: var(--space-5);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
}

.compare-item > summary {
  flex-wrap: wrap;
  row-gap: var(--space-1);
  padding-block: var(--space-4);
}

.compare-price {
  flex-basis: 100%;
  color: var(--text-muted);
}

.compare-item dl {
  display: grid;
  gap: var(--space-3);
  margin: 0;
  padding-bottom: var(--space-5);
}

.compare-item dt {
  font-weight: 650;
}

.compare-item dd {
  margin: var(--space-1) 0 0;
}

/* Wider screens */

@media (min-width: 40rem) {
  :root {
    --gutter: var(--space-5);
  }

  .points-3,
  .plans,
  .checks {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .estimate-inputs,
  .estimate-results dl,
  .estimate-parts {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .estimate-inputs label:last-child {
    grid-column: auto;
  }
}

/* Tablets and up: the hero in two columns, the phone whole inside it, clear of the band below. The
   copy starts at the top beside the phone, so the headline and its button are on the first screen
   of a laptop (1360x900, 1280x720) instead of sitting low beside the phone's full height. */
@media (min-width: 48rem) {
  :root {
    --phone-overlap: 0rem;
    --phone-width: 15rem;
  }

  .hero {
    padding-block: var(--space-7);
  }

  .hero-grid {
    grid-template-columns: minmax(0, 1.25fr) minmax(0, 0.75fr);
    align-items: start;
    column-gap: var(--space-7);
  }

  .hero-copy {
    padding-bottom: var(--space-7);
  }

  .hero-shot {
    width: var(--phone-width);
  }

  .band-who {
    padding-top: var(--space-7);
  }

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

/* A wide screen: the copy starts level with the phone's top edge, at the same height in every
   language (blind audit r11: centring it set the Spanish copy 40 px lower; r13: a fixed step down
   left a tall empty band above the headline), and the phone's caption moves under it, so nothing
   stands above the phone's top. */
@media (min-width: 64rem) {
  .hero-shot {
    display: flex;
    flex-direction: column;
  }

  .hero-shot figcaption {
    order: 1;
    margin: var(--space-3) 0 0;
  }
}

/* The header has room for the section links on one row. */
@media (min-width: 64rem) {
  .sections {
    display: flex;
    margin-inline: var(--space-4) 0;
  }

  .menu,
  .header-cta {
    display: none;
  }
}

@media (min-width: 64rem) {
  :root {
    --phone-width: 19rem;
  }

  .hero {
    padding-block: var(--space-7) var(--space-8);
  }

  /* The copy takes the width the phone leaves, and the headline's size follows that column, so each
     of its two sentences is one line in English (design audit r15: four lines of 60 px at 1360). */
  .hero-grid {
    grid-template-columns: minmax(0, 1fr) var(--phone-width);
    column-gap: var(--space-8);
  }

  .hero-copy {
    container-type: inline-size;
  }

  .hero h1 {
    font-size: var(--text-hero-fit);
  }

  .hero-copy,
  .band-who {
    padding-bottom: var(--space-8);
  }

  .band-who {
    padding-top: var(--space-8);
  }

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

  .split {
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
    column-gap: var(--space-8);
  }

  .split-reverse {
    grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  }

  .split-reverse > figure {
    order: -1;
  }

  .split-shot {
    grid-template-columns: minmax(0, 1.4fr) minmax(0, 0.6fr);
    align-items: center;
    column-gap: var(--space-7);
  }

  .split > .device-phone {
    width: 19rem;
  }

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

  .device-screen {
    margin-top: var(--space-2);
  }

  /* The band's heading level with the first month's top: with sign-up open its side is a heading, the sign-up and
     a folded line, which centred beside the timeline left an empty band above it (r15). */
  .band-contact .split {
    align-items: start;
  }
}

@media (max-width: 23.99rem) {
  .brand {
    font-size: var(--text-base);
  }

  .masthead-tools {
    gap: 0;
  }

  /* The language link says its full name at every width (design audit r14: "EN" at 320 against
     "English" elsewhere); the narrowest phones keep one row by taking the padding beside it (its box stays a 44 px target). */
  .lang-switch {
    padding-inline: 0;
  }

  .header-cta {
    padding-inline: var(--space-2);
  }
}

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