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

:root {
  --cream:       #faf8f3;
  --ink:         #1a1918;
  --green:       #3a6647;
  --green-mid:   #7aab89;
  --green-pale:  #eaf2ec;
  --terra:       #c25c2a;
  --muted:       #78776a;
  --line:        #ddd8ce;
  --white:       #ffffff;
}

html { scroll-behavior: smooth; }

body {
  background: var(--cream);
  color: var(--ink);
  font-family: system-ui, -apple-system, 'Segoe UI', sans-serif;
  font-size: 1.0625rem;
  line-height: 1.65;
  min-height: 100vh;
  border-top: 5px solid var(--green);
}

a { color: inherit; }
img { display: block; width: 100%; height: auto; }


/* ── Header ─────────────────────────────────────── */

.site-header {
  padding: 3.5rem 2rem 2.5rem;
  text-align: center;
  border-bottom: 1px solid var(--line);
}

.site-name {
  font-family: Georgia, 'Times New Roman', serif;
  font-size: clamp(3rem, 10vw, 6rem);
  font-style: italic;
  font-weight: bold;
  color: var(--green);
  text-decoration: none;
  letter-spacing: -0.03em;
  line-height: 0.9;
  display: block;
  transition: color 150ms;
}


.site-tagline {
  margin-top: 0.75rem;
  color: var(--muted);
  font-size: 0.875rem;
  font-style: italic;
  letter-spacing: 0.02em;
}


/* ── Main layout ─────────────────────────────────── */

main {
  max-width: 70rem;
  margin: 0 auto;
  padding: 3rem 1.5rem 5rem;
}


/* ── Index page ──────────────────────────────────── */

.index-intro {
  max-width: 36rem;
  margin: 0 auto 3rem;
  text-align: center;
  color: var(--muted);
  font-style: italic;
}

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

.recipe-card {
  display: flex;
  flex-direction: column;
  background: var(--white);
  border: 1px solid var(--line);
  border-top: 4px solid var(--green);
  text-decoration: none;
  color: var(--ink);
  overflow: hidden;
  transition: border-top-color 150ms, box-shadow 150ms, opacity 180ms ease, transform 180ms ease;
}

.recipe-card:hover {
  border-top-color: var(--terra);
  box-shadow: 0 6px 24px rgba(0,0,0,0.08);
}

.card-photo {
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: var(--green-pale);
}

.card-photo img {
  height: 100%;
  object-fit: cover;
  transition: transform 300ms ease;
}

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

.card-body {
  padding: 1.5rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.card-body h2 {
  font-family: Georgia, serif;
  font-size: 1.35rem;
  font-style: italic;
  font-weight: bold;
  margin-bottom: 0.6rem;
  line-height: 1.2;
}

.card-body p {
  font-size: 0.875rem;
  color: var(--muted);
  line-height: 1.55;
  margin-bottom: 1.25rem;
  flex: 1;
}

.card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: center;
}


/* ── Tags & meta chips ───────────────────────────── */

.tag {
  display: inline-block;
  background: var(--green-pale);
  color: var(--green);
  padding: 0.15rem 0.55rem;
  border-radius: 2px;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: lowercase;
  cursor: pointer;
  text-decoration: none;
  transition: background 150ms, color 150ms;
}

.recipe-card .tag:hover {
  background: var(--green);
  color: var(--white);
}

.meta-chip {
  color: var(--muted);
  font-size: 0.8rem;
}

.meta-chip::after {
  content: '·';
  margin-left: 0.5rem;
  color: var(--line);
}

.meta-chip:last-of-type::after { content: ''; }


/* ── Sheet ───────────────────────────────────────── */

body.recipe-direct {
  background: #111110;
  overflow: hidden;
  height: 100vh;
}

.recipe-sheet {
  position: fixed;
  inset: 44px 0 0 0;
  background: var(--cream);
  border-radius: 18px 18px 0 0;
  box-shadow: 0 -16px 60px rgba(0,0,0,0.5);
  display: flex;
  flex-direction: column;
  transition: transform 0.55s cubic-bezier(0.34, 1.3, 0.64, 1);
  transform: translateY(100%);
  z-index: 10;
}

body.recipe-direct .recipe-sheet {
  transform: none;
  transition: none;
}

.recipe-sheet.is-open { transform: translateY(0); }

.sheet-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10, 9, 8, 0.65);
  z-index: 9;
  opacity: 0;
  transition: opacity 0.4s ease;
  backdrop-filter: blur(2px);
}

.sheet-overlay.is-open { opacity: 1; }

.sheet-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px 1.25rem 10px;
  flex-shrink: 0;
  position: relative;
}

.sheet-handle {
  width: 40px;
  height: 5px;
  background: var(--line);
  border-radius: 3px;
  cursor: grab;
}

.sheet-close {
  position: absolute;
  right: 1.25rem;
  top: 8px;
  width: 30px;
  height: 30px;
  background: var(--line);
  border: none;
  border-radius: 50%;
  color: var(--muted);
  font-size: 0.875rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  font-family: inherit;
  transition: background 150ms, color 150ms;
}

.sheet-close:hover {
  background: var(--ink);
  color: var(--white);
}

.sheet-scroll {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.sheet-body {
  max-width: 42rem;
  margin: 0 auto;
  padding: 1rem 2rem 6rem;
}


/* ── Recipe content ──────────────────────────────── */

.recipe-title {
  font-family: Georgia, 'Times New Roman', serif;
  font-size: clamp(2.25rem, 7vw, 3.5rem);
  font-style: italic;
  font-weight: bold;
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin-bottom: 1.25rem;
}

.recipe-desc {
  font-size: 1.125rem;
  color: var(--muted);
  line-height: 1.65;
  border-left: 3px solid var(--green);
  padding-left: 1rem;
  margin-bottom: 1.75rem;
  font-style: italic;
}

.recipe-meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  padding-bottom: 2.5rem;
  border-bottom: 1px solid var(--line);
}

.recipe-photo {
  margin: 2.5rem 0;
  border-radius: 2px;
  overflow: hidden;
}

.recipe-photo img {
  aspect-ratio: 3 / 2;
  object-fit: cover;
}


/* ── Recipe body ─────────────────────────────────── */

.recipe-body h2 {
  font-family: Georgia, serif;
  font-size: 1.2rem;
  font-style: italic;
  color: var(--green);
  margin: 3rem 0 1.25rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--line);
}

/* Ingredients */

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

.recipe-body ul li {
  position: relative;
  padding: 0.6rem 0 0.6rem 1.75rem;
  border-bottom: 1px solid var(--line);
  font-size: 1rem;
}

.recipe-body ul li:first-child { border-top: 1px solid var(--line); }

.recipe-body ul li::before {
  content: '—';
  position: absolute;
  left: 0;
  color: var(--green-mid);
}

/* Method */

.recipe-body ol {
  list-style: none;
  padding: 0;
  counter-reset: step;
}

.recipe-body ol li {
  counter-increment: step;
  position: relative;
  padding: 0.25rem 0 2.25rem 4rem;
  line-height: 1.7;
}

.recipe-body ol li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: -0.2rem;
  font-family: Georgia, serif;
  font-size: 2.75rem;
  font-style: italic;
  font-weight: bold;
  color: var(--green-mid);
  line-height: 1;
}

.recipe-body ol li:last-child { padding-bottom: 0; }

.recipe-body p {
  margin-bottom: 1rem;
}


/* ── Search ──────────────────────────────────────── */

.search-wrap {
  max-width: 22rem;
  margin: 0 auto 1.5rem;
}

.recipe-search {
  width: 100%;
  border: none;
  border-bottom: 2px solid var(--line);
  background: transparent;
  font-family: inherit;
  font-size: 1rem;
  color: var(--ink);
  padding: 0.5rem 0;
  outline: none;
  transition: border-color 200ms;
  -webkit-appearance: none;
}

.recipe-search:focus { border-bottom-color: var(--green); }

.recipe-search::placeholder {
  color: var(--muted);
  font-style: italic;
}

/* hide the native clear button — we don't need it */
.recipe-search::-webkit-search-cancel-button { display: none; }


/* ── Tag filter ──────────────────────────────────── */

.tag-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 2rem 0 1.5rem;
  justify-content: center;
}

.filter-btn {
  background: none;
  border: 1px solid var(--line);
  color: var(--muted);
  padding: 0.3rem 0.85rem;
  border-radius: 2px;
  font-size: 0.8rem;
  font-family: inherit;
  font-weight: 500;
  letter-spacing: 0.03em;
  cursor: pointer;
  transition: background 150ms, color 150ms, border-color 150ms;
}

.filter-btn:hover {
  border-color: var(--green);
  color: var(--green);
}

.filter-btn.active {
  background: var(--green);
  border-color: var(--green);
  color: var(--white);
}


/* ── Why it works ────────────────────────────────── */

.why-box {
  background: var(--green-pale);
  border-left: 3px solid var(--green-mid);
  padding: 1.25rem 1.25rem 1.25rem 1.5rem;
  margin: 2rem 0;
}

.why-label {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--green);
  margin-bottom: 0.5rem !important;
}

.why-box p:last-child {
  color: var(--ink);
  font-size: 0.9375rem;
  line-height: 1.65;
  margin: 0 !important;
}


/* ── Remix ───────────────────────────────────────── */

.remix {
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px dashed var(--line);
}

.remix-heading {
  font-family: Georgia, serif;
  font-size: 1.2rem;
  font-style: italic;
  color: var(--terra);
  margin-bottom: 1rem;
}

.remix-list {
  list-style: none;
  padding: 0;
}

.remix-list li {
  position: relative;
  padding: 0.4rem 0 0.4rem 1.5rem;
  font-size: 0.9375rem;
  color: var(--muted);
  line-height: 1.55;
}

.remix-list li::before {
  content: '↳';
  position: absolute;
  left: 0;
  color: var(--terra);
  font-style: normal;
}


/* ── Footer ──────────────────────────────────────── */

.site-footer {
  border-top: 1px solid var(--line);
  padding: 2rem;
  text-align: center;
  color: var(--muted);
  font-size: 0.875rem;
  font-style: italic;
}


/* ── Mobile ──────────────────────────────────────── */

@media (max-width: 600px) {
  .site-header { padding: 2.5rem 1.25rem 2rem; }
  main { padding: 2rem 1.25rem 4rem; }
  .recipe-sheet { inset: 20px 0 0 0; border-radius: 14px 14px 0 0; }
  .sheet-body { padding: 0.75rem 1.25rem 5rem; }
  .recipe-body ol li { padding-left: 3.25rem; }
  .recipe-body ol li::before { font-size: 2.25rem; }
}
