/* =========================================================
   SIMMER & SAGE — Design Tokens
   ========================================================= */
:root {
  --cream:   #FBF6EC;
  --paper:   #F3ECDD;
  --paper-2: #ECE3CE;
  --ink:     #2B2320;
  --ink-60:  #6B5F55;
  --olive:   #4A5D3A;
  --olive-d: #384629;
  --brick:   #B5482F;
  --mustard: #D9A441;
  --line:    #DCD3BE;

  --font-display: "Fraunces", serif;
  --font-body: "Inter", sans-serif;
  --font-hand: "Caveat", cursive;

  --radius: 14px;
  --shadow-soft: 0 10px 30px -12px rgba(43, 35, 32, 0.18);
  --shadow-lift: 0 20px 45px -15px rgba(43, 35, 32, 0.28);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }

a { color: inherit; text-decoration: none; }

.wrap {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 24px;
}

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.15;
  margin: 0;
  color: var(--ink);
}

em { font-style: italic; color: var(--olive); }

.eyebrow {
  font-family: var(--font-hand);
  font-size: 1.35rem;
  color: var(--brick);
  margin: 0 0 6px;
  transform: rotate(-1deg);
  display: inline-block;
}

.section-title {
  font-size: clamp(1.6rem, 2.6vw, 2.2rem);
}

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 16px;
  margin-bottom: 34px;
  flex-wrap: wrap;
}

.link-arrow {
  font-weight: 600;
  color: var(--olive);
  border-bottom: 1.5px solid var(--olive);
  padding-bottom: 2px;
  white-space: nowrap;
  transition: color .2s ease, border-color .2s ease;
}
.link-arrow:hover { color: var(--brick); border-color: var(--brick); }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 13px 26px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.95rem;
  border: 1.5px solid transparent;
  cursor: pointer;
  transition: transform .18s ease, box-shadow .18s ease, background .18s ease;
}
.btn:active { transform: scale(.97); }

.btn-primary {
  background: var(--olive);
  color: var(--cream);
  box-shadow: var(--shadow-soft);
}
.btn-primary:hover { background: var(--olive-d); box-shadow: var(--shadow-lift); }

.btn-ghost {
  background: transparent;
  border-color: var(--ink);
  color: var(--ink);
}
.btn-ghost:hover { background: var(--ink); color: var(--cream); }

/* =========================================================
   HEADER
   ========================================================= */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(251, 246, 236, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid transparent;
  transition: border-color .25s ease, box-shadow .25s ease;
}
.site-header.scrolled {
  border-color: var(--line);
  box-shadow: 0 2px 18px -8px rgba(43,35,32,0.15);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 76px;
}

.logo {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.4rem;
  letter-spacing: -0.01em;
}
.logo-amp { color: var(--brick); font-style: italic; font-weight: 400; }

.main-nav {
  display: flex;
  gap: 34px;
}
.main-nav a {
  font-weight: 500;
  font-size: 0.95rem;
  position: relative;
  padding: 6px 0;
}
.main-nav a::after {
  content: "";
  position: absolute;
  left: 0; bottom: 0;
  width: 0%;
  height: 2px;
  background: var(--brick);
  transition: width .2s ease;
}
.main-nav a:hover::after { width: 100%; }

.header-actions { display: flex; align-items: center; gap: 6px; }

.icon-btn {
  width: 40px; height: 40px;
  display: inline-flex; align-items: center; justify-content: center;
  background: transparent;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  color: var(--ink);
  transition: background .18s ease;
}
.icon-btn:hover { background: var(--paper-2); }

.menu-btn { display: none; flex-direction: column; gap: 4px; }
.menu-btn span { width: 20px; height: 2px; background: var(--ink); border-radius: 2px; }

.search-panel {
  max-height: 0;
  overflow: hidden;
  background: var(--paper);
  border-bottom: 1px solid transparent;
  transition: max-height .28s ease, border-color .28s ease;
}
.search-panel.open { max-height: 90px; border-color: var(--line); }
.search-panel-inner {
  display: flex; align-items: center; gap: 12px;
  padding: 20px 24px;
  color: var(--ink-60);
}
.search-panel-inner input {
  flex: 1;
  border: none;
  background: transparent;
  outline: none;
  font-family: var(--font-body);
  font-size: 1.05rem;
  color: var(--ink);
}
.search-panel-inner input::placeholder { color: var(--ink-60); }
#searchClose { font-size: 1.4rem; line-height: 1; }

/* =========================================================
   HERO
   ========================================================= */
.hero { padding: 70px 0 40px; }

.hero-inner {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 60px;
  align-items: center;
}

.hero h1 {
  font-size: clamp(2.6rem, 5vw, 3.9rem);
  letter-spacing: -0.02em;
  margin-bottom: 20px;
}

.hero-lede {
  font-size: 1.1rem;
  color: var(--ink-60);
  max-width: 46ch;
  margin-bottom: 30px;
}

.hero-ctas { display: flex; gap: 14px; margin-bottom: 46px; flex-wrap: wrap; }

.hero-stats {
  display: flex;
  gap: 34px;
  flex-wrap: wrap;
}
.hero-stats div { display: flex; flex-direction: column; }
.hero-stats strong {
  font-family: var(--font-display);
  font-size: 1.5rem;
  color: var(--olive);
}
.hero-stats strong .star { color: var(--mustard); font-size: 1.1rem; }
.hero-stats span { font-size: 0.85rem; color: var(--ink-60); }

/* Hero recipe-card cluster */
.hero-cards {
  position: relative;
  height: 480px;
}

.card-photo {
  position: absolute;
  margin: 0;
  background: var(--paper);
  padding: 10px 10px 46px;
  border-radius: 4px;
  box-shadow: var(--shadow-lift);
  border: 1px solid var(--line);
}
.card-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 2px;
}
.card-photo figcaption {
  position: absolute;
  bottom: 12px; left: 10px; right: 10px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.card-photo--main {
  width: 320px; height: 400px;
  top: 0; right: 20px;
  transform: rotate(3deg);
  z-index: 2;
}
.card-photo--sub {
  width: 220px; height: 260px;
  bottom: 0; left: 0;
  transform: rotate(-6deg);
  z-index: 1;
}

.pin {
  position: absolute;
  top: -8px; left: 50%;
  transform: translateX(-50%);
  width: 16px; height: 16px;
  border-radius: 50%;
  background: var(--brick);
  box-shadow: 0 3px 6px rgba(0,0,0,.25);
}
.tape {
  position: absolute;
  top: -14px; left: 20px;
  width: 60px; height: 26px;
  background: rgba(217, 164, 65, 0.55);
  transform: rotate(-8deg);
  border: 1px solid rgba(217,164,65,.7);
}

.tag-hand {
  font-family: var(--font-hand);
  font-size: 1.05rem;
  color: var(--brick);
  background: rgba(181, 72, 47, 0.08);
  padding: 1px 10px 3px;
  border-radius: 999px;
  white-space: nowrap;
}

/* =========================================================
   TICKER
   ========================================================= */
.ticker {
  background: var(--olive);
  color: var(--cream);
  overflow: hidden;
  padding: 14px 0;
  margin: 60px 0 0;
}
.ticker-track {
  display: flex;
  gap: 14px;
  white-space: nowrap;
  width: max-content;
  animation: scroll-left 28s linear infinite;
  font-family: var(--font-display);
  font-size: 1.05rem;
}
.ticker .dot { color: var(--mustard); }
@keyframes scroll-left {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

/* =========================================================
   CATEGORIES
   ========================================================= */
.categories { padding: 64px 0 10px; }

.chip-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 22px;
}
.chip {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.92rem;
  padding: 10px 20px;
  border-radius: 999px;
  border: 1.5px solid var(--line);
  background: var(--paper);
  color: var(--ink);
  cursor: pointer;
  transition: all .18s ease;
}
.chip:hover { border-color: var(--olive); }
.chip.active {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--cream);
}

/* =========================================================
   FEATURED RECIPES
   ========================================================= */
.featured { padding: 56px 0 40px; }

.recipe-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 30px;
}

.recipe-card {
  background: var(--paper);
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--line);
  transition: transform .22s ease, box-shadow .22s ease;
}
.recipe-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lift);
}

.recipe-photo {
  display: block;
  position: relative;
  aspect-ratio: 4 / 3;
  overflow: hidden;
}
.recipe-photo img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform .4s ease;
}
.recipe-card:hover .recipe-photo img { transform: scale(1.06); }

.fold {
  position: absolute;
  top: 0; right: 0;
  width: 0; height: 0;
  border-style: solid;
  border-width: 0 28px 28px 0;
  border-color: transparent var(--cream) transparent transparent;
  filter: drop-shadow(-2px 2px 3px rgba(0,0,0,.15));
}

.recipe-body { padding: 20px 22px 24px; }
.recipe-body .tag-hand { margin-bottom: 8px; display: inline-block; }
.recipe-body h3 {
  font-size: 1.25rem;
  margin: 4px 0 8px;
}
.recipe-body p {
  color: var(--ink-60);
  font-size: 0.93rem;
  margin: 0 0 16px;
}

.recipe-meta {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  font-size: 0.82rem;
  color: var(--ink-60);
  border-top: 1px dashed var(--line);
  padding-top: 14px;
}
.recipe-meta .rating { color: var(--mustard); font-weight: 600; }
.recipe-meta .rating em { color: var(--ink-60); font-style: normal; margin-left: 2px; }

.empty-state {
  text-align: center;
  color: var(--ink-60);
  padding: 40px 0;
}
.empty-state a { color: var(--olive); font-weight: 600; text-decoration: underline; }

/* =========================================================
   STORY STRIP
   ========================================================= */
.story-strip {
  background: var(--ink);
  color: var(--cream);
  padding: 90px 0;
  margin-top: 40px;
}
.story-inner { max-width: 780px; text-align: center; margin: 0 auto; }
.handwritten {
  font-family: var(--font-hand);
  color: var(--mustard);
  font-size: 1.5rem;
  transform: rotate(-1.5deg);
  margin-bottom: 10px;
}
.story-strip h2 {
  color: var(--cream);
  font-size: clamp(1.5rem, 3vw, 2.1rem);
  font-weight: 500;
  margin-bottom: 26px;
}
.story-strip .link-arrow { color: var(--mustard); border-color: var(--mustard); }
.story-strip .link-arrow:hover { color: var(--cream); border-color: var(--cream); }

/* =========================================================
   NEWSLETTER
   ========================================================= */
.newsletter { padding: 80px 0 30px; }
.newsletter-inner {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 50px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 40px;
  flex-wrap: wrap;
}
.newsletter h2 { font-size: clamp(1.4rem, 2.4vw, 1.9rem); margin: 4px 0 8px; max-width: 20ch; }
.newsletter-sub { color: var(--ink-60); margin: 0; }

.newsletter-form {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.newsletter-form input {
  padding: 13px 18px;
  border-radius: 999px;
  border: 1.5px solid var(--line);
  background: var(--cream);
  font-family: var(--font-body);
  font-size: 0.95rem;
  min-width: 240px;
  outline: none;
  transition: border-color .18s ease;
}
.newsletter-form input:focus { border-color: var(--olive); }

.newsletter-msg {
  text-align: center;
  max-width: 1180px;
  margin: 14px auto 0;
  padding: 0 24px;
  font-size: 0.9rem;
  color: var(--olive);
  font-weight: 600;
  min-height: 1.2em;
}

/* =========================================================
   FOOTER
   ========================================================= */
.site-footer {
  background: var(--ink);
  color: var(--paper);
  padding: 70px 0 24px;
  margin-top: 40px;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.6fr 1fr 1fr;
  gap: 50px;
  padding-bottom: 46px;
}
.footer-brand .logo { color: var(--cream); }
.footer-brand p {
  color: #C9BFAF;
  font-size: 0.92rem;
  max-width: 34ch;
  margin: 16px 0 20px;
}
.social-row { display: flex; gap: 10px; }
.social-row a {
  width: 36px; height: 36px;
  border: 1px solid #55493f;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  transition: background .18s ease, border-color .18s ease;
}
.social-row a:hover { background: var(--brick); border-color: var(--brick); }

/* Mobile */
@media (max-width: 560px) {
  .social-row a {
    width: 40px;
    height: 40px;
  }

  .social-row a svg {
    width: 19px;
    height: 19px;
  }
}

.footer-col h4 {
  font-family: var(--font-body);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--mustard);
  margin-bottom: 16px;
}
.footer-col { display: flex; flex-direction: column; gap: 10px; }
.footer-col a { color: #C9BFAF; font-size: 0.93rem; transition: color .18s ease; }
.footer-col a:hover { color: var(--cream); }

.footer-bottom {
  border-top: 1px solid #453B32;
  padding-top: 22px;
  font-size: 0.82rem;
  color: #9C9082;
}

/* =========================================================
   RESPONSIVE
   Breakpoints: 1024 (small desktop/laptop) → 900 (tablet/iPad)
   → 720 (large phone landscape) → 560 (phones incl. iPhone)
   → 380 (small/older phones)
   ========================================================= */

/* iPhone notch / home-indicator safe areas */
.site-header { padding-top: env(safe-area-inset-top); }
.site-footer { padding-bottom: max(24px, env(safe-area-inset-bottom)); }
.wrap { padding-left: max(24px, env(safe-area-inset-left)); padding-right: max(24px, env(safe-area-inset-right)); }

/* ---- Small desktop / laptop (Mac included) ---- */
@media (max-width: 1024px) {
  .wrap { max-width: 100%; padding-left: max(20px, env(safe-area-inset-left)); padding-right: max(20px, env(safe-area-inset-right)); }
  .hero { padding: 56px 0 32px; }
  .hero-inner { gap: 40px; }
  .recipe-grid { gap: 24px; }
}

/* ---- Tablet / iPad ---- */
@media (max-width: 900px) {
  .hero-inner { grid-template-columns: 1fr; }
  .hero-cards { height: 360px; margin-top: 10px; max-width: 460px; }
  .recipe-grid { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 36px; }
  .footer-brand { grid-column: 1 / -1; }
  .newsletter-inner { padding: 40px; }
}

/* ---- Large phones (landscape) / small tablets ---- */
@media (max-width: 720px) {
  .header-inner { height: 68px; }
  .logo { font-size: 1.2rem; }
  .main-nav {
    display: none;
    position: absolute;
    top: 68px;
    left: 0; right: 0;
    background: var(--cream);
    border-bottom: 1px solid var(--line);
    flex-direction: column;
    gap: 0;
    padding: 10px max(24px, env(safe-area-inset-left)) 20px;
    max-height: calc(100vh - 68px);
    overflow-y: auto;
  }
  .main-nav.mobile-open { display: flex; }
  .main-nav a { padding: 14px 0; border-bottom: 1px solid var(--line); font-size: 1.02rem; }
  .menu-btn { display: flex; }

  .icon-btn { width: 44px; height: 44px; }

  .chip-row {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 8px;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }
  .chip-row::-webkit-scrollbar { display: none; }
  .chip { flex: 0 0 auto; min-height: 44px; display: inline-flex; align-items: center; }

  .ticker-track { font-size: 0.92rem; }
  .newsletter-inner { padding: 34px 26px; }
  .hero-stats { gap: 22px; }
}

/* ---- Phones (iPhone SE/12/13/14/15, most Android) ---- */
@media (max-width: 560px) {
  h1 { letter-spacing: -0.01em; }
  .hero { padding: 40px 0 28px; }
  .hero-ctas { flex-direction: column; align-items: stretch; gap: 12px; }
  .btn { justify-content: center; min-height: 48px; }
  .hero-stats { gap: 18px 26px; }

  /* Simplify the overlapping photo cluster into a single clean stacked card */
  .hero-cards { height: auto; max-width: 100%; }
  .card-photo {
    position: static;
    transform: none !important;
    width: 100%;
    height: 300px;
    margin: 0 auto;
  }
  .card-photo--sub { display: none; }
  .pin { display: none; }

  .section-title { font-size: 1.5rem; }
  .categories { padding: 44px 0 6px; }
  .featured { padding: 40px 0 24px; }
  .section-head { flex-direction: column; align-items: flex-start; gap: 10px; margin-bottom: 26px; }
  .social-row a { width: 40px; height: 40px; }
  .recipe-grid { grid-template-columns: 1fr; gap: 20px; }

  .story-strip { padding: 60px 0; }
  .story-strip h2 { font-size: 1.35rem; }

  .newsletter { padding: 56px 0 24px; }
  .newsletter-inner { flex-direction: column; align-items: stretch; text-align: left; padding: 30px 22px; }
  .newsletter-form { flex-direction: column; }
  .newsletter-form input { min-width: 100%; min-height: 48px; }
  .newsletter-form .btn { min-height: 48px; }

  .footer-grid { grid-template-columns: 1fr; gap: 34px; }
  
}

/* ---- Small / older phones ---- */
@media (max-width: 380px) {
  .wrap { padding-left: max(16px, env(safe-area-inset-left)); padding-right: max(16px, env(safe-area-inset-right)); }
  .hero h1 { font-size: 2.1rem; }
  .hero-lede { font-size: 1rem; }
  .card-photo { height: 240px; }
  .recipe-body { padding: 16px 18px 20px; }
  .newsletter-inner { padding: 24px 18px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .ticker-track { animation: none; }
  * { transition-duration: 0.01ms !important; }
}