/* Noosh e jan: palette taken from the cover (beetroot dip, sage tablecloth, stock flowers). */
:root {
  --paper: #FBF3EA;
  --paper-deep: #F4E4D6;
  --blush: #F3D9D6;
  --rose: #C8677A;
  --berry: #8C2446;
  --sage: #93AE98;
  --sage-deep: #56705C;
  --ink: #3E2A28;
  --ink-soft: #6E5550;
  --line: #E6CFC4;

  --display: "Fraunces", "Iowan Old Style", Georgia, serif;
  --body: "Newsreader", "Iowan Old Style", Georgia, serif;
  --persian: "Noto Naskh Arabic", "Geeza Pro", serif;

  --step--1: 0.9rem;
  --step-0: 1.125rem;
  --step-1: 1.4rem;
  --step-2: 1.9rem;
  --step-3: clamp(2.2rem, 5vw, 3.2rem);
  --step-4: clamp(3.4rem, 10vw, 6.4rem);

  --gutter: clamp(16px, 4vw, 48px);
  --max: 1120px;
  color-scheme: light;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--body);
  font-size: var(--step-0);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: var(--berry); }
:focus-visible { outline: 2px dashed var(--berry); outline-offset: 3px; border-radius: 4px; }
h1, h2, h3 { font-family: var(--display); font-weight: 500; line-height: 1.08; text-wrap: balance; margin: 0; }
p { margin: 0; }

.eyebrow {
  font-family: var(--display);
  font-size: var(--step--1);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--rose);
  font-weight: 600;
}

/* ---------- Top bar ---------- */
.topbar {
  position: sticky;
  top: env(safe-area-inset-top, 0px);
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px var(--gutter);
  background: color-mix(in srgb, var(--paper) 92%, transparent);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--line);
}
.brand {
  font-family: var(--display);
  font-style: italic;
  font-size: var(--step-1);
  font-variation-settings: "SOFT" 100, "WONK" 1;
  color: var(--berry);
  text-decoration: none;
}
.topbar nav { display: flex; gap: clamp(12px, 3vw, 28px); align-items: center; }
.topbar nav a { color: var(--ink); text-decoration: none; font-size: 1rem; }
.topbar nav a:hover { color: var(--berry); }
.nav-cta { padding: 4px 14px; border: 1.5px solid var(--berry); border-radius: 999px; color: var(--berry) !important; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-block;
  font-family: var(--display);
  font-size: 1rem;
  font-weight: 500;
  padding: 12px 22px;
  border-radius: 999px;
  text-decoration: none;
  border: 1.5px solid var(--berry);
  cursor: pointer;
  transition: transform .2s ease, background-color .2s ease;
}
.btn-primary { background: var(--berry); color: var(--paper); }
.btn-primary:hover { background: #761C3A; transform: translateY(-2px); }
.btn-ghost { background: transparent; color: var(--berry); }
.btn-ghost:hover { background: var(--blush); }

/* ---------- Hero ---------- */
.hero {
  max-width: var(--max);
  margin: 0 auto;
  padding: clamp(40px, 7vw, 88px) var(--gutter) clamp(48px, 7vw, 80px);
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  gap: clamp(32px, 6vw, 80px);
  align-items: center;
}
.persian {
  font-family: var(--persian);
  font-size: var(--step-2);
  color: var(--rose);
  line-height: 1;
  text-align: left;
}
.hero h1 {
  font-size: var(--step-4);
  font-weight: 600;
  font-variation-settings: "SOFT" 100, "WONK" 1, "opsz" 144;
  color: var(--berry);
  letter-spacing: -0.02em;
  margin-top: 8px;
}
.hero h1 em { font-weight: 300; color: var(--rose); }
.tagline { font-family: var(--display); font-style: italic; font-size: var(--step-2); margin-top: 12px; line-height: 1.2; }
.byline { margin-top: 10px; color: var(--ink-soft); font-size: var(--step-0); }
.gloss {
  margin-top: 28px;
  max-width: 34ch;
  padding: 14px 18px;
  border-left: 3px solid var(--sage);
  background: color-mix(in srgb, var(--sage) 12%, var(--paper));
  font-size: 1rem;
  line-height: 1.5;
}
.gloss-word { font-weight: 600; font-style: italic; }
.gloss-pos { font-size: var(--step--1); color: var(--sage-deep); font-variant: small-caps; letter-spacing: .04em; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 32px; }

/* Taped photo frames */
.taped {
  position: relative;
  margin: 0;
  padding: 12px 12px 14px;
  background: #fff;
  box-shadow: 0 1px 2px rgba(62, 42, 40, .08), 0 18px 40px -18px rgba(62, 42, 40, .35);
  transform: rotate(1.6deg);
}
.taped::before {
  content: "";
  position: absolute;
  top: -14px;
  left: 50%;
  width: 110px;
  height: 28px;
  transform: translateX(-50%) rotate(-3deg);
  background: color-mix(in srgb, var(--blush) 80%, transparent);
  border-left: 2px dotted rgba(255,255,255,.7);
  border-right: 2px dotted rgba(255,255,255,.7);
}
.taped-left { transform: rotate(-2deg); }
.taped-left::before { left: 18%; transform: translateX(-50%) rotate(-12deg); background: color-mix(in srgb, var(--sage) 45%, transparent); }
.taped img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; background: var(--paper-deep); }
.hero-photo img { aspect-ratio: 5 / 4; }

/* Gingham band, after the tablecloth in the photos */
.gingham {
  height: 36px;
  background-color: var(--paper);
  background-image:
    linear-gradient(90deg, color-mix(in srgb, var(--rose) 38%, transparent) 50%, transparent 50%),
    linear-gradient(color-mix(in srgb, var(--rose) 38%, transparent) 50%, transparent 50%);
  background-size: 18px 18px;
  -webkit-mask: radial-gradient(9px at 50% 0, transparent 97%, #000) 50% / 18px 100% repeat-x;
          mask: radial-gradient(9px at 50% 0, transparent 97%, #000) 50% / 18px 100% repeat-x;
}

/* ---------- Recipes ---------- */
.recipes {
  background: var(--paper-deep);
  padding: clamp(48px, 7vw, 88px) var(--gutter);
}
.section-head, .filters, .courses { max-width: var(--max); margin-inline: auto; }
.section-head h2 { font-size: var(--step-3); margin-top: 6px; font-variation-settings: "SOFT" 100, "WONK" 1; }
.filters { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 24px; }
.chip {
  font-family: var(--body);
  font-size: 1rem;
  padding: 6px 16px;
  border-radius: 999px;
  border: 1.5px solid var(--line);
  background: var(--paper);
  color: var(--ink);
  cursor: pointer;
}
.chip:hover { border-color: var(--rose); }
.chip[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--paper); }

.courses { display: flex; flex-direction: column; gap: clamp(40px, 6vw, 64px); margin-top: 40px; }
.card-meta { font-size: var(--step--1); color: var(--c, var(--rose)); font-variant-numeric: tabular-nums; }
.card-blurb { font-size: 1rem; color: var(--ink-soft); line-height: 1.5; }

/* ---------- Featured recipes ---------- */
.featured {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr));
  gap: clamp(20px, 3vw, 32px);
}
.feature {
  display: flex;
  flex-direction: column;
  background: var(--paper);
  border-radius: 8px;
  overflow: hidden;
  text-decoration: none;
  color: var(--ink);
  box-shadow: 0 1px 0 var(--line), 0 18px 36px -22px rgba(62, 42, 40, .5);
  transition: transform .3s cubic-bezier(.3, 1.6, .5, 1);
}
.feature:hover { transform: translateY(-6px); }
.feature-photo img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.feature-body { display: flex; flex-direction: column; gap: 8px; padding: 20px 22px 26px; }
.feature-title { font-family: var(--display); font-size: var(--step-2); line-height: 1.1; font-variation-settings: "SOFT" 100, "WONK" 1; }
.feature-lead { grid-column: 1 / -1; display: grid; grid-template-columns: 1.25fr 1fr; }
.feature-lead .feature-photo img { height: 100%; aspect-ratio: auto; min-height: 320px; }
.feature-lead .feature-body { justify-content: center; padding: clamp(24px, 4vw, 48px); gap: 12px; }
.feature-lead .feature-title { font-size: var(--step-3); color: var(--c); }
.feature-lead .card-blurb { font-size: var(--step-0); }
@media (min-width: 700px) {
  .featured { grid-template-columns: repeat(2, 1fr); }
  .feature:not(.feature-lead) .feature-photo img { aspect-ratio: 3 / 2; }
  /* An odd card left over at the end spans the row, laid out like the lead card. */
  .feature:not(.feature-lead):last-child:nth-child(even) { grid-column: 1 / -1; display: grid; grid-template-columns: 1.25fr 1fr; }
  .feature:not(.feature-lead):last-child:nth-child(even) .feature-photo img { height: 100%; aspect-ratio: auto; min-height: 280px; }
  .feature:not(.feature-lead):last-child:nth-child(even) .feature-body { justify-content: center; padding: clamp(24px, 4vw, 48px); }
}

/* ---------- Contents list ---------- */
.toc { margin-top: clamp(48px, 7vw, 72px); columns: 2 320px; column-gap: clamp(32px, 5vw, 72px); }
.toc-kicker {
  column-span: all;
  font-size: var(--step-3);
  font-variation-settings: "SOFT" 100, "WONK" 1;
  margin-bottom: 24px;
}
.toc-course { break-inside: avoid; margin-bottom: 32px; }
.toc-heading {
  font-size: var(--step-2);
  font-style: italic;
  padding-bottom: 8px;
  margin-bottom: 6px;
  border-bottom: 1px dashed color-mix(in srgb, var(--rose) 45%, transparent);
}
.toc-list { list-style: none; margin: 0; padding: 0; }
.toc-list a {
  display: grid;
  grid-template-columns: 2.2rem 52px 1fr;
  align-items: center;
  gap: 14px;
  padding: 10px 6px;
  border-radius: 10px;
  text-decoration: none;
  color: var(--ink);
}
.toc-list a:hover { background: color-mix(in srgb, var(--c) 10%, transparent); }
.toc-no { font-family: var(--display); font-size: var(--step-1); color: var(--rose); font-variant-numeric: tabular-nums lining-nums; }
.toc-thumb { width: 52px; height: 52px; border-radius: 50%; overflow: hidden; }
.toc-thumb img { width: 100%; height: 100%; object-fit: cover; }
.toc-dot {
  display: grid;
  place-items: center;
  background: color-mix(in srgb, var(--c) 16%, var(--paper));
  color: var(--c);
  font-family: var(--display);
  font-size: 1.4rem;
  font-style: italic;
  border: 1.5px dashed color-mix(in srgb, var(--c) 50%, transparent);
}
.toc-text { display: flex; flex-direction: column; }
.toc-title { font-family: var(--display); font-size: var(--step-1); line-height: 1.2; }
.toc-meta { font-size: var(--step--1); color: var(--ink-soft); }
.toc-soon .toc-meta { font-style: italic; }

/* ---------- Sustainability tips ---------- */
.tips { padding: clamp(56px, 8vw, 96px) var(--gutter) 0; }
.tips-inner {
  max-width: var(--max);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 0.8fr 1.2fr;
  gap: clamp(24px, 5vw, 64px);
  align-items: start;
}
.tips-head { display: flex; flex-direction: column; gap: 12px; }
.tips-head h2 { font-size: var(--step-3); color: var(--sage-deep); font-variation-settings: "SOFT" 100, "WONK" 1; }
.tips-head p:last-child { color: var(--ink-soft); max-width: 42ch; }
.tips-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 14px; }
.tips-list li { position: relative; padding-left: 30px; max-width: 64ch; }
.tips-list li::before {
  content: "";
  position: absolute;
  left: 2px; top: .45em;
  width: 14px; height: 14px;
  border-radius: 0 70% 0 70%;
  background: var(--sage);
  transform: rotate(-10deg);
}

/* ---------- About ---------- */
.about {
  max-width: var(--max);
  margin: 0 auto;
  padding: clamp(56px, 8vw, 104px) var(--gutter);
  display: grid;
  grid-template-columns: 0.8fr 1.2fr;
  gap: clamp(32px, 6vw, 80px);
  align-items: center;
}
.about-photo img { aspect-ratio: 4 / 5; }
.about-text { display: flex; flex-direction: column; gap: 16px; max-width: 60ch; }
.about-text h2 { font-size: var(--step-3); font-variation-settings: "SOFT" 100, "WONK" 1; }
.note {
  margin-top: 24px;
  padding: 16px 20px;
  background: color-mix(in srgb, var(--c) 9%, var(--paper));
  border-radius: 14px 14px 14px 3px;
}
.note h3 { font-size: 1.05rem; font-style: italic; color: var(--c); }
.note ul { margin: 6px 0 0; padding-left: 20px; font-size: 1rem; }
.placeholder-note { font-size: var(--step--1); color: var(--sage-deep); font-style: italic; }

/* ---------- Kitchen snapshots ---------- */
.kitchen { padding: 0 var(--gutter) clamp(56px, 8vw, 104px); }
.kitchen .section-head h2 { font-size: var(--step-2); }
.snaps {
  max-width: var(--max);
  margin: 28px auto 0;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: clamp(16px, 3vw, 32px);
}
.snap {
  margin: 0;
  padding: 10px 10px 12px;
  background: #fff;
  box-shadow: 0 1px 2px rgba(62, 42, 40, .08), 0 16px 30px -18px rgba(62, 42, 40, .4);
  transition: transform .3s cubic-bezier(.3, 1.6, .5, 1);
}
.snap:nth-child(odd) { transform: rotate(-2deg); }
.snap:nth-child(even) { transform: rotate(1.5deg) translateY(10px); }
.snap:hover { transform: rotate(0) scale(1.03); }
.snap img { width: 100%; aspect-ratio: 1; object-fit: cover; }
.snap figcaption { font-family: var(--display); font-style: italic; font-size: 1rem; text-align: center; margin-top: 8px; }

/* ---------- Book ---------- */
.book {
  max-width: 1040px;
  margin: 0 auto;
  padding: 0 var(--gutter) clamp(56px, 8vw, 104px);
  display: grid;
  grid-template-columns: 0.75fr 1.25fr;
  gap: clamp(28px, 5vw, 64px);
  align-items: center;
}
.book-photo img { aspect-ratio: 4 / 5; }
.book-card {
  padding: clamp(28px, 5vw, 56px);
  background: var(--blush);
  border-radius: 28px 28px 28px 4px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.book-card h2 { font-size: var(--step-3); color: var(--berry); font-variation-settings: "SOFT" 100, "WONK" 1; }
.notify { display: flex; flex-direction: column; gap: 10px; margin-top: 10px; }
.notify label { font-family: var(--display); font-style: italic; font-size: var(--step-0); }
.notify-row { display: flex; flex-wrap: wrap; gap: 10px; }
.notify input {
  flex: 1 1 220px;
  font: inherit;
  font-size: 1rem;
  padding: 11px 18px;
  border-radius: 999px;
  border: 1.5px solid var(--rose);
  background: var(--paper);
  color: var(--ink);
}
.notify-msg { font-size: 1rem; color: var(--berry); min-height: 1.5em; }

/* ---------- Recipe view (a book spread) ---------- */
.recipe-view {
  max-width: var(--max);
  margin: 0 auto;
  padding: 28px var(--gutter) clamp(56px, 8vw, 96px);
}
.back { font-family: var(--display); text-decoration: none; font-size: 1rem; }
.spread {
  display: grid;
  grid-template-columns: 1fr 1fr;
  margin-top: 20px;
  background: #FFFCF8;
  border-radius: 6px;
  box-shadow: 0 30px 60px -40px rgba(62, 42, 40, .5), 0 1px 0 var(--line);
  /* the book's gutter */
  background-image: linear-gradient(90deg, transparent calc(50% - 18px), rgba(62,42,40,.07) 50%, transparent calc(50% + 18px));
}
.page { padding: clamp(28px, 5vw, 56px); display: flex; flex-direction: column; }
.recipe-title {
  font-size: var(--step-3);
  font-weight: 500;
  color: var(--c);
  font-variation-settings: "SOFT" 100, "WONK" 1;
}
.recipe-subtitle { margin-top: 6px; font-family: var(--display); font-style: italic; font-size: var(--step-1); color: var(--ink-soft); }
.recipe-intro { margin-top: 18px; font-size: var(--step-0); }
.spread-soon { grid-template-columns: 1fr; background-image: none; max-width: 640px; margin-inline: auto; text-align: center; }
.spread-soon .page { align-items: center; gap: 4px; padding-block: clamp(48px, 8vw, 88px); }
.soon-text { margin-top: 20px; color: var(--ink-soft); max-width: 36ch; }
.soon-photo { margin-top: 36px; width: min(100%, 440px); }
.recipe-intro::first-letter {
  font-family: var(--display);
  float: left;
  font-size: 3.4em;
  line-height: .9;
  padding: 4px 8px 0 0;
  color: var(--c);
  font-weight: 600;
}
.facts {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin: 26px 0 0;
  padding: 14px 0;
  border-block: 1px dashed var(--line);
}
.facts dt { font-size: .75rem; letter-spacing: .14em; text-transform: uppercase; color: var(--rose); font-family: var(--display); font-weight: 600; }
.facts dd { margin: 2px 0 0; font-size: .98rem; line-height: 1.35; font-variant-numeric: tabular-nums; }
.sub { font-size: var(--step-1); margin-top: 30px; font-style: italic; }
.hint { font-size: var(--step--1); color: var(--ink-soft); margin-top: 4px; }
.ingredients { list-style: none; padding: 0; margin: 14px 0 0; display: flex; flex-direction: column; gap: 2px; }
.ingredients li { display: flex; align-items: baseline; gap: 12px; }
.ingredients input {
  appearance: none;
  flex: none;
  width: 18px;
  height: 18px;
  margin: 0;
  border: 1.5px solid var(--rose);
  border-radius: 50% 45% 55% 48%;
  position: relative;
  top: 3px;
  cursor: pointer;
  background: var(--paper);
}
.ingredients input:checked { background: var(--c); border-color: var(--c); }
.ingredients input:checked::after {
  content: "";
  position: absolute;
  left: 5px; top: 1px;
  width: 4px; height: 9px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(40deg);
}
.ingredients label { cursor: pointer; padding: 4px 0; font-variant-numeric: tabular-nums; }
.ingredients input:checked + label { text-decoration: line-through; text-decoration-color: var(--rose); color: var(--ink-soft); }

.recipe-photo { margin-bottom: 8px; }
.extra-photo { margin-top: 40px; }
.recipe-photo img { aspect-ratio: 4 / 3; }
.page-right .sub { margin-top: 28px; }
.page-right > .sub:first-child { margin-top: 0; }
.method { list-style: none; counter-reset: step; padding: 0; margin: 16px 0 0; display: flex; flex-direction: column; gap: 18px; }
.method li { counter-increment: step; display: grid; grid-template-columns: 40px 1fr; gap: 12px; }
.method li::before {
  content: counter(step);
  font-family: var(--display);
  font-size: 1.1rem;
  font-weight: 600;
  width: 34px; height: 34px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: color-mix(in srgb, var(--c) 14%, var(--paper));
  color: var(--c);
}
.sign-off {
  margin-top: 32px;
  align-self: flex-end;
  font-family: var(--display);
  font-style: italic;
  font-size: var(--step-1);
  color: var(--c);
  transform: rotate(-4deg);
  font-variation-settings: "SOFT" 100, "WONK" 1;
}
.next {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 28px;
  font-family: var(--display);
  text-decoration: none;
  font-size: 1rem;
}
.next span { font-style: italic; }

/* ---------- Footer ---------- */
.footer {
  padding: 28px var(--gutter);
  border-top: 1px solid var(--line);
  text-align: center;
  font-size: var(--step--1);
  color: var(--ink-soft);
}
.persian-small { font-family: var(--persian); color: var(--rose); font-size: 1.1rem; }

/* ---------- Small screens ---------- */
@media (max-width: 820px) {
  .hero, .about, .spread, .tips-inner, .feature-lead, .book { grid-template-columns: 1fr; }
  .book-photo { max-width: 340px; justify-self: center; }
  .feature-lead .feature-photo img { min-height: 0; aspect-ratio: 4 / 3; }
  .hero-photo { order: -1; max-width: 520px; }
  .about-photo { max-width: 360px; }
  .spread { background-image: none; }
  .page-right { padding-top: 0; }
}
@media (max-width: 820px) {
  .snaps { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 480px) {
  .topbar nav { gap: 12px; }
  .topbar nav a { font-size: .95rem; }
  .brand { font-size: 1.15rem; }
  .facts { grid-template-columns: 1fr 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
}
