/* /writing and the posts (next pages in pages/writing + pages/essays, frame in
   components/blog/Frame.tsx). sits on site.css: same palette, fonts and ink.
   the post column is ~65 characters of 18-19px type, for phones first. */

/* the old site's global css (styles/globals.css) is also loaded on next pages: these win on specificity */
body:has(.w-doc) { height: auto; min-height: 100vh; letter-spacing: normal; font: 400 16px/1.6 var(--sans); background: var(--bg); color: var(--ink); overscroll-behavior: auto; }
.w-doc h1, .w-doc h2, .w-doc h3, .w-doc h4 { margin-bottom: 0; }
.w-doc a, .w-doc a:hover, .w-doc a:focus { color: inherit; border-bottom: 0; background: none; outline: none; }
.w-doc a:focus-visible { outline: 2px solid var(--t0); outline-offset: 3px; border-radius: 4px; background: none; }
.w-doc { min-height: 100vh; min-height: 100svh; display: flex; flex-direction: column; }
.w-doc::before { content: ""; display: block; height: 4px; background: linear-gradient(90deg, var(--c1), var(--c0), var(--c2), var(--c3), var(--c4)); }
.w-nav, .w-main { max-width: calc(650px + 2 * var(--m)); } /* ~68 characters of 19px type */
.w-nav.is-wide, .w-main.is-wide { max-width: 1180px; }
.w-nav { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding-top: 24px; padding-bottom: 24px; font-size: 15px; font-weight: 500; }
.w-me { letter-spacing: -0.01em; }
.w-links { display: flex; gap: 18px; color: var(--ink-2); }
.w-links a { display: inline-flex; align-items: center; gap: 5px; }
.w-links .ico { width: 15px; height: 15px; } /* x: the mark alone */
@media (max-width: 480px) { .w-nav { gap: 12px; font-size: 14px; } .w-links { gap: 13px; } }
.w-links a[aria-current] { color: var(--ink); text-decoration-color: var(--c0); }
.w-links a { position: relative; text-decoration: underline; text-decoration-color: var(--line); text-underline-offset: 4px; text-decoration-thickness: 1.5px; transition: color .2s, text-decoration-color .2s; }
.w-links a:hover { color: var(--ink); text-decoration-color: var(--c0); }
.w-me { position: relative; }
.w-links a::after, .w-me::after { content: ""; position: absolute; top: -12px; bottom: -12px; left: 50%; translate: -50% 0; width: calc(100% + 14px); min-width: 44px; } /* 44px target */
.w-main { flex: 1; width: 100%; padding-top: clamp(24px, 7vh, 72px); padding-bottom: clamp(48px, 9vh, 96px); }
.w-doc .skip:focus { top: 16px; }

/* ── the head of a page or post ── */
.w-kicker { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; font: 500 13px/1.4 var(--mono); color: var(--ink-3); }
.w-kicker i { width: 8px; height: 8px; border-radius: 50%; background: var(--dot); margin-right: 2px; }
.w-kicker a { position: relative; color: var(--ink-2); text-decoration: underline; text-decoration-color: var(--line); text-underline-offset: 3px; }
.w-kicker a::after { content: ""; position: absolute; inset: -13px -8px; }
.w-kicker a:hover { text-decoration-color: var(--c0); }
.w-title { margin: 14px 0 0; max-width: none; text-shadow: none; /* not the hero's h1 */ font-size: clamp(36px, 6.4vw, 58px); line-height: 1.04; font-weight: 600; letter-spacing: -0.045em; color: var(--ink); text-wrap: balance; }
.w-lede { margin-top: 16px; font-size: clamp(19px, 2vw, 21px); line-height: 1.45; color: var(--ink-2); letter-spacing: -0.01em; text-wrap: pretty; }
.w-lede a, .w-follow-alt a, .w-empty a { color: var(--ink); text-decoration: underline; text-decoration-color: var(--line); text-underline-offset: 4px; text-decoration-thickness: 1.5px; }
.w-lede a:hover, .w-follow-alt a:hover { text-decoration-color: var(--c0); }
.w-post .w-head { padding-bottom: 28px; border-bottom: 1px solid var(--line); }

/* ── the list ── */
.w-list { margin-top: 40px; list-style: none; padding: 0; border-top: 1px solid var(--line); }
.w-list li { border-bottom: 1px solid var(--line); }
.w-list a { display: grid; grid-template-columns: 1fr auto; gap: 6px 24px; padding: 22px 0; }
.w-list-t { font-size: 21px; line-height: 1.3; font-weight: 600; letter-spacing: -0.02em; transition: color .2s; }
.w-list-d { grid-column: 1; color: var(--ink-2); font-size: 16.5px; line-height: 1.5; }
.w-list-k { grid-column: 2; grid-row: 1; align-self: baseline; font: 400 13px/1.4 var(--mono); color: var(--ink-3); white-space: nowrap; }
.w-list a:hover .w-list-t { color: var(--t0); }
.w-empty { margin-top: 40px; color: var(--ink-2); font-size: 18px; }
@media (max-width: 560px) {
  .w-list a { grid-template-columns: 1fr; }
  .w-list-k { grid-column: 1; grid-row: auto; }
}

/* ── the post ── */
.w-prose { margin-top: 32px; font-size: 19px; line-height: 1.7; color: color-mix(in srgb, var(--ink) 90%, var(--bg)); overflow-wrap: break-word; }
.w-prose > * + * { margin-top: 1.1em; }
.w-prose p, .w-prose li { text-wrap: pretty; }
.w-prose h2, .w-prose h3, .w-prose h4 { color: var(--ink); font-weight: 600; letter-spacing: -0.025em; line-height: 1.2; text-wrap: balance; }
.w-prose h2 { margin-top: 2em; font-size: 30px; }
.w-prose h3 { margin-top: 1.8em; font-size: 25px; }
.w-prose h4 { margin-top: 1.6em; font-size: 20px; }
.w-prose h2 + *, .w-prose h3 + *, .w-prose h4 + * { margin-top: .6em; }
.w-prose a { color: var(--ink); text-decoration: underline; text-decoration-color: color-mix(in srgb, var(--c0) 45%, transparent); text-underline-offset: 4px; text-decoration-thickness: 1.5px; transition: text-decoration-color .2s; }
.w-prose a:hover { text-decoration-color: var(--c0); }
.w-prose strong { color: var(--ink); font-weight: 600; }
.w-prose ul, .w-prose ol { padding-left: 1.3em; }
.w-prose ul { list-style: disc; }
.w-prose ol { list-style: decimal; }
.w-prose li + li { margin-top: .4em; }
.w-prose li::marker { color: var(--ink-3); }
.w-prose blockquote { margin-left: 0; margin-right: 0; padding: 2px 0 2px 20px; border-left: 3px solid var(--c0); color: var(--ink-2); font-style: italic; }
.w-prose code { font: 400 .86em/1.5 var(--mono); padding: .12em .38em; border-radius: 6px; background: color-mix(in srgb, var(--c0) 8%, var(--bg)); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--c0) 16%, transparent); }
.w-prose pre { padding: 16px 18px; border-radius: 12px; overflow-x: auto; white-space: pre-wrap; overflow-wrap: anywhere; background: color-mix(in srgb, var(--ink) 4%, var(--bg)); box-shadow: inset 0 0 0 1px var(--line); font-size: 15px; line-height: 1.6; }
.w-prose pre code { padding: 0; background: none; box-shadow: none; font-size: inherit; }
.w-prose hr { border: 0; height: 1px; background: var(--line); margin: 2.2em 0; }
.w-prose figure { margin-left: 0; margin-right: 0; }
.w-prose figure img, .w-prose figure video { display: block; width: 100%; height: auto; border-radius: 12px; box-shadow: 0 0 0 1px var(--line); background: color-mix(in srgb, var(--ink) 4%, var(--bg)); }
.w-prose figcaption { margin-top: 8px; font: 400 13px/1.45 var(--mono); color: var(--ink-3); }
.w-prose .w-embed iframe { display: block; width: 100%; aspect-ratio: 16 / 9; height: auto; border: 0; border-radius: 12px; background: #000; }
@media (max-width: 560px) {
  .w-prose { font-size: 18px; line-height: 1.68; }
  .w-prose h2 { font-size: 26px; }
  .w-prose h3 { font-size: 22px; }
}

/* ── get the next one ── */
.w-follow { margin-top: 56px; padding: 26px 26px 22px; border-radius: 18px; position: relative;
  background: linear-gradient(135deg, color-mix(in srgb, var(--c1) 7%, var(--bg)), color-mix(in srgb, var(--c2) 7%, var(--bg)));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--c0) 22%, transparent); }
.w-follow h2 { font-size: 24px; line-height: 1.2; font-weight: 600; letter-spacing: -0.03em; }
.w-follow-sub, .w-follow-ok { margin-top: 6px; color: var(--ink-2); font-size: 16.5px; line-height: 1.5; }
.w-follow-ok { color: var(--ink); font-weight: 500; }
.w-follow-form { margin-top: 16px; display: flex; gap: 10px; }
.w-follow-form input[type="email"] {
  flex: 1; min-width: 0; height: 48px; padding: 0 16px; border: 0; border-radius: 999px;
  font: 400 16px/1 var(--sans); color: var(--ink); background: var(--bg);
  box-shadow: inset 0 0 0 1.5px color-mix(in oklab, var(--ink) 50%, transparent); /* the field's edge is 3:1 or better against the card */
}
.w-follow-form input[type="email"]::placeholder { color: var(--ink-3); }
.w-follow-form input[type="email"]:focus { outline: none; box-shadow: inset 0 0 0 2px var(--t0); }
.w-follow-form input[aria-invalid="true"] { box-shadow: inset 0 0 0 2px #c0263f; }
.w-follow-form button {
  height: 48px; padding: 0 22px; border: 0; border-radius: 999px; cursor: pointer;
  font: 600 15px/1 var(--sans); color: #fff;
  background: linear-gradient(100deg, var(--c1) 0%, var(--c0) 45%, var(--c2) 100%);
  box-shadow: 0 10px 24px -12px color-mix(in oklab, var(--c0) 70%, transparent);
  transition: transform .2s ease, opacity .2s;
}
.w-follow-form button:hover { transform: translateY(-1px); }
.w-follow-form button:disabled { opacity: .6; cursor: progress; }
.w-follow-msg { min-height: 0; color: #c0263f; font-size: 14.5px; }
.w-follow-msg:not(:empty) { margin-top: 8px; }
.w-follow-alt { margin-top: 12px; font: 400 13px/1.5 var(--mono); color: var(--ink-3); }
.w-follow-alt a { color: var(--ink-2); position: relative; display: inline-block; padding: 13px 8px; margin: -13px -4px; } /* a 44px target around a one-letter link */
.w-hp, .w-sr { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
@media (max-width: 480px) {
  .w-follow { padding: 22px 18px 18px; }
  .w-follow-form { flex-direction: column; }
  .w-follow-form input[type="email"] { flex: none; }
  .w-follow-form button { width: 100%; }
}

/* ── more writing ── */
.w-more { margin-top: 56px; }
.w-more h2 { font: 500 13px/1 var(--mono); color: var(--ink-3); text-transform: none; }
.w-more .w-list { margin-top: 14px; }
.w-more .w-list a { padding: 16px 0; }
.w-more .w-list-t { font-size: 18px; }

@media (prefers-color-scheme: dark) {
  .w-follow-msg { color: #ff8197; }
}

/* tables (| a | b |) scroll sideways on a phone instead of squeezing */
.w-prose .md-table { overflow-x: auto; border-radius: 12px; box-shadow: inset 0 0 0 1px var(--line); }
.w-prose table { width: 100%; border-collapse: collapse; font-size: 16px; line-height: 1.45; }
.w-prose th, .w-prose td { padding: 10px 14px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); }
.w-prose th { font: 500 13px/1.4 var(--mono); color: var(--ink-3); }
.w-prose tbody tr:last-child td { border-bottom: 0; }

/* round 1 of the council (2026-11-09) */
.w-prose td:first-child, .w-prose th:first-child { white-space: nowrap; }
.w-by { margin-top: 44px; padding-top: 20px; border-top: 1px solid var(--line); color: var(--ink-2); font-size: 16.5px; line-height: 1.5; }
.w-by a, .w-all a { color: var(--ink); text-decoration: underline; text-decoration-color: var(--line); text-underline-offset: 4px; text-decoration-thickness: 1.5px; }
.w-by a:hover, .w-all a:hover { text-decoration-color: var(--c0); }
.w-all { margin-top: 6px; font-size: 15px; font-weight: 500; }
.w-all a { display: inline-flex; align-items: center; min-height: 44px; }
.w-follow-ok:focus { outline: none; }
.w-list + .w-follow, .w-empty + .w-follow { margin-top: 48px; }
/* the button: ink with a palette ring, so the word reads in every palette (white on the light blue stop was 2.8:1) */
.w-follow-form button {
  color: var(--bg); border: 2px solid transparent;
  background: linear-gradient(var(--ink), var(--ink)) padding-box, linear-gradient(100deg, var(--c1) 0%, var(--c0) 45%, var(--c2) 100%) border-box;
}
@media (max-width: 560px) { .w-prose p, .w-prose li { text-wrap: wrap; } }
