/* =============================================================
   Inkwell — Foundational design tokens
   Self-hosted blogging, beautifully crafted.
   Import this file before any other site CSS.
   ============================================================= */

/* Fonts loaded via /fonts/fonts.css in the layout */

:root {
  /* ── Brand palette ─────────────────────────────────────────── */
  --ink-cream:        #FAF7F2;
  --ink-cream-deep:   #F4EFE6;
  --ink-cream-edge:   #E8E1D3;
  --ink-black:        #1A1A1A;
  --ink-black-soft:   #2A2724;
  --ink-sepia:        #8B7355;
  --ink-sepia-light:  #A89378;
  --ink-brown:        #5C5751;
  --ink-brown-light:  #7A7570;
  --ink-accent:       #8C2A1F;
  --ink-accent-warm:  #C4632B;

  /* ── Semantic — Light (Cream preset, default) ──────────────── */
  --bg:               var(--ink-cream);
  --surface:          var(--ink-cream-deep);
  --surface-2:        #EFE9DC;
  --border:           var(--ink-cream-edge);
  --rule:             var(--ink-black);
  --fg:               var(--ink-black);
  --fg-body:          var(--ink-brown);
  --fg-muted:         var(--ink-brown-light);
  --fg-meta:          var(--ink-sepia);
  --link:             var(--ink-black);
  --link-hover:       var(--ink-accent);

  /* ── Type families ─────────────────────────────────────────── */
  --serif:     'Source Serif 4', 'Charter', 'Iowan Old Style', Georgia, serif;
  --sans:      'Geist', 'Inter', -apple-system, system-ui, sans-serif;
  --mono:      'Geist Mono', 'JetBrains Mono', ui-monospace, monospace;

  /* ── Type scale ────────────────────────────────────────────── */
  --fs-display: clamp(48px, 7vw, 84px);
  --fs-h1:      clamp(36px, 4.4vw, 56px);
  --fs-h2:      clamp(28px, 3vw, 40px);
  --fs-h3:      22px;
  --fs-h4:      18px;
  --fs-lede:    21px;
  --fs-body:    17px;
  --fs-ui:      15px;
  --fs-sm:      13px;
  --fs-xs:      11px;

  --lh-tight:  1.08;
  --lh-snug:   1.22;
  --lh-body:   1.55;
  --lh-prose:  1.7;

  --tracking-eyebrow:  0.14em;
  --tracking-tight:   -0.015em;
  --tracking-display: -0.025em;

  --w-regular: 400;
  --w-medium:  500;

  /* ── Spacing (4px base) ────────────────────────────────────── */
  --sp-1:   4px;
  --sp-2:   8px;
  --sp-3:   12px;
  --sp-4:   16px;
  --sp-5:   20px;
  --sp-6:   24px;
  --sp-8:   32px;
  --sp-10:  40px;
  --sp-12:  48px;
  --sp-16:  64px;
  --sp-20:  80px;
  --sp-24:  96px;
  --sp-32:  128px;

  /* ── Layout ────────────────────────────────────────────────── */
  --measure-prose: 640px;
  --measure-wide:  1080px;
  --container:     1240px;
  --gutter:        clamp(20px, 4vw, 56px);

  /* ── Radius ────────────────────────────────────────────────── */
  --r-0:   0;
  --r-1:   2px;
  --r-2:   4px;
  --r-pill: 999px;

  /* ── Hairlines & shadows ───────────────────────────────────── */
  --hairline:        1px solid var(--ink-black);
  --hairline-soft:   1px solid var(--ink-cream-edge);
  --hairline-dotted: 1px dotted var(--ink-sepia);
  --shadow-pop:  0 1px 0 rgba(26,26,26,.04), 0 8px 28px -12px rgba(26,26,26,.18);
  --shadow-lift: 0 1px 0 rgba(26,26,26,.06), 0 14px 40px -16px rgba(26,26,26,.22);

  /* ── Motion ────────────────────────────────────────────────── */
  --ease-out:  cubic-bezier(.2, .7, .2, 1);
  --ease-in:   cubic-bezier(.4, 0, .9, .4);
  --dur-fast:  120ms;
  --dur-base:  180ms;
  --dur-slow:  320ms;

  /* ── Semantic typographic mappings ─────────────────────────── */
  --display-font: var(--serif);
  --h1-font:      var(--serif);
  --h2-font:      var(--serif);
  --h3-font:      var(--serif);
  --h4-font:      var(--sans);
  --eyebrow-font: var(--sans);
  --body-font:    var(--serif);
  --ui-font:      var(--sans);
  --code-font:    var(--mono);
}

/* ── Preset: Linen ─────────────────────────────────────────── */
[data-preset="linen"] {
  --bg:       #F2EDDF;
  --surface:  #ECE5D3;
  --surface-2:#E4DCC6;
  --border:   #D8CFB8;
  --fg:       #1A1A1A;
  --fg-body:  #4A453F;
  --fg-meta:  #7A6647;
}

/* ── Preset: Manuscript ────────────────────────────────────── */
[data-preset="manuscript"] {
  --bg:        #F6F0E0;
  --surface:   #EFE6CF;
  --surface-2: #E7DDC2;
  --border:    #D4C7A4;
  --rule:      #3D2F1E;
  --fg:        #3D2F1E;
  --fg-body:   #5A4A33;
  --fg-muted:  #8A7556;
  --fg-meta:   #8B7355;
  --link:      #3D2F1E;
  --link-hover:#8C2A1F;
}

/* ── Preset: Folio ─────────────────────────────────────────── */
[data-preset="folio"] {
  --bg:        #F5EBCF;
  --surface:   #EDDFB7;
  --surface-2: #E5D29C;
  --border:    #D1BB87;
  --rule:      #2A2418;
  --fg:        #2A2418;
  --fg-body:   #5A4E33;
  --fg-meta:   #8B6F3F;
  --link:      #2A2418;
  --link-hover:#8C2A1F;
}

/* ── Preset: Press ─────────────────────────────────────────── */
[data-preset="press"] {
  --bg:        #F4F2EE;
  --surface:   #ECEAE4;
  --surface-2: #E2DFD7;
  --border:    #D6D2C8;
  --rule:      #14141A;
  --fg:        #14141A;
  --fg-body:   #3F3F46;
  --fg-muted:  #71717A;
  --fg-meta:   #52525B;
  --link:      #14141A;
  --link-hover:#8C2A1F;
}

/* ── Preset: Letterpress ───────────────────────────────────── */
[data-preset="letterpress"] {
  --bg:        #FAF6EC;
  --surface:   #F2EBDA;
  --surface-2: #EAE0C8;
  --border:    #DCCFB0;
  --rule:      #1A1A1A;
  --fg:        #1A1A1A;
  --fg-body:   #4A3F36;
  --fg-meta:   #8C2A1F;
  --link:      #8C2A1F;
  --link-hover:#5F1B14;
}

/* ── Preset: Foxglove ──────────────────────────────────────── */
[data-preset="foxglove"] {
  --bg:        #FCF6EB;
  --surface:   #F6ECD6;
  --surface-2: #EFE2C2;
  --border:    #E2D2AC;
  --rule:      #2A1F12;
  --fg:        #2A1F12;
  --fg-body:   #5A4831;
  --fg-meta:   #C4632B;
  --link:      #C4632B;
  --link-hover:#8A4419;
}

/* ── Preset: Cobalt ────────────────────────────────────────── */
[data-preset="cobalt"] {
  --bg:        #F8F5EE;
  --surface:   #F0ECE0;
  --surface-2: #E7E2D2;
  --border:    #D6D0BD;
  --rule:      #112045;
  --fg:        #112045;
  --fg-body:   #3A4566;
  --fg-meta:   #5C6A8C;
  --link:      #112045;
  --link-hover:#2A4180;
}

/* ── Preset: Ink (warm dark) ───────────────────────────────── */
[data-preset="ink"] {
  --bg:        #16140F;
  --surface:   #1E1B16;
  --surface-2: #25211B;
  --border:    #2E2A23;
  --rule:      #F4EFE6;
  --fg:        #F4EFE6;
  --fg-body:   #D9D2C4;
  --fg-muted:  #A89378;
  --fg-meta:   #C4A47A;
  --link:      #F4EFE6;
  --link-hover:#E8B27A;
}

/* ── Modern Presets ────────────────────────────────────────── */
[data-preset="slate"] {
  --bg:        #FAFAF9;
  --surface:   #F4F4F2;
  --surface-2: #ECECE9;
  --border:    #E2E2DF;
  --rule:      #18181B;
  --fg:        #18181B;
  --fg-body:   #3F3F46;
  --fg-muted:  #71717A;
  --fg-meta:   #52525B;
  --link:      #18181B;
  --link-hover:#6366F1;
}
[data-preset="sand"] {
  --bg:        #F5F2EC;
  --surface:   #EDE8DD;
  --surface-2: #E3DCCC;
  --border:    #D6CCB6;
  --rule:      #1C1917;
  --fg:        #1C1917;
  --fg-body:   #44403C;
  --fg-muted:  #78716C;
  --fg-meta:   #57534E;
  --link:      #1C1917;
  --link-hover:#C2410C;
}
[data-preset="plum"] {
  --bg:        #FBFAFB;
  --surface:   #F5F2F6;
  --surface-2: #EDE8EE;
  --border:    #DFD8E1;
  --rule:      #1F1B24;
  --fg:        #1F1B24;
  --fg-body:   #44404A;
  --fg-muted:  #8B8694;
  --fg-meta:   #6D5A78;
  --link:      #6B46C1;
  --link-hover:#4F2D8E;
}
[data-preset="forest"] {
  --bg:        #F8FAF7;
  --surface:   #EEF2EB;
  --surface-2: #E2EADF;
  --border:    #D2DCCB;
  --rule:      #14271C;
  --fg:        #14271C;
  --fg-body:   #3D4F44;
  --fg-muted:  #7A857D;
  --fg-meta:   #4C6452;
  --link:      #1F5236;
  --link-hover:#0F3522;
}
[data-preset="mono"] {
  --bg:        #FFFFFF;
  --surface:   #F7F7F7;
  --surface-2: #EEEEEE;
  --border:    #E5E5E5;
  --rule:      #000000;
  --fg:        #000000;
  --fg-body:   #404040;
  --fg-muted:  #737373;
  --fg-meta:   #525252;
  --link:      #000000;
  --link-hover:#525252;
}

/* ── Preset: Onyx (cool dark) ──────────────────────────────── */
[data-preset="onyx"] {
  --bg:        #0A0A0C;
  --surface:   #14141A;
  --surface-2: #1E1E26;
  --border:    #2A2A33;
  --rule:      #FAFAFA;
  --fg:        #FAFAFA;
  --fg-body:   #D4D4D8;
  --fg-muted:  #71717A;
  --fg-meta:   #A1A1AA;
  --link:      #FAFAFA;
  --link-hover:#FCD9A8;
}

/* ── Preset: Clinic (Verdict roundup — white / blue CTA) ───────
   Built for scored comparison listicles. Unlike the editorial presets this one
   is all-sans: headings remap to --sans, matching the review-site convention. */
[data-preset="clinic"] {
  --bg:        #FFFFFF;
  --surface:   #F8FAFC;
  --surface-2: #F1F5F9;
  --border:    #E2E8F0;
  --rule:      #0F172A;
  --fg:        #0F172A;
  --fg-body:   #334155;
  --fg-muted:  #94A3B8;
  --fg-meta:   #64748B;
  --link:      #1D4ED8;
  --link-hover:#1E40AF;

  /* Review-site headings are sans, not serif */
  --display-font: var(--sans);
  --h1-font:      var(--sans);
  --h2-font:      var(--sans);
  --h3-font:      var(--sans);
  --h4-font:      var(--sans);
  --body-font:    var(--sans);
}

/* =============================================================
   Base element defaults — scoped to .inkwell-root
   ============================================================= */

.inkwell-root,
.inkwell-root * {
  box-sizing: border-box;
}

.inkwell-root {
  background: var(--bg);
  color: var(--fg-body);
  font-family: var(--body-font);
  font-size: var(--fs-body);
  line-height: var(--lh-prose);
  font-weight: var(--w-regular);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  font-feature-settings: "kern", "liga", "onum";
}

.inkwell-root .ui-region {
  font-family: var(--ui-font);
  font-size: var(--fs-ui);
  line-height: 1.5;
  font-feature-settings: "kern", "liga", "ss01", "tnum";
  color: var(--fg);
}

.inkwell-root h1,
.inkwell-root h2,
.inkwell-root h3 {
  font-family: var(--serif);
  font-weight: var(--w-medium);
  color: var(--fg);
  letter-spacing: var(--tracking-tight);
  line-height: var(--lh-snug);
  text-wrap: balance;
}

.inkwell-root h1 { font-size: var(--fs-h1); letter-spacing: var(--tracking-display); }
.inkwell-root h2 { font-size: var(--fs-h2); }
.inkwell-root h3 { font-size: var(--fs-h3); }
.inkwell-root h4 {
  font-family: var(--sans);
  font-size: var(--fs-h4);
  font-weight: var(--w-medium);
  letter-spacing: 0;
  color: var(--fg);
}

.inkwell-root .display {
  font-family: var(--serif);
  font-size: var(--fs-display);
  font-weight: var(--w-medium);
  letter-spacing: var(--tracking-display);
  line-height: var(--lh-tight);
  color: var(--fg);
  text-wrap: balance;
}

.inkwell-root .lede {
  font-family: var(--serif);
  font-size: var(--fs-lede);
  line-height: 1.5;
  color: var(--fg-body);
  font-style: italic;
  text-wrap: pretty;
}

.inkwell-root .eyebrow {
  font-family: var(--sans);
  font-size: var(--fs-xs);
  font-weight: var(--w-medium);
  text-transform: uppercase;
  letter-spacing: var(--tracking-eyebrow);
  color: var(--fg-meta);
}

.inkwell-root .meta {
  font-family: var(--sans);
  font-size: var(--fs-sm);
  color: var(--fg-meta);
  letter-spacing: 0.01em;
}

.inkwell-root .byline {
  font-family: var(--sans);
  font-size: var(--fs-sm);
  color: var(--fg-meta);
}

.inkwell-root .byline em {
  font-style: italic;
  color: var(--fg);
  font-weight: var(--w-regular);
}

.inkwell-root p {
  margin: 0 0 1em 0;
  text-wrap: pretty;
}

.inkwell-root a {
  color: var(--link);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  text-decoration-color: var(--ink-sepia);
  transition: color var(--dur-fast) var(--ease-out),
              text-decoration-color var(--dur-fast) var(--ease-out);
}

.inkwell-root a:hover {
  color: var(--link-hover);
  text-decoration-color: var(--link-hover);
}

.inkwell-root code,
.inkwell-root pre {
  font-family: var(--mono);
  font-size: 0.92em;
}

.inkwell-root code {
  background: var(--surface);
  padding: 0.1em 0.35em;
  border-radius: var(--r-1);
  color: var(--fg);
}

.inkwell-root hr,
.inkwell-root .ink-rule {
  border: 0;
  border-top: 1px solid var(--rule);
  margin: var(--sp-8) 0;
}

.inkwell-root .ink-rule-soft { border-top-color: var(--border); }

/* Drop cap for essay openers */
.inkwell-root .dropcap::first-letter {
  font-family: var(--serif);
  font-weight: var(--w-medium);
  font-size: 4.2em;
  line-height: 0.86;
  /* Physical on purpose: Chromium lays out ::first-letter differently with float: inline-start / logical padding. */
  float: left;
  padding: 0.06em 0.12em 0 0;
  color: var(--fg);
}
/* Right-to-left sites get no drop cap: a detached first letter breaks letter joining in Arabic script and is not a
   Hebrew or Arabic typesetting convention. */
[dir="rtl"] .inkwell-root .dropcap::first-letter {
  float: none;
  font: inherit;
  line-height: inherit;
  padding: 0;
  color: inherit;
}

.inkwell-root ::selection {
  background: var(--ink-black);
  color: var(--ink-cream);
}

[data-preset="ink"] .inkwell-root ::selection,
[data-preset="onyx"] .inkwell-root ::selection {
  background: var(--ink-cream);
  color: var(--ink-black);
}

/* =============================================================
   Inkwell Magazine — Public blog layout components
   ============================================================= */

/* ── Site header ───────────────────────────────────────────── */
.ink-header {
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 1px solid var(--border);
  background: color-mix(in oklab, var(--bg) 78%, transparent);
  backdrop-filter: blur(14px) saturate(1.05);
  -webkit-backdrop-filter: blur(14px) saturate(1.05);
}

.ink-header-inner {
  max-width: var(--container);
  margin: 0 auto;
  padding: 16px var(--gutter);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
}

.ink-wordmark {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: inherit;
}

.ink-wordmark-text {
  font-family: var(--serif);
  font-weight: 500;
  font-size: 22px;
  letter-spacing: -0.02em;
  line-height: 1;
  color: var(--fg);
}

.ink-nav {
  display: flex;
  flex-wrap: wrap;            /* many categories wrap instead of pushing the page wider */
  row-gap: 8px;
  column-gap: 28px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.ink-nav a {
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--fg-meta);
  text-decoration: none;
}

.ink-nav a:hover { color: var(--fg); }

/* ── Buttons ───────────────────────────────────────────────── */
.ink-btn {
  font-family: var(--sans);
  font-weight: 500;
  font-size: 13px;
  padding: 9px 16px;
  background: var(--ink-black);
  color: var(--ink-cream);
  border: 1px solid var(--ink-black);
  border-radius: var(--r-1);
  cursor: pointer;
  line-height: 1;
  letter-spacing: 0;
  text-decoration: none;
  display: inline-block;
  transition: background var(--dur-fast) var(--ease-out),
              color var(--dur-fast) var(--ease-out);
}

.ink-btn:hover {
  background: transparent;
  color: var(--ink-black);
  text-decoration: none;
}

.ink-btn-ghost {
  background: transparent;
  color: var(--fg);
}

.ink-btn-ghost:hover {
  background: var(--ink-black);
  color: var(--ink-cream);
}

/* ── Logomark SVG ──────────────────────────────────────────── */
.ink-logomark {
  display: inline-block;
  flex-shrink: 0;
}

/* ── Masthead / page header ────────────────────────────────── */
.ink-masthead {
  max-width: var(--container);
  margin: 0 auto;
  padding: var(--sp-16) var(--gutter) var(--sp-10);
  border-bottom: 1px solid var(--ink-black);
}

/* ── Hero split (Magazine index) ───────────────────────────── */
.ink-hero {
  max-width: var(--container);
  margin: 0 auto;
  padding: var(--sp-12) var(--gutter);
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: 48px;
  align-items: stretch;
}

.ink-hero-cover {
  aspect-ratio: 4 / 3;
  border-radius: var(--r-2);
  display: block;
  position: relative;
  overflow: hidden;
  text-decoration: none;
}

.ink-hero-cover-caption {
  position: absolute;
  inset-inline-start: 16px;
  top: 14px;
  font-family: var(--serif);
  font-style: italic;
  color: var(--ink-cream);
  font-size: 14px;
  opacity: .85;
}

.ink-hero-body {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding-top: 8px;
}

.ink-hero-title {
  font-family: var(--serif);
  font-weight: 500;
  font-size: 44px;
  line-height: 1.08;
  letter-spacing: -0.025em;
  color: var(--fg);
  margin: 0 0 16px;
  text-wrap: balance;
  text-decoration: none;
}

.ink-hero-title a {
  color: inherit;
  text-decoration: none;
}

/* ── Secondary section (Magazine index) ────────────────────── */
.ink-secondary-grid {
  max-width: var(--container);
  margin: 0 auto;
  padding: var(--sp-12) var(--gutter);
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 48px;
}

.ink-featured-aside {
  border-inline-end: 1px solid var(--border);
  padding-inline-end: 48px;
}

.ink-grid-4up {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 36px;
}

.ink-card-cover {
  display: block;
  aspect-ratio: 4 / 3;
  border-radius: var(--r-2);
  margin-bottom: 14px;
  position: relative;
  text-decoration: none;
  transition: opacity var(--dur-fast) var(--ease-out);
}

.ink-card-cover:hover { opacity: .92; }

.ink-card-title {
  font-family: var(--serif);
  font-weight: 500;
  font-size: 19px;
  line-height: 1.25;
  letter-spacing: -0.01em;
  color: var(--fg);
  margin: 0 0 8px;
}

.ink-card-title a {
  color: inherit;
  text-decoration: none;
}

.ink-card-title a:hover { color: var(--link-hover); }

/* ── Essay body (Post view) ────────────────────────────────── */
.ink-essay-wrap {
  max-width: var(--measure-prose);
  margin: 0 auto;
  padding: var(--sp-16) var(--gutter);
}

.ink-essay-header {
  margin-bottom: var(--sp-10);
}

.ink-essay-title {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(36px, 4vw, 52px);
  line-height: 1.08;
  letter-spacing: -0.025em;
  color: var(--fg);
  margin: 0 0 18px;
  text-wrap: balance;
}

.ink-essay-lede {
  font-family: var(--serif);
  font-size: 21px;
  line-height: 1.5;
  color: var(--fg-body);
  font-style: italic;
  margin: 0 0 var(--sp-8);
}

.ink-essay-cover {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: var(--r-2);
  display: block;
  margin-bottom: var(--sp-10);
}

.ink-essay-body {
  font-family: var(--serif);
  font-size: var(--fs-body);
  line-height: var(--lh-prose);
  color: var(--fg-body);
  font-feature-settings: "kern", "liga", "onum";
}

.ink-essay-body p { margin: 0 0 1.1em; }

.ink-essay-body h2 {
  font-family: var(--serif);
  font-size: 26px;
  font-weight: 500;
  color: var(--fg);
  margin: var(--sp-10) 0 var(--sp-4);
  letter-spacing: -0.015em;
}

.ink-essay-body h3 {
  font-family: var(--serif);
  font-size: 20px;
  font-weight: 500;
  color: var(--fg);
  margin: var(--sp-8) 0 var(--sp-3);
}

.ink-essay-body a {
  color: var(--link);
  text-decoration-color: var(--ink-sepia);
}

.ink-essay-body a:hover { color: var(--link-hover); }

.ink-essay-body blockquote {
  border-inline-start: 2px solid var(--ink-black);
  margin: var(--sp-8) 0;
  padding-block:var(--sp-3) var(--sp-3);padding-inline:var(--sp-6) 0;
  font-style: italic;
  color: var(--fg-body);
}

.ink-essay-body ul,
.ink-essay-body ol {
  margin-block:0 1.1em;margin-inline:var(--sp-6) 0;
}

.ink-essay-body li { margin-bottom: .4em; }

/* ── Pilcrow divider ───────────────────────────────────────── */
.ink-pilcrow {
  display: flex;
  align-items: center;
  gap: 18px;
  color: var(--fg-meta);
  margin: var(--sp-12) 0;
}

.ink-pilcrow::before,
.ink-pilcrow::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

.ink-pilcrow-glyph {
  font-family: var(--serif);
  font-size: 22px;
  color: var(--ink-sepia);
}

/* ── Footer ────────────────────────────────────────────────── */
.ink-footer {
  border-top: 1px solid var(--ink-black);
  margin-top: var(--sp-20);
  padding: var(--sp-16) var(--gutter) var(--sp-12);
}

.ink-footer-inner {
  max-width: var(--container);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 40px;
}

.ink-footer-brand-desc {
  font-family: var(--serif);
  font-style: italic;
  font-size: 15px;
  color: var(--fg-body);
  margin: 12px 0 0;
  max-width: 320px;
  line-height: 1.5;
}

.ink-footer-col-title {
  font-family: var(--sans);
  font-size: var(--fs-xs);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: var(--tracking-eyebrow);
  color: var(--fg-meta);
  margin-bottom: 14px;
}

.ink-footer-col ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ink-footer-col a {
  font-family: var(--sans);
  font-size: 14px;
  color: var(--fg);
  text-decoration: none;
}

.ink-footer-col a:hover { color: var(--link-hover); }

.ink-footer-bottom {
  max-width: var(--container);
  margin: var(--sp-12) auto 0;
  display: flex;
  justify-content: space-between;
  font-family: var(--sans);
  font-size: 12px;
  color: var(--fg-meta);
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

/* ── Subscribe block ───────────────────────────────────────── */
.ink-subscribe {
  background: var(--surface);
  border: 1px solid var(--ink-black);
  padding: 28px;
}

.ink-subscribe-title {
  font-family: var(--serif);
  font-weight: 500;
  font-size: 22px;
  line-height: 1.2;
  letter-spacing: -0.015em;
  color: var(--fg);
  margin: 10px 0 6px;
}

.ink-subscribe-desc {
  font-family: var(--serif);
  font-style: italic;
  font-size: 14px;
  line-height: 1.5;
  color: var(--fg-body);
  margin: 0 0 14px;
}

.ink-subscribe-form {
  display: flex;
  gap: 8px;
}

.ink-subscribe-input {
  flex: 1;
  font-family: var(--sans);
  font-size: 13px;
  padding: 9px 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--r-1);
  outline: none;
  color: var(--fg);
}

.ink-subscribe-input:focus { border-color: var(--ink-black); }

/* ── Tags ──────────────────────────────────────────────────── */
.ink-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: var(--sp-8) 0;
}

.ink-tag {
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 500;
  padding: 5px 12px;
  border: 1px solid var(--ink-black);
  border-radius: var(--r-1);
  color: var(--fg);
  text-decoration: none;
  transition: background var(--dur-fast) var(--ease-out);
}

.ink-tag:hover {
  background: var(--ink-black);
  color: var(--ink-cream);
  text-decoration: none;
}

/* ── Share row ─────────────────────────────────────────────── */
.ink-share {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: var(--sp-8) 0;
  border-top: 1px solid var(--border);
  font-family: var(--sans);
  font-size: var(--fs-sm);
  color: var(--fg-meta);
}

.ink-share-link {
  width: 36px;
  height: 36px;
  border: 1px solid var(--border);
  border-radius: var(--r-1);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--fg);
  text-decoration: none;
  transition: border-color var(--dur-fast) var(--ease-out);
}

.ink-share-link:hover {
  border-color: var(--ink-black);
  color: var(--fg);
  text-decoration: none;
}

/* ── Related essays ────────────────────────────────────────── */
.ink-related {
  margin-top: var(--sp-12);
  padding-top: var(--sp-10);
  border-top: 1px solid var(--ink-black);
}

.ink-related-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
  margin-top: var(--sp-6);
}

.ink-related-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  text-decoration: none;
  color: inherit;
}

.ink-related-card-cover {
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: var(--r-2);
  display: block;
  border: 1px solid var(--border);
}

.ink-related-card-title {
  font-family: var(--serif);
  font-size: 16px;
  font-weight: 500;
  color: var(--fg);
  line-height: 1.3;
}

.ink-related-card:hover .ink-related-card-title { color: var(--link-hover); }

/* ── Pagination ────────────────────────────────────────────── */
.ink-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: var(--sp-12);
  padding-top: var(--sp-10);
  border-top: 1px solid var(--border);
}

.ink-pagination a,
.ink-pagination span {
  font-family: var(--sans);
  font-size: 13px;
  color: var(--fg-meta);
}

.ink-pagination a {
  padding: 8px 16px;
  border: 1px solid var(--ink-black);
  border-radius: var(--r-1);
  text-decoration: none;
  color: var(--fg);
  transition: background var(--dur-fast) var(--ease-out);
}

.ink-pagination a:hover {
  background: var(--ink-black);
  color: var(--ink-cream);
  text-decoration: none;
}

/* ── FAQ accordion ─────────────────────────────────────────── */
.ink-faq {
  border-top: 1px solid var(--border);
  padding-top: var(--sp-10);
  margin-top: var(--sp-10);
}

.ink-faq-item {
  border-bottom: 1px solid var(--border);
}

.ink-faq-question {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--sp-4) 0;
  background: none;
  border: none;
  cursor: pointer;
  font-family: var(--serif);
  font-size: 17px;
  font-weight: 500;
  color: var(--fg);
  text-align: start;
  gap: var(--sp-4);
}

.ink-faq-answer {
  font-family: var(--serif);
  font-size: 16px;
  line-height: 1.7;
  color: var(--fg-body);
  padding-bottom: var(--sp-4);
}

/* ── Table of Contents ─────────────────────────────────────── */
.ink-toc {
  --toc-accent: var(--link);
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-inline-start: 3px solid var(--toc-accent);
  border-radius: var(--r-2);
  padding: var(--sp-5) var(--sp-6);
  margin: var(--sp-8) 0;
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.5;
  overflow: hidden;
}

.ink-toc-progress {
  position: absolute;
  top: 0; left: 3px; right: 0;
  height: 2px;
  background: color-mix(in srgb, var(--border) 80%, transparent);
}

.ink-toc-progress-bar {
  height: 100%;
  width: 0%;
  background: var(--toc-accent);
  transition: width 0.1s linear;
}

.ink-toc-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-4);
  padding-bottom: var(--sp-4);
  border-bottom: 1px solid var(--border);
  margin-bottom: var(--sp-4);
  cursor: pointer;
  user-select: none;
}

.ink-toc-title {
  font-family: var(--sans);
  font-size: var(--fs-xs);
  font-weight: 600;
  letter-spacing: var(--tracking-eyebrow);
  text-transform: uppercase;
  color: var(--fg-meta);
  margin: 0;
  transition: color var(--dur-fast);
}

.ink-toc-header:hover .ink-toc-title { color: var(--fg); }

.ink-toc-toggle {
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--fg-meta);
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  flex-shrink: 0;
  transition: transform var(--dur-base) var(--ease-out), color var(--dur-fast);
}

.ink-toc-toggle:hover { color: var(--fg); }

.ink-toc.is-collapsed .ink-toc-toggle {
  transform: rotate(-90deg);
}

.ink-toc-body {
  overflow: hidden;
  transition: max-height var(--dur-slow) var(--ease-out), opacity var(--dur-base) var(--ease-out);
  max-height: 2000px;
  opacity: 1;
}

.ink-toc.is-collapsed .ink-toc-body {
  max-height: 0;
  opacity: 0;
}

.ink-toc-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
  counter-reset: toc-h2;
}

.ink-toc-list .ink-toc-list {
  margin-top: 1px;
  margin-inline-start: var(--sp-3);
  padding-inline-start: var(--sp-3);
  border-inline-start: 1px solid var(--border);
  counter-reset: toc-h3;
}

.ink-toc-list .ink-toc-list .ink-toc-list {
  counter-reset: toc-h4;
}

.ink-toc-item                                          { counter-increment: toc-h2; }
.ink-toc-list .ink-toc-list > .ink-toc-item            { counter-increment: toc-h3; }
.ink-toc-list .ink-toc-list .ink-toc-list > .ink-toc-item { counter-increment: toc-h4; }

.ink-toc-link {
  display: flex;
  align-items: baseline;
  gap: var(--sp-2);
  padding: 4px 8px;
  border-radius: var(--r-1);
  color: var(--fg-body);
  text-decoration: none;
  line-height: 1.4;
  transition: color var(--dur-fast), background var(--dur-fast), padding-left var(--dur-base);
  word-break: break-word;
}

.ink-toc-link::before {
  content: counter(toc-h2);
  font-size: var(--fs-xs);
  font-variant-numeric: tabular-nums;
  color: var(--fg-meta);
  flex-shrink: 0;
  min-width: 16px;
  line-height: inherit;
}

.ink-toc-list .ink-toc-list .ink-toc-link::before {
  content: counter(toc-h2) "." counter(toc-h3);
}

.ink-toc-list .ink-toc-list .ink-toc-list .ink-toc-link::before {
  content: counter(toc-h2) "." counter(toc-h3) "." counter(toc-h4);
}

.ink-toc-link:hover {
  color: var(--toc-accent);
  background: color-mix(in srgb, var(--toc-accent) 7%, transparent);
  padding-inline-start: 12px;
  text-decoration: none;
}

.ink-toc-link.is-active {
  color: var(--toc-accent);
  font-weight: 500;
  background: color-mix(in srgb, var(--toc-accent) 9%, transparent);
}

.ink-toc-link.is-active::before { color: var(--toc-accent); }

@media (max-width: 680px) {
  .ink-toc { font-size: 13px; }
}

@media (prefers-reduced-motion: reduce) {
  .ink-toc-body,
  .ink-toc-toggle,
  .ink-toc-progress-bar,
  .ink-toc-link { transition: none; }
}

/* ── Comment section ───────────────────────────────────────── */
.ink-comments {
  max-width: var(--measure-prose);
  margin: var(--sp-12) auto;
  padding: 0 var(--gutter);
}

.ink-comments-title {
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 500;
  color: var(--fg);
  padding-bottom: var(--sp-4);
  border-bottom: 1px solid var(--border);
  margin-bottom: var(--sp-8);
}

.ink-comment-form {
  background: var(--surface);
  border: 1px solid var(--border);
  padding: var(--sp-8);
  margin-top: var(--sp-8);
}

.ink-comment-form h3 {
  font-family: var(--serif);
  font-size: 18px;
  font-weight: 500;
  color: var(--fg);
  margin: 0 0 var(--sp-6);
}

.ink-input {
  width: 100%;
  font-family: var(--sans);
  font-size: 14px;
  padding: 10px 0;
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--ink-black);
  outline: none;
  color: var(--fg);
  border-radius: 0;
}

.ink-input:focus { border-bottom-color: var(--ink-black); }

.ink-input::placeholder { color: var(--fg-muted); }

/* ── Responsive ────────────────────────────────────────────── */
@media (max-width: 900px) {
  .ink-hero { grid-template-columns: 1fr; }
  .ink-secondary-grid { grid-template-columns: 1fr; }
  .ink-featured-aside { border-inline-end: none; padding-inline-end: 0; border-bottom: 1px solid var(--border); padding-bottom: var(--sp-8); }
  .ink-grid-4up { grid-template-columns: 1fr 1fr; }
  .ink-footer-inner { grid-template-columns: 1fr 1fr; gap: 24px; }
  .ink-related-grid { grid-template-columns: 1fr; }
}

@media (max-width: 600px) {
  .ink-nav { display: none; }
  .ink-grid-4up { grid-template-columns: 1fr; }
  .ink-footer-inner { grid-template-columns: 1fr; }
}

/* =============================================================
   Verdict — scored roundup / comparison components
   Inkwell token namespace only. Semantic colours are declared here so the
   components render correctly under EVERY preset, not just Clinic.
   ============================================================= */

.inkwell-root {
  --vd-pro:        #15803D;
  --vd-pro-bg:     rgba(21, 128, 61, 0.08);
  --vd-con:        #B91C1C;
  --vd-con-bg:     rgba(185, 28, 28, 0.07);
  --vd-badge:      #B45309;
  --vd-badge-bg:   rgba(180, 83, 9, 0.10);
  --vd-cta:        var(--link);
  --vd-cta-fg:     #FFFFFF;
  --vd-score:      var(--fg);
}

/* Dark presets need lighter pro/con hues to stay legible */
[data-preset="ink"].inkwell-root,
[data-preset="onyx"].inkwell-root {
  --vd-pro:      #4ADE80;
  --vd-pro-bg:   rgba(74, 222, 128, 0.10);
  --vd-con:      #F87171;
  --vd-con-bg:   rgba(248, 113, 113, 0.10);
  --vd-badge:    #FBBF24;
  --vd-badge-bg: rgba(251, 191, 36, 0.12);
}

.vd-wrap {
  max-width: var(--measure-wide);
  margin: 0 auto;
  padding: 0 var(--gutter);
  font-family: var(--sans);
  color: var(--fg-body);
}

/* ── Byline / trust strip ─────────────────────────────────── */
.vd-trust {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2) var(--sp-4);
  align-items: center;
  padding: var(--sp-4) 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  margin-bottom: var(--sp-8);
  font-size: var(--fs-sm);
  color: var(--fg-meta);
}

.vd-trust-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border: 1px solid var(--border);
  border-radius: var(--r-pill);
  background: var(--surface);
  white-space: nowrap;
}

.vd-trust-badge svg { color: var(--vd-pro); flex: none; }

/* ── Editor's picks (top 3) ───────────────────────────────── */
.vd-picks {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--sp-5);
  margin: var(--sp-8) 0 var(--sp-12);
}

.vd-pick {
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
  padding: var(--sp-6);
  border: 1px solid var(--border);
  border-radius: var(--r-2);
  background: var(--surface);
  transition: box-shadow var(--dur-base) var(--ease-out);
}

.vd-pick:hover { box-shadow: var(--shadow-lift); }
.vd-pick--top { border-color: var(--vd-badge); }

.vd-pick-logo {
  width: 48px; height: 48px;
  object-fit: contain;
  border-radius: var(--r-2);
}

.vd-pick-name {
  font-family: var(--sans);
  font-size: var(--fs-h4);
  font-weight: 600;
  color: var(--fg);
  margin: 0;
}

.vd-pick-blurb {
  font-size: var(--fs-sm);
  line-height: var(--lh-body);
  color: var(--fg-body);
  margin: 0;
  flex: 1;
}

/* ── Badges & scores ──────────────────────────────────────── */
.vd-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: var(--r-pill);
  background: var(--vd-badge-bg);
  color: var(--vd-badge);
  font-size: var(--fs-xs);
  font-weight: 600;
  letter-spacing: var(--tracking-eyebrow);
  text-transform: uppercase;
  white-space: nowrap;
}

.vd-chip {
  display: inline-block;
  padding: 2px 8px;
  border: 1px solid var(--border);
  border-radius: var(--r-pill);
  background: var(--surface-2);
  color: var(--fg-meta);
  font-size: var(--fs-xs);
  white-space: nowrap;
}

.vd-score {
  font-family: var(--sans);
  font-weight: 700;
  font-size: var(--fs-h3);
  color: var(--vd-score);
  line-height: 1;
}

.vd-score-max { font-size: var(--fs-sm); font-weight: 400; color: var(--fg-muted); }

.vd-score-bars { display: grid; gap: 6px; margin: var(--sp-4) 0; }

.vd-score-bar {
  display: grid;
  grid-template-columns: 90px 1fr 34px;
  align-items: center;
  gap: var(--sp-3);
  font-size: var(--fs-xs);
  color: var(--fg-meta);
}

.vd-score-track {
  height: 5px;
  border-radius: var(--r-pill);
  background: var(--surface-2);
  overflow: hidden;
}

.vd-score-fill {
  display: block;
  height: 100%;
  border-radius: var(--r-pill);
  background: var(--link);
}

/* ── CTA ──────────────────────────────────────────────────── */
.vd-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 18px;
  border-radius: var(--r-2);
  background: var(--vd-cta);
  color: var(--vd-cta-fg);
  font-family: var(--sans);
  font-size: var(--fs-ui);
  font-weight: 600;
  text-decoration: none;
  border: 1px solid transparent;
  transition: opacity var(--dur-fast) var(--ease-out);
}

.vd-cta:hover { opacity: .88; color: var(--vd-cta-fg); text-decoration: none; }

.vd-cta--ghost {
  background: transparent;
  color: var(--link);
  border-color: var(--border);
}

.vd-cta--ghost:hover { background: var(--surface-2); color: var(--link); }

/* ── Methodology ──────────────────────────────────────────── */
.vd-method {
  padding: var(--sp-6);
  border: 1px solid var(--border);
  border-radius: var(--r-2);
  background: var(--surface);
  margin: var(--sp-8) 0;
}

.vd-method-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--sp-5);
  margin-top: var(--sp-4);
}

.vd-method-num {
  font-family: var(--mono);
  font-size: var(--fs-xs);
  font-weight: 600;
  color: var(--vd-badge);
  letter-spacing: var(--tracking-eyebrow);
}

.vd-method-step {
  font-weight: 600;
  color: var(--fg);
  font-size: var(--fs-ui);
  margin: 4px 0 2px;
}

.vd-method-detail { font-size: var(--fs-sm); color: var(--fg-meta); line-height: var(--lh-body); }

/* ── Comparison table ─────────────────────────────────────── */
.vd-table-wrap { overflow-x: auto; margin: var(--sp-8) 0; }

.vd-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--fs-ui);
  min-width: 640px;
}

.vd-table th {
  text-align: start;
  padding: var(--sp-3) var(--sp-4);
  border-bottom: 2px solid var(--rule);
  font-size: var(--fs-xs);
  text-transform: uppercase;
  letter-spacing: var(--tracking-eyebrow);
  color: var(--fg-meta);
  font-weight: 600;
  white-space: nowrap;
}

.vd-table td {
  padding: var(--sp-4);
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
  color: var(--fg-body);
}

.vd-table tbody tr:nth-child(even) { background: var(--surface); }
.vd-table tbody tr:hover { background: var(--surface-2); }

.vd-table-rank {
  font-family: var(--mono);
  font-weight: 600;
  color: var(--fg-muted);
}

.vd-table-name { font-weight: 600; color: var(--fg); text-decoration: none; }
.vd-table-name:hover { color: var(--link); }

/* ── Entry card ───────────────────────────────────────────── */
.vd-entry {
  padding: var(--sp-8) 0;
  border-top: 1px solid var(--border);
  scroll-margin-top: 80px;
}

.vd-entry-head {
  display: flex;
  align-items: flex-start;
  gap: var(--sp-4);
  flex-wrap: wrap;
}

.vd-entry-rank {
  font-family: var(--mono);
  font-size: var(--fs-h2);
  font-weight: 700;
  color: var(--fg-muted);
  line-height: 1;
  min-width: 44px;
}

.vd-entry-title {
  font-family: var(--sans);
  font-size: var(--fs-h3);
  font-weight: 700;
  color: var(--fg);
  margin: 0;
}

.vd-entry-meta {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  flex-wrap: wrap;
  margin-top: 6px;
}

.vd-entry-score { margin-inline-start: auto; text-align: end; }

.vd-callout {
  padding: var(--sp-3) var(--sp-4);
  border-inline-start: 3px solid var(--link);
  background: var(--surface);
  margin: var(--sp-4) 0;
  font-size: var(--fs-ui);
  color: var(--fg-body);
}

.vd-callout strong { color: var(--fg); }

.vd-entry-body {
  font-size: var(--fs-body);
  line-height: var(--lh-prose);
  color: var(--fg-body);
  margin: var(--sp-4) 0;
}

/* Disclosure for the publisher's own product: quiet but legible, never styled as a badge. */
.vd-entry-disclosure {
  font-size: var(--fs-ui);
  font-style: italic;
  color: var(--fg-meta);
  margin: var(--sp-3) 0;
}

/* ── Pros / cons ──────────────────────────────────────────── */
.vd-proscons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--sp-5);
  margin: var(--sp-5) 0;
}

.vd-list {
  padding: var(--sp-4) var(--sp-5);
  border-radius: var(--r-2);
}

.vd-list--pro { background: var(--vd-pro-bg); }
.vd-list--con { background: var(--vd-con-bg); }

.vd-list ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.vd-list-title {
  font-size: var(--fs-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: var(--tracking-eyebrow);
  margin: 0 0 var(--sp-2);
}

.vd-list--pro .vd-list-title { color: var(--vd-pro); }
.vd-list--con .vd-list-title { color: var(--vd-con); }

.vd-list li {
  position: relative;
  padding-inline-start: 20px;
  margin: 6px 0;
  font-size: var(--fs-sm);
  line-height: var(--lh-body);
  color: var(--fg-body);
}

.vd-list li::before {
  position: absolute;
  inset-inline-start: 0;
  top: -1px;
  font-weight: 700;
}

.vd-list--pro li::before { content: "+"; color: var(--vd-pro); }
.vd-list--con li::before { content: "–"; color: var(--vd-con); }

.vd-entry-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-4);
  flex-wrap: wrap;
  margin-top: var(--sp-5);
}

.vd-verified { font-size: var(--fs-xs); color: var(--fg-muted); }

.vd-backtotop {
  font-size: var(--fs-xs);
  color: var(--fg-muted);
  text-decoration: none;
}

.vd-backtotop:hover { color: var(--link); }

/* ── Sources ──────────────────────────────────────────────── */
.vd-sources { margin: var(--sp-10) 0; }

.vd-source {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-3) 0;
  border-bottom: 1px solid var(--border);
  font-size: var(--fs-sm);
}

.vd-source-num { font-family: var(--mono); color: var(--fg-muted); min-width: 24px; }

/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 900px) {
  .vd-picks { grid-template-columns: 1fr; }
  .vd-method-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 600px) {
  .vd-proscons { grid-template-columns: 1fr; }
  .vd-method-grid { grid-template-columns: 1fr; }
  .vd-entry-score { margin-inline-start: 0; text-align: start; width: 100%; }
  .vd-score-bar { grid-template-columns: 76px 1fr 30px; }
}

/* =============================================================
   Dark scheme — applies when the operator's colour scheme is
   "system" and the reader prefers dark, or is forced to "dark".
   Presets that are already dark (ink, onyx) keep their own palette.
   Values are the Ink preset's, so dark mode reads as a first-class
   preset rather than an inverted light one.
   ============================================================= */
@media (prefers-color-scheme: dark) {
  html:not([data-theme="light"]) body.inkwell-root:not([data-preset="ink"]):not([data-preset="onyx"]) {
    color-scheme: dark;
    --bg:         #16140F;
    --surface:    #1E1B16;
    --surface-2:  #26221C;
    --border:     #332E26;
    --rule:       #E8E1D3;
    --fg:         #F4EFE6;
    --fg-body:    #CFC7BA;
    --fg-muted:   #A69E90;
    --fg-meta:    #B49A78;
    --link:       #F4EFE6;
    --link-hover: #E0895A;
  }
}
html[data-theme="dark"] body.inkwell-root:not([data-preset="ink"]):not([data-preset="onyx"]) {
  color-scheme: dark;
  --bg:         #16140F;
  --surface:    #1E1B16;
  --surface-2:  #26221C;
  --border:     #332E26;
  --rule:       #E8E1D3;
  --fg:         #F4EFE6;
  --fg-body:    #CFC7BA;
  --fg-muted:   #A69E90;
  --fg-meta:    #B49A78;
  --link:       #F4EFE6;
  --link-hover: #E0895A;
}

/* =============================================================
   Header search (Views/Shared/_NavSearch.cshtml)
   ============================================================= */
header:has(> .ink-nav-search), nav:has(> .ink-nav-search) { position: relative; }
.ink-nav-search { position: absolute; inset-inline-end: 12px; top: 10px; z-index: 40; font-family: var(--sans); }
.ink-nav-search > summary {
  list-style: none; cursor: pointer; width: 36px; height: 36px; border-radius: 999px;
  display: inline-flex; align-items: center; justify-content: center; color: var(--fg-meta);
  background: transparent; transition: background .15s, color .15s;
}
.ink-nav-search > summary::-webkit-details-marker { display: none; }
.ink-nav-search > summary:hover, .ink-nav-search[open] > summary { background: var(--surface-2); color: var(--fg); }
.ink-nav-search__form {
  position: absolute; inset-inline-end: 0; top: 42px; display: flex; gap: 6px; padding: 8px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0,0,0,.12); min-width: min(320px, calc(100vw - 24px));
}
.ink-nav-search__form input {
  flex: 1; min-width: 0; height: 36px; padding: 0 10px; font-size: var(--fs-sm);
  color: var(--fg); background: var(--bg); border: 1px solid var(--border); border-radius: 6px;
}
.ink-nav-search__form button {
  height: 36px; padding: 0 12px; font-size: var(--fs-sm); font-weight: 500; border-radius: 6px;
  color: var(--bg); background: var(--fg); border: 0; cursor: pointer;
}

/* =============================================================
   Search results header (Views/Blog/Index.cshtml)
   ============================================================= */
.ink-search-head { max-width: var(--measure-wide, 1100px); margin: 0 auto; padding: 28px var(--gutter, 16px) 8px; font-family: var(--sans); }
.ink-search-head h1 { font-family: var(--serif); font-size: var(--fs-h2); line-height: var(--lh-snug); color: var(--fg); margin: 0 0 6px; }
.ink-search-head p { color: var(--fg-meta); font-size: var(--fs-sm); margin: 0 0 14px; }
.ink-search-head form { display: flex; gap: 8px; max-width: 520px; }
.ink-search-head input { flex: 1; height: 40px; padding: 0 12px; color: var(--fg); background: var(--surface); border: 1px solid var(--border); border-radius: 6px; font-size: var(--fs-ui); }
.ink-search-head button { height: 40px; padding: 0 16px; color: var(--bg); background: var(--fg); border: 0; border-radius: 6px; font-weight: 500; cursor: pointer; }
.ink-search-head a { color: var(--fg-meta); font-size: var(--fs-sm); align-self: center; margin-inline-start: 4px; }

/* =============================================================
   Table of contents (Views/Blog/_TableOfContents.cshtml)
   ============================================================= */
.ink-toc { margin: 0 0 var(--sp-8, 32px); padding: 14px 18px; background: var(--surface); border: 1px solid var(--border); border-radius: 8px; font-family: var(--sans); }
.ink-toc__title { cursor: pointer; list-style: none; font-size: var(--fs-xs); font-weight: 600; letter-spacing: var(--tracking-eyebrow); text-transform: uppercase; color: var(--fg-meta); }
.ink-toc__title::-webkit-details-marker { display: none; }
.ink-toc__title::after { content: "▾"; float: inline-end; transition: transform .15s; }
.ink-toc:not([open]) .ink-toc__title::after { transform: rotate(-90deg); }
.ink-toc__list { margin: 10px 0 0; padding: 0; list-style: none; columns: 1; }
.ink-toc__item { margin: 0; padding: 4px 0; font-size: var(--fs-sm); line-height: 1.4; }
.ink-toc__item--h3 { padding-inline-start: 16px; }
.ink-toc__item a { color: var(--fg-body); text-decoration: none; border-bottom: 1px solid transparent; }
.ink-toc__item a:hover { color: var(--fg); border-bottom-color: var(--border); }
@media (min-width: 900px) { .ink-toc__list { columns: 2; column-gap: 28px; } .ink-toc__item { break-inside: avoid; } }
[data-reading-body] h2[id], [data-reading-body] h3[id] { scroll-margin-top: 24px; }

/* =============================================================
   Reading progress (Views/Blog/_ReadingProgress.cshtml)
   ============================================================= */
.ink-progress { position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 60; pointer-events: none; background: transparent; }
.ink-progress__bar { height: 100%; width: 100%; transform: scaleX(0); transform-origin: 0 50%; background: var(--fg); opacity: .85; transition: transform .08s linear; }

/* =============================================================
   404 page (Views/Error/NotFound.cshtml)
   ============================================================= */
.ink-404 { max-width: 720px; margin: 0 auto; padding: var(--sp-16, 64px) var(--gutter, 16px); text-align: center; font-family: var(--sans); }
.ink-404__code { font-family: var(--serif); font-size: var(--fs-display); line-height: 1; color: var(--fg-meta); margin: 0 0 8px; }
.ink-404 h1 { font-family: var(--serif); font-size: var(--fs-h2); color: var(--fg); margin: 0 0 8px; }
.ink-404 p { color: var(--fg-body); font-size: var(--fs-ui); margin: 0 auto 22px; max-width: 48ch; }
.ink-404 form { display: flex; gap: 8px; max-width: 460px; margin: 0 auto 32px; }
.ink-404 input { flex: 1; height: 42px; padding: 0 12px; color: var(--fg); background: var(--surface); border: 1px solid var(--border); border-radius: 6px; font-size: var(--fs-ui); }
.ink-404 button { height: 42px; padding: 0 16px; color: var(--bg); background: var(--fg); border: 0; border-radius: 6px; font-weight: 500; cursor: pointer; }
.ink-404__popular { text-align: start; border-top: 1px solid var(--border); padding-top: 20px; }
.ink-404__popular h2 { font-size: var(--fs-xs); font-weight: 600; letter-spacing: var(--tracking-eyebrow); text-transform: uppercase; color: var(--fg-meta); margin: 0 0 10px; }
.ink-404__popular ul { list-style: none; margin: 0; padding: 0; }
.ink-404__popular li { padding: 8px 0; border-bottom: 1px solid var(--border); }
.ink-404__popular a { font-family: var(--serif); font-size: var(--fs-h4); color: var(--fg); text-decoration: none; }
.ink-404__popular a:hover { color: var(--link-hover); }
.ink-404__links { margin-top: 20px; font-size: var(--fs-sm); color: var(--fg-meta); }
.ink-404__links a { color: var(--fg); }

/* =============================================================
   Reader accessibility (2026-09-19): skip link, visible focus,
   prose measure. Appended so earlier rules are left untouched;
   the :focus-visible rules below out-rank the `outline: none`
   set on .ink-input / .ink-subscribe-input above.
   ============================================================= */
.skip-link {
  position: absolute;
  top: 0; inset-inline-start: 0;
  z-index: 1000;
  padding: 10px 16px;
  font-family: var(--sans);
  font-size: var(--fs-ui, 15px);
  font-weight: 600;
  color: var(--bg);
  background: var(--fg);
  border-radius: 0 0 var(--r-2, 4px) 0;
  text-decoration: none;
  /* Visually hidden until it takes focus; still in the tab order. */
  transform: translateY(-120%);
  opacity: 0;
}
.skip-link:focus,
.skip-link:focus-visible {
  transform: none;
  opacity: 1;
  outline: 2px solid var(--bg);
  outline-offset: -4px;
}
#main:focus { outline: none; } /* the skip-link target is focused programmatically; no ring needed */

/* Keyboard focus is always visible on the reader surface. Mouse clicks do not show the ring. */
:focus-visible {
  outline: 2px solid var(--fg);
  outline-offset: 2px;
}
.ink-input:focus-visible,
.ink-subscribe-input:focus-visible,
.ink-nav-search__form input:focus-visible,
.ink-404 input:focus-visible {
  outline: 2px solid var(--fg);
  outline-offset: 2px;
}

/* Line length for the prose block on layouts whose article column is wider than the reading measure. */
.ink-measure-prose {
  max-width: var(--measure-prose, 65ch);
}

/* Comment form feedback, placed beside the form it belongs to. */
.ink-form-alert {
  padding: var(--sp-4, 16px);
  border: 1px solid var(--border);
  background: var(--surface);
  font-family: var(--sans);
  font-size: 14px;
  color: var(--fg-body);
  margin-bottom: var(--sp-6, 24px);
}
.ink-form-alert--error { border-color: var(--ink-accent, var(--fg)); color: var(--ink-accent, var(--fg)); }

/* 404 "Go back" is a button (history.back() needs script), styled as the neighbouring links. */
.ink-404 .ink-404__back {
  height: auto;
  padding: 0;
  background: none;
  border: 0;
  border-radius: 0;
  font: inherit;
  color: var(--fg);
  text-decoration: underline;
  cursor: pointer;
}

/* ── Cookie consent (v1.0.8) ─────────────────────────────────────
   Shown by wwwroot/js/inkwell-consent.js only when the reader has not chosen yet. Fixed to the
   bottom so it never shifts the page; Accept and Reject carry equal weight on purpose. Tokens only,
   so every preset and both colour schemes render it. */
.ink-consent {
  position: fixed; left: 16px; right: 16px; bottom: 16px; z-index: 60;
  max-width: 720px; margin: 0 auto; padding: 16px 18px;
  background: var(--surface); color: var(--fg-body);
  border: 1px solid var(--border); border-radius: 6px;
  box-shadow: 0 6px 24px rgba(0, 0, 0, .18);
  font-family: var(--sans); font-size: 15px; line-height: 1.5;
}
.ink-consent[hidden] { display: none; }
.ink-consent__title { margin: 0 0 4px; font-weight: 600; color: var(--fg); font-size: 15px; }
.ink-consent__text { margin: 0 0 12px; }
.ink-consent__actions { display: flex; flex-wrap: wrap; gap: 8px; }
.ink-consent__btn {
  min-height: 40px; padding: 8px 18px; border-radius: 4px; cursor: pointer;
  font: inherit; font-weight: 600;
  background: var(--fg); color: var(--bg); border: 1px solid var(--fg);
}
.ink-consent__btn:hover { opacity: .9; }
.ink-consent-settings {
  display: block; margin: 0 auto; padding: 12px 16px 20px; text-align: center;
  background: none; border: 0; cursor: pointer;
  font: 13px var(--sans); color: var(--fg-meta); text-decoration: underline; text-underline-offset: 2px;
}
.ink-consent-settings:hover { color: var(--link-hover); }
@media print { .ink-consent, .ink-consent-settings { display: none; } }

/* ── Custom fields shown to readers ("Details", ADR-0025) — Inkwell tokens, so every preset and both schemes apply ── */
.ink-details {
  border: 1px solid var(--border);
  border-radius: var(--r-2, 6px);
  padding: 1rem 1.25rem;
  margin: 1.5rem 0;
  background: var(--surface, transparent);
}
.ink-details-title {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin: 0 0 0.6rem;
  color: var(--fg-meta, inherit);
}
.ink-details dl { display: grid; grid-template-columns: auto 1fr; gap: 0.4rem 1rem; margin: 0; }
.ink-details dt { font-weight: 600; color: var(--fg, inherit); }
.ink-details dd { margin: 0; color: var(--fg-body, inherit); overflow-wrap: anywhere; }
.ink-details a { color: var(--link, inherit); }
@media (max-width: 480px) {
  .ink-details dl { grid-template-columns: 1fr; gap: 0.1rem; }
  .ink-details dd { margin-bottom: 0.5rem; }
}

/* Phone-width fixes found by the v1.0.9 RTL check (they overflowed in both directions). */
.ink-header-inner > nav { min-width: 0; }
.ink-journal-grid { grid-template-columns: minmax(0, 1fr) 300px; }
.ink-broadsheet-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 767.98px) {
  .ink-journal-grid { grid-template-columns: minmax(0, 1fr); }
  .ink-journal-grid > aside { position: static !important; }
  .ink-broadsheet-grid { grid-template-columns: minmax(0, 1fr); }
}
