/* TypingMind Changelog — see README.md "Design rules" before editing. */

/* ---------- tokens ---------- */
:root {
  color-scheme: light;
  --bg: #ffffff;
  --bg-elev: #ffffff;
  --surface: #f6f7f9;
  --surface-2: #eef0f4;
  --text: #0f172a;
  --text-2: #475569;
  --text-3: #64748b;
  --border: #e6e8ec;
  --line: #e2e5ea;
  --brand: #2563eb;
  --brand-hover: #1d4ed8;
  --brand-text: #2563eb;
  --brand-soft: #eaf1ff;
  --on-brand: #ffffff;
  --shadow-sm: 0 1px 2px rgb(15 23 42 / 0.06);
  --shadow-md: 0 8px 28px -6px rgb(15 23 42 / 0.16), 0 2px 6px rgb(15 23 42 / 0.06);
  --media-shadow: 0 1px 2px rgb(15 23 42 / 0.05), 0 12px 32px -12px rgb(15 23 42 / 0.18);
  --tag-new: #15803d;
  --tag-improved: #0369a1;
  --tag-fixed: #7e22ce;
  --topbar-bg: rgb(255 255 255 / 0.82);
  --mm-bar: #d6dae1;
  --mm-bar-hover: #9aa3b2;

  --font: 'Inter', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --date-col: 6.5rem;
  --rail-col: 3rem;
  --content: 50rem; /* ~800px reading column for entry content */
  --container: calc(var(--content) + var(--date-col) + var(--rail-col) + 3rem);
  --topbar-h: 3.75rem;
  --radius: 12px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #0b0d12;
    --bg-elev: #14171f;
    --surface: #14171f;
    --surface-2: #1b1f29;
    --text: #e8eaf0;
    --text-2: #aab1bf;
    --text-3: #808898;
    --border: #252a35;
    --line: #262b36;
    --brand: #3b82f6;
    --brand-hover: #2563eb;
    --brand-text: #7aa7ff;
    --brand-soft: rgb(59 130 246 / 0.14);
    --shadow-sm: 0 1px 2px rgb(0 0 0 / 0.4);
    --shadow-md: 0 12px 32px -6px rgb(0 0 0 / 0.6), 0 2px 6px rgb(0 0 0 / 0.4);
    --media-shadow: 0 1px 2px rgb(0 0 0 / 0.4), 0 16px 36px -14px rgb(0 0 0 / 0.7);
    --tag-new: #4ade80;
    --tag-improved: #38bdf8;
    --tag-fixed: #c084fc;
    --topbar-bg: rgb(11 13 18 / 0.8);
    --mm-bar: #343a47;
    --mm-bar-hover: #6b7384;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0b0d12;
  --bg-elev: #14171f;
  --surface: #14171f;
  --surface-2: #1b1f29;
  --text: #e8eaf0;
  --text-2: #aab1bf;
  --text-3: #808898;
  --border: #252a35;
  --line: #262b36;
  --brand: #3b82f6;
  --brand-hover: #2563eb;
  --brand-text: #7aa7ff;
  --brand-soft: rgb(59 130 246 / 0.14);
  --shadow-sm: 0 1px 2px rgb(0 0 0 / 0.4);
  --shadow-md: 0 12px 32px -6px rgb(0 0 0 / 0.6), 0 2px 6px rgb(0 0 0 / 0.4);
  --media-shadow: 0 1px 2px rgb(0 0 0 / 0.4), 0 16px 36px -14px rgb(0 0 0 / 0.7);
  --tag-new: #4ade80;
  --tag-improved: #38bdf8;
  --tag-fixed: #c084fc;
  --topbar-bg: rgb(11 13 18 / 0.8);
  --mm-bar: #343a47;
  --mm-bar-hover: #6b7384;
}

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--topbar-h) + 1.5rem); }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 16px/1.6 var(--font);
  font-feature-settings: 'cv11', 'ss01';
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
main { flex: 1; }
img, video { max-width: 100%; height: auto; }
a { color: inherit; }
svg { width: 1.125rem; height: 1.125rem; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; flex: none; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: 6px; }
.sr-only { position: absolute; 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: 1rem; top: -3rem; z-index: 100; background: var(--brand); color: var(--on-brand); padding: .5rem .875rem; border-radius: 8px; text-decoration: none; }
.skip-link:focus { top: 1rem; }

.container { max-width: var(--container); margin: 0 auto; padding: 0 1.5rem; }
.container--single { max-width: calc(var(--content) + 3rem); padding-block: 2.5rem 4rem; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: .5rem;
  height: 2.5rem; padding: 0 1rem;
  border-radius: 999px; border: 1px solid transparent;
  font: 500 .9375rem/1 var(--font); text-decoration: none; cursor: pointer; white-space: nowrap;
  transition: background-color .15s, border-color .15s, color .15s;
}
.btn-primary { background: var(--brand); color: var(--on-brand); }
.btn-primary:hover { background: var(--brand-hover); }
.btn-outline { background: var(--bg-elev); color: var(--text); border-color: var(--border); box-shadow: var(--shadow-sm); }
.btn-outline:hover { border-color: var(--text-3); }
.btn-icon svg { width: .875rem; height: .875rem; }
.icon-btn {
  display: inline-grid; place-items: center; width: 2.5rem; height: 2.5rem;
  border-radius: 999px; border: 0; background: transparent; color: var(--text-2); cursor: pointer;
  transition: background-color .15s, color .15s;
}
.icon-btn:hover, .icon-btn[aria-expanded="true"] { background: var(--surface-2); color: var(--text); }
.icon-btn.is-active { color: var(--brand-text); background: var(--brand-soft); }
.link-btn { border: 0; background: none; padding: 0; color: var(--brand-text); font: 500 .875rem var(--font); cursor: pointer; }
.link-btn:hover { text-decoration: underline; }
.text-link { color: var(--text-3); font-size: .875rem; }
.text-link:hover { color: var(--text); }

/* ---------- topbar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 40;
  padding-top: env(safe-area-inset-top, 0px);
  background: var(--topbar-bg);
  -webkit-backdrop-filter: saturate(180%) blur(14px); backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--border);
}
.topbar-inner { max-width: var(--container); margin: 0 auto; padding: 0 1.5rem; height: var(--topbar-h); display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.brand { display: flex; align-items: center; gap: .625rem; text-decoration: none; flex: none; }
.brand img { border-radius: 7px; }
.wordmark { font-weight: 700; font-size: 1.0625rem; letter-spacing: -.01em; }
.wordmark span { color: var(--brand-text); }
.brand-sep { color: var(--border); font-size: 1.25rem; font-weight: 300; }
.brand-sub { color: var(--text-2); font-weight: 500; font-size: .9375rem; }
.topbar-actions { display: flex; align-items: center; gap: .5rem; }
.topbar-link { display: inline-flex; align-items: center; gap: .375rem; padding: .375rem .625rem; border-radius: 8px; color: var(--text-2); text-decoration: none; font-size: .9375rem; font-weight: 500; white-space: nowrap; }
.topbar-link svg { width: 1rem; height: 1rem; }
.topbar-link:hover { color: var(--text); background: var(--surface-2); }
.lbl-short { display: none; }
.topbar .btn { height: 2.25rem; padding: 0 .875rem; font-size: .875rem; }
[data-theme-toggle] .i-moon { display: none; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) [data-theme-toggle] .i-sun { display: none; } :root:not([data-theme="light"]) [data-theme-toggle] .i-moon { display: block; } }
:root[data-theme="dark"] [data-theme-toggle] .i-sun { display: none; }
:root[data-theme="dark"] [data-theme-toggle] .i-moon { display: block; }

/* ---------- page head ---------- */
.page-head {
  display: flex; align-items: flex-end; justify-content: space-between; gap: 1.5rem; flex-wrap: wrap;
  padding: 3.5rem 0 1.25rem; margin-left: calc(var(--date-col) + var(--rail-col));
}
.page-head h1 { margin: 0; font-size: 2rem; line-height: 1.2; font-weight: 700; letter-spacing: -.025em; }
.lede { margin: .375rem 0 0; color: var(--text-2); font-size: 1.0625rem; }
.head-actions { display: flex; align-items: center; gap: .375rem; }
.head-actions .btn { margin-left: .375rem; }

.filter { position: relative; }
.menu {
  position: absolute; right: 0; top: calc(100% + .5rem); z-index: 30;
  width: 16rem; max-height: min(26rem, 70vh); overflow: auto;
  padding: .375rem; background: var(--bg-elev); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-md);
}
.menu-label { margin: .375rem .625rem .5rem; font-size: .75rem; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--text-3); }
.menu button {
  display: flex; align-items: center; gap: .625rem; width: 100%;
  padding: .5rem .625rem; border: 0; border-radius: 8px; background: none; color: var(--text);
  font: 400 .9375rem var(--font); text-align: left; cursor: pointer;
}
.menu button:hover { background: var(--surface-2); }
.menu button[aria-checked="true"] { background: var(--brand-soft); color: var(--brand-text); font-weight: 500; }
.menu .count { margin-left: auto; color: var(--text-3); font-size: .8125rem; font-variant-numeric: tabular-nums; }
.swatch { width: .5rem; height: .5rem; border-radius: 50%; background: var(--text-3); flex: none; }
.swatch.tag--new { background: var(--tag-new); }
.swatch.tag--improved { background: var(--tag-improved); }
.swatch.tag--fixed { background: var(--tag-fixed); }

/* One row of tabs; scrolls sideways when the years don't fit (the bottom line is an inset shadow so the scroll box doesn't clip the active underline) */
.year-nav { display: flex; gap: .25rem; margin: 0 0 1.5rem calc(var(--date-col) + var(--rail-col)); box-shadow: inset 0 -1px 0 var(--border); overflow-x: auto; scrollbar-width: none; overscroll-behavior-x: contain; }
.year-nav::-webkit-scrollbar { display: none; }
.year-nav a { flex: none; white-space: nowrap; padding: .625rem 1rem; color: var(--text-3); text-decoration: none; font-weight: 600; font-size: 1.125rem; line-height: 1.3; border-bottom: 2px solid transparent; font-variant-numeric: tabular-nums; }
.year-nav a:hover { color: var(--text); }
.year-nav a[aria-current="page"] { color: var(--text); border-bottom-color: var(--brand); }

.filter-status { display: flex; align-items: center; gap: 1rem; margin: -.5rem 0 1.5rem calc(var(--date-col) + var(--rail-col)); color: var(--text-2); font-size: .9375rem; }
.filter-status[hidden] { display: none; }
.filter-empty { margin-left: calc(var(--date-col) + var(--rail-col)); color: var(--text-3); padding: 2rem 0; }

/* ---------- timeline ---------- */
.timeline { position: relative; padding-bottom: 2rem; }
.timeline::before {
  content: ''; position: absolute; top: .5rem; bottom: 0;
  left: calc(var(--date-col) + var(--rail-col) / 2 - .5px); width: 1px;
  background: linear-gradient(to bottom, var(--line) 0, var(--line) calc(100% - 6rem), transparent);
}
.entry, .tl-month, .tl-divider {
  display: grid; grid-template-columns: var(--date-col) var(--rail-col) minmax(0, 1fr); position: relative;
}
.entry-rail { display: flex; justify-content: center; }
.dot {
  position: relative; z-index: 1; display: block; width: 11px; height: 11px; margin-top: .4rem;
  border-radius: 50%; background: var(--bg); border: 2px solid var(--text-3);
}
.entry-date { text-align: right; padding-right: .25rem; }
.entry-date a { color: var(--text-3); text-decoration: none; font-size: .9375rem; font-variant-numeric: tabular-nums; white-space: nowrap; }
.entry-date a:hover { color: var(--text); }

.tl-month { padding: 1.5rem 0 .75rem; }
.tl-month:first-child { padding-top: .25rem; }
.dot--month { width: 7px; height: 7px; margin-top: .45rem; background: var(--line); border: 0; box-shadow: 0 0 0 4px var(--bg); }
.month-label { margin: 0; font-size: .75rem; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; color: var(--text-3); }

/* full entries */
.entry--full { padding: .25rem 0 3.5rem; }
.entry--full .entry-date, .entry--full .entry-rail { position: sticky; top: calc(var(--topbar-h) + 1.25rem); align-self: start; height: max-content; padding-top: .55rem; }
.entry--full .entry-date a { font-size: 1.0625rem; }
.entry--full .dot { margin-top: .5rem; }
.entry--full.is-latest .dot { background: var(--brand); border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-soft); }
.entry--full .entry-title { margin: 0; font-size: clamp(1.625rem, 1.2rem + 1.4vw, 2.25rem); line-height: 1.2; font-weight: 700; letter-spacing: -.025em; text-wrap: balance; }
.entry-title a { text-decoration: none; }
.entry-title a:hover { color: var(--brand-text); }
.entry--full .tags { margin-top: .875rem; }
.entry--full .prose { margin-top: 1.25rem; }

/* divider before collapsed entries */
.tl-divider { padding: 1rem 0 .25rem; }
.tl-divider-inner { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; border-top: 1px solid var(--border); padding-top: 2rem; }
.timeline > .tl-divider:first-child .tl-divider-inner { border-top: 0; padding-top: .5rem; }
.tl-divider p { margin: 0; color: var(--text-2); font-weight: 500; }

/* compact (collapsed) entries */
.entry--compact .entry-date { padding-top: 1.5rem; }
.entry--compact .dot { width: 9px; height: 9px; margin-top: 1.85rem; border-width: 2px; border-color: var(--line); }
.entry--compact:hover .dot, .entry--compact:has(details[open]) .dot { border-color: var(--brand); }
.entry--compact .entry-main { border-bottom: 1px solid var(--border); padding: 1.5rem 0; }
.tl-month + .entry--compact .entry-main { padding-top: .75rem; }
.tl-month + .entry--compact .entry-date { padding-top: .75rem; }
.tl-month + .entry--compact .dot { margin-top: 1.1rem; }
.entry--compact summary { display: block; list-style: none; cursor: pointer; }
.entry--compact summary::-webkit-details-marker { display: none; }
.entry--compact .entry-title { margin: 0; font-size: 1.125rem; line-height: 1.4; font-weight: 600; letter-spacing: -.01em; }
.excerpt {
  margin: .375rem 0 0; color: var(--text-2);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
details[open] .excerpt { display: none; }
.entry-meta { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-top: .625rem; }
.toggle-hint { display: inline-flex; align-items: center; gap: .25rem; color: var(--text-3); font-size: .875rem; white-space: nowrap; }
.toggle-hint svg { width: 1rem; height: 1rem; transition: transform .2s; }
summary:hover .toggle-hint { color: var(--text); }
details[open] .toggle-hint svg { transform: rotate(180deg); }
.when-open, details[open] .when-closed { display: none; }
details[open] .when-open { display: inline; }
.entry--compact .prose { margin-top: 1rem; }
.permalink { display: inline-flex; align-items: center; gap: .375rem; margin-top: 1.25rem; color: var(--brand-text); font-weight: 500; text-decoration: none; font-size: .9375rem; }
.permalink:hover { text-decoration: underline; }
.permalink svg { width: 1rem; height: 1rem; }
.entry:target .entry-title a, .entry.is-target .entry-title a { color: var(--brand-text); }

.year-pager { margin: 1rem 0 4rem calc(var(--date-col) + var(--rail-col)); }
.year-pager a { display: inline-flex; align-items: center; gap: .5rem; color: var(--brand-text); font-weight: 500; text-decoration: none; }
.year-pager a:hover { text-decoration: underline; }

/* ---------- gutter minimap (built by main.js on list pages) ---------- */
/* Idle: a tiny rail of bars (active = long + dark). Hover/focus: a scrollable popover panel. */
.minimap {
  position: fixed; left: 1.25rem; top: 50%; transform: translateY(-50%); z-index: 35;
  display: none;
}
@media (min-width: 1200px) { .minimap { display: block; } }
.mm-rail {
  width: 2.25rem; height: 80vh; padding-left: .25rem; overflow: clip; cursor: pointer;
  -webkit-mask-image: linear-gradient(transparent, #000 12%, #000 88%, transparent);
  mask-image: linear-gradient(transparent, #000 12%, #000 88%, transparent);
}
.mm-rail ol { position: relative; top: 50%; list-style: none; margin: 0; padding: 0; transform: translateY(calc(-1 * var(--offset, 4px))); transition: transform .3s cubic-bezier(.2, .7, .2, 1); }
.mm-rail li { height: 8px; display: flex; align-items: center; }
.mm-bar { display: block; height: 2px; border-radius: 2px; width: var(--w, 6px); opacity: var(--o, 1); background: var(--mm-bar); transition: width .25s ease, opacity .25s ease, background-color .15s; }
.mm-bar.is-active { background: var(--text); }
.minimap:hover .mm-bar:not(.is-active) { background: var(--mm-bar-hover); }

.mm-panel {
  position: absolute; left: -.5rem; top: 50%; width: 19rem; max-height: 80vh;
  overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin;
  margin: 0; padding: .375rem; list-style: none;
  background: var(--bg-elev); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow-md);
  opacity: 0; pointer-events: none; transform: translate(-.25rem, -50%); transform-origin: left center;
  transition: opacity .15s ease, transform .15s ease;
}
.minimap.is-open .mm-panel { opacity: 1; pointer-events: auto; transform: translate(0, -50%); }
/* Labels come from data-* via attr() so they never add CMD+F matches. */
.mm-month { padding: .625rem .625rem .25rem; }
.mm-month::before { content: attr(data-label); font-size: .6875rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--text-3); }
.mm-link { display: flex; align-items: baseline; gap: .625rem; padding: .375rem .625rem; border-radius: 8px; text-decoration: none; font-size: .8125rem; line-height: 1.35; outline-offset: -2px; }
.mm-link::before { content: attr(data-date); flex: none; width: 3rem; color: var(--text-3); font-variant-numeric: tabular-nums; }
.mm-link::after { content: attr(data-title); min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; color: var(--text-2); }
.mm-link:hover { background: var(--surface-2); }
.mm-link:hover::after { color: var(--text); }
.mm-link[aria-current="true"] { background: var(--brand-soft); }
.mm-link[aria-current="true"]::before, .mm-link[aria-current="true"]::after { color: var(--brand-text); }
.mm-link[aria-current="true"]::after { font-weight: 600; }

/* ---------- tags ---------- */
.tags { display: flex; flex-wrap: wrap; gap: .25rem 1rem; margin: 0; padding: 0; list-style: none; font-size: .875rem; color: var(--text-3); }
.tag--type { font-weight: 500; }
.tag--new { color: var(--tag-new); }
.tag--improved { color: var(--tag-improved); }
.tag--fixed { color: var(--tag-fixed); }

/* ---------- prose (entry content) ---------- */
.prose { color: var(--text-2); font-size: 1.0625rem; line-height: 1.75; overflow-wrap: anywhere; }
.prose > :first-child { margin-top: 0; }
.prose > :last-child { margin-bottom: 0; }
.prose p { margin: 0 0 1rem; }
.prose strong { color: var(--text); font-weight: 600; }
.prose a { color: var(--brand-text); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 2px; }
.prose a:hover { text-decoration-thickness: 2px; }
.prose h3, .prose h4, .prose h5 { color: var(--text); line-height: 1.35; letter-spacing: -.01em; margin: 1.75rem 0 .625rem; }
.prose h3 { font-size: 1.25rem; font-weight: 650; }
.prose h4 { font-size: 1.125rem; font-weight: 600; }
.prose h5 { font-size: 1rem; font-weight: 600; }
.prose ul, .prose ol { margin: 0 0 1rem; padding-left: 1.375rem; }
.prose li { margin: .375rem 0; padding-left: .25rem; }
.prose li::marker { color: var(--text-3); }
.prose li > p { margin: 0; }
.prose code { font-family: var(--mono); font-size: .875em; background: var(--surface-2); color: var(--text); padding: .125em .375em; border-radius: 5px; }
.prose pre { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 1rem; overflow-x: auto; }
.prose pre code { background: none; padding: 0; }
.prose hr { border: 0; border-top: 1px solid var(--border); margin: 2rem 0; }
.prose blockquote { margin: 1rem 0; padding-left: 1rem; border-left: 3px solid var(--border); }
.prose figure { margin: 1.5rem 0; }
.prose img, .prose video {
  display: block; border-radius: var(--radius); border: 1px solid var(--border);
  box-shadow: var(--media-shadow); background: var(--surface);
}
.prose video { width: 100%; }
.prose figcaption { margin-top: .625rem; font-size: .875rem; color: var(--text-3); text-align: center; }
.prose .callout { margin: 1rem 0; padding: .875rem 1rem; border-radius: 10px; background: var(--brand-soft); border: 1px solid color-mix(in srgb, var(--brand) 25%, transparent); }
.prose .callout p:last-child { margin-bottom: 0; }

/* ---------- single entry page ---------- */
.back-link { display: inline-flex; align-items: center; gap: .375rem; color: var(--text-3); text-decoration: none; font-size: .9375rem; font-weight: 500; }
.back-link:hover { color: var(--text); }
.back-link svg { width: 1rem; height: 1rem; }
.single { margin-top: 2rem; }
.single-meta { color: var(--text-3); font-size: .9375rem; display: flex; align-items: center; gap: .5rem; }
.single-meta::before { content: ''; width: 9px; height: 9px; border-radius: 50%; background: var(--brand); box-shadow: 0 0 0 4px var(--brand-soft); }
.single h1 { margin: .75rem 0 1rem; font-size: clamp(1.875rem, 1.3rem + 2vw, 2.625rem); line-height: 1.15; font-weight: 700; letter-spacing: -.03em; text-wrap: balance; }
.single .prose { margin-top: 2rem; }
.single-actions { display: flex; align-items: center; gap: .75rem; flex-wrap: wrap; margin-top: 3rem; padding-top: 2rem; border-top: 1px solid var(--border); }
.single-actions .text-link { margin-left: auto; }
.pager { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-top: 2rem; }
.pager-link { display: flex; flex-direction: column; gap: .375rem; padding: 1rem 1.125rem; border: 1px solid var(--border); border-radius: var(--radius); text-decoration: none; transition: border-color .15s, background-color .15s; }
.pager-link:hover { border-color: var(--brand); background: var(--brand-soft); }
.pager-link--older { text-align: right; align-items: flex-end; }
.pager-dir { display: inline-flex; align-items: center; gap: .375rem; color: var(--text-3); font-size: .8125rem; font-weight: 500; }
.pager-dir svg { width: .875rem; height: .875rem; }
.pager-title { font-weight: 600; line-height: 1.35; }
.not-found { text-align: center; padding-block: 6rem; }
.not-found p { color: var(--text-2); }

/* ---------- footer ---------- */
.site-footer { border-top: 1px solid var(--border); padding-bottom: env(safe-area-inset-bottom, 0px); }
.footer-inner { max-width: var(--container); margin: 0 auto; padding: 1.5rem; display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; color: var(--text-3); font-size: .875rem; }
.footer-inner nav { display: flex; gap: 1.25rem; flex-wrap: wrap; }
.footer-inner a { text-decoration: none; }
.footer-inner a:hover { color: var(--text); }

/* ---------- subscribe dialog ---------- */
.dialog { border: 0; padding: 0; background: transparent; color: var(--text); width: min(28rem, calc(100vw - 2rem)); }
.dialog::backdrop { background: rgb(10 12 18 / 0.45); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); }
.dialog-body { position: relative; background: var(--bg-elev); border: 1px solid var(--border); border-radius: 16px; box-shadow: var(--shadow-md); padding: 1.75rem; }
.dialog-close { position: absolute; top: .75rem; right: .75rem; }
.dialog--newsletter { width: min(36rem, calc(100vw - 2rem)); }
.dialog-body--frame { padding: 2.75rem .5rem .75rem; overflow: hidden; }
.dialog-body--frame iframe { display: block; width: 100%; height: min(800px, calc(100vh - 9rem)); border: 0; border-radius: 10px; background: #fff; }
.dialog-fallback { margin: .625rem 0 0; text-align: center; font-size: .8125rem; color: var(--text-3); }
.dialog-fallback a { color: var(--brand-text); }

/* ---------- responsive ---------- */
@media (max-width: 760px) {
  :root { --date-col: 0px; --rail-col: 1.75rem; }
  .container, .topbar-inner { padding-inline: 1rem; }
  .topbar-actions { gap: .25rem; }
  .topbar-link { padding: .375rem .5rem; font-size: .875rem; }
  .page-head { padding-top: 2rem; margin-left: 0; align-items: flex-start; flex-direction: column; }
  .year-nav, .filter-status, .year-pager, .filter-empty { margin-left: 0; }
  .timeline::before { left: calc(var(--rail-col) / 2 - .5px); }
  .entry, .tl-month, .tl-divider { grid-template-columns: var(--rail-col) minmax(0, 1fr); grid-template-areas: "rail date" "rail main"; }
  .entry > .entry-rail, .tl-month > .entry-rail, .tl-divider > .entry-rail { grid-area: rail; grid-row: 1 / span 2; }
  .entry-date { grid-area: date; text-align: left; padding: 0 !important; position: static !important; }
  .entry-main, .month-label, .tl-divider-inner { grid-area: main; }
  .tl-month > div:first-child, .tl-divider > div:first-child { display: none; }
  .tl-month .month-label { grid-row: 1 / span 2; }
  .tl-divider .tl-divider-inner { grid-row: 1 / span 2; }
  .entry--full .entry-rail { position: static; padding-top: .2rem; }
  .entry--full .entry-date a { font-size: .9375rem; }
  .entry--full .entry-title { margin-top: .25rem; }
  .entry--compact { padding-top: 1.25rem; }
  .entry--compact .dot { margin-top: .45rem; }
  .entry--compact .entry-main { padding-top: .25rem; padding-bottom: 1.25rem; }
  .tl-month + .entry--compact { padding-top: .25rem; }
  .tl-month + .entry--compact .dot { margin-top: .45rem; }
  .tl-month + .entry--compact .entry-main { padding-top: .25rem; }
  .entry-meta { flex-wrap: wrap; }
  .prose { font-size: 1rem; }
  .pager { grid-template-columns: 1fr; }
  .single-actions .text-link { margin-left: 0; }
}

/* Narrow screens: make room for the Feature Request / Bug Report links. */
@media (max-width: 860px) {
  .brand-sep, .brand-sub { display: none; }
}
@media (max-width: 720px) {
  .wordmark { display: none; }
  .lbl-long { display: none; }
  .lbl-short { display: inline; }
}
@media (max-width: 500px) {
  .topbar .btn-primary { display: none; } /* App link stays in the footer */
}
@media (max-width: 380px) {
  .topbar-link svg { display: none; }
  .topbar-inner { gap: .5rem; }
  .topbar-link { padding: .375rem .375rem; font-size: .8125rem; }
}

main:focus { outline: none; }
/* Scroll-to-top button (added by main.js) */
.to-top { position: fixed; right: max(1.25rem, env(safe-area-inset-right, 0px)); bottom: calc(1.25rem + env(safe-area-inset-bottom, 0px)); z-index: 30; display: grid; place-items: center; width: 2.75rem; height: 2.75rem; padding: 0; border: 1px solid var(--border); border-radius: 999px; background: var(--bg-elev); color: var(--text-2); box-shadow: var(--shadow-md); cursor: pointer; opacity: 0; visibility: hidden; transform: translateY(.5rem); transition: opacity .2s, transform .2s, visibility .2s, color .15s, border-color .15s; }
.to-top.is-visible { opacity: 1; visibility: visible; transform: none; }
.to-top:hover { color: var(--text); border-color: var(--text-3); }
.to-top:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
@media (max-width: 760px) { .to-top { right: max(1rem, env(safe-area-inset-right, 0px)); bottom: calc(1rem + env(safe-area-inset-bottom, 0px)); } }
@media print { .to-top { display: none; } }

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