/* ============================================================
   Real Food - Full of Life
   Landing page styles. Mobile-first.
   Palette is taken directly from the e-book so print + web match.
   ============================================================ */

:root {
  /* brand palette (identical to the PDF) */
  --cream-light: #F7F1E4;
  --cream:       #EFE3CB;
  --white:       #FDFBF6;
  --olive:       #5B6142;
  --olive-dark:  #3F4430;
  --terracotta:  #C1673D;
  --text:        #3A342C;
  --text-muted:  #8B8578;
  --border:      #E7DCC2;

  --serif: "Lora", ui-serif, Georgia, "Times New Roman", serif;
  --sans:  "Poppins", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;

  --wrap: 1120px;
  --narrow: 660px;

  /* fluid spacing */
  --s-section: clamp(3.5rem, 9vw, 7rem);
  --gutter: clamp(1.25rem, 5vw, 2.5rem);

  --radius: 14px;
  --shadow: 0 18px 45px -22px rgba(63, 68, 48, 0.38);
}

/* ---------- reset ---------- */
*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--cream-light);
  color: var(--text);
  font-family: var(--sans);
  font-size: 1rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  /* belt-and-braces against horizontal overflow on iOS */
  overflow-x: hidden;
}

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

h1, h2, h3 {
  font-family: var(--serif);
  font-weight: 500;
  line-height: 1.18;
  color: var(--olive-dark);
  margin: 0;
  letter-spacing: -0.01em;
  /* spreads a heading evenly across its lines instead of leaving a single
     orphaned word on the last line (ignored by browsers that don't have it) */
  text-wrap: balance;
}

/* keeps a phrase from being split across two lines */
.nowrap { white-space: nowrap; }

p { margin: 0 0 1.05em; }
p:last-child { margin-bottom: 0; }

a { color: inherit; }

::selection { background: var(--cream); color: var(--olive-dark); }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

/* ---------- layout helpers ---------- */
.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.narrow { max-width: var(--narrow); margin-inline: auto; }

.section { padding-block: var(--s-section); }

.eyebrow {
  font-size: 0.7rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--terracotta);
  font-weight: 600;
  margin: 0 0 0.9rem;
}

.rule {
  width: 54px; height: 1.5px;
  background: var(--olive);
  border: 0; margin: 0 0 1.6rem;
}
.rule.center { margin-inline: auto; }

.center { text-align: center; }

/* standard section heading size, used across sections */
.h-section { font-size: clamp(1.7rem, 5.6vw, 2.35rem); }

.flush-bottom { padding-bottom: 0; }

.skip-link {
  position: absolute; left: -9999px;
  background: var(--olive-dark); color: var(--cream-light);
  padding: 0.75rem 1.15rem; z-index: 200; border-radius: 0 0 8px 0;
}
.skip-link:focus { left: 0; top: 0; }

:focus-visible {
  outline: 2px solid var(--terracotta);
  outline-offset: 3px;
  border-radius: 4px;
}

/* ---------- buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  font-family: var(--sans);
  font-size: 0.98rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  text-decoration: none;
  padding: 1.05rem 2.1rem;
  border-radius: 999px;
  border: 1.5px solid transparent;
  cursor: pointer;
  transition: background-color .22s ease, color .22s ease,
              border-color .22s ease, transform .22s ease;
  /* comfortable iOS tap target */
  min-height: 52px;
}

.btn--primary {
  background: var(--terracotta);
  color: #fff;
}
.btn--primary:hover { background: #ad5a33; }
.btn--primary:active { transform: translateY(1px); }

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

.btn--block { display: flex; width: 100%; }

.btn-note {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin: 0.95rem 0 0;
}

/* ============================================================
   HEADER
   ============================================================ */
.site-header {
  padding: 1.4rem 0;
  border-bottom: 1px solid rgba(231, 220, 194, 0.7);
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
}
.brand img { width: 30px; height: auto; }
.brand span {
  font-family: var(--serif);
  font-size: 1.12rem;
  color: var(--olive-dark);
}

.site-header .btn {
  padding: 0.7rem 1.4rem;
  font-size: 0.86rem;
  min-height: 44px;
}
/* the header CTA is redundant next to the hero CTA on small screens */
@media (max-width: 600px) { .site-header .btn { display: none; } }

/* ============================================================
   HERO
   ============================================================ */
.hero { padding-block: clamp(2.5rem, 7vw, 4.5rem) 0; }

.hero__grid {
  display: grid;
  gap: clamp(2rem, 5vw, 3.5rem);
  align-items: center;
}

.hero h1 {
  font-size: clamp(2.4rem, 8.5vw, 3.9rem);
  margin-bottom: 0.85rem;
}

.hero__lead {
  font-size: clamp(1.02rem, 3.4vw, 1.16rem);
  color: var(--text);
  max-width: 34ch;
  margin-bottom: 1.9rem;
}

.hero__buy {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1.1rem 1.4rem;
}

.price {
  display: flex;
  align-items: baseline;
  gap: 0.45rem;
  font-family: var(--serif);
  font-size: 1.85rem;
  color: var(--olive-dark);
}
.price small {
  font-family: var(--sans);
  font-size: 0.74rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.hero__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
  list-style: none;
  margin: 1.9rem 0 0;
  padding: 0;
  font-size: 0.83rem;
  color: var(--text-muted);
}
.hero__meta li { display: flex; align-items: center; gap: 0.45rem; }
.hero__meta li::before {
  content: "";
  width: 5px; height: 5px; border-radius: 50%;
  background: var(--terracotta);
  flex: none;
}

.hero__figure { margin: 0; }
.hero__figure img { width: 100%; border-radius: var(--radius); }

@media (min-width: 860px) {
  .hero__grid { grid-template-columns: 1fr 1.05fr; }
  .hero__figure { order: 2; }
}

/* ============================================================
   GALLERY  —  CSS scroll-snap carousel, ~no JS weight
   ============================================================ */
.gallery { padding-top: clamp(2.5rem, 7vw, 4rem); }

.gallery__head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.4rem;
}
.gallery__head h2 { font-size: clamp(1.5rem, 5vw, 2rem); }

/* arrows are shown on every screen size - on touch they are the clear
   "you can go back" affordance that swiping alone doesn't communicate */
.gallery__arrows { display: flex; gap: 0.5rem; flex: none; }
.gallery__arrow {
  width: 44px; height: 44px;
  border-radius: 50%;
  border: 1.5px solid var(--border);
  background: var(--white);
  color: var(--olive-dark);
  display: grid; place-items: center;
  cursor: pointer;
  transition: border-color .2s ease, opacity .2s ease;
}
.gallery__arrow:hover:not(:disabled) { border-color: var(--olive); }
.gallery__arrow:disabled { opacity: 0.32; cursor: default; }
.gallery__arrow svg { width: 17px; height: 17px; }

.gallery__track {
  display: flex;
  gap: 0.85rem;
  overflow-x: auto;
  /* "proximity" rather than "mandatory": the browser only pulls to a snap
     point when you're already near one, so a small backward swipe is never
     yanked forward again. With "mandatory" the last slide felt stuck. */
  scroll-snap-type: x proximity;
  -webkit-overflow-scrolling: touch;
  scroll-behavior: smooth;
  /* hide the scrollbar without killing accessibility */
  scrollbar-width: none;
  /* CRITICAL on iOS: without this, swiping right at the first slide is
     swallowed by Safari's edge back-gesture instead of scrolling the
     carousel - which makes the gallery feel one-way. */
  overscroll-behavior-x: contain;
  touch-action: pan-x pan-y;
  /* let slides bleed to the screen edge on mobile */
  margin-inline: calc(var(--gutter) * -1);
  padding-inline: var(--gutter);
  scroll-padding-inline: var(--gutter);
  padding-bottom: 0.4rem;
}
.gallery__track::-webkit-scrollbar { display: none; }

.gallery__slide {
  /* 78% leaves a deliberate sliver of the next image visible, so it's
     obvious there is more to swipe to */
  flex: 0 0 78%;
  scroll-snap-align: start;
  margin: 0;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--cream);
}
/* The last slide can never reach the start edge - there isn't enough track
   left after it - so give it a snap point it CAN reach, at the end. Without
   this its snap point is unreachable and scrolling back off it fights you. */
.gallery__slide:last-child { scroll-snap-align: end; }

.gallery__slide img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
}

@media (min-width: 620px) { .gallery__slide { flex-basis: 52%; } }
@media (min-width: 860px) {
  .gallery__slide { flex-basis: 38%; }
  .gallery__track {
    margin-inline: 0;
    padding-inline: 0;
    scroll-padding-inline: 0;
  }
}

/* dots */
.gallery__dots {
  display: flex;
  justify-content: center;
  gap: 0.1rem;
  margin-top: 0.9rem;
  padding: 0;
  list-style: none;
}
/* the visible dot is small, but the tappable area is a comfortable 24px */
.gallery__dot {
  width: 24px; height: 24px;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  display: grid;
  place-items: center;
}
.gallery__dot::before {
  content: "";
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--border);
  transition: background-color .25s ease, transform .25s ease;
}
.gallery__dot[aria-current="true"]::before {
  background: var(--olive);
  transform: scale(1.35);
}

.gallery__caption {
  text-align: center;
  font-size: 0.83rem;
  color: var(--text-muted);
  margin-top: 0.75rem;
  min-height: 1.4em;
}

/* ============================================================
   PROSE / MAIN COPY
   ============================================================ */
.prose { font-size: clamp(1.02rem, 3.3vw, 1.12rem); }
.prose h2 {
  font-size: clamp(1.7rem, 5.6vw, 2.35rem);
  margin-bottom: 1.1rem;
}
.prose .lead {
  font-size: clamp(1.14rem, 4vw, 1.35rem);
  font-family: var(--serif);
  line-height: 1.5;
  color: var(--olive-dark);
  margin-bottom: 1.5rem;
}

/* ============================================================
   WHAT'S INSIDE
   ============================================================ */
.inside { background: var(--white); }

.inside__grid {
  display: grid;
  gap: 0.9rem;
  margin-top: 2.4rem;
  padding: 0;
  list-style: none;
}
@media (min-width: 720px) {
  .inside__grid { grid-template-columns: repeat(2, 1fr); gap: 1.1rem; }
  .inside__grid li:first-child { grid-column: 1 / -1; }
}

.inside__grid li {
  background: var(--cream-light);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem 1.5rem 1.6rem;
}
.inside__grid h3 {
  font-size: 1.12rem;
  margin-bottom: 0.4rem;
}
/* emoji renders larger than the serif cap-height, so nudge it down a touch
   to sit level with the text baseline */
.leaf {
  font-size: 0.92em;
  vertical-align: -0.04em;
}
.inside__grid p {
  font-size: 0.94rem;
  color: var(--text-muted);
  margin: 0;
}

.inside__note {
  margin-top: 2rem;
  font-family: var(--serif);
  font-style: italic;
  color: var(--olive);
  font-size: 1.05rem;
}

/* ============================================================
   FOOD IMAGERY
   ============================================================ */
.food__grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.7rem;
  margin-top: 2.4rem;
}
@media (min-width: 720px) {
  .food__grid { grid-template-columns: repeat(3, 1fr); gap: 0.9rem; }
}
.food__grid img {
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  border-radius: 10px;
}

/* sits in the content column, same width and corner radius as the
   food grid above it, rather than bleeding to the screen edge */
.band {
  margin: 0.9rem 0 0;
  width: 100%;
}
.band img {
  width: 100%;
  aspect-ratio: 3 / 2;
  object-fit: cover;
  border-radius: 10px;
}

/* ============================================================
   PERSONAL
   ============================================================ */
.personal { background: var(--white); }

.personal__grid {
  display: grid;
  gap: clamp(2rem, 5vw, 3.5rem);
  align-items: center;
}
@media (min-width: 820px) {
  .personal__grid { grid-template-columns: 0.85fr 1.15fr; }
}
/* the off-white card beside "Who this is for" - everything centred */
.creed {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 1.5rem;
  background: var(--cream-light);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: clamp(2.75rem, 8vw, 3.75rem) clamp(1.5rem, 5vw, 2.25rem);
  min-height: clamp(260px, 46vw, 340px);
}
.creed__mark { width: 52px; height: auto; opacity: 0.9; }
.creed__line {
  font-family: var(--serif);
  font-size: clamp(1.2rem, 4.4vw, 1.45rem);
  line-height: 1.45;
  color: var(--olive-dark);
  margin: 0;
}
.personal h2 { font-size: clamp(1.7rem, 5.6vw, 2.3rem); margin-bottom: 1.1rem; }
.personal .sig {
  font-family: var(--serif);
  font-style: italic;
  font-size: 1.15rem;
  color: var(--olive);
  margin-top: 1.4rem;
}

/* ============================================================
   FINAL CTA
   ============================================================ */
.final {
  background: var(--olive-dark);
  color: var(--cream-light);
  text-align: center;
}
.final img.mark { width: 58px; margin: 0 auto 1.6rem; }
.final h2 {
  color: var(--cream-light);
  font-size: clamp(1.9rem, 6.2vw, 2.8rem);
  margin-bottom: 1rem;
}
.final p { color: rgba(247, 241, 228, 0.8); }
.final .price { color: var(--cream-light); }
.final .price small { color: rgba(247, 241, 228, 0.62); }
.final .hero__buy { justify-content: center; margin-top: 2rem; }
.final .btn-note { color: rgba(247, 241, 228, 0.62); }
.final .btn--primary { background: var(--terracotta); }
.final .btn--primary:hover { background: #d1723f; }

/* ============================================================
   FOOTER
   ============================================================ */
.site-footer {
  background: var(--olive-dark);
  color: rgba(247, 241, 228, 0.55);
  padding: 0 0 2.5rem;
  text-align: center;
  font-size: 0.82rem;
}
/* leave room so the sticky buy bar can never sit on top of the footer text */
@media (max-width: 859px) {
  .site-footer { padding-bottom: calc(6rem + env(safe-area-inset-bottom)); }
}
.site-footer hr {
  border: 0;
  border-top: 1px solid rgba(247, 241, 228, 0.14);
  margin: 0 0 2rem;
}
.site-footer a { color: rgba(247, 241, 228, 0.75); }

/* ============================================================
   STICKY MOBILE BUY BAR
   ============================================================ */
.buybar {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.7rem var(--gutter);
  padding-bottom: calc(0.7rem + env(safe-area-inset-bottom));
  background: rgba(253, 251, 246, 0.94);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  backdrop-filter: saturate(180%) blur(14px);
  border-top: 1px solid var(--border);
  transform: translateY(110%);
  transition: transform .3s ease;
}
.buybar.is-visible { transform: translateY(0); }

.buybar__price {
  font-family: var(--serif);
  font-size: 1.2rem;
  color: var(--olive-dark);
  line-height: 1.2;
}
.buybar__price small {
  display: block;
  font-family: var(--sans);
  font-size: 0.68rem;
  color: var(--text-muted);
}
.buybar .btn {
  padding: 0.85rem 1.6rem;
  font-size: 0.9rem;
  min-height: 48px;
}

@media (min-width: 860px) { .buybar { display: none; } }

/* ============================================================
   REVEAL ON SCROLL (progressive enhancement)
   ============================================================ */
.reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity .7s ease, transform .7s ease;
}
.reveal.is-in { opacity: 1; transform: none; }
/* if JS never runs, nothing stays hidden */
.no-js .reveal { opacity: 1; transform: none; }
