/*
 * Breakdowns by Ken — companion pages.
 *
 * The look is the reels' look, from the shoot notes and `storyboard.ts`:
 * off-white, near-black, one accent, no gradients. It must NOT resemble
 * leadoo.net's warm-paper terracotta marketing site — the whole credibility
 * argument for putting these pages on a Leadoo subdomain is that they read as
 * sources rather than as a sales asset, and that job now falls to the design.
 *
 * The organising idea is Vox's: annotated evidence. Citations are not footnotes
 * set small and grey. They are the most distinctive thing on the page, in mono,
 * next to the claim they support.
 */

:root {
  --paper: #f7f5f1;
  --ink: #16130f;
  --ink-muted: #57514a;
  --rule: #e2ddd4;
  --rule-strong: #c9c2b6;

  /* The brand has not fixed an accent, and one invented here would become the
   * brand's colour by accident. Until the first shoot picks it, the accent IS
   * the ink — so every rule below is already written against a real variable
   * and setting it later is a one-line change, not a redesign. */
  --accent: var(--ink);

  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Code", "Segoe UI Mono", Menlo, Consolas, monospace;

  /* Two widths, not one. A single narrow column made the page read as a phone
   * layout stranded in the middle of a desktop window, and it squeezed the
   * beats worst of all: the label column ate 4.5rem, leaving the sentence
   * about 45 characters wide — well under the 60-75 that prose wants.
   *
   * So the page and the paragraph are sized separately. `--shell` is the
   * structure: headings, rules, and the label-plus-text grids, which have a
   * column to spend the extra width on. `--measure` caps prose alone, because
   * a paragraph does not become easier to read by getting wider. */
  --measure: 48rem;
  --shell: 58rem;
  --gutter: clamp(1.25rem, 4vw, 3rem);
}

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

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: clamp(1.0625rem, 1rem + 0.25vw, 1.1875rem);
  line-height: 1.6;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

/* ---------- shell ---------- */

.shell {
  max-width: calc(var(--shell) + var(--gutter) * 2);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.masthead {
  border-bottom: 1px solid var(--rule);
  padding-block: 1.5rem;
  margin-bottom: clamp(2.5rem, 6vw, 4.5rem);
}

.masthead .shell {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
}

.wordmark {
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: -0.01em;
  color: var(--ink);
  text-decoration: none;
}

.masthead nav {
  font-family: var(--mono);
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.masthead nav a {
  color: var(--ink-muted);
  text-decoration: none;
}

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

main {
  padding-bottom: clamp(4rem, 10vw, 7rem);
}

/* ---------- type ---------- */

h1 {
  font-size: clamp(2.25rem, 1.6rem + 2.8vw, 4rem);
  line-height: 1.08;
  letter-spacing: -0.03em;
  font-weight: 700;
  margin: 0 0 1rem;
  text-wrap: balance;
}

h2 {
  font-size: clamp(1.375rem, 1.2rem + 0.8vw, 1.75rem);
  line-height: 1.2;
  letter-spacing: -0.02em;
  font-weight: 700;
  margin: 0 0 0.75rem;
  text-wrap: balance;
}

h3 {
  font-size: 1rem;
  font-weight: 700;
  margin: 0 0 0.5rem;
}

/* Prose stops at the reading measure while the structure around it runs to the
 * full shell. Widening a paragraph past ~75 characters makes the eye lose the
 * start of the next line, so the extra width goes to the grids instead. */
p {
  margin: 0 0 1.25rem;
  max-width: var(--measure);
}

a {
  color: var(--ink);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
}

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

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

strong {
  font-weight: 700;
}

.lede {
  font-size: clamp(1.25rem, 1.1rem + 0.5vw, 1.5rem);
  line-height: 1.45;
  color: var(--ink);
  margin-bottom: 2rem;
  text-wrap: pretty;
}

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

/* The kicker above a title, and the label on a section. Mono, because on this
 * site mono means "this is machinery, not prose". */
.kicker {
  font-family: var(--mono);
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-muted);
  margin: 0 0 0.75rem;
}

section {
  margin-block: clamp(2.5rem, 6vw, 4rem);
}

hr {
  border: 0;
  border-top: 1px solid var(--rule);
  margin-block: clamp(2.5rem, 6vw, 4rem);
}

/* ---------- the 5W1H beats ---------- */

/* One idea per beat, same order as the reel, so a reader who watched it can
 * find the sentence they half-remember. */
.beats {
  display: grid;
  gap: 0;
  border-top: 1px solid var(--rule);
}

.beat {
  display: grid;
  grid-template-columns: 5.5rem 1fr;
  gap: 0 2rem;
  padding-block: 1.75rem;
  border-bottom: 1px solid var(--rule);
}

.beat > .kicker {
  margin: 0.3rem 0 0;
  font-weight: 700;
  color: var(--accent);
}

.beat > div > :last-child {
  margin-bottom: 0;
}

/* Below this the label column costs more than it explains, so the beat stacks. */
@media (max-width: 40rem) {
  .beat {
    grid-template-columns: 1fr;
    gap: 0.5rem;
  }
}

/* ---------- evidence ---------- */

/* The fact record, rendered as the page's centrepiece rather than as an
 * appendix. Every claim the reel makes is here with the source that carries it
 * and the date it was true — which is the only reason the reel is allowed to
 * assert anything at all. */
.facts {
  border-top: 2px solid var(--ink);
}

.fact {
  display: grid;
  grid-template-columns: 2.5rem 1fr;
  gap: 0 1.25rem;
  padding-block: 1.4rem;
  border-bottom: 1px solid var(--rule);
}

.fact-n {
  font-family: var(--mono);
  font-size: 0.8125rem;
  color: var(--ink-muted);
  padding-top: 0.2rem;
  font-variant-numeric: tabular-nums;
}

.fact-claim {
  margin: 0 0 0.6rem;
}

/* The source strip — the page's version of the reel's lower-third citation.
 * Same information, same job: the claim is checkable in one click. */
.citation {
  font-family: var(--mono);
  font-size: 0.75rem;
  line-height: 1.5;
  color: var(--ink-muted);
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.75rem;
  align-items: baseline;
}

.citation a {
  color: var(--ink-muted);
}

.citation a:hover,
.citation a:focus-visible {
  color: var(--ink);
}

.citation .dot::before {
  content: "·";
  margin-right: 0.75rem;
  color: var(--rule-strong);
}

/* ---------- callout ---------- */

.note {
  border-left: 2px solid var(--ink);
  padding: 0.25rem 0 0.25rem 1.25rem;
  margin-block: 2rem;
}

.note > :last-child {
  margin-bottom: 0;
}

.note .kicker {
  margin-bottom: 0.5rem;
}

/* ---------- entry list ---------- */

.entries {
  list-style: none;
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--rule);
}

.entries li {
  border-bottom: 1px solid var(--rule);
}

.entries a {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.25rem 1.5rem;
  align-items: baseline;
  padding-block: 1.25rem;
  text-decoration: none;
}

.entries a:hover .entry-title,
.entries a:focus-visible .entry-title {
  text-decoration: underline;
  text-underline-offset: 0.2em;
}

.entry-title {
  font-weight: 700;
  font-size: 1.125rem;
  letter-spacing: -0.015em;
}

.entry-meta {
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--ink-muted);
  letter-spacing: 0.04em;
}

.entry-blurb {
  grid-column: 1 / -1;
  color: var(--ink-muted);
  margin: 0;
  max-width: var(--measure);
}

/* ---------- actions ---------- */

.action {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-weight: 700;
  text-decoration: none;
  border: 1px solid var(--ink);
  padding: 0.7rem 1.1rem;
  color: var(--ink);
  background: transparent;
}

.action:hover,
.action:focus-visible {
  background: var(--ink);
  color: var(--paper);
}

.action .arrow {
  font-family: var(--mono);
  font-weight: 400;
}

/* The reel slot. The Instagram account does not exist yet, so this is a labelled
 * placeholder rather than an embed — an empty frame that implied a video would
 * be the page telling its first lie. */
.reel-slot {
  border: 1px dashed var(--rule-strong);
  padding: 1.5rem;
  text-align: center;
  color: var(--ink-muted);
  font-family: var(--mono);
  font-size: 0.8125rem;
}

/* ---------- the download gate ---------- */

/* The written breakdown costs an email address, so this form is the only
 * interactive thing on the site. It is set as a bordered block rather than a
 * loose input because it is a transaction: it should read as a box you are
 * handing something into, not a widget bolted onto the prose. */
.gate {
  border: 1px solid var(--rule-strong);
  padding: 1.5rem;
  margin: 0 0 1.25rem;
  max-width: var(--measure);
}

.gate-ask {
  margin: 0 0 1rem;
  font-weight: 700;
  max-width: none;
}

.gate-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

/* `font: inherit` is load-bearing, not tidiness: Safari on iOS zooms the whole
 * page when a focused input is set below 16px, and the reader who came from a
 * reel is on a phone. Inheriting the body size keeps it at 16px. */
.gate input[type="email"] {
  flex: 1 1 16rem;
  min-width: 0;
  font: inherit;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--ink);
  padding: 0.7rem 0.9rem;
}

.gate input[type="email"]::placeholder {
  color: var(--ink-muted);
  opacity: 1;
}

/* Matched to `.action` so the submit button belongs to the same family as every
 * other thing on the site you can press. */
.gate button {
  font: inherit;
  font-weight: 700;
  border: 1px solid var(--ink);
  padding: 0.7rem 1.1rem;
  color: var(--ink);
  background: transparent;
  cursor: pointer;
}

.gate button:hover,
.gate button:focus-visible {
  background: var(--ink);
  color: var(--paper);
}

/* Once the row wraps, a button sized to its own text sits as a small block under
 * a full-width field — off-balance to look at, and a smaller target than a thumb
 * deserves on the one page a reel actually sends people to. */
@media (max-width: 40rem) {
  .gate button {
    width: 100%;
  }
}

.gate-opt {
  margin: 1rem 0 0;
  font-size: 0.9375rem;
  max-width: none;
}

.gate-opt label {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  cursor: pointer;
}

.gate-opt input[type="checkbox"] {
  flex: none;
  width: 1rem;
  height: 1rem;
  margin: 0.2em 0 0;
  accent-color: var(--ink);
}

.gate-note {
  margin: 1rem 0 0;
  font-size: 0.8125rem;
  line-height: 1.55;
  color: var(--ink-muted);
  max-width: 43em;
}

/* Off the screen but still in the document: the label for the email field, which
 * the placeholder alone cannot stand in for, and the honeypot, which exists to be
 * filled in by something that reads the DOM and cannot see. Clipped rather than
 * `display: none` because a hidden field is skipped by the simplest bots and a
 * merely invisible one is not, and because clipping cannot widen the page. */
/* `.nope input` is named as well as its wrapper: a text input has an intrinsic
 * width of about 177px that the 1px wrapper only clips visually, which leaves a
 * box hanging off the right of a 390px phone for any measuring tool to trip on. */
.visually-hidden,
.nope,
.nope input {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* ---------- footer ---------- */

.colophon {
  border-top: 1px solid var(--rule);
  padding-block: 2rem 3rem;
  font-size: 0.875rem;
  color: var(--ink-muted);
}

/* `--measure` is fixed in rem, which is right for the body but wrong down here:
 * 48rem of 13px type is over a hundred characters a line, and the disclaimers
 * turned into long grey bands. Capping in `em` ties the column to whatever size
 * the text is set at, so the fine print keeps the body's rhythm instead of
 * inheriting its pixels. */
.colophon p {
  margin-bottom: 0.75rem;
  max-width: 43em;
}

.colophon a {
  color: var(--ink-muted);
}

/* The legal necessities, set small but still meant to be read. A disclaimer in
 * 9px pale grey is one written to be missed, and a page whose entire argument is
 * "check me" cannot then hide its own caveats. */
.fineprint {
  font-size: 0.8125rem;
  line-height: 1.55;
  margin-bottom: 0.9rem;
}

.fineprint strong {
  color: var(--ink);
}

/* ---------- print ---------- */

/* Ctrl+P produces a readable document. This is not the companion PDF — that one
 * is a written artifact with its own research, not a printed web page — but it
 * means the page is never useless offline. */
@media print {
  :root {
    --paper: #fff;
    --ink: #000;
    --ink-muted: #333;
  }

  .masthead nav,
  .action,
  .reel-slot,
  .gate {
    display: none;
  }

  body {
    font-size: 11pt;
  }

  .shell {
    max-width: none;
  }

  a::after {
    content: " (" attr(href) ")";
    font-family: var(--mono);
    font-size: 0.85em;
    word-break: break-all;
  }

  .beat,
  .fact {
    break-inside: avoid;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    transition: none !important;
  }
}
