/* The naïveté that costs me — same family as the agency2035 essay:
   salmon paper, serif body, sans furniture, one claret accent. */
/* Fonts are served from this site (Latin subset, variable weight): no third-party
   request, nothing for a content-security rule to allow. Both are OFL-licensed. */
@font-face {
  font-family: 'Source Serif 4'; font-style: normal; font-weight: 400 700; font-display: swap;
  src: url(fonts/source-serif-4-latin.woff2) format('woff2');
}
@font-face {
  font-family: 'Source Serif 4'; font-style: italic; font-weight: 400 700; font-display: swap;
  src: url(fonts/source-serif-4-italic-latin.woff2) format('woff2');
}
@font-face {
  font-family: 'Inter'; font-style: normal; font-weight: 400 700; font-display: swap;
  src: url(fonts/inter-latin.woff2) format('woff2');
}

:root {
  --paper: #fff1e5; --paper-2: #fbe9d9;
  --ink: #1a1817; --ink-soft: #3f3a36; --ink-faint: #6b635c;
  --line: #e6d4c3; --line-strong: #d8c3ae;
  --claret: #990f3d; --on-claret: #fff;
  --serif: 'Source Serif 4', Georgia, 'Times New Roman', serif;
  --sans: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --measure: 680px;
  --shadow: 0 1px 2px rgba(26,24,23,.05), 0 10px 34px rgba(26,24,23,.08);
  color-scheme: light;
}
/* Dark lives in one place. theme.js stamps data-theme before first paint: the
   reader's saved choice, or else the OS setting. */
:root[data-theme="dark"] {
  --paper: #1b1714; --paper-2: #241f1b;
  --ink: #f3ebe2; --ink-soft: #cdc2b7; --ink-faint: #968b80;
  --line: #3a322b; --line-strong: #4a4038;
  --claret: #f06591;
  --shadow: 0 1px 2px rgba(0,0,0,.3), 0 12px 36px rgba(0,0,0,.45);
  color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font-family: var(--serif); font-size: 20px; line-height: 1.62;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
  transition: background-color .35s ease, color .35s ease;
}
::selection { background: color-mix(in srgb, var(--claret) 22%, transparent); }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--claret); outline-offset: 3px; border-radius: 4px; }

/* ---------- progress bar + masthead ---------- */
#progress-bar {
  position: fixed; top: 0; left: 0; height: 3px; width: 100%; z-index: 60;
  background: var(--claret); transform-origin: 0 50%; transform: scaleX(0);
}
.masthead {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: saturate(1.3) blur(10px);
  border-bottom: 1px solid var(--line);
}
.masthead-inner {
  max-width: 1080px; margin: 0 auto; padding: 11px 16px;
  display: flex; align-items: center; justify-content: space-between;
}
.section-eyebrow {
  font-family: var(--sans); font-weight: 600; font-size: 13px; letter-spacing: .02em;
  color: var(--claret); text-decoration: none;
}
.section-eyebrow:hover { text-decoration: underline; }
.top-actions { display: flex; gap: 8px; align-items: center; }
.share-btn {
  display: inline-flex; align-items: center; gap: 7px; cursor: pointer;
  font-family: var(--sans); font-size: 13.5px; font-weight: 600; letter-spacing: .01em;
  height: 36px; padding: 0 15px; border-radius: 8px;
  background: var(--claret); color: var(--on-claret); border: 1px solid var(--claret);
  transition: opacity .16s ease;
}
.share-btn:hover { opacity: .9; }
.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; border-radius: 8px; cursor: pointer;
  background: transparent; border: 1px solid var(--line-strong); color: var(--ink-soft);
  transition: background-color .18s ease, color .18s ease;
}
.icon-btn:hover { background: var(--paper-2); color: var(--ink); }

/* ---------- article ---------- */
.paper { max-width: var(--measure); margin: 0 auto; padding: 0 16px 160px; }
.headline-block { padding: 38px 0 0; }
.kicker {
  font-family: var(--sans); text-transform: uppercase; letter-spacing: .12em;
  font-size: 12.5px; font-weight: 700; color: var(--claret); margin: 0 0 18px;
}
.headline-block h1 {
  font-weight: 700; font-size: clamp(2.3rem, 6vw, 3.5rem);
  line-height: 1.08; letter-spacing: -.012em; margin: 0 0 22px; text-wrap: balance;
}
.byline {
  font-family: var(--sans); font-size: 14px; color: var(--ink-faint);
  display: flex; flex-wrap: wrap; gap: 9px; align-items: center; margin: 0 0 20px;
}
.byline .by { color: var(--ink); font-weight: 600; }
.meta-dot { opacity: .5; }

.hero-figure { margin: 28px 0 36px; }
@media (min-width: 1040px) { .hero-figure { width: calc(100% + 160px); margin-left: -80px; } }
.hero-figure img {
  width: 100%; height: auto; display: block; border-radius: 4px;
  box-shadow: var(--shadow); background: var(--paper-2);
}
.hero-figure figcaption {
  font-family: var(--sans); font-size: 12.5px; line-height: 1.5; color: var(--ink-faint);
  margin-top: 10px;
}
@media (min-width: 1040px) { .hero-figure figcaption { padding-left: 80px; } }

.body p { margin: 0 0 24px; text-wrap: pretty; }
.lead { font-size: 1.08em; }
.lead::first-letter {
  initial-letter: 3; -webkit-initial-letter: 3;
  font-weight: 700; color: var(--claret); margin-right: 10px;
}
@supports not (initial-letter: 3) {
  .lead::first-letter { font-size: 3.4em; line-height: .9; float: left; padding: 6px 10px 0 0; }
}

.body .pull {
  margin: 44px 0; padding: 0 0 0 22px; position: relative;
  font-weight: 600; font-size: clamp(1.5rem, 3.8vw, 2.05rem);
  line-height: 1.2; letter-spacing: -.015em; color: var(--ink);
}
.body .pull::before {
  content: ""; position: absolute; left: 0; top: 6px; bottom: 6px; width: 3px;
  background: var(--claret); transform-origin: 50% 0;
}
.body .pull.last { color: var(--claret); font-style: italic; margin-bottom: 0; }

.sep {
  text-align: center; font-family: var(--sans); letter-spacing: .5em;
  color: var(--ink-faint); margin: 56px 0 20px;
}
.disclaimer {
  font-family: var(--sans); font-size: 12px; line-height: 1.5; font-style: italic;
  color: var(--ink-faint); margin: 0;
}

/* ---------- motion: decorative only, so it is progressive enhancement ----------
   Nothing here hides text in a browser that cannot animate it, and nothing runs
   for a reader who asked for reduced motion. The one exception is 6, which fades
   read text on purpose at the very end. */
@media (prefers-reduced-motion: no-preference) {
  /* 2 · the painting fades up on arrival, like gallery lights */
  @keyframes lights-up { from { opacity: 0; } }
  .hero-figure img { animation: lights-up 1.2s ease-out both; }

  @supports ((animation-timeline: view()) and (animation-range: entry)) {
    @keyframes rise-in { from { opacity: 0; transform: translateY(10px); } }
    @keyframes draw-down { from { transform: scaleY(0); } }

    /* 1 · paragraphs fade in as they scroll into view (rise-in), then arrive grey
       and darken to full ink as they climb into reading position (ink-up), and
       stay dark. Each paragraph has two animations, so every animation-range below
       lists two ranges: rise-in first, then ink-up.
       The start is deliberately faint, 20% ink to 80% paper: 1.52:1 light, 1.77:1
       dark. Ed asked for a fade you can see (2026-11-19); a 50% start read as no
       fade at all. Text is full ink (15.98:1) once it has risen min(45vh, 400px)
       above the bottom of the screen, about mid-screen, before it is read. The
       400px cap keeps it inside the ~450px of page below the last line, so even
       the last line can finish (checked headless from 760px to 1600px tall). */
    @keyframes ink-up {
      from { color: color-mix(in srgb, var(--ink-to) 20%, var(--paper)); }
      to   { color: var(--ink-to); }
    }
    .body p {
      --ink-to: var(--ink);
      animation: rise-in auto ease-out backwards, ink-up auto linear backwards;
      animation-timeline: view(), view();
      animation-range: entry 0% entry 90%, entry 0% contain min(45vh, 400px);
    }
    .body .pull.last { --ink-to: var(--claret); }

    /* Every range below must END at a scroll position the page can reach, or the
       text stays part-faded for good. The last lines sit near the page bottom, so
       their ranges stay inside "entry" or barely past it ("contain 10%"), and the
       article keeps extra bottom padding as slack. */

    /* 3 · the bar beside each big line draws itself, then the words arrive */
    .body .pull {
      view-timeline: --pull;
      animation-range: entry 40% entry 100%, entry 40% contain min(45vh, 400px);
    }
    .body .pull::before {
      animation: draw-down auto ease-out backwards;
      animation-timeline: --pull;
      animation-range: entry 0% entry 60%;
    }

    /* 4 · the last line waits, then lands later than everything else */
    .body .pull.last { animation-range: entry 90% contain 10%, entry 90% contain min(45vh, 400px); }
    .body .pull.last::before { animation-range: entry 20% entry 100%; }
  }

  /* 6 · at the end, everything steps back except the last line. app.js sets
     .at-end on <html> once the reader reaches the bottom with the last line in
     view; scrolling up removes it and the text returns. Read text DOES fade
     here: Ed asked for it (2026-11-19), reversing the earlier "never fade read
     text out", because it only happens at the very end and undoes on scroll-up.
     Opacity goes on the last line's siblings, never on a parent of it, or the
     last line would fade too. Reduced-motion readers get none of this. */
  .headline-block, .hero-figure, .body > p, .sep, .disclaimer, .more {
    transition: opacity 1.4s ease;
  }
  .at-end :is(.headline-block, .hero-figure, .body > p:not(.last), .sep, .disclaimer, .more) {
    opacity: .12;
  }
  /* the way out stays usable: the More card comes back under the pointer or Tab */
  .at-end .more:is(:hover, :focus-within) { opacity: 1; transition-duration: .2s; }
}

/* ---------- the way back to every other essay (the POV section on edtsue.com) ---------- */
.more { margin: 48px 0 0; }
.more a {
  display: block; text-decoration: none; padding: 18px 20px; border-radius: 8px;
  border: 1px solid var(--line-strong); background: var(--paper-2);
  transition: border-color .18s ease;
}
.more a:hover { border-color: var(--claret); }
.more-kicker {
  display: block; font-family: var(--sans); text-transform: uppercase; letter-spacing: .12em;
  font-size: 12px; font-weight: 700; color: var(--claret); margin-bottom: 4px;
}
.more-title { display: block; font-weight: 600; font-size: 1.15rem; line-height: 1.3; color: var(--ink); }
