/* ============================================================
   dexterdev8 · "HOT TYPE"
   Neon is the ink, not the box.
   ------------------------------------------------------------
   One design system for the whole personal space:
   home (/), writing (/blog/), and every post.

   The rule that runs the site:
     glow attaches to things you GLANCE at (headlines, rules,
     hovers) — never to things you READ for minutes (body copy,
     code, metadata).

   Interaction voice: the "afterglow" — states flare in fast
   (.18s) and decay out slow (.7s), like cooling phosphor.
   ============================================================ */

:root {
  --font-display: "Fraunces", "Iowan Old Style", Georgia, serif;
  --font-body: "Instrument Sans", "Helvetica Neue", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, monospace;

  /* Ink — surfaces */
  --ink-0: #0c0910;            /* page */
  --ink-1: #141020;            /* code blocks, matte panels */
  --ink-2: #1d1830;            /* surface borders, frames */
  --hairline: rgba(237, 233, 244, 0.10);

  /* Paper — text */
  --paper: #ede9f4;            /* body, ~15.8:1 on ink-0 */
  --paper-dim: #a79dbf;        /* deks, meta, ~7.4:1 */
  --paper-mute: #948aad;       /* quiet-but-real text (tags, labels), ~6.1:1 */
  --paper-faint: #6e6488;      /* ghost numerals & aria-hidden decoration only */

  /* Neon */
  --rose: #ff77bc;
  --violet: #b79cff;
  --cyan: #7de9ff;
  --rose-soft: #ffa3cf;        /* inline-code text */
  --rose-wash: rgba(255, 119, 188, 0.08);

  /* Gradient ink & filaments */
  --ink-gradient: linear-gradient(100deg, var(--rose) 0%, var(--violet) 48%, var(--cyan) 100%);
  --rule-gradient: linear-gradient(90deg,
      rgba(255, 119, 188, 0) 0%, var(--rose) 16%,
      var(--violet) 50%, var(--cyan) 84%, rgba(125, 233, 255, 0) 100%);
  --tick-gradient: linear-gradient(90deg, var(--rose), var(--violet) 55%, var(--cyan));

  /* Glow — glanced-at things only */
  --bloom-display: drop-shadow(0 0 16px rgba(255, 119, 188, 0.30))
                   drop-shadow(0 0 48px rgba(125, 233, 255, 0.12));
  --bloom-rule: 0 0 10px rgba(255, 119, 188, 0.35), 0 0 26px rgba(125, 233, 255, 0.18);
  --bloom-focus: 0 0 0 2px var(--ink-0), 0 0 0 4px var(--cyan), 0 0 14px rgba(125, 233, 255, 0.5);

  /* One faint horizon bloom at the top edge; the rest is matte */
  --page-bloom:
    radial-gradient(56% 32% at 70% -6%, rgba(183, 156, 255, 0.10), transparent 70%),
    radial-gradient(40% 26% at 12% -4%, rgba(255, 119, 188, 0.07), transparent 70%);

  /* Afterglow timing: flare in fast, decay out slow */
  --flare: 0.18s;
  --decay: 0.7s;

  /* Rhythm */
  --content-max: 68.75rem;     /* 1100px grid */
  --article-max: 44rem;        /* ~66ch post column */
  --radius: 10px;
}

/* Post pages calm the horizon so long-form reading starts quiet */
body.calm {
  --page-bloom:
    radial-gradient(56% 32% at 70% -6%, rgba(183, 156, 255, 0.06), transparent 70%),
    radial-gradient(40% 26% at 12% -4%, rgba(255, 119, 188, 0.04), transparent 70%);
}

/* ---------------------------------------------------------- */
/* Base                                                        */
/* ---------------------------------------------------------- */

* { box-sizing: border-box; margin: 0; padding: 0; }

html { min-height: 100%; scroll-behavior: smooth; }

body {
  min-height: 100vh;
  background: var(--page-bloom) no-repeat, var(--ink-0);
  color: var(--paper);
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

::selection { background: var(--rose); color: var(--ink-0); text-shadow: none; }
pre ::selection, pre::selection, code ::selection, code::selection {
  background: var(--cyan); color: var(--ink-0);
}

/* transparent outline stays invisible normally but is repainted
   in forced-colors mode, so keyboard focus survives there */
:focus-visible {
  outline: 2px solid transparent;
  outline-offset: 2px;
  box-shadow: var(--bloom-focus);
  border-radius: 4px;
}

.shell {
  width: min(100% - clamp(2.5rem, 10vw, 8rem), var(--content-max));
  margin-inline: auto;
}

.skip {
  position: absolute; left: -9999px; top: 0;
  padding: 0.75rem 1.25rem; z-index: 100;
  background: var(--ink-1); color: var(--cyan);
  font-family: var(--font-mono); font-size: 0.8rem;
}
.skip:focus { left: 0; }

/* ---------------------------------------------------------- */
/* Utilities: kickers, gradient ink, filament rules            */
/* ---------------------------------------------------------- */

.kicker {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--paper-dim);
}
.kicker .orn { color: var(--rose); }
.kicker a { color: inherit; text-decoration: none; transition: color var(--decay); }
.kicker a:hover { color: var(--cyan); transition-duration: var(--flare); }

/* Gradient-ink display type.
   Bloom must be filter: drop-shadow — text-shadow silently dies
   on background-clipped text. */
.ink {
  background: var(--ink-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  filter: var(--bloom-display);
}

.hot-rule {
  border: 0; height: 1px;
  background: var(--rule-gradient);
  box-shadow: var(--bloom-rule);
}

.caret {
  color: var(--rose);
  animation: blink 1.05s steps(2) infinite;
}
@keyframes blink { 0%, 50% { opacity: 1; } 50.01%, 100% { opacity: 0; } }

/* ---------------------------------------------------------- */
/* Masthead                                                    */
/* ---------------------------------------------------------- */

.masthead {
  border-bottom: 1px solid var(--hairline);
}
.masthead .shell {
  display: flex; align-items: stretch; justify-content: space-between;
  gap: 1.5rem; min-height: 4.5rem;
}

.brand {
  display: flex; align-items: center; gap: 0.7rem;
  text-decoration: none;
}
.brand .mark {
  width: 26px; height: 26px; flex-shrink: 0;
  filter: drop-shadow(0 0 6px rgba(255, 119, 188, 0.45));
}
.wordmark {
  font-family: var(--font-mono); font-size: 0.9rem; font-weight: 500;
  color: var(--paper); letter-spacing: 0.02em;
}
.wordmark em { font-style: normal; color: var(--rose); }

.nav { display: flex; gap: clamp(1.1rem, 3vw, 2.25rem); }
.nav a {
  position: relative;
  display: flex; align-items: center;
  font-family: var(--font-mono); font-size: 0.8rem; font-weight: 500;
  letter-spacing: 0.08em;
  color: var(--paper-dim); text-decoration: none;
  transition: color var(--decay) ease;
}
.nav a:hover { color: var(--paper); transition-duration: var(--flare); }
/* the lit segment: a short bright stretch of the masthead hairline */
.nav a::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 1px;
  background: var(--tick-gradient);
  box-shadow: var(--bloom-rule);
  opacity: 0;
  transition: opacity var(--decay) ease;
}
.nav a:hover::after,
.nav a:focus-visible::after,
.nav a[aria-current]::after { opacity: 1; transition-duration: var(--flare); }
.nav a[aria-current] { color: var(--paper); }
.nav a:focus-visible { box-shadow: none; outline: 2px solid transparent; color: var(--paper); }

/* ---------------------------------------------------------- */
/* Hero (home)                                                 */
/* ---------------------------------------------------------- */

.hero {
  padding-block: clamp(4.5rem, 16vh, 9.5rem) clamp(3rem, 8vh, 5rem);
}
.hero .kicker { margin-bottom: 1.75rem; }
/* the headline is short enough to wrap badly: without balance it breaks after
   "Mostly" and strands "in Rust." on a line of its own */
.display {
  font-family: var(--font-display);
  font-size: clamp(2.75rem, 7vw, 6rem);
  font-weight: 600;
  line-height: 1.02;
  letter-spacing: -0.02em;
  max-width: 18ch;
  text-wrap: balance;
}
.hero .dek {
  margin-top: 1.75rem;
  max-width: 52ch;
  font-size: 1.25rem; line-height: 1.6;
  color: var(--paper-dim);
}

/* ---------------------------------------------------------- */
/* Sections & index rows                                       */
/* ---------------------------------------------------------- */

.section { padding-block: clamp(3.5rem, 9vh, 6.5rem); }
.section > .kicker { margin-bottom: 2.25rem; }

.index { list-style: none; }

.row {
  position: relative;
  display: grid;
  grid-template-columns: 5rem 1fr auto;
  align-items: baseline;
  gap: 1rem 1.5rem;
  padding-block: 1.5rem;
  border-bottom: 1px solid var(--hairline);
}
.index .row:first-child { border-top: 1px solid var(--hairline); }

/* filament heat-up: the row's hairline switches on under hover/focus */
.row::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 1px;
  background: var(--rule-gradient);
  box-shadow: var(--bloom-rule);
  opacity: 0;
  transition: opacity var(--decay) ease;
}
.row:hover::after, .row:focus-within::after { opacity: 1; transition-duration: var(--flare); }

.numeral {
  font-family: var(--font-display);
  font-size: 2rem; font-weight: 500; line-height: 1;
  background: var(--ink-gradient);
  -webkit-background-clip: text; background-clip: text;
  color: var(--paper-faint);
  -webkit-text-fill-color: var(--paper-faint);
  transition: -webkit-text-fill-color var(--decay) ease, color var(--decay) ease;
}

.row-title {
  font-family: var(--font-display);
  font-size: clamp(1.4rem, 2.5vw, 1.75rem);
  font-weight: 600; line-height: 1.15;
  letter-spacing: -0.01em;
}
.row-title a {
  text-decoration: none;
  background: var(--ink-gradient);
  -webkit-background-clip: text; background-clip: text;
  color: var(--paper);
  -webkit-text-fill-color: var(--paper);
  transition: -webkit-text-fill-color var(--decay) ease, color var(--decay) ease;
}
/* gradient ink floods the title + numeral on hover or keyboard focus */
.row:hover .row-title a, .row:focus-within .row-title a {
  color: transparent; -webkit-text-fill-color: transparent;
  transition-duration: var(--flare);
}
.row:hover .numeral, .row:focus-within .numeral {
  color: transparent; -webkit-text-fill-color: transparent;
  transition-duration: var(--flare);
}
/* the whole row is the link */
.row a.stretch::after { content: ""; position: absolute; inset: 0; }
.row a.stretch:focus-visible { box-shadow: none; outline: 2px solid transparent; }

.row-dek {
  margin-top: 0.4rem;
  max-width: 58ch;
  color: var(--paper-dim);
  font-size: 0.97rem; line-height: 1.55;
}

.row-arrow {
  color: var(--paper-faint);
  font-size: 1.1rem;
  transition: color var(--decay) ease;
}
.row:hover .row-arrow, .row:focus-within .row-arrow {
  color: var(--cyan); transition-duration: var(--flare);
}

/* post rows: mono date column instead of numeral */
.post-row { grid-template-columns: 9ch 1fr auto; }
.post-date {
  font-family: var(--font-mono); font-size: 0.8rem; font-weight: 500;
  letter-spacing: 0.06em;
  color: var(--paper-dim);
}
.post-tags {
  margin-top: 0.5rem;
  font-family: var(--font-mono); font-size: 0.75rem;
  letter-spacing: 0.08em;
  color: var(--paper-mute);
}

/* light-pass underline: a gradient that slides through on hover */
.more {
  display: inline-block;
  margin-top: 2.25rem;
  font-family: var(--font-mono); font-size: 0.85rem; font-weight: 500;
  letter-spacing: 0.06em;
  color: var(--cyan); text-decoration: none;
  padding-bottom: 3px;
  background-image: linear-gradient(90deg, var(--rose), var(--violet), var(--cyan), var(--rose));
  background-size: 200% 1px;
  background-position: 100% 100%;
  background-repeat: no-repeat;
  transition: background-position var(--decay) ease, text-shadow var(--decay) ease;
}
.more:hover {
  background-position: 0% 100%;
  text-shadow: 0 0 10px rgba(125, 233, 255, 0.45);
  transition-duration: var(--flare), var(--flare);
}

/* ---------------------------------------------------------- */
/* Writing index (/blog/)                                      */
/* ---------------------------------------------------------- */

.page-header { padding-block: clamp(3.5rem, 10vh, 6rem) 0; }
.page-header .kicker { margin-bottom: 1.5rem; }
.page-title {
  font-family: var(--font-display);
  font-size: clamp(3rem, 8vw, 5.5rem);
  font-weight: 600; line-height: 1.02; letter-spacing: -0.02em;
}
.page-header .dek {
  margin-top: 1.25rem; max-width: 52ch;
  font-size: 1.15rem; color: var(--paper-dim);
}
.page-header .meta-row {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 1rem; margin-top: 2.5rem;
}
.page-header .meta-row .more { margin-top: 0; }
.page-header .hot-rule { margin-top: 2.5rem; }

.year { padding-block: clamp(2.5rem, 6vh, 4rem); }
.folio {
  font-family: var(--font-display);
  font-size: clamp(3.25rem, 8vw, 5rem);
  font-weight: 600; line-height: 1;
  color: var(--paper-faint);
  margin-bottom: 1.5rem;
}

/* ---------------------------------------------------------- */
/* Article / post pages                                        */
/* ---------------------------------------------------------- */

/* zero-JS reading-progress filament (progressive enhancement) */
.progress { display: none; }
@supports (animation-timeline: scroll()) {
  .progress {
    display: block;
    position: fixed; inset: 0 0 auto 0; height: 2px; z-index: 10;
    background: var(--ink-gradient);
    box-shadow: var(--bloom-rule);
    transform-origin: 0 50%;
    transform: scaleX(0);
    animation: fill-progress linear both;
    animation-timeline: scroll(root);
  }
}
@keyframes fill-progress { from { transform: scaleX(0); } to { transform: scaleX(1); } }

.article {
  width: min(100% - clamp(2.5rem, 10vw, 8rem), var(--article-max));
  margin-inline: auto;
}

.post-header { padding-block: clamp(3.5rem, 10vh, 5.5rem) 0; }
.post-header .kicker { margin-bottom: 1.5rem; }
.post-title {
  font-family: var(--font-display);
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 600; line-height: 1.05; letter-spacing: -0.015em;
}
.standfirst {
  margin-top: 1.5rem;
  font-family: var(--font-display);
  font-style: italic; font-weight: 500;
  font-size: 1.3rem; line-height: 1.55;
  color: var(--paper-dim);
}
/* the fold line: a short lit segment that closes the header */
.fold-line {
  border: 0; height: 1px; width: 96px;
  margin: 2.5rem 0 0;
  background: var(--tick-gradient);
  box-shadow: var(--bloom-rule);
}

/* -------------------- prose -------------------- */

.prose { counter-reset: sec; padding-block: clamp(2.5rem, 6vh, 4rem) 1rem; }

.prose > * + * { margin-top: 1.25rem; }

.prose p, .prose li {
  font-size: 1.125rem; line-height: 1.75;
  color: var(--paper);
}

.prose h2 {
  counter-increment: sec;
  margin-top: 3.5rem;
  font-family: var(--font-display);
  font-size: 1.75rem; font-weight: 600; line-height: 1.2;
  letter-spacing: -0.01em;
  color: var(--paper);
}
/* ledger counters: every h2 gets its mono folio number */
.prose h2::before {
  content: counter(sec, decimal-leading-zero);
  display: block;
  margin-bottom: 0.55rem;
  font-family: var(--font-mono);
  font-size: 0.75rem; font-weight: 500;
  letter-spacing: 0.14em;
  color: var(--rose);
}
.prose h2::after {
  content: ""; display: block;
  width: 48px; height: 1px; margin-top: 0.65rem;
  background: var(--tick-gradient);
}

.prose h3 {
  margin-top: 2.5rem;
  font-family: var(--font-body);
  font-size: 1.2rem; font-weight: 600;
  color: var(--paper);
}

/* hover-visible anchor links on section headings */
.anchor {
  margin-left: 0.45em;
  font-family: var(--font-mono); font-size: 0.7em; font-weight: 400;
  color: var(--cyan); text-decoration: none;
  opacity: 0;
  transition: opacity var(--decay) ease;
}
h2:hover .anchor, .anchor:focus-visible { opacity: 1; transition-duration: var(--flare); }

.prose a {
  color: var(--cyan);
  text-decoration: underline;
  text-decoration-color: rgba(125, 233, 255, 0.3);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  transition: text-decoration-color var(--decay) ease, text-shadow var(--decay) ease;
}
.prose a:hover {
  text-decoration-color: var(--cyan);
  text-shadow: 0 0 8px rgba(125, 233, 255, 0.45);
  transition-duration: var(--flare);
}

.prose ul, .prose ol { padding-left: 1.4rem; }
.prose li { margin-top: 0.5rem; }
.prose ul li::marker { color: var(--rose); }
.prose ol li::marker { color: var(--rose); font-family: var(--font-mono); font-size: 0.9em; }

.prose blockquote {
  margin-block: 2rem;
  padding-left: 1.5rem;
  border-left: 2px solid var(--rose);
  border-image: linear-gradient(180deg, var(--rose), var(--cyan)) 1;
  box-shadow: -8px 0 24px -18px rgba(255, 119, 188, 0.5);
}
.prose blockquote p {
  font-family: var(--font-display);
  font-style: italic; font-weight: 500;
  font-size: 1.25rem; line-height: 1.6;
  color: var(--paper);
}

.prose hr {
  border: 0; height: 1px; margin-block: 2.5rem;
  background: var(--hairline);
}

/* -------------------- code: the sanctuary --------------------
   Matte panels, zero glow. Glow near monospace destroys
   scanability, so neon is banned here on purpose.            */

.prose code {
  font-family: var(--font-mono);
  font-size: 0.9em;
  color: var(--rose-soft);
  background: var(--rose-wash);
  padding: 0.1em 0.35em;
  border-radius: 4px;
}

.prose pre {
  position: relative;
  margin-block: 2rem;
  padding: 1.25rem 1.4rem;
  background: var(--ink-1);
  border: 1px solid var(--ink-2);
  border-radius: var(--radius);
  overflow-x: auto;
}
.prose pre code {
  display: block;
  font-size: 0.9rem; line-height: 1.65;
  color: var(--paper);
  background: none; padding: 0; border-radius: 0;
}
.prose pre[data-lang]::before {
  content: attr(data-lang);
  position: absolute; top: 0.6rem; right: 0.9rem;
  font-family: var(--font-mono); font-size: 0.65rem; font-weight: 500;
  letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--paper-mute);
}

/* code breaks the measure on wide screens — Rust signatures are
   line-length hungry; prose stays at 66ch */
@media (min-width: 60rem) {
  .prose pre { margin-inline: -4rem; padding-inline: 1.6rem; }
}

/* zero-build syntax tokens: annotate by hand, or don't —
   unannotated <pre> still looks intentional */
.tk-k { color: var(--rose-soft); }                    /* keywords   */
.tk-s { color: var(--violet); }                       /* strings    */
.tk-f { color: var(--cyan); }                         /* fns, types */
.tk-c { color: var(--paper-dim); font-style: italic; }/* comments   */
.tk-n { color: var(--paper); }                        /* plain      */

.prose figure { margin-block: 2rem; }
.prose figure img {
  max-width: 100%; display: block;
  border: 1px solid var(--ink-2); border-radius: var(--radius);
}
.prose figcaption {
  margin-top: 0.7rem;
  font-family: var(--font-mono); font-size: 0.8rem;
  color: var(--paper-dim);
}

.prose table {
  width: 100%; margin-block: 2rem;
  border-collapse: collapse;
  font-size: 1rem;
}
.prose th {
  font-family: var(--font-mono); font-size: 0.75rem; font-weight: 500;
  letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--paper-dim); text-align: left;
  padding: 0.6rem 1rem 0.6rem 0;
  border-bottom: 1px solid var(--ink-2);
}
.prose td {
  padding: 0.6rem 1rem 0.6rem 0;
  border-bottom: 1px solid var(--hairline);
}
.prose td:first-child { font-family: var(--font-mono); font-size: 0.9rem; }

/* -------------------- end matter -------------------- */

.post-end { padding-block: 2rem clamp(3rem, 8vh, 5rem); }

.end-slug {
  display: block;
  width: 22px; height: 22px;
  margin-bottom: 2rem;
  color: var(--rose);
}

.post-end .hot-rule { margin-bottom: 2.5rem; }

.pager {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
}
.pager-item { text-decoration: none; }
.pager-item .kicker { display: block; margin-bottom: 0.5rem; }
.pager-item.newer { grid-column: 2; text-align: right; }
.pager-title {
  font-family: var(--font-display);
  font-size: 1.25rem; font-weight: 600; line-height: 1.25;
  background: var(--ink-gradient);
  -webkit-background-clip: text; background-clip: text;
  color: var(--paper);
  -webkit-text-fill-color: var(--paper);
  transition: -webkit-text-fill-color var(--decay) ease, color var(--decay) ease;
}
.pager-item:hover .pager-title, .pager-item:focus-visible .pager-title {
  color: transparent; -webkit-text-fill-color: transparent;
  transition-duration: var(--flare);
}

.author-strip {
  display: flex; align-items: center; gap: 0.9rem;
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid var(--hairline);
}
.author-strip .mark { width: 30px; height: 30px; flex-shrink: 0; }
.author-strip p {
  font-size: 0.95rem; color: var(--paper-dim);
}
.author-strip a { color: var(--cyan); text-decoration: none; }
.author-strip a:hover { text-decoration: underline; text-underline-offset: 3px; }

/* ---------------------------------------------------------- */
/* Footer / contact                                            */
/* ---------------------------------------------------------- */

.footer {
  margin-top: clamp(2rem, 6vh, 4rem);
  border-top: 1px solid var(--hairline);
  padding-block: clamp(3.5rem, 9vh, 6rem) 2.5rem;
}
.footer .kicker { margin-bottom: 2rem; }
.say {
  font-family: var(--font-display);
  font-style: italic;
  font-size: clamp(2.25rem, 5vw, 3rem);
  font-weight: 500; line-height: 1.1;
  letter-spacing: -0.01em;
}
.email {
  display: inline-block;
  margin-top: 1.5rem;
  font-family: var(--font-mono); font-size: 1rem; font-weight: 500;
  color: var(--paper); text-decoration: none;
  padding-bottom: 3px;
  background-image: linear-gradient(90deg, var(--rose), var(--violet), var(--cyan), var(--rose));
  background-size: 200% 1px;
  background-position: 100% 100%;
  background-repeat: no-repeat;
  transition: background-position var(--decay) ease, color var(--decay) ease;
}
.email:hover { background-position: 0% 100%; color: var(--cyan); transition-duration: var(--flare), var(--flare); }

.footer-links {
  display: flex; gap: 0.6rem; align-items: baseline;
  margin-top: 2.25rem;
  font-family: var(--font-mono); font-size: 0.85rem;
  color: var(--paper-faint);
}
.footer-links a {
  color: var(--paper-dim); text-decoration: none;
  transition: color var(--decay) ease, text-shadow var(--decay) ease;
}
.footer-links a:hover {
  color: var(--cyan);
  text-shadow: 0 0 10px rgba(125, 233, 255, 0.45);
  transition-duration: var(--flare);
}

.colophon {
  margin-top: 3.5rem;
  font-family: var(--font-mono); font-size: 0.72rem;
  letter-spacing: 0.04em;
  color: var(--paper-mute);
}

/* ---------------------------------------------------------- */
/* Responsive                                                  */
/* ---------------------------------------------------------- */

/* narrow phones: let the nav wrap onto its own line under the brand */
@media (max-width: 26rem) {
  .masthead .shell {
    flex-wrap: wrap;
    min-height: 0;
    padding-block: 1rem 0.35rem;
    row-gap: 0.15rem;
  }
  .nav { margin-left: auto; }
  .nav a { padding-block: 0.5rem; }
}

@media (max-width: 40rem) {
  .row { grid-template-columns: 1fr auto; row-gap: 0.15rem; }
  /* ghost numerals shrink to inline mono folios */
  .numeral {
    grid-column: 1 / -1;
    font-family: var(--font-mono);
    font-size: 0.75rem; font-weight: 500; letter-spacing: 0.14em;
  }
  .post-row { grid-template-columns: 1fr auto; }
  .post-date { grid-column: 1 / -1; margin-bottom: 0.2rem; }
  .pager { grid-template-columns: 1fr; gap: 1.25rem; }
  .pager-item.newer { grid-column: auto; text-align: left; }
  .page-header .meta-row { flex-direction: column; gap: 1.5rem; }
}

/* ---------------------------------------------------------- */
/* Preferences                                                 */
/* ---------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .caret { animation: none; }
  .progress { animation: none; display: none; }
  * { transition-duration: 0.01ms !important; }
}

@media (prefers-contrast: more) {
  body { background-image: none; }
  .ink { filter: none; }
  .hot-rule, .fold-line, .row::after, .nav a::after, .progress { box-shadow: none; }
  .numeral, .row-title a, .pager-title { -webkit-text-fill-color: currentColor; }
  .folio, .post-tags, .colophon { color: var(--paper-dim); }
}
