/* Marsipedia. Night desert is the default. Day is the bone survey sheet.
   Tokens are semantic. Components do not carry raw palette stops. */

:root,
[data-theme="night"] {
  color-scheme: dark;
  --bg-canvas: oklch(0.17 0.028 38);
  --bg-surface: oklch(0.225 0.03 40);
  --bg-elevated: oklch(0.265 0.032 42);
  --bg-header: oklch(0.185 0.028 38 / 0.9);
  --fg: oklch(0.945 0.016 78);
  --fg-muted: oklch(0.78 0.028 62);
  --fg-subtle: oklch(0.72 0.03 55);
  --fg-on-accent: oklch(0.97 0.015 85);
  --btn-bg: oklch(0.58 0.15 42);
  --btn-bg-hover: oklch(0.64 0.14 46);
  --accent: oklch(0.76 0.12 48);
  --accent-hover: oklch(0.82 0.1 58);
  --accent-subtle: oklch(0.76 0.12 48 / 0.16);
  --border: oklch(0.58 0.04 46 / 0.38);
  --border-strong: oklch(0.74 0.07 50 / 0.55);
  --focus: oklch(0.88 0.11 88);
  --specular: oklch(1 0 0 / 0.18);
  --contour: oklch(0.55 0.05 42 / 0.16);
  --shadow: 0 18px 44px oklch(0.08 0.02 30 / 0.45);
  --header-solid: oklch(0.2 0.03 40);
  --font-display: "Clash Display", "Satoshi", system-ui, sans-serif;
  --font-sans: "Satoshi", system-ui, sans-serif;
  --font-mono: ui-monospace, "Cascadia Code", "Segoe UI Mono", monospace;
  --header-h: 6.6rem;
  --measure: 66ch;
  --radius-plate: 1.15rem;
  --radius-inner: 0.7rem;
  --space-page: clamp(1.25rem, 2vw, 2rem);
  --dur: 180ms;
  --ease: cubic-bezier(0.2, 0, 0, 1);
}

[data-theme="day"] {
  color-scheme: light;
  --bg-canvas: oklch(0.46 0.075 42);
  --bg-surface: oklch(0.955 0.016 84);
  --bg-elevated: oklch(0.985 0.01 88);
  --bg-header: oklch(0.955 0.016 84 / 0.92);
  --fg: oklch(0.27 0.04 40);
  --fg-muted: oklch(0.4 0.04 42);
  --fg-subtle: oklch(0.42 0.038 44);
  --fg-on-accent: oklch(0.98 0.012 88);
  --btn-bg: oklch(0.46 0.14 38);
  --btn-bg-hover: oklch(0.4 0.13 36);
  --accent: oklch(0.44 0.13 38);
  --accent-hover: oklch(0.38 0.12 36);
  --accent-subtle: oklch(0.44 0.13 38 / 0.12);
  --border: oklch(0.42 0.05 42 / 0.28);
  --border-strong: oklch(0.4 0.06 40 / 0.48);
  --focus: oklch(0.42 0.14 45);
  --specular: oklch(1 0 0 / 0.72);
  --contour: oklch(0.28 0.05 40 / 0.14);
  --shadow: 0 16px 36px oklch(0.25 0.04 40 / 0.18);
  --header-solid: oklch(0.955 0.016 84);
}

@media (prefers-contrast: more) {
  :root,
  [data-theme="night"],
  [data-theme="day"] {
    --border: var(--fg-muted);
    --border-strong: var(--fg);
  }
}

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

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-sans);
  font-size: 1.0625rem;
  line-height: 1.65;
  color: var(--fg);
  background-color: var(--bg-canvas);
  background-image:
    radial-gradient(ellipse 70% 45% at 8% -10%, oklch(0.4 0.09 40 / 0.35), transparent 60%),
    radial-gradient(ellipse 50% 40% at 110% 0%, oklch(0.34 0.06 28 / 0.28), transparent 55%),
    repeating-linear-gradient(112deg, transparent 0 42px, var(--contour) 42px 43px);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 60;
  opacity: 0.045;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}

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

a {
  color: var(--accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
  text-decoration-color: color-mix(in oklch, var(--accent) 70%, transparent);
}

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

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

input:focus {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

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

.skip {
  position: absolute;
  left: 1rem;
  top: -4rem;
  z-index: 80;
  background: var(--bg-elevated);
  color: var(--fg);
  padding: 0.7rem 1rem;
  border-radius: 999px;
  text-decoration: none;
}

.skip:focus { top: 0.6rem; }

.wrap {
  width: min(1180px, calc(100% - 2.4rem));
  margin-inline: auto;
}

.wrap-wide {
  width: min(1240px, calc(100% - 2rem));
  margin-inline: auto;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  background: var(--bg-header);
  backdrop-filter: blur(16px) saturate(1.15);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  display: grid;
  grid-template-columns: auto minmax(10rem, 1fr) auto;
  gap: 0.75rem 1rem;
  align-items: center;
  min-height: 4.25rem;
  padding-top: 0.7rem;
}

.brand-island {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-height: 44px;
  padding-right: 0.9rem;
  border-right: 1px solid var(--border);
}

.x-follow {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  height: 44px;
  max-height: 44px;
  padding: 0 0.7rem 0 0.55rem;
  flex-shrink: 0;
  border-radius: 999px;
  border: 1px solid color-mix(in oklch, var(--accent) 45%, transparent);
  color: var(--fg);
  text-decoration: none;
  background: var(--bg-surface);
}

.x-follow-mark {
  width: 24px;
  height: 24px;
  max-width: 24px;
  max-height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.x-follow-mark svg {
  width: 11px;
  height: 11px;
  max-width: 11px;
  max-height: 11px;
  display: block;
}

.x-follow-handle {
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.01em;
}

.wordmark {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 44px;
  color: var(--fg);
  text-decoration: none;
  line-height: 1;
}

.wordmark-name {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.35rem;
  letter-spacing: -0.03em;
}

.wordmark-kicker {
  margin-top: 0.28rem;
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--fg-muted);
}

.search { position: relative; }

.search input {
  width: 100%;
  min-height: 44px;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  background: var(--bg-surface);
  color: var(--fg);
  font: inherit;
  font-size: 0.95rem;
  padding: 0 1rem;
}

.search input::placeholder { color: var(--fg-subtle); }

.search-list {
  position: absolute;
  z-index: 40;
  top: calc(100% + 0.4rem);
  left: 0;
  right: 0;
  margin: 0;
  padding: 0.35rem;
  list-style: none;
  max-height: 22rem;
  overflow: auto;
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-plate);
  box-shadow: var(--shadow);
}

.search-list[hidden] { display: none; }

.search-list a {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  min-height: 44px;
  justify-content: center;
  padding: 0.4rem 0.7rem;
  border-radius: 0.65rem;
  color: var(--fg);
  text-decoration: none;
}

.search-list a[aria-selected="true"],
.search-list a:hover { background: var(--accent-subtle); }

.search-title { font-weight: 700; }

.search-sum {
  color: var(--fg-muted);
  font-size: 0.82rem;
  line-height: 1.35;
}

.search-empty {
  padding: 0.7rem;
  color: var(--fg-muted);
  font-size: 0.9rem;
}

.nav {
  display: flex;
  align-items: center;
  gap: 0.15rem;
}

.nav a,
.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 0.75rem;
  border-radius: 999px;
  color: var(--fg);
  text-decoration: none;
  font-size: 0.92rem;
  font-weight: 500;
}

.nav a[aria-current="page"] {
  background: var(--accent-subtle);
  color: var(--fg);
}

.theme-toggle {
  border: 1px solid var(--border-strong);
  background: var(--bg-surface);
  font: inherit;
  cursor: pointer;
  color: var(--fg);
}

.neat-wrap { padding-bottom: 0.1rem; }

.neatline {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 1.1rem;
  margin: 0;
  padding: 0.15rem 0 0.45rem;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--fg-subtle);
}

.page { padding: var(--space-page) 0 4rem; }

.kicker {
  margin: 0 0 0.4rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
}

h1, h2, .wordmark-name, .stat dd, .plate h2 {
  font-family: var(--font-display);
}

h1 {
  margin: 0;
  font-size: clamp(2.6rem, 4vw + 1rem, 4.6rem);
  font-weight: 600;
  letter-spacing: -0.035em;
  line-height: 0.98;
}

h2 {
  margin: 2.2rem 0 0.7rem;
  font-size: clamp(1.45rem, 1vw + 1rem, 1.9rem);
  font-weight: 600;
  letter-spacing: -0.025em;
  line-height: 1.15;
  scroll-margin-top: calc(var(--header-h) + 0.8rem);
}

.article-body h2::after {
  content: "";
  display: block;
  width: 2.4rem;
  height: 2px;
  margin-top: 0.45rem;
  background: var(--accent);
}

p { margin: 0 0 1rem; }

code {
  font-family: var(--font-mono);
  font-size: 0.86em;
  background: var(--accent-subtle);
  padding: 0.08em 0.35em;
  border-radius: 0.3rem;
}

.hero {
  display: grid;
  margin-top: 0.4rem;
  border-radius: calc(var(--radius-plate) + 0.2rem);
  overflow: hidden;
  background: var(--bg-surface);
  box-shadow: var(--shadow);
}

.hero-media {
  grid-area: 1 / 1;
  min-height: min(72vh, 740px);
}

.hero-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.hero-copy {
  grid-area: 1 / 1;
  align-self: end;
  justify-self: start;
  width: min(38rem, calc(100% - 2rem));
  margin: 1.1rem;
  padding: 1.15rem 1.25rem 1.2rem;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-plate);
  box-shadow: inset 0 1px 0 var(--specular), var(--shadow);
}

.hero-copy h1 { font-size: clamp(3rem, 6vw, 5rem); }

.deck {
  margin: 0.8rem 0 1rem;
  max-width: 38ch;
  color: var(--fg-muted);
  font-size: 1.05rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 1.1rem;
  border-radius: 999px;
  background: var(--btn-bg);
  color: var(--fg-on-accent);
  text-decoration: none;
  font-weight: 700;
}

.btn:hover { background: var(--btn-bg-hover); color: var(--fg-on-accent); }

.fine {
  margin: 0.75rem 0 0;
  color: var(--fg-subtle);
  font-size: 0.8rem;
}

.stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.8rem;
  margin: 1.25rem 0 0;
}

.stats div {
  padding: 0.9rem 1rem;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-plate);
  box-shadow: inset 0 1px 0 var(--specular);
}

.stats dt {
  margin: 0;
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--fg-muted);
}

.stats dd {
  margin: 0.25rem 0 0;
  font-size: clamp(1.6rem, 2vw, 2.1rem);
  font-weight: 600;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
}

.band {
  margin-top: 2.4rem;
}

.band > h2 { margin-top: 0; }

.featured {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(16rem, 0.85fr);
  gap: 1.4rem;
  align-items: stretch;
}

.featured-copy {
  padding: 1.2rem 1.25rem 1.3rem;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-plate);
  box-shadow: inset 0 1px 0 var(--specular);
}

.featured-copy h2 { margin: 0 0 0.7rem; }

.featured-copy h2 a { color: var(--fg); text-decoration: none; }

.featured-copy h2 a:hover { color: var(--accent); }

.frame {
  margin: 0;
  padding: 0.45rem;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-plate);
  box-shadow: inset 0 1px 0 var(--specular), var(--shadow);
}

.frame img {
  display: block;
  width: 100%;
  border-radius: var(--radius-inner);
  object-fit: cover;
}

.frame figcaption,
.shot figcaption {
  margin: 0.55rem 0.35rem 0.2rem;
  color: var(--fg-muted);
  font-size: 0.82rem;
  line-height: 1.45;
}

.field-log {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.55rem;
}

.field-log a {
  display: flex;
  gap: 0.9rem;
  align-items: baseline;
  min-height: 44px;
  padding: 0.75rem 1rem;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 0.9rem;
  color: var(--fg);
  text-decoration: none;
  box-shadow: inset 0 1px 0 var(--specular);
}

.field-log a:hover { border-color: var(--border-strong); }

.field-log span {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}

.atlas-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(15.5rem, 1fr));
  gap: 1.3rem 1.6rem;
}

.cat-block { border-top: 1px solid var(--border-strong); padding-top: 0.7rem; }

.cat-block h3 {
  margin: 0 0 0.45rem;
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.cat-block h3 a { color: var(--fg); text-decoration: none; }

.cat-block h3 a:hover { color: var(--accent); }

.cat-block ul, .see-also, .linkback ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.cat-block li + li, .see-also li + li, .linkback li + li { margin-top: 0.28rem; }

.crumb {
  margin: 0 0 1rem;
  color: var(--fg-muted);
  font-size: 0.88rem;
}

.crumb a { color: var(--fg-muted); }

.article-grid {
  display: grid;
  grid-template-columns: 12.25rem minmax(0, 1fr) 17.5rem;
  grid-template-areas:
    "toc head plate"
    "toc body plate";
  gap: 0.4rem 1.4rem;
  align-items: start;
}

.article-head { grid-area: head; }
.article-body { grid-area: body; max-width: var(--measure); }
.toc { grid-area: toc; }
.plate { grid-area: plate; }

.toc,
.plate {
  position: sticky;
  top: calc(var(--header-h) + 0.8rem);
  max-height: calc(100vh - var(--header-h) - 1.6rem);
  overflow: auto;
}

.toc ol {
  margin: 0.4rem 0 0;
  padding: 0;
  list-style: none;
}

.toc a {
  display: block;
  padding: 0.28rem 0;
  color: var(--fg-muted);
  text-decoration: none;
  font-size: 0.88rem;
  line-height: 1.35;
}

.toc a[aria-current="location"] {
  color: var(--fg);
  box-shadow: inset 2px 0 0 var(--accent);
  padding-left: 0.55rem;
}

.plate {
  padding: 0.95rem 1rem 1rem;
  background: var(--bg-surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-plate);
  box-shadow: inset 0 1px 0 var(--specular), var(--shadow);
}

.plate-kicker {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
}

.plate h2 {
  margin: 0.3rem 0 0.7rem;
  font-size: 1.45rem;
}

.plate h2::after { display: none; }

.plate dl { margin: 0; }

.plate dt {
  margin-top: 0.55rem;
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--fg-muted);
}

.plate dd {
  margin: 0.1rem 0 0;
  font-variant-numeric: tabular-nums;
  font-size: 0.95rem;
}

.shot { margin: 1rem 0 1.2rem; }

.shot img {
  width: 100%;
  border-radius: var(--radius-inner);
  display: block;
  object-fit: cover;
  background: var(--bg-elevated);
}

.lead p:first-child { font-size: 1.12rem; }

.prose-list { margin: 0 0 1rem; padding-left: 1.15rem; }

.prose-list li + li { margin-top: 0.3rem; }

.table-wrap { overflow-x: auto; margin: 0 0 1rem; }

.sheet {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
  font-variant-numeric: tabular-nums;
}

.sheet caption {
  text-align: left;
  caption-side: bottom;
  padding-top: 0.45rem;
  color: var(--fg-muted);
  font-size: 0.8rem;
}

.sheet th,
.sheet td {
  text-align: left;
  vertical-align: top;
  padding: 0.6rem 0.7rem;
  border-bottom: 1px solid var(--border);
}

.sheet th {
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-weight: 500;
  color: var(--fg-muted);
}

.sheet th button {
  min-height: 44px;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  letter-spacing: inherit;
  text-transform: inherit;
  text-align: left;
  cursor: pointer;
}

.sheet th button:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

.ref {
  text-decoration: none;
  font-variant-numeric: tabular-nums;
  margin-left: 0.1rem;
}

.see-also, .linkback, .cats {
  margin-top: 1.6rem;
  padding-top: 0.8rem;
  border-top: 1px solid var(--border);
}

.see-also h2, .linkback h2, .refs h2, .cats h2 { margin-top: 0; }

.refs ol { margin: 0; padding-left: 1.3rem; }

.refs li { margin: 0.4rem 0; font-size: 0.92rem; overflow-wrap: anywhere; }

.refs li a { color: var(--fg); }

.cats a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  margin: 0 0.4rem 0.4rem 0;
  padding: 0 0.8rem;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  color: var(--fg);
  text-decoration: none;
  background: var(--bg-surface);
}

.pager {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.7rem;
  margin-top: 1.8rem;
}

.pager a {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 44px;
  padding: 0.7rem 0.9rem;
  border-radius: 0.9rem;
  border: 1px solid var(--border);
  background: var(--bg-surface);
  color: var(--fg);
  text-decoration: none;
}

.pager a span {
  color: var(--fg-muted);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.pager a:last-child { text-align: right; }

.atlas-section { margin: 0 0 2rem; scroll-margin-top: calc(var(--header-h) + 0.8rem); }

.atlas-section h2 { margin-bottom: 0.25rem; }

.atlas-section li { margin: 0.85rem 0; }

.atlas-section .fine {
  display: block;
  margin: 0.12rem 0 0;
}

.lede { max-width: 62ch; color: var(--fg-muted); }

.about-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 18rem;
  gap: 1.4rem;
  align-items: start;
}

.about-note {
  padding: 1rem;
  background: var(--bg-surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-plate);
  box-shadow: inset 0 1px 0 var(--specular);
}

.instrument {
  margin: 1rem 0 1.4rem;
  padding: 1rem 1rem 1.1rem;
  background: var(--bg-surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-plate);
  box-shadow: inset 0 1px 0 var(--specular);
}

.instrument label {
  display: block;
  margin: 0.8rem 0 0.3rem;
  font-size: 0.82rem;
  letter-spacing: 0.04em;
}

.instrument input {
  width: 100%;
  min-height: 44px;
  padding: 0 0.75rem;
  border-radius: 0.7rem;
  border: 1px solid var(--border-strong);
  background: var(--bg-elevated);
  color: var(--fg);
  font: inherit;
  font-variant-numeric: tabular-nums;
}

.instrument-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.9rem;
}

.instrument-actions button {
  min-height: 44px;
  padding: 0 0.9rem;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  background: var(--bg-elevated);
  color: var(--fg);
  font: inherit;
  cursor: pointer;
}

.instrument-actions button[type="submit"] {
  background: var(--btn-bg);
  color: var(--fg-on-accent);
  border-color: transparent;
}

.screen-banner, .formula {
  color: var(--fg-muted);
  font-size: 0.92rem;
}

.clock-out,
.instrument-out {
  display: grid;
  grid-template-columns: minmax(8rem, 16rem) 1fr;
  gap: 0.35rem 0.8rem;
  margin: 1rem 0 0;
}

.clock-out dt,
.instrument-out dt { color: var(--fg-muted); font-size: 0.78rem; letter-spacing: 0.06em; text-transform: uppercase; }
.clock-out dd,
.instrument-out dd { margin: 0; font-variant-numeric: tabular-nums; }

.checks label {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  min-height: 44px;
  margin: 0;
  letter-spacing: 0;
  font-size: 0.95rem;
  text-transform: none;
}

.checks input { width: 1.1rem; height: 1.1rem; }

.site-footer {
  border-top: 1px solid var(--border);
  padding: 1.4rem 0 2rem;
  color: var(--fg-muted);
  font-size: 0.88rem;
}

.site-footer .wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1.2rem;
  justify-content: space-between;
  align-items: end;
}

.site-footer a { color: var(--fg); }

.footer-meta { margin: 0; max-width: 62ch; }

@media (max-width: 980px) {
  :root { --header-h: 10.75rem; }
  .header-inner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.45rem 0.7rem;
  }
  .brand-island { flex: 1 1 auto; min-width: 0; border-right: 0; padding-right: 0; }
  .search { flex: 1 1 100%; }
  .nav { flex: 1 1 100%; flex-wrap: wrap; }
  .neat-wrap { display: none; }
  .article-grid {
    grid-template-columns: 1fr;
    grid-template-areas:
      "head"
      "plate"
      "toc"
      "body";
  }
  .toc, .plate { position: static; }
  .featured, .about-grid, .stats { grid-template-columns: 1fr; }
  .x-follow-handle { display: none; }
  .x-follow { padding: 0; width: 44px; justify-content: center; }
}

@media (max-width: 700px) {
  .hero { display: block; border-radius: 0; }
  .wrap-wide .hero { width: 100%; }
  .hero-media { min-height: 16rem; max-height: 52vh; }
  .hero-copy {
    width: auto;
    margin: 0;
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }
  .pager { grid-template-columns: 1fr; }
  .pager a:last-child { text-align: left; }
}

@media (min-width: 981px) and (max-width: 1180px) {
  .x-follow-handle { display: none; }
  .x-follow { width: 44px; padding: 0; justify-content: center; }
}

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

@media (prefers-reduced-transparency: reduce) {
  .site-header {
    backdrop-filter: none;
    background: var(--header-solid);
  }
}

@media (forced-colors: active) {
  .btn, .theme-toggle, .x-follow, .plate, .frame {
    border: 1px solid CanvasText;
  }
  :focus-visible { outline-color: Highlight; }
}

@media print {
  body { background: white; color: black; }
  body::before, .site-header, .toc, .theme-toggle, .search, .skip, .neatline { display: none !important; }
  a { color: black; }
  .article-grid { display: block; }
  .plate, .frame, .hero-copy { box-shadow: none; }
}
