/* ==========================================================================
   site-type.css  |  Heading sizes for the home page, in one place.

   The tag (h1, h2, h3) is chosen for document structure. How big a heading
   looks comes from a size role below, never from the tag.

   Two presets:
   - Default: the Field Notes scale (tokens.css).
   - Large: the prototype's scale. Turn it on by adding data-type-scale="large"
     to the <html> tag in index.html.
   Edit any single value here; nothing else needs to change.

   To make one heading look like a different role without changing its tag,
   add data-size="h1" | "h2" | "statement" | "tile-title" | "card-title" | "lead"
   to it, e.g. <h2 data-size="h1">.
   ========================================================================== */

:root {
  /* One scoped exception to Field Notes' single typeface: the handwritten note
     above the problem tiles. Used nowhere else. */
  --font-hand: "Caveat", "Bradley Hand", cursive;

  --h1-size: var(--text-display);   --h1-lh: var(--lh-tight);   --h1-track: var(--track-display);
  --h2-size: var(--text-2xl);       --h2-lh: var(--lh-tight);   --h2-track: var(--track-heading);
  --statement-size: var(--text-xl); --statement-lh: var(--lh-snug); --statement-track: var(--track-heading);
  --tile-title-size: var(--text-lg); --tile-title-lh: var(--lh-snug);
  --card-title-size: var(--text-lg); --card-title-lh: var(--lh-snug);
  --lead-size: var(--text-lg);      --lead-lh: var(--lh-snug);
  --hand-size: clamp(1.625rem, 2.8vw, 2.125rem); --hand-lh: 1.1;
}

:root[data-type-scale="large"] {
  --h1-size: clamp(2.5rem, 6vw, 5rem);            --h1-lh: 1.05;  --h1-track: -0.025em;
  --h2-size: clamp(2.25rem, 5.4vw, 4.5rem);       --h2-lh: 1.04;  --h2-track: -0.02em;
  --statement-size: clamp(1.625rem, 3vw, 2.375rem); --statement-lh: 1.2; --statement-track: -0.015em;
  --tile-title-size: clamp(1.25rem, 2vw, 1.5rem); --tile-title-lh: 1.3;
  --card-title-size: clamp(1.375rem, 2.2vw, 1.75rem); --card-title-lh: 1.2;
  --lead-size: clamp(1.1875rem, 1.8vw, 1.4375rem); --lead-lh: 1.5;
}

/* Roles. Doubled class names so they win over the base h1/h2/h3 rules. */
.t-h1.t-h1         { font-size: var(--h1-size); line-height: var(--h1-lh); letter-spacing: var(--h1-track); }
.t-h2.t-h2         { font-size: var(--h2-size); line-height: var(--h2-lh); letter-spacing: var(--h2-track); max-width: 30ch; }
.t-statement.t-statement { font-size: var(--statement-size); line-height: var(--statement-lh); letter-spacing: var(--statement-track); font-weight: var(--fw-semibold); }
.t-tile-title.t-tile-title { font-size: var(--tile-title-size); line-height: var(--tile-title-lh); font-weight: var(--fw-semibold); }
.t-card-title.t-card-title { font-size: var(--card-title-size); line-height: var(--card-title-lh); font-weight: var(--fw-semibold); }
.t-lead.t-lead     { font-size: var(--lead-size); line-height: var(--lead-lh); }
.t-hand.t-hand     { font-family: var(--font-hand); font-size: var(--hand-size); line-height: var(--hand-lh); font-weight: 600; }

/* One-off overrides: data-size beats the role class. */
html [data-size="h1"][data-size]         { font-size: var(--h1-size); line-height: var(--h1-lh); letter-spacing: var(--h1-track); }
html [data-size="h2"][data-size]         { font-size: var(--h2-size); line-height: var(--h2-lh); letter-spacing: var(--h2-track); }
html [data-size="statement"][data-size]  { font-size: var(--statement-size); line-height: var(--statement-lh); letter-spacing: var(--statement-track); }
html [data-size="tile-title"][data-size] { font-size: var(--tile-title-size); line-height: var(--tile-title-lh); }
html [data-size="card-title"][data-size] { font-size: var(--card-title-size); line-height: var(--card-title-lh); }
html [data-size="lead"][data-size]       { font-size: var(--lead-size); line-height: var(--lead-lh); }
