/* Static guide pages (no JavaScript beyond the optional theme toggle —
   fully crawlable). Colours mirror the
   app's tokens in apps/web/src/styles.css; keep them in step. */

@font-face {
  font-family: 'Source Sans 3';
  src: url('/fonts/SourceSans3-VariableFont_wght.woff2') format('woff2');
  font-weight: 200 900;
  font-style: normal;
  font-display: swap;
}

/* Light by default. Dark only when chosen with the header toggle
   (guides/theme.js), which shares the app's saved theme. */
:root {
  /* Reading scale (2026-11-08) — mirrors the app's reading tokens in
     apps/web/src/styles.css; keep the two in step. Same font and weights as the editor roles. */
  --fs-page-title: clamp(30px, 4.5vw, 44px); /* page h1, bold */
  --fs-display: clamp(24px, 2.6vw, 30px); /* welcome slide titles, bold */
  --fs-heading: 26px; /* article h2, bold */
  --fs-subheading: 20px; /* article h3, card titles, bold */
  --fs-lede: 19px; /* the intro paragraph */
  --fs-reading: 17px; /* article text */
  --fs-small: 15px; /* captions, crumbs, footers, tables */
  --fs-eyebrow: 13px; /* bold caps tags and table heads */
  --fs-page-control: 16px; /* buttons on reading pages, semibold */

  --bg: #efeae0;
  --surface: #f5f1e8;
  --surface-2: #ece6d7;
  --paper: #fffdf8;
  --stroke: #1a1a1a;
  --text: #1a1a1a;
  --text-dim: #665e52;
  --accent: #c78861;
  --accent-ink: #8a4f2c;
  --accent-fg: #1a1a1a;
  --shadow: 3px 3px 0 var(--stroke);
  --shadow-lift: 5px 5px 0 var(--stroke);
  --radius: 6px;
  /* Mode tags: a soft fill and an ink that passes AA on it. */
  --mode-filet: #f0b8a0;
  --mode-filet-ink: #7a2f12;
  --mode-c2c: #b5dde2;
  --mode-c2c-ink: #1d5560;
  --mode-pixel: #c3c6f2;
  --mode-pixel-ink: #33308a;
  --mode-freeform: #cddfb5;
  --mode-freeform-ink: #42562a;
  /* Soft washes for bands and panels. */
  --mode-filet-soft: #f6d3c3;
  --mode-c2c-soft: #d3eaed;
  --mode-pixel-soft: #dcdef8;
  --mode-freeform-soft: #dfeacd;
  color-scheme: light;
}

:root[data-theme='dark'] {
  color-scheme: dark;
  --bg: #1c1714;
  --surface: #251f1b;
  --surface-2: #312923;
  --paper: #2b241f;
  --stroke: #5c4d42;
  --text: #efe4d2;
  --text-dim: #b3a391;
  --accent: #c7805c;
  --accent-ink: #e2a17f;
  --accent-fg: #1c1714;
  --mode-filet: #4a2f22;
  --mode-filet-ink: #f2c4a6;
  --mode-c2c: #1d3a3f;
  --mode-c2c-ink: #a6d9df;
  --mode-pixel: #392b47;
  --mode-pixel-ink: #d5c0ea;
  --mode-freeform: #2e3923;
  --mode-freeform-ink: #c6dba5;
  --mode-filet-soft: #2d2119;
  --mode-c2c-soft: #18292c;
  --mode-pixel-soft: #261f2f;
  --mode-freeform-soft: #20281a;
}

/* Anything with data-mode (a guide's <body>, a hub section, a card, a chip)
   carries its mode's colours as --m (fill), --m-ink (text/lines) and
   --m-soft (wash). Filet is the default. */
[data-mode],
[data-filter] {
  --m: var(--mode-filet);
  --m-ink: var(--mode-filet-ink);
  --m-soft: var(--mode-filet-soft);
}

[data-mode='c2c'],
[data-filter='c2c'] {
  --m: var(--mode-c2c);
  --m-ink: var(--mode-c2c-ink);
  --m-soft: var(--mode-c2c-soft);
}

[data-mode='pixel'],
[data-filter='pixel'] {
  --m: var(--mode-pixel);
  --m-ink: var(--mode-pixel-ink);
  --m-soft: var(--mode-pixel-soft);
}

[data-mode='freeform'],
[data-filter='freeform'] {
  --m: var(--mode-freeform);
  --m-ink: var(--mode-freeform-ink);
  --m-soft: var(--mode-freeform-soft);
}

/* Each mode has its own trim, used as a mask so it takes the mode's ink in
   both themes (owner, 2026-11-08):
   - Filet (and anything with no mode): ch, ch, sc ×, ch, sl st •.
   - Pixel: rounded pixel squares stepping along a playful path.
   - C2C: a diagonal staircase of tilted blocks, posts showing. */
:root,
[data-mode='filet'],
[data-mode='freeform'] {
  --trim: url('/guides/trim-filet.svg');
  --trim-size: 96px 12px;
  --trim-h: 12px;
}

[data-mode='pixel'] {
  --trim: url('/guides/trim-pixel.svg');
  --trim-size: 80px 16px;
  --trim-h: 16px;
}

[data-mode='c2c'] {
  --trim: url('/guides/trim-c2c.svg');
  --trim-size: 84px 18px;
  --trim-h: 18px;
}

.chain-trim {
  display: block;
  height: var(--trim-h);
  background: var(--m-ink, var(--accent-ink));
  -webkit-mask: var(--trim) round left center / var(--trim-size);
  mask: var(--trim) round left center / var(--trim-size);
  opacity: 0.6;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family:
    'Source Sans 3',
    ui-sans-serif,
    system-ui,
    -apple-system,
    'Segoe UI',
    sans-serif;
  font-size: var(--fs-reading);
  line-height: 1.6;
}

a {
  color: var(--accent-ink);
  text-underline-offset: 3px;
}

a:focus-visible,
.button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

/* ── Header ───────────────────────────────────────────────────────────── */
.site-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  max-width: 1080px;
  margin: 0 auto;
  padding: 18px 16px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  text-decoration: none;
}

.brand-mark {
  width: 34px;
  height: 34px;
}

/* The text logo is black paths; masking it keeps it the text colour in
   both themes, like the app's Wordmark. */
.brand-word {
  display: block;
  width: 168px;
  height: 16px;
  background: currentColor;
  -webkit-mask: url('/guides/logo-text.svg') no-repeat center / contain;
  mask: url('/guides/logo-text.svg') no-repeat center / contain;
}

/* ── Buttons ──────────────────────────────────────────────────────────── */
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 8px 20px;
  font-weight: 600;
  font-size: var(--fs-page-control);
  color: var(--accent-fg);
  text-decoration: none;
  background: var(--accent);
  border: 1.5px solid var(--stroke);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.button:hover {
  filter: brightness(1.06);
}

.button--quiet {
  color: var(--text);
  background: var(--surface);
}

/* The header's right side: the round theme toggle, then Open the designer. */
.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  padding: 0;
  color: var(--text);
  background: var(--surface);
  border: 1.5px solid var(--stroke);
  border-radius: 50%;
  box-shadow: var(--shadow);
  cursor: pointer;
}

.theme-toggle[hidden] {
  display: none;
}

.theme-toggle:hover {
  filter: brightness(1.06);
}

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

.theme-toggle svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Shows what a click switches to: the moon in light mode, the sun in dark. */
.theme-toggle .icon-sun,
:root[data-theme='dark'] .theme-toggle .icon-moon {
  display: none;
}

:root[data-theme='dark'] .theme-toggle .icon-sun {
  display: block;
}

/* ── Page ─────────────────────────────────────────────────────────────── */
main {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 16px 48px;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr);
  gap: 32px;
  align-items: center;
  padding: 24px 0 40px;
}

/* On a guide (body[data-mode]) the hero sits on a band of its mode's wash
   that runs the full window width (box-shadow + clip-path: no sideways
   scroll), finished with a row of chain stitches. */
body[data-mode] .hero {
  position: relative;
  margin-top: 22px;
  margin-bottom: 36px;
  padding-top: 40px;
  padding-bottom: 48px;
  background: var(--m-soft);
  box-shadow: 0 0 0 100vmax var(--m-soft);
  clip-path: inset(0 -100vmax);
}

/* Inside a guide the stitch trim is a small accent, like on the hubs: a
   short run over the hero's eyebrow, and a centred break before the FAQ. */
body[data-mode] .hero > div::before,
body[data-mode] .faq::before {
  content: '';
  display: block;
  width: 168px;
  height: var(--trim-h);
  margin: 0 0 16px;
  background: var(--m-ink);
  -webkit-mask: var(--trim) round left center / var(--trim-size);
  mask: var(--trim) round left center / var(--trim-size);
  opacity: 0.6;
}

body[data-mode] .faq::before {
  margin: 56px auto 0;
}

body[data-mode] .eyebrow {
  color: var(--m-ink);
}

.eyebrow {
  margin: 0 0 6px;
  font-size: var(--fs-eyebrow);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent-ink);
}

h1 {
  margin: 0 0 14px;
  font-size: var(--fs-page-title);
  line-height: 1.1;
}

.lede {
  margin: 0 0 22px;
  font-size: var(--fs-lede);
  color: var(--text-dim);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.shot {
  margin: 0;
  background: var(--paper);
  border: 1.5px solid var(--stroke);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.shot img,
.shot video {
  display: block;
  width: 100%;
  height: auto;
}

/* A grid chart gets room between it and the frame's stroke. */
.shot--grid img {
  padding: 24px;
  background: var(--paper);
}

@media (max-width: 760px) {
  .shot--grid img {
    padding: 12px;
  }
}

.shot figcaption {
  padding: 8px 12px;
  font-size: var(--fs-small);
  color: var(--text-dim);
  border-top: 1.5px solid var(--stroke);
  background: var(--surface);
}

/* Readable column for the article body. */
.prose {
  max-width: 720px;
  margin: 0 auto;
}

.prose h2 {
  margin: 44px 0 10px;
  font-size: var(--fs-heading);
  line-height: 1.2;
}

.prose h3 {
  margin: 28px 0 6px;
  font-size: var(--fs-subheading);
}

.prose figure {
  margin: 24px 0;
}

.prose ol,
.prose ul {
  padding-left: 1.3em;
}

.prose li + li {
  margin-top: 6px;
}

.card {
  margin: 24px 0;
  padding: 18px 20px;
  background: var(--surface);
  border: 1.5px solid var(--stroke);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.card > :first-child {
  margin-top: 0;
}

.card > :last-child {
  margin-bottom: 0;
}

/* Symbol key table on the chart guide. */
.key {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--fs-reading);
}

.key th,
.key td {
  padding: 8px 10px;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--surface-2);
}

.key th {
  font-size: var(--fs-eyebrow);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-dim);
}

/* ── Diagrams (inline SVG, drawn by scripts/guide-diagrams.mjs) ───────── */
.diagram {
  margin: 24px 0;
  padding: 16px 16px 0;
  background: var(--paper);
  border: 1.5px solid var(--stroke);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.diagram figcaption {
  margin: 12px -16px 0;
  padding: 8px 12px;
  font-size: var(--fs-small);
  color: var(--text-dim);
  border-top: 1.5px solid var(--stroke);
  background: var(--surface);
}

.dg {
  display: block;
  width: 100%;
  max-width: 520px;
  height: auto;
  margin: 0 auto;
  font-family: inherit;
  font-size: 16px;
}

.dg text {
  fill: var(--text);
}

.dg .dg-dim,
.dg .dg-small {
  fill: var(--text-dim);
}

.dg .dg-small {
  font-size: 15px;
}

.dg .dg-strong {
  font-weight: 700;
}

.dg .dg-big {
  font-size: 21px;
  font-weight: 700;
}

.dg .dg-acc-text {
  fill: var(--accent-ink);
  font-weight: 700;
}

.dg .dg-ink,
.dg .dg-acc,
.dg .dg-dim-ink,
.dg .dg-path,
.dg .dg-v {
  fill: none;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.dg .dg-ink {
  stroke: var(--text);
}

.dg .dg-acc,
.dg .dg-v {
  stroke: var(--accent-ink);
}

.dg .dg-v {
  stroke: #8a4f2c;
  stroke-width: 3;
}

.dg .dg-dim-ink {
  stroke: var(--text-dim);
  stroke-width: 1.6;
}

.dg .dg-hook {
  stroke-width: 4;
}

.dg .dg-acc-fill {
  fill: var(--accent);
  stroke: var(--stroke);
  stroke-width: 1.5;
}

.dg .dg-path {
  stroke: var(--accent);
  stroke-width: 3.5;
}

/* The app's own stitch-chart artwork, drawn in its art units (scaled), so
   stroke widths are in those units: 1 = the chart's line weight. */
.dg .dg-st {
  fill: none;
  stroke: var(--text);
  stroke-width: 1;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.dg .dg-st-acc {
  stroke: var(--accent-ink);
}

/* Where a stitch will go, not yet worked. */
.dg .dg-st-ghost {
  stroke-dasharray: 1.4 1.6;
  opacity: 0.8;
}

/* A stitch chart in place of a screenshot (the hero). */
.shot--chart {
  padding: 12px 8px 0;
}

.shot--chart .dg {
  max-width: none;
}

/* The caption runs edge to edge under the padded chart. */
.shot--chart figcaption {
  margin: 12px -8px 0;
}

/* Chart squares stay paper-coloured in both themes, like the app's canvas:
   a filled square must read as filled. */
.dg .dg-cell,
.dg .dg-block,
.dg .dg-block-soft {
  stroke: #8a8178;
  stroke-width: 1;
}

.dg .dg-cell {
  fill: #fffdf8;
}

.dg .dg-block {
  fill: #1a1a1a;
}

.dg .dg-block-soft {
  fill: #ece6d7;
}

.dg .dg-shape {
  fill: var(--accent);
  fill-opacity: 0.55;
  stroke: var(--accent-ink);
  stroke-width: 2;
}

.dg .dg-guide,
.dg .dg-guide-solid {
  stroke: var(--text-dim);
  stroke-width: 1;
}

.dg .dg-guide {
  stroke-dasharray: 3 4;
}

/* C2C diagrams. Like chart squares, yarn colours stay the same in both
   themes, and anything drawn on a square uses fixed ink (dg-st-on, dg-cell-*). */
.dg .dg-c2c-even,
.dg .dg-c2c-a,
.dg .dg-c2c-b,
.dg .dg-c2c-a-soft,
.dg .dg-sec-inc,
.dg .dg-sec-even,
.dg .dg-sec-dec {
  stroke: #8a8178;
  stroke-width: 1;
}

.dg .dg-c2c-even {
  fill: #e3edf0;
}

.dg .dg-c2c-a {
  fill: #d1495b;
}

.dg .dg-c2c-b {
  fill: #f4a7b5;
}

.dg .dg-c2c-a-soft {
  fill: #f3cdd2;
}

.dg .dg-sec-inc {
  fill: #f5d9c6;
}

.dg .dg-sec-even {
  fill: #dce9cb;
}

.dg .dg-sec-dec {
  fill: #cfe3ea;
}

.dg .dg-outline {
  fill: none;
  stroke: #3d3630;
  stroke-width: 2;
}

.dg .dg-cell-ink {
  fill: none;
  stroke: #3d3630;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.dg .dg-outline-thin {
  fill: none;
  stroke: #8a8178;
  stroke-width: 1;
}

.dg .dg-c2c-dot {
  fill: #3d3630;
}

.dg .dg-st-on {
  stroke: #1a1a1a;
}

.dg .dg-st-on-acc {
  stroke: #8a4f2c;
}

.dg .dg-st-c2c {
  stroke: #8f1f33;
}

.dg .dg-c2c-a-line {
  stroke: #d1495b;
  stroke-width: 5;
  stroke-linecap: round;
}

.dg .dg-c2c-ring {
  fill: none;
  stroke: #8a4f2c;
  stroke-width: 2;
  stroke-dasharray: 4 3;
}

.dg .dg-c2c-ring-cell {
  fill: none;
  stroke: #1a1a1a;
  stroke-width: 3;
  stroke-dasharray: 5 3;
}

/* A title at the top of a card ("Written row-by-row pattern"). */
.card-label {
  margin: 0 0 12px;
  padding-bottom: 8px;
  font-size: var(--fs-eyebrow);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-dim);
  border-bottom: 1.5px solid var(--surface-2);
}

.prose .card > .card-label {
  margin-top: 0;
}

/* A C2C written pattern (generated from the app's own written pattern). */
.written-c2c {
  font-size: var(--fs-reading);
}

.written-terms {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  gap: 4px 12px;
  margin: 0 0 12px;
}

.written-terms dt {
  font-weight: 700;
}

.written-terms dd {
  margin: 0;
}

.written-c2c h4 {
  margin: 18px 0 4px;
  font-size: var(--fs-reading);
}

.written-intro {
  margin: 0 0 8px;
  color: var(--text-dim);
}

.prose .written-rows {
  margin: 0;
  padding: 0;
  list-style: none;
}

.written-box {
  display: inline-block;
  width: 13px;
  height: 13px;
  margin-right: 6px;
  vertical-align: -1px;
  border: 1.5px solid var(--text);
  border-radius: 2px;
}

.written-rows li.is-marked {
  margin-left: -8px;
  padding: 6px 8px;
  background: var(--surface-2);
  border-radius: 4px;
}

.written-note {
  display: block;
  margin-top: 4px;
  font-size: var(--fs-small);
  color: var(--text-dim);
}

/* Blanket size tables: scroll sideways inside their box on a phone. */
.table-wrap {
  overflow-x: auto;
}

.size-table caption {
  padding: 0 0 8px;
  font-weight: 700;
  text-align: left;
}

.size-table td {
  white-space: nowrap;
}

.size-sub {
  display: block;
  font-size: var(--fs-small);
  font-weight: 400;
  color: var(--text-dim);
}

/* C2C blanket size tables (owner, 2026-11-09: livelier, still easy to scan):
   a tinted header in the page's mode colour, striped rows, a swatch of each
   blanket's real shape, and a bar for its yarn. */
.size-table {
  overflow: hidden;
  border-radius: var(--radius);
}

.size-table thead th {
  color: var(--m-ink, var(--text));
  background: var(--m-soft, var(--surface-2));
}

.size-table tbody tr:nth-child(even) {
  background: color-mix(in srgb, var(--m-soft, var(--surface-2)) 45%, transparent);
}

.size-table tbody th {
  display: flex;
  align-items: center;
  gap: 12px;
}

.size-swatch {
  flex: 0 0 auto;
  background: var(--m-ink, var(--accent));
  border: 1.5px solid var(--stroke);
  border-radius: 3px;
  box-shadow: 2px 2px 0 var(--stroke);
}

/* A box the size of the King's swatch, so every name lines up. */
.size-swatch-box {
  flex: 0 0 44px;
  display: grid;
  place-items: center;
  height: 44px;
}

.size-table tbody th .size-name {
  min-width: 0;
}

.size-yarn {
  position: relative;
  min-width: 120px;
  font-weight: 700;
}

.yarn-bar {
  display: block;
  width: var(--p);
  height: 8px;
  margin-bottom: 5px;
  background: var(--m-ink, var(--accent));
  border-radius: 4px;
  opacity: 0.75;
}

.size-table tbody td {
  vertical-align: middle;
}

/* Written rows beside a worked-example chart. */
.worked {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}

.worked .diagram {
  margin: 0;
}

.worked ol {
  margin: 0;
  font-size: var(--fs-reading);
}

.worked .foundation {
  margin: 0 0 8px;
  font-size: var(--fs-reading);
  font-weight: 700;
}

/* Grid → stitch → written crossfade (the welcome window's morph, three
   ways). 12s loop: each view holds 3.4s, then a 0.6s crossfade. All three
   share one keyframe, offset by negative delays; the pill's labels drift up
   and out as the next drifts in, like the welcome pill. */
/* The pill sits centred on the frame's top border, half above it, like the
   welcome window's — so the frame lets it overflow. */
.morph {
  position: relative;
  margin-top: 36px;
  padding-top: 30px;
  overflow: visible;
}

.morph figcaption {
  border-radius: 0 0 var(--radius) var(--radius);
}

.morph-stage {
  display: grid;
  justify-items: center;
}

.morph-tag {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 1;
  display: grid;
  margin: 0;
  padding: 4px 14px;
  border: 1.5px solid var(--stroke);
  border-radius: 999px;
  background: var(--accent);
  color: var(--accent-fg);
  font-size: var(--fs-eyebrow);
  font-weight: 700;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
}

.morph-tag > span {
  grid-area: 1 / 1;
  text-align: center;
  animation: morph-tag 12s ease-in-out infinite;
}

.morph-frame {
  grid-area: 1 / 1;
  align-self: center;
  width: 100%;
  animation: morph-view 12s ease-in-out infinite;
}

.morph-tag > span:nth-child(2),
.morph-frame:nth-of-type(2) {
  animation-delay: -8s;
}

.morph-tag > span:nth-child(3),
.morph-frame:nth-of-type(3) {
  animation-delay: -4s;
}

.morph-label {
  display: none;
  font-size: var(--fs-eyebrow);
}

.morph-words {
  max-width: 560px;
  font-size: var(--fs-small);
  line-height: 1.5;
}

.morph-words .foundation {
  margin: 0 0 6px;
  font-weight: 700;
}

.morph-words ol {
  margin: 0;
  padding-left: 0;
  list-style: none;
}

.morph-words li + li {
  margin-top: 4px;
}

@keyframes morph-view {
  0%,
  28.3% {
    opacity: 1;
    visibility: visible;
  }
  33.3%,
  95% {
    opacity: 0;
    visibility: hidden;
  }
  100% {
    opacity: 1;
    visibility: visible;
  }
}

@keyframes morph-tag {
  0%,
  28.3% {
    opacity: 1;
    transform: translateY(0);
  }
  31.5% {
    opacity: 0;
    transform: translateY(-6px);
  }
  95.5% {
    opacity: 0;
    transform: translateY(6px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

/* No motion: show all three, one under the other, each with its label. */
@media (prefers-reduced-motion: reduce) {
  .morph-tag {
    display: none;
  font-size: var(--fs-eyebrow);
}

  .morph-frame {
    grid-area: auto;
    animation: none;
  }

  .morph-frame + .morph-frame {
    margin-top: 20px;
  }

  .morph-label {
    display: block;
    margin: 0 0 8px;
    font-size: var(--fs-eyebrow);
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--text-dim);
  }
}

/* Downloadable graph paper: two cards, thumbnail on top. */
.printables,
.prose .printables {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin: 16px 0 24px;
  padding: 0;
  list-style: none;
}

.printables li,
.prose .printables li {
  margin: 0;
}

.printables a {
  display: flex;
  flex-direction: column;
  gap: 4px;
  height: 100%;
  padding: 12px;
  color: var(--text);
  text-decoration: none;
  background: var(--surface);
  border: 1.5px solid var(--stroke);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.printables img {
  display: block;
  width: 100%;
  height: auto;
  margin-bottom: 6px;
  border: 1px solid var(--surface-2);
  border-radius: 4px;
}

.printables span {
  font-size: var(--fs-small);
  color: var(--text-dim);
}

.printables .printables-get {
  margin-top: auto;
  padding-top: 6px;
  font-weight: 700;
  color: var(--accent-ink);
}

.printables a:hover .printables-get {
  text-decoration: underline;
}

/* Picture → grid → stitches: image frames, centred with room around them. */
.morph--pics .morph-frame img {
  display: block;
  width: 100%;
  max-width: 420px;
  height: auto;
  margin: 0 auto 8px;
}

/* Two pictures side by side (one column on a phone). */
.pair {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  align-items: stretch;
  margin: 20px 0;
}

.prose .pair figure {
  display: flex;
  flex-direction: column;
  margin: 0;
}

/* Both pictures in the same square frame: a chart is shown whole on white,
   a photo fills its frame. Captions stretch so both frames end level. */
.pair img {
  aspect-ratio: 1;
  object-fit: contain;
  background: #ffffff;
}

.pair img.is-photo {
  object-fit: cover;
}

.pair figcaption {
  flex: 1;
}

/* Photo → graph → stitch chart, three across (one column on a phone). */
.trio {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin: 20px 0;
}

.prose .trio figure {
  margin: 0;
}

/* Two ways in: screenshot cards side by side. */
.ways {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin: 16px 0 8px;
}

.ways section {
  padding: 12px 14px 4px;
  background: var(--surface);
  border: 1.5px solid var(--stroke);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.ways img {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--surface-2);
  border-radius: 4px;
}

.ways h3 {
  margin: 12px 0 4px;
}

.ways ol,
.ways p {
  font-size: var(--fs-reading);
}

.ways ol {
  padding-left: 1.2em;
}

.pro-tag {
  display: inline-block;
  margin-left: 4px;
  padding: 1px 8px;
  font-size: var(--fs-eyebrow);
  font-weight: 700;
  vertical-align: 2px;
  color: var(--accent-fg);
  background: var(--accent);
  border-radius: 999px;
}

.pro-tag--free {
  color: var(--text);
  background: var(--surface-2);
}

.note-dim {
  font-size: var(--fs-small);
  color: var(--text-dim);
}

.compare--wide td {
  vertical-align: top;
}

/* ── Breadcrumb, contents, notes, related guides ──────────────────────── */
.crumbs {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 16px;
  font-size: var(--fs-small);
  color: var(--text-dim);
}

.crumbs ol {
  display: flex;
  flex-wrap: wrap;
  margin: 0;
  padding: 0;
  list-style: none;
}

.crumbs li + li::before {
  content: '›';
  margin: 0 8px;
}

.toc {
  margin: 8px 0 0;
  padding: 14px 20px;
  background: var(--surface);
  border: 1.5px solid var(--stroke);
  border-radius: var(--radius);
}

.toc h2 {
  margin: 0 0 6px;
  font-size: var(--fs-small);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-dim);
}

.toc ol {
  margin: 0;
  columns: 2;
  column-gap: 32px;
  font-size: var(--fs-reading);
}

.toc li + li {
  margin-top: 2px;
}

.note {
  margin: 20px 0;
  padding: 12px 16px;
  background: var(--surface);
  border-left: 4px solid var(--accent);
  border-radius: 0 var(--radius) var(--radius) 0;
}

.note > :first-child {
  margin-top: 0;
}

.note > :last-child {
  margin-bottom: 0;
}

.compare {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--fs-small);
}

.compare th,
.compare td {
  padding: 8px 10px;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--surface-2);
}

.compare thead th {
  font-size: var(--fs-eyebrow);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-dim);
}

/* ── Mode tags and picture cards (hubs + "more guides" strips) ─────────── */
/* Card markup is generated by scripts/guides/cards.mjs — see docs/seo-pages.md. */
.mode-tag {
  display: inline-block;
  padding: 1px 10px;
  font-size: var(--fs-eyebrow);
  font-weight: 700;
  line-height: 1.6;
  letter-spacing: 0.02em;
  text-transform: none;
  white-space: nowrap;
  color: var(--mode-filet-ink);
  background: var(--mode-filet);
  border-radius: 999px;
}

/* .mode-tag alone is Filet Crochet; --filet just says so. */
.mode-tag--c2c {
  color: var(--mode-c2c-ink);
  background: var(--mode-c2c);
}

.mode-tag--pixel {
  color: var(--mode-pixel-ink);
  background: var(--mode-pixel);
}

.mode-tag--freeform {
  color: var(--mode-freeform-ink);
  background: var(--mode-freeform);
}

/* In a page hero the tag sits on the eyebrow line, before its text. */
.eyebrow .mode-tag {
  margin-right: 8px;
  vertical-align: 1px;
}

.hub-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  gap: 24px 40px;
  align-items: center;
  padding: 24px 0 8px;
}

.hub-hero > div > :last-child {
  margin-bottom: 0;
}

.hub-hero__art {
  display: block;
  width: 100%;
  max-width: 420px;
  height: auto;
  justify-self: end;
}

.hub-hero .chain-trim {
  max-width: 240px;
  margin: 0 0 18px;
}

/* Jump links to each mode's section; hub.js turns them into filters. */
.hub-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 8px 0 0;
  padding: 0;
  list-style: none;
}

/* Same shape as .button: rounded rectangle, outline and offset shadow. */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 6px 14px;
  font-size: var(--fs-page-control);
  font-weight: 700;
  color: var(--text);
  text-decoration: none;
  background: var(--surface);
  border: 1.5px solid var(--stroke);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.chip:active {
  transform: translate(2px, 2px);
  box-shadow: 1px 1px 0 var(--stroke);
}

.chip[data-filter]:not([data-filter='all']) {
  background: var(--m-soft);
}

.chip[data-filter]:not([data-filter='all']):hover {
  background: var(--m);
}

.chip[data-filter='all']:hover,
.chip:not([data-filter]):hover {
  background: var(--surface-2);
}

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

.chip[aria-pressed='true'] {
  color: var(--accent-fg);
  background: var(--accent);
  box-shadow: var(--shadow);
}

.chip[data-filter]:not([data-filter='all'])[aria-pressed='true'] {
  color: var(--paper);
  background: var(--m-ink);
}

.chip[aria-pressed='true'] .chip-dot {
  background: currentColor;
}

.chip-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--mode-filet-ink);
}

.chip-dot--c2c {
  background: var(--mode-c2c-ink);
}

.chip-dot--pixel {
  background: var(--mode-pixel-ink);
}

.chip-dot--freeform {
  background: var(--mode-freeform-ink);
}

.hub-section {
  margin: 36px 0 0;
  padding: 24px 24px 28px;
  background: var(--m-soft);
  border-radius: 14px;
  scroll-margin-top: 16px;
}

.hub-section > .chain-trim {
  max-width: 168px;
  margin: 0 0 12px;
}

.hub-section[hidden] {
  display: none;
}

.hub-section__head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 14px;
  margin-bottom: 16px;
}

.hub-section__head h2 {
  margin: 0;
  font-size: var(--fs-heading);
  line-height: 1.2;
}

.hub-section__intro {
  flex-basis: 100%;
  margin: 0;
  color: var(--text-dim);
}

.post-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.post-card {
  margin: 0;
}

.post-card > a {
  display: flex;
  flex-direction: column;
  height: 100%;
  color: var(--text);
  text-decoration: none;
  background: var(--surface);
  border: 1.5px solid var(--stroke);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  transition:
    transform 0.15s ease,
    box-shadow 0.15s ease;
}

.post-card > a:hover {
  transform: translate(-2px, -2px);
  box-shadow: var(--shadow-lift);
}

.post-card > a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

/* Covers run edge to edge (each brings its own background). */
.post-card__media {
  display: block;
  background: var(--paper);
  border-bottom: 1.5px solid var(--stroke);
}

.post-card__media img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

.post-card__body {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 6px;
  padding: 14px 16px 16px;
}

.post-card__tags {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 8px;
}

.post-card__kind {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-dim);
}

/* On cards the tags are small labels, so the title leads (owner,
   2026-11-09); the hero's mode tag keeps its eyebrow size. */
.post-card__tags .mode-tag {
  padding: 0 7px;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.55;
}

.post-card__title {
  margin: 0;
  font-size: var(--fs-subheading);
  line-height: 1.25;
}

.post-card__desc {
  font-size: var(--fs-small);
  line-height: 1.5;
  color: var(--text-dim);
}

.post-card__meta {
  margin-top: auto;
  padding-top: 4px;
  font-size: var(--fs-small);
  color: var(--text-dim);
}

/* "More guides" strip at the foot of a guide page. */
.more-guides {
  margin: 56px 0 0;
}

.more-guides__head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 4px 16px;
  margin-bottom: 14px;
}

.more-guides__head h2 {
  margin: 0;
  font-size: var(--fs-heading);
}

.more-guides__head a {
  font-weight: 700;
}

.hub-back {
  margin: 28px 0 0;
  text-align: center;
  font-weight: 700;
}

/* The band on /guides that points to the free patterns hub. */
.hub-band {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px 24px;
  align-items: center;
  margin: 56px 0 0;
  padding: 22px 24px;
  background: var(--surface);
  border: 1.5px solid var(--stroke);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.hub-band h2 {
  margin: 0 0 4px;
  font-size: var(--fs-heading);
}

.hub-band p {
  margin: 0;
  color: var(--text-dim);
}

@media (max-width: 960px) {
  .post-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .hub-hero {
    grid-template-columns: minmax(0, 1fr);
  }

  .hub-hero__art {
    max-width: 300px;
    justify-self: start;
    grid-row: 1;
  }
}

@media (max-width: 600px) {
  .post-grid,
  .hub-band {
    grid-template-columns: minmax(0, 1fr);
  }

  .hub-section {
    margin-right: -8px;
    margin-left: -8px;
    padding: 18px 12px 20px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .post-card > a {
    transition: none;
  }

  .post-card > a:hover {
    transform: none;
    box-shadow: var(--shadow);
  }
}

.faq details {
  margin: 10px 0;
  padding: 12px 16px;
  background: var(--surface);
  border: 1.5px solid var(--stroke);
  border-radius: var(--radius);
}

.faq summary {
  font-weight: 700;
  cursor: pointer;
}

.faq details[open] summary {
  margin-bottom: 6px;
}

.cta {
  margin: 48px auto 0;
  max-width: 720px;
  padding: 24px;
  text-align: center;
  background: var(--surface);
  border: 1.5px solid var(--stroke);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.cta h2 {
  margin: 0 0 8px;
}

.cta p {
  margin: 0 0 16px;
  color: var(--text-dim);
}

/* ── Footer ───────────────────────────────────────────────────────────── */
.site-footer {
  max-width: 1080px;
  margin: 0 auto;
  padding: 24px 16px 40px;
  font-size: var(--fs-small);
  color: var(--text-dim);
  text-align: center;
  border-top: 1.5px solid var(--surface-2);
}

/* The 1C mark, sitting a little above the text line. */
.footer-mark {
  width: 20px;
  height: 20px;
  margin-right: 4px;
  vertical-align: -1px;
}

.site-footer ul {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
  margin: 0 0 12px;
  padding: 0;
  list-style: none;
}

@media (max-width: 760px) {
  body {
    font-size: var(--fs-reading);
  }

  .hero {
    grid-template-columns: minmax(0, 1fr);
    gap: 20px;
    padding-top: 8px;
  }

  /* Logo and the header button share one line on a phone. */
  .site-header {
    flex-wrap: nowrap;
  }

  .brand-mark {
    width: 28px;
    height: 28px;
  }

  .brand-word {
    width: 118px;
  }

  .worked {
    grid-template-columns: minmax(0, 1fr);
  }

  .toc ol {
    columns: 1;
  font-size: var(--fs-reading);
}

  .printables,
  .ways,
  .trio,
  .pair {
    grid-template-columns: minmax(0, 1fr);
  }

  .compare {
    font-size: var(--fs-small);
  }

  .site-header .button {
    min-height: 38px;
    padding: 6px 12px;
    font-size: 15px;
    white-space: nowrap;
  }

  .header-actions {
    gap: 8px;
  }

  /* Never taller than Open the designer beside it. */
  .site-header .theme-toggle {
    width: 38px;
    height: 38px;
  }

  .site-header .theme-toggle svg {
    width: 18px;
    height: 18px;
  }
}

/* About us (/about): the photo placeholder beside the story. */
.about {
  display: grid;
  grid-template-columns: minmax(0, 340px) minmax(0, 1fr);
  gap: 48px;
  align-items: center;
  margin: 24px 0 40px;
}

.about__photo {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1;
  background: var(--accent);
  border: 1.5px solid var(--stroke);
  border-radius: 58% 42% 55% 45% / 47% 58% 42% 53%;
  box-shadow: 6px 6px 0 var(--stroke);
  object-fit: cover;
}

.about__copy > .chain-trim {
  max-width: 168px;
  margin: 0 0 12px;
}

.about__copy p {
  font-size: var(--fs-reading);
  line-height: 1.6;
}

@media (max-width: 760px) {
  .about {
    grid-template-columns: minmax(0, 1fr);
    gap: 28px;
  }

  .about__photo {
    width: min(240px, 70vw);
    margin: 0 auto;
  }
}

/* The smallest phones (≤ 360px): the logo mark alone, so the header's
   toggle and Open the designer fit without a sideways scroll. */
@media (max-width: 360px) {
  .site-header .brand-word {
    display: none;
  }
}
