/* casual-chef.com — the ink design system.
 *
 * One colour of ink on one colour of paper, as if the whole site were written
 * out by hand with a cobalt nib. Every rule here exists to serve that: the
 * paper grain, the nib wobble on display type, the dotted leaders, the
 * single-stroke drawings.
 *
 * Owned by tools/build_casual_chef.py — that script writes every page and links
 * this file. Bump the ?v= on the link in the builder when this changes, and read
 * the "?v= bump can be poisoned by the rolling update" gotcha in CLAUDE.md
 * before trusting the bump: css is served max-age=604800.
 *
 * The old WordPress stylesheets (foodie-world.css, blocks.css, theme-fonts.css)
 * are no longer linked by any generated page. theme-fonts.css was also loading
 * Montserrat over plain http from an old WP host, which an https page blocks as
 * mixed content — so Montserrat never actually arrived. The three faces below
 * are self-hosted instead: latin-only, variable where the family offers it,
 * ~121KB for the set, no third-party font request and nothing for a CDN to log.
 */

/* ---------------------------------------------------------------- fonts */

@font-face {
  font-family: 'Caveat';
  src: url('/fonts/caveat-latin-var.woff2') format('woff2-variations'),
       url('/fonts/caveat-latin-var.woff2') format('woff2');
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Montserrat';
  src: url('/fonts/montserrat-latin-var.woff2') format('woff2-variations'),
       url('/fonts/montserrat-latin-var.woff2') format('woff2');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Courier Prime';
  src: url('/fonts/courierprime-latin-400.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

/* ---------------------------------------------------------------- tokens */

:root {
  --paper: #e7e2d2;
  --paper-deep: #ded8c5;
  --ink: #24329b;
  --ink-mid: rgba(36, 50, 155, .62);
  --ink-soft: rgba(36, 50, 155, .34);
  --ink-faint: rgba(36, 50, 155, .16);

  --f-script: 'Caveat', 'Segoe Script', cursive;
  --f-sans: 'Montserrat', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  --f-mono: 'Courier Prime', ui-monospace, 'SFMono-Regular', Menlo, monospace;

  --gutter: clamp(1.25rem, 4vw, 4.5rem);
  --measure: 62ch;
  --rule: 1px solid var(--ink-faint);
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background-color: var(--paper);
  color: var(--ink);
  font-family: var(--f-sans);
  font-weight: 300;
  line-height: 1.6;
  /* Paper grain. An inline SVG turbulence rather than a raster tile: it is
     ~400 bytes, resolution-independent, and cannot be mistaken for content by
     an image crawler. Kept very low-contrast — it should be felt, not seen. */
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='g'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='180' height='180' filter='url(%23g)' opacity='.055'/%3E%3C/svg%3E");
  background-repeat: repeat;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; }

a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { text-decoration-style: dotted; }

.sr {
  position: absolute; width: 1px; height: 1px; padding: 0;
  margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.skip {
  position: absolute; left: -9999px; top: 0;
  font-family: var(--f-mono); font-size: .8rem; padding: .6rem 1rem;
  background: var(--paper); border: 1px solid var(--ink); z-index: 50;
}
.skip:focus { left: var(--gutter); top: .5rem; }

/* ---------------------------------------------------------------- ink effect
 *
 * The nib wobble. feTurbulence + feDisplacementMap pushes each edge off true by
 * a couple of pixels, which is what separates "a script font" from "written by
 * hand". Applied ONLY to large display type and the drawings — on body copy the
 * displacement eats the stem contrast and the text reads as damp. */

.ink-wobble { filter: url('#cc-nib'); }

@media (prefers-reduced-motion: reduce) {
  /* The filter is static, so this is not about motion — but users who ask for
     reduced effects generally want fewer of them, and the type is cleaner without. */
  .ink-wobble { filter: none; }
}

/* ---------------------------------------------------------------- type */

.script {
  font-family: var(--f-script);
  font-weight: 500;
  line-height: .92;
  letter-spacing: .005em;
}

.brush {
  font-family: var(--f-script);
  font-weight: 700;
  line-height: .86;
  font-size: clamp(3rem, 9vw, 6.5rem);
  margin: 0;
}

/* A recipe title is three or four words, not one, so it needs a smaller size
   than a standalone brush word or it takes four lines in a grid column. */
.brush--tight { font-size: clamp(2.4rem, 5vw, 4.25rem); line-height: .92; }

.display {
  font-family: var(--f-sans);
  font-weight: 200;
  letter-spacing: .13em;
  text-transform: uppercase;
  font-size: clamp(1.9rem, 5.5vw, 3.4rem);
  line-height: 1.05;
  margin: 0;
}

.label {
  font-family: var(--f-mono);
  font-size: clamp(.66rem, 1.5vw, .78rem);
  letter-spacing: .22em;
  text-transform: uppercase;
  margin: 0;
}

.hand {
  font-family: var(--f-script);
  font-weight: 400;
  font-size: clamp(1.35rem, 2.6vw, 1.75rem);
  line-height: 1.35;
}

/* ---------------------------------------------------------------- masthead */

.masthead {
  padding: clamp(2.5rem, 7vw, 5rem) var(--gutter) clamp(1.5rem, 4vw, 3rem);
  text-align: center;
}

.masthead__mark {
  width: clamp(150px, 22vw, 260px);
  margin: 0 auto clamp(.25rem, 1vw, .75rem);
  display: block;
}

.masthead__wordmark {
  font-size: clamp(4rem, 15vw, 9.5rem);
  margin: 0;
  /* Caveat's ascenders and descenders are long; without the negative top the
     wordmark floats a long way below the drawing it belongs to. */
  margin-top: -.12em;
}

.masthead__rule {
  border: 0; border-top: var(--rule);
  width: min(30ch, 70%); margin: clamp(1rem, 3vw, 1.75rem) auto;
}

.masthead__meta > * + * { margin-top: .45rem; }

.masthead__nav {
  margin-top: clamp(1.25rem, 3vw, 2rem);
  display: flex; flex-wrap: wrap; gap: .5rem clamp(1rem, 3vw, 2.25rem);
  justify-content: center;
  font-family: var(--f-mono);
  font-size: .74rem; letter-spacing: .2em; text-transform: uppercase;
}
.masthead__nav a { text-decoration: none; border-bottom: 1px solid var(--ink-soft); padding-bottom: 2px; }
.masthead__nav a:hover, .masthead__nav a:focus-visible { border-bottom-color: var(--ink); }

/* ---------------------------------------------------------------- poster grid
 *
 * The reference is a poster: blocks sit at deliberate, slightly-off positions
 * rather than in a tidy column. Built as a grid with per-item offsets instead of
 * absolute positioning, so it still reflows on a narrow screen — the offsets are
 * dropped below 900px, where they would only cause overlap. */

.poster {
  padding: 0 var(--gutter) clamp(3rem, 8vw, 6rem);
  max-width: 1180px; margin: 0 auto;
}

/* Rhythm between blocks. Set on the container rather than on each block so a new
   section added by the builder inherits it without a matching CSS rule. */
.poster > * + * { margin-top: clamp(2.75rem, 8vw, 6rem); }

.poster__row {
  display: grid;
  gap: clamp(1.75rem, 5vw, 3.5rem);
  align-items: start;
}

@media (min-width: 900px) {
  .poster__row--split { grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); }
  .poster__row--offset-right > :last-child { margin-top: clamp(2rem, 6vw, 5rem); }
  .poster__row--offset-left > :first-child { margin-top: clamp(1.5rem, 4vw, 3rem); }
}

/* ---------------------------------------------------------------- leaders
 *
 * "CHICKPEA SALAD..........SALAD". Typed dots would wrap mid-run and break the
 * line, so the run is a flex spacer with a dotted bottom border: same look, and
 * it cannot wrap wrongly however long the name is. */

.index { margin: 0; padding: 0; list-style: none; }

.index__item + .index__item { margin-top: .1rem; }

.leader {
  display: flex; align-items: baseline; gap: .55rem;
  font-family: var(--f-mono);
  font-size: clamp(.72rem, 1.7vw, .84rem);
  letter-spacing: .12em; text-transform: uppercase;
  padding: .5rem 0;
  text-decoration: none;
  border-bottom: 1px solid transparent;
}
.leader:hover, .leader:focus-visible { border-bottom-color: var(--ink-faint); }
.leader:hover .leader__name, .leader:focus-visible .leader__name { text-decoration: underline; text-underline-offset: 4px; }

.leader__name { flex: 0 1 auto; }
.leader__dots {
  flex: 1 1 2rem; min-width: 1.5rem;
  border-bottom: 1px dotted var(--ink-soft);
  transform: translateY(-.3em);
}
.leader__kind { flex: 0 0 auto; color: var(--ink-mid); }

/* ---------------------------------------------------------------- photo */

.plate { margin: 0; }
.plate img {
  display: block; width: 100%;
  /* No rounding and no shadow: it is a photograph laid on paper, not a card. */
  filter: saturate(.92) contrast(1.02);
}
.plate figcaption {
  font-family: var(--f-mono); font-size: .68rem; letter-spacing: .16em;
  text-transform: uppercase; color: var(--ink-mid);
  margin-top: .6rem;
}

/* ---------------------------------------------------------------- hand note */

.note {
  max-width: 34ch;
  transform: rotate(-1.1deg);
  transform-origin: left top;
  color: var(--ink);
}

@media (min-width: 900px) {
  /* Indented and held narrow, the way a note written in a margin sits — the
     reference's handwritten block is a column, not a full-width paragraph. */
  .note { margin-left: clamp(0rem, 6vw, 5rem); max-width: 40ch; }
}
.note > p { margin: 0 0 .7em; }
.note > p:last-child { margin-bottom: 0; }

/* ---------------------------------------------------------------- drawings */

.vessel { width: clamp(140px, 26vw, 300px); display: block; }

.drawn { display: block; width: 100%; height: auto; }

/* ---------------------------------------------------------------- recipe page
 *
 * The one place the site stops being a poster and becomes something you read
 * standing up with your hands full. Measure is tight, steps are numbered large
 * enough to find again after looking away, and nothing here is decorative. */

.cc-post { max-width: 62ch; }

.cc-hero { margin: clamp(1.5rem, 4vw, 2.5rem) 0; }

/* The prose above the recipe. Script at reading size for two or three
   paragraphs is fine and is the site's voice; the recipe itself drops to the
   mono/sans below, because that is the part read at a glance mid-task. */
/* Smaller than the landing page's note. That one is three lines of voice and can
   afford to be big; this is 150-odd words of explanation, and at the note's size
   it pushed the actual ingredients below a second screen. */
.cc-body {
  max-width: 48ch;
  font-size: clamp(1.1rem, 1.8vw, 1.3rem);
  line-height: 1.45;
}
.cc-body > p { margin: 0 0 .7em; }
.cc-body > p:last-child { margin-bottom: 0; }

.cc-recipe {
  margin-top: clamp(2rem, 5vw, 3rem);
  padding-top: clamp(1.5rem, 4vw, 2.25rem);
  border-top: var(--rule);
  font-family: var(--f-sans);
  font-size: 1rem;
  line-height: 1.65;
}

.cc-h {
  font-family: var(--f-sans);
  font-weight: 200; letter-spacing: .13em; text-transform: uppercase;
  font-size: clamp(1.1rem, 2.4vw, 1.4rem);
  margin: 1.75rem 0 .6rem;
}
.cc-recipe > .cc-h:first-of-type { margin-top: 0; }

/* Times and yield. A definition list because that is what it is — and it is
   what a screen reader announces usefully, unlike a row of divs. */
.cc-meta {
  display: flex; flex-wrap: wrap; gap: 1.25rem 2.25rem;
  margin: 0 0 1.75rem; padding: 0;
}
.cc-meta > div { margin: 0; }
.cc-meta dt {
  font-family: var(--f-mono); font-size: .66rem; letter-spacing: .2em;
  text-transform: uppercase; color: var(--ink-mid); margin: 0 0 .15rem;
}
.cc-meta dd { margin: 0; font-size: 1.05rem; }

.cc-ing-group {
  font-family: var(--f-mono); font-size: .7rem; letter-spacing: .18em;
  text-transform: uppercase; color: var(--ink-mid);
  margin: 1.25rem 0 .4rem;
}

.cc-ing { margin: 0 0 .5rem; padding: 0; list-style: none; }
.cc-ing li {
  padding: .4rem 0 .4rem 1.35rem;
  border-bottom: 1px dotted var(--ink-faint);
  position: relative;
}
.cc-ing li::before {
  /* A short dash, as you would write down a list.
     This was a two-border box rotated -45deg, intended as a tick. It read as a
     dropdown chevron instead — wrong shape, and wrong meaning next to text. A
     dash cannot be mistaken for a control. */
  content: ""; position: absolute; left: 0; top: 1.15em;
  width: .7rem; height: 0;
  border-top: 1.5px solid var(--ink-soft);
}

.cc-steps { margin: 0; padding-left: 0; list-style: none; counter-reset: step; }
.cc-steps li {
  counter-increment: step;
  position: relative;
  padding: 0 0 1.1rem 2.6rem;
}
.cc-steps li::before {
  content: counter(step);
  position: absolute; left: 0; top: -.1em;
  font-family: var(--f-script); font-weight: 700;
  font-size: 1.9rem; line-height: 1; color: var(--ink-soft);
}
.cc-steps strong { font-weight: 500; }
/* Deep-linked from the HowToStep URLs in the Recipe schema, so landing on one
   has to make it obvious which step you were sent to. */
.cc-steps li:target::before { color: var(--ink); }
.cc-steps li:target { background: var(--paper-deep); border-radius: 3px; }

.cc-notes { margin: 0; padding-left: 1.1rem; }
.cc-notes li { margin-bottom: .5rem; }

.cc-related {
  margin-top: clamp(2.5rem, 6vw, 4rem);
  padding-top: clamp(1.5rem, 4vw, 2rem);
  border-top: var(--rule);
}

/* ---------------------------------------------------------------- footer */

.foot {
  border-top: var(--rule);
  padding: clamp(2rem, 5vw, 3.5rem) var(--gutter) 1.5rem;
  text-align: center;
}
.foot__addr { font-style: normal; }
.foot__addr > * + * { margin-top: .4rem; }

.dt-social {
  display: flex; justify-content: center; gap: 1.25rem;
  margin: 1.5rem 0 0; padding: 0; list-style: none;
}
.dt-social a { display: inline-flex; color: inherit; opacity: .7; transition: opacity .15s ease; }
.dt-social a:hover, .dt-social a:focus-visible { opacity: 1; }
.dt-social svg { width: 18px; height: 18px; display: block; flex-shrink: 0; }

/* The injector-owned credit block. Restyled to the paper, not re-authored — the
   markup must stay byte-identical to what tools/inject-credit.js emits. */
.dt-credit { border-color: var(--ink-faint) !important; opacity: .8 !important; }
.dt-credit a { color: var(--ink) !important; }
