/* ============================================================
   Equ Blog · blue biosphere night theme (v9.5.6)
   deep night blues · dome amber · frosted glass · canvas rain
   Applies to: Zola homepage / article pages / tag pages,
   and the static mirror generated by scripts/generate_full_issue_pages.py
   ============================================================ */

@import url("https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@400;500&family=IBM+Plex+Sans:wght@400;500;600&family=Newsreader:ital,opsz,wght@0,6..72,400;0,6..72,500;0,6..72,600;1,6..72,400&family=Noto+Serif+SC:wght@400;500;600&display=swap");

/* ------------------------------------------------------------
   Design tokens — dark (default) is the biosphere night
   ------------------------------------------------------------ */
:root {
  color-scheme: dark;

  --bg: #081226;
  --bg-deep: #0a1730;
  --surface: rgba(10, 23, 42, 0.4);
  --surface-2: rgba(15, 31, 54, 0.55);
  --surface-solid: #0d1e34;
  --fg: #f2f7ff;
  --fg-2: #c6d4e8;
  --muted: #8ca2c2;
  --meta: #a3b9d9;

  --border: rgba(164, 198, 238, 0.2);
  --border-strong: rgba(188, 216, 250, 0.34);
  --border-soft: rgba(164, 198, 238, 0.1);

  --accent: #f2ab52;
  --accent-on: #1d1204;
  --accent-hover: #f7bd76;
  --accent-active: #fbce96;
  --accent-soft: rgba(242, 171, 82, 0.15);
  --accent-cool: #8fc3f2;
  --accent-cool-strong: #b4d8fb;
  --accent-cool-soft: rgba(143, 195, 242, 0.13);

  --glass-bg: rgba(13, 28, 54, 0.46);
  --glass-bg-strong: rgba(11, 24, 46, 0.7);
  --glass-border: rgba(180, 210, 246, 0.22);
  --glass-highlight: rgba(255, 255, 255, 0.1);
  --glass-blur: 28px;

  --font-display: "Newsreader", "Noto Serif SC", "Songti SC", Georgia, serif;
  --font-body: "IBM Plex Sans", "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  --text-2xs: 10.5px;
  --text-xs: 12px;
  --text-sm: 13.5px;
  --text-base: 15.5px;
  --text-lg: 18px;
  --text-xl: clamp(20px, 2.4vw, 24px);
  --text-display: clamp(1.75rem, 1.1rem + 3.2vw, 3rem);

  --leading-body: 1.75;
  --leading-tight: 1.16;
  --tracking-display: -0.015em;
  --tracking-wide: 0.18em;
  --tracking-caps: 0.14em;

  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  --space-12: 48px;

  --radius-xs: 4px;
  --radius-sm: 7px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --radius-pill: 999px;

  --max: 1080px;

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-snap: cubic-bezier(0.34, 1.3, 0.5, 1);
  --dur-fast: 160ms;
  --dur-med: 280ms;
  --dur-slow: 560ms;

  --shadow-sm: 0 2px 10px rgba(2, 7, 16, 0.35);
  --shadow-md: 0 10px 32px rgba(2, 7, 16, 0.38);
  --shadow-lg: 0 24px 64px -12px rgba(1, 5, 12, 0.55);
  --shadow-glow-amber: 0 0 18px rgba(242, 171, 82, 0.4);
  --shadow-glow-cool: 0 0 0 3px rgba(143, 195, 242, 0.16);

  /* —— legacy aliases: article / tag page rules keep their old
        variable names but now resolve to biosphere tokens —— */
  --paper: var(--bg-deep);
  --ink: var(--fg);
  --soft: var(--muted);
  --line: var(--border);
  --line-strong: var(--border-strong);
  --forest: var(--accent-cool);
  --blue: var(--accent-cool);
  --gold: var(--accent);
  --rose: #ef6b5e;
  --shadow: rgba(2, 7, 16, 0.4);

  --body-sans: var(--font-body);
  --display-serif: var(--font-display);
}

:root[data-theme="light"] {
  color-scheme: light;

  --bg: #dce7f5;
  --bg-deep: #c9d9ec;
  --surface: rgba(255, 255, 255, 0.55);
  --surface-2: rgba(255, 255, 255, 0.72);
  --surface-solid: #f0f5fc;
  --fg: #14243a;
  --fg-2: #3b506c;
  --muted: #5f7492;
  --meta: #47648a;

  --border: rgba(38, 70, 112, 0.18);
  --border-strong: rgba(38, 70, 112, 0.3);
  --border-soft: rgba(38, 70, 112, 0.09);

  --accent: #a96813;
  --accent-on: #fffaf2;
  --accent-hover: #8f5710;
  --accent-active: #78480d;
  --accent-soft: rgba(169, 104, 19, 0.12);
  --accent-cool: #2f639c;
  --accent-cool-strong: #244f80;
  --accent-cool-soft: rgba(47, 99, 156, 0.1);

  --glass-bg: rgba(236, 244, 252, 0.6);
  --glass-bg-strong: rgba(241, 247, 253, 0.82);
  --glass-border: rgba(255, 255, 255, 0.65);
  --glass-highlight: rgba(255, 255, 255, 0.85);

  --shadow-sm: 0 2px 8px rgba(30, 55, 90, 0.1);
  --shadow-md: 0 10px 28px rgba(30, 55, 90, 0.14);
  --shadow-lg: 0 22px 56px -14px rgba(24, 46, 78, 0.28);
  --shadow-glow-amber: 0 0 16px rgba(169, 104, 19, 0.3);
  --shadow-glow-cool: 0 0 0 3px rgba(47, 99, 156, 0.14);

  --shadow: rgba(30, 55, 90, 0.16);
}

/* ------------------------------------------------------------
   Base
   ------------------------------------------------------------ */
* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  background: var(--bg-deep);
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--fg);
  background: var(--bg-deep);
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: var(--leading-body);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  transition: color var(--dur-fast) ease, background var(--dur-med) ease;
  overflow-x: hidden;
}

::selection {
  background: rgba(242, 171, 82, 0.32);
  color: var(--fg);
}

[hidden] {
  display: none !important;
}

a {
  color: inherit;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

:where(a, button, input, summary):focus-visible {
  outline: 2px solid var(--accent-cool);
  outline-offset: 3px;
  border-radius: var(--radius-xs);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.shell {
  width: min(var(--max), calc(100% - 48px));
  margin-inline: auto;
}

main {
  position: relative;
  z-index: 1;
  width: min(1120px, calc(100% - 40px));
  margin-inline: auto;
}

.reading-progress {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 60;
  width: 100%;
  height: 2px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left center;
}

/* ------------------------------------------------------------
   Rear photo plane + rain canvas (homepage only)
   ------------------------------------------------------------ */
.depth {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
  background: var(--bg-deep);
}

.depth-shift {
  position: absolute;
  left: 0;
  right: 0;
  top: var(--backdrop-top, 62px);
  bottom: 0;
}

.depth-image {
  display: block;
  width: 100%;
  height: 100%;
  max-width: none;
  object-fit: cover;
  object-position: center 62%;
  filter: saturate(1.1) contrast(1.06) brightness(1.02);
}

.depth::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(to bottom, rgba(4, 10, 21, 0.42), transparent 22%),
    linear-gradient(to bottom, transparent 46%, rgba(4, 10, 21, 0.5) 88%);
}

:root[data-theme="light"] .depth::after {
  background:
    linear-gradient(to bottom, rgba(220, 231, 245, 0.25), transparent 22%),
    linear-gradient(to bottom, transparent 46%, rgba(220, 231, 245, 0.55) 88%);
}

:root[data-theme="light"] .depth-image {
  filter: saturate(0.92) contrast(0.98) brightness(1.14);
  opacity: 0.85;
}

.rain-layer {
  position: fixed;
  inset: 0;
  z-index: 0; /* later sibling of .depth: paints above the photo */
  width: 100%;
  height: 100%;
  pointer-events: none;
}

@media (prefers-reduced-motion: reduce) {
  .rain-layer {
    display: none;
  }
}

/* ------------------------------------------------------------
   Header — full-bleed sticky glass bar, content in .shell
   ------------------------------------------------------------ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  width: 100%;
  border-bottom: 1px solid var(--glass-border);
  background: var(--glass-bg);
  backdrop-filter: blur(var(--glass-blur)) saturate(1.4);
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(1.4);
  box-shadow: inset 0 1px 0 var(--glass-highlight);
  transition: background var(--dur-med) ease, box-shadow var(--dur-med) ease;
}

.site-header.is-scrolled {
  background: var(--glass-bg-strong);
  box-shadow:
    inset 0 1px 0 var(--glass-highlight),
    var(--shadow-md);
}

.site-header-inner {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: var(--space-4);
  padding: 14px 0;
}

.brand {
  justify-self: start;
  display: inline-flex;
  align-items: baseline;
  gap: 7px;
  color: var(--fg);
  font-family: var(--font-display);
  font-size: 25px;
  font-weight: 500;
  letter-spacing: var(--tracking-display);
  text-decoration: none;
  line-height: 1;
  text-shadow: 0 2px 18px rgba(0, 0, 0, 0.3);
}

.brand::after {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: var(--shadow-glow-amber);
  transform: translateY(-1px);
  transition: transform var(--dur-fast) var(--ease-snap);
}

.brand:hover::after {
  transform: translateY(-4px);
}

.nav {
  justify-self: center;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
}

.nav a {
  position: relative;
  padding: 6px 11px;
  color: var(--fg-2);
  font-size: var(--text-sm);
  font-weight: 500;
  letter-spacing: 0.02em;
  text-decoration: none;
  border-radius: var(--radius-pill);
  transition: color var(--dur-fast) ease, background var(--dur-fast) ease;
}

.nav a:hover {
  color: var(--fg);
  background: var(--accent-cool-soft);
}

.header-actions {
  justify-self: end;
  display: inline-flex;
  gap: var(--space-2);
  align-items: center;
}

.icon-toggle {
  display: inline-grid;
  width: 32px;
  height: 32px;
  place-items: center;
  padding: 0;
  color: var(--accent-cool-strong);
  border: 1px solid var(--border-strong);
  border-radius: 50%;
  background: var(--surface);
  backdrop-filter: blur(10px);
  box-shadow: inset 0 1px 0 var(--glass-highlight);
  transition: color var(--dur-fast) ease, border-color var(--dur-fast) ease,
    background var(--dur-fast) ease, box-shadow var(--dur-fast) ease,
    transform var(--dur-fast) var(--ease-snap);
}

.icon-toggle:hover {
  color: var(--fg);
  border-color: var(--accent-cool);
  transform: translateY(-2px);
  box-shadow: var(--shadow-glow-cool);
}

.icon-toggle:active {
  transform: translateY(0);
}

.icon-toggle[aria-pressed="true"] {
  color: var(--accent-on);
  border-color: var(--accent);
  background: var(--accent);
  box-shadow: var(--shadow-glow-amber);
}

:root[data-theme="light"] .icon-toggle {
  color: var(--accent-cool);
  background: var(--surface-2);
}

:root[data-theme="light"] .icon-toggle:hover {
  color: var(--fg);
}

.control-icon {
  display: inline-grid;
  place-items: center;
}

.control-icon svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.theme-icon-sun {
  display: none;
}

:root[data-theme="dark"] .theme-icon-moon {
  display: none;
}

:root[data-theme="dark"] .theme-icon-sun {
  display: block;
}

/* ------------------------------------------------------------
   Hero — compact band over the dome (homepage)
   ------------------------------------------------------------ */
.hero {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  place-items: center;
  width: 100vw;
  margin-left: calc(50% - 50vw);
  padding: clamp(20px, 4.2vh, 40px) var(--space-5) clamp(16px, 3.2vh, 30px);
  text-align: center;
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(
    ellipse 62% 46% at 50% 46%,
    rgba(4, 10, 21, 0.46),
    transparent 72%
  );
  pointer-events: none;
}

:root[data-theme="light"] .hero::before {
  background: radial-gradient(
    ellipse 72% 58% at 50% 50%,
    rgba(228, 238, 249, 0.78),
    rgba(228, 238, 249, 0.35) 58%,
    transparent 78%
  );
}

.hero-copy {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  justify-items: center;
  gap: var(--space-4);
  width: 100%;
  max-width: 100%;
  animation: hero-rise 900ms var(--ease) both;
}

.hero-copy > * {
  max-width: 100%;
}

@keyframes hero-rise {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.hero-divider {
  width: 56px;
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent,
    var(--accent) 35%,
    var(--accent) 65%,
    transparent
  );
  opacity: 0.9;
}

.hero h1 {
  margin: 0;
  max-width: min(15em, 100%);
  font-family: var(--font-display);
  font-size: var(--text-display);
  font-weight: 500;
  letter-spacing: 0.045em;
  line-height: 1.34;
  color: #f7faff;
  text-shadow:
    0 2px 10px rgba(3, 8, 18, 0.65),
    0 10px 44px rgba(3, 8, 18, 0.5);
  overflow-wrap: break-word;
  text-wrap: balance;
  white-space: normal;
}

:root[data-theme="light"] .hero h1 {
  color: #10203a;
  text-shadow: 0 2px 18px rgba(236, 244, 252, 0.9);
}

.hero-text {
  margin: 0;
  max-width: min(34em, 100%);
  color: rgba(230, 240, 252, 0.97);
  font-size: clamp(13px, 1.3vw, 15px);
  font-weight: 500;
  letter-spacing: 0.03em;
  line-height: 1.7;
  text-shadow:
    0 0 6px rgba(3, 8, 18, 0.85),
    0 2px 14px rgba(3, 8, 18, 0.75),
    0 0 28px rgba(3, 8, 18, 0.6);
  overflow-wrap: break-word;
  text-wrap: balance;
}

:root[data-theme="light"] .hero-text {
  color: #22375a;
  text-shadow:
    0 0 8px rgba(236, 244, 252, 0.95),
    0 1px 18px rgba(236, 244, 252, 0.9);
}

/* ------------------------------------------------------------
   Homepage content — equal-width frosted panels on the dome
   ------------------------------------------------------------ */
.content-stack {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  justify-items: center;
  gap: var(--space-5);
  margin-top: clamp(16px, 7vh, 64px);
  padding-bottom: var(--space-12);
}

.section-block {
  width: min(100%, 560px);
  margin: 0;
  padding: var(--space-4) var(--space-5);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  background: rgba(8, 18, 34, 0.09);
  backdrop-filter: blur(14px) saturate(1.3);
  -webkit-backdrop-filter: blur(14px) saturate(1.3);
  box-shadow:
    var(--shadow-md),
    inset 0 1px 0 var(--glass-highlight);
  text-shadow: 0 1px 6px rgba(2, 8, 18, 0.65), 0 2px 16px rgba(2, 8, 18, 0.45);
  opacity: 0;
  transform: translateY(22px);
  transition: opacity var(--dur-slow) var(--ease), transform var(--dur-slow) var(--ease);
}

:root[data-theme="light"] .section-block {
  background: rgba(242, 247, 253, 0.24);
  text-shadow: 0 0 6px rgba(240, 246, 252, 0.9), 0 1px 12px rgba(240, 246, 252, 0.75);
}

.section-block.is-visible {
  opacity: 1;
  transform: none;
}

.archive-label,
.section-heading-solo p {
  margin: 0;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--meta);
  font-family: var(--font-mono);
  font-size: var(--text-2xs);
  font-weight: 500;
  letter-spacing: var(--tracking-caps);
  text-transform: uppercase;
  white-space: nowrap;
}

/* one compact row: ARCHIVE label left, underline search right */
.archive-toolbar {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: var(--space-4);
  align-items: center;
  margin-bottom: var(--space-1);
  padding-bottom: var(--space-3);
  border-bottom: 1px solid var(--border);
}

.post-tools {
  display: flex;
  gap: var(--space-3);
  align-items: center;
  margin: 0;
  justify-content: flex-end;
}

.search-field {
  position: relative;
  flex: 1;
  max-width: 340px;
  margin: 0;
  width: auto;
}

.search-field::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 1px;
  background: var(--border-strong);
  transition: background var(--dur-fast) ease, box-shadow var(--dur-fast) ease;
}

.search-field:focus-within::after {
  background: var(--accent);
  box-shadow: 0 1px 12px rgba(242, 171, 82, 0.4);
}

.search-kbd {
  position: absolute;
  right: 2px;
  top: 50%;
  transform: translateY(-50%);
  display: inline-grid;
  place-items: center;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: var(--text-2xs);
  line-height: 1;
  transition: opacity var(--dur-fast) ease;
}

.search-field:focus-within .search-kbd {
  opacity: 0;
}

.blog-search-input {
  width: 100%;
  min-height: 34px;
  padding: 4px 28px 4px 2px;
  color: var(--fg);
  border: 0;
  border-radius: 0;
  background: transparent;
  outline: none;
  font-size: var(--text-sm);
  letter-spacing: 0.01em;
  transition: color var(--dur-fast) ease;
}

.blog-search-input:focus-visible {
  outline: none;
}

.blog-search-input::placeholder {
  color: var(--muted);
}

.blog-search-input:focus {
  border-color: transparent;
  box-shadow: none;
}

.search-clear {
  min-height: 28px;
  padding: 3px 10px;
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  background: transparent;
  font-size: var(--text-xs);
  font-weight: 500;
  transition: color var(--dur-fast) ease, border-color var(--dur-fast) ease;
}

.search-clear:hover {
  color: var(--accent);
  border-color: var(--accent);
}

.section-heading-solo {
  display: flex;
  justify-content: flex-start;
  margin-bottom: var(--space-5);
  padding-bottom: var(--space-4);
  border-bottom: 1px solid var(--border);
}

/* ------------------------------------------------------------
   Post groups — year / title / count rows with timeline children
   ------------------------------------------------------------ */
.post-groups {
  border-top: 0;
}

.post-group {
  border-bottom: 1px solid var(--border-soft);
}

.post-group:last-of-type {
  border-bottom: 0;
}

.post-group-summary {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto 20px;
  gap: var(--space-3);
  align-items: baseline;
  margin-inline: calc(var(--space-3) * -1);
  padding: 10px var(--space-3);
  border-radius: var(--radius-md);
  cursor: pointer;
  list-style: none;
  outline: none;
  transition: background var(--dur-fast) ease;
}

.post-group-summary:hover {
  background: var(--accent-cool-soft);
}

.post-group-summary::-webkit-details-marker {
  display: none;
}

.post-group-summary::after {
  content: "+";
  display: block;
  grid-column: 4;
  width: auto;
  height: auto;
  justify-self: end;
  color: var(--muted);
  border: 0;
  border-radius: 0;
  font-family: var(--font-mono);
  font-size: 16px;
  line-height: 1;
  transition: transform var(--dur-med) var(--ease), color var(--dur-fast) ease;
}

.post-group[open] .post-group-summary::after {
  content: "+";
  transform: rotate(45deg);
  color: var(--accent);
}

.post-group-year {
  grid-column: 1;
  color: var(--accent-cool);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: 500;
  letter-spacing: 0.06em;
  line-height: 1.3;
}

.post-group-node {
  display: none;
}

.post-group-title {
  grid-column: 2;
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 500;
  letter-spacing: 0.01em;
  line-height: 1.3;
  overflow-wrap: anywhere;
  transition: color var(--dur-fast) ease;
}

.post-group-summary:hover .post-group-title {
  color: var(--accent-hover);
}

.post-group-count {
  grid-column: 3;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: var(--text-2xs);
  font-weight: 500;
  letter-spacing: 0.08em;
  padding: 3px 9px;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-pill);
  white-space: nowrap;
}

.post-list-nested {
  margin: 0 0 var(--space-2) 56px;
  border-top: 0;
}

.post-timeline {
  position: relative;
  max-height: 180px;
  overflow-y: auto;
  padding-left: var(--space-5);
  padding-right: 6px;
  border-left: 1px solid var(--border);
  scrollbar-width: thin;
  scrollbar-color: var(--border-strong) transparent;
}

.post-card {
  position: relative;
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  gap: var(--space-3);
  align-items: baseline;
  padding: var(--space-3) 0;
  border-bottom: 1px solid var(--border-soft);
}

.post-card:last-child {
  border-bottom: 0;
}

.post-list-nested .post-card {
  padding: var(--space-3) 0;
}

.post-timeline .post-card::before {
  content: "";
  position: absolute;
  top: 22px;
  left: -23px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft), var(--shadow-glow-amber);
}

.post-title {
  color: var(--fg);
  font-size: var(--text-base);
  font-weight: 600;
  letter-spacing: 0.005em;
  line-height: 1.45;
  text-decoration: none;
  transition: color var(--dur-fast) ease;
}

.post-list-nested .post-title {
  font-family: var(--font-body);
  font-size: var(--text-base);
  font-weight: 600;
}

.post-title:hover {
  color: var(--accent-hover);
}

.post-excerpt {
  max-width: 620px;
  margin: 3px 0 0;
  color: var(--fg-2);
  font-size: var(--text-sm);
  line-height: 1.6;
}

.post-card-date {
  display: block;
  padding-top: 2px;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  letter-spacing: 0.04em;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.post-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.post-tags span {
  color: var(--accent-cool);
  font-size: 12px;
  font-weight: 600;
}

.post-tags span::before {
  content: "#";
}

.search-empty,
.empty {
  margin: var(--space-4) 0 0;
  color: var(--muted);
  font-size: var(--text-sm);
}

/* ------------------------------------------------------------
   About panel — poetic serif prose
   ------------------------------------------------------------ */
.about-block {
  text-align: left;
}

.about-body {
  max-width: 42em;
}

.about-body > p,
.about-block > p {
  max-width: none;
  margin: 0;
  color: var(--fg-2);
  font-family: var(--font-display);
  font-size: var(--text-sm);
  font-weight: 400;
  letter-spacing: 0.02em;
  line-height: 1.9;
  text-align: justify;
  text-justify: inter-ideograph;
}

.about-body > p + p,
.about-block > p + p {
  margin-top: var(--space-4);
}

/* ------------------------------------------------------------
   Back-to-top (homepage)
   ------------------------------------------------------------ */
.back-top {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 30;
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border: 1px solid var(--glass-border);
  border-radius: 50%;
  background: var(--glass-bg-strong);
  backdrop-filter: blur(14px);
  color: var(--fg);
  box-shadow: var(--shadow-md), inset 0 1px 0 var(--glass-highlight);
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px);
  transition: opacity var(--dur-fast) ease, transform var(--dur-fast) var(--ease),
    color var(--dur-fast) ease, border-color var(--dur-fast) ease,
    box-shadow var(--dur-fast) ease;
}

.back-top.is-visible {
  opacity: 1;
  pointer-events: auto;
  transform: none;
}

.back-top:hover {
  color: var(--accent);
  border-color: var(--accent);
  box-shadow: var(--shadow-md), var(--shadow-glow-amber);
  transform: translateY(-2px);
}

.back-top svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ------------------------------------------------------------
   Article & tag pages — original structure, biosphere palette
   ------------------------------------------------------------ */
.eyebrow {
  margin: 0 0 16px;
  color: var(--meta);
  font-family: var(--font-mono);
  font-size: var(--text-2xs);
  font-weight: 500;
  letter-spacing: var(--tracking-caps);
  text-transform: uppercase;
}

.button {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 8px 16px;
  color: var(--fg);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-pill);
  background: var(--surface);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  transition: color var(--dur-fast) ease, border-color var(--dur-fast) ease;
}

.button:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.article,
.archive-page {
  margin: 44px auto 54px;
  padding: 44px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface-solid);
  box-shadow: var(--shadow-lg);
}

.archive-page {
  max-width: 900px;
}

.archive-heading {
  margin-bottom: 30px;
}

.archive-page h1 {
  margin: 0 0 8px;
  font-family: var(--font-display);
  font-size: clamp(2.1rem, 4.8vw, 3.4rem);
  font-weight: 500;
  letter-spacing: 0;
  line-height: 1.15;
}

.archive-summary {
  margin: 0;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: 500;
  letter-spacing: 0.08em;
}

.tag-list {
  display: grid;
  gap: 0;
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--border);
  counter-reset: tag-list;
  list-style: none;
}

.tag-list li {
  counter-increment: tag-list;
  border-bottom: 1px solid var(--border);
}

.tag-list a {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) auto;
  gap: 18px;
  align-items: center;
  min-height: 64px;
  padding: 14px 0;
  color: var(--fg);
  text-decoration: none;
  transition: color var(--dur-fast) ease;
}

.tag-list a:hover {
  color: var(--accent-hover);
}

.tag-list-number {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 14px;
  font-variant-numeric: tabular-nums;
}

.tag-list-number::before {
  content: counter(tag-list, decimal-leading-zero);
}

.tag-list-name {
  overflow-wrap: anywhere;
  font-family: var(--font-display);
  font-size: clamp(1.25rem, 2.6vw, 1.8rem);
  font-weight: 500;
  line-height: 1.28;
}

.tag-list-count {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: var(--text-2xs);
  font-weight: 500;
  letter-spacing: 0.08em;
  padding: 3px 9px;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-pill);
  white-space: nowrap;
}

.back-link {
  color: var(--accent-cool);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
}

.back-link:hover {
  color: var(--accent-cool-strong);
}

.reading-article {
  max-width: 960px;
  padding: clamp(34px, 6vw, 68px);
}

.reading-article .article-header {
  max-width: 760px;
  margin-inline: auto;
  padding-bottom: 34px;
  border-bottom: 1px solid var(--border);
  text-align: center;
}

.article-kicker {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px;
  align-items: center;
  justify-content: center;
  margin-bottom: 18px;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: var(--text-2xs);
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.article-kicker .back-link {
  color: var(--accent-cool);
  font-family: var(--font-body);
  letter-spacing: 0;
  text-transform: none;
}

.article-header h1,
.reading-article .article-header h1 {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1.95rem, 4.6vw, 3.2rem);
  font-weight: 500;
  letter-spacing: 0.01em;
  line-height: 1.2;
}

.article-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 20px;
  color: var(--muted);
  font-size: 14px;
}

.reading-article .article-meta {
  justify-content: center;
}

.article-meta a {
  color: var(--accent-cool);
  text-decoration: none;
}

.article-tags {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
}

.article-tags a,
.article-tags span {
  color: var(--accent-cool);
  font-weight: 600;
}

.article-tags a::before,
.article-tags span::before {
  content: "#";
}

.article-tags span {
  font-size: 14px;
}

.article-intro {
  max-width: 560px;
  margin: 20px auto 0;
  color: var(--fg-2);
  font-size: 15px;
  line-height: 1.8;
}

.article-content {
  margin-top: 42px;
  color: var(--fg);
  font-size: 17px;
}

.reading-article .article-content {
  max-width: 720px;
  margin: 46px auto 0;
  font-size: 17px;
  line-height: 2;
}

.article-content p,
.article-content li,
.reading-article .article-content p,
.reading-article .article-content li {
  color: var(--fg-2);
}

.reading-article .article-content p {
  margin: 1.1em 0;
}

.article-content a {
  color: var(--accent-cool);
  text-underline-offset: 0.18em;
}

.reading-article .article-content .issue-floor-label {
  margin: 0 0 1.4em;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: var(--text-2xs);
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.reading-article .article-content h2,
.reading-article .article-content h3,
.reading-article .article-content h4 {
  margin: 2.4em 0 0.8em;
  font-family: var(--font-display);
  font-weight: 500;
  line-height: 1.35;
  color: var(--fg);
}

.reading-article .article-content h2 {
  font-size: 1.6rem;
}

.reading-article .article-content h3 {
  font-size: 1.3rem;
}

.reading-article .article-content hr {
  width: min(180px, 44%);
  height: 1px;
  margin: 2.6em auto;
  border: 0;
  background: linear-gradient(90deg, transparent, var(--border-strong), transparent);
}

.article-content img,
.reading-article .article-content img {
  display: block;
  max-width: min(100%, 860px);
  height: auto;
  margin: 28px auto;
  border-radius: 10px;
  box-shadow: var(--shadow-md);
}

.article-content blockquote,
.reading-article .article-content blockquote {
  margin: 2em 0;
  padding: 12px 22px;
  color: var(--fg-2);
  border-left: 3px solid var(--accent);
  background: rgba(255, 255, 255, 0.04);
}

:root[data-theme="light"] .article-content blockquote,
:root[data-theme="light"] .reading-article .article-content blockquote {
  background: rgba(38, 70, 112, 0.06);
}

.article-content pre,
.reading-article .article-content pre {
  overflow-x: auto;
  margin: 1.8em 0;
  padding: 18px 20px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #081020;
}

.article-content code {
  font-family: var(--font-mono);
}

.reading-article .article-content pre code {
  color: #e6eefb;
}

.article-content :not(pre) > code,
.reading-article .article-content :not(pre) > code {
  padding: 0.18em 0.36em;
  border-radius: 5px;
  color: var(--fg);
  background: rgba(242, 171, 82, 0.16);
}

.reading-article .article-content table {
  width: 100%;
  margin: 1.8em 0;
  border-collapse: collapse;
  font-size: 15px;
}

.reading-article .article-content th,
.reading-article .article-content td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  text-align: left;
}

.article-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  justify-content: center;
  max-width: 720px;
  margin: 48px auto 0;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}

.issue-link {
  margin: 0;
  padding: 9px 16px;
  color: var(--accent-cool);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-pill);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  transition: border-color var(--dur-fast) ease;
}

.issue-link:hover {
  border-color: var(--accent-cool);
}

.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  width: min(1120px, calc(100% - 40px));
  margin-inline: auto;
  padding: 28px 0 46px;
  color: var(--muted);
  font-size: 13px;
}

/* ------------------------------------------------------------
   Responsive
   ------------------------------------------------------------ */
@media (max-width: 820px) {
  .shell {
    width: min(100% - 32px, var(--max));
  }

  main,
  .site-footer {
    width: min(100% - 28px, 1120px);
  }

  .section-block {
    padding: var(--space-4) var(--space-4);
    border-radius: var(--radius-md);
  }

  .archive-toolbar {
    grid-template-columns: 1fr;
    gap: var(--space-3);
  }

  .post-tools {
    justify-content: stretch;
    flex-direction: row;
    align-items: center;
  }

  .search-field {
    max-width: none;
  }

  .post-group-summary {
    grid-template-columns: 40px minmax(0, 1fr) auto 18px;
    gap: var(--space-2);
    margin-inline: calc(var(--space-2) * -1);
    padding-inline: var(--space-2);
  }

  .post-list-nested {
    margin-left: var(--space-2);
  }

  .post-card {
    grid-template-columns: 78px minmax(0, 1fr);
  }

  .article,
  .archive-page {
    padding: 26px 20px;
    border-radius: var(--radius-md);
  }

  .reading-article .article-header {
    text-align: left;
  }

  .article-kicker,
  .reading-article .article-meta,
  .article-tags,
  .article-footer {
    justify-content: flex-start;
  }

  .reading-article .article-header h1 {
    font-size: clamp(1.75rem, 8vw, 2.45rem);
  }

  .reading-article .article-content {
    margin-top: 34px;
    font-size: 16px;
    line-height: 1.92;
  }

  .tag-list a {
    grid-template-columns: 36px minmax(0, 1fr);
    gap: 12px;
    min-height: 58px;
  }

  .tag-list-count {
    grid-column: 2;
    justify-self: start;
    margin-top: -4px;
  }

  .site-footer {
    flex-direction: column;
  }
}

@media (max-width: 560px) {
  .site-header-inner {
    grid-template-columns: auto auto;
    grid-template-rows: auto auto;
    row-gap: var(--space-2);
    padding: 12px 0 10px;
  }

  .brand {
    grid-row: 1;
    grid-column: 1;
  }

  .header-actions {
    grid-row: 1;
    grid-column: 2;
  }

  .nav {
    grid-column: 1 / -1;
    justify-self: stretch;
    padding-top: var(--space-2);
    border-top: 1px solid var(--border-soft);
  }

  .nav a {
    padding: 5px 9px;
    font-size: var(--text-xs);
  }

  .hero-copy {
    gap: var(--space-3);
  }

  /* keep the 12-character hero title on a single line on phones:
     fluid size derived from (100vw - 40px padding) / ~12.4em */
  .hero h1 {
    max-width: none;
    font-size: clamp(17px, 7.6vw - 3.5px, 28px);
    letter-spacing: 0.03em;
    white-space: nowrap;
    text-wrap: unset;
  }

  .post-card {
    grid-template-columns: 1fr;
    gap: 2px;
  }

  .post-timeline .post-card::before {
    top: 18px;
  }

  .back-top {
    right: 14px;
    bottom: 14px;
  }
}

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

  .section-block,
  .hero-copy {
    opacity: 1;
    transform: none;
    animation: none;
    transition: none;
  }
}
