/* joshkoerpel.com — "Live dangerously (in a good way)"
   The brand comes straight from the yellow homepage banner:
   caution yellow, duotone plum photos, bone letters with a hard black
   shadow thrown down-left, halftone dots, grunge, and marker notes.
   See BRAND.md for the rules. */

/* ---------- fonts (self-hosted, SIL Open Font License) ---------- */
@font-face { font-family: 'Barlow Condensed'; font-weight: 600; font-display: swap; src: url('/fonts/barlow-condensed-600.woff2') format('woff2'); }
@font-face { font-family: 'Barlow Condensed'; font-weight: 700; font-display: swap; src: url('/fonts/barlow-condensed-700.woff2') format('woff2'); }
@font-face { font-family: 'Barlow Condensed'; font-weight: 800; font-display: swap; src: url('/fonts/barlow-condensed-800.woff2') format('woff2'); }
@font-face { font-family: 'Source Serif 4'; font-weight: 200 900; font-style: normal; font-display: swap; src: url('/fonts/source-serif-4.woff2') format('woff2'); }
@font-face { font-family: 'Source Serif 4'; font-weight: 200 900; font-style: italic; font-display: swap; src: url('/fonts/source-serif-4-italic.woff2') format('woff2'); }
/* Josh's own handwriting, traced from his sheet (tools/font/) */
@font-face { font-family: 'Josh Hand'; font-weight: 400; font-display: swap; src: url('/fonts/josh-hand.woff2') format('woff2'); }

:root {
  /* palette */
  --yellow: #f8cc02;       /* caution yellow: backgrounds only, never text on paper */
  --yellow-deep: #e3b800;
  --yellow-pale: #fbe68c;
  --plum: #2e1f44;         /* duotone shadows, dark bands */
  --plum-deep: #1b1029;
  --plum-soft: #6c5a7e;
  --bone: #ece6da;         /* the banner's letter colour */
  --paper: #faf7ef;
  --ink: #141114;          /* the hard shadow */
  --ink-soft: #4b4450;
  --rule: #dcd4c4;

  /* older names still used by a few components */
  --magenta: var(--plum);
  --shallow: #f3ecd8;
  --deep: var(--yellow);

  --display: 'Barlow Condensed', 'Arial Narrow', sans-serif;
  --text: 'Source Serif 4', Georgia, serif;
  --hand: 'Josh Hand', 'Comic Sans MS', cursive;

  /* the signature: a solid shadow thrown down and to the left */
  --extrude: -.008em .008em 0 var(--ink), -.016em .016em 0 var(--ink), -.024em .024em 0 var(--ink),
    -.032em .032em 0 var(--ink), -.04em .04em 0 var(--ink), -.048em .048em 0 var(--ink),
    -.056em .056em 0 var(--ink), -.064em .064em 0 var(--ink), -.072em .072em 0 var(--ink),
    -.08em .08em 0 var(--ink);
  --drop: -6px 6px 0 var(--ink);

  --halftone: radial-gradient(circle, rgb(255 246 190 / .75) 30%, transparent 36%) 0 0 / 12px 12px,
    radial-gradient(circle, rgb(255 246 190 / .75) 30%, transparent 36%) 6px 6px / 12px 12px;
  --grunge: url('/textures/grunge.svg') 0 0 / 640px 640px;
  --torn: linear-gradient(#000 0 0) top / 100% calc(100% - 13px) no-repeat,
    url('/textures/torn.svg') bottom left / 420px 14px repeat-x;

  --measure: 38rem;
  --wide: 70rem;
  --gutter: clamp(1rem, 4vw, 2.5rem);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 1.1875rem/1.65 var(--text);
  text-rendering: optimizeLegibility;
}
img, video, iframe { max-width: 100%; }
img { height: auto; display: block; }
::selection { background: var(--yellow); color: var(--ink); }

/* Links: a highlighter swipe that fills in on hover */
a {
  color: var(--ink); text-decoration: none;
  background: linear-gradient(var(--yellow), var(--yellow)) left bottom / 100% .32em no-repeat;
  transition: background-size .15s ease;
}
a:hover { background-size: 100% 100%; }
:focus-visible { outline: 3px solid var(--plum); outline-offset: 3px; border-radius: 2px; }

.skip { position: absolute; left: -999px; top: 0; background: var(--yellow); color: var(--ink); padding: .5rem 1rem; z-index: 10; }
.skip:focus { left: 1rem; top: 1rem; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

h1, h2, h3, h4, .wordmark, .card-title, .button {
  font-family: var(--display);
  font-weight: 800;
  line-height: .98;
  letter-spacing: .005em;
  text-transform: uppercase;
}
h1 { font-size: clamp(2.6rem, 7.5vw, 5.25rem); margin: 0; }
h2 { font-size: clamp(2rem, 4.2vw, 3rem); margin: 0; }
h3 { font-size: 1.6rem; }
h4, h5 { font-size: 1.3rem; }

/* Bone letters with the hard shadow, as on the banner. Use on yellow or photos. */
.extrude {
  color: var(--bone); text-shadow: var(--extrude);
  /* thin ink outline round each letter, like the banner; paint-order keeps it outside the fill */
  -webkit-text-stroke: .055em var(--ink); paint-order: stroke fill;
}
/* Section titles on paper: ink letters on a yellow swipe */
.swipe { display: inline; padding: 0 .12em; background: linear-gradient(transparent 52%, var(--yellow) 52%, var(--yellow) 90%, transparent 90%); box-decoration-break: clone; -webkit-box-decoration-break: clone; }

/* Marker notes, like "Josh Koerpel, author" on the banner */
.note {
  font: 400 1.8rem/1.05 var(--hand); color: var(--ink);
  display: inline-flex; align-items: flex-end; gap: .35rem;
  transform: rotate(-3deg); text-transform: none; letter-spacing: 0;
}
.note svg { width: 2.6rem; height: 2.6rem; flex: none; }
.note--up svg { align-self: flex-start; }

/* Shared yellow band: grunge + halftone + torn bottom edge */
.band {
  position: relative; isolation: isolate;
  background: var(--grunge), var(--yellow);
  -webkit-mask: var(--torn); mask: var(--torn);
}
.band::before {
  content: ''; position: absolute; inset: 0; z-index: -1; background: var(--halftone);
  -webkit-mask: radial-gradient(ellipse 60% 90% at 88% 30%, #000 0 20%, transparent 70%);
  mask: radial-gradient(ellipse 60% 90% at 88% 30%, #000 0 20%, transparent 70%);
}

/* ---------- header / footer ---------- */
.site-head { background: var(--ink); color: var(--bone); }
.head-inner {
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: .5rem 1.5rem;
  max-width: var(--wide); margin: 0 auto; padding: .9rem var(--gutter);
}
.wordmark { font-size: 1.9rem; color: var(--yellow); background: none; letter-spacing: .01em; line-height: 1; }
.wordmark:hover { color: var(--bone); }
.site-head nav { display: flex; gap: 1.4rem; flex-wrap: wrap; }
.site-head nav a {
  font: 700 1.1rem var(--display); text-transform: uppercase; letter-spacing: .05em;
  color: var(--bone); background: none; padding: .3rem 0 .45rem;
}
.site-head nav a:hover { color: var(--yellow); }
.site-head nav a[aria-current="page"] {
  color: var(--yellow);
  background: url('/textures/underline.svg') left bottom / 100% .55rem no-repeat;
}

.site-foot { margin-top: 7rem; background: var(--ink); color: var(--bone); position: relative; }
.site-foot::before { /* torn top edge */
  content: ''; position: absolute; left: 0; right: 0; top: -13px; height: 14px; background: var(--ink);
  -webkit-mask: url('/textures/torn.svg') left top / 420px 14px repeat-x; mask: url('/textures/torn.svg') left top / 420px 14px repeat-x;
  transform: scaleY(-1);
}
.foot-inner {
  max-width: var(--wide); margin: 0 auto; padding: 3.5rem var(--gutter) 2.5rem;
  display: grid; grid-template-columns: 2.2fr 1fr 1fr; gap: 2rem 2.5rem;
}
.foot-big { margin: 0; font: 800 clamp(2.6rem, 6.5vw, 4.6rem)/.92 var(--display); text-transform: uppercase; color: var(--yellow); }
.foot-big .note { display: block; margin-top: .6rem; color: var(--bone); font-size: 2rem; }
.site-foot a { color: var(--bone); background-image: linear-gradient(var(--plum-soft), var(--plum-soft)); }
.site-foot a:hover { color: var(--ink); background-image: linear-gradient(var(--yellow), var(--yellow)); }
.site-foot nav { display: flex; flex-direction: column; gap: .5rem; align-items: flex-start; font: 700 1.15rem var(--display); text-transform: uppercase; letter-spacing: .05em; }
.foot-label { font: 400 1.55rem var(--hand); color: var(--yellow); margin: 0 0 .25rem; }
.foot-copy { grid-column: 1 / -1; margin: 1.5rem 0 0; padding-top: 1.25rem; border-top: 1px solid #3a333c; font: 600 .95rem var(--display); letter-spacing: .05em; text-transform: uppercase; color: #9d94a3; }

/* ---------- home ---------- */
.hero-banner { background: #f9cf02; -webkit-mask: var(--torn); mask: var(--torn); }
.hero-banner img { width: 100%; max-width: 1800px; margin: 0 auto; }

.masthead {
  max-width: var(--wide); margin: 0 auto; padding: 3rem var(--gutter) 0;
  display: grid; grid-template-columns: minmax(0, 44rem) auto; gap: 1rem 3rem; align-items: end;
}
.masthead .lede { margin: 0; font-size: clamp(1.35rem, 2.6vw, 1.75rem); line-height: 1.4; }
.masthead .lede strong { font-weight: 700; background: linear-gradient(transparent 55%, var(--yellow) 55%, var(--yellow) 92%, transparent 92%); }
.masthead .note { margin-bottom: .4rem; }

.home-stories, .home-shop, .said, .more, .index-body, .shop-list {
  max-width: var(--wide); margin: 0 auto; padding: 0 var(--gutter);
}
.home-stories { padding-top: 4.5rem; }
.section-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem 2rem; margin-bottom: 2.25rem; flex-wrap: wrap; }
.section-head h2 { margin: 0 !important; }
.section-head .note { margin-right: auto; margin-bottom: .2rem; }
.more-link { font: 700 1.1rem var(--display); text-transform: uppercase; letter-spacing: .05em; }

/* Story cards: duotone photos like the banner, colour on hover */
.cards { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(18rem, 1fr)); gap: 2.75rem 2rem; }
.card a { display: flex; flex-direction: column; background: none; height: 100%; }
.card-pic {
  position: relative; display: block; overflow: hidden; aspect-ratio: 3 / 2;
  background: var(--plum); border: 3px solid var(--ink); box-shadow: var(--drop);
  transition: transform .15s ease, box-shadow .15s ease;
}
.card-pic img { width: 100%; height: 100%; object-fit: cover; filter: url(#duotone); transition: transform .4s ease; }
.card-pic::after { /* print dots */
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(circle, rgb(27 16 41 / .35) 28%, transparent 34%) 0 0 / 5px 5px; mix-blend-mode: multiply; opacity: .55;
  transition: opacity .2s;
}
.card a:hover .card-pic { transform: translate(-3px, 3px); box-shadow: -3px 3px 0 var(--ink); }
.card a:hover .card-pic img { filter: none; transform: scale(1.03); }
.card a:hover .card-pic::after { opacity: 0; }
.card-meta { display: flex; gap: .75rem; align-items: center; margin: 1.15rem 0 .45rem; font: 700 .95rem var(--display); text-transform: uppercase; letter-spacing: .07em; color: var(--ink-soft); }
.card-cat { background: var(--ink); color: var(--bone); padding: .1rem .45rem; }
.card-title { font-size: 1.75rem; line-height: 1; }
.card a:hover .card-title { background: linear-gradient(transparent 50%, var(--yellow) 50%, var(--yellow) 92%, transparent 92%); box-decoration-break: clone; -webkit-box-decoration-break: clone; }
.card-desc { margin-top: .6rem; color: var(--ink-soft); font-size: 1.05rem; line-height: 1.5; }

/* Home: one big story, four small ones */
.cards--home { grid-template-columns: 1.5fr 1fr 1fr; gap: 2.5rem 2rem; }
.cards--home .card:first-child { grid-row: span 2; }
.cards--home .card:first-child .card-pic { aspect-ratio: 4 / 3; }
.cards--home .card:first-child .card-title { font-size: clamp(2rem, 3.4vw, 2.8rem); }
.cards--home .card:not(:first-child) .card-desc { display: none; }
.cards--home .card:not(:first-child) .card-title { font-size: 1.45rem; }

/* The short version: a plum band, like the photo's shadows */
.record {
  margin-top: 6rem; background: var(--plum); color: var(--bone); position: relative; isolation: isolate;
  -webkit-mask: var(--torn); mask: var(--torn);
}
.record::before {
  content: ''; position: absolute; inset: 0; z-index: -1;
  background: radial-gradient(circle, rgb(248 204 2 / .16) 30%, transparent 36%) 0 0 / 12px 12px,
    radial-gradient(circle, rgb(248 204 2 / .16) 30%, transparent 36%) 6px 6px / 12px 12px;
  -webkit-mask: radial-gradient(ellipse 50% 80% at 100% 0, #000, transparent 75%); mask: radial-gradient(ellipse 50% 80% at 100% 0, #000, transparent 75%);
}
.record-inner { max-width: var(--wide); margin: 0 auto; padding: 4rem var(--gutter) 4.5rem; }
.record h2 { color: var(--yellow); }
.record h2 .note { color: var(--bone); margin-left: .75rem; vertical-align: middle; font-size: 1.85rem; }
.record ol { list-style: none; margin: 2.5rem 0 2rem; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(19rem, 1fr)); gap: 2rem 3rem; counter-reset: fact; }
.record li { counter-increment: fact; display: grid; grid-template-columns: 3.4rem 1fr; gap: .9rem; line-height: 1.5; font-size: 1.1rem; }
.record li::before { content: counter(fact, decimal-leading-zero); font: 800 2.6rem/1 var(--display); color: var(--yellow); }
.record a { color: var(--bone); background-image: linear-gradient(var(--plum-soft), var(--plum-soft)); }
.record a:hover { color: var(--ink); background-image: linear-gradient(var(--yellow), var(--yellow)); }
.record p { margin: 0; }
.record .more-link { color: var(--bone); }

.home-shop { margin-top: 5.5rem; }
.home-shop h2, .said h2, .more h2 { margin-bottom: 2.25rem; }

/* Products: a sticker with the hard shadow */
.product { display: grid; grid-template-columns: 11rem 1fr; gap: 1.75rem; align-items: center; padding: 1.5rem; border: 3px solid var(--ink); background: #fff; max-width: 48rem; box-shadow: -10px 10px 0 var(--ink); margin-left: 10px; }
.product img { width: 100%; aspect-ratio: 1; object-fit: contain; background: var(--yellow-pale); border: 2px solid var(--ink); }
.product h3 { margin: 0 0 .4rem; font-size: 2rem; }
.product p { margin: 0 0 1.1rem; line-height: 1.5; }
.product-buy { display: flex; align-items: center; gap: 1.25rem; margin: 0 !important; }
.price { font: 800 1.6rem var(--display); }

.button {
  display: inline-block; background: var(--yellow); color: var(--ink);
  font-size: 1.25rem; letter-spacing: .04em; line-height: 1; padding: .8rem 1.25rem .75rem;
  border: 3px solid var(--ink); box-shadow: -5px 5px 0 var(--ink); margin-left: 5px;
  transition: transform .1s ease, box-shadow .1s ease;
}
.button:hover { background: var(--yellow); transform: translate(-3px, 3px); box-shadow: -2px 2px 0 var(--ink); }
.button:active { transform: translate(-5px, 5px); box-shadow: none; }

/* What people say: notes taped to the wall */
.said { margin-top: 6rem; }
.quotes { display: grid; grid-template-columns: repeat(auto-fit, minmax(18rem, 1fr)); gap: 2.5rem 2rem; }
.said blockquote {
  position: relative; margin: 0; padding: 2rem 1.6rem 1.5rem; background: #fff; border: 2px solid var(--ink);
  transform: rotate(-1.2deg);
}
.said blockquote:nth-child(2) { transform: rotate(1deg) translateY(.75rem); }
.said blockquote:nth-child(3) { transform: rotate(-.5deg); }
.said blockquote::before { /* tape */
  content: ''; position: absolute; top: -.85rem; left: 50%; width: 6.5rem; height: 1.6rem;
  transform: translateX(-50%) rotate(-3deg); background: rgb(248 204 2 / .8);
  clip-path: polygon(2% 8%, 98% 0, 100% 92%, 0 100%);
}
.said h3 { margin: 0 0 .75rem; font-size: 1.55rem; line-height: 1.02; }
.said blockquote p { font-size: 1.1rem; line-height: 1.5; font-style: italic; margin: 0 0 1rem; }
.said blockquote footer { font: 800 1.1rem var(--display); text-transform: uppercase; letter-spacing: .04em; }
.said blockquote footer span { display: block; font: 400 1.35rem/1.15 var(--hand); text-transform: none; letter-spacing: 0; color: var(--ink-soft); }

/* ---------- projects ---------- */
.proj-pic { display: block; position: relative; aspect-ratio: 16 / 10; overflow: hidden; background: var(--plum); border: 3px solid var(--ink); box-shadow: var(--drop); }
.proj-pic img { width: 100%; height: 100%; object-fit: cover; object-position: top; }
.proj-pic--tile { display: grid; place-items: center; padding: 1rem; background: var(--grunge), var(--yellow); }
.proj-pic--tile span { font: 800 clamp(1.6rem, 3vw, 2.4rem)/.95 var(--display); text-transform: uppercase; text-align: center; color: var(--bone); text-shadow: var(--extrude); -webkit-text-stroke: .055em var(--ink); paint-order: stroke fill; }

.home-projects { max-width: var(--wide); margin: 5.5rem auto 0; padding: 0 var(--gutter); }
.proj-grid { list-style: none; margin: 0; padding: 0 0 0 6px; display: grid; grid-template-columns: repeat(4, 1fr); gap: 2.5rem 1.75rem; }
@media (max-width: 60rem) { .proj-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 30rem) { .proj-grid { gap: 2rem 1.1rem; } .proj-name { font-size: 1.3rem; } .proj-tag { font-size: .95rem; } }
.proj-grid a { display: block; background: none; }
.proj-grid .proj-pic { transition: transform .15s ease, box-shadow .15s ease; }
.proj-grid a:hover .proj-pic { transform: translate(-3px, 3px); box-shadow: -3px 3px 0 var(--ink); }
.proj-name { display: block; margin-top: 1.1rem; font: 800 1.45rem/1 var(--display); text-transform: uppercase; }
.proj-grid a:hover .proj-name { background: linear-gradient(transparent 50%, var(--yellow) 50%, var(--yellow) 92%, transparent 92%); display: inline; }
.proj-tag { display: block; margin-top: .45rem; color: var(--ink-soft); font-size: 1.05rem; line-height: 1.45; }

.proj-list { max-width: var(--wide); margin: 0 auto; padding: 0 var(--gutter); display: grid; gap: 5rem; }
.proj { display: grid; grid-template-columns: 1.15fr 1fr; gap: 2.5rem 3rem; align-items: center; scroll-margin-top: 2rem; }
.proj:nth-child(even) .proj-shot { order: 2; }
.proj-shot { display: block; background: none; padding-left: 6px; }
.proj-text h2 { font-size: clamp(2.2rem, 4.4vw, 3.2rem); }
.proj-text p { margin: 0 0 1.1rem; line-height: 1.55; }
.proj-text .stamp { margin-bottom: 1rem; }
.proj-tagline { margin: .6rem 0 1.1rem !important; }
.proj-tagline .note { font-size: 1.55rem; transform: rotate(-2deg); }
@media (max-width: 48rem) {
  .proj { grid-template-columns: 1fr; gap: 1.75rem; }
  .proj:nth-child(even) .proj-shot { order: 0; }
}

/* ---------- page heads (stories index, shop, pages, 404) ---------- */
.index-head { margin-bottom: 3.5rem; }
.index-head-inner, .story-head-inner { max-width: var(--wide); margin: 0 auto; padding: clamp(2.75rem, 7vw, 4.75rem) var(--gutter) clamp(3rem, 6vw, 4.25rem); }
.index-head .lede { font-size: clamp(1.2rem, 2.2vw, 1.45rem); line-height: 1.45; max-width: 36rem; margin: 1.5rem 0 0; }
.index-head .note { margin-top: 1rem; }
.shop-list { display: grid; gap: 2.5rem; }

/* ---------- story ---------- */
.story-head .stamp, .stamp {
  display: inline-block; margin: 0 0 1.25rem; padding: .25rem .6rem .2rem; background: var(--ink); color: var(--bone);
  font: 800 1rem var(--display); text-transform: uppercase; letter-spacing: .08em; transform: rotate(-2deg);
}
.stamp:hover { background: var(--plum); color: var(--bone); }
.story-head h1 { max-width: 20ch; }
.story-date { margin: 1.5rem 0 0; font: 700 1.05rem var(--display); text-transform: uppercase; letter-spacing: .06em; }
.story-hero { max-width: var(--wide); margin: -1rem auto 3rem; padding: 0 var(--gutter); position: relative; z-index: 1; }
.story-hero img { width: 100%; max-height: 36rem; object-fit: cover; border: 3px solid var(--ink); box-shadow: -10px 10px 0 var(--ink); }
.story:not(:has(.story-hero)) .story-head { margin-bottom: 3rem; }

.toc { width: min(var(--measure), 100% - 2 * var(--gutter)); margin: 0 auto 2.75rem; border: 2px solid var(--ink); padding: .8rem 1.1rem; background: #fff; }
.toc summary { font: 800 1.15rem var(--display); text-transform: uppercase; letter-spacing: .05em; cursor: pointer; }
.toc ol { margin: .75rem 0 .25rem; padding-left: 1.4rem; font-size: 1.05rem; line-height: 1.5; }
.toc li + li { margin-top: .35rem; }

.prose { max-width: var(--measure); margin: 0 auto; padding: 0 var(--gutter); box-sizing: content-box; }
.prose > * { margin-top: 0; margin-bottom: 1.3rem; }
.prose > p.lead::first-letter {
  float: left; font: 800 4.6rem/.8 var(--display); color: var(--yellow);
  /* browsers ignore text-stroke on ::first-letter, so the outline is a ring of
     thin shadows, then the usual hard shadow down-left */
  text-shadow:
    .025em 0 0 var(--ink), -.025em 0 0 var(--ink), 0 .025em 0 var(--ink), 0 -.025em 0 var(--ink),
    .018em .018em 0 var(--ink), -.018em .018em 0 var(--ink), .018em -.018em 0 var(--ink), -.018em -.018em 0 var(--ink),
    var(--extrude);
  margin: .3rem .55rem 0 .3rem; text-transform: uppercase;
}
.prose h2 { margin: 3.5rem 0 1.1rem; scroll-margin-top: 1.5rem; font-size: clamp(1.9rem, 4vw, 2.5rem); }
.prose h2::before { content: ''; display: block; width: 3rem; height: .45rem; background: var(--yellow); margin-bottom: .9rem; border: 2px solid var(--ink); box-shadow: -3px 3px 0 var(--ink); }
.prose h3 { margin: 2.6rem 0 .75rem; scroll-margin-top: 1.5rem; font-size: 1.65rem; }
.prose h4, .prose h5 { margin: 2rem 0 .5rem; }
.prose ul, .prose ol { padding-left: 1.4rem; }
.prose ul { list-style: none; }
.prose ul > li { position: relative; }
.prose ul > li::before { content: ''; position: absolute; left: -1.25rem; top: .62em; width: .55rem; height: .55rem; background: var(--yellow); border: 2px solid var(--ink); }
.prose ol > li::marker { font: 800 1.1em var(--display); }
.prose li + li { margin-top: .4rem; }
.prose li > p { margin: 0; }
.prose img { margin: 2.25rem auto .6rem; border: 2px solid var(--ink); }
.prose p > img:only-child { margin-bottom: .6rem; }
.prose p.caption { font: 400 1.5rem/1.25 var(--hand); color: var(--ink-soft); margin-top: -.1rem; }
.prose p.caption em { font-style: normal; }
.prose blockquote { margin: 2.25rem 0; padding: .25rem 0 .25rem 1.4rem; border-left: 6px solid var(--yellow); font-style: italic; font-size: 1.25rem; line-height: 1.5; }
.prose hr { border: 0; height: 3.4rem; width: 7.4rem; margin: 3rem auto; background: url('/textures/dog.svg') center / contain no-repeat; }
.prose table { border-collapse: collapse; width: 100%; font-size: 1rem; }
.prose th { font: 800 1.05rem var(--display); text-transform: uppercase; letter-spacing: .04em; border-bottom: 3px solid var(--ink); }
.prose th, .prose td { border-bottom: 1px solid var(--rule); padding: .55rem; text-align: left; }
.prose strong { font-weight: 700; }

.embed { position: relative; aspect-ratio: 16 / 9; margin: 2.25rem 0; border: 3px solid var(--ink); box-shadow: var(--drop); }
.embed iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
iframe.podcast { width: 100%; height: 10.5rem; border: 0; margin: 1.5rem 0; }
.prose iframe:not(.podcast) { border: 0; }
.video { margin: 2.25rem 0; }
.video video, .video-link video { width: 100%; display: block; background: var(--ink); border: 3px solid var(--ink); }
.video-link { display: block; margin: 2rem 0 .5rem; background: none; }

.gallery { columns: 2 14rem; column-gap: .75rem; margin: 2.25rem 0; }
.gallery img { margin: 0 0 .75rem; width: 100%; break-inside: avoid; }

/* Carousel (set up by a small script on pages with galleries) */
.carousel { margin: 2.25rem 0; }
.carousel .gallery {
  columns: auto; display: flex; gap: 1rem; margin: 0; padding: 0 0 1rem 8px;
  overflow-x: auto; scroll-snap-type: x mandatory; overscroll-behavior-x: contain;
  scrollbar-width: thin; scrollbar-color: var(--ink) transparent;
}
.carousel .gallery img {
  flex: none; width: auto; max-width: none; height: clamp(15rem, 42vw, 22rem); margin: 0;
  object-fit: cover; scroll-snap-align: start; box-shadow: -6px 6px 0 var(--ink);
}
.carousel-ctl { display: flex; align-items: center; gap: .75rem; margin-top: .5rem; }
.carousel-ctl button {
  font: 800 1rem var(--display); color: var(--ink); background: var(--yellow); cursor: pointer;
  border: 2px solid var(--ink); box-shadow: -3px 3px 0 var(--ink); padding: .45rem .85rem; margin-left: 3px;
}
.carousel-ctl button:hover { background: var(--ink); color: var(--yellow); }
.carousel-ctl button:active { transform: translate(-3px, 3px); box-shadow: none; }
.carousel-count { font: 700 1rem var(--display); letter-spacing: .05em; color: var(--ink-soft); }

/* Lightbox */
.prose .gallery img { cursor: zoom-in; }
.lb-open { overflow: hidden; }
.lightbox {
  width: 100vw; height: 100dvh; max-width: none; max-height: none; margin: 0; padding: 0; border: 0;
  background: rgb(20 17 20 / .96); color: var(--bone);
  display: none; grid-template-rows: auto 1fr auto;
}
.lightbox[open] { display: grid; }
.lightbox::backdrop { background: rgb(20 17 20 / .7); }
.lb-top { display: flex; align-items: center; gap: 1rem; padding: .9rem var(--gutter); }
.lb-label { font: 400 1.6rem/1 var(--hand); color: var(--yellow); }
.lb-count { margin-left: auto; font: 700 1rem var(--display); letter-spacing: .06em; color: #b8afbd; }
.lb-stage { position: relative; display: flex; align-items: center; justify-content: center; min-height: 0; padding: 0 4.5rem; }
.lb-img { max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain; border: 3px solid var(--bone); box-shadow: -8px 8px 0 #000; user-select: none; }
.lightbox button { font: 800 1.05rem var(--display); color: var(--ink); background: var(--yellow); border: 2px solid var(--ink); cursor: pointer; }
.lightbox button:hover { background: var(--bone); }
.lb-close { width: 2.6rem; height: 2.6rem; box-shadow: -3px 3px 0 #000; }
.lb-nav { position: absolute; top: 50%; transform: translateY(-50%); width: 3rem; height: 3.6rem; box-shadow: -4px 4px 0 #000; }
.lb-prev { left: var(--gutter); }
.lb-next { right: var(--gutter); }
.lb-strip { display: flex; gap: .5rem; overflow-x: auto; padding: .9rem var(--gutter) 1.1rem; scrollbar-width: thin; scrollbar-color: var(--plum-soft) transparent; }
.lightbox .lb-strip button { flex: none; padding: 0; width: 4.5rem; height: 3.2rem; background: var(--plum); border: 2px solid transparent; opacity: .55; }
.lb-strip img { width: 100%; height: 100%; object-fit: cover; }
.lightbox .lb-strip button:hover { opacity: .9; }
.lightbox .lb-strip button[aria-current] { opacity: 1; border-color: var(--yellow); }
@media (max-width: 40rem) {
  .lb-stage { padding: 0 .5rem; }
  .lb-nav { top: auto; bottom: -3.2rem; transform: none; width: 2.6rem; height: 2.6rem; }
  .lb-top { padding-top: .7rem; }
  .lb-strip { padding-top: 3.8rem; }
  .lb-prev { left: .5rem; } .lb-next { right: .5rem; }
}
.page-photography .prose { max-width: var(--wide); }
.page-photography .gallery { columns: 3 15rem; }
.page-photography .gallery img { border-width: 2px; }

.story-shop { max-width: var(--measure); margin: 4rem auto 0; padding: 0 var(--gutter); box-sizing: content-box; }
.story-shop .product { grid-template-columns: 8rem 1fr; }

/* Author box: a duotone snapshot with a marker caption */
.author {
  width: min(var(--measure), 100% - 2 * var(--gutter)); margin: 4.5rem auto 0; padding-top: 2rem;
  display: grid; grid-template-columns: 6.5rem 1fr; gap: 1.6rem; align-items: start;
  border-top: 3px solid var(--ink);
}
.author figure { margin: 0; text-align: center; }
.author img { width: 6.5rem; height: 6.5rem; object-fit: cover; object-position: 50% 40%; border: 3px solid var(--ink); background: var(--yellow); filter: url(#duotone); transform: rotate(-3deg); box-shadow: -5px 5px 0 var(--ink); margin-left: 5px; }
.author figcaption { margin-top: .7rem; font: 400 1.4rem/1 var(--hand); transform: rotate(-4deg); white-space: nowrap; }
.author p { margin: .2rem 0 0; font-size: 1.05rem; line-height: 1.55; color: var(--ink-soft); }
.more { margin-top: 6rem; }

/* ---------- small screens ---------- */
@media (max-width: 52rem) {
  .cards--home { grid-template-columns: 1fr 1fr; }
  .cards--home .card:first-child { grid-column: 1 / -1; grid-row: auto; }
  .cards--home .card:first-child .card-pic { aspect-ratio: 3 / 2; }
  .foot-inner { grid-template-columns: 1fr 1fr; }
  .foot-big { grid-column: 1 / -1; }
}
@media (max-width: 40rem) {
  body { font-size: 1.125rem; }
  .head-inner { justify-content: center; padding-top: .8rem; padding-bottom: .6rem; }
  .wordmark { font-size: 1.75rem; }
  .site-head nav { gap: 1.1rem; justify-content: center; }
  .site-head nav a { font-size: 1.05rem; }
  .masthead { grid-template-columns: 1fr; padding-top: 2.25rem; }
  .masthead .note { justify-self: end; }
  .cards, .cards--home { grid-template-columns: 1fr; gap: 1.75rem; }
  .cards .card:not(:first-child) a, .index-body .cards .card a, .more .cards .card a { display: grid; grid-template-columns: 6.5rem 1fr; grid-template-areas: "pic meta" "pic title"; column-gap: 1rem; align-items: start; }
  .cards .card:not(:first-child) .card-pic, .index-body .cards .card .card-pic, .more .cards .card .card-pic { grid-area: pic; aspect-ratio: 1; border-width: 2px; box-shadow: -4px 4px 0 var(--ink); }
  .cards .card:not(:first-child) .card-meta, .index-body .cards .card .card-meta, .more .cards .card .card-meta { grid-area: meta; margin: 0 0 .35rem; font-size: .85rem; }
  .cards .card:not(:first-child) .card-title, .index-body .cards .card .card-title, .more .cards .card .card-title { grid-area: title; font-size: 1.35rem; }
  .cards .card:not(:first-child) .card-desc, .index-body .cards .card .card-desc, .more .cards .card .card-desc { display: none; }
  .product, .story-shop .product { grid-template-columns: 1fr; padding: 1.25rem; }
  .product img { max-width: 10rem; }
  .said blockquote:nth-child(2) { transform: rotate(1deg); }
  .story-hero img { box-shadow: -6px 6px 0 var(--ink); }
  .prose > p.lead::first-letter { font-size: 3.9rem; }
  .author { grid-template-columns: 5rem 1fr; gap: 1.1rem; }
  .author img { width: 5rem; height: 5rem; }
  .author figcaption { font-size: 1.2rem; }
  .author p { font-size: 1rem; }
}

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; }
}

/* ---------- /knots sales page ---------- */
.k-inner { max-width: var(--wide); margin: 0 auto; padding: 0 var(--gutter); }
.knots h2 { max-width: 22ch; }
.k-sub { font: 400 1.65rem/1.2 var(--hand); color: var(--ink-soft); margin: .75rem 0 0; }
.k-eyebrow { display: inline-block; margin: 0 0 1.1rem; padding: .25rem .6rem .2rem; background: var(--ink); color: var(--bone); font: 800 1rem var(--display); text-transform: uppercase; letter-spacing: .08em; transform: rotate(-2deg); }
.k-soon { display: inline-block; font: 800 .95rem var(--display); text-transform: uppercase; letter-spacing: .08em; color: var(--ink); background: var(--yellow-pale); border: 2px solid var(--ink); padding: .2rem .55rem; margin: 0; transform: rotate(2deg); }

.k-hero-band { margin-bottom: 0; }
.k-hero {
  max-width: var(--wide); margin: 0 auto; padding: clamp(2.5rem, 6vw, 4.5rem) var(--gutter) 4.5rem;
  display: grid; grid-template-columns: 1.15fr 1fr; gap: 2.5rem; align-items: center;
}
.k-hero h1 { font-size: clamp(2.6rem, 5.8vw, 4.4rem); }
.k-hero .k-sub { color: var(--ink); }
.k-benefits { list-style: none; padding: 0; margin: 1.75rem 0 2rem; }
.k-benefits li { position: relative; padding-left: 1.6rem; line-height: 1.45; }
.k-benefits li + li { margin-top: .55rem; }
.k-benefits li::before { content: ''; position: absolute; left: 0; top: .5em; width: .6rem; height: .6rem; background: var(--bone); border: 2px solid var(--ink); }
.k-buy-inline { display: flex; align-items: center; gap: 1.25rem; flex-wrap: wrap; }

.k-fan { position: relative; height: clamp(20rem, 42vw, 30rem); }
.k-fan img {
  position: absolute; left: 50%; bottom: 0; width: 40%; max-width: 13rem;
  transform-origin: 50% 110%;
  transform: translateX(calc(-50% + var(--i) * 18%)) rotate(calc(var(--i) * 11deg)) translateY(calc(abs(var(--i)) * .5rem));
  z-index: calc(10 - abs(var(--i)));
  filter: drop-shadow(-6px 6px 0 rgb(20 17 20 / .9));
}
@supports not (z-index: calc(10 - abs(1))) {
  .k-fan img { transform: translateX(calc(-50% + var(--i) * 18%)) rotate(calc(var(--i) * 11deg)); }
  .k-fan img[style*="--i:0"] { z-index: 3; }
}

.k-band { background: var(--plum); color: var(--bone); padding: 4rem 0 4.25rem; -webkit-mask: var(--torn); mask: var(--torn); }
.k-band h2 { color: var(--yellow); }
.k-band .k-sub { color: var(--bone); }
.k-situations { list-style: none; padding: 0; margin: 2rem 0 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); gap: .9rem 2.5rem; }
.k-situations li { position: relative; padding-left: 1.75rem; line-height: 1.45; }
.k-situations li::before { content: '\2713'; position: absolute; left: 0; top: 0; font: 800 1.2rem var(--display); color: var(--yellow); }
.k-band a { color: var(--bone); background-image: linear-gradient(var(--plum-soft), var(--plum-soft)); }

.k-problem { padding-top: 4rem; font-size: clamp(1.2rem, 2.2vw, 1.4rem); line-height: 1.5; }
.k-problem p { max-width: 38rem; }
.k-problem p:last-child { font: 800 clamp(1.8rem, 3.6vw, 2.5rem)/1.02 var(--display); text-transform: uppercase; }

.k-compare { margin-top: 4rem; display: grid; grid-template-columns: 1fr 1.4fr; gap: 3rem; align-items: start; }
.k-compare h2 span { background: linear-gradient(transparent 52%, var(--yellow) 52%, var(--yellow) 90%, transparent 90%); }
.k-old { padding: 1.5rem; border: 2px dashed var(--ink-soft); color: var(--ink-soft); transform: rotate(-1deg); }
.k-old h2 { color: var(--ink-soft); }
.k-old h2 span { background: none; text-decoration: line-through; text-decoration-thickness: 4px; text-decoration-color: var(--ink); }

.k-demo { margin: 1.5rem 0 0; border: 3px solid var(--ink); background: #fff; padding: 1rem; box-shadow: -8px 8px 0 var(--ink); margin-left: 8px; }
.k-frames { display: grid; gap: .75rem; }
.k-frames img { width: 100%; max-width: 30rem; margin: 0 auto; }
.k-demo.is-live .k-frames { gap: 0; }
.k-demo.is-live .k-frames img { grid-area: 1 / 1; transition: opacity .25s; }
.k-demo.is-live .k-frames img.is-off { opacity: 0; }
.k-demo:not(.is-live) .k-frames img.is-off { opacity: 1; }
.k-demo figcaption { margin-top: .75rem; font-size: 1rem; line-height: 1.45; min-height: 2.9em; }
.k-controls { display: flex; align-items: center; gap: .5rem; margin-top: .75rem; }
.k-controls button {
  font: 800 1rem var(--display); text-transform: uppercase; letter-spacing: .04em; color: var(--ink); background: var(--paper);
  border: 2px solid var(--ink); padding: .45rem .8rem; cursor: pointer; min-width: 3rem;
}
.k-controls .k-play { background: var(--yellow); min-width: 5.5rem; box-shadow: -3px 3px 0 var(--ink); }
.k-controls button:hover { background: var(--ink); color: var(--yellow); }
.k-count { margin-left: auto; font: 700 1rem var(--display); color: var(--ink-soft); }

.k-cards { margin-top: 5.5rem; margin-bottom: 5rem; }
.k-grid { list-style: none; padding: 0; margin: 2.5rem 0 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(10.5rem, 1fr)); gap: 2.25rem 1.5rem; }
.k-grid img { width: 62%; margin: 0 auto 1rem; filter: drop-shadow(-5px 5px 0 rgb(20 17 20 / .85)); }
.k-grid h3 { margin: 0 0 .3rem; font-size: 1.5rem; }
.k-grid p { margin: 0; font-size: 1rem; line-height: 1.45; color: var(--ink-soft); }

.k-uses { list-style: none; padding: 0; margin: 1.5rem 0; display: flex; flex-wrap: wrap; gap: .6rem; }
.k-uses li { font: 800 1.05rem var(--display); text-transform: uppercase; letter-spacing: .04em; color: var(--ink); background: var(--yellow); border: 2px solid var(--ink); padding: .3rem .8rem; }
.k-uses li:nth-child(odd) { transform: rotate(-1.5deg); }
.k-uses li:nth-child(even) { transform: rotate(1.5deg); }
.k-band p { max-width: 40rem; margin-bottom: 0; }

.k-close { margin-top: 5rem; }
.k-buy { margin: 2.5rem 0 0 10px; padding: 2rem; border: 3px solid var(--ink); background: #fff; max-width: 34rem; box-shadow: -10px 10px 0 var(--ink); }
.k-buy h2 { margin: .9rem 0 .35rem; }
.k-price { margin: 0 0 1rem; color: var(--ink-soft); }
.k-price .price { color: var(--ink); font-size: 2.2rem; margin-right: .4rem; }
.k-includes { columns: 2 12rem; padding-left: 1.2rem; margin: 0 0 1.75rem; font-size: 1.05rem; }
.k-buy p { margin-bottom: 0; }
.k-note { margin-top: 1.25rem !important; font-size: 1rem; color: var(--ink-soft); }
.is-knots .author { margin-top: 4.5rem; }

@media (max-width: 48rem) {
  .k-hero { grid-template-columns: 1fr; }
  .k-fan { order: -1; height: 14rem; }
  .k-fan img { width: 30%; max-width: 8.5rem; }
  .k-compare { grid-template-columns: 1fr; gap: 2rem; }
}
@media (max-width: 40rem) {
  .k-grid { grid-template-columns: repeat(2, 1fr); gap: 2rem 1rem; }
  .k-buy { padding: 1.4rem; }
}
