/* AFTERNOONSELF
   Layout idea: a quiet reading room. Dusk-coloured bands for the moments that ask something of the reader,
   stone-coloured paper for everything that is read. One signature: a sundial shadow that follows local time. */
:root {
  --paper: #ecefea;
  --surface: #f6f7f3;
  --ink: #10191d;
  --muted: #4f5d5e;
  --rule: #c7cdc5;
  --gold: #86590a;        /* text-safe gold on paper */
  --dusk: #14232a;        /* dark band background */
  --dusk-ink: #ebe8de;    /* text on dusk */
  --dusk-muted: #a9b4b3;
  --sun: #e3b04b;         /* gold on dusk, buttons */
  --sun-ink: #1a1405;
  --focus: #1d5fd1;
  --display: "Newsreader", "Iowan Old Style", Georgia, "Times New Roman", serif;
  --mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  --measure: 62ch;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #0d1417;
    --surface: #131e23;
    --ink: #e9e6dc;
    --muted: #a3afae;
    --rule: #28373d;
    --gold: #e3b04b;
    --dusk: #172a32;
    --focus: #7fb0ff;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #0d1417;
  --surface: #131e23;
  --ink: #e9e6dc;
  --muted: #a3afae;
  --rule: #28373d;
  --gold: #e3b04b;
  --dusk: #172a32;
  --focus: #7fb0ff;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--display);
  font-size: 1.125rem;
  line-height: 1.6;
  font-optical-sizing: auto;
  -webkit-font-smoothing: antialiased;
}
img, svg { max-width: 100%; }
a { color: inherit; text-decoration-color: color-mix(in srgb, currentColor 40%, transparent); text-underline-offset: 0.2em; }
a:hover { text-decoration-color: currentColor; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: 2px; }
h1, h2, h3, h4 { font-weight: 500; line-height: 1.12; letter-spacing: -0.012em; text-wrap: balance; margin: 0; }
p { margin: 0; text-wrap: pretty; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 12px; top: -60px; background: var(--ink); color: var(--paper); padding: 10px 14px; z-index: 50; }
.skip:focus { top: 12px; }

.wrap { width: 100%; max-width: 1120px; margin: 0 auto; padding: 0 20px; }
.wrap-narrow { max-width: 760px; }
.mono { font-family: var(--mono); font-size: 0.78rem; letter-spacing: 0.06em; text-transform: uppercase; }
.eyebrow { font-family: var(--mono); font-size: 0.78rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--gold); }
.muted { color: var(--muted); }

/* header */
.site-header { border-bottom: 1px solid var(--rule); background: var(--paper); position: sticky; top: 0; z-index: 20; }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 64px; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font-family: var(--display); font-weight: 500; font-size: 1.35rem; letter-spacing: -0.01em; }
.brand svg { width: 28px; height: 28px; flex: none; }
.nav { display: flex; align-items: center; gap: 26px; }
.nav a { text-decoration: none; font-size: 1rem; }
.nav a[aria-current="page"] { text-decoration: underline; text-decoration-thickness: 2px; text-decoration-color: var(--gold); text-underline-offset: 0.45em; }
.nav a:hover { color: var(--gold); }
.nav-toggle { display: none; background: none; border: 1px solid var(--rule); color: var(--ink); font: inherit; font-size: 0.95rem; padding: 8px 14px; border-radius: 999px; cursor: pointer; }

.btn { display: inline-flex; align-items: center; justify-content: center; font: inherit; font-size: 1rem; font-weight: 500; line-height: 1; padding: 14px 22px; border-radius: 4px; border: 1px solid transparent; cursor: pointer; text-decoration: none; white-space: nowrap; }
.btn-ink { background: var(--ink); color: var(--paper); }
.btn-ink:hover { background: var(--gold); color: var(--paper); }
:root[data-theme="dark"] .btn-ink:hover { color: #1a1405; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .btn-ink:hover { color: #1a1405; } }
.btn-sun { background: var(--sun); color: var(--sun-ink); }
.btn-sun:hover { background: #f1c46a; }
.btn-line { border-color: var(--ink); color: var(--ink); background: transparent; }
.btn-line:hover { background: var(--ink); color: var(--paper); }
.btn-sm { padding: 10px 16px; font-size: 0.95rem; }

/* dusk band */
.dusk { background: var(--dusk); color: var(--dusk-ink); }
.dusk .muted, .dusk .eyebrow { color: var(--dusk-muted); }
.dusk .eyebrow { color: var(--sun); }
.dusk a { color: var(--dusk-ink); }

/* hero */
.hero { padding: 56px 0 64px; overflow: hidden; }
.hero .wrap { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 0.75fr); gap: 40px; align-items: center; }
.hero h1 { font-size: clamp(2.7rem, 8vw, 5.4rem); font-weight: 400; line-height: 1.02; letter-spacing: -0.025em; }
.hero h1 em { font-style: italic; color: var(--sun); font-weight: 400; }
.hero .lede { font-size: clamp(1.15rem, 2.4vw, 1.4rem); line-height: 1.5; color: var(--dusk-ink); max-width: 36ch; margin-top: 22px; opacity: 0.92; }
.hero .sub-form { margin-top: 30px; max-width: 560px; }
.hero .fine { margin-top: 14px; font-size: 0.95rem; color: var(--dusk-muted); }
.dial { width: 100%; max-width: 380px; justify-self: end; }
.dial svg { width: 100%; height: auto; display: block; }
.dial figcaption { font-family: var(--mono); font-size: 0.72rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--dusk-muted); margin-top: 6px; }
.dial figcaption b { color: var(--sun); font-weight: 500; }

/* forms */
.sub-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 8px; }
.btn-block { width: 100%; padding: 16px 22px; }
.sub-fields input, .sub-row input[type="email"] { flex: 1 1 auto; min-width: 0; font: inherit; font-size: 1.05rem; padding: 14px 16px; border-radius: 4px; border: 1px solid var(--rule); background: var(--surface); color: var(--ink); }
.dusk .sub-fields input { background: rgba(255,255,255,0.07); border-color: rgba(235,232,222,0.28); color: var(--dusk-ink); }
.dusk .sub-fields input::placeholder { color: var(--dusk-muted); }
.consent { display: flex; gap: 10px; align-items: flex-start; margin-top: 12px; font-size: 0.92rem; line-height: 1.4; color: var(--muted); cursor: pointer; }
.dusk .consent { color: var(--dusk-muted); }
.consent input { margin-top: 3px; width: 18px; height: 18px; flex: none; accent-color: var(--sun); }
.sub-msg { margin-top: 12px; font-size: 1rem; min-height: 1.4em; }
.sub-msg.ok { color: var(--gold); }
.dusk .sub-msg.ok { color: var(--sun); }
.sub-msg.err { color: #b3261e; }
.dusk .sub-msg.err { color: #ff9b91; }
:root[data-theme="dark"] .sub-msg.err { color: #ff9b91; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .sub-msg.err { color: #ff9b91; } }

/* sections */
.section { padding: 72px 0; }
.section-tight { padding: 48px 0; }
.section-rule { border-top: 1px solid var(--rule); }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 20px; margin-bottom: 32px; flex-wrap: wrap; }
.section-head h2 { font-size: clamp(1.8rem, 4.2vw, 2.6rem); }
.section-head a { font-size: 1rem; }
.lead { font-size: clamp(1.2rem, 2.4vw, 1.45rem); line-height: 1.5; max-width: 40ch; }

.trio { display: grid; grid-template-columns: repeat(3, 1fr); gap: 36px; }
.trio h3 { font-size: 1.5rem; margin-bottom: 10px; }
.trio p { color: var(--muted); }
.trio > div { border-top: 2px solid var(--ink); padding-top: 18px; }

/* letter tiles */
.grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 28px; }
.tile { display: flex; flex-direction: column; gap: 14px; text-decoration: none; color: inherit; }
.tile-cover { position: relative; aspect-ratio: 16 / 10; background: var(--dusk); color: var(--dusk-ink); padding: 18px 20px; display: flex; flex-direction: column; justify-content: space-between; overflow: hidden; border-radius: 4px; }
.tile-cover::after { content: ""; position: absolute; inset: 0; background: linear-gradient(112deg, transparent 58%, rgba(227,176,75,0.10) 58%, rgba(227,176,75,0.10) 62%, transparent 62%); pointer-events: none; }
.tile-cover .mono { color: var(--dusk-muted); position: relative; z-index: 1; }
.tile-cover h3 { font-size: clamp(1.45rem, 2.6vw, 1.9rem); font-weight: 400; position: relative; z-index: 1; }
a.tile:hover .tile-cover h3 { color: var(--sun); }
a.tile:hover h4 { text-decoration: underline; text-decoration-color: var(--gold); text-underline-offset: 0.2em; }
.tile h4 { font-size: 1.25rem; font-weight: 500; }
.tile p { color: var(--muted); font-size: 1rem; line-height: 1.5; }
.tile .meta { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; color: var(--muted); }
.pill { display: inline-block; font-family: var(--mono); font-size: 0.68rem; letter-spacing: 0.06em; text-transform: uppercase; padding: 4px 8px; border-radius: 999px; border: 1px solid var(--rule); color: var(--muted); }
.pill-live { border-color: var(--gold); color: var(--gold); }
.tile.soon { opacity: 0.94; }

/* statement list */
.cols-2 { display: grid; grid-template-columns: 0.9fr 1.1fr; gap: 56px; align-items: start; }
.cols-2 h2 { font-size: clamp(1.8rem, 4.2vw, 2.6rem); }
.checklist { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; }
.checklist li { padding: 18px 0; border-top: 1px solid var(--rule); display: grid; grid-template-columns: 2.4rem 1fr; gap: 6px; }
.checklist li:last-child { border-bottom: 1px solid var(--rule); }
.checklist .n { font-family: var(--mono); font-size: 0.8rem; color: var(--gold); padding-top: 0.45rem; }
.checklist b { font-weight: 600; }

/* sources strip */
.sources { display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; }
.sources div { border-left: 2px solid var(--sun); padding-left: 16px; }
.sources b { display: block; font-size: 1.15rem; font-weight: 500; }
.sources span { font-size: 1rem; color: var(--dusk-muted); }

/* faq */
.faq { border-top: 1px solid var(--rule); }
.faq details { border-bottom: 1px solid var(--rule); }
.faq summary { cursor: pointer; list-style: none; padding: 20px 36px 20px 0; font-size: 1.3rem; font-weight: 500; position: relative; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; position: absolute; right: 4px; top: 50%; transform: translateY(-50%); font-family: var(--mono); font-size: 1.3rem; color: var(--gold); }
.faq details[open] summary::after { content: "\2212"; }
.faq .ans { padding: 0 0 22px; max-width: var(--measure); color: var(--muted); }
.faq .ans p + p { margin-top: 12px; }

/* page header (inner pages) */
.page-head { padding: 64px 0 32px; }
.page-head h1 { font-size: clamp(2.3rem, 6vw, 4rem); font-weight: 400; letter-spacing: -0.02em; line-height: 1.05; }
.page-head .lead { margin-top: 18px; color: var(--muted); }

/* prose */
.prose { max-width: var(--measure); }
.prose > * + * { margin-top: 1.15em; }
.prose h2 { font-size: 1.75rem; margin-top: 2em; }
.prose h3 { font-size: 1.3rem; margin-top: 1.7em; }
.prose ul, .prose ol { padding-left: 1.3em; }
.prose li + li { margin-top: 0.5em; }
.prose blockquote { margin-left: 0; padding-left: 20px; border-left: 3px solid var(--sun); font-style: italic; }
.prose hr { border: 0; border-top: 1px solid var(--rule); margin: 2.2em 0; }
.prose .callout { background: var(--surface); border: 1px solid var(--rule); border-left: 4px solid var(--sun); padding: 18px 22px; border-radius: 4px; }
.prose .callout > * + * { margin-top: 0.7em; }
.prose strong { font-weight: 600; }
.prose .ps { color: var(--muted); }
.letter-meta { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 20px; color: var(--muted); }
.letter-body { font-size: 1.22rem; line-height: 1.65; }
.letter-body > p:first-of-type::first-line { font-weight: 600; }
.reply-box { margin-top: 2.2em; background: var(--dusk); color: var(--dusk-ink); padding: 26px 28px; border-radius: 4px; }
.reply-box h2 { font-size: 1.5rem; margin: 0 0 8px; }
.reply-box p { color: var(--dusk-ink); opacity: 0.9; }
.reply-box code, .addr { font-family: var(--mono); font-size: 0.92em; }
.next-up { margin-top: 2.5em; padding-top: 1.4em; border-top: 1px solid var(--rule); }

/* archive controls */
.controls { display: grid; gap: 16px; margin-bottom: 32px; }
.search { position: relative; }
.search input { width: 100%; font: inherit; font-size: 1.05rem; padding: 14px 16px 14px 44px; border: 1px solid var(--rule); border-radius: 4px; background: var(--surface); color: var(--ink); }
.search svg { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; color: var(--muted); }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { font: inherit; font-size: 0.95rem; padding: 8px 14px; border-radius: 999px; border: 1px solid var(--rule); background: transparent; color: var(--ink); cursor: pointer; }
.chip[aria-pressed="true"] { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.empty { padding: 28px 0; color: var(--muted); }

/* contact */
.contact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 56px; align-items: start; }
.field { display: grid; gap: 6px; margin-bottom: 18px; }
.field label { font-weight: 500; font-size: 1rem; }
.field input, .field select, .field textarea { font: inherit; font-size: 1.05rem; padding: 12px 14px; border: 1px solid var(--rule); border-radius: 4px; background: var(--surface); color: var(--ink); width: 100%; }
.field textarea { min-height: 150px; resize: vertical; }
.addr-card { background: var(--surface); border: 1px solid var(--rule); border-radius: 4px; padding: 22px 24px; display: grid; gap: 14px; }
.addr-card .addr { font-size: 1.15rem; word-break: break-all; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.compose { margin-top: 20px; background: var(--surface); border: 1px solid var(--rule); border-left: 4px solid var(--sun); border-radius: 4px; padding: 20px 22px; display: none; }
.compose.show { display: block; }
.compose pre { white-space: pre-wrap; word-break: break-word; font-family: var(--mono); font-size: 0.88rem; line-height: 1.5; margin: 12px 0 16px; background: var(--paper); padding: 14px; border-radius: 4px; border: 1px solid var(--rule); }

/* footer */
.site-footer { margin-top: 0; }
.footer-top { display: grid; grid-template-columns: 1.2fr 1fr; gap: 48px; padding: 56px 0 40px; }
.footer-top h2 { font-size: 1.7rem; font-weight: 400; }
.footer-top p { color: var(--dusk-muted); margin-top: 10px; max-width: 42ch; font-size: 1rem; }
.footer-cols { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; padding: 28px 0; border-top: 1px solid rgba(235,232,222,0.16); }
.footer-cols h3 { font-family: var(--mono); font-size: 0.72rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--dusk-muted); font-weight: 400; margin-bottom: 12px; }
.footer-cols ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; font-size: 1rem; }
.footer-cols a { text-decoration: none; }
.footer-cols a:hover { color: var(--sun); text-decoration: underline; }
.footer-base { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding: 20px 0 32px; border-top: 1px solid rgba(235,232,222,0.16); font-size: 0.9rem; color: var(--dusk-muted); }
.footer-base p { max-width: 70ch; }

.notfound { padding: 96px 0; }
.notfound .big { font-family: var(--mono); font-size: clamp(4rem, 14vw, 9rem); color: var(--gold); line-height: 1; letter-spacing: -0.04em; }

@media (max-width: 880px) {
  .hero .wrap { grid-template-columns: 1fr; }
  .dial { justify-self: start; max-width: 300px; order: 2; }
  .trio, .sources { grid-template-columns: 1fr; gap: 28px; }
  .grid { grid-template-columns: 1fr 1fr; }
  .cols-2, .contact-grid, .footer-top { grid-template-columns: 1fr; gap: 32px; }
}
@media (max-width: 640px) {
  body { font-size: 1.0625rem; }
  .grid { grid-template-columns: 1fr; }
  .section { padding: 52px 0; }
  .hero { padding: 40px 0 48px; }
  .sub-fields { grid-template-columns: 1fr; }
  .footer-cols { grid-template-columns: 1fr 1fr; }
  .js .nav-toggle { display: inline-block; }
  .js .nav { display: none; position: absolute; left: 0; right: 0; top: 100%; background: var(--paper); border-bottom: 1px solid var(--rule); flex-direction: column; align-items: flex-start; gap: 0; padding: 8px 20px 18px; }
  .js .nav.open { display: flex; }
  .js .nav a { padding: 12px 0; width: 100%; font-size: 1.1rem; }
  .js .nav .btn { width: 100%; margin-top: 8px; padding: 14px; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

/* sub-fields base input look (name + email) */
.sub-fields input { width: 100%; min-width: 0; font: inherit; font-size: 1.05rem; padding: 14px 16px; border-radius: 4px; border: 1px solid var(--rule); background: var(--surface); color: var(--ink); }

/* books */
.books { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 40px; }
.book { display: grid; grid-template-columns: 170px 1fr; gap: 24px; align-items: start; }
img.cover { display: block; width: 100%; height: auto; border-radius: 3px 6px 6px 3px; box-shadow: 0 14px 28px -14px rgba(16,25,29,0.55); background: var(--dusk); }
.book h3 { font-size: 1.45rem; margin: 6px 0 8px; line-height: 1.15; }
.meta-line { margin-top: 10px; color: var(--muted); }
.gdetail { padding: 8px 0 56px; }
.gdetail + .gdetail { border-top: 1px solid var(--rule); padding-top: 56px; }
.gd-top { display: grid; grid-template-columns: 260px 1fr; gap: 44px; align-items: start; }
.gd-title { font-size: clamp(1.9rem, 4.4vw, 2.8rem); font-weight: 400; line-height: 1.06; margin-top: 8px; display: block; padding: 0; }
.gd-title::before { display: none; }
.gd-meta { display: flex; flex-wrap: wrap; gap: 8px; margin: 18px 0 6px; }
.gd-h { font-size: 1.2rem; margin: 22px 0 8px; }
.gd-list { margin: 0; padding: 0; list-style: none; display: grid; }
.gd-list li { padding: 11px 0 11px 22px; border-top: 1px solid var(--rule); position: relative; }
.gd-list li:last-child { border-bottom: 1px solid var(--rule); }
.gd-list li::before { content: ""; position: absolute; left: 0; top: 1.15em; width: 10px; height: 2px; background: var(--sun); }
.peek { margin-top: 36px; }
.peek-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-top: 10px; }
.peek-row img { width: 100%; height: auto; display: block; border: 1px solid var(--rule); border-radius: 3px; box-shadow: 0 10px 22px -16px rgba(16,25,29,0.6); }
@media (max-width: 880px) { .books { grid-template-columns: 1fr; } .gd-top { grid-template-columns: 200px 1fr; gap: 28px; } }
@media (max-width: 640px) { .book { grid-template-columns: 110px 1fr; gap: 16px; } .gd-top { grid-template-columns: 1fr; } .gd-top > img.cover { max-width: 220px; } .peek-row { gap: 8px; } }

/* blog */
.byline { display: flex; align-items: center; gap: 8px; font-family: var(--display); font-size: 0.95rem; font-weight: 500; color: var(--gold); }
.byline svg { width: 18px; height: 18px; }
.byline-lg { margin-top: 18px; font-size: 1.05rem; }
.byline-lg svg { width: 22px; height: 22px; }
.pager { display: flex; justify-content: center; gap: 8px; margin-top: 40px; flex-wrap: wrap; }
.pager button { font: inherit; min-width: 42px; height: 42px; padding: 0 12px; border: 1px solid var(--rule); border-radius: 4px; background: transparent; color: var(--ink); cursor: pointer; }
.pager button[aria-current="page"] { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.pager button:disabled { opacity: 0.4; cursor: default; }
.post-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.post-nav a { text-decoration: none; padding: 16px 0; border-top: 1px solid var(--rule); font-size: 1rem; }
.post-nav a:last-child { text-align: right; }
.post-nav a:hover { color: var(--gold); }
[hidden] { display: none !important; }
@media (max-width: 880px) { .books { grid-template-columns: 1fr; } .nav { gap: 18px; } }
@media (max-width: 640px) { .book { grid-template-columns: 110px 1fr; } .post-nav { grid-template-columns: 1fr; } .post-nav a:last-child { text-align: left; } }

/* photo covers */
.tile-cover > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: 0; transition: transform .6s ease; }
.tile-cover::before { content: ""; position: absolute; inset: 0; z-index: 1; background: linear-gradient(180deg, rgba(20,35,42,0.50) 0%, rgba(20,35,42,0.72) 100%); }
a.tile:hover .tile-cover > img { transform: scale(1.03); }
.tile-cover::after { z-index: 1; }
