/* site/style.css
 *
 * THE DESIGN IS THE ARGUMENT.
 *
 * The page claims that most string marketing sells differences smaller than the
 * threshold a player can feel. A page that looked like that marketing — a hero
 * image, a gradient, a number blown up to 96px in a brand colour — would refute
 * its own copy before the copy was read. So this reads as an instrument: one
 * paper, one ink, hairline rules, and figures set in a monospace face so they
 * carry their units and read as readings rather than as claims.
 *
 * The structural device is a LEFT RAIL. Every label on the page — the section
 * headings and the five confidence terms in the disclosure — sits in that rail
 * in the utility face, quieter and smaller than the prose it labels. Prose is
 * indented to a single body column. The rule is: the left edge is structure and
 * readout, the indent is prose. Inverting the usual heading hierarchy is the one
 * deliberate risk here, and it is the same argument again — on an instrument the
 * etched labels are small and the reading is what you look at.
 *
 * THE DISCLOSURE IS NOT FINE PRINT. It is set at body size, in body weight, in
 * full-strength ink, on the same hairline rule as the findings, and it occupies
 * more of the page than either finding. It is the most structured block here on
 * purpose. Shrinking it would be the exact dishonesty the product exists to
 * refuse.
 *
 * ONE ACCENT, SPENT ONCE. `--accent` is declared and used nowhere but the
 * keyboard focus ring and the deposit action's `.action` fill. Colouring a
 * finding would oversell the one number the page is being most careful about.
 *
 * No imagery, no gradients, no external resource of any kind: no @font-face, no
 * @import, no url(). The page must render identically from file://.
 */

/* --- Reset: only what this page actually needs ---------------------------- */

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

body,
h1,
h2,
p,
dl,
dt,
dd,
figure {
  margin: 0;
}

/* --- Tokens --------------------------------------------------------------- */

:root {
  color-scheme: light dark;

  /* Charter: a text serif built for screens, sturdy and unliterary. It reads as
   * a technical note rather than a magazine. Every fallback is a system face; a
   * web font would be an external request and there are none on this page. */
  --serif: Charter, "Bitstream Charter", "Sitka Text", Cambria, "Iowan Old Style",
    Georgia, serif;
  /* The utility face. Labels and figures only. */
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas,
    "Liberation Mono", "DejaVu Sans Mono", monospace;

  /* One body measure, ~66 characters of Charter, and one rail, used by every
   * block on the page so the left edge and the indent never drift. */
  --measure: 32em;
  --rail: 10rem;
  --gutter: 2.5rem;

  /* Paper with a faint green-grey cast — graph paper and calibration
   * certificates, not the warm cream of a lifestyle brand. */
  --paper: #f2f4f3;
  --ink: #171b1c;
  --ink-quiet: #5a625f;
  --rule: #ced4d1;

  /* RESERVED. The single action takes this and nothing else may. */
  --accent: #34409e;
  --accent-ink: #ffffff;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #0f1312;
    --ink: #e4e9e7;
    --ink-quiet: #9aa39f;
    --rule: #2b3331;
    --accent: #97a6ff;
    --accent-ink: #0f1312;
  }
}

/* --- Page ----------------------------------------------------------------- */

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

body {
  background-color: var(--paper);
  color: var(--ink);
  font-family: var(--serif);
  /* ~17px at 320px, ~19px at 1200px. Never smaller than comfortable. */
  font-size: clamp(1.0625rem, 1rem + 0.35vw, 1.1875rem);
  line-height: 1.62;
  padding-inline: clamp(1.25rem, 5vw, 3.5rem);
  padding-block: clamp(3rem, 9vw, 6.5rem);
}

/* Narrow: one column, capped at the measure, so 320px is a single tidy column
 * and nothing has to be pinched to fit. */
main {
  max-width: var(--measure);
  margin-inline: auto;
}

p,
dd {
  text-wrap: pretty;
}

/* --- The thesis ----------------------------------------------------------- */

/* Regular weight, not bold. Size alone carries it, which is the restrained
 * version of a headline and the only one this page is entitled to. */
h1 {
  font-size: clamp(1.75rem, 1.15rem + 2.6vw, 2.6rem);
  font-weight: 400;
  line-height: 1.14;
  letter-spacing: -0.012em;
  text-wrap: balance;
}

.lede {
  margin-top: 1.5rem;
  max-width: 30em;
  font-size: 1.0625em;
}

/* --- Section labels ------------------------------------------------------- */

/* Headings are labels, so they are set in the utility face at label size and in
 * quiet ink. Nothing on this page shouts except its first sentence. */
h2 {
  font-family: var(--mono);
  font-size: 0.775em;
  font-weight: 400;
  line-height: 1.4;
  letter-spacing: 0.005em;
  color: var(--ink-quiet);
  margin-bottom: 1rem;
  /* Without this the longest label orphans its last word onto a line of its
   * own at narrow widths. */
  text-wrap: balance;
}

main > section {
  margin-top: clamp(3rem, 6vw, 4.75rem);
}

/* --- The findings: two cells of one readout ------------------------------- */

/* A hairline above each, the same hairline the disclosure gets. The findings
 * are not privileged over the caveats. */
.findings > figure {
  border-top: 1px solid var(--rule);
  padding-top: 1.125rem;
}

.findings > figure + figure {
  margin-top: 2rem;
}

/* The figures. Monospace, tabular, unit attached, and — deliberately — the same
 * size and weight as the prose around them. They read as measurements because
 * of the face, not because they were made large or coloured. */
.findings strong {
  font-family: var(--mono);
  font-size: 0.9em;
  font-weight: 400;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.005em;
  /* A reading must not break across a line from its unit. */
  white-space: nowrap;
}

/* --- The disclosure: a ruled sheet, at full body weight ------------------- */

/* FULL BODY SIZE, and that is not a typographic slip. A label is conventionally
 * set smaller than the text it labels, and these five were, until it was pointed
 * out that the page cannot argue the industry hides its uncertainty in small
 * print and then set the labels of its own uncertainty in small print. "NEVER
 * DONE" and "NOT BUILT" are the bluntest things here. They are the same size and
 * the same weight as the prose, and the line-height matches, so each term's line
 * box starts level with the first line of the definition beside it. The mono and
 * serif faces differ in metrics, so the two BASELINES are not guaranteed to
 * coincide — only the line-box tops are, which is what alignment here means. */
.disclosure dt {
  border-top: 1px solid var(--rule);
  padding-top: 1.125rem;
  font-family: var(--mono);
  font-size: 1em;
  font-weight: 400;
  line-height: 1.62;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  /* Full ink, unlike the section labels: the confidence ladder is the most
   * load-bearing structure on the page. */
  color: var(--ink);
}

.disclosure dd {
  padding-top: 0.5rem;
  padding-bottom: 2.25rem;
  max-width: var(--measure);
}

/* A closing rule, so the sheet ends rather than trails off. The last entry is
 * the bluntest thing the page says — that the product does not exist yet — and
 * it should sit on a floor, not fade into the margin. */
.disclosure > dl {
  border-bottom: 1px solid var(--rule);
}

/* --- Wide: the rail opens --------------------------------------------------
 *
 * `:where()` keeps these layout selectors at near-zero specificity so a later
 * class rule — `.disclosure > dl` here, `.offer` when the action arrives — wins
 * without a specificity fight or an `!important`.
 */

@media (min-width: 60rem) {
  main {
    max-width: calc(var(--rail) + var(--gutter) + var(--measure));
  }

  /* The thesis owns the whole block; its prose is indented into the body
   * column, which sets the rule the rest of the page follows. */
  .lede {
    margin-top: 2rem;
    margin-left: calc(var(--rail) + var(--gutter));
  }

  main > :where(section:not(.findings)) {
    display: grid;
    grid-template-columns: var(--rail) minmax(0, var(--measure));
    column-gap: var(--gutter);
    align-items: start;
  }

  main > :where(section:not(.findings)) > * {
    grid-column: 2;
  }

  main > :where(section:not(.findings)) > h2 {
    grid-column: 1;
    grid-row: 1;
    margin-bottom: 0;
  }

  /* Two readings on one instrument, so they are set side by side rather than
   * stacked. They span the rail as well as the body column: the readout uses
   * the full face. */
  .findings {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: var(--gutter);
  }

  .findings > figure + figure {
    margin-top: 0;
  }

  /* This one heading captions a sheet that uses the rail itself, so it spans
   * rather than sitting in the rail. Confined to the rail it wrapped to three
   * lines with the whole sheet width empty beside it — a hole, not a margin. */
  .disclosure > h2 {
    grid-column: 1 / -1;
  }

  /* The list spans both tracks and re-cuts them itself, so each term lands in
   * the same rail as the section labels and each definition lands on the same
   * indent as every other paragraph. The gutter is padding rather than a
   * column-gap so the hairline runs unbroken across the whole row. */
  .disclosure > dl {
    grid-column: 1 / -1;
    grid-row: 2;
    margin-top: 1.75rem;
    display: grid;
    grid-template-columns:
      calc(var(--rail) + var(--gutter))
      minmax(0, var(--measure));
  }

  .disclosure dt {
    padding-right: var(--gutter);
    padding-bottom: 2.25rem;
  }

  .disclosure dd {
    border-top: 1px solid var(--rule);
    padding-top: 1.125rem;
  }
}

/* --- The offer: the one reading with a control on it ----------------------- */

/* The deposit figure reads as a reading, not a headline: same mono/tabular
 * treatment as the findings, not a price tag blown up in a brand colour. */
.offer .price {
  font-family: var(--mono);
  font-size: 1.2em;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.005em;
}

.offer .price strong {
  font-weight: 400;
}

/* THE ONE DELIBERATE SPOT OF COLOUR. Sized and set like a control on an
 * instrument panel — a labelled switch, not a marketing button: mono face,
 * tracked like the disclosure terms, no gradient, no shadow, a hairline
 * radius rather than a pill. */
.action {
  display: inline-block;
  margin-top: 0.25rem;
  padding: 0.85em 1.5em;
  border-radius: 3px;
  background-color: var(--accent);
  color: var(--accent-ink);
  font-family: var(--mono);
  font-size: 0.85em;
  font-weight: 400;
  letter-spacing: 0.02em;
  text-decoration: none;
  transition: opacity 0.15s ease;
}

.action:hover {
  opacity: 0.88;
}

.offer .small {
  margin-top: 1.25rem;
  font-size: 0.85em;
  color: var(--ink-quiet);
}

/* --- Floor ---------------------------------------------------------------- */

/* The other place the reserved accent appears, for keyboard users on any
 * focusable element — which, on this page, is only `.action` itself. */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

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