/* ehandelsguiden.com — "riso-affischen"
   Bespoke build from DESIGN.md (Flying Papers reference): a flat dusk-violet
   stage, poster-scale condensed display type (Anton for ObviouslyVariable),
   receipt-tight JetBrains Mono micro-labels, flat paint cards (bone white,
   lilac, one confetti accent at a time), 6px cards vs 100px pills, and zero
   shadows — depth is stacking order, never elevation.
   Contrast adaptation (WCAG-AA gate): the reference's yellow-on-violet type
   fails AA, so on the violet stage text is ink black (5.3:1) or large bone
   white (3.2:1, display only); Hi-Vis Yellow is kept strictly for outlined
   action borders and decorative marks. Body copy always sits on bone cards
   (ink) or lilac blocks (bone, 5.3:1). */

@font-face {
  font-family: 'Anton';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/fonts/anton-400.woff2') format('woff2');
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/fonts/inter-400.woff2') format('woff2');
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('/fonts/inter-700.woff2') format('woff2');
}
@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/fonts/jetbrains-mono-400.woff2') format('woff2');
}
@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('/fonts/jetbrains-mono-600.woff2') format('woff2');
}

:root {
  /* Colors — DESIGN.md tokens */
  --violet: #8584bd;     /* the stage */
  --hivis: #f4ed36;      /* outlined action borders + decorative marks ONLY */
  --butter: #f9cc73;     /* softer decorative sibling */
  --lilac: #61609a;      /* nested blocks on the stage */
  --pink: #f8c1ba;       /* confetti accent (one per composition) */
  --matcha: #b5c995;     /* confetti accent (one per composition) */
  --magenta: #ac4f98;    /* screaming accent card */
  --firecracker: #c94245;/* red wash accent */
  --bone: #f9f5f2;       /* card surface, pill button fill */
  --ink: #1a1a1a;        /* body text on light, text on the stage */
  --black: #000000;      /* hard borders, text on yellow */
  --footer-green: #375027;

  /* Type */
  --font-display: 'Anton', 'Arial Narrow', ui-sans-serif, system-ui, sans-serif;
  --font-ui: 'Inter', ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --text-caption: 0.75rem;   /* 12px mono */
  --text-body: 1rem;         /* 16px */
  --text-body-lg: 1.125rem;  /* 18px */
  --text-sub: 1.875rem;      /* 30px */
  --text-poster-sm: clamp(2rem, 1.2rem + 3vw, 3.5rem);
  --text-poster: clamp(3rem, 1.6rem + 6.5vw, 7rem);
  --text-poster-lg: clamp(3.4rem, 1.6rem + 9vw, 10rem);

  /* Shape — sharp blocks vs soft pills */
  --r-card: 6px;
  --r-pill: 100px;

  /* Layout */
  --page-w: 1240px;
  --measure: 740px;

  /* Motion — network law */
  --dur-1: 130ms;
  --dur-2: 220ms;
  --ease: cubic-bezier(0.2, 0.6, 0.2, 1);
}

/* ── Base ─────────────────────────────────────────────── */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-ui);
  font-size: var(--text-body);
  line-height: 1.55;
  color: var(--ink);
  background: var(--violet);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  line-height: 1.02; /* Anton Ä/Ö diacritics clip at the reference's 0.9 */
  color: var(--ink);
  margin: 0 0 .45em;
}
h1 { font-size: var(--text-poster); }
h2 { font-size: var(--text-poster-sm); }
h3 { font-size: 1.375rem; }
p { margin: 0 0 1em; }
a { color: var(--ink); text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 3px; text-decoration-color: var(--hivis); transition: text-decoration-color var(--dur-1) var(--ease); }
a:hover { text-decoration-color: var(--ink); }
:focus-visible { outline: 3px solid var(--black); outline-offset: 2px; }
img { max-width: 100%; height: auto; }

.wrap { max-width: var(--page-w); margin-inline: auto; padding-inline: 24px; }

/* Shared-view compatibility (network law): src/views (author page,
   legal/_page.php) and partials wrap content in
   .section > .container(.container-narrow). These MUST exist as centered
   max-width columns or those pages render unstyled. On this site the shared
   pages read as a bone paper sheet dropped on the violet stage. */
.section { padding: 64px 0; }
.container { max-width: var(--page-w); margin-inline: auto; padding-inline: 24px; }
.container-narrow { max-width: calc(var(--measure) + 48px); }
/* The paper sheet: shared legal/author/about content gets a bone card */
.section .container-narrow > .prose,
.section .container-narrow.author-profile {
  background: var(--bone);
  border-radius: var(--r-card);
  padding: clamp(24px, 5vw, 56px);
}
.section .container-narrow.author-profile .prose { background: none; padding: 0; }

.skip-link { position: absolute; left: -9999px; top: 0; background: var(--bone); color: var(--ink); padding: 10px 16px; z-index: 200; border-radius: 0 0 var(--r-card) 0; }
.skip-link:focus { left: 0; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.hp-field { position: absolute !important; left: -9999px; width: 1px; height: 1px; opacity: 0; }

/* Mono label tag: the stamped receipt voice */
.tag {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: var(--text-caption);
  font-weight: 600;
  letter-spacing: .05em;
  text-transform: uppercase;
  line-height: 1.3;
  color: var(--ink);
  border: 1px solid currentColor;
  border-radius: var(--r-pill);
  padding: 4px 12px;
}
.tag--plain { border: 0; padding: 0; border-radius: 0; }

/* ── Buttons: cream gate pill + yellow outlined action ── */
.btn {
  display: inline-flex; align-items: center; gap: .5rem;
  font: 700 var(--text-body)/1 var(--font-ui);
  letter-spacing: .05em;
  text-transform: uppercase;
  padding: 15px 26px;
  border-radius: var(--r-pill);
  border: 2px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: background var(--dur-1) var(--ease), color var(--dur-1) var(--ease), border-color var(--dur-1) var(--ease), transform var(--dur-1) var(--ease);
}
.btn--gate { background: var(--bone); color: var(--black); }
.btn--gate:hover { background: var(--hivis); }
.btn--outline { background: transparent; color: var(--ink); border-color: var(--hivis); }
.btn--outline:hover { background: var(--hivis); color: var(--black); border-color: var(--hivis); }

/* ── Masthead on the stage ────────────────────────────── */
.masthead { background: var(--violet); position: sticky; top: 0; z-index: 100; border-bottom: 2px solid transparent; transition: border-color var(--dur-2) var(--ease); }
.masthead.is-stuck { border-bottom-color: var(--lilac); }
.masthead-in { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding-block: 14px; }
.brand { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; color: var(--ink); }
.brand svg { display: block; }
.brand-w { font-family: var(--font-display); font-size: 1.5rem; letter-spacing: .04em; text-transform: uppercase; line-height: 1; }
.navlinks { display: flex; align-items: center; gap: 14px; }
.navlink-tag { font-family: var(--font-mono); font-size: var(--text-caption); font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: var(--ink); text-decoration: none; border: 1px solid var(--ink); border-radius: var(--r-pill); padding: 8px 16px; transition: background var(--dur-1) var(--ease), color var(--dur-1) var(--ease); }
.navlink-tag:hover, .navlink-tag.is-here { background: var(--ink); color: var(--bone); }
.burger { display: none; }
.drawer { display: none; }

/* ── Poster hero ──────────────────────────────────────── */
.hero { padding: 72px 0 64px; overflow: hidden; }
.hero-poster { position: relative; }
/* Anton's Swedish diacritics (Ä/Ö) overshoot the em box — the reference's
   0.80–0.88 leading clips them into the line above, so the poster runs at
   1.02 here. */
.hero h1 {
  font-size: var(--text-poster-lg);
  line-height: 1.02;
  margin: 0 0 30px;
  max-width: 11ch;
}
.hero h1 .alt { color: var(--bone); }
.hero-mascot { position: absolute; right: 0; bottom: -8px; width: clamp(180px, 28vw, 360px); pointer-events: none; }
.hero-mascot svg { display: block; width: 100%; height: auto; }
.hero-sub { font-size: var(--text-body-lg); line-height: 1.5; color: var(--ink); max-width: 46ch; margin: 0 0 28px; }
.hero-cta { display: flex; gap: 14px; flex-wrap: wrap; align-items: center; }
.hero-note { font-family: var(--font-mono); font-size: var(--text-caption); letter-spacing: .05em; color: var(--ink); margin: 22px 0 0; }

/* ── Section heads on the stage ───────────────────────── */
.section-head { margin-bottom: 34px; }
.section-head h2 { color: var(--bone); font-size: var(--text-poster-sm); margin: 0; }
.section-head .tag { margin-bottom: 14px; }
.section-head p { color: var(--ink); margin: 12px 0 0; max-width: 60ch; }

/* ── Confetti shelf: paint-swatch value cards ─────────── */
.shelf { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; align-items: start; }
.shelf-item { border-radius: var(--r-card); padding: 26px 24px; background: var(--bone); color: var(--ink); }
.shelf-item--accent { background: var(--matcha); margin-top: 28px; }
.shelf-item .tag { margin-bottom: 16px; }
.shelf-item h3 { margin: 0 0 10px; }
.shelf-item p { font-size: 0.9375rem; line-height: 1.6; margin: 0; }

/* ── Card grid: article listings as printed swatches ──── */
.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.card {
  display: flex; flex-direction: column;
  background: var(--bone);
  border-radius: var(--r-card);
  overflow: hidden;
  text-decoration: none;
  color: var(--ink);
  transition: transform var(--dur-2) var(--ease);
}
.card:hover { transform: translateY(-4px); }
.card-img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; display: block; }
.card-tx { padding: 18px 20px 22px; display: flex; flex-direction: column; flex: 1; }
.card-date { font-family: var(--font-mono); font-size: var(--text-caption); font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: var(--ink); margin: 0 0 10px; }
.card-t { font-family: var(--font-display); font-size: 1.5rem; letter-spacing: .02em; text-transform: uppercase; line-height: 1.02; margin: 0 0 10px; }
.card-d { font-size: 0.9375rem; line-height: 1.55; margin: 0 0 16px; }
.card-go { margin-top: auto; font-family: var(--font-mono); font-size: var(--text-caption); font-weight: 600; letter-spacing: .05em; text-transform: uppercase; text-decoration: underline; text-decoration-thickness: 2px; text-decoration-color: var(--magenta); text-underline-offset: 3px; }
.card:hover .card-go { text-decoration-color: var(--ink); }
.cards-more { margin-top: 30px; }

/* ── Magenta statement card ───────────────────────────── */
.shout { padding: 24px 0 64px; }
/* Magenta darkened ~10% (#ac4f98 → #9b4789) so 18px bone body copy clears
   WCAG-AA 4.5:1 — the raw token lands at 4.48:1. */
.shout-card { background: #9b4789; border-radius: var(--r-card); padding: clamp(28px, 6vw, 64px); }
.shout-card h2 { color: var(--bone); font-size: var(--text-poster); line-height: 1.0; max-width: 16ch; margin: 0 0 20px; }
.shout-card p { color: var(--bone); font-size: var(--text-body-lg); line-height: 1.5; max-width: 54ch; margin: 0 0 26px; }
.shout-card .btn--gate { background: var(--bone); }

/* ── Newsletter: lilac block ──────────────────────────── */
.nl { padding: 24px 0 72px; }
.nl-in { background: var(--lilac); border-radius: var(--r-card); padding: clamp(28px, 6vw, 56px); color: var(--bone); }
.nl-in .tag { color: var(--bone); }
.nl-in h2 { color: var(--bone); margin: 14px 0 12px; }
.nl-sub { color: var(--bone); max-width: 54ch; margin: 0 0 24px; }
.nl-form { display: flex; gap: 12px; flex-wrap: wrap; max-width: 560px; }
.nl-form .field {
  flex: 1 1 240px; min-width: 0;
  font: 400 var(--text-body)/1.4 var(--font-ui);
  color: var(--ink);
  padding: 14px 20px;
  border: 2px solid var(--bone);
  border-radius: var(--r-pill);
  background: var(--bone);
}
.nl-form .field::placeholder { color: #5a5850; }
.nl-form .field[aria-invalid="true"] { border-color: var(--firecracker); }
.nl-form .btn--gate:hover { border-color: var(--hivis); }
.nl-consent { flex-basis: 100%; display: flex; gap: 8px; align-items: flex-start; font-size: 0.875rem; color: var(--bone); }
.nl-consent a { color: var(--bone); }
.nl-consent input { margin-top: 3px; accent-color: var(--ink); }
.nl-consent input[aria-invalid="true"] { outline: 3px solid var(--firecracker); outline-offset: 1px; }
.newsletter-ok { font-weight: 700; color: var(--bone); }

/* ── Footer: the dark green block ─────────────────────── */
.foot { background: var(--footer-green); color: var(--bone); padding: 56px 0 36px; font-family: var(--font-mono); font-size: var(--text-caption); letter-spacing: .03em; }
.foot a { color: var(--bone); text-decoration-color: var(--butter); }
.foot a:hover { text-decoration-color: var(--bone); }
.foot-top { display: flex; gap: 48px; flex-wrap: wrap; justify-content: space-between; }
.foot-note { max-width: 380px; line-height: 1.7; font-family: var(--font-ui); font-size: 0.875rem; }
.foot-note b { display: block; font-family: var(--font-display); font-weight: 400; font-size: 1.25rem; letter-spacing: .04em; text-transform: uppercase; margin-bottom: 10px; }
.foot-cols { display: flex; gap: 56px; flex-wrap: wrap; }
.foot-col { display: grid; gap: 10px; align-content: start; }
.foot-col h2 { font-family: var(--font-mono); font-weight: 600; font-size: var(--text-caption); letter-spacing: .08em; text-transform: uppercase; color: var(--butter); margin: 0 0 4px; }
.foot-col a { text-decoration: none; }
.foot-col a:hover { text-decoration: underline; text-underline-offset: 3px; }
.foot-base { margin-top: 44px; padding-top: 18px; border-top: 1px solid rgba(249,245,242,.25); }

/* ── Cookie banner: bone card, pill actions ───────────── */
.cookie {
  position: fixed; inset-inline: 16px; bottom: 16px;
  max-width: 520px; margin-inline: auto;
  background: var(--bone); border-radius: var(--r-card);
  border: 2px solid var(--black);
  padding: 18px 20px;
  display: none;
  z-index: 150;
  font-size: 0.875rem;
  color: var(--ink);
}
.cookie.is-visible { display: block; }
.cookie p { margin: 0 0 12px; }
.cookie a { text-decoration-color: var(--magenta); }
.cookie-actions { display: flex; gap: 10px; }
.cookie-actions .btn { flex: 1 1 0; justify-content: center; padding: 12px 18px; font-size: 0.875rem; }
.cookie-actions .btn--gate { background: var(--ink); color: var(--bone); }
.cookie-actions .btn--gate:hover { background: var(--black); }
.cookie-actions .btn--outline { border-color: var(--ink); }
.cookie-actions .btn--outline:hover { background: var(--ink); color: var(--bone); }

/* ── Breadcrumb (mono receipt line) ───────────────────── */
.breadcrumb-list {
  list-style: none; display: flex; flex-wrap: wrap; gap: 8px;
  padding: 0; margin: 0 0 24px;
  font-family: var(--font-mono); font-size: var(--text-caption); letter-spacing: .03em; color: var(--ink);
}
.breadcrumb-list a { color: inherit; text-decoration: none; }
.breadcrumb-list a:hover { text-decoration: underline; text-underline-offset: 3px; }
.breadcrumb-list li + li::before { content: '>'; margin-right: 8px; }

/* ── Page headers (inner pages, on the stage) ─────────── */
.pagehead { padding: 56px 0 8px; }
.pagehead h1 { color: var(--bone); font-size: var(--text-poster); margin-bottom: 0; }
.pagehead .lede { color: var(--ink); font-size: var(--text-body-lg); line-height: 1.5; max-width: 54ch; margin: 16px 0 0; }
.page-list { padding: 40px 0 88px; }
.page-list > .container-narrow > .prose { background: var(--bone); border-radius: var(--r-card); padding: clamp(24px, 5vw, 56px); }

/* ── Article: a bone paper sheet on the stage ─────────── */
.art { padding: 48px 0 88px; }
.art-shell {
  display: grid;
  grid-template-columns: 250px minmax(0, calc(var(--measure) + 112px)) 250px;
  column-gap: 40px;
  justify-content: center;
}
.art-top { grid-column: 2; grid-row: 1; min-width: 0; }
.art-body { grid-column: 2; grid-row: 2; min-width: 0; }
.art-shell .toc { grid-column: 1; grid-row: 2; }
.art-head h1 { color: var(--bone); font-size: clamp(2.4rem, 1.4rem + 3.6vw, 4.4rem); margin: 0 0 6px; }
.standfirst { font-size: var(--text-body-lg); line-height: 1.5; color: var(--ink); margin: 14px 0 0; max-width: 58ch; }
.byline { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 14px 0; margin-top: 22px; border-top: 2px solid var(--lilac); border-bottom: 2px solid var(--lilac); }
.byline img { width: 40px; height: 40px; border-radius: var(--r-pill); }
.byline-who { display: grid; line-height: 1.35; }
.byline-who a { font-weight: 700; color: var(--ink); text-decoration: none; font-size: 0.875rem; }
.byline-who a:hover { text-decoration: underline; text-underline-offset: 3px; }
.byline-role { font-size: 0.8125rem; color: var(--ink); }
.byline-meta { margin-left: auto; font-family: var(--font-mono); font-size: var(--text-caption); letter-spacing: .03em; color: var(--ink); text-align: right; line-height: 1.6; }
.art-cover { margin: 28px 0 0; }
.art-cover img { width: 100%; height: auto; border-radius: var(--r-card); display: block; }

/* TOC: lilac index block, LEFT rail (owner law) */
.toc { position: sticky; top: 90px; align-self: start; background: var(--lilac); color: var(--bone); border-radius: var(--r-card); padding: 18px 18px 10px; font-size: 0.875rem; margin-top: 28px; }
.toc h2 { font-family: var(--font-mono); font-weight: 600; font-size: var(--text-caption); letter-spacing: .08em; text-transform: uppercase; color: var(--butter); margin: 0 0 12px; }
.toc-list { list-style: none; margin: 0; padding: 0; }
.toc-list li { border-top: 1px solid rgba(249,245,242,.2); }
.toc-list a {
  display: block; color: var(--bone); text-decoration: none;
  padding: 8px 2px;
}
.toc-list a:hover { text-decoration: underline; text-underline-offset: 3px; }

/* Prose: ink on the bone sheet */
.art-body .prose { background: var(--bone); border-radius: var(--r-card); padding: clamp(24px, 5vw, 56px); margin-top: 28px; }
.prose { max-width: none; font-size: 1.0625rem; line-height: 1.7; color: var(--ink); }
.prose h1 { font-size: clamp(2rem, 1.2rem + 3vw, 3.25rem); overflow-wrap: anywhere; }
.prose h2 { font-size: 1.75rem; margin: 1.9em 0 .6em; }
.prose h3 { font-size: 1.25rem; margin: 1.6em 0 .5em; }
.prose p { margin: 0 0 1.2em; }
.prose a { overflow-wrap: anywhere; text-decoration-color: var(--magenta); }
.prose a:hover { text-decoration-color: var(--ink); }
.prose ul, .prose ol { padding-left: 1.3em; margin: 0 0 1.2em; }
.prose li { margin-bottom: .4em; }
.prose li::marker { color: var(--magenta); }
.prose blockquote {
  margin: 1.6em 0; padding: 16px 22px;
  background: #efe9e4; border-left: 4px solid var(--magenta);
  border-radius: var(--r-card);
  font-size: 1rem;
}
.prose blockquote p:last-child { margin-bottom: 0; }
.prose img { border-radius: var(--r-card); }
.prose code { font-family: var(--font-mono); font-size: .88em; background: #efe9e4; border-radius: 4px; padding: 2px 6px; }
.prose pre { background: var(--ink); color: var(--bone); border-radius: var(--r-card); padding: 18px 20px; overflow-x: auto; font-size: .85rem; }
.prose pre code { background: none; padding: 0; color: inherit; }
.prose hr { border: 0; border-top: 2px solid #e3dcd5; margin: 2.5em 0; }
.prose .table-scroll { overflow-x: auto; margin: 0 0 1.2em; border: 1px solid #e3dcd5; border-radius: var(--r-card); }
.prose table { border-collapse: collapse; width: 100%; font-size: 0.875rem; }
.prose th { font-family: var(--font-mono); font-weight: 600; font-size: var(--text-caption); letter-spacing: .05em; text-transform: uppercase; text-align: left; background: #efe9e4; }
.prose th, .prose td { padding: 10px 14px; border-bottom: 1px solid #e3dcd5; vertical-align: top; }
.prose tr:last-child td { border-bottom: 0; }
.legal-updated { font-family: var(--font-mono); font-size: var(--text-caption); letter-spacing: .03em; }

/* Related: butter block under the sheet */
.related { margin-top: 28px; background: var(--butter); border-radius: var(--r-card); padding: clamp(22px, 4vw, 40px); color: var(--ink); }
.related h2 { font-size: 1.75rem; margin: 0 0 16px; }
.related-list { list-style: none; margin: 0; padding: 0; }
.related-list li { border-top: 1px solid rgba(26,26,26,.25); }
.related-list li:last-child { border-bottom: 1px solid rgba(26,26,26,.25); }
.related-list a {
  display: block; padding: 12px 2px; text-decoration: none;
  color: var(--ink); font-weight: 700;
}
.related-list a:hover { text-decoration: underline; text-underline-offset: 3px; }
.related-list .meta { display: block; font-family: var(--font-mono); font-weight: 400; font-size: var(--text-caption); letter-spacing: .03em; margin-top: 3px; }

/* ── About: author callout repin (partial themes off themeColor = lilac) ── */
.about-author { background: var(--bone); border-radius: var(--r-card) !important; border-color: transparent !important; box-shadow: none !important; }
.about-author:hover { border-color: var(--ink) !important; box-shadow: none !important; }

/* ── 404: poster ──────────────────────────────────────── */
.err { padding: 96px 0 120px; }
.err-code { font-family: var(--font-display); font-size: var(--text-poster-lg); line-height: 1; color: var(--bone); margin: 0 0 8px; }
.err h1 { font-size: var(--text-poster-sm); color: var(--ink); }
.err p { color: var(--ink); max-width: 44ch; margin: 12px 0 28px; }
.err .hero-cta { justify-content: flex-start; }

/* ── Reveal on scroll (JS adds .is-in; no-JS stays visible) ─ */
.reveal { opacity: 1; transform: none; }
.js .reveal { opacity: 0; transform: translateY(14px); transition: opacity var(--dur-2) var(--ease), transform var(--dur-2) var(--ease); }
.js .reveal.is-in { opacity: 1; transform: none; }

/* ── Responsive ───────────────────────────────────────── */
@media (max-width: 1340px) {
  .art-shell { grid-template-columns: minmax(0, calc(var(--measure) + 112px)); }
  .art-top, .art-body, .art-shell .toc { grid-column: 1; grid-row: auto; }
  .toc { position: static; }
}
@media (max-width: 1024px) {
  .cards, .shelf { grid-template-columns: repeat(2, 1fr); }
  .shelf-item--accent { margin-top: 0; }
  .hero-mascot { position: static; width: clamp(160px, 40vw, 260px); margin-top: 24px; }
}
@media (max-width: 900px) {
  .navlinks { display: none; }
  .burger {
    display: inline-flex; width: 44px; height: 44px; align-items: center; justify-content: center;
    background: var(--bone); border: 2px solid var(--black); border-radius: var(--r-pill); cursor: pointer; color: var(--ink);
  }
  .burger i { display: block; width: 18px; height: 2px; background: currentColor; box-shadow: 0 -6px 0 currentColor, 0 6px 0 currentColor; }
  .drawer { display: none; border-top: 2px solid var(--lilac); background: var(--violet); }
  .drawer.is-open { display: block; }
  .drawer-in { display: grid; gap: 8px; padding-block: 16px; }
  .drawer-in a { text-decoration: none; color: var(--ink); font-weight: 700; padding: 12px 8px; border-radius: var(--r-card); }
  .drawer-in a:hover { background: var(--lilac); color: var(--bone); }
  .drawer-in .btn { justify-content: center; margin-top: 8px; }
}
@media (max-width: 640px) {
  .cards, .shelf { grid-template-columns: 1fr; }
  .byline-meta { margin-left: 0; text-align: left; flex-basis: 100%; }
  .foot-cols { gap: 36px; }
  .hero h1 { max-width: none; }
}

/* ── Reduced motion — network law ─────────────────────── */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
  .js .reveal { opacity: 1; transform: none; }
  .card:hover { transform: none; }
}
