:root {
  --paper: #f3eee5;
  --paper-deep: #ebe3d6;
  --surface: #fbf8f2;
  --ink: #211d18;
  --muted: #685e52;
  --rule: #d9cfbf;
  --rule-dark: #b9ac98;
  --accent: #8f3523;
  --accent-soft: #ead9cf;
  --danger: #9c2f23;
  --btn-bg: #211d18;
  --btn-fg: #fbf8f2;
  --photo-control-bg: rgba(251, 248, 242, 0.92);
  --photo-control-ink: #3a322a;
  --font-display: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --font-body: "Avenir Next", Avenir, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  color-scheme: light;
}

[data-theme="dark"] {
  --paper: #171411;
  --paper-deep: #201c17;
  --surface: #1c1814;
  --ink: #f2eadd;
  --muted: #b1a495;
  --rule: #3a322a;
  --rule-dark: #5a4f44;
  --accent: #e59a80;
  --accent-soft: #3b271f;
  --danger: #f08b76;
  --btn-bg: #f2eadd;
  --btn-fg: #1a1612;
  --photo-control-bg: rgba(28, 24, 20, 0.92);
  --photo-control-ink: #e8ddcf;
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 96px;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  transition: background-color 0.25s ease, color 0.25s ease;
}

body.no-scroll {
  overflow: hidden;
}

img {
  display: block;
  max-width: 100%;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
}

a {
  color: inherit;
}

[hidden] {
  display: none !important;
}

::selection {
  background: var(--accent);
  color: #fffaf4;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

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

.skip-link {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 200;
  padding: 10px 14px;
  background: var(--ink);
  color: var(--paper);
  font-size: 0.84rem;
  font-weight: 600;
  text-decoration: none;
  transform: translateY(-160%);
}

.skip-link:focus {
  transform: translateY(0);
}

.container {
  width: min(1160px, calc(100% - 48px));
  margin-inline: auto;
}

.icon {
  width: 20px;
  height: 20px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

h1,
h2,
h3 {
  font-family: var(--font-display);
  font-weight: 400;
}

.kicker {
  margin: 0;
  color: var(--accent);
  font-family: var(--font-body);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  line-height: 1.3;
  text-transform: uppercase;
}

/* Header */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 1px solid var(--rule);
  background: var(--paper);
}

.site-header.scrolled {
  background: var(--surface);
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 34px;
  min-height: 78px;
}

.brand {
  display: flex;
  align-items: baseline;
  gap: 12px;
  color: var(--ink);
  text-decoration: none;
}

.brand-name {
  font-family: var(--font-display);
  font-size: 1.85rem;
  font-weight: 500;
  letter-spacing: -0.035em;
  line-height: 1;
}

.brand-tagline {
  color: var(--muted);
  font-family: var(--font-display);
  font-size: 0.88rem;
  font-style: italic;
  line-height: 1;
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 24px;
}

.nav-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 0;
  border: 0;
  border-bottom: 1px solid transparent;
  border-radius: 0;
  background: transparent;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 500;
  line-height: 1.2;
  text-decoration: none;
  transition: color 0.2s ease, border-color 0.2s ease;
}

.nav-link:hover {
  border-bottom-color: var(--rule-dark);
  color: var(--ink);
}

.nav-count {
  display: inline-grid;
  place-items: center;
  min-width: 16px;
  color: var(--accent);
  font-size: 0.66rem;
  font-weight: 700;
  line-height: 1;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-left: auto;
}

.cart-btn .icon {
  width: 18px;
  height: 18px;
}

.cart-label {
  font-size: 0.82rem;
}

.cart-badge {
  position: static;
}

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 38px;
  padding: 0;
  border: 1px solid var(--rule);
  border-radius: 50%;
  background: transparent;
  color: var(--ink);
  transition: border-color 0.2s ease, color 0.2s ease;
}

.icon-btn:hover {
  border-color: var(--ink);
  color: var(--accent);
}

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

.theme-icon-sun {
  display: none;
}

[data-theme="dark"] .theme-icon-sun {
  display: block;
}

[data-theme="dark"] .theme-icon-moon {
  display: none;
}

/* Buttons */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 18px;
  border: 1px solid transparent;
  border-radius: 3px;
  background: transparent;
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 0.82rem;
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
  transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.btn .icon {
  width: 17px;
  height: 17px;
}

.btn:active {
  transform: translateY(1px);
}

.btn-primary {
  border-color: var(--btn-bg);
  background: var(--btn-bg);
  color: var(--btn-fg);
}

.btn-primary:hover {
  border-color: var(--accent);
  background: var(--accent);
  color: #fffaf4;
}

[data-theme="dark"] .btn-primary:hover {
  color: #1a1612;
}

.btn-outline {
  border-color: var(--ink);
  background: transparent;
  color: var(--ink);
}

.btn-outline:hover {
  background: var(--ink);
  color: var(--paper);
}

.btn-ghost {
  border-color: var(--rule-dark);
  background: transparent;
  color: var(--ink);
}

.btn-ghost:hover {
  border-color: var(--ink);
}

.btn-sm {
  padding: 8px 12px;
  font-size: 0.77rem;
}

.danger-text {
  color: var(--danger);
}

.text-link {
  padding: 4px 0;
  border: 0;
  border-bottom: 1px solid var(--rule-dark);
  border-radius: 0;
  background: transparent;
  color: var(--ink);
  font-size: 0.82rem;
  line-height: 1.3;
  text-align: left;
  transition: color 0.2s ease, border-color 0.2s ease;
}

.text-link:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* Intro */

.intro {
  padding: 66px 0 54px;
  border-bottom: 1px solid var(--rule);
}

.intro-inner {
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) minmax(320px, 0.88fr);
  align-items: end;
  gap: 72px;
}

.intro-copy {
  max-width: 700px;
}

.intro h1 {
  max-width: 12ch;
  margin: 18px 0 24px;
  font-size: clamp(3.2rem, 6.3vw, 5.6rem);
  letter-spacing: -0.045em;
  line-height: 0.95;
}

.intro-lede {
  max-width: 54ch;
  margin: 0 0 30px;
  color: var(--muted);
  font-size: 1.02rem;
  line-height: 1.65;
}

.intro-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px 28px;
  margin-top: 22px;
}

.intro-meta {
  color: var(--muted);
  font-size: 0.74rem;
  letter-spacing: 0.015em;
}

.intro-feature {
  width: 100%;
  max-width: 430px;
  margin: 0;
  justify-self: end;
}

.feature-media {
  aspect-ratio: 4 / 5;
  overflow: hidden;
  border: 1px solid var(--rule);
  background: var(--paper-deep);
}

.feature-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.intro-feature figcaption {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-top: 14px;
  padding-top: 13px;
  border-top: 1px solid var(--rule);
}

.feature-link {
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  font-family: var(--font-display);
  font-size: clamp(1.55rem, 2.2vw, 1.95rem);
  font-weight: 400;
  letter-spacing: -0.025em;
  line-height: 1.1;
  text-align: left;
  transition: color 0.2s ease;
}

.feature-link:hover {
  color: var(--accent);
}

.feature-meta {
  color: var(--muted);
  font-size: 0.75rem;
}

/* Search */

.search-wrap {
  position: relative;
  width: 100%;
  max-width: 550px;
}

.search-shell {
  display: flex;
  align-items: center;
  gap: 11px;
  height: 52px;
  padding: 0 14px;
  border: 1px solid var(--rule-dark);
  border-radius: 2px;
  background: transparent;
  transition: border-color 0.2s ease, background-color 0.2s ease;
}

.search-shell:focus-within {
  border-color: var(--accent);
  background: var(--surface);
}

.search-icon {
  width: 18px;
  height: 18px;
  color: var(--muted);
}

.search-shell input {
  flex: 1;
  min-width: 0;
  height: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  font-size: 0.94rem;
}

.search-shell input::placeholder {
  color: var(--muted);
  opacity: 0.9;
}

.search-shell input::-webkit-search-cancel-button {
  display: none;
}

.search-clear {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--paper-deep);
  color: var(--muted);
}

.search-clear:hover {
  color: var(--accent);
}

.search-clear .icon {
  width: 14px;
  height: 14px;
}

.search-kbd {
  padding: 2px 6px;
  border: 1px solid var(--rule);
  border-radius: 2px;
  background: transparent;
  color: var(--muted);
  font-family: var(--font-body);
  font-size: 0.68rem;
}

.search-suggest {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  left: 0;
  z-index: 40;
  max-height: min(430px, 65vh);
  padding: 6px;
  overflow-y: auto;
  border: 1px solid var(--rule-dark);
  border-radius: 2px;
  background: var(--surface);
  box-shadow: 0 24px 52px -28px rgba(40, 28, 16, 0.55);
}

.suggest-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 9px 9px;
  color: var(--muted);
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.suggest-item {
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  padding: 7px;
  border: 0;
  border-radius: 2px;
  background: transparent;
  color: var(--ink);
  text-align: left;
}

.suggest-item:hover,
.suggest-item:focus-visible {
  background: var(--paper-deep);
}

.suggest-item img {
  width: 46px;
  height: 46px;
  flex: none;
  object-fit: cover;
}

.suggest-copy {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.suggest-copy strong {
  overflow: hidden;
  font-family: var(--font-display);
  font-size: 1.08rem;
  font-weight: 400;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.suggest-copy small {
  overflow: hidden;
  color: var(--muted);
  font-size: 0.69rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.suggest-arrow {
  width: 15px;
  height: 15px;
  flex: none;
  margin-left: auto;
  color: var(--muted);
}

.suggest-all {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  margin-top: 4px;
  padding: 11px 8px 8px;
  border: 0;
  border-top: 1px solid var(--rule);
  border-radius: 0;
  background: transparent;
  color: var(--accent);
  font-size: 0.77rem;
  font-weight: 600;
}

.suggest-all:hover {
  background: var(--paper-deep);
}

.suggest-all .icon {
  width: 14px;
  height: 14px;
}

.suggest-empty {
  padding: 10px 12px 14px;
  color: var(--muted);
  font-size: 0.83rem;
  line-height: 1.5;
  text-align: center;
}

.suggest-empty p {
  margin: 0 0 10px;
}

.suggest-empty strong {
  color: var(--ink);
}

.suggest-reset {
  border: 0;
  background: transparent;
  color: var(--accent);
  font-size: 0.82rem;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* Recipe index */

.recipes-section {
  padding: 48px 0 92px;
}

.section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 24px;
}

.section-head h2 {
  margin: 7px 0 0;
  font-size: clamp(2.3rem, 3.6vw, 3.15rem);
  letter-spacing: -0.035em;
  line-height: 1;
}

.section-tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 24px;
}

.result-count {
  color: var(--muted);
  font-size: 0.76rem;
  font-variant-numeric: tabular-nums;
}

.select-wrap {
  position: relative;
}

.select-wrap::after {
  content: "";
  position: absolute;
  top: 50%;
  right: 5px;
  width: 6px;
  height: 6px;
  border-right: 1px solid var(--muted);
  border-bottom: 1px solid var(--muted);
  transform: translateY(-70%) rotate(45deg);
  pointer-events: none;
}

.select-wrap select {
  appearance: none;
  padding: 7px 25px 7px 0;
  border: 0;
  border-bottom: 1px solid var(--rule-dark);
  border-radius: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font-size: 0.77rem;
  cursor: pointer;
}

.select-wrap select:focus {
  border-bottom-color: var(--accent);
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 22px;
  margin: 0 0 34px;
  padding: 0;
  border-bottom: 1px solid var(--rule);
}

.chip {
  flex: none;
  margin-bottom: -1px;
  padding: 0 0 11px;
  border: 0;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  background: transparent;
  color: var(--muted);
  font-size: 0.79rem;
  font-weight: 500;
  line-height: 1.2;
  transition: color 0.2s ease, border-color 0.2s ease;
}

.chip:hover {
  color: var(--ink);
}

.chip.is-active {
  border-bottom-color: var(--accent);
  color: var(--ink);
  font-weight: 600;
}

.recipe-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 44px 28px;
}

.recipe-card {
  min-width: 0;
  cursor: pointer;
}

.recipe-card.is-flash {
  outline: 2px solid var(--accent);
  outline-offset: 5px;
}

.card-media {
  position: relative;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: var(--paper-deep);
}

.card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: opacity 0.25s ease;
}

.recipe-card:hover .card-media img {
  opacity: 0.88;
}

.fav-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--photo-control-bg);
  color: var(--photo-control-ink);
  transition: color 0.2s ease, transform 0.2s ease;
}

.fav-btn:hover {
  color: var(--accent);
  transform: scale(1.04);
}

.fav-btn .icon {
  width: 18px;
  height: 18px;
}

.fav-btn.is-fav {
  color: var(--accent);
}

.fav-btn.is-fav .icon {
  fill: currentColor;
}

.card-body {
  padding: 14px 0 0;
}

.card-cat {
  color: var(--accent);
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.13em;
  line-height: 1.2;
  text-transform: uppercase;
}

.card-body h3 {
  margin: 7px 0 5px;
  font-size: 1.52rem;
  letter-spacing: -0.02em;
  line-height: 1.12;
}

.card-title {
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  letter-spacing: inherit;
  line-height: inherit;
  text-align: left;
  transition: color 0.2s ease;
}

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

.card-body > p {
  display: -webkit-box;
  margin: 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 0.83rem;
  line-height: 1.5;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.card-meta {
  display: flex;
  flex-wrap: wrap;
  margin-top: 10px;
  color: var(--muted);
  font-size: 0.71rem;
  line-height: 1.4;
}

.card-meta span + span::before {
  content: "·";
  margin: 0 7px;
  color: var(--rule-dark);
}

.empty-state {
  max-width: 560px;
  margin: 40px auto 0;
  padding: 46px 0;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  text-align: center;
}

.empty-state h3 {
  margin: 0 0 8px;
  font-size: 1.9rem;
  letter-spacing: -0.02em;
}

.empty-state p {
  max-width: 42ch;
  margin: 0 auto 20px;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.6;
}

/* Footer */

.site-footer {
  padding: 30px 0 38px;
  border-top: 1px solid var(--rule);
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 22px;
}

.footer-brand strong {
  display: block;
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 500;
  letter-spacing: -0.03em;
  line-height: 1;
}

.footer-brand p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 0.78rem;
}

.footer-side {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 5px;
}

.footer-note {
  max-width: 46ch;
  margin: 0;
  color: var(--muted);
  font-size: 0.72rem;
  line-height: 1.5;
  text-align: right;
}

.footer-credits {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 600;
  text-decoration: underline;
  text-decoration-color: var(--rule-dark);
  text-underline-offset: 3px;
}

.footer-credits:hover {
  color: var(--accent);
  text-decoration-color: var(--accent);
}

/* Dialogs */

dialog.modal {
  max-width: none;
  max-height: none;
  margin: auto;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
}

dialog.modal::backdrop {
  background: rgba(25, 19, 13, 0.62);
}

.recipe-modal {
  display: none;
  width: min(900px, calc(100vw - 32px));
  max-height: calc(100dvh - 40px);
}

.recipe-modal[open] {
  display: flex;
  flex-direction: column;
  max-height: calc(100dvh - 40px);
  overflow: hidden;
  border-radius: 3px;
  background: var(--surface);
  box-shadow: 0 32px 80px -30px rgba(0, 0, 0, 0.55);
}

.recipe-content {
  position: relative;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 5;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--photo-control-bg);
  color: var(--photo-control-ink);
  transition: color 0.2s ease, transform 0.2s ease;
}

.modal-close:hover {
  color: var(--accent);
  transform: rotate(90deg);
}

.modal-close .icon {
  width: 18px;
  height: 18px;
}

.recipe-hero {
  height: 340px;
  background: var(--paper-deep);
}

.recipe-hero img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.recipe-body {
  padding: 30px 40px 42px;
}

.recipe-cat {
  margin: 0 0 8px;
  color: var(--accent);
  font-size: 0.67rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.recipe-head h2 {
  margin: 0 0 10px;
  font-size: clamp(2.2rem, 4vw, 3.1rem);
  letter-spacing: -0.04em;
  line-height: 0.98;
}

.recipe-desc {
  max-width: 62ch;
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.recipe-facts {
  display: flex;
  flex-wrap: wrap;
  margin: 22px 0;
  padding: 11px 0;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  color: var(--muted);
  font-size: 0.78rem;
}

.recipe-facts span + span::before {
  content: "·";
  margin: 0 9px;
  color: var(--rule-dark);
}

.recipe-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 30px;
}

.btn-ghost.is-fav {
  border-color: var(--accent);
  color: var(--accent);
}

.btn-ghost.is-fav .icon {
  fill: currentColor;
}

.recipe-layout {
  display: grid;
  grid-template-columns: minmax(240px, 0.82fr) minmax(0, 1.3fr);
  gap: 40px;
}

.ingredients-panel {
  align-self: start;
  padding: 18px 20px 8px;
  border-top: 2px solid var(--ink);
  background: var(--paper-deep);
}

.servings {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--rule);
}

.servings > span {
  color: var(--muted);
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.stepper {
  display: flex;
  align-items: center;
  gap: 1px;
  padding: 2px;
  border: 1px solid var(--rule-dark);
  border-radius: 2px;
  background: var(--surface);
}

.stepper button {
  display: grid;
  place-items: center;
  width: 27px;
  height: 27px;
  padding: 0;
  border: 0;
  border-radius: 1px;
  background: transparent;
  color: var(--ink);
}

.stepper button:hover {
  background: var(--accent-soft);
  color: var(--accent);
}

.stepper button .icon {
  width: 13px;
  height: 13px;
}

.servings-value {
  min-width: 29px;
  text-align: center;
  font-size: 0.85rem;
  font-weight: 600;
}

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

.ingredients li {
  border-bottom: 1px solid var(--rule);
}

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

.ingredient {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 9px 0;
  font-size: 0.86rem;
  line-height: 1.45;
  cursor: pointer;
}

.ingredient input {
  width: 15px;
  height: 15px;
  margin: 3px 0 0;
  accent-color: var(--accent);
  cursor: pointer;
}

.ingredient input:checked + span {
  color: var(--muted);
  text-decoration: line-through;
}

.ingredient strong {
  font-weight: 600;
}

.steps-panel h3 {
  margin: 0 0 16px;
  font-size: 1.55rem;
  letter-spacing: -0.02em;
}

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

.steps li {
  position: relative;
  margin-bottom: 18px;
  padding-left: 32px;
  font-size: 0.91rem;
  line-height: 1.6;
  counter-increment: step;
}

.steps li::before {
  content: counter(step) ".";
  position: absolute;
  top: 0;
  left: 0;
  color: var(--accent);
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 500;
}

.tip {
  margin-top: 26px;
  padding: 2px 0 2px 16px;
  border-left: 2px solid var(--accent);
}

.tip strong {
  display: block;
  margin-bottom: 4px;
  color: var(--accent);
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.tip p {
  margin: 0;
  font-size: 0.87rem;
  line-height: 1.55;
}

/* Add-recipe form */

.form-modal {
  display: none;
  width: min(740px, calc(100vw - 32px));
}

.form-modal[open] {
  display: flex;
  flex-direction: column;
  max-height: calc(100dvh - 40px);
  overflow: hidden;
  border-radius: 3px;
  background: var(--surface);
  box-shadow: 0 32px 80px -30px rgba(0, 0, 0, 0.55);
}

.modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  padding: 24px 30px 18px;
  border-bottom: 1px solid var(--rule);
}

.modal-head .kicker {
  margin-bottom: 7px;
}

.modal-head h2 {
  margin: 0;
  font-size: 2rem;
  letter-spacing: -0.03em;
  line-height: 1;
}

#addForm {
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.form-body {
  overflow-y: auto;
  padding: 22px 30px 28px;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px 18px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field.full,
.check-field.full {
  grid-column: 1 / -1;
}

.field > label,
.field-label {
  font-size: 0.76rem;
  font-weight: 600;
}

.field-help {
  margin: -2px 0 0;
  color: var(--muted);
  font-size: 0.7rem;
  line-height: 1.45;
}

.upload-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 12px;
}

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

.upload-button {
  cursor: pointer;
}

.upload-input:focus-visible + .upload-button {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.upload-name {
  max-width: 330px;
  overflow: hidden;
  color: var(--muted);
  font-size: 0.74rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.upload-remove {
  margin-left: auto;
  font-size: 0.74rem;
}

.image-preview {
  width: min(240px, 100%);
  margin-top: 4px;
  border: 1px solid var(--rule);
  background: var(--paper-deep);
}

.image-preview img {
  width: 100%;
  max-height: 170px;
  object-fit: cover;
}

.btn:disabled {
  opacity: 0.55;
  cursor: wait;
}

.label-hint {
  margin-left: 4px;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 400;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--rule-dark);
  border-radius: 2px;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font-size: 0.88rem;
}

.field textarea {
  min-height: 96px;
  line-height: 1.5;
  resize: vertical;
}

.field input::placeholder,
.field textarea::placeholder {
  color: var(--muted);
  opacity: 0.78;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: var(--accent);
}

.check-field {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.84rem;
  cursor: pointer;
}

.check-field input {
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
}

.form-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 15px 30px;
  border-top: 1px solid var(--rule);
  background: var(--paper-deep);
}

.form-note {
  margin: 0;
  color: var(--muted);
  font-size: 0.7rem;
}

.form-actions {
  display: flex;
  gap: 8px;
}

/* Shopping list */

.drawer {
  display: none;
  width: min(420px, 100vw);
  height: 100dvh;
  max-height: 100dvh;
  margin: 0 0 0 auto;
}

.drawer[open] {
  display: flex;
  flex-direction: column;
  height: 100dvh;
  margin: 0 0 0 auto;
  overflow: hidden;
  border-radius: 0;
  background: var(--surface);
  box-shadow: -24px 0 70px -30px rgba(0, 0, 0, 0.5);
}

.drawer::backdrop {
  background: rgba(25, 19, 13, 0.55);
}

.drawer-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 22px 24px 15px;
  border-bottom: 1px solid var(--rule);
}

.drawer-head .kicker {
  margin-bottom: 5px;
}

.drawer-head h2 {
  margin: 0;
  font-size: 1.9rem;
  letter-spacing: -0.03em;
  line-height: 1;
}

.shopping-add {
  display: flex;
  gap: 8px;
  padding: 16px 24px;
  border-bottom: 1px solid var(--rule);
}

.shopping-add input {
  flex: 1;
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid var(--rule-dark);
  border-radius: 2px;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font-size: 0.86rem;
}

.shopping-add input:focus {
  border-color: var(--accent);
}

.shopping-add .btn {
  width: 42px;
  height: 42px;
  flex: none;
  padding: 0;
  border-radius: 2px;
}

.shopping-body {
  flex: 1;
  overflow-y: auto;
  padding: 0 24px 22px;
  scrollbar-width: thin;
}

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

.shopping-list li {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 0;
  border-bottom: 1px solid var(--rule);
}

.shopping-list li:last-child {
  border-bottom: 0;
}

.item-check {
  width: 17px;
  height: 17px;
  flex: none;
  accent-color: var(--accent);
  cursor: pointer;
}

.item-main {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.item-text {
  font-size: 0.88rem;
  line-height: 1.4;
  transition: color 0.2s ease;
}

.item-source {
  overflow: hidden;
  color: var(--muted);
  font-size: 0.68rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.shopping-list li.is-done .item-text {
  color: var(--muted);
  text-decoration: line-through;
}

.shopping-list li.is-done .item-source {
  opacity: 0.6;
}

.item-remove {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  flex: none;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--muted);
}

.item-remove:hover {
  background: var(--paper-deep);
  color: var(--danger);
}

.item-remove .icon {
  width: 14px;
  height: 14px;
}

.drawer-empty {
  padding: 42px 6px;
  text-align: center;
}

.drawer-empty h3 {
  margin: 0 0 7px;
  font-size: 1.45rem;
  letter-spacing: -0.02em;
}

.drawer-empty p {
  max-width: 32ch;
  margin: 0 auto;
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.6;
}

.drawer-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 24px 17px;
  border-top: 1px solid var(--rule);
  background: var(--paper-deep);
}

.shopping-summary {
  color: var(--muted);
  font-size: 0.74rem;
}

.drawer-actions {
  display: flex;
  gap: 6px;
}

/* Toasts */

.toasts {
  position: fixed;
  bottom: 24px;
  left: 50%;
  z-index: 100;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  width: max-content;
  max-width: calc(100vw - 32px);
  transform: translateX(-50%);
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: 100%;
  padding: 10px 16px;
  border-radius: 2px;
  background: var(--ink);
  color: var(--paper);
  font-size: 0.8rem;
  font-weight: 500;
  box-shadow: 0 16px 40px -18px rgba(0, 0, 0, 0.45);
}

.toast.out {
  opacity: 0;
  transition: opacity 0.25s ease;
}

/* Credits */

.credits-header {
  padding: 18px 0;
  border-bottom: 1px solid var(--rule);
}

.credits-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
}

.back-link {
  color: var(--muted);
  font-size: 0.8rem;
  text-decoration: underline;
  text-decoration-color: var(--rule-dark);
  text-underline-offset: 3px;
}

.back-link:hover {
  color: var(--accent);
  text-decoration-color: var(--accent);
}

.credits-main {
  padding: 56px 0 78px;
}

.credits-main h1 {
  margin: 14px 0 15px;
  font-size: clamp(3rem, 6vw, 4.8rem);
  letter-spacing: -0.045em;
  line-height: 0.95;
}

.credits-intro {
  max-width: 72ch;
  margin: 0 0 38px;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.65;
}

.credit-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  column-gap: 32px;
  border-top: 1px solid var(--rule);
}

.credit {
  display: flex;
  align-items: center;
  gap: 13px;
  margin: 0;
  padding: 13px 0;
  border-bottom: 1px solid var(--rule);
}

.credit img {
  width: 76px;
  height: 58px;
  flex: none;
  object-fit: cover;
}

.credit figcaption {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.credit strong {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 400;
  line-height: 1.2;
}

.credit span {
  color: var(--muted);
  font-size: 0.69rem;
  line-height: 1.4;
}

.credit a {
  color: inherit;
  text-underline-offset: 2px;
}

.credit a:hover {
  color: var(--accent);
}

.credits-footer {
  padding: 24px 0 34px;
  border-top: 1px solid var(--rule);
  color: var(--muted);
  font-size: 0.72rem;
}

/* Responsive */

@media (max-width: 1024px) {
  .intro-inner {
    gap: 48px;
  }

  .recipe-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .main-nav {
    display: none;
  }

  .intro {
    padding: 46px 0 42px;
  }

  .intro-inner {
    grid-template-columns: 1fr;
    gap: 38px;
  }

  .intro h1 {
    max-width: 14ch;
  }

  .intro-feature {
    max-width: 460px;
    justify-self: start;
  }

  .feature-media {
    aspect-ratio: 16 / 10;
  }
}

@media (max-width: 720px) {
  .container {
    width: calc(100% - 32px);
  }

  .header-inner {
    min-height: 68px;
    gap: 12px;
  }

  .brand-name {
    font-size: 1.55rem;
  }

  .brand-tagline,
  .cart-label {
    display: none;
  }

  .header-actions {
    gap: 8px;
  }

  .add-btn {
    width: 38px;
    height: 38px;
    padding: 0;
  }

  .add-btn span {
    display: none;
  }

  .intro h1 {
    margin-top: 14px;
    font-size: clamp(2.7rem, 13vw, 4rem);
  }

  .intro-lede {
    font-size: 0.97rem;
  }

  .intro-actions {
    align-items: flex-start;
    flex-direction: column;
    gap: 11px;
  }

  .feature-media {
    aspect-ratio: 4 / 3;
  }

  .search-shell {
    height: 50px;
  }

  .search-kbd {
    display: none;
  }

  .recipes-section {
    padding: 34px 0 64px;
  }

  .section-head {
    align-items: flex-start;
  }

  .section-tools {
    width: 100%;
    justify-content: space-between;
    gap: 14px;
  }

  .chips {
    flex-wrap: wrap;
    gap: 8px 20px;
  }

  .recipe-grid {
    grid-template-columns: 1fr;
    gap: 34px;
  }

  .card-body h3 {
    font-size: 1.65rem;
  }

  .site-footer {
    padding: 24px 0 30px;
  }

  .footer-inner {
    display: block;
  }

  .footer-side {
    align-items: flex-start;
    margin-top: 16px;
  }

  .footer-note {
    text-align: left;
  }

  .recipe-modal,
  .form-modal,
  .drawer {
    width: 100vw;
    height: 100dvh;
    max-height: 100dvh;
  }

  .recipe-modal[open],
  .form-modal[open] {
    height: 100dvh;
    max-height: 100dvh;
    border-radius: 0;
  }

  .recipe-hero {
    height: 230px;
  }

  .recipe-body {
    padding: 22px 18px 32px;
  }

  .recipe-layout {
    grid-template-columns: 1fr;
    gap: 28px;
  }

  .modal-close {
    top: 12px;
    right: 12px;
  }

  .modal-head {
    padding: 20px 20px 16px;
  }

  .modal-head h2 {
    font-size: 1.7rem;
  }

  .form-body {
    padding: 18px 20px 22px;
  }

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

  .field.full,
  .check-field.full {
    grid-column: auto;
  }

  .form-foot {
    padding: 14px 20px;
  }

  .form-note {
    display: none;
  }

  .form-actions {
    width: 100%;
  }

  .form-actions .btn {
    flex: 1;
  }

  .drawer-head {
    padding: 20px 20px 14px;
  }

  .shopping-add {
    padding: 14px 20px;
  }

  .shopping-body {
    padding: 0 20px 20px;
  }

  .drawer-foot {
    padding: 12px 20px 16px;
  }

  .credits-main {
    padding: 38px 0 54px;
  }

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

@media (max-width: 420px) {
  .drawer-actions {
    width: 100%;
    justify-content: space-between;
  }

  .shopping-summary {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Print */

@media print {
  @page {
    margin: 16mm;
  }

  body {
    background: #fff !important;
    color: #000 !important;
  }

  body > *:not(#recipeDialog) {
    display: none !important;
  }

  #recipeDialog {
    display: block !important;
    position: static !important;
    width: 100% !important;
    max-height: none !important;
    margin: 0 !important;
    overflow: visible !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: #fff !important;
    box-shadow: none !important;
  }

  #recipeDialog::backdrop {
    display: none !important;
  }

  .recipe-content {
    overflow: visible !important;
  }

  .recipe-hero {
    height: 200px !important;
    break-inside: avoid;
  }

  .recipe-body {
    padding: 18px 0 0 !important;
  }

  .modal-close,
  .recipe-actions,
  .stepper {
    display: none !important;
  }

  .recipe-layout {
    grid-template-columns: 1fr 1.4fr;
    gap: 24px;
  }

  .ingredients-panel {
    border: 0 !important;
    border-top: 1px solid #ccc !important;
    background: #fff !important;
  }

  .tip {
    border-left-color: #999 !important;
  }

  .steps li,
  .ingredients li,
  .tip {
    break-inside: avoid;
  }
}
