/* Kimmi Cooks: index cards in a travel sketchbook. Mobile first; no JavaScript needed; no external requests.
   Sprites are JPEGs on white, laid over the paper with mix-blend-mode: multiply. A multiply sprite that sticks out
   of its box must not sit inside a transformed (rotated) element, or its white background would show: that is why
   tape strips are siblings of the rotated card/photo, never children. */

@font-face { font-family: "Mali"; font-style: normal; font-weight: 400; font-display: swap; src: url(fonts/Mali-normal-400.ttf) format("truetype"); }
@font-face { font-family: "Mali"; font-style: normal; font-weight: 600; font-display: swap; src: url(fonts/Mali-normal-600.ttf) format("truetype"); }
@font-face { font-family: "Mali"; font-style: normal; font-weight: 700; font-display: swap; src: url(fonts/Mali-normal-700.ttf) format("truetype"); }
@font-face { font-family: "Cormorant Garamond"; font-style: italic; font-weight: 500; font-display: swap; src: url(fonts/CormorantGaramond-italic-500.ttf) format("truetype"); }

:root {
  --ink: #2b3050;
  --soft: #5f6482;        /* a touch darker than the print palette's #6a6f8c: 5.4:1 on paper */
  --terra: #b65a3a;
  --terra-deep: #9a4a2f;  /* terracotta for text and buttons: 5.6:1 on paper */
  --red: #b8323a;
  --paper: #fbf6ea;
  --card: #fffdf7;
  --note: #fff6cf;
  --rule: rgba(95, 100, 130, .22);
  --shadow: 0 1px 1px rgba(60, 40, 20, .1), 2px 5px 14px rgba(60, 40, 20, .2);
  --hand: "Mali", "Comic Sans MS", "Chalkboard SE", "Segoe Print", system-ui, sans-serif;
  --serif: "Cormorant Garamond", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  --wobble: 14px 18px 12px 20px / 18px 12px 20px 14px;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { overflow-x: clip; -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-top: 16px; }
body {
  margin: 0; color: var(--ink); background-color: var(--paper);
  /* faint dot grid of a sketchbook page */
  background-image: radial-gradient(rgba(43, 48, 80, .09) 1px, transparent 1.4px); background-size: 22px 22px;
  font: 400 1.0625rem/1.55 var(--hand); overflow-wrap: break-word;
}
img { max-width: 100%; height: auto; }
a { color: var(--terra-deep); text-underline-offset: .18em; text-decoration-thickness: .08em; }
a:hover { color: var(--ink); }
:focus-visible { outline: 3px solid var(--terra-deep); outline-offset: 3px; border-radius: 4px; }
h1, h2, h3, p, ul, ol, figure { margin: 0; }
ul[role="list"], ol[role="list"] { list-style: none; padding: 0; }

.skip { position: absolute; left: 8px; top: -80px; z-index: 10; padding: 10px 16px; background: var(--ink); color: #fff; border-radius: 8px; }
.skip:focus { top: 8px; color: #fff; }

/* ---------- frame ---------- */
.site-head, main, .site-foot { width: min(100% - 32px, 1120px); margin-inline: auto; }
.site-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0 6px; }
.brand { display: block; flex: none; border-radius: 8px; }
.brand img { display: block; width: auto; height: 58px; }
.site-head nav { display: flex; gap: 4px; }
.site-head nav a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 10px; color: var(--ink); font-weight: 600; text-decoration: none; position: relative; }
.site-head nav a::after { content: ""; position: absolute; left: 6px; right: 6px; bottom: 6px; height: 7px; background: url(sprites/line-1.jpg) center / 100% 100% no-repeat; mix-blend-mode: multiply; opacity: 0; }
.site-head nav a:hover::after, .site-head nav a[aria-current]::after { opacity: .6; }
main { padding: 18px 0 56px; }

.site-foot { border-top: 2px dashed var(--rule); padding: 22px 0 36px; color: var(--soft); font-size: .9375rem; }
.site-foot strong { color: var(--ink); font-weight: 700; }
.foot-brand span { font: italic 500 1.15rem var(--serif); }
.site-foot nav { display: flex; flex-wrap: wrap; gap: 0 18px; margin: 6px 0 4px -2px; }
.site-foot nav a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 2px; color: var(--ink); }

/* ---------- headings ---------- */
.page-title, .recipe-title h1 { font: 700 clamp(1.7rem, 6.4vw, 2.7rem)/1.16 var(--hand); letter-spacing: -.01em; position: relative; text-wrap: balance; }
h2 { font: 700 1.45rem/1.25 var(--hand); margin: 44px 0 18px; position: relative; display: table; }
h2::after { content: ""; position: absolute; left: -6px; right: -18px; bottom: -8px; height: 9px; background: url(sprites/line-1.jpg) center / 100% 100% no-repeat; mix-blend-mode: multiply; opacity: .55; }
.lead { font-size: 1.125rem; max-width: 40em; margin-top: 14px; }
.status { color: var(--soft); font-size: .9375rem; margin: 10px 0 22px; }

/* watercolour wash behind page titles */
.intro, .recipe-title { position: relative; }
.intro::before, .recipe-title::before, .prose::before { content: ""; position: absolute; left: -14px; top: -8px; width: min(96%, 620px); height: 86px; background: url(sprites/wash-ochre.jpg) center / 100% 100% no-repeat; mix-blend-mode: multiply; opacity: .5; pointer-events: none; }
.intro > *, .recipe-title > *, .prose > * { position: relative; }
.intro { padding-top: 8px; }
.prose::before { background-image: url(sprites/wash-green.jpg); }

/* ---------- chips ---------- */
.chips ul { display: flex; flex-wrap: wrap; gap: 10px; }
.chip { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 16px; background: var(--card); color: var(--ink); border: 2px solid var(--ink); border-radius: var(--wobble); font-weight: 600; text-decoration: none; }
.chip .count { font-weight: 400; color: var(--soft); font-size: .875rem; }
.chip:hover { background: var(--note); color: var(--ink); }
.chip[aria-current] { background: var(--ink); color: #fff; }
.chip[aria-current] .count { color: #dfe1ee; }

/* ---------- index cards ---------- */
.cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 30px 16px; padding-top: 12px; }
.cards > li { position: relative; display: flex; }
.card { display: flex; flex-direction: column; width: 100%; padding: 8px 8px 14px; background: var(--card); color: var(--ink); text-decoration: none; box-shadow: var(--shadow); border-radius: 3px; transition: transform .18s ease, box-shadow .18s ease; }
.cards > li:nth-child(4n+1) .card { transform: rotate(-1.1deg); }
.cards > li:nth-child(4n+2) .card { transform: rotate(.9deg); }
.cards > li:nth-child(4n+3) .card { transform: rotate(.6deg); }
.cards > li:nth-child(4n+4) .card { transform: rotate(-.8deg); }
.card:hover { color: var(--ink); }
@media (prefers-reduced-motion: no-preference) {
  .cards > li .card:hover, .cards > li .card:focus-visible { transform: rotate(0deg) translateY(-3px); box-shadow: 0 1px 1px rgba(60, 40, 20, .1), 3px 9px 20px rgba(60, 40, 20, .26); }
}
/* the strip of tape: a sibling drawn over the card (see note at the top) */
.cards > li::after { content: ""; position: absolute; top: -13px; left: 50%; width: 84px; height: 30px; margin-left: -42px; background: url(sprites/tape-yellow.jpg) center / 100% 100% no-repeat; mix-blend-mode: multiply; opacity: .92; transform: rotate(-3deg); pointer-events: none; }
.cards > li:nth-child(6n+2)::after { background-image: url(sprites/tape-green.jpg); transform: rotate(4deg); margin-left: -30px; }
.cards > li:nth-child(6n+3)::after { background-image: url(sprites/tape-terra.jpg); transform: rotate(-5deg); margin-left: -54px; }
.cards > li:nth-child(6n+4)::after { background-image: url(sprites/tape-indigo.jpg); transform: rotate(2deg); }
.cards > li:nth-child(6n+5)::after { background-image: url(sprites/tape-pink.jpg); transform: rotate(-2deg); margin-left: -34px; }
.cards > li:nth-child(6n+6)::after { background-image: url(sprites/tape-stripe.jpg); transform: rotate(5deg); margin-left: -50px; }
.card-photo { display: block; aspect-ratio: 4 / 3; overflow: hidden; background: #efe6d2; }
.card-photo img { display: block; width: 100%; height: 100%; object-fit: cover; }
.card-name { font: 700 1rem/1.28 var(--hand); margin: 10px 4px 0; padding-bottom: 1px; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; line-clamp: 3; overflow: hidden; }
.card-local { font: italic 500 1.125rem/1.2 var(--serif); color: var(--terra-deep); margin: 3px 4px 8px; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden; }
.card-place { margin: auto 4px 0; padding-top: 6px; border-top: 1px solid var(--rule); color: var(--soft); font-size: .8125rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; }
.card-count { text-transform: none; letter-spacing: 0; font-weight: 400; font-size: .9375rem; }

/* ---------- recipe page ---------- */
.recipe-head { display: grid; gap: 22px; }
.eyebrow { color: var(--soft); font-size: .8125rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; margin-bottom: 4px; }
.local { font: italic 500 1.6rem/1.2 var(--serif); color: var(--terra-deep); margin-top: 6px; }
.place { margin-top: 10px; padding-left: 26px; font-weight: 600; position: relative; }
.place::before { content: ""; position: absolute; left: 0; top: .1em; width: 19px; height: 25px; background: url(sprites/pin.jpg) center / contain no-repeat; mix-blend-mode: multiply; }
.place a { color: var(--ink); }

.photo { position: relative; margin: 6px 4px 0; }
.photo-frame { display: block; background: var(--card); padding: 8px; box-shadow: var(--shadow); transform: rotate(-.9deg); }
.photo-frame img { display: block; width: 100%; height: auto; }
.tape { position: absolute; width: 96px; height: 34px; background: center / 100% 100% no-repeat; mix-blend-mode: multiply; opacity: .92; pointer-events: none; }
.tape-a { left: -14px; top: -8px; transform: rotate(-26deg); background-image: url(sprites/tape-yellow.jpg); }
.tape-b { right: -14px; top: -4px; transform: rotate(22deg); background-image: url(sprites/tape-green.jpg); }

.what { font-size: 1.125rem; max-width: 36em; }
.facts { display: flex; flex-wrap: wrap; gap: 8px 22px; margin-top: 16px; font-weight: 600; }
.fact { display: flex; align-items: center; gap: 8px; min-height: 34px; }
.fact::before { content: ""; flex: none; width: 34px; height: 30px; background: center / contain no-repeat; mix-blend-mode: multiply; }
.fact-serves::before { background-image: url(sprites/plate.jpg); }
.fact-time::before { background-image: url(sprites/clock.jpg); }
.fact-heat::before { background-image: url(sprites/chili.jpg); }
.note { margin: 22px 4px 0; padding: 14px 18px; max-width: 26em; background: var(--note); box-shadow: 1px 3px 8px rgba(60, 40, 20, .2); transform: rotate(.8deg); font: italic 500 1.3rem/1.3 var(--serif); }
.sig { display: block; margin-top: 4px; text-align: right; font: 600 .9375rem var(--hand); color: var(--soft); }
.sig::before { content: "— "; }

/* ingredients: a ruled index card with tick boxes; every text line is exactly one rule high */
.ingredients { margin-top: 44px; padding: 18px 16px 22px; background: var(--card); box-shadow: var(--shadow); border-radius: 3px; border-top: 0; position: relative; }
.ingredients h2 { margin: 0 0 6px; display: block; padding-bottom: 12px; border-bottom: 2px solid rgba(184, 50, 58, .55); }
.ingredients h2::after { content: none; }
.checklist { --row: 2rem; line-height: var(--row); background: repeating-linear-gradient(to bottom, transparent 0, transparent calc(var(--row) - 1px), var(--rule) calc(var(--row) - 1px), var(--rule) var(--row)); }
.checklist li { break-inside: avoid; }
.checklist label { display: block; position: relative; padding-left: 34px; cursor: pointer; }
.checklist input { appearance: none; -webkit-appearance: none; position: absolute; left: 2px; top: calc((var(--row) - 20px) / 2); width: 20px; height: 20px; margin: 0; background: #fff; border: 2px solid var(--ink); border-radius: 4px 5px 3px 6px; cursor: pointer; }
.checklist input:checked { background: var(--ink); }
.checklist input:checked::after { content: ""; position: absolute; left: 4px; top: 0; width: 6px; height: 11px; border: solid #fff; border-width: 0 2.5px 2.5px 0; transform: rotate(40deg); }
.checklist input:checked + span { color: var(--soft); text-decoration: line-through; }

/* method */
.steps { counter-reset: step; display: grid; gap: 22px; max-width: 800px; }
.steps li { counter-increment: step; display: grid; grid-template-columns: 34px minmax(0, 1fr); gap: 12px; align-items: start; scroll-margin-top: 16px; }
.steps li.has-img { grid-template-columns: 34px minmax(0, 1fr) 92px; }
.steps li::before { content: counter(step); width: 34px; height: 34px; display: grid; place-items: center; background: var(--ink); color: #fff; border-radius: 50%; font: 700 1rem var(--hand); }
.steps p { padding-top: 3px; }
.step-img { display: block; width: 92px; height: auto; aspect-ratio: 1 / 1; object-fit: cover; background: var(--card); padding: 4px; box-shadow: 1px 2px 6px rgba(60, 40, 20, .25); }
.steps li:nth-child(odd) .step-img { transform: rotate(1.4deg); }
.steps li:nth-child(even) .step-img { transform: rotate(-1.2deg); }

/* tips: sticky notes */
.tips { display: grid; gap: 18px; }
.tip { padding: 14px 18px 16px; background: var(--note); box-shadow: 1px 3px 8px rgba(60, 40, 20, .2); }
.tip:nth-child(odd) { transform: rotate(-.5deg); }
.tip:nth-child(even) { transform: rotate(.6deg); }
.tip strong { display: block; font-weight: 700; margin-bottom: 2px; }
.tip:first-child strong { color: var(--red); }

/* buttons */
.actions { display: grid; gap: 12px; }
.btn { display: inline-flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 2px 10px; width: 100%; min-height: 52px; padding: 10px 20px; background: var(--card); color: var(--ink); border: 2px solid var(--ink); border-radius: var(--wobble); font-weight: 600; text-align: center; text-decoration: none; box-shadow: 2px 3px 0 rgba(43, 48, 80, .18); }
.btn small { font-weight: 400; font-size: .8125rem; color: var(--soft); }
.btn:hover { background: var(--note); color: var(--ink); }
.btn-primary { background: var(--terra-deep); border-color: var(--terra-deep); color: #fff; }
.btn-primary:hover { background: var(--ink); border-color: var(--ink); color: #fff; }
.intro .btn { width: auto; margin-top: 20px; }

.more { margin-top: 12px; }
.more h2 { margin-bottom: 22px; }

/* text pages */
.prose { max-width: 42em; position: relative; padding-top: 8px; }
.prose p, .prose address, .prose ul { margin-top: 12px; }
.prose address { font-style: normal; }
.prose ul { padding-left: 1.3em; }
.prose h2 { font-size: 1.25rem; margin: 34px 0 6px; }
.empty { margin-top: 12px; }

/* ---------- wider screens ---------- */
@media (min-width: 560px) {
  .steps li.has-img { grid-template-columns: 34px minmax(0, 1fr) 128px; gap: 16px; }
  .step-img { width: 128px; }
  .actions { display: flex; flex-wrap: wrap; }
  .actions .btn { width: auto; }
  .tips { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px; }
  .cards { gap: 36px 24px; }
  .card { padding: 10px 10px 16px; }
  .card-name { font-size: 1.125rem; }
}
@media (min-width: 760px) {
  .site-head, main, .site-foot { width: min(100% - 64px, 1120px); }
  .brand img { height: 76px; }
  .site-head nav a { font-size: 1.125rem; padding: 0 14px; }
  .cards { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 44px 30px; }
  .checklist { columns: 2; column-gap: 40px; }
  .ingredients { padding: 24px 28px 30px; }
  h2 { font-size: 1.65rem; }
}
@media (min-width: 900px) {
  .recipe-head { grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); grid-template-areas: "photo title" "photo meta"; grid-template-rows: auto 1fr; column-gap: 48px; row-gap: 20px; align-items: start; }
  .recipe-title { grid-area: title; padding-top: 10px; }
  .photo { grid-area: photo; margin-top: 14px; }
  .recipe-meta { grid-area: meta; }
  .recipe-title h1 { font-size: clamp(1.9rem, 3.1vw, 2.6rem); }
  .tape { width: 120px; height: 42px; }
}
@media (min-width: 1080px) {
  .cards { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}
