/* That Which Inspires Awe — site styles */

@font-face {
  font-family: "Junicode";
  src: url("../fonts/awe/junicode-roman.woff2") format("woff2-variations"), url("../fonts/awe/junicode-roman.woff2") format("woff2");
  font-weight: 300 700;
  font-stretch: 75% 125%;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Junicode";
  src: url("../fonts/awe/junicode-italic.woff2") format("woff2-variations"), url("../fonts/awe/junicode-italic.woff2") format("woff2");
  font-weight: 300 700;
  font-stretch: 75% 125%;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: "Bricolage Grotesque";
  src: url("../fonts/awe/bricolage-grotesque.woff2") format("woff2-variations"), url("../fonts/awe/bricolage-grotesque.woff2") format("woff2");
  font-weight: 200 800;
  font-stretch: 75% 100%;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "JetBrains Mono";
  src: url("../fonts/awe/jetbrains-mono.woff2") format("woff2-variations"), url("../fonts/awe/jetbrains-mono.woff2") format("woff2");
  font-weight: 100 800;
  font-style: normal;
  font-display: swap;
}

/* ---------- Tokens ---------- */

:root,
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #1f1f1f;
  --bg-raised: #272725;
  --bg-sunk: #1a1a19;
  --text: #d1cfc0;
  --text-strong: #ebe9dc;
  --muted: #9c9a8d;
  --line: rgba(209, 207, 192, 0.12);
  --line-strong: rgba(209, 207, 192, 0.22);
  --accent: #d68a96;
  --accent-soft: rgba(214, 138, 150, 0.16);
  --button-bg: #d1cfc0;
  --button-text: #1f1f1f;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 12px 32px -12px rgba(0, 0, 0, 0.55);

  --syn-comment: #7f7d72;
  --syn-keyword: #c9a3c8;
  --syn-string: #b4c08f;
  --syn-number: #dcae74;
  --syn-type: #9db6c4;
  --syn-func: #e6dfbf;
  --syn-attr: #a9b3d8;
  --syn-plain: #d1cfc0;
}

:root[data-theme="light"] {
  color-scheme: light;
  --bg: #f2f0e3;
  --bg-raised: #e8e5d4;
  --bg-sunk: #ebe8d8;
  --text: #2e2e2e;
  --text-strong: #1a1a1a;
  --muted: #65635a;
  --line: rgba(46, 46, 46, 0.12);
  --line-strong: rgba(46, 46, 46, 0.24);
  --accent: #a04a5c;
  --accent-soft: rgba(160, 74, 92, 0.14);
  --button-bg: #2e2e2e;
  --button-text: #f2f0e3;
  --shadow: 0 1px 2px rgba(60, 50, 30, 0.08), 0 12px 32px -14px rgba(60, 50, 30, 0.25);

  --syn-comment: #85826f;
  --syn-keyword: #7b3f79;
  --syn-string: #5a6b2c;
  --syn-number: #985e16;
  --syn-type: #2f5f78;
  --syn-func: #3f3b2a;
  --syn-attr: #45528f;
  --syn-plain: #2e2e2e;
}

:root {
  --font-display: "Junicode", "Iowan Old Style", Georgia, serif;
  --font-text: "Bricolage Grotesque", ui-sans-serif, system-ui, sans-serif;
  --font-code: "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;

  --measure: 40rem;
  --wide: 58rem;
  --page: 74rem;
  --gutter: clamp(1rem, 4vw, 2.5rem);
  --radius: 14px;
  --radius-sm: 8px;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

/* ---------- Base ---------- */

*,
*::before,
*::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: 2rem;
  scrollbar-color: var(--line-strong) var(--bg);
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-text);
  font-size: 1.0625rem;
  font-weight: 420;
  line-height: 1.6;
  font-optical-sizing: auto;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  transition: background-color 0.35s var(--ease), color 0.35s var(--ease);
}

::selection { background: var(--accent-soft); color: var(--text-strong); }

img, video, iframe, svg { max-width: 100%; }
img { height: auto; }

a {
  color: inherit;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

input, textarea { caret-color: var(--accent); }

h1, h2, h3, h4, h5, h6 {
  color: var(--text-strong);
  overflow-wrap: break-word;
  margin: 0;
  text-wrap: balance;
  font-variant-numeric: lining-nums;
}

p { text-wrap: pretty; }

.screen-reader-text,
.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(1px, 1px, 1px, 1px);
  white-space: nowrap;
}

.skip-links ul { list-style: none; margin: 0; padding: 0; }
.skip-links a {
  position: absolute;
  left: -9999px;
  top: 0.75rem;
  z-index: 100;
  padding: 0.5rem 1rem;
  border-radius: 999px;
  background: var(--button-bg);
  color: var(--button-text);
  font-weight: 600;
  text-decoration: none;
}
.skip-links a:focus { left: 0.75rem; }

.wrap {
  width: 100%;
  max-width: var(--page);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

/* ---------- Buttons & pills ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.8rem 1.4rem;
  border-radius: var(--radius-sm);
  border: 0;
  background: var(--bg-raised);
  color: var(--text-strong);
  font: inherit;
  font-size: 0.9375rem;
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.2s var(--ease), transform 0.2s var(--ease), color 0.2s var(--ease);
}
.btn:hover { background: color-mix(in srgb, var(--bg-raised) 70%, var(--text) 30%); }
.btn:active { transform: translateY(1px); }
.btn--primary { background: var(--button-bg); color: var(--button-text); box-shadow: var(--shadow); }
.btn--primary:hover { background: color-mix(in srgb, var(--button-bg) 88%, var(--accent) 12%); }
.btn svg { width: 1em; height: 1em; flex: none; }

.pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35em;
  padding: 0.3em 0.75em;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  color: var(--muted);
  font-size: 0.8125rem;
  font-weight: 500;
  line-height: 1.3;
  text-decoration: none;
  transition: color 0.2s var(--ease), border-color 0.2s var(--ease), background-color 0.2s var(--ease);
}
a.pill:hover { color: var(--text-strong); border-color: var(--text); }
.pill .count { color: var(--muted); font-variant-numeric: tabular-nums; opacity: 0.8; }

.pill-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

/* ---------- Site header ---------- */

.site-header {
  padding-block: 1.5rem;
}
.site-header .wrap {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 1rem;
}
.site-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  justify-self: start;
  color: var(--text-strong);
  font-weight: 700;
  font-size: 1.0625rem;
  letter-spacing: -0.01em;
  text-decoration: none;
}
.site-brand em {
  font-family: var(--font-display);
  font-size: 1.2em;
  font-weight: 500;
  color: var(--accent);
  margin-left: 0.05em;
}
.site-nav ul {
  display: flex;
  gap: 0.25rem;
  list-style: none;
  margin: 0;
  padding: 0;
}
.site-nav a {
  display: block;
  padding: 0.5rem 0.9rem;
  border-radius: var(--radius-sm);
  color: var(--text);
  font-weight: 600;
  font-size: 0.9875rem;
  text-decoration: none;
  transition: background-color 0.2s var(--ease), color 0.2s var(--ease);
}
.site-nav a:hover { background: var(--bg-raised); color: var(--text-strong); }
.site-nav a[aria-current="page"] { color: var(--text-strong); background: var(--bg-raised); }

.site-tools {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  justify-self: end;
}
.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 2.5rem;
  height: 2.5rem;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text);
  cursor: pointer;
  transition: background-color 0.2s var(--ease), color 0.2s var(--ease);
}
.icon-btn:hover { background: var(--bg-raised); color: var(--text-strong); }
.icon-btn svg { width: 1.25rem; height: 1.25rem; }
.theme-toggle .icon-sun { display: none; }
:root[data-theme="light"] .theme-toggle .icon-sun { display: block; }
:root[data-theme="light"] .theme-toggle .icon-moon { display: none; }

@media (max-width: 40em) {
  .site-header .wrap { grid-template-columns: 1fr auto; row-gap: 0.75rem; }
  .site-nav { grid-row: 2; grid-column: 1 / -1; }
  .site-nav a { padding-inline: 0.7rem; }
  .site-nav li:first-child a { margin-left: -0.7rem; }
  .site-brand-name { font-size: 1rem; }
}

/* ---------- Footer ---------- */

.site-footer {
  margin-top: clamp(4rem, 10vw, 8rem);
  padding-block: 3rem 3.5rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.9375rem;
}
.site-footer .wrap {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-end;
  gap: 2rem;
}
.footer-title {
  font-family: var(--font-display);
  font-size: 1.75rem;
  font-weight: 600;
  line-height: 1.1;
  color: var(--text-strong);
  margin: 0 0 0.5rem;
}
.footer-title em { color: var(--accent); font-weight: 500; }
.site-footer p { margin: 0; }
.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.5rem;
  list-style: none;
  margin: 0;
  padding: 0;
}
.footer-links a { color: var(--text); text-decoration: none; font-weight: 600; }
.footer-links a:hover { color: var(--accent); }

/* ---------- Home ---------- */

.hero {
  padding-block: clamp(4rem, 12vw, 9rem) clamp(3.5rem, 8vw, 6rem);
  text-align: center;
}
.hero-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(3.25rem, 9vw, 6rem);
  line-height: 0.98;
  letter-spacing: -0.015em;
  margin-bottom: 1.75rem;
}
.hero-title em {
  display: inline-block;
  color: var(--accent);
  font-style: italic;
  font-weight: 500;
  padding-inline-end: 0.06em;
}
.hero-lede {
  max-width: 34rem;
  margin: 0 auto 2.25rem;
  color: var(--text);
  font-size: 1.125rem;
  font-weight: 550;
  line-height: 1.5;
}
.hero-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1rem;
}
.hero-links {
  justify-content: center;
  margin-top: 2rem;
}

.section-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(2rem, 4vw, 2.75rem);
  line-height: 1.05;
  letter-spacing: -0.01em;
}
.section-title em { font-weight: 500; color: var(--accent); }
.section-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  padding-bottom: 1.25rem;
  margin-bottom: 0.5rem;
  border-bottom: 1px solid var(--line);
}
.section-head a { color: var(--muted); font-weight: 600; font-size: 0.9375rem; text-decoration: none; }
.section-head a:hover { color: var(--accent); }

/* Featured (latest) post */
.featured {
  overflow-wrap: anywhere;
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
  gap: clamp(1.5rem, 4vw, 3.5rem);
  align-items: center;
  margin-bottom: clamp(4rem, 9vw, 7rem);
}
.featured-media {
  display: block;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg-raised);
  aspect-ratio: 16 / 10;
  box-shadow: var(--shadow);
}
.featured-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.8s var(--ease);
}
.featured:hover .featured-media img { transform: scale(1.025); }
.featured-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(2rem, 3.6vw, 2.875rem);
  line-height: 1.04;
  letter-spacing: -0.01em;
  margin: 0.75rem 0 1rem;
}
.featured-title a { text-decoration: none; }
.featured-title a:hover { color: var(--accent); }
.featured-excerpt { color: var(--text); font-size: 1.0625rem; margin: 0 0 1.5rem; }
.featured-excerpt p { margin: 0; }

@media (max-width: 52em) {
  .featured { grid-template-columns: 1fr; }
}

/* Entry rows */
.entry-list { list-style: none; margin: 0; padding: 0; overflow-wrap: anywhere; }
.entry {
  position: relative;
  display: grid;
  grid-template-columns: 9.5rem minmax(0, 1fr) 10rem;
  gap: 0.5rem 2rem;
  padding-block: 2rem;
  border-bottom: 1px solid var(--line);
}
.entry-meta-col {
  color: var(--muted);
  font-size: 0.875rem;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  padding-top: 0.45rem;
}
.entry-meta-col time { display: block; color: var(--text); font-weight: 600; }
.entry-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(1.5rem, 2.4vw, 1.875rem);
  line-height: 1.12;
  letter-spacing: -0.005em;
  margin-bottom: 0.6rem;
}
.entry-title a { text-decoration: none; }
.entry-title a::after { content: ""; position: absolute; inset: 0; }
.entry:hover .entry-title a { color: var(--accent); }
.entry-excerpt { color: var(--muted); margin: 0; max-width: 38rem; }
.entry-excerpt p { margin: 0; }
.entry-tags { margin-top: 1rem; position: relative; z-index: 1; }
.entry-thumb {
  border-radius: var(--radius-sm);
  overflow: hidden;
  aspect-ratio: 4 / 3;
  background: var(--bg-raised);
  align-self: start;
  margin-top: 0.35rem;
}
.entry-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; filter: saturate(0.85); transition: filter 0.4s var(--ease); }
.entry:hover .entry-thumb img { filter: saturate(1); }
.entry--no-thumb { grid-template-columns: 9.5rem minmax(0, 1fr); }

@media (max-width: 52em) {
  .entry, .entry--no-thumb { grid-template-columns: minmax(0, 1fr) 6.5rem; }
  .entry-meta-col { grid-column: 1 / -1; grid-row: 1; padding-top: 0; display: flex; gap: 0.75rem; }
  .entry-thumb { grid-column: 2; grid-row: 2; }
  .entry--no-thumb .entry-body { grid-column: 1 / -1; }
}
@media (max-width: 52em) {
  .entry-meta-col { grid-row: 3; grid-column: 1; }
  .entry-body { grid-row: 1 / 3; }
  .entry-thumb { grid-row: 1; }
}
@media (max-width: 30em) {
  .entry { grid-template-columns: minmax(0, 1fr) 4.5rem; column-gap: 1rem; }
  .entry-excerpt { font-size: 0.9375rem; }
  .pagination li:not(:first-child):not(:last-child) a:not(.current) { display: none; }
}

/* Compact rows (archive, tags, search) */
.entry--compact {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: baseline;
  padding-block: 1rem;
}
.entry--compact .entry-title { font-size: 1.375rem; margin: 0; }
.entry--compact .entry-meta-col { padding: 0; text-align: right; white-space: nowrap; display: block; grid-column: auto; grid-row: auto; }
.entry--compact .entry-excerpt { grid-column: 1 / -1; font-size: 0.9375rem; }
@media (max-width: 30em) {
  .entry--compact { grid-template-columns: minmax(0, 1fr); }
  .entry--compact .entry-meta-col { text-align: left; }
}

/* Pagination */
.pagination { margin-top: 3rem; }
.pagination ul {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.375rem;
  list-style: none;
  margin: 0;
  padding: 0;
}
.pagination a {
  display: inline-grid;
  place-items: center;
  min-width: 2.75rem;
  height: 2.75rem;
  padding-inline: 0.9rem;
  border-radius: var(--radius-sm);
  color: var(--text);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  text-decoration: none;
  transition: background-color 0.2s var(--ease);
}
.pagination a:hover { background: var(--bg-raised); }
.pagination a.current { background: var(--button-bg); color: var(--button-text); }
.pagination a.disabled:not(.current) { color: var(--muted); opacity: 0.5; pointer-events: none; }

/* ---------- Pages (archive, tags, search) ---------- */

.page-intro {
  padding-block: clamp(3rem, 9vw, 6rem) clamp(2rem, 5vw, 3.5rem);
  text-align: center;
}
.page-intro .page-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(2.75rem, 7vw, 4.75rem);
  line-height: 1;
  letter-spacing: -0.015em;
}
.page-intro .page-title em { color: var(--accent); font-weight: 500; }
.page-intro-lede { color: var(--muted); font-size: 1.125rem; margin: 1.25rem auto 0; max-width: 34rem; }
.page-intro .pill-list { justify-content: center; margin-top: 2rem; }

.page-body { max-width: var(--wide); margin-inline: auto; }

.year-group {
  display: grid;
  grid-template-columns: 9rem minmax(0, 1fr);
  gap: 1rem 2rem;
  padding-block: 2.5rem;
  border-top: 1px solid var(--line);
}
.year-label {
  position: sticky;
  top: 1.5rem;
  align-self: start;
  font-family: var(--font-display);
  font-size: 2.5rem;
  font-weight: 500;
  font-style: italic;
  line-height: 1;
  color: var(--muted);
  font-variant-numeric: oldstyle-nums;
}
.year-label .count {
  display: block;
  margin-top: 0.5rem;
  font-family: var(--font-text);
  font-style: normal;
  font-size: 0.8125rem;
  font-weight: 500;
}
.year-group .entry:first-child { padding-top: 0.25rem; }
.year-group .entry:last-child { border-bottom: 0; }
@media (max-width: 40em) {
  .year-group { grid-template-columns: 1fr; }
  .year-label { position: static; }
}

.back-to-top { display: inline-block; margin-top: 1rem; color: var(--muted); font-size: 0.875rem; font-weight: 600; text-decoration: none; }
.back-to-top:hover { color: var(--accent); }

/* Search */
.search-form { max-width: 36rem; margin: 2rem auto 0; position: relative; }
.search-form svg {
  position: absolute;
  left: 1.25rem;
  top: 50%;
  width: 1.25rem;
  height: 1.25rem;
  transform: translateY(-50%);
  color: var(--muted);
  pointer-events: none;
}
.search-input {
  width: 100%;
  padding: 1rem 1.25rem 1rem 3.25rem;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--bg-raised);
  color: var(--text-strong);
  font: inherit;
  font-size: 1.125rem;
  font-weight: 500;
  transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}
.search-input::placeholder { color: var(--muted); }
.search-input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.results-found { color: var(--muted); font-size: 0.9375rem; margin: 0 0 0.5rem; }

/* ---------- Post ---------- */

.post-header {
  max-width: var(--wide);
  margin-inline: auto;
  overflow-wrap: anywhere;
  padding-block: clamp(2.5rem, 7vw, 5rem) clamp(2rem, 4vw, 3rem);
  text-align: center;
}
.post-header .pill-list { justify-content: center; margin-bottom: 1.75rem; }
.post-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(2.125rem, 5.6vw, 4.5rem);
  line-height: 1.02;
  overflow-wrap: anywhere;
  letter-spacing: -0.015em;
  max-width: 52rem;
  margin-inline: auto;
}
@media (max-width: 30em) {
  .post-title { font-size: 1.875rem; }
}
.post-dek {
  max-width: 38rem;
  margin: 1.5rem auto 0;
  color: var(--muted);
  font-size: clamp(1.0625rem, 1.6vw, 1.25rem);
  font-weight: 450;
  line-height: 1.5;
}
.post-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 0.5rem 1rem;
  margin-top: 1.75rem;
  color: var(--muted);
  font-size: 0.9375rem;
  font-weight: 500;
}
.post-meta .author { display: inline-flex; align-items: center; gap: 0.6rem; color: var(--text); font-weight: 600; }
.post-meta .author img { width: 2rem; height: 2rem; border-radius: 50%; object-fit: cover; }
.post-meta .sep { width: 3px; height: 3px; border-radius: 50%; background: currentColor; opacity: 0.6; }

.post-cover {
  max-width: var(--wide);
  margin: 0 auto clamp(2.5rem, 6vw, 4rem);
}
.post-cover img {
  display: block;
  width: 100%;
  max-height: 34rem;
  object-fit: cover;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.post-cover figcaption {
  margin-top: 0.75rem;
  color: var(--muted);
  font-size: 0.8125rem;
  text-align: center;
}
.post-cover figcaption p { margin: 0; }
.post-cover figcaption a { color: inherit; }

/* Reading column */
.prose {
  max-width: var(--measure);
  margin-inline: auto;
  font-size: 1.125rem;
  line-height: 1.72;
  color: var(--text);
  overflow-wrap: anywhere;
}
.prose > * { margin-block: 0; }
.prose > * + * { margin-top: 1.35em; }

.prose a {
  color: var(--text-strong);
  text-decoration-color: var(--accent);
  text-decoration-thickness: 1.5px;
  transition: color 0.15s var(--ease);
}
.prose a:hover { color: var(--accent); }

.prose strong { color: var(--text-strong); font-weight: 650; }
.prose em { font-style: italic; }

.prose h2,
.prose h3,
.prose h4 { scroll-margin-top: 2rem; }
.prose h2 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(1.75rem, 3vw, 2.25rem);
  line-height: 1.12;
  letter-spacing: -0.01em;
  margin-top: 2.4em;
}
.prose h3 {
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: -0.01em;
  margin-top: 2.2em;
}
.prose h4 {
  font-size: 1.0625rem;
  font-weight: 700;
  margin-top: 2em;
}
.prose h2 + *,
.prose h3 + *,
.prose h4 + * { margin-top: 0.7em; }
.prose h2 a, .prose h3 a { text-decoration: none; color: inherit; }

.prose ul,
.prose ol { padding-left: 1.4em; }
.prose li + li { margin-top: 0.4em; }
.prose li::marker { color: var(--muted); }
.prose ol li::marker { font-variant-numeric: tabular-nums; font-weight: 600; }

.prose hr {
  border: 0;
  height: auto;
  margin-block: 3em;
  text-align: center;
  color: var(--muted);
}
.prose hr::before { content: "\2022 \2022 \2022"; letter-spacing: 0.75em; font-size: 0.875rem; }

.prose blockquote {
  margin-inline: 0;
  padding: 0.25em 0 0.25em 1.5em;
  border-left: 1px solid var(--line-strong);
  font-family: var(--font-display);
  font-size: 1.25em;
  font-style: italic;
  line-height: 1.5;
  color: var(--text-strong);
}
.prose blockquote p { margin: 0; }
.prose blockquote p + p { margin-top: 0.75em; }

.prose img { border-radius: var(--radius-sm); }
.prose figure { margin-inline: 0; text-align: center; }
.prose figure.highlight { text-align: left; }
.prose figure img { display: block; margin-inline: auto; }
.prose figcaption {
  margin-top: 0.75rem;
  color: var(--muted);
  font-size: 0.875rem;
  line-height: 1.5;
}
.prose figcaption a { color: inherit; }
.prose figure.half { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.prose figure.half figcaption { grid-column: 1 / -1; }

/* Embedded tweets: clip the iframe canvas to the card corners */
.prose .twitter-tweet iframe { border-radius: 12px; }

/* Tables */
.prose table {
  display: block;
  width: 100%;
  overflow-x: auto;
  border-collapse: collapse;
  font-size: 0.9375rem;
  font-variant-numeric: tabular-nums;
  overflow-wrap: normal;
}
.prose th,
.prose td {
  padding: 0.6rem 0.9rem;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}
.prose th {
  color: var(--text-strong);
  font-weight: 650;
  border-bottom-color: var(--line-strong);
}

/* Notices */
.prose .notice,
.prose .notice--info,
.prose .notice--warning,
.prose .notice--danger,
.prose .notice--success {
  padding: 1.1rem 1.35rem;
  border-radius: var(--radius-sm);
  background: var(--bg-raised);
  border: 1px solid var(--line);
  font-size: 0.975em;
}
.prose .notice--warning,
.prose .notice--danger {
  border-color: color-mix(in srgb, var(--accent) 40%, transparent);
}
.prose [class^="notice"] > :first-child { margin-top: 0; }
.prose [class^="notice"] > :last-child { margin-bottom: 0; }

.aging-notice {
  display: flex;
  gap: 0.75rem;
  align-items: baseline;
  padding: 1rem 1.25rem;
  border-radius: var(--radius-sm);
  background: var(--bg-raised);
  font-size: 0.9375rem;
  color: var(--text);
}
.aging-notice::before {
  content: "";
  width: 0.5rem;
  height: 0.5rem;
  flex: none;
  border-radius: 50%;
  background: var(--accent);
  transform: translateY(-0.1em);
}

/* Table of contents */
.prose .toc-wrapper {
  padding: 1.25rem 1.5rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  font-size: 0.9375rem;
}
.prose .toc-wrapper h2 {
  font-family: var(--font-text);
  font-size: 0.9375rem;
  font-weight: 700;
  margin: 0 0 0.5rem;
}
.prose .toc-wrapper .toc-toggle-icon { display: none; }
.prose .toc-wrapper ul,
.prose .toc-wrapper ol { margin: 0; padding-left: 1.1em; }
.prose .toc-wrapper a { text-decoration: none; color: var(--text); }
.prose .toc-wrapper a:hover { color: var(--accent); }

/* Inline code */
.prose code,
.prose kbd,
.prose samp {
  font-family: var(--font-code);
  font-size: 0.84em;
  font-weight: 450;
  font-variant-ligatures: none;
}
.prose :not(pre) > code {
  padding: 0.12em 0.4em;
  border-radius: 5px;
  background: var(--bg-raised);
  color: var(--text-strong);
  overflow-wrap: break-word;
}
.prose a code { color: inherit; }

/* Code blocks */
.prose div.highlighter-rouge,
.prose figure.highlight,
.prose pre {
  position: relative;
}
.prose div.highlighter-rouge,
.prose figure.highlight {
  margin-inline: -1.5rem;
  border-radius: var(--radius);
  background: var(--bg-sunk);
  border: 1px solid var(--line);
}
.prose div.highlighter-rouge .highlight,
.prose figure.highlight .highlight { background: transparent; }
.prose pre {
  margin: 0;
  padding: 1.25rem 1.5rem;
  overflow-x: auto;
  font-size: 0.875rem;
  line-height: 1.65;
  tab-size: 4;
  color: var(--syn-plain);
  scrollbar-width: thin;
}
.prose > pre {
  margin-inline: -1.5rem;
  border-radius: var(--radius);
  background: var(--bg-sunk);
  border: 1px solid var(--line);
}
.prose pre code {
  font-size: inherit;
  padding: 0;
  background: none;
  color: inherit;
}
.code-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 0.5rem 0.6rem 0.5rem 1.5rem;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}
.code-copy {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.3rem 0.6rem;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  cursor: pointer;
  transition: background-color 0.2s var(--ease), color 0.2s var(--ease);
}
.code-copy:hover { background: var(--bg-raised); color: var(--text-strong); }
.code-copy[data-copied] { color: var(--accent); }
.code-copy svg { width: 0.9rem; height: 0.9rem; }

@media (max-width: 46em) {
  .prose div.highlighter-rouge,
  .prose figure.highlight,
  .prose > pre {
    margin-inline: calc(-1 * var(--gutter));
    border-radius: 0;
    border-inline: 0;
  }
  .prose pre { padding-inline: var(--gutter); }
  .code-bar { padding-left: var(--gutter); }
}

/* Rouge syntax */
.highlight .c, .highlight .ch, .highlight .cd, .highlight .cm, .highlight .cpf, .highlight .c1, .highlight .cs { color: var(--syn-comment); font-style: italic; }
.highlight .cp { color: var(--syn-attr); }
.highlight .k, .highlight .kc, .highlight .kd, .highlight .kn, .highlight .kp, .highlight .kr, .highlight .kv, .highlight .ow { color: var(--syn-keyword); }
.highlight .kt, .highlight .nc, .highlight .nn, .highlight .no, .highlight .bp { color: var(--syn-type); }
.highlight .s, .highlight .sa, .highlight .sb, .highlight .sc, .highlight .dl, .highlight .sd, .highlight .s2, .highlight .se, .highlight .sh, .highlight .si, .highlight .sx, .highlight .sr, .highlight .s1, .highlight .ss { color: var(--syn-string); }
.highlight .m, .highlight .mb, .highlight .mf, .highlight .mh, .highlight .mi, .highlight .il, .highlight .mo, .highlight .mx { color: var(--syn-number); }
.highlight .nf, .highlight .fm, .highlight .nb { color: var(--syn-func); }
.highlight .na, .highlight .nt, .highlight .nd, .highlight .ne, .highlight .nl, .highlight .py { color: var(--syn-attr); }
.highlight .nv, .highlight .vc, .highlight .vg, .highlight .vi, .highlight .vm { color: var(--syn-number); }
.highlight .o, .highlight .p { color: var(--muted); }
.highlight .gd { color: var(--syn-keyword); }
.highlight .gi { color: var(--syn-string); }
.highlight .gh, .highlight .gu { color: var(--syn-type); font-weight: 600; }
.highlight .ge { font-style: italic; }
.highlight .gs { font-weight: 700; }
.highlight .err { color: inherit; background: none; }

/* Post footer */
.post-footer {
  max-width: var(--measure);
  margin: clamp(3rem, 7vw, 4.5rem) auto 0;
}
.post-footer-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 1rem 2rem;
  padding-block: 1.5rem;
  border-top: 1px solid var(--line);
}
.post-footer-label { color: var(--muted); font-size: 0.875rem; font-weight: 600; margin-right: 0.25rem; }
.share-links { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; }

.author-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 1.25rem;
  align-items: center;
  margin-top: 1.5rem;
  padding: 1.5rem;
  border-radius: var(--radius);
  background: var(--bg-raised);
}
.author-card img { width: 4rem; height: 4rem; border-radius: 50%; object-fit: cover; }
.author-card-name {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 600;
  line-height: 1.1;
  color: var(--text-strong);
}
.author-card p { margin: 0.25rem 0 0; color: var(--muted); font-size: 0.9375rem; }
.author-card .footer-links { margin-top: 0.6rem; font-size: 0.9375rem; }

.post-nav {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  max-width: var(--measure);
  margin: clamp(2.5rem, 6vw, 4rem) auto 0;
}
.post-nav a {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 1.5rem 1.75rem;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  text-decoration: none;
  transition: border-color 0.2s var(--ease), background-color 0.2s var(--ease);
}
.post-nav a:hover { border-color: var(--line-strong); background: var(--bg-raised); }
.post-nav .label { color: var(--muted); font-size: 0.875rem; font-weight: 600; }
.post-nav .title,
.footer-title,
.author-card-name {
  font-variant-numeric: lining-nums;
}
.post-nav .title {
  font-family: var(--font-display);
  font-size: 1.375rem;
  font-weight: 600;
  line-height: 1.15;
  color: var(--text-strong);
}
.post-nav a:hover .title { color: var(--accent); }
.post-nav .next { grid-column: 2; text-align: right; }
@media (max-width: 40em) {
  .post-nav { grid-template-columns: 1fr; }
  .post-nav .next { grid-column: 1; }
}

.page-comments {
  max-width: var(--measure);
  margin: clamp(3rem, 7vw, 4.5rem) auto 0;
}
.affiliate-notice { color: var(--muted); font-size: 0.875rem; margin-top: 2rem; }

/* MathJax */
.MathJax_Display { overflow-x: auto; overflow-y: hidden; }

/* ---------- Motion ---------- */

@keyframes awe-rise {
  from { opacity: 0; transform: translateY(0.35em); filter: blur(6px); }
  to { opacity: 1; transform: none; filter: none; }
}
.rise { animation: awe-rise 0.9s var(--ease) both; }
.rise-2 { animation-delay: 0.08s; }
.rise-3 { animation-delay: 0.16s; }
.rise-4 { animation-delay: 0.24s; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-delay: 0s !important;
    transition-duration: 0.01ms !important;
  }
}

.page-pills { margin: -1rem auto clamp(2.5rem, 6vw, 4rem); max-width: var(--wide); }
.page-pills .pill-list { justify-content: center; }
.search-results { margin-top: 3rem; }

/* Arrows, featured meta, mobile meta, search clear */
.icon-arrow { width: 1em; height: 1em; vertical-align: -0.125em; flex: none; }
.icon-arrow--left { transform: scaleX(-1); }
.post-nav .label { display: inline-flex; align-items: center; gap: 0.4rem; }
.post-nav .next .label { justify-content: flex-end; }
.section-head a { display: inline-flex; align-items: center; gap: 0.35rem; }
.featured .post-meta { justify-content: flex-start; margin: 0 0 1rem; }
.featured-title { margin-top: 0; }

@media (max-width: 40em) {
  .post-meta .author { flex-basis: 100%; justify-content: center; }
  .post-meta .author + .sep { display: none; }
}

.search-input::-webkit-search-cancel-button {
  -webkit-appearance: none;
  appearance: none;
  width: 1.1rem;
  height: 1.1rem;
  background: var(--muted);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.75' stroke-linecap='round'%3E%3Cpath d='M6 6l12 12M18 6 6 18'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.75' stroke-linecap='round'%3E%3Cpath d='M6 6l12 12M18 6 6 18'/%3E%3C/svg%3E") center / contain no-repeat;
  cursor: pointer;
}
