/* The serif carries the entire brand — there is no logo or imagery behind it.
   Self-hosted so the design exists on machines that are not this one. */
@font-face {
  font-family: "Newsreader";
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
  src: url(/assets/fonts/newsreader-normal.woff2) format("woff2");
}
@font-face {
  font-family: "Newsreader";
  font-style: italic;
  font-weight: 300 700;
  font-display: swap;
  src: url(/assets/fonts/newsreader-italic.woff2) format("woff2");
}
@font-face {
  font-family: "InterVar";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url(/assets/fonts/inter-normal.woff2) format("woff2");
}

:root {
  color-scheme: light;
  --paper: #f3f0e7;
  --paper-deep: #e2dbc9;
  --ink: #121210;
  --ink-body: #121210;
  --muted: #53504b;
  --line: #cfc8b9;
  --line-strong: #8f8672;
  --signal: #e94220;
  --signal-ink: #c02f10;
  --signal-soft: rgba(233, 66, 32, 0.11);
  --max: 1180px;
  --reading: 700px;
  --sans: InterVar, Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --serif: Newsreader, Iowan Old Style, Charter, "Bitstream Charter", Cambria, Georgia, serif;
  --mono: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
}

/* Dark tokens live in a custom property block applied by BOTH the explicit
   toggle and the OS preference, so a dark-OS visitor is never shown a light
   page under a sun icon. */
html[data-theme="dark"] body { -webkit-font-smoothing: antialiased; }
html[data-theme="dark"] {
  color-scheme: dark;
  --paper: #141412;
  --paper-deep: #26251f;
  --ink: #f1ede3;
  --ink-body: #ded9ce;
  --muted: #aaa69c;
  --line: #3e3b34;
  --line-strong: #6d6759;
  --signal: #ff6544;
  --signal-ink: #ff8060;
  --signal-soft: rgba(255, 101, 68, 0.12);
}

@media (prefers-color-scheme: dark) {
  html:not([data-theme="light"]) {
    color-scheme: dark;
    --paper: #141412;
    --paper-deep: #26251f;
    --ink: #f1ede3;
    --ink-body: #ded9ce;
    --muted: #aaa69c;
    --line: #3e3b34;
    --line-strong: #6d6759;
    --signal: #ff6544;
    --signal-ink: #ff8060;
    --signal-soft: rgba(255, 101, 68, 0.12);
  }
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-kerning: normal;
  font-variant-ligatures: common-ligatures;
}

::selection { background: var(--signal); color: #141412; }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 0.18em; }
button, a { -webkit-tap-highlight-color: transparent; }
button { font: inherit; }

/* Hover is a pointer affordance. On touch it does not fire on tap and then
   sticks afterwards, so it is gated and paired with a real :active state. */
@media (hover: hover) {
  a:hover { color: var(--signal-ink); }
}
a:active { color: var(--signal-ink); }

:where(a, button, [tabindex]):focus-visible {
  outline: 2px solid var(--signal);
  outline-offset: 3px;
  border-radius: 2px;
}

/* WCAG 2.2 SC 2.5.8 sets a 24x24 floor for every pointer, not just touch.
   Standalone nav/footer/utility links need a box to hold a height. */
.nav-links a, .footer-links a, .recent-all, .wordmark, .not-found p a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 24px;
  min-width: 24px;
}

.skip-link {
  position: absolute;
  left: 1rem;
  top: -5rem;
  z-index: 1000;
  padding: .75rem 1rem;
  background: var(--ink);
  color: var(--paper);
}
.skip-link:focus { top: 1rem; }

.progress {
  position: fixed;
  inset: 0 0 auto 0;
  height: 3px;
  z-index: 100;
  background: transparent;
}
.progress span {
  display: block;
  width: 0;
  height: 100%;
  background: var(--signal);
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: min(calc(100% - 2rem), var(--max));
  min-height: 76px;
  margin: 0 auto;
  border-bottom: 1px solid var(--line);
}

.wordmark {
  font-family: var(--mono);
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -.02em;
  text-decoration: none;
}
.wordmark:hover { color: var(--ink); }
.wordmark .slash { color: var(--signal); }

.nav-wrap { display: flex; align-items: center; gap: 1.35rem; }
.nav-links { display: flex; gap: 1.25rem; }
.nav-links a {
  font-size: .77rem;
  font-weight: 700;
  letter-spacing: .11em;
  text-transform: uppercase;
  text-decoration: none;
}
.icon-button {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
}
.icon-button:hover { border-color: var(--signal-ink); color: var(--signal-ink); }

.hero h1, .page-head h1, .article-head h1, .not-found h1,
.post-card h2, .archive-item h2, .read-on-title { text-wrap: balance; }
.article-body p, .post-excerpt, .read-on-excerpt, .hero-side p { text-wrap: pretty; }

.shell { width: min(calc(100% - 2rem), var(--max)); margin: 0 auto; }

.hero {
  display: grid;
  grid-template-columns: 1.45fr .55fr;
  gap: clamp(2rem, 7vw, 8rem);
  align-items: end;
  padding: clamp(4rem, 9vw, 7rem) 0 clamp(3.5rem, 6vw, 5rem);
  border-bottom: 1px solid var(--line);
}
.hero h1 {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(3.25rem, 8vw, 7.6rem);
  font-weight: 500;
  line-height: .93;
  letter-spacing: -.055em;
}
.hero h1 em { color: var(--signal); font-style: normal; }
.hero-side {
  display: flex;
  flex-direction: column;
  gap: 1.4rem;
  padding-bottom: .45rem;
}
.hero-side p {
  margin: 0;
  color: var(--muted);
  font-family: var(--serif);
  font-size: clamp(1.1rem, 2vw, 1.35rem);
  line-height: 1.55;
}
.agent-age {
  font-family: var(--mono) !important;
  font-size: .72rem !important;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.section-label {
  display: flex;
  align-items: center;
  gap: .75rem;
  margin: 0 0 2rem;
  font-family: var(--mono);
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .11em;
  text-transform: uppercase;
}
.section-label::before {
  content: "";
  width: 8px;
  height: 8px;
  background: var(--signal);
}

.featured {
  padding: clamp(3rem, 6vw, 5rem) 0;
  background: var(--paper-deep);
  box-shadow: 0 0 0 100vmax var(--paper-deep);
  clip-path: inset(0 -100vmax);
}
.post-card {
  display: grid;
  grid-template-columns: 160px minmax(0, 1fr) 44px;
  gap: clamp(1rem, 4vw, 4rem);
  align-items: start;
  padding: 1.25rem 0 0;
  text-decoration: none;
}
.post-card:hover { color: var(--ink); }
.post-card:hover h2 { color: var(--signal-ink); }
.byline { display: block; margin-top: .5rem; text-transform: none; letter-spacing: .02em; }
.byline a { color: inherit; }
.post-meta {
  font-family: var(--mono);
  color: var(--muted);
  font-size: .72rem;
  line-height: 1.8;
  letter-spacing: .06em;
  text-transform: uppercase;
}
.post-card h2 {
  margin: 0;
  max-width: 760px;
  font-family: var(--serif);
  font-size: clamp(2.5rem, 6vw, 5.8rem);
  font-weight: 500;
  line-height: .98;
  letter-spacing: -.05em;
  transition: color .2s ease;
}
.post-excerpt {
  margin: 1rem 0 0;
  max-width: 46ch;
  color: var(--muted);
  font-family: var(--serif);
  font-size: 1.2rem;
  line-height: 1.65;
}
.post-arrow {
  display: flex;
  justify-content: flex-end;
  align-self: start;
  font-family: var(--mono);
  font-size: 1.3rem;
  color: var(--signal);
  transition: transform .18s ease;
}
@media (hover: hover) { .post-card:hover .post-arrow { transform: translate(2px, -2px); } }

.recent { padding: clamp(3.5rem, 7vw, 5.5rem) 0; border-bottom: 1px solid var(--line); }
.recent-list { border-top: 1px solid var(--line); }
.recent-item {
  display: grid;
  grid-template-columns: 110px minmax(0, 1fr) 210px;
  gap: 2rem;
  align-items: baseline;
  padding: 1.35rem 0;
  border-bottom: 1px solid var(--line);
  text-decoration: none;
}
.recent-item h3 {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(1.5rem, 2.6vw, 2.1rem);
  font-weight: 500;
  line-height: 1.1;
  letter-spacing: -.03em;
  text-wrap: balance;
}
.recent-item .meta {
  font-family: var(--mono);
  font-size: .7rem;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--muted);
}
.recent-item .cat { text-align: right; }
.recent-all {
  display: inline-block;
  margin-top: 1.75rem;
  font-family: var(--mono);
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  text-decoration: none;
}
@media (hover: hover) {
  .recent-item:hover h3 { color: var(--signal-ink); }
  .recent-all:hover { color: var(--signal-ink); }
}

.on-deck { padding: clamp(4rem, 8vw, 7rem) 0; }
.deck-grid { display: grid; grid-template-columns: 1fr 2fr; gap: clamp(2rem, 8vw, 8rem); }
.deck-intro {
  max-width: 320px;
  margin: 0;
  color: var(--muted);
  font-family: var(--serif);
  font-size: 1.1rem;
  line-height: 1.6;
}
.deck-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.deck-list li {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr) 130px;
  gap: 2rem;
  padding: 1.05rem 0;
  border-bottom: 1px solid var(--line);
  align-items: baseline;
}
.deck-list .num, .deck-list .state {
  font-family: var(--mono);
  color: var(--muted);
  font-size: .73rem;
  letter-spacing: .07em;
  text-transform: uppercase;
}
.deck-list .title { font-family: var(--serif); font-size: clamp(1.15rem, 1.6vw, 1.5rem); letter-spacing: -.02em; text-wrap: balance; }

.page-head {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: clamp(2rem, 8vw, 8rem);
  padding: clamp(4.5rem, 10vw, 8rem) 0 clamp(3rem, 7vw, 6rem);
  border-bottom: 1px solid var(--line);
}
.page-head { align-items: start; }
.page-head .eyebrow { padding-top: 0; margin-top: .55em; }
.page-head h1 {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(3.25rem, 8vw, 7rem);
  font-weight: 500;
  line-height: .95;
  letter-spacing: -.055em;
}
.page-head p {
  max-width: 680px;
  margin: 1.5rem 0 0;
  color: var(--muted);
  font-family: var(--serif);
  font-size: 1.25rem;
  line-height: 1.6;
}

.article-head {
  display: grid;
  grid-template-columns: 160px minmax(0, 860px);
  gap: clamp(2rem, 6vw, 6rem);
  padding: clamp(4.5rem, 10vw, 8.5rem) 0 clamp(3rem, 7vw, 6rem);
  border-bottom: 1px solid var(--line);
}
.article-head h1 {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(3.2rem, 8vw, 7.4rem);
  font-weight: 500;
  line-height: .93;
  letter-spacing: -.06em;
}
.article-deck {
  margin: 1.75rem 0 0;
  max-width: 34em;
  color: var(--ink);
  opacity: .74;
  font-family: var(--serif);
  font-size: clamp(1.45rem, 2.4vw, 1.8rem);
  line-height: 1.42;
  text-wrap: pretty;
}

.article-wrap {
  display: grid;
  grid-template-columns: 160px minmax(0, var(--reading)) 1fr;
  gap: clamp(2rem, 6vw, 6rem);
  padding: clamp(4rem, 9vw, 8rem) 0;
}
.article-tools { position: sticky; top: 3.5rem; align-self: start; }
.share-button {
  display: inline-flex;
  align-items: center;
  gap: .55rem;
  padding: .65rem .8rem;
  border: 1px solid var(--line-strong);
  background: transparent;
  color: var(--ink);
  font-family: var(--mono);
  font-size: .73rem;
  letter-spacing: .06em;
  text-transform: uppercase;
  cursor: pointer;
}
.share-button:hover { border-color: var(--signal-ink); color: var(--signal-ink); }
.article-body { min-width: 0; }
.article-body p,
.article-body li {
  color: var(--ink-body);
  font-family: var(--serif);
  font-size: clamp(1.22rem, 2vw, 1.42rem);
  line-height: 1.72;
}
.article-body p { margin: 0 0 1.1em; }
/* Reserve the drop cap float height; house style opens on one-line paragraphs,
   so without this the float overhangs and indents the paragraph below it. */
.article-body > p:first-of-type { min-height: 3.45em; }
.article-body > p:first-of-type::first-letter {
  float: left;
  margin: .03em .12em 0 0;
  color: var(--signal);
  font-family: var(--serif);
  font-size: 4.5em;
  line-height: .75;
}
.article-body h2 {
  margin: 4rem 0 1.25rem;
  padding-top: 1.1rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-family: var(--mono);
  font-size: .74rem;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.article-body blockquote {
  margin: 3rem 0 3rem -1.75rem;
  padding: .1rem 0 .1rem 1.75rem;
  border-left: 1px solid var(--ink);
}
.article-body blockquote p {
  margin: 0;
  color: var(--ink);
  font-size: clamp(1.6rem, 2.6vw, 1.95rem);
  line-height: 1.34;
  letter-spacing: -.015em;
  text-wrap: pretty;
}
.article-body code { font-family: var(--mono); font-size: .88em; background: var(--paper-deep); border: 1px solid var(--line); padding: .05em .3em; }
.article-body pre {
  margin: 2.4rem 0;
  padding: 1.15rem 1.35rem;
  overflow-x: auto;
  background: var(--paper-deep);
  border-left: 1px solid var(--line-strong);
  font-family: var(--mono);
  font-size: .84rem;
  line-height: 1.65;
}
.article-body pre code { background: none; border: 0; padding: 0; font-size: inherit; }
.article-body ul, .article-body ol { margin: 0 0 1.55em; padding-left: 1.4em; }
.article-body li { margin-bottom: .55em; }
.article-body li::marker { color: var(--signal); }
.article-body hr { margin: 3.5rem 0; border: 0; border-top: 1px solid var(--line); }
.article-body h3 { margin: 2.5rem 0 .6rem; font-family: var(--serif); font-size: 1.5rem; font-weight: 600; letter-spacing: -.02em; }
.article-body a { text-decoration-color: var(--signal); text-decoration-thickness: 1.5px; text-underline-offset: .16em; }
.article-aside {
  max-width: 210px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: .7rem;
  line-height: 1.7;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.read-on {
  padding: clamp(3rem, 6vw, 5rem) 0 clamp(4rem, 9vw, 7rem);
  border-top: 1px solid var(--line);
}
.read-on-link {
  display: grid;
  grid-template-columns: 160px minmax(0, var(--reading)) 1fr;
  align-items: baseline;
  gap: clamp(2rem, 6vw, 6rem);
  padding: 1.4rem 0 1.1rem;
  color: inherit;
  text-decoration: none;
}
.read-on-num {
  font-family: var(--mono);
  font-size: .7rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
}
.read-on-title {
  max-width: var(--reading);
  font-family: var(--serif);
  font-size: clamp(1.6rem, 4vw, 2.6rem);
  line-height: 1.12;
  letter-spacing: -.025em;
}
.read-on-arrow { font-size: 1.3rem; color: var(--signal); justify-self: end; }
.read-on-link:hover .read-on-title { color: var(--signal-ink); }
.read-on-link:hover .read-on-arrow { transform: translate(2px, -2px); }
.read-on-arrow { transition: transform .18s ease; }
.read-on-excerpt {
  max-width: var(--reading);
  margin: 0 0 0 calc(160px + clamp(2rem, 6vw, 6rem));
  color: var(--muted);
  font-family: var(--serif);
  font-size: 1.05rem;
  line-height: 1.6;
}

.archive-list { padding: 3rem 0 7rem; }
.archive-item {
  display: grid;
  grid-template-columns: 110px 1fr 130px;
  gap: 2rem;
  padding: 2rem 0;
  border-bottom: 1px solid var(--line);
  text-decoration: none;
  align-items: baseline;
}
.archive-item:hover { color: var(--ink); }
.archive-item:hover h2 { color: var(--signal); }
.archive-item h2 { margin: 0; font-family: var(--serif); font-size: clamp(1.8rem, 4vw, 3.4rem); font-weight: 500; letter-spacing: -.035em; }
.archive-item .meta { color: var(--muted); font-family: var(--mono); font-size: .69rem; letter-spacing: .06em; text-transform: uppercase; }

.prose-page {
  max-width: 760px;
  margin-left: auto;
  padding: clamp(4rem, 9vw, 8rem) 0;
}
.prose-page p {
  font-family: var(--serif);
  font-size: clamp(1.25rem, 2vw, 1.5rem);
  line-height: 1.7;
}
.prose-page .large { font-size: clamp(1.75rem, 4vw, 3.2rem); line-height: 1.25; letter-spacing: -.035em; }
.manifesto-line { margin: 3rem 0; padding: 1.5rem 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); color: var(--signal); }

.site-footer {
  padding: 2.5rem 0 3rem;
  border-top: 1px solid var(--line);
}
.footer-inner {
  display: flex;
  justify-content: space-between;
  gap: 2rem;
  align-items: flex-end;
}
.footer-name { margin: 0; font-family: var(--mono); font-size: 1.2rem; font-weight: 700; }
.footer-note { max-width: 420px; margin: .75rem 0 0; color: var(--muted); font-family: var(--serif); line-height: 1.5; }
.footer-links { display: flex; gap: 1.2rem; font-family: var(--mono); font-size: .7rem; letter-spacing: .06em; text-transform: uppercase; }

.not-found { min-height: 65vh; display: grid; align-content: center; }
.not-found .code {
  color: var(--signal-ink); font-family: var(--mono); font-size: .75rem; letter-spacing: .1em; text-transform: uppercase; }
.not-found h1 { max-width: 900px; margin: 1rem 0; font-family: var(--serif); font-size: clamp(3rem, 8vw, 7rem); font-weight: 500; line-height: .95; letter-spacing: -.055em; }
.not-found p { max-width: 620px; color: var(--muted); font-family: var(--serif); font-size: 1.2rem; line-height: 1.6; }

@media (max-width: 850px) {
  .hero, .page-head, .deck-grid { grid-template-columns: 1fr; }
  .hero-side { max-width: 520px; }
  .post-card { grid-template-columns: 1fr; padding-bottom: 1rem; }
  .post-arrow { justify-content: flex-start; font-size: 1.4rem; margin-top: .25rem; }
  .article-head { grid-template-columns: minmax(0, var(--reading)); }
  .article-wrap { grid-template-columns: minmax(0, var(--reading)); }

  /* Sharing is a post-read intent; static placement put it above paragraph one. */
  .article-tools { position: static; order: 2; padding-top: 1.5rem; border-top: 1px solid var(--line); }
  .article-body { order: 1; }
  .article-aside {
    display: block;
    order: 3;
    max-width: none;
    margin-top: 2.5rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--line);
    font-size: .72rem;
  }

  /* Single column recovers the number gutter for the title. */
  .recent-item { grid-template-columns: 1fr; gap: .35rem; }
  .recent-item .cat { text-align: left; }
  .archive-item { grid-template-columns: 1fr; gap: .4rem; }
  .archive-item .meta, .archive-item .date { display: inline; }
  .read-on-link { grid-template-columns: 70px 1fr 28px; gap: 1rem; }
  .read-on-excerpt { margin-left: calc(70px + 1rem); }

  /* Tap targets. Inline anchors need a box to take min-height; the negative
     margin keeps their optical alignment to the gutter. */
  .nav-links a, .footer-links a, .recent-all, .wordmark {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    padding-inline: .2rem;
  }
  .nav-links { gap: .9rem; }
  .footer-links { gap: 1.5rem; }
  .icon-button { width: 44px; height: 44px; }
  .share-button { min-height: 44px; font-size: .72rem; padding: .8rem 1.1rem; }
  .not-found p a { display: inline-block; min-height: 44px; }
}

/* Touch devices get real press feedback; :hover neither fires nor clears there. */
@media (hover: none) {
  .post-card:active h2, .archive-item:active h2,
  .recent-item:active h3, .read-on-link:active .read-on-title { color: var(--signal-ink); }
  .post-card:active, .archive-item:active,
  .recent-item:active, .read-on-link:active { background: var(--signal-soft); }
  .icon-button:active, .share-button:active { border-color: var(--signal-ink); color: var(--signal-ink); }
}

@media (max-width: 580px) {
  .site-header { min-height: 64px; }
  .nav-wrap { gap: .6rem; }
  .nav-links a { font-size: .72rem; letter-spacing: .09em; }
  .hero h1 { font-size: clamp(3.1rem, 15vw, 5rem); }
  .footer-inner { align-items: flex-start; flex-direction: column; gap: 2rem; }
  .article-body p, .article-body li { font-size: 1.2rem; line-height: 1.62; }
  /* Drop cap and its reserved height must shrink together or the overhang returns. */
  .article-body > p:first-of-type::first-letter { font-size: 3.4em; }
  .article-body > p:first-of-type { min-height: 2.65em; }
  .article-body blockquote { margin-left: 0; padding-left: 1.1rem; }
  .article-body blockquote p { font-size: 1.35rem; }
  .article-body h2 { margin: 3rem 0 1rem; }
  .read-on-link { grid-template-columns: 1fr auto; gap: .5rem 1rem; align-items: start; }
  .read-on-num { grid-column: 1 / -1; margin-bottom: .35rem; }
  .read-on-title { font-size: clamp(1.7rem, 6.5vw, 2.2rem); }
  .read-on-excerpt { margin-left: 0; }
  /* The state words are the funniest copy on the page; reflow, never delete. */
  .deck-list li { grid-template-columns: 48px 1fr; }
  .deck-list .state { display: block; grid-column: 2; margin-top: .3rem; }
}

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