:root {
  --paper: #f3efe6;
  --paper-deep: #e7e0d2;
  --card: #fffaf3;
  --ink: #241c16;
  --muted: #6d6258;
  --line: #e3d7c6;
  --leaf: #234c39;
  --leaf-soft: #e4f0e8;
  --tomato: #c4492c;
  --tomato-dark: #9a341c;
  --amber: #e7d3a8;
  --shadow: 0 16px 40px rgba(55, 36, 18, 0.08);
  --serif: "Fraunces", "Iowan Old Style", Palatino, Georgia, serif;
  --sans: "Figtree", "Avenir Next", "Segoe UI", sans-serif;
  --radius: 18px;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(224, 122, 61, 0.14), transparent 32rem),
    linear-gradient(180deg, #f7f3ea 0%, var(--paper) 18rem);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.5;
}

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

a {
  color: inherit;
}

.skip {
  position: absolute;
  left: 1rem;
  top: -4rem;
  background: var(--ink);
  color: white;
  padding: 0.5rem 0.8rem;
  border-radius: 8px;
  z-index: 5;
}

.skip:focus {
  top: 1rem;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.25rem clamp(1rem, 3vw, 2.5rem);
  position: sticky;
  top: 0;
  z-index: 4;
  background: rgba(243, 239, 230, 0.9);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid transparent;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  text-decoration: none;
}

.mark {
  width: 2.7rem;
  height: 2.7rem;
  color: var(--leaf);
  flex: none;
}

.eyebrow {
  display: block;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.wordmark {
  display: block;
  font-family: var(--serif);
  font-size: 1.7rem;
  font-weight: 680;
  line-height: 1;
}

.surprise,
.empty button,
.detail-nav button,
.detail-nav a,
.text-button {
  border: 0;
  cursor: pointer;
  text-decoration: none;
}

.surprise {
  background: var(--tomato);
  color: #fffaf6;
  border-radius: 999px;
  padding: 0.75rem 1.15rem;
  font-weight: 700;
  white-space: nowrap;
  flex: none;
  box-shadow: 0 8px 18px rgba(196, 73, 44, 0.25);
}

.surprise:hover {
  background: var(--tomato-dark);
}

.surprise:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  box-shadow: none;
}

.layout {
  display: grid;
  grid-template-columns: 290px minmax(0, 1fr);
  gap: 1.5rem;
  width: min(1180px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 1.25rem 0 3rem;
}

.filters {
  align-self: start;
  position: sticky;
  top: 5.5rem;
  max-height: calc(100vh - 6.5rem);
  overflow: auto;
  background: rgba(255, 250, 243, 0.8);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0.4rem 1rem 1rem;
}

.filters summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  cursor: pointer;
  font-weight: 700;
  padding: 0.7rem 0;
  list-style: none;
}

.filters summary::-webkit-details-marker {
  display: none;
}

.filter-count {
  min-width: 1.4rem;
  height: 1.4rem;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  background: var(--leaf);
  color: white;
  font-size: 0.75rem;
}

.field,
fieldset {
  border: 0;
  margin: 0 0 1rem;
  padding: 0;
}

.field span,
legend {
  display: block;
  margin-bottom: 0.4rem;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

input[type="search"],
input[type="text"],
select {
  width: 100%;
  border: 1px solid var(--line);
  background: white;
  border-radius: 12px;
  padding: 0.65rem 0.75rem;
}

input:focus,
select:focus,
button:focus-visible,
a:focus-visible {
  outline: 3px solid rgba(196, 73, 44, 0.35);
  outline-offset: 2px;
}

.choices,
.quick,
.checks {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.choices label,
.quick button,
.checks label {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  border: 1px solid var(--line);
  background: white;
  border-radius: 999px;
  padding: 0.28rem 0.65rem;
  font-size: 0.92rem;
}

.choices label:has(input:checked),
.quick button[aria-pressed="true"],
.checks label:has(input:checked) {
  background: var(--leaf-soft);
  border-color: #b7d2c4;
  color: var(--leaf);
  font-weight: 650;
}

.choices input,
.checks input {
  accent-color: var(--leaf);
}

.quick button {
  cursor: pointer;
}

.checks.scroll {
  max-height: 11rem;
  overflow: auto;
  padding-right: 0.2rem;
}

.picker {
  position: relative;
  margin-top: 0.55rem;
}

.suggestions {
  position: absolute;
  z-index: 2;
  left: 0;
  right: 0;
  top: calc(100% + 0.25rem);
  background: white;
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.suggestions button {
  display: block;
  width: 100%;
  text-align: left;
  border: 0;
  background: white;
  padding: 0.55rem 0.75rem;
  cursor: pointer;
}

.suggestions button:hover,
.suggestions button[aria-selected="true"] {
  background: var(--paper);
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.5rem;
}

.chip {
  border: 0;
  background: var(--ink);
  color: #fffaf3;
  border-radius: 999px;
  padding: 0.25rem 0.6rem;
  cursor: pointer;
  font-size: 0.88rem;
}

.chip span {
  margin-left: 0.35rem;
  opacity: 0.7;
}

.text-button,
.empty button {
  background: transparent;
  color: var(--tomato-dark);
  font-weight: 700;
  padding: 0;
}

.toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
}

.count {
  margin: 0;
  color: var(--muted);
  font-weight: 600;
}

.sort {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--muted);
  font-size: 0.92rem;
}

.sort select {
  width: auto;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 1rem;
}

.card {
  display: flex;
  flex-direction: column;
  min-height: 100%;
  background: var(--card);
  border-radius: var(--radius);
  overflow: hidden;
  text-decoration: none;
  border: 1px solid rgba(227, 215, 198, 0.9);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.7) inset;
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.card-media {
  aspect-ratio: 4 / 3;
  background: var(--amber);
  overflow: hidden;
}

.card-media img,
.hero img,
.step img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.card:hover img {
  transform: scale(1.03);
}

.card-media img {
  transition: transform 180ms ease;
}

.card-body {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: 0.9rem 0.95rem 1rem;
  flex: 1;
}

.kicker {
  margin: 0;
  color: var(--leaf);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.card h2,
.detail-copy h1,
.step h3 {
  font-family: var(--serif);
  font-weight: 560;
  letter-spacing: -0.02em;
}

.card h2 {
  margin: 0;
  font-size: 1.28rem;
  line-height: 1.15;
}

.subtitle,
.meta,
.note,
.fine {
  color: var(--muted);
}

.subtitle,
.meta {
  margin: 0;
}

.subtitle {
  font-size: 0.95rem;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  margin-top: auto;
  padding-top: 0.45rem;
}

.tag {
  background: var(--paper-deep);
  color: var(--ink);
  border-radius: 999px;
  padding: 0.12rem 0.45rem;
  font-size: 0.75rem;
  font-weight: 650;
}

.empty {
  text-align: center;
  padding: 3rem 1rem;
}

.empty h2 {
  font-family: var(--serif);
  margin-bottom: 0.3rem;
}

.detail-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  margin-bottom: 1rem;
}

.detail-nav a,
.detail-nav button {
  background: white;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.4rem 0.75rem;
  font-weight: 650;
}

.detail-nav .position {
  margin-left: auto;
  color: var(--muted);
  font-size: 0.92rem;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(280px, 0.95fr);
  gap: 1.25rem;
  margin-bottom: 1.5rem;
}

.hero-media {
  position: relative;
  border-radius: 24px;
  overflow: hidden;
  background: var(--amber);
  min-height: 320px;
}

.hero-media img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  max-height: none;
  object-fit: cover;
}

.detail-copy h1 {
  margin: 0.15rem 0 0.35rem;
  font-size: clamp(2rem, 4vw, 3.3rem);
  line-height: 0.95;
}

.stat-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin: 0.9rem 0;
}

.stat {
  background: white;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 0.45rem 0.7rem;
  min-width: 5.5rem;
}

.stat b {
  display: block;
  font-size: 1.05rem;
}

.stat span {
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.columns {
  display: grid;
  grid-template-columns: minmax(240px, 0.8fr) minmax(0, 1.2fr);
  gap: 1.5rem;
  align-items: start;
}

.panel {
  background: rgba(255, 250, 243, 0.76);
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 1rem 1rem 1.1rem;
}

.notes-button,
.notes-status {
  display: none;
}

.notes-button {
  width: 100%;
  justify-content: center;
  margin: 0 0 0.85rem;
  border: 0;
  background: var(--leaf);
  color: #f7f3ea;
  border-radius: 999px;
  padding: 0.75rem 1rem;
  font-weight: 700;
  cursor: pointer;
}

.notes-button:hover {
  background: #1b3d2e;
}

.notes-status {
  margin: -0.35rem 0 0.8rem;
  color: var(--leaf);
  font-weight: 650;
}

.panel h2 {
  margin: 0 0 0.8rem;
  font-size: 0.82rem;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--muted);
}

.ingredient-list,
.steps {
  list-style: none;
  margin: 0;
  padding: 0;
}

.ingredient-list li {
  display: grid;
  grid-template-columns: 6.5rem minmax(0, 1fr);
  gap: 0.4rem 0.7rem;
  padding: 0.45rem 0;
  border-top: 1px solid var(--line);
}

.ingredient-list li:first-child {
  border-top: 0;
}

.amount {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.note,
.fine {
  display: block;
  font-size: 0.85rem;
}

.pantry-label {
  margin: 1rem 0 0.2rem;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.step {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 0.8rem;
  padding: 0.9rem 0;
  border-top: 1px solid var(--line);
}

.step:first-child {
  border-top: 0;
  padding-top: 0;
}

.step-no {
  width: 1.8rem;
  height: 1.8rem;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: var(--leaf);
  color: white;
  font-weight: 700;
  font-size: 0.85rem;
}

.step h3 {
  margin: 0;
  font-size: 1.15rem;
}

.step p {
  margin: 0.25rem 0 0;
}

.step img {
  margin-top: 0.7rem;
  border-radius: 14px;
  max-height: 220px;
  object-fit: cover;
  width: 100%;
}

.tip {
  margin-top: 0.45rem !important;
  padding: 0.55rem 0.7rem;
  background: #fff4df;
  border-radius: 10px;
}

.source {
  display: inline-block;
  margin-top: 0.8rem;
  font-weight: 700;
  color: var(--tomato-dark);
}

.utensils {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.utensils span {
  background: white;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.2rem 0.55rem;
  font-size: 0.9rem;
}

.outside {
  background: #fff4df;
  border-radius: 12px;
  padding: 0.6rem 0.75rem;
}

@media (max-width: 959px) {
  .site-header {
    position: static;
  }

  .layout {
    grid-template-columns: 1fr;
    width: min(1180px, calc(100% - 1.4rem));
  }

  .filters {
    position: static;
    max-height: none;
  }

  .hero,
  .columns {
    grid-template-columns: 1fr;
  }

  .detail-nav .position {
    margin-left: 0;
    width: 100%;
  }

  .notes-button {
    display: flex;
  }

  .notes-status:not(:empty) {
    display: block;
  }
}

@media (hover: none) and (pointer: coarse) {
  .notes-button {
    display: flex;
  }

  .notes-status:not(:empty) {
    display: block;
  }
}

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

  .card,
  .card-media img {
    transition: none;
  }

  .card:hover {
    transform: none;
  }
}
