/* ====================================
   APPROVED THOUGHTS — MAIN STYLESHEET
   Visual Refresh: Quiet, Editorial
   ==================================== */

/* Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Atkinson+Hyperlegible:wght@400;700&family=Nunito+Sans:ital,wght@0,300;0,400;0,600;0,700;1,400&display=swap');

/* ====================================
   1. DESIGN TOKENS
   ==================================== */
:root {
  /* Color */
  --paper:        #f4efe6;
  --paper-2:      color-mix(in srgb, #f4efe6 88%, #000 4%);
  --ink:          #2a241d;
  --ink-2:        #2a241d;
  --ink-3:        #2a241d;
  --rule:         #d8cfbe;
  --rule-soft:    #e3dccd;
  --accent:       #b04a2f;
  --accent-soft:  color-mix(in srgb, #b04a2f 70%, #fff 30%);

  /* Typography */
  --f-mark: 'Atkinson Hyperlegible', sans-serif;
  --f-body: 'Nunito Sans', sans-serif;
  --w-body: 300;

  /* Shadows (used by image modal) */
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.10);
  --shadow-md: 0 4px 6px rgba(0,0,0,0.10);
  --shadow-lg: 0 10px 20px rgba(0,0,0,0.10);
  --transition-base: all 0.2s ease;
}

/* ====================================
   2. RESET & BASE
   ==================================== */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--f-body);
  font-size: 16px;
  line-height: 1.6;
  font-weight: var(--w-body);
  font-feature-settings: "kern","liga";
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }

a.inline {
  color: var(--accent);
  border-bottom: 1px solid color-mix(in srgb, var(--accent) 30%, transparent);
}
a.inline:hover { border-bottom-color: var(--accent); }

/* Skip link */
.skip-link {
  position: absolute;
  top: -40px; left: 0;
  background: var(--accent);
  color: var(--paper);
  padding: 8px 16px;
  text-decoration: none;
  z-index: 100;
}
.skip-link:focus { top: 0; }

/* ====================================
   3. SHARED HEADER
   ==================================== */
.at-header {
  padding: 18px 0 14px;
  border-bottom: 1px solid var(--rule);
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--paper);
  max-width: none;
  margin: 0;
}
.at-header-inner {
  display: block;
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 56px;
}
.at-header-inner > div:last-child { display: none; }
.at-header-col {
  text-align: center;
  position: relative;
  padding-bottom: 0;
}
.at-name-link { display: block; }
.at-name {
  font-family: var(--f-mark);
  font-size: 44px; font-weight: 400;
  letter-spacing: -0.005em; line-height: 1;
  color: var(--ink);
}
.at-name em {
  color: var(--accent);
  font-style: normal; font-weight: 700;
}
.at-nav {
  display: flex; gap: 32px; justify-content: center;
  margin-top: 14px;
  font-family: var(--f-body); font-size: 12px;
  letter-spacing: 0.18em; text-transform: uppercase;
}
.at-nav a {
  color: var(--ink-2);
  padding-bottom: 6px;
  border-bottom: 1px solid transparent;
}
.at-nav a:hover { color: var(--ink); }
.at-nav a.active { color: var(--ink); border-bottom-color: var(--accent); }
.at-nav .rss-nav {
  display: inline-flex; align-items: center; gap: 6px;
  color: var(--accent);
}
.at-nav .rss-nav svg { width: 11px; height: 11px; }
.at-nav .rss-nav:hover { border-bottom-color: var(--accent); }

/* ====================================
   4. PAGE BODY GRID
   ==================================== */
.at-body {
  display: grid;
  grid-template-columns: minmax(0,1fr) 240px;
  gap: 64px;
  max-width: 1120px;
  margin: 0 auto;
  padding: 48px 56px 56px;
}
.at-body.single {
  grid-template-columns: minmax(0,1fr);
  max-width: 760px;
}
.at-body.archive {
  grid-template-columns: minmax(0,1fr);
  max-width: 880px;
}

/* ====================================
   5. SHARED SIDEBAR
   ==================================== */
.at-side { font-family: var(--f-body); font-size: 14.5px; }
.at-side > section { margin-bottom: 36px; }
.at-side h3 {
  font-family: var(--f-body); font-weight: 500; font-size: 12px;
  letter-spacing: 0.22em; text-transform: uppercase;
  margin: 0 0 14px; padding-bottom: 8px;
  border-bottom: 1px solid var(--accent);
  color: var(--accent);
}
.at-side ul { list-style: none; padding: 0; margin: 0; }
.at-side li { padding: 6px 0; border-bottom: 1px dotted var(--rule); }
.at-side li:last-child { border-bottom: none; }

/* Recent posts */
.at-recent-title {
  font-size: 13.5px; line-height: 1.3;
  color: var(--ink); display: block; font-weight: 500;
}
.at-recent-date {
  font-size: 10px; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--accent); margin-top: 2px; display: block;
}
.at-side a:hover .at-recent-title { color: var(--accent); }

/* Elsewhere */
.at-elsewhere a {
  display: flex; justify-content: space-between;
  padding: 3px 0; font-size: 13.5px; color: var(--ink);
}
.at-elsewhere a::after { content: '↗'; color: var(--ink-3); font-size: 12px; }
.at-elsewhere a:hover { color: var(--accent); }

/* Sidebar search box */
.at-search-box {
  background: var(--paper-2); border: 1px solid var(--rule);
  border-radius: 999px;
  padding: 8px 14px;
  display: flex; align-items: center; gap: 10px;
}
.at-search-box .icon { color: var(--accent); width: 16px; height: 16px; flex-shrink: 0; display: block; }
.at-search-box input {
  border: none; outline: none; background: transparent;
  font: inherit; font-family: var(--f-body);
  flex: 1; color: var(--ink); min-width: 0;
}
.at-search-box input::placeholder { color: var(--ink-3); }

/* Subscribe */
.at-subscribe-list {
  list-style: none; padding: 0; margin: 0;
  display: flex; flex-direction: column; gap: 6px;
}
.at-subscribe-list li { border: none !important; padding: 0 !important; }
.at-subscribe-link {
  color: var(--ink); display: grid;
  grid-template-columns: 14px 1fr; gap: 8px;
  align-items: center; font-size: 13.5px;
}
.at-subscribe-link svg { color: var(--accent); width: 12px; height: 12px; }
.at-subscribe-link:hover { color: var(--ink); }
.at-subscribe-note {
  font-size: 12px; color: var(--ink-3); margin: 10px 0 0; line-height: 1.5;
}

/* ====================================
   6. SHARED FOOTER
   ==================================== */
.at-footer {
  background: var(--paper-2);
  padding: 28px 56px;
  display: flex; justify-content: space-between; align-items: center;
  font-family: var(--f-body); font-size: 11px; letter-spacing: 0.16em;
  text-transform: uppercase; color: var(--ink-2);
  border-top: 3px double var(--rule);
}
.at-footer .seal {
  font-family: var(--f-body); font-size: 13px; font-weight: 500;
  letter-spacing: 0.06em; text-transform: none; color: var(--ink);
}
.at-footer .links { display: flex; gap: 22px; align-items: center; }
.at-footer a { color: var(--ink-2); }
.at-footer a:hover { color: var(--accent); }
.at-rss {
  display: inline-flex; align-items: center; gap: 6px;
  color: var(--accent);
}
.at-rss svg { width: 11px; height: 11px; }

/* ====================================
   7. HOMEPAGE ENTRIES
   ==================================== */
.hy-entry {
  padding: 32px 0 36px;
  border-bottom: 1px solid var(--rule-soft);
  display: grid;
  grid-template-columns: 110px minmax(0,1fr);
  gap: 28px;
  align-items: baseline;
}
.hy-entry:first-child { padding-top: 0; }
.hy-entry:last-child { border-bottom: none; }

.hy-rail {
  font-family: var(--f-body);
  font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase;
  line-height: 1.6; padding-top: 6px; color: var(--ink-2);
}
.hy-rail .date { display: block; color: var(--accent); font-weight: 500; }
.hy-rail .read {
  display: block; margin-top: 4px; color: var(--ink-3);
  letter-spacing: 0.08em; text-transform: none; font-size: 11px;
}

.hy-title {
  font-family: var(--f-body);
  font-size: 30px; font-weight: 700;
  letter-spacing: -0.015em; line-height: 1.2;
  margin: 0 0 12px;
  color: var(--ink);
}
.hy-title a { color: var(--ink); }
.hy-title a:hover { color: var(--accent); }

.hy-dek {
  font-family: var(--f-body);
  font-size: 15px; line-height: 1.65;
  color: var(--ink-2);
  margin: 0 0 18px; max-width: 60ch;
  font-weight: var(--w-body);
}

.hy-prose {
  font-family: var(--f-body);
  font-size: 15px; line-height: 1.65;
  color: var(--ink);
  max-width: 60ch;
  font-weight: var(--w-body);
}
.hy-prose p { margin: 0 0 1em; }
.hy-prose a { color: var(--accent); border-bottom: 1px solid color-mix(in srgb, var(--accent) 30%, transparent); }
.hy-prose a:hover { border-bottom-color: var(--accent); }

/* Link list entries */
.hy-content { max-width: 60ch; margin-bottom: 18px; }
.hy-content > p {
  font-size: 15px; line-height: 1.65;
  color: var(--ink-2); margin: 0 0 1em;
  font-weight: var(--w-body);
}
.hy-content { counter-reset: hyl; }
.hy-content > ul, .hy-content > ol {
  list-style: none; padding: 0; margin: 0;
}
.hy-content > ol > li,
.hy-content > ul > li {
  counter-increment: hyl;
  padding: 16px 0 16px 38px;
  position: relative;
  border-top: 1px solid var(--rule-soft);
  font-size: 15px; line-height: 1.65;
  font-weight: var(--w-body);
}
.hy-content > ol > li::before {
  content: counter(hyl, decimal-leading-zero);
  /* Anchor on the title line's vertical center: the first line containing
     the 16.5px headline link has a line-box height of ~27px. We position
     the bullet so its visual center sits on that line's center. */
  position: absolute; left: 0; top: 24px;
  font-family: var(--f-body); font-size: 12px;
  line-height: 1;
  color: var(--accent);
  letter-spacing: 0.1em; font-weight: 500;
}
.hy-content > ol > li:first-child,
.hy-content > ul > li:first-child { border-top: none; padding-top: 4px; }
.hy-content > ol > li:first-child::before { top: 12px; }
.hy-content > ol > li > p:first-child,
.hy-content > ul > li > p:first-child { margin: 0 0 8px; }
.hy-content > ol > li > p.hy-link-headline > a:first-of-type,
.hy-content > ul > li > p.hy-link-headline > a:first-of-type {
  font-weight: 500;
  font-size: 16.5px;
}
.hy-content li p { color: var(--ink-2); margin: 0 0 0.6em; }
.hy-content li p:last-child { margin-bottom: 0; }
.hy-content a { color: var(--accent); }
.hy-content a:hover { color: var(--accent); text-decoration: underline; text-decoration-color: color-mix(in srgb, var(--accent) 50%, transparent); }
.hy-content strong { font-weight: 600; color: var(--ink); }
.hy-content em { font-style: italic; }

/* Blockquote — homepage entries (notes, link lists, posts shown in full).
   The original lighter-than-paper tint reads as a distinct "quote surface"
   without darkening the page, paired with the terracotta accent line. */
.hy-content blockquote,
.hy-prose blockquote {
  background: var(--paper-2);
  border-left: 3px solid var(--accent);
  border-radius: 4px;
  padding: 10px 16px;
  margin: 1em 0;
  color: var(--ink-2);
  font-size: 15px; line-height: 1.6;
}
.hy-content blockquote p,
.hy-prose blockquote p {
  color: var(--ink-2);
  margin: 0 0 0.6em;
}
.hy-content blockquote p:last-child,
.hy-prose blockquote p:last-child { margin-bottom: 0; }
/* Nested lists inside a blockquote — keep markers off the left border. */
.hy-content blockquote ul,
.hy-content blockquote ol,
.hy-prose blockquote ul,
.hy-prose blockquote ol {
  margin: 0.4em 0;
  padding-left: 1.6em;
  list-style-position: outside;
}
.hy-content blockquote ol > li,
.hy-content blockquote ul > li,
.hy-prose blockquote ol > li,
.hy-prose blockquote ul > li {
  /* Override the .hy-content > ol > li styling (which has 38px padding and an
     ::before counter) — nested lists should look like normal markdown lists. */
  padding: 0 0 0.2em 0;
  position: static;
  border-top: none;
  font-size: inherit;
  counter-increment: none;
  list-style: revert;
}
.hy-content blockquote ol > li::before,
.hy-content blockquote ul > li::before,
.hy-prose blockquote ol > li::before,
.hy-prose blockquote ul > li::before {
  content: none;
}

/* Inline images inside link list entries */
.hy-content img,
.hy-prose img { max-width: 100%; height: auto; display: block; margin: 1em 0; }
.hy-content .image-container,
.hy-prose .image-container { margin: 1em 0; }

/* Tweet card — editorial style (sourced from inline ::: tweet metadata).
   Falls back to Twitter widget for any ![embed] without metadata. */
.hy-tweet {
  border: 1px solid var(--rule);
  background: var(--paper-2);
  border-radius: 6px;
  padding: 18px 20px;
  margin: 16px 0;
  max-width: 60ch;
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  gap: 12px;
  font-family: var(--f-body);
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.hy-tweet:hover {
  border-color: var(--accent);
  box-shadow: 0 1px 0 0 color-mix(in srgb, var(--accent) 18%, transparent) inset;
}
.hy-tweet-avatar {
  width: 44px; height: 44px; border-radius: 50%;
  background: var(--accent-soft);
  display: grid; place-items: center;
  font-family: var(--f-body);
  font-size: 14px; color: #fff; font-weight: 700;
  letter-spacing: 0.02em;
}
.hy-tweet-body-col { min-width: 0; }
.hy-tweet-meta {
  font-family: var(--f-body);
  font-size: 13px; line-height: 1.4;
  margin-bottom: 6px;
}
.hy-tweet-meta .name { font-weight: 600; color: var(--ink); }
.hy-tweet-meta .handle { color: var(--ink-3); margin-left: 6px; font-weight: 400; }
.hy-tweet-body {
  font-family: var(--f-body);
  font-size: 15px; line-height: 1.55; color: var(--ink);
  font-weight: var(--w-body);
  margin: 0 0 8px;
  word-wrap: break-word;
  overflow-wrap: anywhere;
}
.hy-tweet-body a {
  color: var(--accent);
  border-bottom: 1px solid color-mix(in srgb, var(--accent) 30%, transparent);
}
.hy-tweet-body a:hover { border-bottom-color: var(--accent); }
.hy-tweet-img {
  margin: 12px 0 10px;
  border: 1px solid var(--rule);
  overflow: hidden;
}
.hy-tweet-img img { display: block; width: 100%; height: auto; }
.hy-tweet-foot {
  font-family: var(--f-body);
  font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--ink-3);
}
.hy-tweet-foot a { color: var(--ink-3); }
.hy-tweet-foot a:hover { color: var(--accent); }

/* Entry footer (tags + permalink) */
.hy-footer {
  margin-top: 18px;
  display: flex; align-items: center;
  justify-content: space-between;
  gap: 18px; flex-wrap: wrap;
}
.hy-footer .hy-tags { flex: 1 1 auto; }
.hy-copy {
  display: inline-flex; align-items: center; gap: 6px;
  margin-left: auto;
  background: none; border: none; padding: 0; cursor: pointer;
  font-family: var(--f-body); font-size: 11px;
  letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--accent); font-weight: 500;
  white-space: nowrap;
}
.hy-copy:hover { text-decoration: underline; text-decoration-color: var(--accent); }
.hy-copy.copied { color: var(--ink-2); }
.hy-copy svg { display: inline-block; }
.hy-tags {
  display: flex; flex-wrap: wrap; gap: 16px;
  font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase;
}
.hy-tags a {
  color: var(--accent);
  font-weight: 500;
}
.hy-tags a:hover {
  text-decoration: underline;
  text-decoration-color: color-mix(in srgb, var(--accent) 50%, transparent);
  text-underline-offset: 3px;
}
.hy-permalink {
  font-size: 12px; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--accent); font-weight: 600;
  white-space: nowrap;
}
.hy-permalink:hover { text-decoration: underline; text-decoration-color: var(--accent); }

/* Pagination on homepage */
.hy-pagination {
  display: flex; justify-content: space-between; align-items: center;
  padding: 32px 0 0;
  border-top: 1px solid var(--rule);
  font-size: 12px; letter-spacing: 0.14em; text-transform: uppercase;
  margin-top: 8px;
}
.hy-pagination a { color: var(--accent); font-weight: 600; }
.hy-pagination a:hover { text-decoration: underline; }
.hy-pagination .current { color: var(--ink-3); }
.hy-pagination .disabled { color: var(--ink-3); opacity: 0.4; }

/* ====================================
   8. POST PAGE
   ==================================== */
.pp-meta {
  display: flex; gap: 18px; align-items: baseline; margin-bottom: 14px;
  font-family: var(--f-body); font-size: 11px; letter-spacing: 0.18em;
  text-transform: uppercase;
}
.pp-meta .date { color: var(--accent); font-weight: 600; }
.pp-meta .read { color: var(--ink-3); letter-spacing: 0.08em; text-transform: none; font-size: 12px; }
.pp-meta .type { color: var(--ink-2); }

.pp-title {
  font-family: var(--f-body); font-weight: 700;
  font-size: 36px; line-height: 1.15; letter-spacing: -0.015em;
  margin: 0 0 32px; max-width: 22ch; color: var(--ink);
}

.pp-prose { font-family: var(--f-body); max-width: 64ch; }
.pp-prose p { margin: 0 0 1.1em; line-height: 1.65; font-weight: var(--w-body); }
.pp-prose h2 {
  font-family: var(--f-body); font-weight: 700;
  font-size: 22px; letter-spacing: -0.01em;
  margin: 2.2em 0 0.6em; padding-top: 0.4em; color: var(--ink);
}
.pp-prose h3 {
  font-family: var(--f-body); font-weight: 600;
  font-size: 17px; margin: 2em 0 0.4em; color: var(--ink);
}
.pp-prose h4 {
  font-family: var(--f-body); font-weight: 600;
  font-size: 15px; margin: 1.8em 0 0.4em; color: var(--ink);
}
.pp-prose ul, .pp-prose ol {
  margin: 0.8em 0 1.1em;
  padding-left: 1.6em; font-weight: var(--w-body);
}
.pp-prose li { margin-bottom: 0.5em; line-height: 1.65; }
.pp-prose li li { margin-bottom: 0.3em; }
.pp-prose blockquote {
  background: var(--paper-2);
  border-left: 3px solid var(--accent);
  border-radius: 4px;
  padding: 14px 20px;
  margin: 1.6em 0;
  color: var(--ink-2);
}
.pp-prose blockquote p { color: var(--ink-2); margin: 0 0 0.8em; }
.pp-prose blockquote p:last-child { margin-bottom: 0; }
/* Nested lists inside post-page blockquote */
.pp-prose blockquote ul,
.pp-prose blockquote ol { margin: 0.4em 0; padding-left: 1.6em; }
.pp-prose strong { font-weight: 600; color: var(--ink); }
.pp-prose em { font-style: italic; }
.pp-prose code {
  font-family: ui-monospace, 'SF Mono', Monaco, monospace;
  font-size: 0.85em;
  background: var(--paper-2);
  border: 1px solid var(--rule-soft);
  padding: 0.15em 0.4em;
  border-radius: 3px;
  font-weight: 400;
}
.pp-prose pre {
  background: var(--paper-2);
  border: 1px solid var(--rule);
  padding: 16px;
  overflow-x: auto;
  margin: 1.6em 0;
  border-radius: 4px;
  font-size: 14px; line-height: 1.6;
}
.pp-prose pre code { background: none; border: none; padding: 0; }
.pp-prose table { width: 100%; border-collapse: collapse; margin: 1.6em 0; font-size: 14px; }
.pp-prose th {
  text-align: left; padding: 8px 12px;
  border-bottom: 2px solid var(--rule); font-weight: 600;
}
.pp-prose td {
  padding: 8px 12px;
  border-bottom: 1px solid var(--rule-soft); font-weight: var(--w-body);
}
.pp-prose tr:last-child td { border-bottom: none; }
.pp-prose hr { border: none; border-top: 1px solid var(--rule); margin: 2em 0; }

/* Inline image support in prose */
.pp-prose img { max-width: 100%; height: auto; display: block; margin: 1.6em auto; }

/* Footnote superscript inline in body text */
.pp-prose sup.fnref {
  font-size: 0.7em; vertical-align: super; line-height: 0;
  color: var(--accent); font-weight: 600; padding: 0 1px;
}
.pp-prose sup.fnref a { color: var(--accent); }

/* marked-footnote plugin output — styled to match design */
.pp-prose .footnotes {
  margin: 56px 0 0; padding: 24px 0 0;
  border-top: 1px solid var(--rule);
  font-size: 14px; line-height: 1.55;
}
.pp-prose .footnotes h2,
.pp-prose .footnotes h3 {
  font-family: var(--f-body); font-size: 11px; letter-spacing: 0.22em;
  text-transform: uppercase; color: var(--accent); font-weight: 700;
  margin: 0 0 14px; padding: 0;
}
.pp-prose .footnotes ol { padding-left: 1.4em; margin: 0; }
.pp-prose .footnotes li { margin-bottom: 0.8em; color: var(--ink-2); font-weight: var(--w-body); }
.pp-prose .footnotes li::marker { color: var(--accent); font-weight: 600; }
.pp-prose .footnotes a { color: var(--accent); }
.pp-prose .footnotes p { display: inline; margin: 0; font-size: inherit; font-weight: var(--w-body); }

/* Superscript links generated by marked-footnote */
.pp-prose sup a {
  color: var(--accent); font-weight: 600; font-size: 0.8em;
}

/* Post tags */
.pp-tags {
  margin: 48px 0 0; padding: 24px 0 0;
  border-top: 1px solid var(--rule);
  display: flex; gap: 14px; align-items: baseline;
  font-size: 11px; letter-spacing: 0.18em; text-transform: uppercase;
}
.pp-tags .label { color: var(--ink-3); }
.pp-tags a { color: var(--accent); font-weight: 600; }
.pp-tags a:hover {
  text-decoration: underline;
  text-decoration-color: color-mix(in srgb, var(--accent) 50%, transparent);
  text-underline-offset: 3px;
}

/* Prev/Next pagination */
.pp-pagination {
  margin: 36px 0 0; padding: 24px 0 0;
  border-top: 1px solid var(--rule);
  display: grid; grid-template-columns: 1fr 1fr; gap: 24px;
}
.pp-pagination a { color: var(--ink); display: block; }
.pp-pagination .label {
  font-size: 11px; letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--accent); font-weight: 600; margin-bottom: 6px; display: block;
}
.pp-pagination .ttl { font-size: 15px; font-weight: 600; line-height: 1.35; }
.pp-pagination .next { text-align: right; }
.pp-pagination a:hover .ttl { color: var(--accent); }

/* ====================================
   9. ARCHIVES
   ==================================== */
.ar-h1 {
  font-family: var(--f-body); font-weight: 700;
  font-size: 32px; letter-spacing: -0.01em;
  margin: 0 0 24px; color: var(--ink);
}
.ar-search {
  background: var(--paper-2); border: 1px solid var(--rule);
  border-radius: 999px;
  padding: 12px 20px; display: flex; align-items: center; gap: 12px;
  margin-bottom: 18px;
}
.ar-search input {
  border: none; outline: none; background: transparent;
  font-family: var(--f-body); font-size: 16px; font-weight: var(--w-body);
  flex: 1; color: var(--ink);
}
.ar-search input::placeholder { color: var(--ink-3); }
.ar-search .icon { color: var(--accent); width: 18px; height: 18px; flex-shrink: 0; display: block; }

.ar-stats {
  display: flex; gap: 28px; padding: 14px 0;
  justify-content: space-between;
  border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule);
  margin-bottom: 36px;
}
.ar-stats .stat {
  text-align: center;
  flex: 1;
}
.ar-stats .stat .n {
  font-family: var(--f-body); font-weight: 700; font-size: 20px;
  color: var(--accent); display: block; line-height: 1;
  text-align: center;
}
.ar-stats .stat .l {
  font-size: 10px; letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--ink-3); margin-top: 6px; display: block;
  text-align: center;
}

.ar-section-label {
  font-family: var(--f-body); font-weight: 600;
  font-size: 11px; letter-spacing: 0.22em;
  text-transform: uppercase; color: var(--accent);
  margin: 28px 0 12px; padding-bottom: 6px;
  border-bottom: 1px solid var(--rule);
}

/* Tag cloud */
.ar-tagcloud { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 32px; }
.ar-tagcloud a {
  font-size: 12px; padding: 5px 12px;
  background: var(--paper-2); border: 1px solid var(--rule);
  border-radius: 999px;
  color: var(--accent);
  display: inline-flex; align-items: baseline; gap: 6px;
}
.ar-tagcloud a .n { color: var(--ink-3); font-size: 10px; }
.ar-tagcloud a:hover {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 8%, var(--paper));
}
.ar-tagcloud a.big { font-size: 13px; font-weight: 500; }
.ar-tagcloud a.bigger { font-size: 14px; font-weight: 600; }

/* Collapsible year blocks */
.ar-year-block { border-top: 1px solid var(--rule); }
.ar-year-block:last-of-type { border-bottom: 1px solid var(--rule); }
.ar-year-block summary {
  list-style: none; cursor: pointer;
  display: flex; align-items: baseline; justify-content: space-between;
  padding: 18px 4px;
  font-family: var(--f-body); font-weight: 700;
  font-size: 22px; color: var(--ink);
  letter-spacing: 0.01em;
  position: relative;
  user-select: none;
}
.ar-year-block summary::-webkit-details-marker { display: none; }
.ar-year-block summary::before {
  content: '+'; position: absolute; right: 4px;
  font-family: var(--f-body); font-weight: 400;
  font-size: 22px; color: var(--accent);
}
.ar-year-block[open] > summary::before { content: '–'; }
.ar-year-block summary:hover { color: var(--accent); }
.ar-year-count {
  font-family: var(--f-body); font-weight: 400;
  font-size: 11px; letter-spacing: 0.18em;
  text-transform: uppercase; color: var(--ink-3);
  margin-left: 14px; padding-right: 28px;
}
.ar-year-body { padding: 0 4px 18px; }

.ar-month {
  font-family: var(--f-body); font-weight: 600;
  font-size: 11px; letter-spacing: 0.22em;
  text-transform: uppercase; color: var(--ink-2);
  margin: 18px 0 6px;
}
.ar-list { list-style: none; padding: 0; margin: 0; }
.ar-list li {
  display: grid; grid-template-columns: 80px 1fr auto; gap: 18px;
  padding: 8px 0; border-bottom: 1px dotted var(--rule);
  align-items: baseline;
}
.ar-list li:last-child { border-bottom: none; }
.ar-list .date {
  font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--ink-3);
}
.ar-list .ttl { font-size: 15px; color: var(--ink); font-weight: 600; line-height: 1.35; }
.ar-list a:hover .ttl { color: var(--accent); }
.ar-list .type {
  font-size: 10px; letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--ink-3); justify-self: end;
}

/* Archive search — hide non-matching items */
.ar-list li[hidden] { display: none; }
.ar-year-block[data-empty] summary { opacity: 0.4; }

/* ====================================
   10. ABOUT
   ==================================== */
.ab-h1 {
  font-family: var(--f-body); font-weight: 700;
  font-size: 36px; letter-spacing: -0.015em;
  margin: 0 0 8px; color: var(--ink);
}
.ab-sub {
  font-size: 13px; color: var(--ink-3); margin-bottom: 32px;
  letter-spacing: 0.06em; text-transform: uppercase;
}
.ab-prose { font-family: var(--f-body); max-width: 64ch; }
.ab-prose p { margin: 0 0 1.1em; line-height: 1.65; font-weight: var(--w-body); }
.ab-prose h2 {
  font-family: var(--f-body); font-weight: 700;
  font-size: 18px; letter-spacing: 0.01em;
  margin: 2em 0 0.6em; color: var(--ink);
}
.ab-prose a {
  color: var(--accent);
  border-bottom: 1px solid color-mix(in srgb, var(--accent) 30%, transparent);
}
.ab-prose a:hover { border-bottom-color: var(--accent); }
.ab-prose strong { font-weight: 600; }
.ab-prose ul, .ab-prose ol { margin: 0.8em 0 1.1em; padding-left: 1.6em; font-weight: var(--w-body); }
.ab-prose li { margin-bottom: 0.4em; line-height: 1.65; }

/* ====================================
   11. 404
   ==================================== */
.nf-wrap {
  max-width: 760px; margin: 0 auto; padding: 120px 56px 96px;
  text-align: center;
}
.nf-mark {
  font-family: var(--f-mark); font-weight: 700;
  font-size: 18px; letter-spacing: 0.04em;
  color: var(--accent); margin-bottom: 60px;
  text-transform: uppercase; display: block;
}
.nf-num {
  font-family: var(--f-mark); font-weight: 700;
  font-size: 120px; letter-spacing: -0.01em;
  color: var(--ink); line-height: 1;
  position: relative; display: inline-block;
}
.nf-num::after {
  content: ''; display: block; width: 56px; height: 3px;
  background: var(--accent); margin: 24px auto 0;
}
.nf-line {
  font-family: var(--f-body); font-weight: 700;
  font-size: 28px; letter-spacing: -0.005em;
  margin: 36px 0 18px; color: var(--ink);
}
.nf-line em { color: var(--accent); font-style: normal; }
.nf-sub {
  font-family: var(--f-body); font-size: 16px; line-height: 1.6;
  color: var(--ink-2); max-width: 48ch; margin: 0 auto 36px;
  font-weight: var(--w-body);
}
.nf-actions {
  display: flex; gap: 32px; justify-content: center;
  font-size: 12px; letter-spacing: 0.18em; text-transform: uppercase;
}
.nf-actions a {
  padding-bottom: 6px; border-bottom: 1px solid var(--accent);
  color: var(--accent); font-weight: 600;
}
.nf-actions a.muted { color: var(--ink-2); border-color: var(--ink-3); }

/* ====================================
   12. IMAGES & MEDIA (functional)
   ==================================== */
.image-container {
  position: relative;
  margin: 1.5em 0;
  text-align: center;
  max-width: 100%; overflow: hidden;
}
.inline-image {
  max-width: 100%; max-height: 500px;
  width: auto; height: auto;
  border: 1px solid var(--rule);
  display: block; margin: 0 auto;
  object-fit: contain;
  transition: var(--transition-base);
}
.inline-image:hover { box-shadow: var(--shadow-md); }
.image-caption {
  margin-top: 10px;
  font-size: 12px; color: var(--ink-3);
  font-style: italic; text-align: center;
  padding-top: 10px;
  border-top: 1px solid var(--rule-soft);
}
.clickable-image { cursor: pointer !important; }
.clickable-image:hover { box-shadow: var(--shadow-lg) !important; }
.linked-image { border: 1px solid var(--rule); transition: var(--transition-base); cursor: pointer; }
.linked-image:hover { border-color: var(--accent); }
.image-container .image-link { display: block; text-decoration: none; position: relative; }
.image-container .image-link::after {
  content: "↗"; position: absolute; top: 8px; right: 8px;
  background: rgba(42,36,29,0.8); color: var(--paper);
  padding: 2px 6px; font-size: 11px; opacity: 0; transition: var(--transition-base);
}
.image-container .image-link:hover::after { opacity: 1; }

/* Image modal / lightbox */
.image-modal {
  display: none; position: fixed; z-index: 9999;
  left: 0; top: 0; width: 100%; height: 100%;
  background-color: rgba(0,0,0,0.9); cursor: pointer;
}
.image-modal.show {
  display: flex; align-items: center; justify-content: center; flex-direction: column;
}
.modal-image {
  max-width: 90%; max-height: 90%; object-fit: contain;
  border-radius: 4px; box-shadow: var(--shadow-lg);
}
.modal-close {
  position: absolute; top: 20px; right: 35px;
  color: #fff; font-size: 40px; font-weight: bold;
  cursor: pointer; z-index: 10000; user-select: none;
}
.modal-close:hover { color: #ccc; }
.modal-caption {
  color: #fff; text-align: center; font-size: 14px;
  margin-top: 16px; background: rgba(0,0,0,0.7);
  padding: 8px 16px; max-width: 80%;
}

/* Video embeds */
.video-container {
  position: relative; padding-bottom: 56.25%;
  height: 0; overflow: hidden;
  max-width: 560px; margin: 1.5em auto;
}
.video-container iframe {
  position: absolute; top: 0; left: 0;
  width: 100%; height: 100%; border: 0;
}

/* Tweet embeds */
.tweet-container { max-width: 350px; margin: 1em auto; }

/* ====================================
   13. UTILITIES
   ==================================== */
.visually-hidden {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

/* ====================================
   14. ANIMATIONS
   ==================================== */
@keyframes modalFadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes imageZoomIn {
  from { opacity: 0; transform: scale(0.8); }
  to   { opacity: 1; transform: scale(1); }
}

/* ====================================
   15. RESPONSIVE
   ==================================== */

/* Tablet — collapse sidebar */
@media (max-width: 960px) {
  .at-header { padding: 20px 0 14px; }
  .at-header-inner { grid-template-columns: minmax(0,1fr); gap: 0; padding: 0 32px; }
  .at-header-inner > div:last-child { display: none; }
  .at-body {
    grid-template-columns: minmax(0,1fr);
    padding: 32px 32px 40px;
    gap: 0;
  }
  .at-side {
    border-top: 1px solid var(--rule);
    padding-top: 32px;
    margin-top: 32px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 24px;
  }
  .at-side > section { margin-bottom: 0; }
  .at-footer { padding: 20px 32px; }
  .hy-entry { grid-template-columns: 92px minmax(0,1fr); gap: 20px; }
}

/* Mobile */
@media (max-width: 600px) {
  .at-header { padding: 14px 0 10px; }
  .at-header-inner { padding: 0 20px; }
  .at-name { font-size: 32px; }
  .at-nav { gap: 18px; font-size: 11px; flex-wrap: wrap; margin-top: 10px; }
  .at-body { padding: 24px 20px 32px; }
  .at-body.single { padding: 24px 20px 32px; }
  .at-body.archive { padding: 24px 20px 32px; }
  .at-footer {
    padding: 16px 20px;
    flex-direction: column; gap: 12px; text-align: center;
  }
  .at-footer .links { justify-content: center; }
  .at-side { grid-template-columns: 1fr; }

  /* Homepage entries */
  .hy-entry { grid-template-columns: 1fr; gap: 4px; }
  .hy-rail { display: flex; gap: 10px; flex-wrap: wrap; padding-top: 0; }
  .hy-title { font-size: 22px; }

  /* Post page */
  .pp-title { font-size: 26px; max-width: 100%; }
  .pp-pagination { grid-template-columns: 1fr; gap: 16px; }
  .pp-pagination .next { text-align: left; }

  /* Archives */
  .ar-list li { grid-template-columns: 58px 1fr; }
  .ar-list .type { display: none; }
  .ar-h1 { font-size: 24px; }

  /* 404 */
  .nf-wrap { padding: 80px 20px 60px; }
  .nf-num { font-size: 80px; }
  .nf-line { font-size: 22px; }

  /* Images */
  .inline-image { max-height: 300px; }
  .modal-close { top: 10px; right: 15px; font-size: 32px; }
  .modal-image { max-width: 95%; max-height: 80%; }
  .modal-caption { font-size: 12px; margin-top: 8px; max-width: 90%; }
  .video-container { max-width: 100%; }
  .tweet-container { max-width: 100%; }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
  html { scroll-behavior: auto; }
}

/* Print */
@media print {
  .at-header, .at-side, .at-footer, .image-modal { display: none !important; }
  .at-body { display: block; }
  body { background: #fff; color: #000; font-size: 12pt; }
  a { color: #000; text-decoration: underline; }
}
