/* ==========================================================================
   The publication's stylesheet: cream paper, red accents and charcoal ink, with tall uppercase headings (Anton),
   Open Sans for reading, Oswald for small labels and Playfair Display italic for accent words.
   Light and dark themes; edit the tokens to restyle everything.
   ========================================================================== */

/* Fonts are served from this site (SIL Open Font License, see fonts/licenses/): no outside requests. */
@font-face { font-family: "Anton"; src: url("../fonts/anton.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Open Sans"; src: url("../fonts/open-sans.woff2") format("woff2"); font-weight: 400 800; font-style: normal; font-display: swap; }
@font-face { font-family: "Open Sans"; src: url("../fonts/open-sans-italic.woff2") format("woff2"); font-weight: 400 800; font-style: italic; font-display: swap; }
@font-face { font-family: "Oswald"; src: url("../fonts/oswald.woff2") format("woff2"); font-weight: 400 700; font-style: normal; font-display: swap; }
@font-face { font-family: "Playfair Display"; src: url("../fonts/playfair-italic.woff2") format("woff2"); font-weight: 400 700; font-style: italic; font-display: swap; }
@font-face { font-family: "Playfair Display"; src: url("../fonts/playfair.woff2") format("woff2"); font-weight: 400 700; font-style: normal; font-display: swap; }
@font-face { font-family: "JetBrains Mono"; src: url("../fonts/jetbrains-mono.woff2") format("woff2"); font-weight: 100 800; font-style: normal; font-display: swap; }
/* Capitals only, for the wordmark: every weight and width of Archivo in 16 KB. */
@font-face { font-family: "Archivo"; src: url("../fonts/archivo-caps.woff2") format("woff2"); font-weight: 100 900; font-stretch: 62% 125%; font-style: normal;
  font-display: swap; unicode-range: U+20, U+26-27, U+2D-2E, U+41-5A; }

:root {
  --font-display: "Anton", Impact, "Arial Narrow", "Helvetica Neue", Arial, sans-serif;
  --font-sans: "Open Sans", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-label: "Oswald", "Arial Narrow", "Helvetica Neue", Arial, sans-serif;
  --font-accent: "Playfair Display", Georgia, "Times New Roman", serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --bg: #fffae7;              /* cream paper */
  --surface: #ffffff;         /* cards */
  --surface-2: #f6eed2;       /* warm beige */
  --ink: #2f2d2d;             /* charcoal */
  --ink-2: #4f4c49;
  --muted: #6b6762;
  --line: #e6e1d1;
  --line-strong: #d1cdbe;
  --accent: #d02e2e;          /* red for links, labels and borders */
  --accent-hover: #b82828;
  --accent-strong: #b82828;   /* red for small text on tinted backgrounds */
  --accent-fill: #d02e2e;     /* red behind buttons and title cards */
  --accent-fill-hover: #b82828;
  --accent-ink: #fffae7;      /* text on red */
  --accent-soft: #fbe8dc;
  --orange: #d06e2e;
  --gold: #9c4c17;            /* orange, deepened for text */
  --gold-soft: #fbead9;
  --red: #b82828;
  --red-soft: #fadfd8;
  --code-bg: #2f2d2d;
  --code-head: #d02e2e;
  --code-ink: #fffae7;
  --header-bg: #fffae7;
  --header-line: rgba(208, 46, 46, .16);
  --footer-bg: #21110e;
  --glow-a: rgba(208, 46, 46, .16);
  --glow-b: rgba(208, 110, 46, .12);

  --radius: 14px;
  --radius-sm: 12px;
  --shadow: 0 1px 2px rgba(47, 45, 45, .05), 0 16px 50px rgba(47, 45, 45, .10);
  --shadow-sm: 0 1px 2px rgba(47, 45, 45, .06), 0 8px 24px rgba(47, 45, 45, .07);
  --glow: 0 0 0 1px rgba(208, 46, 46, .25), 0 18px 60px rgba(208, 46, 46, .14);
  --container: 1160px;
  --reading: 700px;
  --gutter: 24px;
  --header: 68px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #1a1210; --surface: #241a17; --surface-2: #2e2420; --ink: #fffae7; --ink-2: #e8dfca; --muted: #b5aa97;
    --line: #3b2f2a; --line-strong: #54443d; --accent: #ff6b5e; --accent-hover: #ff8b80; --accent-strong: #ff8b80;
    --accent-fill: #d02e2e; --accent-fill-hover: #e03b3b; --accent-ink: #fffae7; --accent-soft: #3a1d19;
    --gold: #f0a066; --gold-soft: #33241a; --red: #ff8a7d; --red-soft: #3a1a17; --code-bg: #120b09;
    --header-bg: #1a1210; --header-line: rgba(255, 107, 94, .18); --footer-bg: #120b09;
    --glow-a: rgba(208, 46, 46, .24); --glow-b: rgba(208, 110, 46, .12);
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 16px 50px rgba(0, 0, 0, .35);
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .25);
    --glow: 0 0 0 1px rgba(255, 107, 94, .35), 0 18px 60px rgba(208, 46, 46, .25);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #1a1210; --surface: #241a17; --surface-2: #2e2420; --ink: #fffae7; --ink-2: #e8dfca; --muted: #b5aa97;
  --line: #3b2f2a; --line-strong: #54443d; --accent: #ff6b5e; --accent-hover: #ff8b80; --accent-strong: #ff8b80;
  --accent-fill: #d02e2e; --accent-fill-hover: #e03b3b; --accent-ink: #fffae7; --accent-soft: #3a1d19;
  --gold: #f0a066; --gold-soft: #33241a; --red: #ff8a7d; --red-soft: #3a1a17; --code-bg: #120b09;
  --header-bg: #1a1210; --header-line: rgba(255, 107, 94, .18); --footer-bg: #120b09;
  --glow-a: rgba(208, 46, 46, .24); --glow-b: rgba(208, 110, 46, .12);
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 16px 50px rgba(0, 0, 0, .35);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .25);
  --glow: 0 0 0 1px rgba(255, 107, 94, .35), 0 18px 60px rgba(208, 46, 46, .25);
  color-scheme: dark;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: calc(var(--header) + 16px); }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } *, *::before, *::after { transition: none !important; animation: none !important; } }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--font-sans); font-size: 17px; line-height: 1.7;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; overflow-x: hidden; font-synthesis: none; }
::selection { background: rgba(208, 46, 46, .2); }
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--accent); }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 6px; }
h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 400; line-height: 1.02; letter-spacing: .005em; text-transform: uppercase;
  margin: 0 0 .5em; text-wrap: balance; }
h1 { font-size: clamp(2.4rem, 5.6vw, 4.2rem); line-height: .98; }
h2 { font-size: clamp(1.7rem, 3.2vw, 2.5rem); }
h3 { font-size: 1.35rem; line-height: 1.08; }
h1 em, h2 em, h3 em, .accent { font-family: var(--font-accent); font-style: italic; font-weight: 500; text-transform: none; letter-spacing: 0; color: var(--accent); }
p { margin: 0 0 1em; }
.icon { width: 20px; height: 20px; fill: currentColor; flex: none; }
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip-link { position: absolute; left: 16px; top: -60px; z-index: 100; background: var(--accent-fill); color: var(--accent-ink); padding: 10px 16px; border-radius: 999px; font-weight: 700; text-decoration: none; }
.skip-link:focus { top: 12px; }
.container { width: 100%; max-width: calc(var(--container) + var(--gutter) * 2); margin: 0 auto;
  padding-left: max(var(--gutter), env(safe-area-inset-left, 0px)); padding-right: max(var(--gutter), env(safe-area-inset-right, 0px)); }
.narrow { max-width: calc(var(--reading) + var(--gutter) * 2); }
@media (max-width: 640px) { :root { --gutter: 16px; } body { font-size: 16px; } }

/* A soft red glow across the top of every page, like light on paper. */
main { position: relative; isolation: isolate; }
main::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 560px; z-index: -1; pointer-events: none;
  background: radial-gradient(120% 80% at 50% 0%, var(--glow-a) 0%, transparent 60%); }

/* ---------- Header ---------- */
body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 60; background: var(--header-bg); }
.site-header { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 50; background: var(--header-bg); border-bottom: 1px solid var(--header-line); color: var(--ink); }
.site-header .container { display: flex; align-items: center; justify-content: space-between; gap: 16px; height: var(--header); }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font-family: var(--font-display); font-weight: 400; font-size: 1.3rem;
  letter-spacing: .03em; text-transform: uppercase; color: var(--accent); white-space: nowrap; }
.brand:hover { color: var(--accent-hover); }
.brand img { width: 34px; height: 34px; border-radius: 50%; object-fit: cover; box-shadow: 0 0 0 2px var(--accent-fill); }
/* The wordmark, drawn like the logo files: a small "AI with" (bold, then light) beside the name set wide and heavy. */
.wordmark { display: inline-flex; align-items: center; gap: .1em; font-family: "Archivo", var(--font-sans); font-size: 1.5rem; line-height: 1;
  letter-spacing: 0; text-transform: uppercase; white-space: nowrap; }
.wm-lead { font-size: max(.38em, 8px); font-weight: 300; letter-spacing: -.01em; transform: translateY(2%); }
.wm-lead b { font-weight: 800; }
.wm-name { font-weight: 900; font-stretch: 112%; letter-spacing: -.04em; }
/* In the header, the name's capitals are as tall as on the reference page's logo: 12.7% of a logo drawn
   clamp(188px, 15vw, 220px) wide, 174px on phones. Archivo's capitals are .7125em, so the font size is 17.8% of that. */
.site-header .wordmark { font-size: clamp(33.5px, 2.67vw, 39.2px); }
@media (max-width: 760px) { .site-header .wordmark { font-size: 31px; } }
/* Phones: the name stays on one line, as large as fits beside the menu button (the light/dark switch moves into the
   menu). It is 11.4 times as wide as its font size. */
.nav .nav-theme { display: none; }
@media (max-width: 540px) {
  .site-header .wordmark { font-size: min(31px, calc((100vw - 2 * var(--gutter) - 56px) / 11.5)); }
  .header-actions .theme-toggle { display: none; }
  .nav .nav-theme { display: inline-flex; align-items: center; gap: 10px; margin-top: 6px; padding: 13px 16px; border: 0; border-radius: 999px;
    background: transparent; color: var(--ink); font: 700 .9rem/1.2 var(--font-sans); letter-spacing: .105em; text-transform: uppercase; cursor: pointer; text-align: left; }
  .nav .nav-theme:hover { color: var(--accent); }
}
.nav { display: flex; align-items: center; gap: 2px; }
.nav a { color: var(--ink); text-decoration: none; font: 700 .76rem/1.2 var(--font-sans); letter-spacing: .105em; text-transform: uppercase;
  padding: 10px 12px; border-radius: 999px; white-space: nowrap; }
.nav a:hover { color: var(--accent); }
.nav a[aria-current="page"] { color: var(--accent); background: var(--accent-soft); }
.nav .nav-cta { color: var(--accent-ink); background: var(--accent-fill); margin-left: 8px; padding: 11px 20px; font: 400 .86rem/1.1 var(--font-display);
  letter-spacing: .09em; box-shadow: 0 8px 22px rgba(208, 46, 46, .28); transition: background .2s, transform .2s; }
.nav .nav-cta:hover { color: var(--accent-ink); background: var(--accent-fill-hover); transform: translateY(-1px); }
.header-actions { display: flex; align-items: center; gap: 6px; }
.icon-btn { display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 999px; border: 1px solid var(--line-strong); background: transparent; color: var(--ink); cursor: pointer; }
.icon-btn:hover { border-color: var(--accent); color: var(--accent); }
.theme-toggle .i-moon { display: none; }
:root[data-theme="dark"] .theme-toggle .i-sun { display: none; }
:root[data-theme="dark"] .theme-toggle .i-moon { display: block; }
.menu-toggle { display: none; }
@media (max-width: 1100px) {
  .menu-toggle { display: inline-grid; }
  .nav { position: fixed; inset: var(--header) 0 auto 0; flex-direction: column; align-items: stretch; gap: 2px; background: var(--header-bg);
    border-bottom: 1px solid var(--header-line); box-shadow: 0 18px 40px rgba(47, 45, 45, .12); padding: 12px 16px 20px; transform: translateY(-8px); opacity: 0; visibility: hidden;
    transition: opacity .2s, transform .2s, visibility .2s; }
  .nav a { padding: 13px 16px; font-size: .9rem; }
  .nav .nav-cta { margin: 8px 0 0; text-align: center; font-size: 1rem; padding: 14px 20px; }
  .nav-open .nav { transform: none; opacity: 1; visibility: visible; }
  .menu-toggle .i-close { display: none; }
  .nav-open .menu-toggle .i-close { display: block; }
  .nav-open .menu-toggle .i-menu { display: none; }
}
.progress { position: fixed; top: calc(env(safe-area-inset-top, 0px) + var(--header)); left: 0; height: 3px; width: 0; background: var(--accent-fill); z-index: 51; }

/* ---------- Buttons, chips ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 12px 26px; border-radius: 999px;
  font: 400 1rem/1.1 var(--font-display); letter-spacing: .07em; text-transform: uppercase; text-decoration: none; border: 2px solid transparent; cursor: pointer;
  transition: background .2s, color .2s, border-color .2s, transform .16s, box-shadow .2s; }
.btn:hover { transform: translateY(-2px); }
.btn .icon { width: 18px; height: 18px; }
.btn-primary { background: var(--accent-fill); color: var(--accent-ink); box-shadow: 0 12px 34px rgba(208, 46, 46, .30); }
.btn-primary:hover { background: var(--accent-fill-hover); color: var(--accent-ink); box-shadow: 0 16px 44px rgba(208, 46, 46, .42); }
.btn-ghost { border-color: var(--line-strong); color: var(--ink); background: transparent; }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }
.btn-small { min-height: 38px; padding: 8px 16px; font-size: .86rem; }
.on-night .btn-primary { background: var(--accent-fill); color: var(--accent-ink); }
.on-night .btn-ghost { border-color: var(--line-strong); color: var(--ink); }
.on-night .btn-ghost:hover { border-color: var(--accent); color: var(--accent); }
.tag { display: inline-block; font: 700 .76rem/1.3 var(--font-label); letter-spacing: .14em; text-transform: uppercase; color: var(--accent-strong);
  background: var(--accent-soft); padding: 4px 11px; border-radius: 999px; text-decoration: none; }
.tag:hover { color: var(--accent-strong); filter: brightness(.97); }
.chip { display: inline-flex; align-items: center; gap: 6px; font-size: .88rem; font-weight: 600; padding: 7px 15px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--line-strong); color: var(--ink-2); cursor: pointer; text-decoration: none; }
.chip:hover { border-color: var(--accent); color: var(--accent); }
.chip[aria-pressed="true"] { border-color: var(--accent-fill); background: var(--accent-fill); color: var(--accent-ink); }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; font: 700 .8rem/1.3 var(--font-label); letter-spacing: .22em; text-transform: uppercase; color: var(--accent); margin: 0 0 14px; }
.on-night .eyebrow { color: var(--accent); }
.meta { color: var(--muted); font-size: .9rem; }
.meta .dot::before { content: "·"; margin: 0 6px; }

/* ---------- Hero (home, subscribe) ---------- */
.hero { position: relative; background: transparent; color: var(--ink); overflow: hidden; isolation: isolate; border-bottom: 1px solid var(--line); }
.hero::before { content: ""; position: absolute; inset: 0; z-index: -1;
  background: radial-gradient(90% 70% at 12% 30%, var(--glow-a) 0%, transparent 55%), radial-gradient(60% 70% at 92% 8%, var(--glow-b) 0%, transparent 60%); }
.hero .container { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, .7fr); gap: 32px; align-items: center; padding-top: 21px; padding-bottom: 64px; }
.hero h1 { color: var(--ink); margin-bottom: 16px; font-size: clamp(2.6rem, 6vw, 4.8rem); line-height: .95; }
.hero .eyebrow { border: 1px solid var(--line-strong); border-radius: 999px; padding: 7px 14px; font-size: .74rem; letter-spacing: .2em; margin-bottom: 20px; background: var(--surface); }
.hero .lead { font-size: clamp(1.08rem, 1.5vw, 1.25rem); color: var(--ink-2); max-width: 34em; margin-bottom: 26px; }
.hero-author { display: flex; align-items: center; gap: 14px; color: var(--muted); font-size: .95rem; }
.hero-author img { width: 52px; height: 52px; border-radius: 50%; object-fit: cover; border: 2px solid var(--accent-fill); }
.hero-author strong { display: block; color: var(--ink); font-weight: 700; }
.hero-side { justify-self: end; width: 100%; max-width: 360px; }
.hero-side img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 24px; border: 0; box-shadow: var(--shadow), 0 0 0 6px var(--surface); }
.hero-side img.hero-photo { aspect-ratio: auto; height: auto; }
/* The subscribe page's headline, drawn like the LEARN AI With MOJEED logo: wide heavy capitals with a small italic
   serif join, on one line. It may run wider than the text column, and is 4/5 of the size that would fill the
   page width (the line is 17.9 times as wide as its font size). */
.hero h1.sub-wordmark { font-family: "Archivo", var(--font-sans); font-weight: 900; font-stretch: 112%; letter-spacing: -.04em; text-transform: uppercase;
  line-height: 1; color: var(--ink); white-space: nowrap; width: max-content; position: relative; left: 50%; transform: translateX(-50%);
  font-size: min(58px, calc((min(100vw, 1208px) - 2 * var(--gutter)) / 22.4)); }   /* 4/5 of the widest that fits */
.sub-wordmark .ln { display: inline; }
.sub-wordmark .join { font-family: var(--font-accent); font-style: italic; font-weight: 500; font-stretch: normal; letter-spacing: 0; text-transform: none; font-size: 1.12em; color: var(--ink); }   /* a photo set in site.json keeps its own shape */
@media (max-width: 860px) { .hero .container { grid-template-columns: 1fr; padding-top: 15px; padding-bottom: 44px; } .hero-side { display: none; } }
/* Phones and small tablets: the home page photo comes first, full width under the header, fading into the page,
   and the headline starts over its faded foot (as on the reference page). */
@media (max-width: 860px) {
  .hero-home .container { padding-top: 0; row-gap: 0; }
  .hero-home .hero-side:has(.hero-photo) { display: block; order: -1; justify-self: stretch; max-width: none; width: auto;
    margin: 0 calc(-1 * max(var(--gutter), env(safe-area-inset-right, 0px))) 0 calc(-1 * max(var(--gutter), env(safe-area-inset-left, 0px))); }
  .hero-home .hero-side img.hero-photo { width: 100%; height: min(124vw, 540px); object-fit: cover; object-position: 50% 12%; border-radius: 0; box-shadow: none;
    -webkit-mask-image: linear-gradient(to bottom, #000 58%, transparent 100%); mask-image: linear-gradient(to bottom, #000 58%, transparent 100%); }
  .hero-home .container:has(.hero-photo) > div:first-child { position: relative; z-index: 1; margin-top: -54px; }
}

/* ---------- Subscribe box ---------- */
.subscribe { background: var(--surface); border: 1px solid var(--line); border-top: 5px solid var(--accent-fill); border-radius: var(--radius); padding: 26px; box-shadow: var(--shadow); margin: 2em 0; }
.subscribe h2, .subscribe .subscribe-title { font: 400 1.6rem/1.05 var(--font-display); letter-spacing: .01em; text-transform: uppercase; margin: 0 0 8px; color: var(--ink); }
.subscribe p { color: var(--ink-2); margin-bottom: 16px; }
.subscribe-form { display: flex; flex-wrap: wrap; gap: 10px; }
.subscribe-form input[type="email"] { flex: 1 1 220px; min-height: 48px; padding: 10px 18px; border-radius: 999px; border: 1px solid var(--line-strong);
  background: var(--bg); color: var(--ink); font: 500 1rem var(--font-sans); }
.subscribe-form input[type="email"]:focus { outline: 3px solid var(--accent-soft); border-color: var(--accent); }
.subscribe-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.subscribe .fine { font-size: .82rem; color: var(--muted); margin: 12px 0 0; }
.subscribe iframe { width: 100%; border: 0; min-height: 150px; background: transparent; }
.on-night .subscribe, .hero .subscribe { background: var(--surface); border-color: var(--line); border-top-color: var(--accent-fill); box-shadow: var(--shadow); }
.hero .subscribe p, .hero .subscribe .fine { color: var(--ink-2); }
.hero .subscribe .fine { color: var(--muted); }
.hero .subscribe-form input[type="email"] { background: var(--bg); border-color: var(--line-strong); color: var(--ink); }

/* ---------- Sections ---------- */
.section { padding: 56px 0; }
.section + .section { padding-top: 8px; }
.section-head { display: flex; align-items: end; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.section-head h2 { margin: 0; font-size: clamp(1.7rem, 3vw, 2.4rem); }
.section-head a { font: 700 .8rem/1.3 var(--font-label); letter-spacing: .16em; text-transform: uppercase; text-decoration: none; color: var(--accent); }
.section-head a:hover { color: var(--accent-hover); }

/* ---------- Cards and lists of posts ---------- */
.grid { display: grid; gap: 20px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); }
.card { position: relative; display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; box-shadow: var(--shadow-sm); transition: box-shadow .25s, border-color .25s, transform .25s; text-decoration: none; color: var(--ink); }
.card:hover { color: var(--ink); border-color: transparent; box-shadow: var(--glow); transform: translateY(-3px); }
.card-body { display: flex; flex-direction: column; gap: 8px; padding: 18px 20px 20px; flex: 1; }
.card h3 { margin: 0; font-size: 1.4rem; }
.card .tag { align-self: flex-start; }
.card p { margin: 0; color: var(--ink-2); font-size: .96rem; }
.card .meta { margin-top: auto; padding-top: 6px; }
.post-list { list-style: none; padding: 0; margin: 0; display: grid; }
.post-row { display: grid; grid-template-columns: minmax(0, 1fr) 168px; gap: 22px; align-items: center; padding: 22px 0; border-bottom: 1px solid var(--line-strong); }
.post-row:first-child { border-top: 1px solid var(--line-strong); }
.post-row a.title { text-decoration: none; color: var(--ink); }
.post-row a.title:hover { color: var(--accent); }
.post-row h3 { font-size: clamp(1.3rem, 2.2vw, 1.65rem); margin: 0 0 6px; }
.post-row p { margin: 0 0 6px; color: var(--ink-2); }
.post-row .thumb { display: block; border-radius: 10px; overflow: hidden; box-shadow: var(--shadow-sm); transition: transform .2s; }
.post-row .thumb:hover { transform: translateY(-2px); }
@media (max-width: 640px) { .post-row { grid-template-columns: minmax(0, 1fr) 96px; gap: 14px; } .post-row p.sub { display: none; } }

/* The drawn title card used when an item has no cover image: same proportions as a social image. */
.titlecard { position: relative; aspect-ratio: 1200 / 630; display: flex; flex-direction: column; justify-content: flex-end; padding: 7% 7.5%;
  background: var(--accent-fill); color: #fffae7; overflow: hidden; isolation: isolate; container-type: inline-size; }
.titlecard::before { content: ""; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(160deg, rgba(255, 255, 255, .06) 0%, rgba(255, 255, 255, 0) 45%, rgba(33, 17, 14, .22) 100%); }
.titlecard::after { content: ""; position: absolute; right: -14%; top: -34%; width: 58%; aspect-ratio: 1; border-radius: 50%; z-index: -1;
  background: radial-gradient(circle, rgba(208, 110, 46, .75), rgba(208, 110, 46, 0) 68%); }
.titlecard .tc-kicker { font: 700 clamp(.5rem, 3cqi, .85rem)/1.2 var(--font-label); letter-spacing: .2em; text-transform: uppercase; color: rgba(255, 250, 231, .9); margin-bottom: 3cqi; }
.titlecard .tc-title { font: 400 clamp(1rem, 8.4cqi, 3.9rem)/.98 var(--font-display); letter-spacing: .01em; text-transform: uppercase; text-wrap: balance; }
.titlecard .tc-foot { margin-top: 4cqi; font: 700 clamp(.45rem, 2.5cqi, .8rem)/1.2 var(--font-label); letter-spacing: .12em; text-transform: uppercase; color: rgba(255, 250, 231, .78); }
.titlecard.small .tc-title { font-size: clamp(.75rem, 10.5cqi, 1.7rem); }
.titlecard.small .tc-kicker, .titlecard.small .tc-foot { display: none; }
.cover-img { width: 100%; aspect-ratio: 1200 / 630; object-fit: cover; }

/* ---------- Article (issue and guide) ---------- */
.article-head { padding: 48px 0 8px; }
.article-head h1 { margin-bottom: 12px; }
.article-head .subtitle { font: italic 500 clamp(1.25rem, 2.3vw, 1.6rem)/1.35 var(--font-accent); color: var(--accent); margin: 0 0 24px; }
.byline { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding: 14px 0; border-top: 1px solid var(--line-strong); border-bottom: 1px solid var(--line-strong); }
.byline .who { display: flex; align-items: center; gap: 12px; }
.byline img { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; border: 2px solid var(--accent-fill); }
.byline .who strong { display: block; font-weight: 700; line-height: 1.25; }
.byline .who a { text-decoration: none; }
.share { display: flex; gap: 6px; flex-wrap: wrap; }
.share a, .share button { display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: 999px; border: 1px solid var(--line-strong);
  background: var(--surface); color: var(--ink-2); cursor: pointer; transition: background .2s, color .2s, border-color .2s; }
.share a:hover, .share button:hover { color: var(--accent-ink); background: var(--accent-fill); border-color: var(--accent-fill); }
.share .icon { width: 17px; height: 17px; }
.cover { margin: 26px 0 8px; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }

.prose { font-size: 1.1rem; line-height: 1.75; color: var(--ink); padding: 18px 0 8px; }
.prose > * + * { margin-top: 0; }
.prose p { margin: 0 0 1.05em; }
.prose h2 { font-size: clamp(1.75rem, 3.2vw, 2.4rem); margin: 1.6em 0 .55em; }
.prose h3 { font-size: 1.4rem; margin: 1.5em 0 .5em; }
.prose a { color: var(--accent); text-decoration-thickness: 1.5px; }
.prose a:hover { color: var(--accent-hover); }
.prose ul, .prose ol { padding-left: 1.4em; margin: 0 0 1.1em; }
.prose li { margin: .35em 0; padding-left: .2em; }
.prose ul > li::marker { color: var(--accent); }
.prose ol > li::marker { font-weight: 700; color: var(--accent); }
.prose strong { font-weight: 700; }
.prose code { font-family: var(--font-mono); font-size: .86em; background: var(--surface-2); color: var(--ink); padding: .12em .38em; border-radius: 6px; }
.prose hr { border: 0; height: 1px; background: var(--line-strong); margin: 2.4em 0; position: relative; overflow: visible; }
.prose hr::after { content: "✦"; position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); background: var(--bg); color: var(--accent); padding: 0 12px; font-size: .9rem; }
.prose blockquote { margin: 1.4em 0; padding: .2em 0 .2em 1.1em; border-left: 4px solid var(--accent-fill); color: var(--ink); font: italic 500 1.3em/1.45 var(--font-accent); }
.prose table { width: 100%; border-collapse: collapse; margin: 1.4em 0; font-size: .95rem; display: block; overflow-x: auto; }
.prose th, .prose td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.prose th { background: var(--surface-2); font: 700 .8rem/1.3 var(--font-label); letter-spacing: .12em; text-transform: uppercase; }
.prose .cta { margin: 1.4em 0; text-align: center; }
.prose .btn { text-decoration: none; }
.prose .btn-primary, .prose .btn-primary:hover { color: var(--accent-ink); }
.prose .btn-ghost { color: var(--ink); }
.prose .btn-ghost:hover { color: var(--accent); }
.figure { margin: 1.6em 0; }
.figure img { border-radius: var(--radius-sm); border: 1px solid var(--line); margin: 0 auto; }
.figure figcaption { text-align: center; color: var(--muted); font-size: .88rem; margin-top: 8px; }
.figure-missing .missing-shot { display: grid; gap: 6px; place-items: center; text-align: center; min-height: 180px; padding: 22px; border-radius: var(--radius-sm);
  border: 2px dashed var(--orange); background: var(--gold-soft); color: var(--ink-2); font-size: .95rem; }
.figure-missing strong { color: var(--gold); text-transform: uppercase; letter-spacing: .14em; font: 700 .78rem/1.3 var(--font-label); }

/* Prompts: a red label bar over a charcoal box, so "copy this" stands out from the reading text. */
.prompt, .codeblock { position: relative; margin: 1.5em 0; border-radius: var(--radius-sm); overflow: hidden; background: var(--code-bg); color: var(--code-ink); border: 0; box-shadow: var(--shadow-sm); }
.prompt-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 10px 8px 16px; background: var(--code-head);
  font: 700 .78rem/1.2 var(--font-label); letter-spacing: .16em; text-transform: uppercase; color: #fffae7; }
.prompt pre, .codeblock pre { margin: 0; padding: 16px 18px; overflow-x: auto; white-space: pre-wrap; word-break: break-word; }
.prompt code, .codeblock code { font: 400 .92rem/1.65 var(--font-mono); background: none; padding: 0; color: inherit; }
.copy-btn { border: 1px solid rgba(255, 250, 231, .55); background: transparent; color: #fffae7; border-radius: 999px; padding: 6px 13px; font: 700 .74rem/1 var(--font-label);
  letter-spacing: .12em; text-transform: uppercase; cursor: pointer; transition: background .2s, color .2s, border-color .2s; }
.copy-btn:hover { background: #fffae7; border-color: #fffae7; color: #b82828; }
.codeblock pre { padding-top: 54px; }
.codeblock::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 42px; background: rgba(255, 250, 231, .05); border-bottom: 1px solid rgba(255, 250, 231, .12); }
.codeblock .copy-btn { position: absolute; top: 8px; right: 10px; z-index: 1; background: #d02e2e; border-color: #d02e2e; }
.codeblock .copy-btn:hover { background: #fffae7; border-color: #fffae7; color: #b82828; }
.copy-btn.copied, .copy-btn.copied:hover { background: #fffae7; border-color: #fffae7; color: #2f2d2d; }

.callout { margin: 1.5em 0; padding: 16px 18px; border-radius: var(--radius-sm); border: 1px solid var(--line); border-left-width: 5px; background: var(--surface); }
.callout p:last-child { margin-bottom: 0; }
.callout-title { font: 700 .8rem/1.2 var(--font-label) !important; letter-spacing: .16em; text-transform: uppercase; margin: 0 0 6px !important; }
.callout-tip { background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 28%, transparent); border-left-color: var(--accent-fill); }
.callout-tip .callout-title { color: var(--accent-strong); }
.callout-note { background: var(--surface-2); border-color: var(--line-strong); border-left-color: var(--ink); }
.callout-note .callout-title { color: var(--ink-2); }
.callout-warning { background: var(--red-soft); border-color: color-mix(in srgb, var(--red) 30%, transparent); border-left-color: var(--red); }
.callout-warning .callout-title { color: var(--red); }
.callout-key { background: var(--gold-soft); border-color: color-mix(in srgb, var(--orange) 35%, transparent); border-left-color: var(--orange); }
.callout-key .callout-title { color: var(--gold); }

.contains-task-list { list-style: none; padding-left: 0 !important; }
.task-list-item { display: flex; gap: 12px; align-items: flex-start; padding: 10px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); box-shadow: 0 1px 2px rgba(47, 45, 45, .04); }
.task-list-item + .task-list-item { margin-top: 8px; }
.task-list-item input { width: 20px; height: 20px; margin-top: 4px; accent-color: var(--accent-fill); flex: none; cursor: pointer; }
.task-list-item.done { color: var(--muted); text-decoration: line-through; text-decoration-color: var(--line-strong); }

.embed-card { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 16px; align-items: center; margin: 1.6em 0; padding: 12px; border: 1px solid var(--line);
  border-radius: var(--radius-sm); background: var(--surface); text-decoration: none !important; color: var(--ink) !important; box-shadow: var(--shadow-sm); transition: box-shadow .2s, border-color .2s; }
.embed-card:hover { border-color: transparent; box-shadow: var(--glow); }
.embed-card .ec-title { display: block; font: 400 1.2rem/1.1 var(--font-display); letter-spacing: .01em; text-transform: uppercase; }
.embed-card .ec-sub { display: block; font-size: .9rem; color: var(--ink-2); margin-top: 4px; }
.embed-card .ec-kind { display: block; font: 700 .72rem/1.3 var(--font-label); letter-spacing: .16em; text-transform: uppercase; color: var(--accent); margin-bottom: 4px; }
.embed-card .titlecard { border-radius: 8px; }

.article-foot { padding: 10px 0 40px; }
.discuss { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; padding: 18px 20px; border-radius: var(--radius); background: var(--surface-2); margin: 24px 0; }
.discuss p { margin: 0; color: var(--ink-2); font-weight: 600; }
/* Previous and next: two plain links with arrows, as at the end of a Substack post. */
.prev-next { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin: 40px 0 8px; }
.prev-next a { display: inline-flex; align-items: center; gap: 12px; padding: 10px 4px; font: 700 1.1rem/1.2 var(--font-sans); color: var(--ink); text-decoration: none; }
.prev-next a:hover { color: var(--accent); }
.prev-next .next { margin-left: auto; }
.prev-next .icon { width: 24px; height: 24px; }

/* The ending of every issue and guide: the paid-subscription pitch, the subscribe form, then the paywall box. */
.paywall-end { margin-top: 8px; }
.pw-text { font-size: 1.12rem; line-height: 1.75; color: var(--ink); }
.pw-text p { margin: 0 0 1.05em; }
.pw-text a { color: var(--accent); }
.pw-form { margin: 4px 0 22px; }
.pw-form .substack-embed { display: block; width: 100%; height: 150px; border: 0; border-radius: 12px; background: #ffffff; }
.paywall { margin-top: 26px; padding: 50px 28px 46px; background: var(--accent-fill); color: #fffae7; text-align: center; box-shadow: 0 18px 50px rgba(208, 46, 46, .22); }
.paywall-title { margin: 0 0 30px; font: 500 clamp(1.75rem, 4vw, 2.45rem)/1.2 "Playfair Display", Georgia, "Times New Roman", serif; font-style: normal;
  letter-spacing: 0; text-transform: none; color: #fffae7; text-wrap: balance; }
.paywall-btn { display: inline-block; min-width: 210px; padding: 19px 42px; border-radius: 10px; background: #ffffff; color: #d02e2e; font: 700 1.2rem/1 var(--font-sans);
  text-decoration: none; transition: transform .16s, box-shadow .2s, color .2s; }
.paywall-btn:hover { color: #b82828; transform: translateY(-2px); box-shadow: 0 10px 24px rgba(33, 17, 14, .25); }
.paywall-signin { margin: 28px 0 0; font-size: .98rem; color: rgba(255, 250, 231, .92); }
.paywall-signin a { color: #fffae7; font-weight: 700; text-decoration: none; }
.paywall-signin a:hover { color: #fffae7; text-decoration: underline; }
@media (max-width: 640px) { .paywall { padding: 40px 20px 36px; margin-left: calc(-1 * var(--gutter) / 2); margin-right: calc(-1 * var(--gutter) / 2); } }
.done-toggle[aria-pressed="true"] { background: var(--accent-fill); border-color: var(--accent-fill); color: var(--accent-ink); }
.draft-banner { background: var(--gold-soft); color: var(--gold); border-bottom: 1px solid var(--orange); text-align: center; font-weight: 700; padding: 8px 16px; font-size: .9rem; }

/* ---------- Guide layout: contents on the side ---------- */
.guide-layout { display: grid; grid-template-columns: minmax(0, var(--reading)) 260px; gap: 56px; justify-content: center; }
.toc { position: sticky; top: calc(var(--header) + 28px); align-self: start; max-height: calc(100vh - var(--header) - 56px); overflow: auto; padding: 18px 0 18px 18px; border-left: 2px solid var(--line); font-size: .92rem; }
.toc h2 { font: 700 .8rem/1.2 var(--font-label); letter-spacing: .18em; text-transform: uppercase; color: var(--accent); margin: 0 0 12px; }
.toc ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.toc a { display: block; text-decoration: none; color: var(--ink-2); padding: 4px 0; line-height: 1.35; }
.toc a:hover { color: var(--accent); }
.toc a.active { color: var(--accent); font-weight: 700; }
.toc .lvl3 { padding-left: 14px; font-size: .88rem; }
.toc-inline { display: none; }
@media (max-width: 1080px) {
  .guide-layout { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .guide-layout > .toc { display: none; }
  .toc-inline { display: block; margin: 18px 0; border: 1px solid var(--line); border-top: 4px solid var(--accent-fill); border-radius: var(--radius-sm); background: var(--surface); }
  .toc-inline summary { cursor: pointer; padding: 12px 16px; font: 700 .84rem/1.3 var(--font-label); letter-spacing: .16em; text-transform: uppercase; color: var(--ink); }
  .toc-inline .toc { position: static; max-height: none; border: 0; padding: 0 16px 14px; }
}
.guide-facts { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 18px; }

/* ---------- Archive, search, filters ---------- */
.page-head { padding: 48px 0 24px; }
.page-head p.lead { font-size: 1.15rem; color: var(--ink-2); max-width: 40em; }
.tools { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin: 8px 0 26px; }
.search { flex: 1 1 260px; display: flex; align-items: center; gap: 8px; min-height: 48px; padding: 0 18px; border: 1px solid var(--line-strong); border-radius: 999px; background: var(--surface); box-shadow: var(--shadow-sm); }
.search:focus-within { border-color: var(--accent); }
.search input { flex: 1; border: 0; outline: 0; background: transparent; color: var(--ink); font: 500 1rem var(--font-sans); min-height: 44px; }
.search .icon { color: var(--accent); }
.filters { display: flex; flex-wrap: wrap; gap: 8px; }
.empty { color: var(--muted); padding: 24px 0; }
[hidden] { display: none !important; }

/* ---------- Start here (learning path) ---------- */
.path-progress { display: flex; align-items: center; gap: 14px; margin: 6px 0 28px; }
.path-progress .bar { flex: 1; height: 10px; border-radius: 999px; background: var(--surface-2); overflow: hidden; box-shadow: inset 0 0 0 1px var(--line); }
.path-progress .bar span { display: block; height: 100%; width: 0; background: var(--accent-fill); border-radius: inherit; transition: width .3s; }
.module { margin: 0 0 30px; }
.module h2 { font-size: 1.6rem; margin-bottom: 6px; }
.module > p { color: var(--ink-2); }
.lesson { display: grid; grid-template-columns: 38px minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 14px 16px; border: 1px solid var(--line);
  border-radius: var(--radius-sm); background: var(--surface); text-decoration: none; color: var(--ink); box-shadow: var(--shadow-sm); transition: box-shadow .2s, border-color .2s; }
.lesson + .lesson { margin-top: 8px; }
.lesson:hover { border-color: transparent; box-shadow: var(--glow); color: var(--ink); }
.lesson .num { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font: 400 1rem/1 var(--font-display); background: var(--accent-soft); color: var(--accent-strong); }
.lesson.done .num { background: var(--accent-fill); color: var(--accent-ink); }
.lesson strong { display: block; font-family: var(--font-display); font-weight: 400; font-size: 1.2rem; line-height: 1.1; letter-spacing: .01em; text-transform: uppercase; margin-bottom: 2px; }
.lesson span.sub { color: var(--muted); font-size: .9rem; }

/* ---------- Library ---------- */
.lib-card .card-body { gap: 10px; }
.lib-card .prompt { margin: 6px 0 0; }
.lib-card .lib-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: auto; padding-top: 8px; }

/* ---------- About ---------- */
.about-grid { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 40px; align-items: start; }
.about-grid img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 24px; box-shadow: var(--shadow), 0 0 0 6px var(--surface); }
.about-grid img.portrait { aspect-ratio: auto; height: auto; }   /* the portrait from site.json, shown whole */
@media (max-width: 760px) { .about-grid { grid-template-columns: 1fr; } .about-grid img { max-width: 180px; } .about-grid img.portrait { max-width: 260px; } }

/* ---------- Footer ---------- */
.site-footer { background: var(--footer-bg); color: rgba(255, 250, 231, .74); padding: 52px 0 36px; font-size: .93rem; border-top: 5px solid #d02e2e; margin-top: 40px; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 32px; }
@media (max-width: 760px) { .footer-grid { grid-template-columns: 1fr; } }
.site-footer h2 { font: 700 .8rem/1.2 var(--font-label); letter-spacing: .2em; text-transform: uppercase; color: #fffae7; margin: 0 0 14px; }
.site-footer a { color: rgba(255, 250, 231, .74); text-decoration: none; }
.site-footer a:hover { color: #fffae7; text-decoration: underline; }
.site-footer ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.site-footer .brand { margin-bottom: 14px; color: #fffae7; }
.site-footer .wordmark { font-size: min(1.6rem, calc((100vw - 2 * var(--gutter)) / 11.8)); }
.site-footer .brand:hover { color: #fffae7; text-decoration: none; }
.footer-note { margin-top: 36px; padding-top: 20px; border-top: 1px solid rgba(255, 250, 231, .14); display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; font-size: .85rem; }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); opacity: 0; background: var(--ink); color: var(--bg); padding: 10px 18px; border-radius: 999px;
  font-weight: 700; font-size: .9rem; z-index: 90; transition: opacity .2s, transform .2s; pointer-events: none; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@media print {
  .site-header, .site-footer, .share, .subscribe, .progress, .toc, .copy-btn, .discuss, .prev-next, .nav, .paywall-end { display: none !important; }
  body { background: #fff; color: #000; }
  main::before { display: none; }
  .guide-layout { display: block; }
}

/* ---------- Issue polish: reading type, lead line, sections, figures ---------- */
.issue-prose { font-size: 1.16rem; line-height: 1.8; }
.issue-prose > p:first-of-type { font-family: var(--font-sans); font-weight: 600; font-size: 1.3em; line-height: 1.5; letter-spacing: -0.005em; color: var(--ink); }
.prose h2 { position: relative; padding-top: 20px; }
.prose h2::before { content: ""; position: absolute; top: 0; left: 0; width: 48px; height: 5px; border-radius: 5px; background: var(--accent-fill); }
.prose h3 { color: var(--ink); }
.prose h3::before { content: "→ "; color: var(--accent); font-family: var(--font-sans); font-weight: 800; }
.figure img { border: 0; border-radius: var(--radius); box-shadow: 0 2px 6px rgba(47, 45, 45, .06), 0 18px 48px rgba(47, 45, 45, .14); width: 100%; }
.figure figcaption { margin-top: 12px; font-style: italic; }
.prose > ul, .prose > ol { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 14px 18px 14px 2.2em; box-shadow: 0 1px 2px rgba(47, 45, 45, .04); }
.prose > ul.contains-task-list { background: none; border: 0; padding: 0; box-shadow: none; }
.cover .titlecard { border-radius: var(--radius); }
.article-head .eyebrow { margin-bottom: 12px; }

.subscribe .substack-embed { display: block; width: 100%; height: 150px; border: 0; border-radius: 12px; background: #ffffff; }
.hero .subscribe .fine a, .subscribe .fine a { color: inherit; text-decoration: underline; }
