/*
 * plinthhealth.com
 *
 * The mark is a plinth: a slab resting on two legs. That is the whole visual argument of this
 * page — a heavy horizontal rule separates every band, the headline stands on a drawn plinth, and
 * annotations sit out in a left margin the way they do on a measured drawing. Nothing here is
 * decorative for its own sake; if a line is present it is separating two things.
 *
 * Colour is never the only carrier of meaning, every surface token has a dark counterpart, and the
 * whole page is built to WCAG 2.2 AA because the product it is selling is.
 */

/* --- Typefaces ---------------------------------------------------------------------------------
 *
 * Served from this origin. See fonts/LICENCE.txt for why that is a decision rather than an
 * optimisation. Each is the Latin subset; `font-display: swap` so text is readable before the
 * files land.
 */

@font-face {
  font-family: 'Archivo';
  src: url('fonts/archivo-latin.woff2') format('woff2');
  font-weight: 500 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Source Serif 4';
  src: url('fonts/source-serif-4-latin.woff2') format('woff2');
  font-weight: 400 600;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'IBM Plex Mono';
  src: url('fonts/ibm-plex-mono-500-latin.woff2') format('woff2');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

/* --- Tokens ------------------------------------------------------------------------------------
 *
 * Light is the bare :root block and dark redefines the same names below. A rule that sets a
 * literal colour instead of a token is readable in one scheme and invisible in the other, which is
 * the exact way this went wrong in the app twice.
 */

:root {
  --ink: #0d1b26;
  --ink-soft: #4a5c6b;
  --ground: #eef1f4;
  --paper: #ffffff;
  --rule: #b9c5ce;
  --rule-soft: #dde3e9;
  --accent: #0b5d8f;
  --accent-quiet: #e3eef6;
  --button: #0b5d8f;
  --button-ink: #ffffff;
  --button-hover: #08496f;
  --clay: #8a4c15;
  --focus: #b45309;

  --measure: 34rem;
  --sheet: 72rem;
  --gutter: clamp(1.25rem, 4vw, 3.5rem);
}

@media (prefers-color-scheme: dark) {
  :root {
    --ink: #e6edf3;
    --ink-soft: #9aabb8;
    --ground: #0c1419;
    --paper: #131f27;
    --rule: #2f414f;
    --rule-soft: #1f2d37;
    --accent: #6fb3dc;
    --accent-quiet: #17303f;
    --button: #1372ad;
    --button-ink: #ffffff;
    --button-hover: #1a86c8;
    --clay: #dda06a;
    --focus: #f0a04b;
  }
}

/* --- Reset and base ---------------------------------------------------------------------------- */

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

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

body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font-family: 'Source Serif 4', Georgia, 'Times New Roman', serif;
  font-size: 1.0625rem;
  line-height: 1.65;
  font-synthesis-weight: none;
}

h1,
h2,
h3 {
  font-family: 'Archivo', 'Helvetica Neue', Arial, sans-serif;
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.02em;
  text-wrap: balance;
  margin: 0;
}

p {
  margin: 0;
  max-width: var(--measure);
}

a {
  color: var(--accent);
  text-underline-offset: 0.18em;
  text-decoration-thickness: from-font;
}

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

/* 3px against the adjacent colour, never a removed outline: the keyboard user is the only person
   who can tell where they are on the page. */
:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
  border-radius: 2px;
}

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

.skip {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--paper);
  color: var(--ink);
  padding: 0.75rem 1.25rem;
  z-index: 10;
  font-family: 'Archivo', sans-serif;
}

.skip:focus {
  left: 0;
}

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

/* --- The sheet ---------------------------------------------------------------------------------
 *
 * Every band is the same grid: a narrow annotation column on the left, content on the right. Below
 * 60rem the annotation folds above the content rather than squeezing, because a 6ch column of
 * letter-spaced mono is unreadable.
 */

.band {
  border-top: 2px solid var(--rule);
  padding: clamp(3rem, 7vw, 5.5rem) var(--gutter);
}

.band--paper {
  background: var(--paper);
}

.band__inner {
  max-width: var(--sheet);
  margin: 0 auto;
  display: grid;
  gap: clamp(1.5rem, 4vw, 3rem);
  grid-template-columns: minmax(0, 1fr);
}

@media (min-width: 60rem) {
  .band__inner {
    grid-template-columns: 9rem minmax(0, 1fr);
  }
}

.annotation {
  font-family: 'IBM Plex Mono', ui-monospace, 'SFMono-Regular', Menlo, monospace;
  font-weight: 500;
  font-size: 0.75rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin: 0;
  /* Sits on the cap-height of the heading beside it rather than its line box. */
  padding-top: 0.35rem;
}

.band__body {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  min-width: 0;
}

.band__body h2 {
  font-size: clamp(1.6rem, 3.4vw, 2.35rem);
}

.lede {
  font-size: 1.1875rem;
  color: var(--ink-soft);
}

/* --- Header ------------------------------------------------------------------------------------ */

.masthead {
  background: var(--paper);
  padding: 1.25rem var(--gutter);
}

.masthead__inner {
  max-width: var(--sheet);
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem 2rem;
}

.masthead__lockup {
  display: inline-flex;
  align-items: center;
  /* The lockup is the site name; the link needs no further label. */
  line-height: 0;
}

.masthead__lockup svg {
  height: 1.75rem;
  width: auto;
  fill: var(--accent);
}

.masthead nav ul {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.75rem;
  margin: 0;
  padding: 0;
}

.masthead nav a {
  font-family: 'Archivo', sans-serif;
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--ink);
  text-decoration: none;
  /* 24×24 minimum target (WCAG 2.5.8) without visibly padding a text link out of shape. */
  display: inline-flex;
  align-items: center;
  min-height: 24px;
}

.masthead nav a:hover,
.masthead nav a:focus-visible {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 0.25em;
}

/* --- Hero -------------------------------------------------------------------------------------- */

.hero {
  background: var(--paper);
  border-top: 2px solid var(--rule);
  padding: clamp(3rem, 8vw, 6rem) var(--gutter) clamp(3rem, 7vw, 5rem);
}

.hero__inner {
  max-width: var(--sheet);
  margin: 0 auto;
}

.hero h1 {
  font-size: clamp(2.5rem, 8vw, 5.25rem);
  letter-spacing: -0.035em;
  max-width: 16ch;
}

/*
 * The mark at page scale: a slab on two legs, with the headline standing on it. Drawn rather than
 * an <img> so it takes the accent token in both schemes, and aria-hidden because it says nothing a
 * screen-reader user needs — the words above it are the content.
 */
.plinth {
  margin: clamp(1.75rem, 4vw, 2.75rem) 0 clamp(2rem, 4vw, 3rem);
  position: relative;
  height: 3.25rem;
  max-width: 44rem;
}

.plinth__slab {
  position: absolute;
  inset: 0 0 auto 0;
  height: 0.625rem;
  background: var(--accent);
}

.plinth__leg {
  position: absolute;
  top: 0.625rem;
  width: 0.625rem;
  height: 2.625rem;
  background: var(--accent);
}

.plinth__leg:first-of-type {
  left: 8%;
}

.plinth__leg:last-of-type {
  right: 8%;
}

.hero__lede {
  font-size: clamp(1.125rem, 2.2vw, 1.375rem);
  max-width: 42rem;
  color: var(--ink-soft);
}

.hero__actions {
  margin-top: 2.25rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1.25rem 2rem;
}

/* The symbol definitions. Out of flow and zero-sized: <use> still resolves, and nothing about it
   participates in layout. */
.sprite {
  position: absolute;
}

/* --- Status note -------------------------------------------------------------------------------
 *
 * Said in words and marked with a rule, not a colour: somebody who cannot see the clay line still
 * reads "not open yet". This is the most important sentence on the page for anybody deciding
 * whether to act on it, so it is never quieter than the copy around it.
 */

.status {
  border-left: 4px solid var(--clay);
  padding-left: 1rem;
  color: var(--ink);
}

.status strong {
  font-family: 'Archivo', sans-serif;
  font-weight: 600;
}

.hero__status {
  margin-top: 2.25rem;
}

/* --- Buttons ----------------------------------------------------------------------------------- */

.button {
  font-family: 'Archivo', sans-serif;
  font-size: 1rem;
  font-weight: 600;
  background: var(--button);
  color: var(--button-ink);
  border: 2px solid var(--button);
  padding: 0.75rem 1.5rem;
  min-height: 44px;
  border-radius: 3px;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.button:hover {
  background: var(--button-hover);
  border-color: var(--button-hover);
}

.button[disabled] {
  cursor: progress;
  opacity: 0.7;
}

/* --- Capability grid ---------------------------------------------------------------------------- */

.cards {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 1px;
  background: var(--rule-soft);
  border: 1px solid var(--rule-soft);
  grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
}

.cards > li {
  background: var(--paper);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.cards h3 {
  font-size: 1.0625rem;
  letter-spacing: -0.01em;
}

.cards p {
  color: var(--ink-soft);
  font-size: 0.9688rem;
  margin: 0;
}

/* --- Point list --------------------------------------------------------------------------------
 *
 * A rule to the left of each point rather than a bullet glyph: the same slab motif, and it survives
 * a list item running to three lines without the marker drifting away from the text.
 */

.points {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  max-width: var(--measure);
}

.points > li {
  border-left: 3px solid var(--accent);
  padding-left: 1rem;
}

.points strong {
  font-family: 'Archivo', sans-serif;
  font-weight: 600;
  display: block;
}

.points span {
  color: var(--ink-soft);
}

/* --- Aside ------------------------------------------------------------------------------------- */

.aside {
  background: var(--accent-quiet);
  padding: 1.75rem;
  max-width: var(--measure);
  border-radius: 3px;
}

.aside h2 {
  font-size: 1.25rem;
  margin-bottom: 0.75rem;
}

/* --- Waitlist form ------------------------------------------------------------------------------ */

.waitlist {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  max-width: 30rem;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
}

.field label {
  font-family: 'Archivo', sans-serif;
  font-weight: 600;
  font-size: 0.9375rem;
}

.field__optional {
  font-weight: 500;
  color: var(--ink-soft);
}

.field input,
.field textarea {
  font: inherit;
  font-size: 1rem;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--ink-soft);
  border-radius: 3px;
  padding: 0.625rem 0.75rem;
  min-height: 44px;
  width: 100%;
}

.field textarea {
  resize: vertical;
}

/* Never the border colour alone — an error is announced, described and outlined. */
.field input[aria-invalid='true'],
.field textarea[aria-invalid='true'] {
  border-color: var(--clay);
  border-width: 2px;
}

.field__help {
  font-size: 0.875rem;
  color: var(--ink-soft);
  margin: 0;
}

.field__error {
  font-size: 0.875rem;
  font-family: 'Archivo', sans-serif;
  font-weight: 600;
  color: var(--clay);
  margin: 0;
}

.field__error:empty {
  display: none;
}

.waitlist__status {
  font-family: 'Archivo', sans-serif;
  font-weight: 600;
  margin: 0;
}

.waitlist__status:empty {
  display: none;
}

.waitlist__status[data-state='ok'] {
  border-left: 4px solid var(--accent);
  padding-left: 1rem;
}

.waitlist__status[data-state='error'] {
  border-left: 4px solid var(--clay);
  padding-left: 1rem;
  color: var(--clay);
}

/* The honeypot. Hidden from everybody — including assistive technology, which is why it carries
   aria-hidden and tabindex="-1" in the markup as well as being off-screen here. */
.trap {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.waitlist__note {
  max-width: 30rem;
}

/* --- Footer ------------------------------------------------------------------------------------- */

.footer {
  border-top: 2px solid var(--rule);
  background: var(--paper);
  padding: clamp(2.5rem, 5vw, 3.5rem) var(--gutter);
}

.footer__inner {
  max-width: var(--sheet);
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 1.5rem 3rem;
}

.footer svg {
  height: 1.5rem;
  width: auto;
  fill: var(--accent);
}

.footer p,
.footer li {
  font-size: 0.9375rem;
  color: var(--ink-soft);
}

.footer ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.footer a {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
}

.footer__blurb {
  margin-top: 0.75rem;
}

/* --- Prose pages (privacy, 404) ------------------------------------------------------------------ */

.prose {
  max-width: 42rem;
  margin: 0 auto;
  padding: clamp(2.5rem, 6vw, 4.5rem) var(--gutter);
}

.prose h1 {
  font-size: clamp(2rem, 5vw, 2.75rem);
  margin-bottom: 1.5rem;
}

.prose h2 {
  font-size: 1.3125rem;
  margin: 2.5rem 0 0.75rem;
}

.prose p,
.prose li {
  max-width: none;
  margin-bottom: 1rem;
}

.prose ul {
  padding-left: 1.25rem;
}

/* --- Motion ---------------------------------------------------------------------------------------
 *
 * One sequence, on load, and only where the reader has not asked for stillness.
 */

@media (prefers-reduced-motion: no-preference) {
  .hero h1,
  .plinth,
  .hero__lede,
  .hero__actions {
    animation: rise 0.5s cubic-bezier(0.2, 0.6, 0.3, 1) backwards;
  }

  .plinth {
    animation-delay: 0.06s;
  }

  .hero__lede {
    animation-delay: 0.12s;
  }

  .hero__actions {
    animation-delay: 0.18s;
  }

  @keyframes rise {
    from {
      opacity: 0;
      transform: translateY(0.75rem);
    }
  }
}
