/* blog.lewisbrewer.com
   Black, off-white and red, after the Te Hīkoi and Musket pages on
   lewisbrewer.com. BN Romaine for display type, Inter for reading. */

@font-face { font-family: "Inter"; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url("/assets/fonts/inter-latin-wght-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url("/assets/fonts/inter-latin-ext-wght-normal.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Inter"; font-style: italic; font-weight: 100 900; font-display: swap;
  src: url("/assets/fonts/inter-latin-wght-italic.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Inter"; font-style: italic; font-weight: 100 900; font-display: swap;
  src: url("/assets/fonts/inter-latin-ext-wght-italic.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "BN Romaine"; font-style: normal; font-weight: 400; font-display: swap;
  src: url("/assets/fonts/bn-romaine.woff2") format("woff2"); }

:root {
  --bg: #000;
  --surface: #0f0f10;
  --head: #f0f0f0;
  --text: #e2e2e2;
  --muted: rgba(240, 240, 240, 0.63);
  --faint: rgba(240, 240, 240, 0.42);
  --rule: rgba(240, 240, 240, 0.16);
  --red: #d12229;            /* the portfolio's title red, for large type */
  --red-text: #ff5a5f;       /* a lighter red that stays readable at small sizes */
  --display: "BN Romaine", "Inter", Georgia, serif;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --gutter: clamp(16px, 4vw, 40px);
  --measure: 41rem;
  --wide: 65rem;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 1.0625rem/1.7 var(--sans);
  font-feature-settings: "kern", "liga", "calt";
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-wrap: break-word;
}
@media (min-width: 720px) { body { font-size: 1.125rem; } }
img, picture, video, iframe { display: block; max-width: 100%; height: auto; }
::selection { background: var(--red); color: #fff; }
:focus-visible { outline: 2px solid var(--red-text); outline-offset: 3px; }
a { color: inherit; }

.skip { position: absolute; left: -9999px; top: 8px; background: var(--head); color: #000; padding: 8px 12px; z-index: 10; }
.skip:focus { left: 8px; }

/* ── header and footer ─────────────────────────────────── */
.site-header {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 18px var(--gutter);
  font-size: 0.875rem; line-height: 1; text-transform: uppercase; letter-spacing: -0.03em;
  color: var(--head);
}
.site-header a { text-decoration: none; }
.brand { display: inline-flex; gap: 0.6em; align-items: baseline; white-space: nowrap; }
.brand-sub { color: var(--muted); }
.site-nav { display: flex; gap: clamp(14px, 3vw, 36px); }
.site-nav a { color: var(--head); }
.site-header a:hover, .site-header a:focus-visible { color: var(--red-text); }
@media (max-width: 420px) { .brand-sub { display: none; } }

.preview-bar, .draft-banner {
  background: var(--red); color: #fff; text-align: center;
  font-size: 0.8125rem; letter-spacing: 0.04em; text-transform: uppercase; padding: 8px var(--gutter); margin: 0;
}
.draft-banner { margin-bottom: 2rem; }

.site-footer { margin-top: clamp(80px, 12vw, 160px); padding: 0 var(--gutter) 40px; text-align: center; }
.back {
  display: inline-block; text-decoration: none; text-transform: uppercase;
  font-size: clamp(1.5rem, 1rem + 2.6vw, 2.5rem); line-height: 1; letter-spacing: -0.02em;
  color: var(--muted); transition: color 0.2s ease;
}
.back:hover, .back:focus-visible { color: var(--head); }
.foot-meta {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 20px; margin-top: 40px;
  font-size: 0.75rem; letter-spacing: 0.04em; text-transform: uppercase; color: var(--faint);
}
.foot-meta a { text-decoration: none; color: var(--muted); }
.foot-meta a:hover { color: var(--head); }

/* ── home and list pages ───────────────────────────────── */
.masthead, .list-head { padding: clamp(40px, 8vw, 110px) var(--gutter) clamp(32px, 5vw, 64px); max-width: calc(var(--wide) + 2 * var(--gutter)); margin: 0 auto; }
.masthead--small { padding-bottom: 0; }
.eyebrow { margin: 0 0 0.75rem; font-size: 0.8125rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.eyebrow a { text-decoration: none; }
.eyebrow a:hover { color: var(--head); }
.display {
  margin: 0; font: 400 clamp(4rem, 1.6rem + 13vw, 10.5rem)/0.86 var(--display);
  text-transform: uppercase; letter-spacing: -0.01em; color: var(--red);
}
.lede { max-width: 34rem; margin: 1.5rem 0 0; color: var(--muted); font-size: 1.0625rem; line-height: 1.55; text-wrap: pretty; }
.list-title { margin: 0; font: 400 clamp(2.75rem, 1.6rem + 6vw, 5.5rem)/0.9 var(--display); text-transform: uppercase; color: var(--red); text-wrap: balance; }
.list-sub { margin: 0.9rem 0 0; color: var(--muted); font-size: 0.875rem; letter-spacing: 0.04em; text-transform: uppercase; }
.empty { padding: 0 var(--gutter); max-width: calc(var(--wide) + 2 * var(--gutter)); margin: 0 auto; color: var(--muted); }

.post-list { max-width: calc(var(--wide) + 2 * var(--gutter)); margin: 0 auto; padding: 0 var(--gutter); }
.card-meta { display: flex; flex-wrap: wrap; gap: 4px 14px; margin: 0 0 0.6rem; font-size: 0.75rem; line-height: 1.4; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.card-meta .is-draft { color: var(--red-text); }
.card-summary { margin: 0.75rem 0 0; color: var(--muted); font-size: 1rem; line-height: 1.55; max-width: 38rem; text-wrap: pretty; }

.featured { margin-bottom: clamp(40px, 6vw, 72px); }
.featured-link, .row-link { display: block; text-decoration: none; color: inherit; }
.featured-media { aspect-ratio: 16 / 9; overflow: hidden; background: var(--surface); margin-bottom: 1.5rem; }
.featured-media img, .row-media img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.6s ease; }
.featured-title, .row-title {
  margin: 0; color: var(--head); text-transform: uppercase; font-weight: 400; text-wrap: balance;
  transition: color 0.2s ease;
}
.featured-title { font-size: clamp(2rem, 1.2rem + 3.6vw, 3.75rem); line-height: 0.98; letter-spacing: -0.035em; }
.row { border-top: 1px solid var(--rule); }
.row-link { display: grid; gap: 18px; padding: 28px 0; }
.row-title { font-size: clamp(1.5rem, 1.1rem + 1.9vw, 2.5rem); line-height: 1; letter-spacing: -0.035em; }
.row-media { aspect-ratio: 16 / 10; overflow: hidden; background: var(--surface); order: -1; }
@media (min-width: 760px) {
  .row-link { grid-template-columns: 1fr 320px; gap: 40px; align-items: start; }
  .row-media { order: 0; }
}
.featured-link:hover .featured-title, .row-link:hover .row-title,
.featured-link:focus-visible .featured-title, .row-link:focus-visible .row-title { color: var(--red-text); }
.featured-link:hover img, .row-link:hover img { transform: scale(1.025); }

.pager { display: flex; justify-content: space-between; max-width: calc(var(--wide) + 2 * var(--gutter)); margin: 48px auto 0; padding: 24px var(--gutter) 0; border-top: 1px solid var(--rule); font-size: 0.875rem; letter-spacing: 0.04em; text-transform: uppercase; }
.pager a { text-decoration: none; }
.pager a:hover { color: var(--red-text); }

.index-list, .series-list { list-style: none; margin: 0 auto; padding: 0 var(--gutter); max-width: calc(var(--wide) + 2 * var(--gutter)); }
.index-list li, .series-list li { border-top: 1px solid var(--rule); }
.index-list a, .series-list a { display: flex; align-items: baseline; gap: 16px; padding: 18px 0; text-decoration: none; }
.index-name, .series-title { flex: 1; color: var(--head); text-transform: uppercase; font-size: clamp(1.25rem, 1rem + 1.4vw, 2rem); line-height: 1.05; letter-spacing: -0.03em; }
.index-count, .series-list time { color: var(--muted); font-size: 0.8125rem; letter-spacing: 0.04em; text-transform: uppercase; white-space: nowrap; }
.series-num { min-width: 2ch; color: var(--red-text); font-size: 0.875rem; font-variant-numeric: tabular-nums; }
.index-list a:hover .index-name, .series-list a:hover .series-title { color: var(--red-text); }

/* ── a post ────────────────────────────────────────────── */
.post { position: relative; }
/* The header shares the reading column's grid, so the title lines up with
   the text and can still run wider to the right. */
.post-head, .prose {
  display: grid;
  grid-template-columns:
    [full-start] minmax(var(--gutter), 1fr)
    [wide-start] minmax(0, calc((var(--wide) - var(--measure)) / 2))
    [content-start] min(var(--measure), 100% - 2 * var(--gutter))
    [content-end] minmax(0, calc((var(--wide) - var(--measure)) / 2))
    [wide-end] minmax(var(--gutter), 1fr) [full-end];
}
.post-head { padding: clamp(36px, 7vw, 96px) 0 clamp(28px, 4vw, 56px); }
.post-head > * { grid-column: content; }
.post-head > .post-title { grid-column: content-start / wide-end; }
.series-label {
  display: inline-block; margin-bottom: 1rem; text-decoration: none;
  font-size: 0.8125rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--red-text);
}
.series-label span { color: var(--muted); }
.series-label:hover span { color: var(--head); }
.post-title {
  margin: 0; max-width: 16ch;
  font: 400 clamp(2.75rem, 1.4rem + 7vw, 6.5rem)/0.9 var(--display);
  text-transform: uppercase; letter-spacing: -0.01em; color: var(--red); text-wrap: balance;
}
.post-meta { display: flex; flex-wrap: wrap; gap: 4px 18px; margin: 1.5rem 0 0; font-size: 0.8125rem; letter-spacing: 0.05em; text-transform: uppercase; color: var(--muted); }
.tag-list { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; margin: 1.25rem 0 0; padding: 0; }
.tag-list a {
  display: inline-block; padding: 5px 12px 4px; border: 1px solid var(--rule); border-radius: 999px;
  font-size: 0.75rem; line-height: 1.3; letter-spacing: 0.05em; text-transform: uppercase; text-decoration: none; color: var(--muted);
}
.tag-list a:hover, .tag-list a:focus-visible { color: var(--head); border-color: var(--head); }

/* Wide screens: the series name runs up the left edge, like the
   STORYBOARD and PROCESS labels on the portfolio pages. */
@media (min-width: 1240px) {
  .post-head > .series-label {
    grid-column: wide-start / content-start; grid-row: 1 / span 3; justify-self: end; align-self: start;
    margin: 0.4rem 2.5rem 0 0; writing-mode: vertical-rl; transform: rotate(180deg);
    font-family: var(--display); font-size: 1.5rem; letter-spacing: 0.02em; color: var(--red);
  }
  .series-label span { font-family: var(--sans); font-size: 0.75rem; letter-spacing: 0.06em; margin-top: 0.5em; }
}

/* The reading column, with figures allowed to run wider. */
.prose > * { grid-column: content; margin-top: 0; margin-bottom: 1.25em; }
.prose > .figure, .prose > .embed, .prose > .table-wrap { grid-column: wide; }
.prose > .figure, .prose > .embed { margin: 2.25em 0; }
.prose > .epigraph + h2 { margin-top: 1.2em; }
@media (max-width: 719px) {
  .prose > .figure, .prose > .embed { grid-column: full; }
  .prose > .figure figcaption, .prose > .embed figcaption { padding: 0 var(--gutter); }
}

.prose p { text-wrap: pretty; }
.prose strong { font-weight: 650; color: var(--head); }
.prose a {
  text-decoration: underline; text-decoration-color: var(--red); text-decoration-thickness: 1px;
  text-underline-offset: 0.2em; transition: color 0.15s ease, text-decoration-thickness 0.15s ease;
}
.prose a:hover { color: #fff; text-decoration-thickness: 2px; }

.prose h2 {
  margin: 2.2em 0 0.55em; font: 400 clamp(1.9rem, 1.3rem + 2.4vw, 2.75rem)/1 var(--display);
  text-transform: uppercase; letter-spacing: -0.005em; color: var(--red); text-wrap: balance;
}
.prose h3 { margin: 2em 0 0.5em; font-size: 1.3rem; line-height: 1.25; font-weight: 600; letter-spacing: -0.015em; color: var(--head); text-wrap: balance; }
.prose h4 { margin: 1.8em 0 0.5em; font-size: 0.875rem; line-height: 1.4; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--head); }
.prose h5, .prose h6 { margin: 1.6em 0 0.4em; font-size: 1rem; font-weight: 600; color: var(--head); }
.prose > :is(h2, h3, h4, h5, h6):first-child { margin-top: 0; }
.prose :is(h2, h3, h4) { scroll-margin-top: 24px; }

.prose ul, .prose ol { padding-left: 1.3em; }
.prose li { margin: 0.4em 0; padding-left: 0.2em; }
.prose li > ul, .prose li > ol { margin: 0.4em 0 0; }
.prose li::marker { color: var(--red-text); }
.prose ol > li::marker { font-variant-numeric: tabular-nums; font-size: 0.9em; }

.prose hr { grid-column: content; width: 48px; height: 2px; border: 0; background: var(--red); margin: 3em auto; }
.prose code { font-family: var(--mono); font-size: 0.86em; background: var(--surface); border: 1px solid var(--rule); border-radius: 3px; padding: 0.08em 0.35em; }
.prose sup, .prose sub { line-height: 0; }

/* Epigraph: a whakataukī or quote with its source. */
.epigraph { margin: 0 0 2.5em; padding-left: 1.25rem; border-left: 2px solid var(--red); }
.epigraph blockquote { margin: 0; }
.epigraph blockquote p { margin: 0; font-size: clamp(1.25rem, 1.05rem + 0.8vw, 1.6rem); line-height: 1.35; font-weight: 300; letter-spacing: -0.015em; color: var(--head); text-wrap: balance; }
.epigraph figcaption { margin-top: 0.9rem; font-size: 0.75rem; line-height: 1.5; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }

/* Images, captions and credits. */
.figure img { width: 100%; background: var(--surface); }
.figure figcaption { max-width: var(--measure); margin-top: 0.85rem; }
.figure .caption { display: block; font-size: 0.875rem; line-height: 1.5; color: var(--muted); text-wrap: pretty; }
.figure .credit { display: block; margin-top: 0.3rem; font-size: 0.6875rem; line-height: 1.45; letter-spacing: 0.06em; text-transform: uppercase; color: var(--faint); }
.figure .credit a, .figure .caption a { color: inherit; }
.gallery { display: grid; gap: 8px; grid-template-columns: repeat(2, 1fr); }
.gallery--3 { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 559px) { .gallery--3 { grid-template-columns: 1fr 1fr; } }
.gallery img { height: 100%; object-fit: cover; }

.embed-frame { position: relative; aspect-ratio: 16 / 9; background: var(--surface); }
.embed-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.embed figcaption { margin-top: 0.75rem; font-size: 0.8125rem; color: var(--muted); }

/* Tables scroll sideways on phones instead of squashing. */
.table-wrap { overflow-x: auto; margin: 1.5em 0 2em; -webkit-overflow-scrolling: touch; }
.table-wrap table { width: 100%; border-collapse: collapse; font-size: 0.9375rem; line-height: 1.45; font-variant-numeric: tabular-nums; }
.table-wrap th { text-align: left; vertical-align: bottom; padding: 0 1.25rem 0.6rem 0; border-bottom: 1px solid var(--head); font-size: 0.6875rem; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--head); }
.table-wrap td { vertical-align: top; padding: 0.7rem 1.25rem 0.7rem 0; border-bottom: 1px solid var(--rule); }
.table-wrap td p { margin: 0 0 0.5em; }
.table-wrap td > :last-child { margin-bottom: 0; }

.fn-ref a { text-decoration: none; color: var(--red-text); font-size: 0.75em; padding: 0 0.1em; }
.footnotes { grid-column: content; margin-top: 3em; padding-top: 1.5em; border-top: 1px solid var(--rule); font-size: 0.875rem; line-height: 1.6; color: var(--muted); }
.prose .footnotes-title { margin: 0 0 1em; font: 600 0.75rem/1 var(--sans); letter-spacing: 0.06em; text-transform: uppercase; color: var(--head); }
.footnotes ol { padding-left: 1.2em; margin: 0; }
.fn-back { text-decoration: none !important; }

/* Series navigation and comments. */
.series-nav, .comments { max-width: calc(var(--measure) + 2 * var(--gutter)); margin: clamp(56px, 8vw, 96px) auto 0; padding: 0 var(--gutter); }
.series-nav-label { margin: 0 0 1rem; font-size: 0.75rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.series-nav-label a { color: var(--red-text); text-decoration: none; }
.series-nav-links { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; border-top: 1px solid var(--rule); padding-top: 1.25rem; }
.series-nav-links a { text-decoration: none; color: var(--head); text-transform: uppercase; font-size: 1.125rem; line-height: 1.1; letter-spacing: -0.02em; }
.series-nav-links a span { display: block; margin-bottom: 0.4rem; font-size: 0.6875rem; letter-spacing: 0.06em; color: var(--muted); }
.series-nav-links .next { text-align: right; grid-column: 2; }
.series-nav-links a:hover { color: var(--red-text); }
.comments-title { margin: 0 0 1.5rem; font-size: 0.75rem; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--head); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; }
}
@media print {
  body { background: #fff; color: #000; }
  .site-header, .site-footer, .comments, .series-nav { display: none; }
  .post-title, .prose h2 { color: #000; }
}
