/*
  Tenon No. 14, "Repair": magazine issue page (Screenery template)
  A contemporary print culture quarterly: black, paper white, and one saturated colour per story (--c on each section).
  Anton is the display voice and is allowed to be the composition; Spectral sets every line meant to be read.

  Contents
   1. Tokens
   2. Base and browser surfaces
   3. Shared pieces: headings, buttons, icons, drawn-art classes
   4. Masthead bar
   5. Cover spread
   6. Contents list and preview
   7. Long read: progress, head, body, drop cap, footnotes, pull quote, figure, table
   8. Kinetic interlude
   9. In this issue
  10. Subscribe form, summary, states
  11. Back issues shelf
  12. Stockists
  13. Footer
  14. Motion-only states (html.kinetic, set by script.js)
  15. Narrow screens
*/

/* ---------- 1. Tokens ---------- */
:root {
  /* Ground */
  --ink: #0d0d0c;
  --paper: #f5f4f0;
  --paper-2: #e6e4dd;     /* second paper: stockists, plates */
  --rule: #0d0d0c;
  --ink-2: #4f4b44;       /* secondary text on paper, 7.6:1 */
  --paper-dim: #b8b2a6;   /* secondary text on ink, 9:1 */
  --ink-lift: #1d1c1a;    /* raised areas on ink */

  /* One saturated colour per story. Text on each: --ink except cobalt, which takes --paper. */
  --vermilion: #ff4a1c;   /* 1. The Mender's Ledger, and the issue itself */
  --cobalt: #2b3cff;      /* 2. Eleven Glues */
  --acid: #e4ff3a;        /* 3. The Last Loom Tuner */
  --pink: #ff5fa8;        /* 4. Spare Parts */
  --green: #19c26b;       /* 5. Darn It */
  --c: var(--vermilion);  /* the current story colour; sections override */
  --on: var(--ink);       /* text on --c */

  /* Type */
  --display: "Anton", "Oswald", "Arial Narrow", sans-serif;
  --text: "Spectral", Georgia, "Times New Roman", serif;

  --fs-xs: 0.8125rem;   /* 13 */
  --fs-sm: 0.9375rem;   /* 15 */
  --fs-md: 1.1875rem;   /* 19, body */
  --fs-lg: 1.4375rem;   /* 23 */
  --fs-xl: clamp(1.6rem, 1.1rem + 1.6vw, 2.4rem);
  --fs-h2: clamp(3.6rem, 1.4rem + 9vw, 9.5rem);      /* section heads: the type is the composition */
  --fs-title: clamp(2rem, 0.9rem + 4.2vw, 4.6rem);    /* contents rows, spread titles */

  /* Space */
  --s-1: 4px;
  --s-2: 8px;
  --s-3: 12px;
  --s-4: 16px;
  --s-5: 24px;
  --s-6: 32px;
  --s-7: 48px;
  --s-8: 80px;
  --s-9: 128px;
  --gutter: clamp(16px, 3.2vw, 48px);
  --wrap: 1440px;
  --measure: 66ch;
  --bar-h: 56px;

  /* Shape: print is cut square */
  --r: 0px;
  --r-btn: 999px;
  --line: 2px;

  /* Depth: paper lifted off paper */
  --lift: 0 2px 2px rgb(13 13 12 / 0.12), 0 18px 40px -16px rgb(13 13 12 / 0.45);

  /* Motion */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-expo: cubic-bezier(0.19, 1, 0.22, 1);
  --t-fast: 160ms;
  --t-mid: 380ms;
  --t-slow: 720ms;
}

/* ---------- 2. Base and browser surfaces ---------- */
*, *::before, *::after { box-sizing: border-box; }
html {
  -webkit-text-size-adjust: 100%;
  scroll-padding-top: calc(var(--bar-h) + 16px);
  scrollbar-color: var(--ink) var(--paper-2);
  accent-color: var(--vermilion);
  overflow-x: clip;
}
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 var(--fs-md)/1.6 var(--text);
  font-kerning: normal;
  font-variant-ligatures: common-ligatures;
  overflow-x: clip;
  caret-color: var(--vermilion);
}
::selection { background: var(--c); color: var(--on); }
::-webkit-scrollbar { width: 12px; height: 12px; }
::-webkit-scrollbar-track { background: var(--paper-2); }
::-webkit-scrollbar-thumb { background: var(--ink); border: 3px solid var(--paper-2); }
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 0.22em; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--c); outline-offset: 3px; }
.read :focus-visible, .contents :focus-visible, .issues :focus-visible, .stock :focus-visible { outline-color: var(--ink); }
.subscribe :focus-visible, .inter :focus-visible, .foot :focus-visible, .bar :focus-visible, .cover :focus-visible { outline-color: var(--vermilion); }
h1, h2, h3, p, ul, ol, dl, dd, figure, blockquote { margin: 0; }
ul[role="list"], ol[role="list"] { list-style: none; padding: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }
[tabindex="-1"]:focus { outline: none; }
.defs { position: absolute; width: 0; height: 0; overflow: hidden; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip { position: fixed; left: 16px; top: -60px; z-index: 50; padding: 10px 16px; background: var(--vermilion); color: var(--ink); font-weight: 700; text-decoration: none; }
.skip:focus { top: 12px; }
.num, td, .sum, .plan__price, .toc__pg { font-variant-numeric: tabular-nums lining-nums; }

/* ---------- 3. Shared pieces ---------- */
.h2 {
  font: 400 var(--fs-h2)/0.84 var(--display);
  text-transform: uppercase;
  letter-spacing: -0.01em;
  text-wrap: balance;
}
.h2--paper { color: var(--paper); }

.ico { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 44px; padding: 0 20px;
  border: var(--line) solid var(--ink); border-radius: var(--r-btn);
  background: transparent; color: var(--ink);
  font: 400 1rem/1 var(--display); text-transform: uppercase; letter-spacing: 0.04em; text-decoration: none;
  transition: background var(--t-fast), color var(--t-fast), transform var(--t-fast) var(--ease-out);
}
.btn:hover { text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn--ink { background: var(--ink); color: var(--paper); }
.btn--ink:hover { background: var(--vermilion); color: var(--ink); border-color: var(--vermilion); }
.btn--c { background: var(--vermilion); color: var(--ink); border-color: var(--vermilion); }
.btn--c:hover { background: var(--paper); border-color: var(--paper); }
.btn--ghost:hover { background: var(--ink); color: var(--paper); }
.btn--paper { color: var(--paper); border-color: var(--paper); }
.btn--paper:hover { background: var(--paper); color: var(--ink); }
.btn--lg { min-height: 60px; padding: 0 30px; font-size: 1.25rem; }
.btn[disabled], .btn[aria-disabled="true"] { opacity: 0.55; cursor: not-allowed; }

/* Drawn art: symbol shapes take their colours from the <use> element's custom properties */
.c { fill: var(--c); }
.i { fill: var(--art-i, var(--ink)); }
.i2 { fill: var(--art-i2, #2a2926); }
.p { fill: var(--art-p, var(--paper)); }
.ln { fill: none; stroke: var(--c); stroke-width: 1.5; opacity: 0.55; }
.ln2 { fill: none; stroke: var(--art-i, var(--ink)); stroke-width: 6; stroke-linecap: round; }
.tick { fill: none; stroke: var(--ink); stroke-width: 3; stroke-linecap: round; }
.cs { fill: none; stroke: var(--ink); stroke-width: 3; }
.ring { fill: none; stroke: var(--c); stroke-width: 3; opacity: 0.6; }
.drip { fill: none; stroke: var(--paper); stroke-width: 5; stroke-linecap: round; }
.warp { fill: none; stroke: var(--ink); stroke-width: 3; }
.weft { fill: none; stroke: var(--ink); stroke-width: 7; stroke-linecap: square; }
.dash { fill: none; stroke: var(--ink); stroke-width: 3; stroke-dasharray: 6 7; }
.woof { fill: none; stroke: var(--c); stroke-width: 5; }
.crack { fill: none; stroke: var(--art-crack, var(--ink)); stroke-width: 4; stroke-linejoin: round; stroke-linecap: round; }
.staple { fill: none; stroke: var(--vermilion); stroke-width: 7; stroke-linecap: square; }

/* ---------- 4. Masthead bar ---------- */
.bar {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; gap: var(--s-5);
  height: var(--bar-h); padding: 0 var(--gutter);
  background: var(--ink); color: var(--paper);
}
.bar__mark { font: 400 1.75rem/1 var(--display); text-transform: uppercase; letter-spacing: 0.06em; text-decoration: none; }
.bar__issue { font: 400 var(--fs-sm)/1 var(--text); color: var(--paper-dim); white-space: nowrap; }
.bar__issue span:first-child { color: var(--vermilion); font-style: italic; }
.bar__nav { display: flex; gap: var(--s-5); margin-left: auto; }
.bar__nav a { font: 400 0.95rem/1 var(--display); text-transform: uppercase; letter-spacing: 0.06em; text-decoration: none; padding: 12px 0; color: var(--paper); }
.bar__nav a:hover { color: var(--vermilion); }
.bar__cta { border-color: var(--paper); background: var(--paper); color: var(--ink); min-height: 38px; padding: 0 16px; font-size: 0.95rem; }
.bar__cta:hover { background: var(--vermilion); border-color: var(--vermilion); }

/* ---------- 5. Cover spread ---------- */
.cover {
  --art-i: var(--paper);
  --art-i2: #d9d2c2;
  --art-crack: var(--ink);
  position: relative;
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  grid-template-rows: auto 1fr auto;
  column-gap: var(--s-5);
  min-height: calc(100svh - var(--bar-h));
  padding: var(--s-5) var(--gutter) var(--s-6);
  background: var(--ink); color: var(--paper);
  overflow: clip;
}
.cover__mast {
  grid-column: 1 / -1; grid-row: 1;
  display: flex; align-items: flex-end; justify-content: space-between; gap: var(--s-5);
  border-bottom: var(--line) solid var(--paper);
  padding-bottom: var(--s-3);
}
.cover__name { font: 400 clamp(3.4rem, 1rem + 8vw, 8.6rem)/0.8 var(--display); text-transform: uppercase; letter-spacing: 0.02em; }
.cover__dek { font: italic 400 var(--fs-sm)/1.35 var(--text); color: var(--paper-dim); text-align: right; }

.cover__title {
  grid-column: 1 / -1; grid-row: 2;
  align-self: center;
  position: relative; z-index: 2;
  margin: var(--s-3) 0 0;
  font: 400 min(30.5vw, 60svh)/0.8 var(--display);
  text-transform: uppercase;
  letter-spacing: -0.012em;
  color: var(--vermilion);
  white-space: nowrap;
}
.cover__word { display: inline-block; transform-origin: 50% 100%; }

.cover__art {
  grid-column: 6 / -1; grid-row: 2 / 4;
  align-self: end; justify-self: end;
  width: min(50vw, 680px);
  margin-bottom: calc(-1 * var(--s-6));
  position: relative; z-index: 3;
  pointer-events: none;
}
.cover__art svg { width: 100%; height: auto; filter: drop-shadow(0 24px 30px rgb(0 0 0 / 0.5)); }

.cover__no {
  position: absolute; z-index: 4;
  right: var(--gutter); top: calc(var(--s-5) + clamp(4rem, 1.4rem + 8vw, 9rem));
  width: clamp(150px, 15vw, 230px); aspect-ratio: 1;
  display: grid; place-items: center;
}
.seal { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.seal text { font: 400 21px/1 var(--display); letter-spacing: 0.18em; text-transform: uppercase; fill: var(--paper); }
.seal__spin { transform-origin: 150px 150px; }
.cover__num {
  position: relative;
  font: 400 clamp(3.6rem, 1rem + 6vw, 6rem)/0.8 var(--display);
  color: var(--ink);
  background: var(--paper);
  border-radius: 50%;
  width: 66%; aspect-ratio: 1;
  display: grid; place-content: center; text-align: center;
}
.cover__num small { display: block; font: italic 500 0.95rem/1 var(--text); margin-bottom: 0.25em; }

.cover__lines {
  grid-column: 1 / 7; grid-row: 3;
  list-style: none; padding: 0;
  display: grid; gap: var(--s-2);
  position: relative; z-index: 4;
  max-width: 38rem;
}
.cover__lines a { display: block; font: italic 400 var(--fs-lg)/1.2 var(--text); color: var(--paper); text-decoration: none; padding: 2px 0; }
.cover__lines b { font: normal 400 1.05em/1 var(--display); text-transform: uppercase; letter-spacing: 0.02em; color: var(--vermilion); }
.cover__lines a:hover { text-decoration: underline; text-decoration-color: var(--vermilion); }

/* ---------- 6. Contents ---------- */
.contents { padding: var(--s-8) var(--gutter) var(--s-9); max-width: var(--wrap); margin: 0 auto; }
.contents__head { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: var(--s-5); align-items: end; margin-bottom: var(--s-7); }
.contents__head .h2 { grid-column: 1 / 9; }
.contents__note { grid-column: 9 / -1; color: var(--ink-2); font-style: italic; max-width: 30ch; }

.contents__body { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--s-5); }
.toc { grid-column: 1 / 8; list-style: none; padding: 0; margin: 0; border-top: var(--line) solid var(--ink); }
.toc__row { position: relative; border-bottom: var(--line) solid var(--ink); }
.toc__link {
  position: relative;
  display: grid;
  grid-template-columns: 4.2rem 1fr auto;
  grid-template-areas: "pg title by" "pg dek dek";
  column-gap: var(--s-4); row-gap: var(--s-2);
  padding: var(--s-5) var(--s-3);
  text-decoration: none;
  isolation: isolate;
}
/* The colour flood: wipes up from the rule on hover or focus */
.toc__link::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: var(--c);
  clip-path: inset(100% 0 0 0);
  transition: clip-path var(--t-mid) var(--ease-expo);
}
.toc__row.is-active .toc__link::before, .toc__link:hover::before, .toc__link:focus-visible::before { clip-path: inset(0 0 0 0); }
.toc__row.is-active .toc__link, .toc__link:hover, .toc__link:focus-visible { color: var(--on); }
.toc__link:focus-visible { outline-offset: -3px; }
.toc__pg { grid-area: pg; font: 400 1.05rem/1.6 var(--display); letter-spacing: 0.04em; padding-top: 0.3em; }
.toc__title { grid-area: title; font: 400 var(--fs-title)/0.9 var(--display); text-transform: uppercase; text-wrap: balance; transition: letter-spacing var(--t-mid) var(--ease-expo); }
.toc__by { grid-area: by; font: italic 500 var(--fs-sm)/1.6 var(--text); white-space: nowrap; padding-top: 0.3em; }
.toc__dek { grid-area: dek; max-width: 56ch; font-size: var(--fs-sm); line-height: 1.5; }
.toc__thumb { display: none; }
.toc__row.is-active .toc__title { letter-spacing: 0.012em; }

.preview { grid-column: 8 / -1; grid-row: 1 / 3; position: sticky; top: calc(var(--bar-h) + 24px); align-self: start; margin-left: var(--s-5); }
.preview__frame { position: relative; aspect-ratio: 4 / 5; background: var(--ink); box-shadow: var(--lift); overflow: hidden; }
.preview__art { position: absolute; inset: 0; width: 100%; height: 100%; clip-path: inset(0 0 100% 0); transition: clip-path var(--t-slow) var(--ease-expo); }
.preview__art.is-on { clip-path: inset(0 0 0 0); z-index: 1; }
.preview__cap { display: flex; gap: var(--s-3); align-items: baseline; margin-top: var(--s-3); font-style: italic; color: var(--ink-2); }
.preview__pg { font: normal 400 1rem/1 var(--display); color: var(--ink); letter-spacing: 0.04em; }

.regulars { grid-column: 1 / 8; list-style: none; padding: var(--s-5) 0 0; display: flex; flex-wrap: wrap; gap: var(--s-2) var(--s-6); font-size: var(--fs-sm); color: var(--ink-2); }
.regulars span { font: 400 0.95rem/1 var(--display); color: var(--ink); letter-spacing: 0.04em; margin-right: 6px; }

/* ---------- 7. Long read ---------- */
.read { position: relative; background: var(--paper); border-top: var(--line) solid var(--ink); padding-bottom: var(--s-9); }

.progress {
  position: sticky; top: var(--bar-h); z-index: 30;
  display: flex; align-items: center; gap: var(--s-4);
  height: 44px; padding: 0 var(--gutter);
  background: var(--paper); border-bottom: 1px solid var(--ink);
  font-size: var(--fs-xs);
}
.progress__t { font: 400 0.95rem/1 var(--display); text-transform: uppercase; letter-spacing: 0.05em; }
.progress__left { margin-left: auto; font-style: italic; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.progress__bar { position: absolute; left: 0; right: 0; bottom: -1px; height: 4px; }
.progress__fill { display: block; height: 100%; background: var(--c); transform-origin: 0 50%; transform: scaleX(var(--read, 0)); }

.read__head { max-width: var(--wrap); margin: 0 auto; padding: var(--s-8) var(--gutter) var(--s-7); display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--s-5); }
.read__title { grid-column: 1 / -1; font: 400 clamp(4rem, 0.8rem + 12.5vw, 13.5rem)/0.9 var(--display); text-transform: uppercase; letter-spacing: -0.012em; text-wrap: balance; }
.read__title .word { display: inline-block; transform-origin: 50% 100%; }
.read__stand { grid-column: 1 / 9; margin-top: var(--s-6); font: italic 400 var(--fs-xl)/1.25 var(--text); text-wrap: balance; }
.read__by { grid-column: 9 / -1; align-self: end; margin-top: var(--s-6); font-size: var(--fs-sm); color: var(--ink-2); }
.read__by b { color: var(--ink); font-weight: 700; }

.read__body {
  display: grid;
  grid-template-columns: [full-start] minmax(var(--gutter), 1fr) [wide-start] minmax(0, 8rem) [text-start] min(var(--measure), 100% - 2 * var(--gutter)) [text-end] minmax(0, 8rem) [wide-end] minmax(var(--gutter), 1fr) [full-end];
  row-gap: 1.15em;
}
.read__body > * { grid-column: text; }
.read__body p { hyphens: auto; text-wrap: pretty; }
.read__body i { font-style: italic; }

.dropcap::first-letter {
  float: left;
  font: 400 5.6em/0.8 var(--display);
  color: var(--ink);
  background: var(--c);
  margin: 0.08em 0.16em 0 0;
  padding: 0.08em 0.1em 0.02em;
}
.dropcap::first-line { font-variant: small-caps; letter-spacing: 0.04em; }

/* Footnote markers: a small printed tab with a padded hit area */
.fn {
  position: relative;
  display: inline-grid; place-items: center;
  min-width: 1.45em; height: 1.45em;
  margin: 0 0.12em 0 0.15em; padding: 0 0.3em;
  vertical-align: 0.4em;
  border: 0; border-radius: 0;
  background: var(--c); color: var(--ink);
  font: 400 0.68em/1 var(--display);
  transition: background var(--t-fast);
}
.fn::after { content: ""; position: absolute; inset: -10px -8px; }
.fn:hover, .fn[aria-expanded="true"] { background: var(--ink); color: var(--paper); }

.note {
  /* Default: anchored to the bottom of the screen; script.js moves it next to its marker on wide screens */
  position: fixed; inset: auto var(--gutter) var(--gutter) var(--gutter);
  margin: 0; max-width: 24rem;
  padding: var(--s-4) var(--s-7) var(--s-4) var(--s-4);
  border: var(--line) solid var(--ink); border-radius: 0;
  background: var(--paper); color: var(--ink);
  box-shadow: var(--lift);
  font-size: var(--fs-sm); line-height: 1.5;
}
.note b { font: 400 1rem/1 var(--display); background: var(--c); padding: 2px 6px; margin-right: 6px; }
.note__x { position: absolute; top: 6px; right: 6px; width: 44px; height: 44px; display: grid; place-items: center; border: 0; background: none; }
.note__x:hover { color: var(--c); background: var(--ink); }
.note:not(:popover-open) { display: none; }
@supports not selector(:popover-open) { .note { position: static; display: block; box-shadow: none; } .note__x { display: none; } }

.pull { grid-column: wide; margin: var(--s-6) 0; padding: var(--s-6) 0; border-top: 6px solid var(--ink); border-bottom: 2px solid var(--ink); }
.pull p { font: 400 clamp(2.2rem, 1rem + 4.2vw, 4.6rem)/0.95 var(--display); text-transform: uppercase; text-wrap: balance; }
.pull .word { display: inline-block; }
.pull footer { margin-top: var(--s-4); font-style: italic; font-size: var(--fs-sm); color: var(--ink-2); }

.read__fig { grid-column: wide; margin: var(--s-5) 0; }
.read__fig svg { width: 100%; height: auto; background: var(--paper-2); }
.fig-page { fill: #ece6d7; }
.fig-rule { fill: none; stroke: #9db0c9; stroke-width: 1; }
.fig-rule path:last-child { stroke: var(--c); }
.fig-hand { font: italic 400 19px/1 var(--text); fill: #24304a; }
.fig-under { fill: none; stroke: var(--c); stroke-width: 3; stroke-linecap: round; }
.read__fig figcaption { margin-top: var(--s-3); font-size: var(--fs-sm); font-style: italic; color: var(--ink-2); max-width: 60ch; }

.tally { margin: var(--s-4) 0; width: 100%; border-collapse: collapse; font-size: var(--fs-sm); }
.tally caption { text-align: left; font: 400 1.1rem/1 var(--display); text-transform: uppercase; letter-spacing: 0.04em; padding-bottom: var(--s-3); }
.tally th, .tally td { padding: 10px 8px; border-bottom: 1px solid var(--ink); text-align: right; }
.tally th:first-child { text-align: left; font-weight: 500; }
.tally thead th { font: italic 400 var(--fs-xs)/1 var(--text); color: var(--ink-2); border-bottom-width: 2px; }
.tally tfoot th, .tally tfoot td { font-weight: 700; border-bottom: 0; border-top: 2px solid var(--ink); }
.read__end { font-style: italic; padding-top: var(--s-4); border-top: 1px solid var(--ink); }
.read__end a { font-style: normal; font-weight: 700; text-decoration-color: var(--c); text-decoration-thickness: 3px; }

/* ---------- 8. Kinetic interlude ---------- */
.inter { position: relative; background: var(--ink); color: var(--paper); overflow: clip; }
.inter__pin { padding: var(--s-8) var(--gutter) var(--s-5); }
/* Default (no JS, reduced motion): the phrase simply sets, large, wrapped */
.inter__track {
  display: flex; flex-wrap: wrap; column-gap: 0.18em; row-gap: 0;
  font: 400 clamp(4.4rem, 1rem + 15vw, 16rem)/0.84 var(--display);
  text-transform: uppercase; letter-spacing: -0.01em;
}
.inter__w { display: inline-block; transform-origin: 50% 100%; }
.inter__w--c { color: var(--vermilion); }
.inter__w .char { display: inline-block; transform-origin: 50% 100%; }
.inter__curve { padding: 0 0 var(--s-8); }
.inter__curve svg { width: 100%; height: auto; overflow: visible; }
.inter__guide { fill: none; stroke: #3a3935; stroke-width: 1.5; stroke-dasharray: 2 8; }
.inter__path { font: italic 500 32px/1 var(--text); fill: var(--paper); }
.inter__src { font: normal 400 22px/1 var(--display); fill: var(--green); letter-spacing: 0.08em; text-transform: uppercase; }
.inter__plain { display: none; padding: 0 var(--gutter); font: italic 500 1.6rem/1.3 var(--text); text-wrap: balance; }
.inter__plain span { display: block; margin-top: var(--s-3); font: normal 400 1rem/1 var(--display); letter-spacing: 0.08em; text-transform: uppercase; color: var(--green); }

/* ---------- 9. In this issue ---------- */
.issue { max-width: var(--wrap); margin: 0 auto; padding: var(--s-9) var(--gutter); }
.issue .h2 { margin-bottom: var(--s-7); }
.spreads { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: var(--s-5); }
.spread { background: var(--c); color: var(--on); display: grid; gap: var(--s-5); padding: var(--s-5); align-content: start; }
.spread__art { width: 100%; height: auto; border: var(--line) solid var(--on); }
.spread__t { font: 400 var(--fs-title)/0.9 var(--display); text-transform: uppercase; text-wrap: balance; }
.spread__by { font: italic 500 var(--fs-sm)/1.4 var(--text); margin: var(--s-3) 0 var(--s-4); }
.spread p:last-child { font-size: var(--fs-sm); line-height: 1.55; max-width: 52ch; }
/* Four different spreads, set like an issue's flatplan, not a card row */
.spread--a { grid-column: 1 / 9; grid-template-columns: 5fr 6fr; align-items: end; }
.spread--a .spread__t { font-size: clamp(2.6rem, 1rem + 5vw, 6rem); }
.spread--b { grid-column: 9 / -1; }
.spread--b .spread__art { aspect-ratio: 4 / 3; object-fit: cover; }
.spread--c { grid-column: 1 / 6; grid-template-columns: 1fr; }
.spread--d { grid-column: 6 / -1; grid-template-columns: 1fr 1fr; align-items: stretch; }
.spread--d .spread__art { height: 100%; min-height: 320px; }
.spread--d .spread__txt { align-self: end; }
.spread--d .spread__t { font-size: clamp(3.6rem, 1rem + 6.4vw, 8.4rem); line-height: 0.86; }
.spread--c .spread__art { width: 62%; }

/* ---------- 10. Subscribe ---------- */
.subscribe {
  background: var(--ink); color: var(--paper);
  display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--s-5);
  padding: var(--s-9) var(--gutter);
}
.subscribe__intro { grid-column: 1 / 6; align-self: start; position: sticky; top: calc(var(--bar-h) + 32px); }
.subscribe .h2 { font-size: clamp(3.4rem, 1rem + 6.2vw, 8.2rem); }
.subscribe__intro > p { margin-top: var(--s-5); max-width: 40ch; color: var(--paper-dim); }
.perks { margin-top: var(--s-5); display: grid; gap: var(--s-3); }
.perks li { display: flex; gap: var(--s-3); align-items: center; }
.perks .ico { color: var(--vermilion); }

.sub, .done { grid-column: 6 / -1; }
.sub { background: var(--paper); color: var(--ink); padding: clamp(20px, 3vw, 44px); display: grid; gap: var(--s-5); align-content: start; }
.sub__set { border: 0; padding: 0; margin: 0; display: grid; gap: var(--s-4); min-width: 0; }
.sub__set legend { font: 400 1.35rem/1 var(--display); text-transform: uppercase; letter-spacing: 0.03em; padding: 0; margin-bottom: var(--s-4); }
.sub__row { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-4); }

.plans { display: grid; grid-template-columns: repeat(3, 1fr); border: var(--line) solid var(--ink); }
.plan { position: relative; display: grid; gap: 4px; padding: var(--s-4); cursor: pointer; transition: background var(--t-fast), color var(--t-fast); }
.plan + .plan { border-left: var(--line) solid var(--ink); }
.plan input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.plan__name { font: 400 1.6rem/1 var(--display); text-transform: uppercase; }
.plan__price { font: 700 1.25rem/1.2 var(--text); }
.plan__price small { font-weight: 400; font-style: italic; font-size: 0.7em; }
.plan__what { font-size: var(--fs-xs); line-height: 1.35; color: var(--ink-2); }
.plan:hover { background: var(--paper-2); }
.plan:has(input:checked) { background: var(--ink); color: var(--paper); }
.plan:has(input:checked) .plan__what { color: var(--paper-dim); }
.plan:has(input:checked) .plan__name { color: var(--vermilion); }
.plan:has(input:focus-visible) { outline: 3px solid var(--vermilion); outline-offset: -6px; }

.field { display: grid; gap: 6px; min-width: 0; }
.field label { font-weight: 500; font-size: var(--fs-sm); }
.opt { font-weight: 400; font-style: italic; color: var(--ink-2); }
.field input, .field select, .field textarea {
  width: 100%; min-height: 48px; padding: 10px 12px;
  border: var(--line) solid var(--ink); border-radius: 0;
  background: #fbf9f4; color: var(--ink);
  font-size: 1.0625rem;
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
}
.field textarea { resize: vertical; line-height: 1.45; }
.field select { appearance: none; padding-right: 40px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none' stroke='%230d0d0c' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 8l5 5 5-5'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; background-size: 20px; }
.field input::placeholder, .field textarea::placeholder { color: #6a655c; }
.field input:focus-visible, .field select:focus-visible, .field textarea:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--vermilion); }
.field.is-bad input, .field.is-bad textarea { border-color: #b3260b; background: #fff1ec; }
.err { min-height: 0; font-size: var(--fs-xs); color: #a3220a; font-weight: 500; }
.err:empty { display: none; }
.count { font-size: var(--fs-xs); color: var(--ink-2); font-style: italic; }

.check { display: inline-flex; align-items: center; gap: var(--s-3); min-height: 44px; cursor: pointer; justify-self: start; font-weight: 500; }
.check input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.check__box { width: 26px; height: 26px; border: var(--line) solid var(--ink); display: grid; place-items: center; background: #fbf9f4; }
.check__box .ico { opacity: 0; transform: scale(0.6); transition: opacity var(--t-fast), transform var(--t-mid) var(--ease-out); }
.check input:checked + .check__box { background: var(--ink); color: var(--vermilion); }
.check input:checked + .check__box .ico { opacity: 1; transform: none; }
.check input:focus-visible + .check__box { outline: 3px solid var(--vermilion); outline-offset: 2px; }
.gift { padding: var(--s-4); background: var(--paper-2); }

.sum { border-top: 6px solid var(--ink); padding-top: var(--s-4); }
.sum__t { font: 400 1.35rem/1 var(--display); text-transform: uppercase; margin-bottom: var(--s-3); }
.sum__lines { display: grid; }
.sum__lines div { display: flex; justify-content: space-between; gap: var(--s-4); padding: 8px 0; border-bottom: 1px solid #b7b0a2; font-size: var(--fs-sm); }
.sum__lines dd { font-weight: 500; }
.sum__lines .is-new { animation: flash 900ms var(--ease-out); }
.sum__total { display: flex; justify-content: space-between; align-items: baseline; padding-top: var(--s-3); font-size: var(--fs-sm); }
.sum__total b { font: 400 2.6rem/1 var(--display); }
.sum__fine { margin-top: var(--s-2); font-size: var(--fs-xs); font-style: italic; color: var(--ink-2); }
.sum__x { border: 0; background: none; padding: 0 0 0 8px; color: var(--ink-2); font-size: var(--fs-xs); text-decoration: underline; text-underline-offset: 3px; min-height: 32px; }
.sum__x:hover { color: var(--ink); }

.sub__go { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-4); }
.sub__status { font-style: italic; font-size: var(--fs-sm); color: var(--ink-2); }
.sub.is-loading .btn--c { pointer-events: none; }
.sub.is-loading .btn__l::after { content: ""; display: inline-block; width: 0.9em; height: 0.9em; margin-left: 10px; vertical-align: -0.1em; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin 700ms linear infinite; }
.sub.is-loading .btn--c .ico { display: none; }
.banner { display: flex; gap: var(--s-3); padding: var(--s-4); border: var(--line) solid #a3220a; background: #fff1ec; color: #5a1406; }
.banner .ico { color: #a3220a; margin-top: 3px; }
.banner p { font-size: var(--fs-sm); margin-bottom: var(--s-3); }

.done { align-self: center; display: grid; gap: var(--s-4); justify-items: start; padding: var(--s-6) 0; }
.done__big { font: 400 clamp(3.6rem, 1rem + 8vw, 9rem)/0.84 var(--display); text-transform: uppercase; color: var(--vermilion); text-wrap: balance; }
.done__ref { font: 400 1.4rem/1 var(--display); letter-spacing: 0.06em; text-transform: uppercase; }
.done__txt { max-width: 46ch; color: var(--paper-dim); }

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes flash { from { background: color-mix(in srgb, var(--vermilion) 35%, transparent); } to { background: transparent; } }

/* ---------- 11. Back issues ---------- */
.issues { max-width: var(--wrap); margin: 0 auto; padding: var(--s-9) var(--gutter) var(--s-8); }
.issues__head { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: var(--s-5); align-items: end; margin-bottom: var(--s-7); }
.issues__head .h2 { grid-column: 1 / 8; }
.issues__head p { grid-column: 8 / -1; color: var(--ink-2); max-width: 40ch; font-style: italic; }

.shelf { position: relative; overflow-x: auto; overflow-y: clip; padding-top: 44px; scrollbar-width: thin; }
.shelf__row { display: flex; align-items: flex-end; gap: 3px; min-width: max-content; padding: 0 var(--s-4); border-bottom: 16px solid var(--ink); }
.shelf__plank { display: none; }
.spine {
  position: relative;
  width: calc(var(--sw) * 1.7); height: calc(var(--sh) * 1.15);
  padding: 14px 0 12px;
  display: flex; flex-direction: column; align-items: center; justify-content: space-between;
  border: 1.5px solid var(--ink); border-bottom: 0; border-radius: 0;
  background: var(--sb); color: var(--sf);
  transform-origin: 50% 100%;
  transition: transform var(--t-mid) var(--ease-out), box-shadow var(--t-mid) var(--ease-out);
}
.spine__no { font: 400 1.35rem/1 var(--display); }
.spine__t { writing-mode: vertical-rl; transform: rotate(180deg); font: 400 2rem/1 var(--display); text-transform: uppercase; letter-spacing: 0.06em; }
.spine__m { writing-mode: vertical-rl; transform: rotate(180deg); font: italic 500 0.8rem/1 var(--text); }
/* Sold out in print: the publisher's name gives way to a black tab */
.spine.is-sold .spine__m { visibility: hidden; }
.spine.is-sold::after {
  content: "Sold out"; position: absolute; left: -1.5px; right: -1.5px; bottom: 0;
  padding: 8px 0; writing-mode: vertical-rl; transform: rotate(180deg);
  display: grid; place-items: center;
  background: var(--ink); color: var(--paper);
  font: italic 500 0.78rem/1 var(--text);
}
.spine:hover, .spine:focus-visible { transform: translateY(-18px) rotate(-2deg); box-shadow: var(--lift); z-index: 2; }
.spine[aria-pressed="true"] { transform: translateY(-34px); box-shadow: var(--lift); z-index: 3; }
.spine:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; }

/* The new issue leans face-out at the end of the shelf */
.faceout {
  --art-i: var(--paper); --art-i2: #d9d2c2; --art-crack: var(--ink);
  position: relative; flex: none;
  width: 250px; height: 330px; margin-left: var(--s-5);
  padding: 14px 14px 12px;
  display: grid; grid-template-rows: auto 1fr auto; justify-items: start;
  background: var(--ink); color: var(--paper);
  transform: rotate(-4deg); transform-origin: 0% 100%;
  box-shadow: var(--lift);
  overflow: hidden;
}
.faceout__mast { font: 400 2.6rem/0.8 var(--display); text-transform: uppercase; border-bottom: 2px solid var(--paper); width: 100%; padding-bottom: 6px; }
.faceout__word { font: 400 4.7rem/0.8 var(--display); text-transform: uppercase; color: var(--vermilion); align-self: center; letter-spacing: -0.01em; }
.faceout svg { position: absolute; right: -30px; bottom: 26px; width: 200px; }
.faceout__no { font: italic 500 0.9rem/1 var(--text); position: relative; }

.pulled {
  margin-top: var(--s-6);
  display: grid; grid-template-columns: auto 1fr auto; gap: var(--s-6); align-items: center;
  padding: var(--s-5) 0; border-top: var(--line) solid var(--ink); border-bottom: var(--line) solid var(--ink);
}
.pulled__no { font: 400 clamp(3rem, 1rem + 5vw, 6rem)/0.8 var(--display); }
.pulled__t { font: 400 2rem/1 var(--display); text-transform: uppercase; }
.pulled__t span { display: block; font: italic 400 var(--fs-sm)/1.4 var(--text); text-transform: none; color: var(--ink-2); margin-top: 6px; }
.pulled__d { margin-top: var(--s-2); max-width: 52ch; font-size: var(--fs-sm); }
.pulled__act { display: grid; gap: var(--s-3); justify-items: end; }
.pulled__stock { font-weight: 700; font-size: var(--fs-sm); }
.pulled.is-sold .pulled__stock { color: #a3220a; }

/* ---------- 12. Stockists ---------- */
.stock { background: var(--paper-2); padding: var(--s-9) var(--gutter); }
.stock__head { max-width: var(--wrap); margin: 0 auto var(--s-7); display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: var(--s-5); }
.chips { display: flex; flex-wrap: wrap; gap: var(--s-2); }
.chip { min-height: 44px; padding: 0 16px; border: var(--line) solid var(--ink); border-radius: var(--r-btn); background: transparent; font: 400 0.95rem/1 var(--display); text-transform: uppercase; letter-spacing: 0.04em; }
.chip span { font: italic 400 0.85rem/1 var(--text); text-transform: none; margin-left: 4px; color: var(--ink-2); }
.chip:hover { background: var(--paper); }
.chip[aria-pressed="true"] { background: var(--ink); color: var(--paper); }
.chip[aria-pressed="true"] span { color: var(--paper-dim); }
.shops { max-width: var(--wrap); margin: 0 auto; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); column-gap: var(--s-6); border-top: var(--line) solid var(--ink); }
.shops li { display: grid; gap: 2px; padding: var(--s-4) 0; border-bottom: 1px solid var(--ink); }
.shops b { font: 400 1.5rem/1.05 var(--display); text-transform: uppercase; letter-spacing: 0.01em; }
.shops span { font-size: var(--fs-sm); }
.shops__n { font-style: italic; color: var(--ink-2); }
.shops li.is-in { animation: shopin var(--t-mid) var(--ease-out); }
.stock__trade { max-width: var(--wrap); margin: var(--s-6) auto 0; font-size: var(--fs-sm); }
@keyframes shopin { from { transform: translateY(8px); } to { transform: none; } }

/* ---------- 13. Footer ---------- */
.foot { background: var(--ink); color: var(--paper); padding: var(--s-7) var(--gutter) var(--s-6); overflow: clip; }
.foot__mark { font: 400 43vw/0.76 var(--display); text-transform: uppercase; letter-spacing: -0.01em; color: var(--paper); margin: 0 0 var(--s-7) -0.03em; white-space: nowrap; }
.foot__cols { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: var(--s-6); border-top: var(--line) solid var(--paper); padding-top: var(--s-5); font-size: var(--fs-sm); color: var(--paper-dim); }
.foot__cols p { max-width: 52ch; }
.foot__cols ul { list-style: none; padding: 0; display: grid; gap: 6px; }
.foot__cols a { color: var(--paper); min-height: 32px; display: inline-flex; align-items: center; }
.foot__h { font: 400 1.1rem/1 var(--display); text-transform: uppercase; letter-spacing: 0.06em; color: var(--paper); margin-bottom: var(--s-3); }
.foot__fine { margin-top: var(--s-7); font-size: var(--fs-xs); font-style: italic; color: var(--paper-dim); }

/* ---------- 14. Motion-only states (html.kinetic is set by script.js when GSAP loaded and motion is allowed) ---------- */
.kinetic .inter__pin { height: 100svh; display: flex; align-items: center; padding: 0; }
.kinetic .inter__track { flex-wrap: nowrap; white-space: nowrap; font-size: min(52svh, 34vw); padding: 0 6vw; column-gap: 0.22em; will-change: transform; }
.kinetic .kin .char, .kinetic .kin-cover .char { display: inline-block; transform-origin: 50% 100%; will-change: transform; }

/* ---------- 15. Narrow screens ---------- */
@media (max-width: 1100px) {
  .bar__nav { display: none; }
  .bar__cta { margin-left: auto; }
  .contents__head .h2, .issues__head .h2 { grid-column: 1 / -1; }
  .contents__note, .issues__head p { grid-column: 1 / -1; }
  .spread--a, .spread--d { grid-column: 1 / -1; }
  .spread--b, .spread--c { grid-column: span 6; }
  .subscribe__intro { grid-column: 1 / -1; position: static; margin-bottom: var(--s-7); }
  .cover { min-height: auto; }
  .cover__title { font-size: min(36vw, 50svh); margin: var(--s-7) 0 var(--s-5); }
  .cover__no { top: auto; bottom: 34%; }
  .sub, .done { grid-column: 1 / -1; }
}

@media (max-width: 820px) {
  :root { --fs-md: 1.125rem; }
  .contents__body { display: block; }
  .preview { display: none; }
  .toc__link { grid-template-columns: 1fr 88px; grid-template-areas: "pg thumb" "title thumb" "by thumb" "dek dek"; row-gap: 6px; padding: var(--s-4) 0; }
  .toc__thumb { display: block; grid-area: thumb; width: 88px; height: 110px; align-self: start; border: var(--line) solid var(--ink); }
  .toc__pg { padding: 0; }
  .toc__by { padding: 0; }
  .toc__link::before { inset: 0 calc(-1 * var(--s-3)); }
  .read__stand, .read__by { grid-column: 1 / -1; }
  .read__by { margin-top: var(--s-4); }
  .shops { grid-template-columns: 1fr 1fr; }
  .pulled { grid-template-columns: auto 1fr; }
  .pulled__act { grid-column: 1 / -1; justify-items: start; grid-auto-flow: column; align-items: center; justify-content: space-between; }
  .foot__cols { grid-template-columns: 1fr 1fr; }
  .foot__cols > div:first-child { grid-column: 1 / -1; }
}

@media (max-width: 640px) {
  :root { --bar-h: 52px; --s-9: 88px; --s-8: 56px; }
  .bar { gap: var(--s-3); }
  .bar__season, .hide-sm { display: none; }
  .bar__cta { min-height: 44px; }

  /* Cover: a vertical stack, the theme word set across the full width */
  .cover { grid-template-rows: auto auto auto auto; min-height: auto; padding-bottom: var(--s-6); }
  .cover__mast { flex-direction: column; align-items: flex-start; gap: var(--s-2); }
  .cover__name { font-size: 22vw; }
  .cover__dek { text-align: left; }
  .cover__title { font-size: 32.5vw; margin-top: var(--s-6); }
  .cover__art { grid-column: 1 / -1; grid-row: 3; width: 100%; margin: calc(-1 * 13vw) 0 0; justify-self: center; }
  .cover__no { top: auto; right: var(--gutter); bottom: auto; width: 34vw; position: absolute; top: calc(var(--s-5) + 3vw); }
  .cover__num { font-size: 13vw; }
  .cover__num small { font-size: 0.75rem; }
  .seal text { font-size: 24px; }
  .cover__lines { grid-column: 1 / -1; grid-row: 4; margin-top: var(--s-5); }
  .cover__lines a { font-size: 1.15rem; }

  .toc__title { font-size: 2.2rem; }
  .read__title { font-size: 19vw; }
  .read__stand { font-size: 1.4rem; }
  .pull p { font-size: 2.3rem; }
  .dropcap::first-letter { font-size: 5.2em; }
  .read__fig { grid-column: full; }
  .read__fig figcaption { padding: 0 var(--gutter); }
  .inter__curve { padding-bottom: var(--s-7); }
  .inter__path { font-size: 64px; }
  .inter__src { font-size: 40px; }

  .spreads { grid-template-columns: 1fr; }
  .spread--a, .spread--b, .spread--c, .spread--d { grid-column: 1 / -1; grid-template-columns: 1fr; }
  .spread--c .spread__art { width: 100%; }
  .spread--d .spread__t { font-size: 22vw; }
  .spread { padding: var(--s-4); }

  .sub { padding: 20px 16px; }
  .sub__row { grid-template-columns: 1fr; }
  .plans { grid-template-columns: 1fr; }
  .plan { grid-template-columns: 1fr auto; align-items: baseline; }
  .plan__what { grid-column: 1 / -1; }
  .plan + .plan { border-left: 0; border-top: var(--line) solid var(--ink); }
  .btn--lg { width: 100%; }

  .shelf { margin: 0 calc(-1 * var(--gutter)); scroll-snap-type: x proximity; }
  .shelf__row { padding: 0 var(--gutter); }
  .spine { scroll-snap-align: start; }
  .pulled { grid-template-columns: 1fr; gap: var(--s-3); }
  .pulled__act { grid-auto-flow: row; justify-items: start; }

  .shops { grid-template-columns: 1fr; }
  .foot__mark { font-size: 42vw; }
  .foot__cols { grid-template-columns: 1fr; }

  /* The pinned line becomes a vertical sequence of words, each one stretching as it crosses the screen */
  .kinetic .inter__pin { height: auto; display: block; padding: var(--s-8) var(--gutter) var(--s-5); }
  .kinetic .inter__track { flex-direction: column; align-items: flex-start; white-space: normal; font-size: 18.5vw; padding: 0; row-gap: 0.06em; }
  .spine { width: calc(var(--sw) * 1.25); height: calc(var(--sh) * 0.92); }
  .spine__t { font-size: 1.6rem; }
  .faceout { width: 200px; height: 264px; }
  .faceout__word { font-size: 3.7rem; }
  .faceout__mast { font-size: 2rem; }
  .faceout svg { width: 160px; }
  /* The wave is too long for a phone line: the moving version travels along it, the still version sets it plainly */
  .inter__curve svg { width: 260%; margin-left: -40%; }
  html:not(.kinetic) .inter__curve svg { display: none; }
  html:not(.kinetic) .inter__plain { display: block; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
}
