/* Editorial layer: journal typography and rhythm on top of site.css and story.css.
   Loaded last on every page, so deleting the <link> rolls the whole pass back. */

/* ---------- Type ---------- */
body::before { opacity: .07; }                          /* the paper grain, a touch more present */
h1, h2, h3 { font-variant-numeric: oldstyle-nums proportional-nums; }
.odo, .trail__y, .display { font-variant-numeric: lining-nums tabular-nums; }
p { text-wrap: pretty; hanging-punctuation: first; }
em { font-style: italic; font-variation-settings: "opsz" 144, "SOFT" 100; }

/* Links inside running text read as links in print do */
.col p a, .moment p a, .lede a {
  text-decoration-line: underline; text-decoration-thickness: 1px;
  text-decoration-color: var(--accent); text-underline-offset: .22em;
  transition: text-decoration-color .3s var(--ease), color .3s var(--ease);
}
.col p a:hover, .moment p a:hover, .lede a:hover { color: var(--accent-text); text-decoration-color: currentColor; }

/* Drop caps: the first paragraph of the story, and the opening of every case study */
#era-1 .moment:first-of-type > p:first-of-type::first-letter,
.col > .lede:first-of-type::first-letter {
  float: left; font-family: var(--serif); font-weight: 400;
  font-variation-settings: "opsz" 144, "SOFT" 100;
  font-size: 3.3em; line-height: .82; margin: .07em .12em -.05em 0;
  color: var(--accent-text);
}

/* Captions set like a magazine's */
figcaption, .frames figcaption {
  font: italic 400 15px/1.45 var(--serif); letter-spacing: 0; text-transform: none;
  font-variation-settings: "opsz" 14, "SOFT" 100; color: var(--muted);
}

/* ---------- Things I'm trying: a notebook ledger instead of a card grid ---------- */
.notes { display: block; counter-reset: entry; border-top: 1.5px solid var(--ink); }
.note {
  counter-increment: entry; display: grid; grid-template-columns: 1fr; gap: 6px;
  background: none; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; box-shadow: none;
  padding: 26px 0 28px; overflow: visible; transition: none;
}
.note:hover { transform: none; box-shadow: none; }
.note::before { content: "No. " counter(entry, decimal-leading-zero); font: 500 11px/1 var(--mono); letter-spacing: .08em; color: var(--muted); }
.note h3 { font-size: clamp(25px, 2.6vw, 34px); line-height: 1.08; margin: 6px 0 8px; transition: color .35s var(--ease), transform .5s var(--ease); }
.note p { font-size: 16px; max-width: 54ch; }
.note__doodle { display: none; }
@media (min-width: 900px) {
  .note { grid-template-columns: 96px minmax(0, 1fr) minmax(0, 1.05fr); column-gap: 36px; align-items: start; padding: 34px 0 36px; }
  .note::before { grid-column: 1; grid-row: 1; padding-top: 4px; }
  .note__tag { grid-column: 2; grid-row: 1; }
  .note h3 { grid-column: 2; grid-row: 2; margin: 10px 0 0; }
  .note p { grid-column: 3; grid-row: 1 / span 2; margin: 0; padding-top: 2px; }
  .note__doodle {
    display: block; position: static; grid-column: 1; grid-row: 2; align-self: end;
    width: 38px; height: 38px; margin-top: 14px; opacity: .3; color: var(--ink);
    transition: transform .8s var(--ease), color .4s, opacity .4s;
  }
  .note:hover h3 { color: var(--accent-text); transform: translateX(6px); }
  .note:hover .note__doodle { transform: rotate(-14deg); color: var(--accent-text); opacity: .8; }
}

/* ---------- Lessons: big italic numerals in the margin ---------- */
.lessons li { grid-template-columns: 72px 1fr; }
.lessons li::before {
  content: counter(l); font: italic 300 clamp(40px, 4vw, 56px)/.9 var(--serif);
  font-variation-settings: "opsz" 144, "SOFT" 100; color: var(--accent-text); grid-row: span 2;
}

/* ---------- Section openers: a hairline and a folio ---------- */
.section__head { position: relative; padding-top: 22px; border-top: 1px solid var(--line); }
.hello .section__head, .section__head:first-child:where(.cs-hero *) { border-top: 0; padding-top: 0; }

/* ---------- Results: numbers you can't miss ---------- */
.stats { display: grid; grid-template-columns: 1fr; gap: 0; margin-top: 44px; border-top: 1.5px solid var(--ink); }
@media (min-width: 640px) { .stats { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 980px) { .stats { grid-template-columns: repeat(3, 1fr); } }
.stats__head { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 6px 18px; align-items: baseline; padding: 16px 0 6px; }
.stats__head .eyebrow { font-size: 13px; color: var(--ink); }
.stats__head p { margin: 0; font-size: 14.5px; color: var(--muted); max-width: 70ch; }
.stat { position: relative; padding: 22px 28px 26px 0; border-bottom: 1px solid var(--line); }
.stat__n {
  display: block; font: 400 clamp(52px, 6vw, 80px)/.95 var(--serif); letter-spacing: -.035em;
  font-variation-settings: "opsz" 144, "SOFT" 60; font-variant-numeric: lining-nums; color: var(--ink);
}
.stat__n small { font-size: .42em; letter-spacing: 0; color: var(--muted); margin-left: .08em; }
.stat p { margin: 12px 0 0; font-size: 15px; line-height: 1.45; color: var(--ink-2); max-width: 30ch; }
.stat--mine .stat__n { color: var(--accent-text); }
.stat__tag { position: absolute; top: 24px; right: 28px; font: 500 10px/1 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--accent-ink); background: var(--accent); padding: 5px 7px; border-radius: 4px; }

/* Italics: Instrument Sans italic, the same family as the body text */
:root { --italic: "Instrument Sans", ui-sans-serif, system-ui, sans-serif; }
h1 em, h2 em, h3 em, .stack__line em, .hello__big em, .offclock i,
figcaption, .frames figcaption, .lessons li::before, .hello__pull, .tabs__tab, .say__done {
  font-family: var(--italic); font-weight: 400; font-style: italic; font-variation-settings: normal; letter-spacing: 0;
}
figcaption, .frames figcaption { font-size: 15px; line-height: 1.45; }
/* Big italics (titles, headings, statement lines) keep the thin serif italic */
:root { --italic-display: "Instrument Serif", "Iowan Old Style", Georgia, serif; }
h1 em, h2 em, h3 em, .stack__line em, .hello__big em { font-family: var(--italic-display); letter-spacing: 0; }
.tabs__tab { font-size: clamp(17px, 1.6vw, 21px); }
.offclock i { font-size: 1em; }

/* Captions under demo frames: plain text, easier to read at small size */
figcaption.demo__cap { font-family: var(--sans); font-style: normal; font-weight: 400; font-size: 13px; line-height: 1.5; letter-spacing: 0; font-variation-settings: normal; }
