/* =========================================================
   The Saturday Baker — Cookbook styles
   ========================================================= */

/* ---------- Page chrome ---------- */

.app {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.site-header {
  padding: var(--s-5) var(--s-5);
  border-bottom: 1px solid var(--line-soft);
  background: var(--bg);
  position: sticky;
  top: 0;
  z-index: 10;
  backdrop-filter: saturate(150%) blur(8px);
  background: rgba(250, 243, 231, 0.92);
}

.site-header-inner {
  max-width: var(--container-wide);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-5);
}

.brand {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  text-decoration: none;
  color: var(--ink);
}

.brand-mark {
  width: 36px;
  height: 36px;
  color: var(--crust);
}

.brand-name {
  font-family: var(--font-display);
  font-size: var(--t-md);
  font-weight: 500;
  font-style: italic;
  font-variation-settings: 'opsz' 144, 'SOFT' 80;
  letter-spacing: 0.005em;
}

.nav {
  display: flex;
  align-items: center;
  gap: var(--s-5);
}

.nav a {
  font-family: var(--font-display);
  font-size: var(--t-sm);
  font-weight: 500;
  text-decoration: none;
  color: var(--ink-soft);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  font-variation-settings: 'opsz' 9, 'SOFT' 50;
}

.nav a:hover,
.nav a.active {
  color: var(--crust-deep);
}

/* ---------- Layout ---------- */

main {
  flex: 1;
  padding: var(--s-7) var(--s-5);
}

.container {
  max-width: var(--container);
  margin: 0 auto;
}

.container-wide {
  max-width: var(--container-wide);
  margin: 0 auto;
}

/* ---------- Home / Welcome ---------- */

.welcome {
  text-align: center;
  padding: var(--s-7) 0 var(--s-6);
  position: relative;
}

.welcome-mark {
  width: 64px;
  height: 64px;
  margin: 0 auto var(--s-5);
  color: var(--crust);
  opacity: 0.85;
}

.welcome h1 {
  font-size: clamp(2.4rem, 6vw, 4.2rem);
  font-weight: 300;
  font-variation-settings: 'opsz' 144, 'SOFT' 80;
  margin-bottom: var(--s-2);
}

.welcome .italic-display {
  font-weight: 300;
  color: var(--jam);
}

.welcome-sub {
  font-family: var(--font-display);
  font-style: italic;
  font-size: var(--t-lg);
  color: var(--ink-soft);
  font-variation-settings: 'opsz' 144, 'SOFT' 100;
  margin-bottom: var(--s-6);
  font-weight: 300;
}

.welcome-body {
  max-width: 580px;
  margin: 0 auto var(--s-7);
  font-size: var(--t-md);
  color: var(--ink-soft);
}

.welcome-greeting {
  font-family: var(--font-display);
  font-style: italic;
  color: var(--crust-deep);
  font-variation-settings: 'opsz' 144, 'SOFT' 100;
  font-size: var(--t-md);
  margin-bottom: var(--s-3);
  font-weight: 400;
}

/* ---------- Progress loaf ---------- */

.progress-loaf {
  margin: var(--s-6) auto var(--s-7);
  max-width: 920px;
  text-align: left;
}

.progress-loaf-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--s-3);
  flex-wrap: wrap;
  margin-bottom: var(--s-3);
  padding: 0 var(--s-2);
}

.progress-loaf-title {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 400;
  font-size: var(--t-md);
  color: var(--ink);
  font-variation-settings: 'opsz' 144, 'SOFT' 100;
  margin: 0;
  letter-spacing: 0;
}

.loaf-arrow {
  display: inline-block;
  margin-left: 4px;
  color: var(--crust);
  font-style: normal;
  font-weight: 400;
  transform: translateY(2px);
}

.progress-loaf-count {
  font-family: var(--font-body);
  font-size: var(--t-sm);
  color: var(--ink-soft);
  text-align: right;
}

.progress-loaf-count em {
  font-family: var(--font-display);
  font-style: italic;
  color: var(--jam);
  font-weight: 700;
  font-size: var(--t-md);
  font-variation-settings: 'opsz' 144, 'SOFT' 100;
  font-variant-numeric: oldstyle-nums;
  margin-right: 2px;
}

.dot-sep {
  margin: 0 4px;
  color: var(--ink-faint);
}

/* ---- The track ---- */

.progress-loaf-track {
  /* The loaf itself: a plain, domed-top, flat-based silhouette drawn in CSS.
     Content-sized height means it grows naturally as the circles wrap into rows. */
  background: var(--paper);
  border: 1.4px solid var(--line);
  border-radius: 130px 130px 38px 38px / 88px 88px 32px 32px;
  padding: 30px clamp(20px, 4vw, 44px) 26px;
}

.loaf-rows {
  display: flex;
  flex-direction: column;
  gap: clamp(7px, 1.6vw, 13px);
}

.loaf-row {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: clamp(5px, 1.3vw, 11px);
}

.loaf-circle {
  flex: 0 1 auto;
  width: clamp(13px, 3.4vw, 22px);
  min-width: 9px;
  aspect-ratio: 1 / 1;
  border-radius: 50%;
  border: 1.5px dashed var(--ink-faint);
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  position: relative;
  transition: transform 200ms var(--ease), border-color 200ms var(--ease), background 200ms var(--ease);
}

.loaf-circle:hover:not(.is-stub) {
  transform: scale(1.3);
  z-index: 3;
}

.loaf-circle:focus-visible {
  outline: 2px solid var(--crust);
  outline-offset: 3px;
  z-index: 4;
}

.loaf-circle.status-completed {
  background: var(--olive);
  border: 1.5px solid var(--olive);
}

.loaf-circle.status-attempted {
  background: var(--crust);
  border: 1.5px solid var(--crust);
}

.loaf-circle.status-planned {
  background: transparent;
  border: 1.5px solid var(--crust-soft);
  border-style: solid;
}

/* Milestones override the regular fill colours */

.loaf-circle.is-milestone {
  border: 2px solid var(--jam);
  background: transparent;
}

.loaf-circle.is-milestone.status-attempted {
  background: var(--jam);
  opacity: 0.55;
}

.loaf-circle.is-milestone.status-completed {
  background: var(--jam);
  border-color: var(--jam);
}

.loaf-circle-star {
  width: 62%;
  height: 62%;
  fill: var(--jam);
  transition: fill 200ms var(--ease);
}

.loaf-circle.is-milestone.status-completed .loaf-circle-star,
.loaf-circle.is-milestone.status-attempted .loaf-circle-star {
  fill: var(--paper);
}

.loaf-circle.is-stub {
  cursor: default;
  opacity: 0.45;
}

/* ---- Legend ---- */

.progress-loaf-legend {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-4);
  justify-content: center;
  margin-top: var(--s-4);
  font-family: var(--font-display);
  font-size: var(--t-xs);
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-soft);
  font-variation-settings: 'opsz' 9, 'SOFT' 50;
}

.progress-loaf-legend > span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.legend-mark {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}

.legend-mark.legend-completed { background: var(--olive); }
.legend-mark.legend-attempted { background: var(--crust); }
.legend-mark.legend-ahead { border: 1.5px dashed var(--ink-faint); }
.legend-mark.legend-milestone { border: 1.6px solid var(--jam); }

/* Mobile loaf */

@media (max-width: 600px) {
  .progress-loaf-track {
    border-radius: 90px 90px 26px 26px / 60px 60px 22px 22px;
    padding: 22px 16px 18px;
  }
  .progress-loaf-legend {
    gap: var(--s-3);
    font-size: 0.66rem;
  }
}

/* ---------- Phase list ---------- */

.phase-list {
  margin-top: var(--s-7);
}

.phase {
  border-top: 1px solid var(--line);
  padding: var(--s-5) 0;
}

.phase:last-child {
  border-bottom: 1px solid var(--line);
}

.phase-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--s-4);
  cursor: pointer;
  padding: var(--s-2) 0;
  user-select: none;
  transition: color var(--dur) var(--ease);
}

.phase-header:hover {
  color: var(--crust-deep);
}

.phase-header-left {
  display: flex;
  align-items: baseline;
  gap: var(--s-4);
  flex: 1;
  min-width: 0;
}

.phase-number {
  font-family: var(--font-display);
  font-style: italic;
  font-size: var(--t-md);
  color: var(--crust);
  font-variation-settings: 'opsz' 144, 'SOFT' 100;
  font-weight: 400;
  white-space: nowrap;
}

.phase-title {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 3vw, 2.1rem);
  font-weight: 400;
  font-variation-settings: 'opsz' 144, 'SOFT' 60;
  letter-spacing: -0.01em;
  color: var(--ink);
}

.phase-progress {
  font-family: var(--font-body);
  font-size: var(--t-sm);
  color: var(--ink-quiet);
  font-style: italic;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: var(--s-3);
}

.phase-progress-bar {
  width: 80px;
  height: 4px;
  background: var(--line-soft);
  border-radius: 2px;
  overflow: hidden;
}

.phase-progress-fill {
  height: 100%;
  background: var(--crust);
  transition: width var(--dur-slow) var(--ease);
}

.phase-toggle {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ink-quiet);
  transition: transform var(--dur) var(--ease);
}

.phase.expanded .phase-toggle {
  transform: rotate(45deg);
}

.phase-body {
  display: none;
  padding-top: var(--s-4);
  padding-left: 0;
  animation: fadeIn var(--dur) var(--ease);
}

.phase.expanded .phase-body {
  display: block;
}

.phase-subtitle {
  font-family: var(--font-display);
  font-style: italic;
  font-size: var(--t-md);
  color: var(--ink-soft);
  font-variation-settings: 'opsz' 144, 'SOFT' 100;
  margin-bottom: var(--s-4);
  font-weight: 400;
}

.phase-intro {
  color: var(--ink-soft);
  margin-bottom: var(--s-5);
  max-width: 640px;
}

.phase-skills {
  background: var(--paper);
  border-left: 3px solid var(--crust-soft);
  padding: var(--s-4) var(--s-5);
  margin-bottom: var(--s-5);
  border-radius: 0 var(--radius) var(--radius) 0;
}

.phase-skills-label {
  font-family: var(--font-display);
  font-size: var(--t-xs);
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--crust-deep);
  font-variation-settings: 'opsz' 9;
  margin-bottom: var(--s-3);
}

.phase-skills ul {
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: var(--t-sm);
  color: var(--ink-soft);
}

.phase-skills li {
  padding: 2px 0;
}

.phase-skills li::before {
  content: '✦';
  color: var(--crust);
  margin-right: var(--s-3);
  font-size: 0.7em;
}

/* ---------- Recipe list (within phase) ---------- */

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

.recipe-row {
  display: flex;
  align-items: center;
  gap: var(--s-4);
  padding: var(--s-3) var(--s-3);
  margin: var(--s-2) calc(var(--s-3) * -1);
  border-radius: var(--radius);
  transition: background var(--dur) var(--ease);
  text-decoration: none;
  color: inherit;
}

.recipe-row:hover {
  background: var(--paper);
  color: inherit;
}

.recipe-row-week {
  font-family: var(--font-display);
  font-style: italic;
  font-size: var(--t-sm);
  color: var(--ink-quiet);
  font-variation-settings: 'opsz' 144, 'SOFT' 100;
  width: 70px;
  flex-shrink: 0;
}

.recipe-row-title {
  font-family: var(--font-display);
  font-size: var(--t-md);
  font-weight: 500;
  flex: 1;
  font-variation-settings: 'opsz' 144, 'SOFT' 50;
}

.recipe-row-meta {
  font-family: var(--font-body);
  font-size: var(--t-xs);
  color: var(--ink-quiet);
  font-style: italic;
  text-align: right;
}

.recipe-row-status {
  font-size: var(--t-xs);
  font-family: var(--font-display);
  font-style: italic;
  color: var(--ink-quiet);
  font-variation-settings: 'opsz' 144, 'SOFT' 100;
  flex-shrink: 0;
}

.recipe-row-status.completed {
  color: var(--olive);
}

.recipe-row-status.attempted {
  color: var(--crust);
}

.recipe-row-status.planned {
  color: var(--ink-faint);
}

.recipe-row.is-milestone .recipe-row-title {
  color: var(--jam-deep);
}

.recipe-row.is-milestone::after {
  content: '✦';
  color: var(--jam);
  font-size: 0.9em;
  margin-left: var(--s-2);
}

.recipe-row.is-stub {
  color: var(--ink-faint);
  pointer-events: none;
  cursor: default;
}

.recipe-row.is-stub .recipe-row-title {
  font-style: italic;
  font-weight: 400;
}

.phase-stub-note {
  font-style: italic;
  font-size: var(--t-sm);
  color: var(--ink-quiet);
  padding: var(--s-3) 0;
  font-family: var(--font-display);
  font-variation-settings: 'opsz' 144, 'SOFT' 100;
}

/* ---------- Recipe view ---------- */

.recipe-view {
  max-width: var(--container);
  margin: 0 auto;
}

.recipe-back {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  font-family: var(--font-display);
  font-size: var(--t-sm);
  font-style: italic;
  color: var(--ink-soft);
  text-decoration: none;
  margin-bottom: var(--s-5);
  font-variation-settings: 'opsz' 144, 'SOFT' 100;
}

.recipe-back:hover {
  color: var(--crust-deep);
}

.recipe-header {
  text-align: center;
  margin-bottom: var(--s-6);
  padding-bottom: var(--s-6);
  border-bottom: 1px solid var(--line);
  position: relative;
}

.recipe-eyebrow {
  font-family: var(--font-display);
  font-size: var(--t-xs);
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--crust);
  font-variation-settings: 'opsz' 9;
  margin-bottom: var(--s-3);
}

.recipe-eyebrow.milestone {
  color: var(--jam);
}

.recipe-title {
  font-size: clamp(2.2rem, 5vw, 3.6rem);
  font-weight: 300;
  font-variation-settings: 'opsz' 144, 'SOFT' 70;
  margin-bottom: var(--s-3);
  letter-spacing: -0.02em;
}

.recipe-subtitle {
  font-family: var(--font-display);
  font-style: italic;
  font-size: var(--t-md);
  color: var(--ink-soft);
  font-variation-settings: 'opsz' 144, 'SOFT' 100;
  font-weight: 400;
  margin-bottom: var(--s-5);
}

.recipe-source {
  font-size: var(--t-sm);
  color: var(--ink-soft);
  font-style: italic;
  max-width: 480px;
  margin: 0 auto;
}

.recipe-source-book {
  font-family: var(--font-display);
  font-weight: 500;
  font-style: italic;
  color: var(--ink);
  font-variation-settings: 'opsz' 144, 'SOFT' 100;
}

/* ---------- Why this recipe ---------- */

.why-this-recipe {
  background: var(--paper);
  border: 1px solid var(--line-soft);
  border-left: 4px solid var(--crust);
  padding: var(--s-5) var(--s-5);
  border-radius: 0 var(--radius) var(--radius) 0;
  margin-bottom: var(--s-6);
}

.why-this-recipe h3 {
  font-family: var(--font-display);
  font-size: var(--t-xs);
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--crust-deep);
  font-variation-settings: 'opsz' 9;
  margin-bottom: var(--s-3);
}

.why-this-recipe p {
  margin: 0;
  color: var(--ink-soft);
  font-size: var(--t-base);
}

/* ---------- Yield scaler ---------- */

.recipe-tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-4);
  padding: var(--s-4) 0;
  border-bottom: 1px solid var(--line-soft);
  margin-bottom: var(--s-5);
}

.yield-scaler {
  display: flex;
  align-items: center;
  gap: var(--s-3);
}

.yield-scaler-label {
  font-family: var(--font-display);
  font-style: italic;
  font-size: var(--t-sm);
  color: var(--ink-soft);
  font-variation-settings: 'opsz' 144, 'SOFT' 100;
}

.yield-control {
  display: flex;
  align-items: center;
  gap: var(--s-2);
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 100px;
  padding: 4px;
}

.yield-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--t-md);
  color: var(--crust-deep);
  font-weight: 600;
  transition: all var(--dur-fast) var(--ease);
}

.yield-btn:hover:not(:disabled) {
  background: var(--bg);
}

.yield-btn:active:not(:disabled) {
  transform: scale(0.92);
}

.yield-btn:disabled {
  color: var(--ink-faint);
  cursor: not-allowed;
}

.yield-value {
  min-width: 80px;
  text-align: center;
  font-family: var(--font-display);
  font-weight: 500;
  font-variation-settings: 'opsz' 144, 'SOFT' 50;
  font-size: var(--t-base);
  color: var(--ink);
}

/* ---------- Status control ---------- */

.status-control {
  display: flex;
  gap: var(--s-2);
  flex-wrap: wrap;
  align-items: center;
}

.status-control-label {
  font-family: var(--font-display);
  font-style: italic;
  font-size: var(--t-sm);
  color: var(--ink-soft);
  font-variation-settings: 'opsz' 144, 'SOFT' 100;
  margin-right: var(--s-2);
}

.status-btn {
  font-family: var(--font-display);
  font-size: var(--t-xs);
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 6px 14px;
  border: 1px solid var(--line);
  border-radius: 100px;
  background: var(--paper);
  color: var(--ink-soft);
  font-variation-settings: 'opsz' 9, 'SOFT' 50;
  transition: all var(--dur-fast) var(--ease);
}

.status-btn:hover {
  border-color: var(--crust-soft);
  color: var(--crust-deep);
}

.status-btn.active {
  background: var(--crust);
  border-color: var(--crust);
  color: var(--paper);
}

.status-btn.active.completed-state {
  background: var(--olive);
  border-color: var(--olive);
}

/* ---------- Two-column ingredients & method ---------- */

.recipe-body {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--s-6);
}

@media (min-width: 800px) {
  .recipe-body {
    grid-template-columns: 280px 1fr;
    gap: var(--s-7);
  }
}

.ingredients-panel {
  position: sticky;
  top: 100px;
  align-self: start;
}

.section-heading {
  font-family: var(--font-display);
  font-size: var(--t-xs);
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--crust-deep);
  font-variation-settings: 'opsz' 9;
  padding-bottom: var(--s-2);
  border-bottom: 1px solid var(--line);
  margin-bottom: var(--s-4);
}

.ingredients-list {
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: var(--t-base);
}

.ingredient {
  padding: var(--s-3) 0;
  border-bottom: 1px dotted var(--line-soft);
  display: flex;
  align-items: baseline;
  gap: var(--s-3);
}

.ingredient:last-child {
  border-bottom: none;
}

.ingredient-amount {
  font-family: var(--font-display);
  font-weight: 600;
  color: var(--crust-deep);
  font-variation-settings: 'opsz' 36, 'SOFT' 50;
  white-space: nowrap;
  min-width: 70px;
  font-variant-numeric: tabular-nums;
}

.ingredient-name {
  flex: 1;
  color: var(--ink);
}

.ingredient-note {
  display: block;
  font-size: var(--t-xs);
  color: var(--ink-quiet);
  font-style: italic;
  margin-top: 2px;
}

/* Inline ingredient reference in method body — clickable link to the ingredient row */
.ing-ref {
  font-family: var(--font-display);
  font-weight: 600;
  color: var(--crust-deep);
  text-decoration: none;
  border-bottom: 1px dashed var(--crust-soft);
  font-variation-settings: 'opsz' 36, 'SOFT' 50;
  font-variant-numeric: tabular-nums oldstyle-nums;
  transition: color 150ms var(--ease-soft), border-bottom-color 150ms var(--ease-soft), border-bottom-style 150ms var(--ease-soft);
  /* Allow the reference to wrap between the amount and the name */
  word-spacing: normal;
}

.ing-ref:hover,
.ing-ref:focus-visible {
  color: var(--jam);
  border-bottom-style: solid;
  border-bottom-color: var(--jam);
}

.ing-ref:focus-visible {
  outline: 2px solid var(--crust);
  outline-offset: 2px;
  border-radius: 2px;
}

/* Highlight pulse for the targeted ingredient row when an ing-ref is clicked */
.ingredient.ing-highlighted {
  animation: ingHighlight 1.6s var(--ease-soft);
  border-radius: 4px;
}

@keyframes ingHighlight {
  0% {
    background: transparent;
    box-shadow: 0 0 0 0 transparent;
  }
  15% {
    background: var(--crust-soft);
    box-shadow: 0 0 0 6px var(--crust-soft);
  }
  60% {
    background: var(--crust-soft);
    box-shadow: 0 0 0 6px var(--crust-soft);
  }
  100% {
    background: transparent;
    box-shadow: 0 0 0 0 transparent;
  }
}

/* ---------- Steps ---------- */

.steps-list {
  list-style: none;
  margin: 0;
  padding: 0;
  counter-reset: step;
}

.step {
  padding: var(--s-5) 0;
  border-bottom: 1px solid var(--line-soft);
  counter-increment: step;
}

.step:last-child {
  border-bottom: none;
}

.step-header {
  display: flex;
  align-items: baseline;
  gap: var(--s-4);
  margin-bottom: var(--s-3);
}

.step-number {
  font-family: var(--font-display);
  font-style: italic;
  font-size: var(--t-2xl);
  color: var(--crust);
  font-weight: 300;
  font-variation-settings: 'opsz' 144, 'SOFT' 100;
  line-height: 1;
  flex-shrink: 0;
  font-variant-numeric: oldstyle-nums;
  width: 50px;
}

.step-number::before {
  content: counter(step);
}

.step-title {
  font-family: var(--font-display);
  font-size: var(--t-lg);
  font-weight: 500;
  font-variation-settings: 'opsz' 144, 'SOFT' 50;
  letter-spacing: -0.01em;
  margin: 0;
  flex: 1;
}

.step-body {
  margin: 0 0 var(--s-3) 70px;
  color: var(--ink);
}

.step-look-for {
  margin-left: 70px;
  padding: var(--s-3) var(--s-4);
  background: rgba(184, 108, 42, 0.06);
  border-radius: var(--radius);
  font-size: var(--t-sm);
  color: var(--ink-soft);
  display: flex;
  gap: var(--s-3);
  align-items: flex-start;
}

.step-look-for::before {
  content: '👀';
  font-size: 1em;
  flex-shrink: 0;
}

.step-look-for-label {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 600;
  color: var(--crust-deep);
  font-variation-settings: 'opsz' 144, 'SOFT' 100;
  margin-right: 4px;
}

/* ---------- Timer ---------- */

.timer {
  margin-left: 70px;
  margin-top: var(--s-3);
  margin-bottom: var(--s-3);
  display: inline-flex;
  align-items: center;
  gap: var(--s-3);
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 100px;
  padding: var(--s-2) var(--s-3) var(--s-2) var(--s-4);
}

.timer.is-running {
  background: var(--crust);
  border-color: var(--crust);
  color: var(--paper);
  animation: pulseGlow 2s ease-in-out infinite;
}

.timer.is-done {
  background: var(--olive);
  border-color: var(--olive);
  color: var(--paper);
  animation: none;
}

.timer-icon {
  width: 18px;
  height: 18px;
}

.timer-display {
  font-family: var(--font-display);
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  font-size: var(--t-base);
  font-variation-settings: 'opsz' 36, 'SOFT' 50;
  min-width: 64px;
}

.timer-btn {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  color: var(--crust-deep);
  transition: all var(--dur-fast) var(--ease);
}

.timer.is-running .timer-btn {
  background: var(--crust-deep);
  color: var(--paper);
}

.timer-btn:hover {
  transform: scale(1.06);
}

.timer-btn:active {
  transform: scale(0.94);
}

@keyframes pulseGlow {
  0%, 100% { box-shadow: 0 0 0 0 rgba(184, 108, 42, 0.4); }
  50% { box-shadow: 0 0 0 8px rgba(184, 108, 42, 0); }
}

/* ---------- Tips section ---------- */

.tips {
  margin-top: var(--s-7);
  padding: var(--s-5) var(--s-5);
  background: var(--paper);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-lg);
  position: relative;
}

.tips-eyebrow {
  font-family: var(--font-display);
  font-size: var(--t-xs);
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--crust-deep);
  font-variation-settings: 'opsz' 9;
  margin-bottom: var(--s-3);
  display: flex;
  align-items: center;
  gap: var(--s-2);
}

.tips-eyebrow::before {
  content: '✦';
  color: var(--crust);
  font-size: 0.9em;
}

.tips ul {
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: var(--t-sm);
  color: var(--ink-soft);
}

.tips li {
  padding: var(--s-2) 0;
  border-bottom: 1px dotted var(--line);
}

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

/* ---------- Notes ---------- */

.notes-section {
  margin-top: var(--s-7);
}

.notes-textarea {
  width: 100%;
  min-height: 140px;
  padding: var(--s-4);
  font-family: var(--font-body);
  font-size: var(--t-base);
  line-height: 1.6;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  resize: vertical;
  transition: border-color var(--dur-fast) var(--ease);
}

.notes-textarea:focus {
  outline: none;
  border-color: var(--crust);
}

.notes-textarea::placeholder {
  color: var(--ink-faint);
  font-style: italic;
}

.notes-meta {
  font-size: var(--t-xs);
  color: var(--ink-quiet);
  font-style: italic;
  margin-top: var(--s-2);
}

/* ---------- Reference cards (kit bag) ---------- */

.reference-index {
  max-width: var(--container);
  margin: 0 auto;
}

.reference-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--s-4);
  margin-top: var(--s-5);
}

@media (min-width: 600px) {
  .reference-grid {
    grid-template-columns: 1fr 1fr;
  }
}

.reference-card {
  display: block;
  padding: var(--s-5);
  background: var(--paper);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-lg);
  text-decoration: none;
  color: inherit;
  transition: all var(--dur) var(--ease);
}

.reference-card:hover {
  border-color: var(--crust-soft);
  transform: translateY(-2px);
  box-shadow: var(--shadow-soft);
  color: inherit;
}

.reference-card-icon {
  width: 28px;
  height: 28px;
  color: var(--crust);
  margin-bottom: var(--s-3);
}

.reference-card-title {
  font-family: var(--font-display);
  font-size: var(--t-md);
  font-weight: 500;
  font-variation-settings: 'opsz' 144, 'SOFT' 50;
  margin-bottom: var(--s-1);
}

.reference-card-subtitle {
  font-family: var(--font-display);
  font-style: italic;
  font-size: var(--t-sm);
  color: var(--ink-soft);
  font-variation-settings: 'opsz' 144, 'SOFT' 100;
}

.reference-content {
  max-width: var(--container);
  margin: 0 auto;
}

.reference-content h2 {
  font-family: var(--font-display);
  font-size: var(--t-lg);
  font-weight: 500;
  margin-top: var(--s-6);
  margin-bottom: var(--s-3);
  font-variation-settings: 'opsz' 144, 'SOFT' 50;
  color: var(--crust-deep);
}

.reference-content p {
  margin: 0 0 var(--s-4) 0;
  color: var(--ink);
}

.reference-content strong {
  font-family: var(--font-display);
  font-weight: 600;
  font-variation-settings: 'opsz' 36, 'SOFT' 50;
  color: var(--ink);
}

.reference-content ul {
  padding-left: var(--s-5);
  margin: 0 0 var(--s-4) 0;
}

.reference-content li {
  padding: var(--s-1) 0;
}

/* Glossary */

.glossary {
  margin-top: var(--s-6);
}

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

.glossary-item {
  padding: var(--s-4) 0;
  border-bottom: 1px solid var(--line-soft);
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--s-2);
}

@media (min-width: 600px) {
  .glossary-item {
    grid-template-columns: 200px 1fr;
    gap: var(--s-4);
  }
}

.glossary-term {
  font-family: var(--font-display);
  font-weight: 600;
  font-variation-settings: 'opsz' 36, 'SOFT' 50;
  color: var(--crust-deep);
}

.glossary-def {
  color: var(--ink-soft);
  font-size: var(--t-sm);
}

/* ---------- Loading & empty states ---------- */

.loading {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--s-9);
  color: var(--ink-quiet);
  font-style: italic;
  font-family: var(--font-display);
  font-variation-settings: 'opsz' 144, 'SOFT' 100;
}

.loading::after {
  content: '...';
  animation: dots 1.4s infinite;
  margin-left: 4px;
}

@keyframes dots {
  0%, 20% { content: '.'; }
  40% { content: '..'; }
  60%, 100% { content: '...'; }
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ---------- Confetti / celebration ---------- */

.celebration {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 100;
  overflow: hidden;
}

.confetti-piece {
  position: absolute;
  width: 8px;
  height: 14px;
  top: -20px;
  animation: confetti 3s ease-out forwards;
  border-radius: 1px;
}

@keyframes confetti {
  0% {
    transform: translateY(0) rotate(0);
    opacity: 1;
  }
  100% {
    transform: translateY(110vh) rotate(720deg);
    opacity: 0;
  }
}

/* ---------- Footer ---------- */

.site-footer {
  text-align: center;
  padding: var(--s-7) var(--s-5);
  color: var(--ink-quiet);
  font-size: var(--t-sm);
  font-style: italic;
  font-family: var(--font-display);
  font-variation-settings: 'opsz' 144, 'SOFT' 100;
  border-top: 1px solid var(--line-soft);
  margin-top: var(--s-8);
}

/* ---------- Decorative wheat sprig ---------- */

.flourish {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: var(--s-3);
  margin: var(--s-5) 0;
  color: var(--crust);
  opacity: 0.7;
}

.flourish-line {
  flex: 0 1 80px;
  height: 1px;
  background: var(--line);
}

.flourish-mark {
  width: 20px;
  height: 20px;
}

/* ---------- Mobile tweaks ---------- */

@media (max-width: 600px) {
  body {
    font-size: 16px;
  }
  main {
    padding: var(--s-5) var(--s-4);
  }
  .site-header {
    padding: var(--s-3) var(--s-4);
  }
  .site-header-inner {
    gap: var(--s-3);
  }
  .brand-name {
    font-size: 0.95rem;
  }
  .brand-mark {
    width: 28px;
    height: 28px;
  }
  .nav {
    gap: var(--s-3);
  }
  .nav a {
    font-size: 0.72rem;
  }
  .step-number {
    font-size: var(--t-xl);
    width: 38px;
  }
  .step-body,
  .step-look-for,
  .timer {
    margin-left: 50px;
  }
  .recipe-tools {
    flex-direction: column;
    align-items: flex-start;
  }
  .ingredients-panel {
    position: static;
  }
}

@media (max-width: 420px) {
  .brand-name {
    display: none;
  }
}

/* ---------- Print styles ---------- */

@media print {
  @page {
    size: A4;
    margin: 18mm;
  }

  body {
    background: white;
    color: black;
    font-size: 11pt;
  }

  .site-header,
  .site-footer,
  .recipe-tools,
  .recipe-back,
  .nav,
  .timer,
  .status-control,
  .notes-section,
  .yield-scaler {
    display: none !important;
  }

  .recipe-view {
    max-width: 100%;
  }

  .recipe-header {
    border-bottom: 2px solid black;
    text-align: left;
    padding-bottom: 12pt;
    margin-bottom: 14pt;
  }

  .recipe-title {
    font-size: 26pt;
    color: black;
  }

  .why-this-recipe {
    border: 1pt solid #999;
    border-left-width: 3pt;
    page-break-inside: avoid;
  }

  .recipe-body {
    grid-template-columns: 200px 1fr !important;
    gap: 16pt;
  }

  .ingredients-panel {
    position: static;
  }

  .step {
    page-break-inside: avoid;
    border-bottom: 0.5pt solid #ccc;
  }

  .step-look-for {
    background: #f8f4ec;
    border-left: 2pt solid #888;
  }

  .ing-ref {
    border-bottom: 1px dotted #555;
    color: black;
  }

  a {
    color: black;
    text-decoration: none;
  }

  .recipe-source-book::after {
    /* No URL print noise */
  }
}
