/* Self-hosted variable fonts (latin subset).
   Fraunces: display serif for headings, brand, and card titles.
   Public Sans: body and UI text, with a true italic.
   Caveat: handwritten accents (margin notes, recipe-card scribbles). */
@font-face {
  font-family: "Fraunces";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("/assets/fraunces-latin-2a0ad122.woff2") format("woff2");
}

@font-face {
  font-family: "Public Sans";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("/assets/public-sans-latin-217759bd.woff2") format("woff2");
}

@font-face {
  font-family: "Public Sans";
  font-style: italic;
  font-weight: 100 900;
  font-display: swap;
  src: url("/assets/public-sans-italic-latin-5c4d741c.woff2") format("woff2");
}

@font-face {
  font-family: "Caveat";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("/assets/caveat-latin-0aa453d2.woff2") format("woff2");
}

:root {
  /* The site is light-only by design; keep UA form controls and scrollbars light too. */
  color-scheme: light;
  --color-bg: #faf7f0;
  --color-bg-alt: #f2ecdf;
  --color-text: #4a3f35;
  --color-text-muted: #7b7060;
  --color-accent: #8a2e3b;
  --color-accent-hover: #6c2330;
  --color-accent-alt: #5f6b3c;
  --color-accent-alt-soft: #edefdf;
  --color-border: #e0d8c7;
  --color-success: #4a7c4e;
  --color-error: #b54a4a;
  --color-success-soft: #f2f5ea;
  --color-error-soft: #f9efec;
  --color-paper: #fffdf6;
  --color-ink-pen: #35507a;
  --color-card-line: #cfdfec;
  --color-card-margin: #e8b9b9;
  --color-paper-border: #e6ddc8;
  --color-tape: rgba(233, 214, 155, 0.55);
  --color-postit: #f9eca6;
  --color-postit-deep: #f4e28f;
  --color-postit-ink: #5a4a1f;
  --color-clipping: #f6ecd4;
  --color-clipping-border: #e0d3ae;
  --color-clipping-ink: #8a7b56;
  --font-body: "Public Sans", system-ui, -apple-system, sans-serif;
  --font-heading: "Fraunces", Georgia, "Times New Roman", serif;
  --font-hand: "Caveat", "Bradley Hand", "Segoe Script", cursive;

  /* Type scale */
  --text-caption: 0.8125rem;
  --text-sm: 0.875rem;
  --text-base: 1rem;
  --text-lg: 1.125rem;
  --text-xl: 1.25rem;
  --text-2xl: 1.5rem;
  --text-3xl: 2.25rem;
  --weight-heading: 560;
  --tracking-heading: -0.015em;
  --tracking-caption: 0.015em;

  --max-width: 72rem;
  --max-width-narrow: 48rem;
  --spacing: 1rem;
}

* {
  box-sizing: border-box;
}

body {
  font-family: var(--font-body);
  font-size: var(--text-base);
  font-weight: 400;
  background: var(--color-bg);
  color: var(--color-text);
  line-height: 1.6;
  margin: 0;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

/* Page frame: chrome (header border, footer gingham) bleeds full-width;
   content sits in centered containers. */
.container {
  width: 100%;
  max-width: var(--max-width);
  margin-inline: auto;
  padding-inline: var(--spacing);
}

.page-body {
  flex: 1 0 auto;
  width: 100%;
  max-width: var(--max-width);
  margin-inline: auto;
  padding: calc(var(--spacing) * 2) var(--spacing) 0;
}

.skip-link {
  position: absolute;
  left: 1rem;
  top: -3rem;
  z-index: 10;
  background: var(--color-accent);
  color: white;
  border-radius: 0 0 0.375rem 0.375rem;
  padding: 0.5rem 1rem;
  font-size: var(--text-sm);
}

.skip-link:focus-visible {
  top: 0;
  color: white;
  text-decoration: none;
}

h1, h2, h3 {
  font-family: var(--font-heading);
  font-weight: var(--weight-heading);
  letter-spacing: var(--tracking-heading);
  line-height: 1.2;
  color: var(--color-text);
}

h1 {
  font-size: var(--text-3xl);
  margin-bottom: 1.5rem;
}

h2 {
  font-size: var(--text-2xl);
  margin-top: 2rem;
  margin-bottom: 1rem;
}

a {
  color: var(--color-accent);
  text-decoration: none;
}

a:hover {
  color: var(--color-accent-hover);
  text-decoration: underline;
}

/* Gingham hem along the very top of the page: the kitchen-towel edge,
   thinner and subtler than the footer strip. */
.page-hem {
  height: 8px;
  background:
    repeating-linear-gradient(0deg, rgba(138, 46, 59, 0.1) 0 4px, transparent 4px 8px),
    repeating-linear-gradient(90deg, rgba(138, 46, 59, 0.1) 0 4px, transparent 4px 8px),
    var(--color-bg);
  border-bottom: 1px solid var(--color-border);
}

/* Navigation */
.site-header {
  border-bottom: 1px solid var(--color-border);
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--spacing);
  padding-block: 1rem;
}

.site-nav a {
  color: var(--color-text);
}

.site-nav a:hover {
  color: var(--color-accent);
  text-decoration: none;
}

.site-nav a[aria-current="page"] {
  color: var(--color-accent);
  font-weight: 500;
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 6px;
}

.nav-brand {
  font-family: var(--font-heading);
  font-size: var(--text-xl);
  font-weight: 600;
  letter-spacing: var(--tracking-heading);
}

.site-nav .nav-brand {
  color: var(--color-accent);
}

.site-nav .nav-brand:hover {
  color: var(--color-accent-hover);
}

.nav-sep {
  width: 1px;
  height: 1.05rem;
  background: var(--color-border);
}

.site-nav form {
  display: inline;
}

.nav-user {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: var(--spacing);
}

/* Uitloggen is the exit, not the destination: a quiet text control. */
.nav-user button {
  background: none;
  border: none;
  padding: 0;
  color: var(--color-text-muted);
  font-size: inherit;
  cursor: pointer;
}

.nav-user button:hover {
  background: none;
  color: var(--color-accent);
}

.site-nav .nav-toggle {
  display: none;
  margin-left: auto;
  align-items: center;
  gap: 0.45rem;
  background: transparent;
  color: var(--color-text);
  border: 1px solid var(--color-border);
  border-radius: 0.375rem;
  padding: 0.4rem 0.7rem;
  font-size: var(--text-sm);
  line-height: 1;
  cursor: pointer;
}

.site-nav .nav-toggle:hover {
  background: var(--color-bg-alt);
  color: var(--color-text);
}

.site-nav .nav-toggle svg {
  display: block;
}

.nav-menu {
  display: contents;
}

/* Flash messages: small paper notes with a semantic edge. The message
   text stays warm ink; only the bar and dot carry the semantic color. */
.notice,
.alert {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  background: var(--color-success-soft);
  border: 1px solid var(--color-border);
  border-left: 3px solid var(--color-success);
  border-radius: 0.375rem;
  color: var(--color-text);
  padding: 0.7rem 0.9rem;
  margin: 0 0 var(--spacing);
  box-shadow: 0 2px 8px rgba(74, 63, 53, 0.08);
}

.notice::before,
.alert::before {
  content: "✓";
  flex-shrink: 0;
  width: 1.15rem;
  height: 1.15rem;
  margin-top: 0.2rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  font-weight: 700;
  color: white;
  background: var(--color-success);
}

.flash-message {
  flex: 1;
}

/* Scoped under .notice/.alert to outrank the global button[type="button"] rule. */
.notice .flash-dismiss,
.alert .flash-dismiss {
  background: none;
  border: none;
  padding: 0 0.1rem;
  font-size: var(--text-base);
  line-height: 1.3;
  color: var(--color-text-muted);
  cursor: pointer;
}

.notice .flash-dismiss:hover,
.alert .flash-dismiss:hover {
  background: none;
  color: var(--color-text);
}

.notice.copyable {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.notice.copyable span {
  flex: 1;
  word-break: break-all;
}

.notice.copyable button {
  background: transparent;
  border: none;
  padding: 0.25rem;
  cursor: pointer;
  font-size: 1rem;
  opacity: 0.7;
}

.notice.copyable button:hover {
  opacity: 1;
  background: transparent;
}

.alert {
  background: var(--color-error-soft);
  border-left-color: var(--color-error);
}

.alert::before {
  content: "!";
  background: var(--color-error);
}

/* Forms */
.field {
  margin-bottom: 1rem;
}

.field label {
  display: block;
  font-weight: 500;
  margin-bottom: 0.25rem;
}

input, textarea, select {
  font-family: inherit;
  font-size: inherit;
  padding: 0.5rem;
  border: 1px solid var(--color-border);
  border-radius: 0.25rem;
  width: 100%;
  background: white;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

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

input[type="number"] {
  width: auto;
}

.input-with-prefix {
  display: flex;
  align-items: stretch;
}

.input-prefix {
  background: var(--color-bg-alt);
  border: 1px solid var(--color-border);
  border-right: none;
  border-radius: 0.25rem 0 0 0.25rem;
  padding: 0.5rem;
  color: var(--color-text-muted);
  font-family: monospace;
}

.input-with-prefix input {
  border-radius: 0 0.25rem 0.25rem 0;
  font-family: monospace;
}

input[type="file"] {
  padding: 0.25rem;
}

button, input[type="submit"], a.button {
  background: var(--color-accent);
  color: white;
  border: none;
  padding: 0.5rem 1rem;
  border-radius: 0.25rem;
  cursor: pointer;
  font-family: inherit;
  font-size: inherit;
  text-decoration: none;
  display: inline-block;
}

button:hover, input[type="submit"]:hover, a.button:hover {
  background: var(--color-accent-hover);
  color: white;
}

button[type="button"] {
  background: var(--color-bg-alt);
  color: var(--color-text);
  border: 1px solid var(--color-border);
}

button[type="button"]:hover {
  background: var(--color-border);
}

/* Fieldset */
fieldset {
  border: 1px solid var(--color-border);
  border-radius: 0.5rem;
  padding: var(--spacing);
  margin-bottom: 1rem;
}

legend {
  font-family: var(--font-heading);
  font-weight: 600;
  letter-spacing: var(--tracking-heading);
  padding: 0 0.5rem;
}

/* Ingredient fields */
.ingredient-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.ingredient-fields {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.4rem 0;
  margin: 0;
  border-bottom: 1px solid var(--color-bg-alt);
}

.ingredient-fields:first-child {
  border-top: 1px solid var(--color-bg-alt);
}

.ingredient-fields::before {
  content: "";
  width: 0.4rem;
  height: 0.4rem;
  border-radius: 50%;
  background: var(--color-accent-alt);
  opacity: 0.55;
  flex-shrink: 0;
}

.ingredient-fields input[type="text"] {
  flex: 1;
  min-width: 0;
}

button.ingredient-remove {
  background: transparent;
  border: none;
  color: var(--color-text-muted);
  font-size: var(--text-caption);
  padding: 0.35rem 0.5rem;
  white-space: nowrap;
}

button.ingredient-remove:hover {
  color: var(--color-error);
  background: color-mix(in srgb, var(--color-error) 7%, transparent);
}

.ingredient-foot {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  margin-top: 1rem;
}

.kbd-hint {
  font-size: var(--text-caption);
  letter-spacing: var(--tracking-caption);
  color: var(--color-text-muted);
}

.kbd-hint kbd {
  font-family: inherit;
  font-size: 0.75rem;
  background: var(--color-bg-alt);
  border: 1px solid var(--color-border);
  border-bottom-width: 2px;
  border-radius: 0.25rem;
  padding: 0 0.4rem;
}

/* Portion controls */
.portion-controls {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.portion-controls button {
  width: 2rem;
  height: 2rem;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  line-height: 1;
}

/* Errors */
.errors {
  background: var(--color-error-soft);
  border: 1px solid var(--color-error);
  color: var(--color-error);
  padding: var(--spacing);
  border-radius: 0.5rem;
  margin-bottom: 1rem;
}

.errors h2 {
  margin-top: 0;
  font-size: var(--text-base);
  color: inherit;
}

.errors ul {
  margin: 0;
  padding-left: 1.5rem;
}

.errors a {
  color: inherit;
  text-decoration: underline;
}

.field-error {
  font-size: var(--text-caption);
  letter-spacing: var(--tracking-caption);
  color: var(--color-error);
  margin: 0.35rem 0 0;
}

.field_with_errors input,
.field_with_errors textarea,
.field_with_errors select {
  border-color: var(--color-error);
}

/* Images */
img {
  max-width: 100%;
  height: auto;
  border-radius: 0.25rem;
}

/* Tables */
table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0;
}

th, td {
  padding: 0.5rem;
  text-align: left;
  border-bottom: 1px solid var(--color-border);
}

th {
  font-weight: 600;
  font-size: var(--text-sm);
  letter-spacing: var(--tracking-caption);
  color: var(--color-text-muted);
}

code {
  background: var(--color-bg-alt);
  padding: 0.125rem 0.25rem;
  border-radius: 0.125rem;
  font-size: 0.875em;
  word-break: break-all;
}

/* Horizontal rule */
hr {
  border: none;
  border-top: 1px solid var(--color-border);
  margin: 2rem 0;
}

/* Lists */
ul, ol {
  padding-left: 1.5rem;
}

li {
  margin-bottom: 0.25rem;
}

/* Homepage hero */
.home-hero {
  text-align: center;
  padding: 1.5rem 1rem 2.25rem;
  margin-bottom: var(--spacing);
  border-bottom: 1px solid var(--color-border);
}

.home-hero .eyebrow {
  margin-bottom: 0.9rem;
}

.home-hero-title {
  font-size: clamp(2.1rem, 4.5vw, 2.9rem);
  line-height: 1.12;
  max-width: 40rem;
  margin: 0 auto 0.75rem;
  text-wrap: balance;
}

.home-hero-title .hand {
  color: var(--color-accent);
  font-size: 1.08em;
  font-weight: 600;
}

.home-hero-tagline {
  color: var(--color-text-muted);
  max-width: 34rem;
  margin: 0 auto 1.5rem;
}

/* Category chips (reset the global nav chrome: these are <nav> elements) */
.category-chips {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin: 1.1rem 0 0;
  padding-bottom: 0;
  border-bottom: none;
}

.category-chip {
  background: var(--color-accent-alt-soft);
  color: var(--color-accent-alt);
  padding: 0.25rem 0.8rem;
  border-radius: 1rem;
  font-size: var(--text-caption);
  letter-spacing: var(--tracking-caption);
}

.category-chip:hover {
  color: var(--color-accent-alt);
}

.category-chips-more {
  font-size: var(--text-caption);
  letter-spacing: var(--tracking-caption);
  margin-left: 0.25rem;
}

/* Empty search state */
.empty-search .empty-search-note {
  display: inline-block;
  font-size: 1.6rem;
  font-weight: 500;
  color: var(--color-accent);
  transform: rotate(-2deg);
  margin-bottom: 0.5rem;
}

/* Muted intro line under a page H1 */
.page-standfirst {
  color: var(--color-text-muted);
  margin: -1rem 0 1.5rem;
  max-width: var(--max-width-narrow);
}

/* Recipe grid header */
.recipes-header {
  display: flex;
  align-items: baseline;
  gap: 0.75rem 1rem;
  flex-wrap: wrap;
  margin-top: 1.75rem;
}

.recipes-title {
  font-size: var(--text-2xl);
  margin: 0;
}

.recipes-count {
  color: var(--color-text-muted);
  font-size: var(--text-sm);
  letter-spacing: var(--tracking-caption);
}

.recipes-add {
  margin-left: auto;
  align-self: center;
}

.recipes-header-results {
  margin-top: 0.5rem;
}

.recipes-header-results a {
  font-size: var(--text-sm);
}

.results-title {
  font-size: var(--text-xl);
  margin: 0;
}

/* Recipe grid */
.recipes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
  margin-top: 1.5rem;
}

.recipe-card {
  position: relative;
  background: white;
  border: 1px solid var(--color-border);
  border-radius: 0.75rem;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  transition: box-shadow 0.2s, transform 0.2s;
}

/* Mom's pen in the margin: marks recipes added in the last two weeks */
.recipe-card-new {
  position: absolute;
  top: 0.5rem;
  right: 0.7rem;
  z-index: 1;
  pointer-events: none;
  font-family: var(--font-hand);
  font-weight: 600;
  font-size: 1.35rem;
  color: var(--color-accent);
  transform: rotate(-6deg);
  text-shadow: 0 1px 0 rgba(255, 253, 246, 0.8);
}

.recipe-card:hover {
  box-shadow: 0 4px 16px rgba(0,0,0,0.12);
  transform: translateY(-2px);
}

.recipe-card-media {
  display: block;
}

.recipe-card-image {
  aspect-ratio: 4/3;
  width: 100%;
  object-fit: cover;
}

/* Gingham kitchen-towel pattern for recipes without a photo */
.recipe-card-placeholder {
  aspect-ratio: 4/3;
  width: 100%;
  background:
    repeating-linear-gradient(0deg, rgba(138, 46, 59, 0.07) 0 12px, transparent 12px 24px),
    repeating-linear-gradient(90deg, rgba(138, 46, 59, 0.07) 0 12px, transparent 12px 24px),
    var(--color-bg);
}

.recipe-card-content {
  padding: 1rem;
}

.recipe-card-title {
  font-family: var(--font-heading);
  font-size: var(--text-lg);
  font-weight: var(--weight-heading);
  letter-spacing: var(--tracking-heading);
  color: var(--color-text);
  margin: 0 0 0.5rem 0;
  line-height: 1.3;
}

.recipe-card-title a {
  color: inherit;
  text-decoration: none;
}

.recipe-card-title a:hover {
  color: inherit;
  text-decoration: none;
}

.recipe-card-meta {
  display: flex;
  align-items: center;
  gap: 1rem;
  color: var(--color-text-muted);
  font-size: var(--text-sm);
  letter-spacing: var(--tracking-caption);
}

.recipe-card:hover .recipe-card-title {
  color: var(--color-accent);
}

.recipe-card-category,
.category-pill {
  background: var(--color-accent-alt-soft);
  color: var(--color-accent-alt);
  padding: 0.125rem 0.5rem;
  border-radius: 1rem;
  font-size: var(--text-caption);
}

.category-pill {
  padding: 0.125rem 0.65rem;
  font-weight: 600;
}

.category-pill:hover {
  color: var(--color-accent-alt);
  text-decoration: underline;
}

a.recipe-card-category:hover {
  color: var(--color-accent-alt);
}

.recipe-card-origin {
  margin: 0.35rem 0 0;
  font-size: var(--text-caption);
  letter-spacing: var(--tracking-caption);
  color: var(--color-text-muted);
  font-style: italic;
}

/* Category cards */
.category-card {
  background: white;
  border: 1px solid var(--color-border);
  border-radius: 0.75rem;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  transition: box-shadow 0.2s, transform 0.2s;
}

.category-card:hover {
  box-shadow: 0 4px 16px rgba(0,0,0,0.12);
  transform: translateY(-2px);
}

.category-card a {
  display: block;
  text-decoration: none;
}

/* Gingham kitchen-towel pattern for categories without a cover photo */
.category-card-placeholder {
  aspect-ratio: 4/3;
  width: 100%;
  background:
    repeating-linear-gradient(0deg, rgba(138, 46, 59, 0.07) 0 12px, transparent 12px 24px),
    repeating-linear-gradient(90deg, rgba(138, 46, 59, 0.07) 0 12px, transparent 12px 24px),
    var(--color-bg);
}

.category-card-image {
  aspect-ratio: 4/3;
  width: 100%;
  object-fit: cover;
}

.category-card-content {
  padding: 1rem;
}

.category-card-meta {
  font-size: var(--text-sm);
  letter-spacing: var(--tracking-caption);
  color: var(--color-text-muted);
}

.category-card-title {
  font-family: var(--font-heading);
  font-size: var(--text-lg);
  font-weight: var(--weight-heading);
  letter-spacing: var(--tracking-heading);
  color: var(--color-text);
  margin: 0;
  line-height: 1.3;
}

.category-card:hover .category-card-title {
  color: var(--color-accent);
}

/* Category page chapter header */
.breadcrumb {
  font-size: var(--text-caption);
  letter-spacing: var(--tracking-caption);
  margin: 0 0 0.75rem;
}

.category-count {
  color: var(--color-text-muted);
  font-size: var(--text-sm);
  letter-spacing: var(--tracking-caption);
  margin: -1rem 0 0;
}

/* Chapter navigation: soft olive pills, current chapter solid */
.category-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 1rem 0 0;
}

.category-nav a {
  background: var(--color-accent-alt-soft);
  color: var(--color-accent-alt);
  border-radius: 1rem;
  padding: 0.25rem 0.875rem;
  font-size: var(--text-sm);
  letter-spacing: var(--tracking-caption);
}

.category-nav a:hover {
  background: var(--color-accent-alt);
  color: white;
  text-decoration: none;
}

.category-nav a[aria-current="page"] {
  background: var(--color-accent-alt);
  color: white;
}

/* Search form */
.search-form {
  display: flex;
  gap: 0.5rem;
  margin-bottom: calc(var(--spacing) * 1.5);
}

.search-form input[type="search"] {
  flex: 1;
  min-width: 0;
}

.search-form input[type="submit"] {
  flex-shrink: 0;
  width: auto;
}

/* Large front-door variant, centered inside the homepage hero */
.search-form.search-form-hero {
  max-width: 32rem;
  margin: 0 auto;
}

.search-form-hero input[type="search"] {
  padding: 0.65rem 1rem;
  border-radius: 0.375rem;
  box-shadow: 0 2px 8px rgba(74, 63, 53, 0.06);
}

.search-form-hero input[type="submit"] {
  padding: 0.65rem 1.25rem;
  border-radius: 0.375rem;
}

/* Narrow container for forms and single recipe view */
.narrow {
  max-width: var(--max-width-narrow);
}

/* Standalone auth pages (no nav): wordmark above a single card */
.auth-page {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: clamp(2.5rem, 12vh, 6rem) var(--spacing) 4rem;
}

.auth-wordmark {
  font-size: 2rem;
  line-height: 1.2;
  text-align: center;
  margin: 0;
}

.auth-wordmark a {
  color: var(--color-accent);
}

.auth-tagline {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  text-align: center;
  margin: 0.375rem 1rem 2rem;
}

.auth-page .notice,
.auth-page .alert {
  width: 100%;
  max-width: 24rem;
}

.auth-card {
  width: 100%;
  max-width: 24rem;
  padding: 1.75rem 2rem 2rem;
  background: white;
  border: 1px solid var(--color-border);
  border-radius: 0.75rem;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  overflow: hidden;
}

/* Gingham kitchen-towel hem along the top of the card */
.auth-card::before {
  content: "";
  display: block;
  height: 0.75rem;
  margin: -1.75rem -2rem 1.5rem;
  background:
    repeating-linear-gradient(0deg, rgba(138, 46, 59, 0.28) 0 5px, transparent 5px 10px),
    repeating-linear-gradient(90deg, rgba(138, 46, 59, 0.28) 0 5px, transparent 5px 10px),
    var(--color-bg);
  border-bottom: 1px solid var(--color-border);
}

.auth-card h2 {
  font-size: var(--text-2xl);
  margin: 0 0 1.25rem;
}

.auth-card-lede {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  margin: -0.75rem 0 1.25rem;
}

/* Handwritten greeting from the inviter above the signup card */
.auth-note {
  font-family: var(--font-hand);
  font-size: 1.9rem;
  font-weight: 500;
  line-height: 1.15;
  color: var(--color-accent);
  transform: rotate(-2deg);
  text-align: center;
  margin: -0.5rem 0 1.5rem;
}

.auth-note-signature {
  font-size: 0.8em;
}

.field-hint {
  font-size: var(--text-caption);
  letter-spacing: var(--tracking-caption);
  color: var(--color-text-muted);
  margin: 0.25rem 0 0;
}

.auth-meta {
  font-size: var(--text-caption);
  letter-spacing: var(--tracking-caption);
  color: var(--color-text-muted);
  text-align: center;
  max-width: 24rem;
  margin: 1.25rem 0 0;
}

.auth-card input[type="submit"] {
  width: 100%;
  padding: 0.625rem 1rem;
  margin-top: 0.25rem;
}

.auth-link {
  text-align: center;
  font-size: var(--text-sm);
  margin: 1.25rem 0 0;
}

/* Profile page: narrow column of grouped cards */
.page-intro {
  color: var(--color-text-muted);
  margin: -1rem 0 1.5rem;
}

.profile-section {
  background: white;
  border: 1px solid var(--color-border);
  border-radius: 0.75rem;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
  padding: 1.25rem 1.5rem 1.5rem;
  margin-bottom: 1.25rem;
}

.profile-section h2 {
  font-size: var(--text-xl);
  margin: 0 0 1rem;
}

.section-hint {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  margin: -0.5rem 0 1rem;
}

.profile-page input[type="submit"] {
  width: auto;
  padding: 0.5rem 1.5rem;
  margin-bottom: 2rem;
}

.profile-feed .feed-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.feed-row code {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.feed-row button {
  background: var(--color-bg-alt);
  color: var(--color-text);
  border: 1px solid var(--color-border);
  font-size: var(--text-sm);
  padding: 0.375rem 0.75rem;
  white-space: nowrap;
}

.feed-row button:hover {
  background: var(--color-border);
  color: var(--color-text);
}

/* Invitations page */
.invite-rows {
  list-style: none;
  margin: 0;
  padding: 0;
}

.invite-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
  background: white;
  border: 1px solid var(--color-border);
  border-radius: 0.5rem;
  padding: 0.7rem 0.9rem;
  margin-bottom: 0.6rem;
  font-size: var(--text-sm);
}

.invite-row.spent {
  background: transparent;
  color: var(--color-text-muted);
}

.invite-row .invite-when {
  flex: 1;
  color: var(--color-text-muted);
}

.invite-row button {
  background: var(--color-bg-alt);
  color: var(--color-text);
  border: 1px solid var(--color-border);
  font-size: var(--text-sm);
  padding: 0.375rem 0.75rem;
  white-space: nowrap;
}

.invite-row button:hover {
  background: var(--color-border);
  color: var(--color-text);
}

.invite-pill {
  background: var(--color-accent-alt-soft);
  color: var(--color-accent-alt);
  border-radius: 1rem;
  padding: 0.125rem 0.6rem;
  font-size: var(--text-caption);
  letter-spacing: var(--tracking-caption);
  font-weight: 600;
  white-space: nowrap;
}

.invite-pill.gray {
  background: var(--color-bg-alt);
  color: var(--color-text-muted);
  font-weight: 500;
}

.member-chips {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.member-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  background: white;
  border: 1px solid var(--color-border);
  border-radius: 2rem;
  padding: 0.25rem 0.8rem 0.25rem 0.3rem;
  font-size: var(--text-sm);
  margin: 0;
}

.member-chip i {
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 50%;
  background: var(--color-accent-alt-soft);
  color: var(--color-accent-alt);
  font-style: normal;
  font-weight: 600;
  font-size: var(--text-caption);
  font-family: var(--font-heading);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* Recipe show page */
.recipe-kop {
  margin-bottom: 2rem;
}

.recipe-kopline {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-wrap: wrap;
  font-size: var(--text-sm);
  letter-spacing: var(--tracking-caption);
  color: var(--color-text-muted);
  margin: 0 0 0.6rem;
}

.recipe-kopline-item::before {
  content: "·";
  margin-right: 0.65rem;
}

.recipe-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
}

.recipe-header h1 {
  margin: 0;
}

/* The one handwritten accent on the page: the recipe's origin as
   mom's margin note. Wine red on the cream page per the house rule. */
.recipe-origin {
  font-size: 1.35rem;
  font-weight: 500;
  line-height: 1.2;
  color: var(--color-accent);
  transform: rotate(-2deg);
  display: inline-block;
  margin: 0.5rem 0 0;
}

.recipe-byline {
  font-size: var(--text-caption);
  letter-spacing: var(--tracking-caption);
  color: var(--color-text-muted);
  margin: 0.75rem 0 0;
}

.button-secondary {
  background: var(--color-bg-alt);
  color: var(--color-text);
  border: 1px solid var(--color-border);
  padding: 0.375rem 0.75rem;
  border-radius: 0.25rem;
  font-size: var(--text-sm);
  text-decoration: none;
  white-space: nowrap;
}

.button-secondary:hover {
  background: var(--color-border);
  color: var(--color-text);
  text-decoration: none;
}

.recipe-image {
  margin: 0 auto 1.5rem auto;
  max-width: 700px;
}

.recipe-image img {
  width: 100%;
  border-radius: 0.5rem;
}

.recipe-intro {
  font-size: var(--text-lg);
  color: var(--color-text-muted);
  margin: 0.9rem 0 0;
  font-style: italic;
  max-width: 42rem;
}

.recipe-columns {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
}

@media (min-width: 768px) {
  .recipe-columns {
    grid-template-columns: 1fr 2fr;
  }

  .ingredients-card {
    position: sticky;
    top: 1rem;
  }
}

.recipe-columns h2,
.recipe-comments h2 {
  font-family: var(--font-body);
  font-size: 0.875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-text-muted);
  border-bottom: 2px solid var(--color-accent);
  padding-bottom: 0.5rem;
  margin-top: 0;
}

/* The keukenkaart: ingredients on paper with the index-card margin rule.
   Functional adaptation of the paper artifacts: flat, no tape, no rotation. */
.ingredients-card {
  background:
    linear-gradient(90deg, transparent 1.5rem, var(--color-card-margin) 1.5rem, var(--color-card-margin) calc(1.5rem + 1px), transparent calc(1.5rem + 1px)),
    var(--color-paper);
  border: 1px solid #e6ddc8;
  border-radius: 5px;
  box-shadow: 0 8px 22px rgba(74, 63, 53, 0.12);
  padding: 1.4rem 1.5rem 1.5rem 2.4rem;
  align-self: start;
}

.ingredients-card h2 {
  border-bottom-color: var(--color-card-margin);
  color: var(--color-text);
}

.preparation-steps {
  list-style: none;
  counter-reset: step;
  margin: 0;
  padding: 0;
  font-size: 1.0625rem;
  line-height: 1.75;
}

.preparation-steps li {
  counter-increment: step;
  position: relative;
  padding-left: 3rem;
}

.preparation-steps li + li {
  margin-top: 1.25rem;
}

.preparation-steps li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 0.125rem;
  width: 2rem;
  height: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--color-paper);
  border: 1px solid #e6ddc8;
  box-shadow: 0 1px 3px rgba(74, 63, 53, 0.1);
  color: var(--color-accent);
  font-family: var(--font-heading);
  font-weight: bold;
}

.ai-disclaimer {
  color: var(--color-text-muted);
  font-size: var(--text-caption);
  letter-spacing: var(--tracking-caption);
  margin-top: 0.5rem;
  font-style: italic;
}

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

.ingredients-list li {
  margin: 0;
  border-bottom: 1px solid var(--color-border);
}

.ingredients-list li:last-child {
  border-bottom: none;
}

.ingredients-list label {
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
  padding: 0.5rem 0;
  cursor: pointer;
}

/* Tick off ingredients while cooking; nothing is persisted */
.ingredients-list input[type="checkbox"] {
  appearance: none;
  width: 1.05rem;
  height: 1.05rem;
  flex-shrink: 0;
  border: 1.5px solid var(--color-border);
  border-radius: 3px;
  background: white;
  margin: 0;
  padding: 0;
  cursor: pointer;
  position: relative;
  top: 0.15rem;
}

.ingredients-list input[type="checkbox"]:checked {
  background: var(--color-accent);
  border-color: var(--color-accent);
}

.ingredients-list input[type="checkbox"]:checked::before {
  content: "✓";
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 0.75rem;
  line-height: 1;
}

.ingredients-list input:checked ~ span {
  text-decoration: line-through;
  text-decoration-color: rgba(123, 112, 96, 0.6);
  color: var(--color-text-muted);
}

.ingredient-quantity {
  font-weight: 650;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* Share strip: surfaces the public /r/:slug link */
.recipe-share {
  margin-top: 2.75rem;
  border: 1px dashed var(--color-border);
  border-radius: 0.5rem;
  background: white;
  padding: 1rem 1.25rem;
}

.recipe-share-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.recipe-share-label {
  font-weight: 600;
  font-size: var(--text-sm);
  white-space: nowrap;
}

.recipe-share-url {
  font-family: monospace;
  font-size: var(--text-caption);
  background: var(--color-bg-alt);
  border: 1px solid var(--color-border);
  border-radius: 0.25rem;
  padding: 0.35rem 0.6rem;
  flex: 1;
  min-width: 12rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.recipe-share button[type="button"] {
  background: var(--color-accent);
  color: white;
  border: none;
  font-size: var(--text-sm);
  padding: 0.45rem 0.9rem;
}

.recipe-share button[type="button"]:hover {
  background: var(--color-accent-hover);
}

.recipe-share small {
  display: block;
  color: var(--color-text-muted);
  font-size: var(--text-caption);
  margin-top: 0.5rem;
}

/* Comments */
.recipe-comments {
  margin-top: 3rem;
}

.comment {
  border-top: 1px solid var(--color-border);
  padding: 1.1rem 0 1rem;
  margin: 0;
}

.comments-empty {
  color: var(--color-text-muted);
  font-style: italic;
}

.comment-form {
  border-top: 1px solid var(--color-border);
  padding-top: 1.25rem;
}

.comment-form textarea {
  min-height: 5.5rem;
  resize: vertical;
}

.comment-form input[type="submit"] {
  margin-top: 0.6rem;
}

.comment-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
  font-size: var(--text-caption);
  letter-spacing: var(--tracking-caption);
}

.comment-author {
  font-weight: 600;
  color: var(--color-text);
}

.comment-date {
  color: var(--color-text-muted);
}

.comment-date::before {
  content: "·";
  margin-right: 0.5rem;
}

.comment-body p {
  margin: 0;
}

.comment-body p + p {
  margin-top: 0.75rem;
}

.comment-actions {
  margin-top: 0.5rem;
}

.comment-delete {
  background: transparent;
  color: var(--color-text-muted);
  border: none;
  padding: 0;
  font-size: var(--text-caption);
  cursor: pointer;
}

.comment-delete:hover {
  color: var(--color-error);
  background: transparent;
}

.comments-login-notice {
  background: var(--color-bg);
  border: 1px dashed var(--color-border);
  border-radius: 0.5rem;
  padding: 1.5rem 1rem;
  text-align: center;
  font-size: var(--text-sm);
}

/* Empty state */
.empty-state {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--color-text-muted);
}

/* Handwritten aside above the message, same recipe as .empty-search-note:
   handwriting on the cream page is wine red (see docs/HOUSE_STYLE.md). */
.empty-state-note {
  display: inline-block;
  font-size: 1.6rem;
  font-weight: 500;
  color: var(--color-accent);
  transform: rotate(-2deg);
  margin-bottom: 0.5rem;
}

.empty-state-message {
  margin: 0 0 1.5rem;
}

/* Empty archive: the one empty state that is a story moment,
   so it gets the post-it treatment (see docs/HOUSE_STYLE.md) */
.empty-archive {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
}

.empty-archive .postit-note {
  position: relative;
  width: 10.5rem;
  aspect-ratio: 1;
  background: linear-gradient(180deg, var(--color-postit) 0%, var(--color-postit-deep) 100%);
  box-shadow: 0 10px 22px rgba(74, 63, 53, 0.2);
  transform: rotate(-2deg);
  padding: 1rem;
  font-family: var(--font-hand);
  font-size: 1.4rem;
  line-height: 1.2;
  color: var(--color-postit-ink);
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.empty-archive .empty-state-message {
  margin: 0;
}

/* Pagination (reset the global nav chrome: this is a <nav> element) */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.25rem;
  flex-wrap: wrap;
  margin: 2rem 0 0;
  padding-bottom: 0;
  border-bottom: none;
  font-size: var(--text-sm);
}

.pagination-status {
  color: var(--color-text-muted);
  font-size: var(--text-caption);
  letter-spacing: var(--tracking-caption);
  font-variant-numeric: tabular-nums;
}

.pagination-disabled {
  color: var(--color-text-muted);
  opacity: 0.55;
}

/* Responsive */
@media (max-width: 600px) {
  dl {
    grid-template-columns: 1fr;
  }

  .recipes-grid {
    grid-template-columns: 1fr;
  }
}

/* Chrome breakpoint: matches the 760px editorial breakpoint. */
@media (max-width: 760px) {
  /* Only collapse the menu (and show the toggle) once the Stimulus controller
     has connected; without JavaScript the menu stays visible and usable. */
  .site-nav[data-nav-enhanced] .nav-toggle {
    display: inline-flex;
  }

  /* The open menu is a paper panel: same material as the content cards. */
  .nav-menu {
    display: flex;
    flex-basis: 100%;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    background: white;
    border: 1px solid var(--color-border);
    border-radius: 0.625rem;
    box-shadow: 0 10px 24px rgba(74, 63, 53, 0.14);
    overflow: hidden;
    margin-block: 0.25rem 0.5rem;
  }

  .site-nav[data-nav-enhanced] .nav-menu {
    display: none;
  }

  .site-nav[data-nav-enhanced] .nav-menu[data-open] {
    display: flex;
    opacity: 1;
    translate: 0 0;
    transition: opacity 0.18s ease, translate 0.18s ease;
  }

  @starting-style {
    .site-nav[data-nav-enhanced] .nav-menu[data-open] {
      opacity: 0;
      translate: 0 -4px;
    }
  }

  .nav-menu > a,
  .nav-menu .nav-user a,
  .nav-menu .nav-user button {
    padding: 0.7rem 1.1rem;
    width: 100%;
    text-align: left;
  }

  .nav-menu > a:hover,
  .nav-menu .nav-user a:hover,
  .nav-menu .nav-user button:hover {
    background: var(--color-bg);
    color: var(--color-accent);
    text-decoration: none;
  }

  .site-nav .nav-menu a[aria-current="page"] {
    text-decoration: none;
    box-shadow: inset 3px 0 0 var(--color-accent);
  }

  .nav-menu .nav-user {
    margin-left: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    border-top: 1px solid var(--color-border);
  }

  .nav-sep {
    display: none;
  }
}

/* About page ("Ons verhaal") */
.story-hero {
  max-width: 46rem;
  margin: 3rem auto 4.5rem;
  text-align: center;
}

.eyebrow {
  font-size: var(--text-caption);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--color-accent-alt);
  margin: 0 0 1rem;
}

.story-hero h1 {
  font-size: clamp(2.1rem, 5.5vw, 3.4rem);
  line-height: 1.12;
  margin: 0 0 1.25rem;
  text-wrap: balance;
}

.story-hero h1 .hand {
  color: var(--color-accent);
  font-size: 1.08em;
  font-weight: 600;
}

.hand {
  font-family: var(--font-hand);
}

.standfirst {
  color: var(--color-text-muted);
  font-size: var(--text-lg);
  max-width: 34rem;
  margin: 0 auto;
  text-wrap: balance;
}

.chapters {
  max-width: 62rem;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

/* De rode draad: hand-drawn thread segments stitching the chapters into
   one continuous story. Drawn in mom's wine-red pen, like the era labels. */
.stitch {
  display: flex;
  justify-content: center;
  padding: 0.25rem 0;
}

.stitch svg {
  width: 26px;
  height: 76px;
  overflow: visible;
}

.stitch path {
  fill: none;
  stroke: var(--color-accent);
  stroke-width: 2;
  stroke-linecap: round;
  opacity: 0.8;
  stroke-dasharray: 130;
  stroke-dashoffset: 0;
  transition: stroke-dashoffset 0.9s ease 0.15s;
}

/* The reveal controller draws each stitch in as it scrolls into view */
.stitch.reveal-hidden path {
  stroke-dashoffset: 130;
}

/* Closing beat: the archive today, counted on a taped index card */
.coda {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
  padding-top: 0.5rem;
  opacity: 1;
  transform: none;
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.coda.reveal-hidden {
  opacity: 0;
  transform: translateY(16px);
}

.chapter {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  gap: 2.5rem 4rem;
  align-items: center;
  opacity: 1;
  transform: none;
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.chapter.reveal-hidden {
  opacity: 0;
  transform: translateY(16px);
}

.chapter:nth-of-type(even) .chapter-text {
  order: 2;
}

.chapter:nth-of-type(even) .chapter-artifact {
  order: 1;
}

.era {
  font-family: var(--font-hand);
  font-size: 1.5rem;
  font-weight: 500;
  color: var(--color-accent);
  margin: 0 0 0.25rem;
  transform: rotate(-2deg);
  display: inline-block;
}

.chapter h2 {
  margin: 0 0 0.875rem;
  font-size: 1.75rem;
}

.chapter p {
  margin: 0 0 1rem;
  max-width: 34rem;
}

.chapter p:last-child {
  margin-bottom: 0;
}

.chapter .button {
  margin-top: 0.75rem;
}

.chapter-artifact {
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.25rem;
}

.chapter-artifact figcaption {
  font-size: var(--text-caption);
  letter-spacing: var(--tracking-caption);
  color: var(--color-text-muted);
  font-style: italic;
  text-align: center;
}

/* Artifact: handwritten index card */
.index-card {
  position: relative;
  width: min(21rem, 100%);
  background:
    linear-gradient(90deg, transparent 2.1rem, var(--color-card-margin) 2.1rem, var(--color-card-margin) calc(2.1rem + 1px), transparent calc(2.1rem + 1px)),
    repeating-linear-gradient(to bottom, transparent 0 27px, var(--color-card-line) 27px 28px),
    var(--color-paper);
  background-position: 0 0, 0 14px, 0 0;
  border: 1px solid var(--color-paper-border);
  border-radius: 3px;
  box-shadow: 0 12px 28px rgba(74, 63, 53, 0.16);
  padding: 1.5rem 1.5rem 1.75rem 2.9rem;
  transform: rotate(-2.5deg);
  transition: transform 0.35s ease;
}

.index-card:hover {
  transform: rotate(0deg);
}

.tape {
  position: absolute;
  top: -12px;
  left: 50%;
  width: 6rem;
  height: 1.75rem;
  transform: translateX(-50%) rotate(-1.5deg);
  background: var(--color-tape);
  box-shadow: 0 1px 3px rgba(74, 63, 53, 0.12);
  border-left: 1px dashed rgba(74, 63, 53, 0.12);
  border-right: 1px dashed rgba(74, 63, 53, 0.12);
}

.index-card h3 {
  font-family: var(--font-hand);
  font-weight: 600;
  font-size: 1.8rem;
  line-height: 28px;
  color: var(--color-ink-pen);
  margin: 0;
  text-decoration: underline;
  text-decoration-thickness: 1.5px;
  text-underline-offset: 4px;
}

.index-card ul {
  list-style: none;
  margin: 0;
  padding: 0;
  font-family: var(--font-hand);
  font-size: 1.3rem;
  line-height: 28px;
  color: var(--color-ink-pen);
}

.index-card li {
  margin: 0;
}

.index-card .card-note {
  font-family: var(--font-hand);
  font-size: 1.2rem;
  line-height: 28px;
  color: var(--color-accent);
  margin: 0;
}

/* Artifact: pile of loose recipe papers */
.paper-pile {
  position: relative;
  width: min(21rem, 100%);
  aspect-ratio: 5 / 4;
}

.paper-pile .sheet-typed {
  position: absolute;
  inset: 4% 12% 14% 0;
  background: var(--color-paper);
  border: 1px solid var(--color-paper-border);
  box-shadow: 0 10px 24px rgba(74, 63, 53, 0.14);
  transform: rotate(2.5deg);
  padding: 1.1rem 1.2rem;
}

.sheet-typed h4 {
  font-family: "Times New Roman", serif;
  font-size: var(--text-base);
  font-weight: 700;
  margin: 0 0 0.6rem;
}

.textbars {
  height: 70%;
  background: repeating-linear-gradient(to bottom, #e3ddd0 0 6px, transparent 6px 15px);
}

.paper-pile .sheet-clipping {
  position: absolute;
  right: 0;
  bottom: 6%;
  width: 52%;
  background: var(--color-clipping);
  border: 1px solid var(--color-clipping-border);
  box-shadow: 0 8px 18px rgba(74, 63, 53, 0.16);
  transform: rotate(-5deg);
  padding: 0.8rem 0.9rem;
}

.sheet-clipping .textbars {
  height: 3.2rem;
  background: repeating-linear-gradient(to bottom, #d9c99b 0 5px, transparent 5px 13px);
}

.sheet-clipping p {
  font-family: "Times New Roman", serif;
  font-size: 0.7rem;
  font-style: italic;
  color: var(--color-clipping-ink);
  margin: 0.5rem 0 0;
}

.paper-pile .postit {
  position: absolute;
  left: 8%;
  bottom: 0;
  width: 44%;
  aspect-ratio: 1;
  background: linear-gradient(180deg, var(--color-postit) 0%, var(--color-postit-deep) 100%);
  box-shadow: 0 8px 16px rgba(74, 63, 53, 0.2);
  transform: rotate(-2deg);
  padding: 0.7rem 0.8rem;
  font-family: var(--font-hand);
  font-size: 1.15rem;
  line-height: 1.25;
  color: var(--color-postit-ink);
  display: flex;
  align-items: center;
  transition: transform 0.35s ease;
}

.paper-pile .postit:hover {
  transform: rotate(0.5deg) scale(1.03);
}

/* Artifact: retro Word window */
.word-window {
  width: min(23rem, 100%);
  background: #c0c0c0;
  border: 1px solid #808080;
  border-top-color: #dfdfdf;
  border-left-color: #dfdfdf;
  box-shadow: 0 14px 30px rgba(74, 63, 53, 0.22);
  font-family: Tahoma, "Segoe UI", sans-serif;
  font-size: var(--text-caption);
}

.word-titlebar {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  background: linear-gradient(90deg, #000080, #1084d0);
  color: white;
  font-weight: 700;
  padding: 0.2rem 0.25rem 0.2rem 0.4rem;
}

.word-titlebar .title {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.win-btn {
  width: 1.1rem;
  height: 1.05rem;
  background: #c0c0c0;
  border: 1px solid #404040;
  border-top-color: white;
  border-left-color: white;
  color: black;
  font-size: 0.65rem;
  font-weight: 700;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.word-menubar {
  display: flex;
  gap: 0.9rem;
  padding: 0.25rem 0.5rem;
  color: black;
  flex-wrap: wrap;
}

.word-doc {
  background: white;
  border: 1px solid #404040;
  border-bottom-color: white;
  border-right-color: white;
  margin: 0 2px;
  padding: 1.25rem 1.5rem 1.5rem;
  font-family: "Times New Roman", serif;
  font-size: 0.9375rem;
  color: black;
  line-height: 1.55;
}

.word-doc h4 {
  text-align: center;
  text-decoration: underline;
  font-size: 1.05rem;
  margin: 0 0 0.75rem;
}

.word-doc ol {
  margin: 0;
  padding-left: 1.4rem;
}

.word-doc li {
  margin: 0;
}

.cursor {
  display: inline-block;
  width: 1px;
  height: 1em;
  background: black;
  vertical-align: text-bottom;
  animation: blink 1.06s steps(1) infinite;
}

@keyframes blink {
  50% {
    opacity: 0;
  }
}

.word-statusbar {
  display: flex;
  gap: 1.25rem;
  padding: 0.2rem 0.5rem;
  color: black;
  border-top: 1px solid #808080;
}

/* Artifact: browser window */
.browser {
  width: min(23rem, 100%);
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: 0.65rem;
  box-shadow: 0 14px 30px rgba(74, 63, 53, 0.18);
  overflow: hidden;
}

.browser-chrome {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  background: var(--color-bg-alt);
  border-bottom: 1px solid var(--color-border);
  padding: 0.55rem 0.75rem;
}

.browser-dots {
  display: flex;
  gap: 0.3rem;
}

.browser-dots i {
  width: 0.6rem;
  height: 0.6rem;
  border-radius: 50%;
  background: var(--color-border);
}

.browser-address {
  flex: 1;
  background: white;
  border: 1px solid var(--color-border);
  border-radius: 1rem;
  font-size: 0.75rem;
  color: var(--color-text-muted);
  padding: 0.2rem 0.75rem;
}

.browser-body {
  padding: 0.9rem 1rem 1.1rem;
}

.browser-brand {
  font-family: var(--font-heading);
  font-weight: 600;
  letter-spacing: var(--tracking-heading);
  color: var(--color-accent);
  font-size: 0.9375rem;
  margin: 0 0 0.75rem;
}

.mini-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.mini-card {
  background: white;
  border: 1px solid var(--color-border);
  border-radius: 0.5rem;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.mini-thumb {
  aspect-ratio: 4 / 3;
  background:
    repeating-linear-gradient(0deg, rgba(138, 46, 59, 0.07) 0 9px, transparent 9px 18px),
    repeating-linear-gradient(90deg, rgba(138, 46, 59, 0.07) 0 9px, transparent 9px 18px),
    var(--color-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  opacity: 0.85;
}

img.mini-thumb {
  display: block;
  width: 100%;
  object-fit: cover;
  border-radius: 0;
}

.mini-card h5 {
  font-family: var(--font-heading);
  font-weight: var(--weight-heading);
  font-size: var(--text-caption);
  margin: 0;
  padding: 0.5rem 0.6rem 0.6rem;
  line-height: 1.3;
}

/* Site footer */
.site-footer {
  margin-top: 5.5rem;
}

.gingham-strip {
  height: 14px;
  background:
    repeating-linear-gradient(0deg, rgba(138, 46, 59, 0.12) 0 7px, transparent 7px 14px),
    repeating-linear-gradient(90deg, rgba(138, 46, 59, 0.12) 0 7px, transparent 7px 14px),
    var(--color-bg);
  border-top: 1px solid var(--color-border);
  border-bottom: 1px solid var(--color-border);
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1.5rem;
  padding: 2rem 0 1.5rem;
}

.footer-brand {
  font-family: var(--font-heading);
  font-weight: 600;
  letter-spacing: var(--tracking-heading);
  font-size: var(--text-xl);
  color: var(--color-accent);
  margin: 0 0 0.25rem;
}

.footer-tagline {
  color: var(--color-text-muted);
  font-size: var(--text-sm);
  margin: 0;
}

.footer-nav {
  display: flex;
  gap: 1.5rem;
  font-size: var(--text-sm);
}

/* Mom gets the last word: the one sanctioned handwriting moment in the chrome. */
.footer-ps {
  font-family: var(--font-hand);
  font-size: 1.35rem;
  font-weight: 500;
  color: var(--color-accent);
  transform: rotate(-1.5deg);
  transform-origin: left bottom;
  display: inline-block;
  margin: 0 0 0.25rem;
}

.footer-copyright {
  font-size: var(--text-caption);
  letter-spacing: var(--tracking-caption);
  color: var(--color-text-muted);
  margin: 0;
  padding-bottom: 1rem;
}

@media (max-width: 760px) {
  .chapter {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .chapter:nth-of-type(even) .chapter-text {
    order: 1;
  }

  .chapter:nth-of-type(even) .chapter-artifact {
    order: 2;
  }

  .story-hero {
    margin: 1.5rem auto 3.5rem;
  }

  .chapters {
    gap: 0.75rem;
  }

  .stitch svg {
    height: 56px;
  }

  .footer-inner {
    flex-direction: column;
  }
}

/* Recipe authoring ("het recept voor een recept") */
.form-page {
  max-width: var(--max-width-narrow);
  margin: 0 auto;
}

.form-pagehead {
  text-align: center;
  margin: 1rem 0 2rem;
}

.form-pagehead .eyebrow {
  margin-bottom: 0.5rem;
}

.form-pagehead h1 {
  margin-bottom: 0.5rem;
}

.form-standfirst {
  color: var(--color-text-muted);
  max-width: 30rem;
  margin: 0 auto;
  text-wrap: balance;
}

/* Numbered form sections: white cards whose legends reuse the step-circle
   vocabulary of .preparation-steps on the recipe page. */
.form-section {
  background: var(--color-paper);
  border: 1px solid var(--color-border);
  border-radius: 0.75rem;
  box-shadow: 0 2px 8px rgba(74, 63, 53, 0.06);
  padding: 1.5rem 1.75rem 1.75rem;
  margin: 0 0 1.5rem;
  min-width: 0;
  position: relative;
}

/* Float keeps the legend inside the card's border box across browsers. */
.form-section-legend {
  float: left;
  width: 100%;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0;
  margin-bottom: 1.25rem;
}

.form-section-legend ~ * {
  clear: both;
}

.form-section-title {
  font-size: var(--text-xl);
  margin: 0;
}

.form-section-optional {
  margin-left: auto;
  font-size: var(--text-caption);
  letter-spacing: var(--tracking-caption);
  color: var(--color-text-muted);
}

.form-step {
  width: 2rem;
  height: 2rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--color-bg-alt);
  border: 1px solid var(--color-border);
  color: var(--color-accent);
  font-family: var(--font-heading);
  font-weight: bold;
  flex-shrink: 0;
}

.field-hint {
  font-size: var(--text-caption);
  letter-spacing: var(--tracking-caption);
  color: var(--color-text-muted);
  margin: 0.35rem 0 0;
}

.form-section-intro {
  margin: 0 0 1rem;
}

.field-optional {
  font-weight: 400;
  font-size: var(--text-caption);
  color: var(--color-text-muted);
}

.prep-foot {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  flex-wrap: wrap;
  margin-top: 0.35rem;
}

.prep-foot .field-hint {
  margin: 0;
}

.prep-step-count {
  font-size: var(--text-caption);
  letter-spacing: var(--tracking-caption);
  color: var(--color-accent-alt);
  font-weight: 600;
  white-space: nowrap;
}

/* Photo dropzone: the real file input covers the whole zone (opacity 0),
   so click and native drag-and-drop keep working without JavaScript.
   Gingham at the placeholder strength, as on .mini-thumb. */
/* label.photo-dropzone so it outranks the generic .field label display */
label.photo-dropzone {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.6rem;
  padding: 2rem 1rem;
  border: 1.5px dashed var(--color-border);
  border-radius: 0.5rem;
  background:
    repeating-linear-gradient(0deg, rgba(138, 46, 59, 0.07) 0 9px, transparent 9px 18px),
    repeating-linear-gradient(90deg, rgba(138, 46, 59, 0.07) 0 9px, transparent 9px 18px),
    var(--color-bg);
  text-align: center;
  cursor: pointer;
}

.photo-dropzone:hover {
  border-color: var(--color-accent);
}

.photo-dropzone:focus-within {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

.photo-dropzone input[type="file"] {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}

.photo-dropzone-cta {
  font-size: var(--text-sm);
}

.photo-dropzone-button {
  background: var(--color-paper);
  border: 1px solid var(--color-border);
  border-radius: 0.25rem;
  padding: 0.45rem 1rem;
  font-size: var(--text-sm);
  box-shadow: 0 1px 3px rgba(74, 63, 53, 0.08);
}

.photo-dropzone-hint {
  font-size: var(--text-caption);
  letter-spacing: var(--tracking-caption);
  color: var(--color-text-muted);
  max-width: 26rem;
}

.photo-dropzone-thumb {
  max-height: 8rem;
  width: auto;
  border-radius: 0.375rem;
  box-shadow: 0 2px 8px rgba(74, 63, 53, 0.15);
}

.field-duo {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1rem;
}

.field-duo .field {
  margin-bottom: 0;
}

.input-with-suffix {
  display: flex;
  align-items: stretch;
}

.input-with-suffix input {
  border-radius: 0.25rem 0 0 0.25rem;
  border-right: none;
  text-align: right;
  width: 100%;
}

.input-suffix {
  display: flex;
  align-items: center;
  background: var(--color-bg-alt);
  border: 1px solid var(--color-border);
  border-radius: 0 0.25rem 0.25rem 0;
  padding: 0 0.75rem;
  color: var(--color-text-muted);
  font-size: var(--text-sm);
  white-space: nowrap;
}

.form-actions {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  margin-top: 2rem;
}

.form-actions input[type="submit"] {
  width: auto;
  padding: 0.625rem 1.5rem;
}

/* Mom's single margin note: handwriting on the cream page is wine red. */
.form-margin-note {
  position: absolute;
  top: -0.95rem;
  right: 1.5rem;
  font-size: 1.35rem;
  font-weight: 500;
  color: var(--color-accent);
  transform: rotate(-2deg);
  background: var(--color-bg);
  padding: 0 0.5rem;
  line-height: 1.1;
}

.form-danger {
  margin-top: 2.5rem;
  border-top: 1px solid var(--color-border);
  padding-top: 1.5rem;
  display: flex;
  align-items: baseline;
  gap: 1rem;
  flex-wrap: wrap;
}

.form-danger p {
  font-size: var(--text-caption);
  letter-spacing: var(--tracking-caption);
  color: var(--color-text-muted);
  margin: 0;
}

button.button-danger {
  background: transparent;
  color: var(--color-error);
  border: 1px solid color-mix(in srgb, var(--color-error) 40%, transparent);
  padding: 0.45rem 1rem;
  font-size: var(--text-sm);
  white-space: nowrap;
}

button.button-danger:hover {
  background: color-mix(in srgb, var(--color-error) 8%, transparent);
  border-color: var(--color-error);
  color: var(--color-error);
}

@media (max-width: 600px) {
  .field-duo {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .field-duo .field {
    margin-bottom: 1rem;
  }

  .form-section {
    padding: 1.25rem 1rem 1.25rem;
  }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  .recipe-card,
  .category-card {
    transition: none;
  }

  .recipe-card:hover,
  .category-card:hover {
    transform: none;
  }

  .chapter,
  .coda,
  .index-card,
  .paper-pile .postit {
    transition: none;
  }

  .stitch path {
    transition: none;
  }

  .index-card:hover {
    transform: rotate(-2.5deg);
  }

  .paper-pile .postit:hover {
    transform: rotate(-2deg);
  }

  .cursor {
    animation: none;
  }

  .site-nav[data-nav-enhanced] .nav-menu[data-open] {
    transition: none;
  }
}

/* Print: the recipe page becomes a plain kitchen card. Chrome, sharing,
   and comments stay on screen; the ink is the artifact. */
@media print {
  body {
    max-width: none;
    background: white;
    color: black;
    padding: 0;
  }

  body > nav,
  .site-footer,
  .notice,
  .alert,
  .button-secondary,
  .recipe-image,
  .portion-controls,
  .recipe-share,
  .recipe-comments,
  .ingredients-list input[type="checkbox"] {
    display: none;
  }

  .recipe-columns {
    grid-template-columns: 1fr 2fr;
    gap: 1.5rem;
  }

  .ingredients-card {
    background: none;
    border: none;
    border-radius: 0;
    box-shadow: none;
    padding: 0;
    position: static;
  }

  .recipe-columns h2 {
    color: black;
    border-bottom-color: black;
  }

  .preparation-steps li::before {
    background: none;
    border-color: black;
    box-shadow: none;
    color: black;
  }

  .recipe-kopline,
  .recipe-byline,
  .recipe-intro {
    color: black;
  }

  .recipe-origin {
    color: black;
    transform: none;
  }

  .category-pill {
    background: none;
    color: black;
    padding: 0;
  }

  /* The short URL as a footer line, so paper points back to the archive */
  .recipe-page::after {
    content: attr(data-share-url);
    display: block;
    margin-top: 2rem;
    padding-top: 0.5rem;
    border-top: 1px solid black;
    font-family: monospace;
    font-size: 0.75rem;
  }
}
