/* ==========================================================================
   Palette — ink, parchment, cream, teal, rust.
   Light is the default; dark follows the system unless the reader picks
   one with the header toggle.
   ========================================================================== */

:root {
  color-scheme: light;

  --ink: #18222a;
  --ink-raised: #21343e;
  --ink-line: #2d3a43;
  --on-ink: #ebe7d8;
  --on-ink-muted: #9ba7ac;

  --paper: #f4f0e3;
  --surface: #ebe6d6;
  --parchment: #e1dbb3;
  --glow: #f7f0c7;
  --line: #d9d2bd;
  --line-strong: #bfb79e;
  --tag: #d8dfda;
  --tag-line: #b3bdb8;

  --teal: #63abb2;
  --teal-deep: #548e96;
  --link: #2b6a72;
  --rust: #8a5324;

  --text: #18222a;
  --text-soft: #3d474e;
  --text-muted: #5a6266;

  --code-bg: #18222a;
  --code-text: #dfe4e1;

  /* Slightly deeper tones for text sitting on the parchment bands */
  --band-muted: #4d5559;
  --band-rust: #7a461c;
  --band-link: #245d64;

  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-serif: "Source Serif 4", "Iowan Old Style", Georgia, "Times New Roman", serif;
  --font-mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;

  --gutter: 20px;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(24, 34, 42, 0.06), 0 12px 32px -18px rgba(24, 34, 42, 0.45);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --ink: #10181d;
    --ink-raised: #1c2b33;
    --ink-line: #24313a;
    --paper: #161f25;
    --surface: #1e2930;
    --parchment: #1b262d;
    --glow: #243540;
    --line: #2a363e;
    --line-strong: #3a4750;
    --tag: #25313a;
    --tag-line: #3a4750;
    --link: #82c5cb;
    --rust: #d6925a;
    --text: #ebe7d8;
    --text-soft: #c7cac1;
    --text-muted: #98a3a7;
    --code-bg: #10181d;
    --band-muted: #98a3a7;
    --band-rust: #d6925a;
    --band-link: #82c5cb;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.2), 0 14px 34px -18px rgba(0, 0, 0, 0.8);
  }
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --ink: #10181d;
  --ink-raised: #1c2b33;
  --ink-line: #24313a;
  --paper: #161f25;
  --surface: #1e2930;
  --parchment: #1b262d;
  --glow: #243540;
  --line: #2a363e;
  --line-strong: #3a4750;
  --tag: #25313a;
  --tag-line: #3a4750;
  --link: #82c5cb;
  --rust: #d6925a;
  --text: #ebe7d8;
  --text-soft: #c7cac1;
  --text-muted: #98a3a7;
  --code-bg: #10181d;
  --band-muted: #98a3a7;
  --band-rust: #d6925a;
  --band-link: #82c5cb;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.2), 0 14px 34px -18px rgba(0, 0, 0, 0.8);
}

/* ==========================================================================
   Base
   ========================================================================== */

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

html { -webkit-text-size-adjust: 100%; scroll-padding-top: 24px; }

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--paper);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

main { flex: 1; }

[hidden] { display: none !important; }

a { color: inherit; }

img { display: block; max-width: 100%; height: auto; }

::selection { background: color-mix(in srgb, var(--teal) 38%, transparent); }

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

.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: 12px; top: -48px;
  z-index: 100;
  padding: 8px 14px;
  border-radius: 6px;
  background: var(--teal);
  color: #18222a;
  font-weight: 600;
  text-decoration: none;
}
.skip-link:focus { top: 12px; }

.icon { width: 18px; height: 18px; flex: none; }

.container {
  width: min(100% - 2 * var(--gutter), 1120px);
  margin-inline: auto;
}
.container--text { width: min(100% - 2 * var(--gutter), 720px); }

/* ==========================================================================
   Shared type
   ========================================================================== */

.display {
  margin: 0;
  font-family: var(--font-serif);
  font-size: clamp(38px, 5.4vw, 60px);
  font-weight: 600;
  font-optical-sizing: auto;
  letter-spacing: -0.022em;
  line-height: 1.06;
  text-wrap: balance;
}

.dek {
  margin: 18px 0 0;
  color: var(--text-soft);
  font-family: var(--font-serif);
  font-size: clamp(19px, 2.1vw, 22px);
  line-height: 1.5;
  text-wrap: pretty;
}

.eyebrow {
  display: block;
  margin: 0 0 14px;
  color: var(--rust);
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.eyebrow--teal { color: var(--teal); }

.kicker {
  margin: 0 0 10px;
  color: var(--link);
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.kicker a { text-decoration: none; }
.kicker a:hover { text-decoration: underline; text-underline-offset: 3px; }
.kicker span { color: var(--text-muted); }

.meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0 7px;
  margin: 0;
  color: var(--text-muted);
  font-size: 14px;
}

.section-title {
  margin: 0 0 8px;
  padding-bottom: 14px;
  border-bottom: 2px solid var(--text);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.empty { margin: 28px 0; color: var(--text-muted); font-size: 16px; }

/* Buttons and links */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 11px 18px;
  border: 0;
  border-radius: 8px;
  font: 600 15px/1.2 var(--font-sans);
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease;
}
.btn .icon { width: 16px; height: 16px; }
.btn--ink { background: var(--ink); color: var(--on-ink); }
.btn--ink .icon { color: var(--teal); }
.btn--ink:hover { background: var(--ink-raised); }
.btn--teal { background: var(--teal); color: #18222a; }
.btn--teal:hover { background: #79bcc2; }
.btn--sm { padding: 8px 14px; font-size: 14px; }
.btn--block { width: 100%; }

.text-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--link);
  font-weight: 600;
  text-decoration: none;
}
.text-link .icon { width: 16px; height: 16px; transition: transform 0.15s ease; }
.text-link:hover .icon { transform: translateX(3px); }

.tag-list { display: flex; flex-wrap: wrap; gap: 8px; }
.tag {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 12px;
  border: 1px solid var(--tag-line);
  border-radius: 999px;
  background: var(--tag);
  color: var(--text);
  font-size: 13.5px;
  font-weight: 500;
  text-decoration: none;
  transition: border-color 0.15s ease;
}
.tag:hover { border-color: var(--teal-deep); }
.tag-count { color: var(--text-muted); font-variant-numeric: tabular-nums; }

.avatar {
  display: grid;
  place-items: center;
  flex: none;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--ink);
  color: var(--teal);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.04em;
}
.avatar--lg { width: 60px; height: 60px; font-size: 18px; }

/* ==========================================================================
   Header
   ========================================================================== */

.site-header {
  position: relative;
  z-index: 20;
  background: var(--ink);
  color: var(--on-ink);
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 32px;
  min-height: 68px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--on-ink);
  text-decoration: none;
}
.brand-mark {
  width: 10px;
  height: 10px;
  flex: none;
  border-radius: 2px;
  background: var(--teal);
  transform: rotate(45deg);
}
.brand-name {
  font-family: var(--font-serif);
  font-size: 21px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.site-nav { margin-left: auto; }
.site-nav ul { display: flex; gap: 6px; margin: 0; padding: 0; list-style: none; }
.site-nav a {
  position: relative;
  display: block;
  padding: 8px 12px;
  color: var(--on-ink-muted);
  font-size: 15px;
  font-weight: 500;
  text-decoration: none;
  transition: color 0.15s ease;
}
.site-nav a:hover,
.site-nav a.is-active { color: var(--on-ink); }
.site-nav a.is-active::after {
  content: "";
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: -14px;
  height: 2px;
  background: var(--teal);
}

.header-actions { display: flex; align-items: center; gap: 10px; }

.icon-btn {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--on-ink-muted);
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease;
}
.icon-btn:hover { background: var(--ink-raised); color: var(--on-ink); }
.menu-btn { display: none; }

[data-theme-toggle] .icon-sun { display: none; }
:root[data-theme="dark"] [data-theme-toggle] .icon-sun { display: block; }
:root[data-theme="dark"] [data-theme-toggle] .icon-moon { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) [data-theme-toggle] .icon-sun { display: block; }
  :root:not([data-theme="light"]) [data-theme-toggle] .icon-moon { display: none; }
}

/* ==========================================================================
   Mastheads — the parchment band with a soft glow
   ========================================================================== */

.masthead,
.aside-block--subscribe {
  --text-muted: var(--band-muted);
  --rust: var(--band-rust);
  --link: var(--band-link);
}

.masthead {
  position: relative;
  overflow: hidden;
  border-bottom: 1px solid var(--line);
  background:
    radial-gradient(ellipse 60% 90% at 12% 110%, var(--glow) 0%, transparent 70%),
    radial-gradient(ellipse 50% 80% at 95% -20%, var(--glow) 0%, transparent 70%),
    var(--parchment);
}

.masthead--home { padding: clamp(48px, 8vw, 96px) 0; }
.masthead--page { padding: clamp(48px, 7vw, 84px) 0 clamp(40px, 6vw, 64px); }
.masthead--article { padding: clamp(48px, 7vw, 88px) 0 clamp(36px, 5vw, 56px); }
.masthead--center { text-align: center; }
.masthead--center .btn { margin-top: 30px; }

.hero { display: grid; gap: 48px; align-items: center; }
.hero--split { grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); }
.hero-intro .dek { max-width: 34ch; }
.hero-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px 24px;
  margin-top: 32px;
}

/* Latest-article card */
.feature {
  --pad: clamp(26px, 3vw, 36px);
  display: flex;
  flex-direction: column;
  padding: var(--pad);
  border: 1px solid var(--ink-line);
  border-radius: 14px;
  background: var(--ink);
  color: var(--on-ink);
  box-shadow: var(--shadow);
  text-decoration: none;
  transition: transform 0.2s ease;
}
.feature:hover { transform: translateY(-3px); }
.feature-image {
  width: calc(100% + 2 * var(--pad));
  max-width: none;
  margin: calc(-1 * var(--pad)) calc(-1 * var(--pad)) 26px;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: 14px 14px 0 0;
}
.feature-title {
  font-family: var(--font-serif);
  font-size: clamp(26px, 2.8vw, 32px);
  font-weight: 600;
  letter-spacing: -0.015em;
  line-height: 1.15;
  text-wrap: balance;
}
.feature-excerpt {
  margin-top: 14px;
  color: var(--on-ink-muted);
  font-size: 16px;
  line-height: 1.6;
}
.feature-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 28px;
  padding-top: 18px;
  border-top: 1px solid var(--ink-line);
  color: var(--on-ink-muted);
  font-size: 14px;
}
.feature-cta { display: inline-flex; align-items: center; gap: 6px; color: var(--teal); font-weight: 600; }
.feature-cta .icon { width: 16px; height: 16px; transition: transform 0.15s ease; }
.feature:hover .feature-cta .icon { transform: translateX(3px); }

/* ==========================================================================
   Home body — article list and aside
   ========================================================================== */

.home-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 72px;
  padding: 64px 0 96px;
}

.post-row {
  display: grid;
  gap: 28px;
  padding: 30px 0;
  border-bottom: 1px solid var(--line);
}
.post-row--image { grid-template-columns: minmax(0, 1fr) 200px; align-items: start; }
.post-row-title {
  margin: 0;
  font-family: var(--font-serif);
  font-size: clamp(23px, 2.4vw, 28px);
  font-weight: 600;
  letter-spacing: -0.012em;
  line-height: 1.2;
  text-wrap: balance;
}
.post-row-title a {
  text-decoration: none;
  background-image: linear-gradient(var(--teal), var(--teal));
  background-size: 0 2px;
  background-position: 0 100%;
  background-repeat: no-repeat;
  transition: background-size 0.25s ease;
}
.post-row-title a:hover { background-size: 100% 2px; }
.post-row-excerpt {
  margin: 10px 0 14px;
  color: var(--text-soft);
  font-size: 16.5px;
  line-height: 1.6;
}
.post-row .meta { margin-top: 12px; }
.post-row-excerpt + .meta { margin-top: 0; }
.post-row-media img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: 8px;
}

.home-aside { display: grid; gap: 28px; align-content: start; }
.aside-title {
  margin: 0 0 8px;
  padding-bottom: 14px;
  border-bottom: 2px solid var(--text);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.topic-list { margin: 0; padding: 0; list-style: none; }
.topic-list a {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 0;
  border-bottom: 1px solid var(--line);
  color: var(--text);
  font-weight: 500;
  text-decoration: none;
  text-transform: capitalize;
  transition: color 0.15s ease;
}
.topic-list a:hover { color: var(--link); }
.topic-count { color: var(--text-muted); font-variant-numeric: tabular-nums; }

.aside-block--subscribe {
  padding: 24px;
  border-radius: var(--radius);
  background:
    radial-gradient(ellipse 80% 70% at 100% 0%, var(--glow) 0%, transparent 70%),
    var(--parchment);
}
.aside-block--subscribe .aside-title { border: 0; padding: 0; margin-bottom: 10px; }
.aside-block--subscribe p { margin: 0 0 18px; color: var(--text-soft); font-size: 15px; line-height: 1.55; }

/* ==========================================================================
   Article
   ========================================================================== */

.masthead--article .kicker { margin-bottom: 18px; }

.byline {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 34px;
}
.byline-name {
  display: inline-block;
  margin-bottom: 2px;
  font-weight: 600;
  text-decoration: none;
}
.byline-name:hover { color: var(--link); }

.cover { margin-block: 0; padding-top: 48px; }
.cover img { width: 100%; border-radius: var(--radius); }
.cover figcaption { margin-top: 10px; color: var(--text-muted); font-size: 14px; text-align: center; }

.prose {
  padding: clamp(40px, 6vw, 64px) 0 8px;
  font-family: var(--font-serif);
  font-size: 20px;
  line-height: 1.72;
  font-optical-sizing: auto;
  overflow-wrap: break-word;
}
.page-body .prose { padding-bottom: 88px; }
.prose > :first-child { margin-top: 0; }
.prose > :last-child { margin-bottom: 0; }

.prose p,
.prose ul,
.prose ol,
.prose figure,
.prose table,
.prose details,
.prose .highlighter-rouge { margin: 0 0 1.2em; }

.prose h2,
.prose h3,
.prose h4 { font-family: var(--font-serif); letter-spacing: -0.015em; text-wrap: balance; }
.prose h2 { margin: 1.9em 0 0.5em; font-size: 31px; font-weight: 600; line-height: 1.2; }
.prose h3 { margin: 1.7em 0 0.45em; font-size: 24px; font-weight: 600; line-height: 1.25; }
.prose h4 {
  margin: 1.6em 0 0.4em;
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.prose a {
  color: var(--link);
  text-decoration-line: underline;
  text-decoration-thickness: 1px;
  text-decoration-color: color-mix(in srgb, var(--link) 45%, transparent);
  text-underline-offset: 3px;
  transition: text-decoration-color 0.15s ease;
}
.prose a:hover { text-decoration-color: currentColor; }

.prose strong { font-weight: 700; }

.prose ul,
.prose ol { padding-left: 1.35em; }
.prose li { margin: 0.4em 0; padding-left: 0.25em; }
.prose li::marker { color: var(--teal-deep); }
.prose ol li::marker { font-family: var(--font-sans); font-size: 0.8em; font-weight: 600; }

.prose blockquote {
  margin: 1.8em 0;
  padding: 0 0 0 26px;
  border-left: 3px solid var(--teal);
  color: var(--text);
  font-size: 1.15em;
  font-style: italic;
  line-height: 1.55;
}
.prose blockquote p:last-child { margin-bottom: 0; }

.prose hr {
  height: auto;
  margin: 2.6em 0;
  border: 0;
  text-align: center;
}
.prose hr::before {
  content: "◆  ◆  ◆";
  color: var(--teal-deep);
  font-family: var(--font-sans);
  font-size: 12px;
  letter-spacing: 0.6em;
  white-space: pre;
}

.prose img { margin-inline: auto; border-radius: 8px; }
.prose figcaption {
  margin-top: 10px;
  color: var(--text-muted);
  font-family: var(--font-sans);
  font-size: 14px;
  text-align: center;
}

.prose code {
  padding: 0.12em 0.36em;
  border-radius: 4px;
  background: var(--surface);
  font-family: var(--font-mono);
  font-size: 0.8em;
}

.prose pre {
  margin: 0;
  padding: 20px 22px;
  overflow-x: auto;
  border-radius: var(--radius);
  background: var(--code-bg);
  color: var(--code-text);
  font-size: 14.5px;
  line-height: 1.65;
  tab-size: 2;
}
.prose pre code { padding: 0; border: 0; background: none; color: inherit; font-size: inherit; }

.prose table {
  display: block;
  width: 100%;
  overflow-x: auto;
  border-collapse: collapse;
  font-family: var(--font-sans);
  font-size: 15px;
  font-variant-numeric: tabular-nums;
}
.prose th,
.prose td { padding: 10px 16px 10px 0; border-bottom: 1px solid var(--line); text-align: left; }
.prose th {
  border-bottom: 2px solid var(--text);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.prose .footnotes {
  margin-top: 3em;
  padding-top: 1.4em;
  border-top: 1px solid var(--line);
  color: var(--text-soft);
  font-size: 16px;
}
.prose sup a,
.prose .reversefootnote { text-decoration: none; }

/* Syntax highlighting (Rouge) */
.highlight .c, .highlight .c1, .highlight .cm, .highlight .cs, .highlight .cp { color: #7f8c92; font-style: italic; }
.highlight .k, .highlight .kd, .highlight .kn, .highlight .kp, .highlight .kr, .highlight .kc, .highlight .ow { color: #63abb2; }
.highlight .kt, .highlight .nc, .highlight .no, .highlight .nn { color: #9fd0d4; }
.highlight .s, .highlight .s1, .highlight .s2, .highlight .sb, .highlight .sd, .highlight .se, .highlight .sh, .highlight .si, .highlight .sx, .highlight .sr, .highlight .ss, .highlight .sc { color: #e3d49b; }
.highlight .m, .highlight .mi, .highlight .mf, .highlight .mh, .highlight .mo, .highlight .il { color: #e0a36f; }
.highlight .nf, .highlight .fm, .highlight .nb, .highlight .bp { color: #f1ede0; }
.highlight .na, .highlight .nt, .highlight .nd { color: #b7c98f; }
.highlight .nv, .highlight .vi, .highlight .vg, .highlight .vc { color: #e8b7a0; }
.highlight .o, .highlight .p { color: #aab5b9; }
.highlight .gd { color: #e39a8f; }
.highlight .gi { color: #a9cf8d; }
.highlight .err { color: inherit; background: none; }

/* End of article */
.article-foot { padding: 48px 0 80px; }
.article-foot .tag-list { margin-bottom: 40px; }

.author-box {
  display: flex;
  gap: 20px;
  padding: 28px;
  border-top: 2px solid var(--text);
  border-radius: 0 0 var(--radius) var(--radius);
  background: var(--surface);
}
.author-box p { margin: 0; }
.author-box-label {
  color: var(--text-muted);
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.author-box .author-box-name { margin-top: 4px; font-family: var(--font-serif); font-size: 22px; font-weight: 600; }
.author-box .author-box-bio { margin-top: 8px; color: var(--text-soft); line-height: 1.6; }
.author-box .author-box-links { display: flex; flex-wrap: wrap; gap: 6px 20px; margin-top: 14px; }
.author-box-links a { color: var(--link); font-size: 15px; font-weight: 600; text-decoration: none; }
.author-box-links a:hover { text-decoration: underline; text-underline-offset: 3px; }

/* Keep reading */
.keep-reading {
  padding: 64px 0 88px;
  border-top: 1px solid var(--line);
  background: var(--surface);
}
.keep-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
  margin-top: 28px;
}
.keep-card {
  display: flex;
  flex-direction: column;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
  text-decoration: none;
  transition: border-color 0.15s ease, transform 0.2s ease;
}
.keep-card:hover { border-color: var(--teal-deep); transform: translateY(-2px); }
.keep-card .eyebrow { margin-bottom: 10px; }
.keep-title {
  font-family: var(--font-serif);
  font-size: 24px;
  font-weight: 600;
  letter-spacing: -0.012em;
  line-height: 1.2;
}
.keep-excerpt { margin: 10px 0 18px; color: var(--text-soft); line-height: 1.6; }
.keep-card .meta { margin-top: auto; }

/* Reading progress */
.progress {
  position: fixed;
  inset: 0 0 auto;
  z-index: 40;
  height: 3px;
  pointer-events: none;
}
.progress span {
  display: block;
  height: 100%;
  background: var(--teal);
  transform: scaleX(0);
  transform-origin: 0 50%;
}

/* ==========================================================================
   Topics and archive
   ========================================================================== */

.tag-list--index { margin-top: 30px; }

.search {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 30px;
  padding: 0 16px;
  height: 52px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--paper);
  color: var(--text-muted);
  cursor: text;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.search:focus-within {
  border-color: var(--teal-deep);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--teal) 30%, transparent);
}
.search input {
  flex: 1;
  min-width: 0;
  height: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  font: 400 16px var(--font-sans);
}
.search input::placeholder { color: var(--text-muted); }

.page-body { padding-bottom: 72px; }

.index-group { margin-top: 56px; }
.index-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin: 0;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--text);
  font-family: var(--font-serif);
  font-size: 28px;
  font-weight: 600;
  letter-spacing: -0.01em;
  text-transform: capitalize;
}
.index-count {
  color: var(--text-muted);
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
}

.index-list { margin: 0; padding: 0; list-style: none; }
.index-row {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr) auto;
  align-items: baseline;
  gap: 16px;
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
}
.index-date { color: var(--text-muted); font-size: 14px; font-variant-numeric: tabular-nums; }
.index-title {
  font-family: var(--font-serif);
  font-size: 20px;
  font-weight: 600;
  line-height: 1.3;
  text-decoration: none;
}
.index-title:hover { color: var(--link); }
.index-time { color: var(--text-muted); font-size: 14px; white-space: nowrap; }

/* ==========================================================================
   Footer
   ========================================================================== */

.site-footer {
  background: var(--ink);
  color: var(--on-ink-muted);
}
.footer-inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 32px 64px;
  padding: 56px 0 40px;
}
.footer-about { max-width: 380px; }
.footer-about p { margin: 16px 0 0; font-size: 15px; line-height: 1.6; }
.footer-nav ul {
  display: grid;
  grid-template-columns: repeat(2, auto);
  gap: 10px 48px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.footer-nav a { color: var(--on-ink); font-size: 15px; text-decoration: none; }
.footer-nav a:hover { color: var(--teal); }
.footer-base {
  padding: 20px 0 28px;
  border-top: 1px solid var(--ink-line);
  font-size: 13.5px;
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 980px) {
  .hero--split { grid-template-columns: minmax(0, 1fr); }
  .home-body { grid-template-columns: minmax(0, 1fr); gap: 56px; padding-top: 48px; }
  .home-aside { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 40px; }
}

@media (max-width: 760px) {
  :root { --gutter: 16px; }

  .header-inner { gap: 12px; min-height: 60px; }
  .brand-name { font-size: 19px; }
  .menu-btn { display: grid; }
  .header-actions { margin-left: auto; gap: 6px; }
  .header-actions .btn { display: none; }

  .site-nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    display: none;
    margin: 0;
    padding: 8px var(--gutter) 16px;
    border-top: 1px solid var(--ink-line);
    background: var(--ink);
  }
  .site-header.is-open .site-nav { display: block; }
  .site-nav ul { flex-direction: column; gap: 0; }
  .site-nav a { padding: 12px 0; font-size: 16px; border-bottom: 1px solid var(--ink-line); }
  .site-nav li:last-child a { border-bottom: 0; }
  .site-nav a.is-active::after { display: none; }
  .site-nav a.is-active { color: var(--teal); }

  .post-row--image { grid-template-columns: minmax(0, 1fr) 96px; gap: 16px; }
  .post-row--image .post-row-excerpt { display: none; }

  .prose { font-size: 18.5px; line-height: 1.7; }
  .prose h2 { font-size: 26px; }
  .prose h3 { font-size: 21px; }
  .prose pre { margin-inline: calc(-1 * var(--gutter)); border-radius: 0; font-size: 13.5px; }

  .author-box { flex-direction: column; gap: 14px; padding: 22px; }

  .index-row { grid-template-columns: minmax(0, 1fr); gap: 4px; }
  .index-date { order: 2; }
  .index-time { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; scroll-behavior: auto !important; }
}

@media print {
  .site-header, .site-footer, .progress, .keep-reading, .author-box { display: none !important; }
  .masthead { background: none; border: 0; padding: 0 0 24px; }
  body { background: #fff; }
}
