/* Pantry Ponder — marketing site. Palette mirrors the app (Theme.swift /
   Theme.kt): cream background, forest green, vermillion accent. */
:root {
  --cream: #f5f0e2;
  --forest: #40522d;
  --ink: #33301f;
  --subtle: #736f65;
  --accent: #cc4326;
  --hairline: #e4dcc8;
  --card: #fbf8ef;
}

* { box-sizing: border-box; }

/* Clip the deliberately-overhanging hero shots at the viewport edge. This must
   be on the ROOT as well as body: body alone doesn't clip here because it's a
   flex container, and the page simply grew wider than the viewport instead. */
html {
  -webkit-text-size-adjust: 100%;
  overflow-x: hidden;
  overflow-x: clip;   /* clip doesn't create a scroll container; hidden is the fallback */
}

body {
  margin: 0;
  overflow-x: hidden;
  overflow-x: clip;
  background: var(--cream);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.55;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.wrap {
  width: 100%;
  max-width: 760px;
  margin: 0 auto;
  padding: 0 20px;
  flex: 1;
  /* .wrap is a flex item (body is a column flex container), so its default
     min-width:auto makes it refuse to shrink below the hero's INTRINSIC
     min-content — and the hero's percentage-width phones go indefinite during
     intrinsic sizing, falling back to the images' natural widths. On narrow
     phones that propped the whole page open ~95px wider than the viewport and
     clipped the right edge of every line of text. min-width:0 lets the page be
     the viewport's width, which is the whole design. */
  min-width: 0;
}

/* header / brand */
.brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 26px 0 6px;
}
.brand .basket { font-size: 26px; }
.brand h1 {
  color: var(--forest);
  font-size: 30px;
  margin: 0;
  font-weight: 700;
}

.leaves {
  text-align: center;
  color: rgba(64, 82, 45, 0.45);
  letter-spacing: 6px;
  font-size: 10px;
  margin-bottom: 4px;
}

/* hero */
.hero {
  text-align: center;
  padding: 8px 0 40px;
}
/* Five device shots: Pantry Ponder's three in the middle (one in front, two
   behind and half tucked under), plus one smaller phone at each outer edge for
   the two sibling apps — Cookbook left, Shopping List right. Every width AND
   overlap is a percentage of the SAME container, so the stack always sums to
   92% of it — it can never exceed its parent and therefore never needs
   clipping. An earlier version clipped with overflow:hidden, which sliced the
   outer bezels flat. Nothing is clipped; each phone keeps its rounded edge. */
.shots {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  max-width: 500px;
  margin: 14px auto 26px;
  padding: 18px 0;   /* vertical only — horizontal padding would change the % base */
}

/* Device bezel. The app's own background is the same cream as this page, so
   without a frame a screenshot has no edge — the dark border gives it one and
   makes it read as a phone rather than floating page content. */
.shot {
  display: block;
  box-sizing: border-box;
  height: auto;
  flex: 0 0 auto;
  border: 11px solid #23201c;
  border-radius: 44px;
  background: var(--card);
}

/* Landscape tablet capture (the Cookbook page's split view). Same bezel idea
   as .shot, but it sits inside a section instead of the phone row, so it owns
   its width and margins rather than flexing in a stack. */
.wide-shot {
  display: block;
  box-sizing: border-box;
  width: min(100%, 700px);
  height: auto;
  margin: 16px auto 2px;
  border: 11px solid #23201c;
  border-radius: 26px;
  background: var(--card);
  box-shadow: 0 14px 34px rgba(35, 32, 28, 0.22);
}

.shot-main {
  width: 40%;
  position: relative;
  z-index: 2;
  box-shadow: 0 18px 42px rgba(35, 32, 28, 0.28), 0 4px 12px rgba(0, 0, 0, 0.12);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.shot-main:hover {
  transform: translateY(-5px);
  box-shadow: 0 26px 54px rgba(35, 32, 28, 0.34), 0 6px 16px rgba(0, 0, 0, 0.14);
}

/* Behind and faded. The negative margin pulls each one under the main phone so
   roughly half shows — the visible half keeps its own rounded corners. */
.shot-side {
  width: 32%;
  z-index: 1;
  opacity: 0.5;
  filter: saturate(0.8);
  box-shadow: 0 12px 30px rgba(35, 32, 28, 0.2);
  pointer-events: none;
  transition: transform 0.35s ease, opacity 0.35s ease;
}
/* Outermost pair: the sibling apps, each its own real capture. Smaller and
   further faded, labelled by the caption row below the stack rather than by
   alt text, so a screen reader hears one app described, not three. */
.shot-suite {
  width: 22%;
  z-index: 0;
  opacity: 0.32;
  filter: saturate(0.6);
  box-shadow: 0 8px 20px rgba(35, 32, 28, 0.16);
  pointer-events: none;
  border-width: 7px;
  border-radius: 30px;
  transition: transform 0.35s ease, opacity 0.35s ease;
}
/* 22 - 12 + 32 - 16 + 40 - 16 + 32 - 12 + 22 = 92% — the slack absorbs the
   rotation, which widens each phone's footprint slightly. */
.shot-left  { margin-right: -16%; transform: rotate(-3.5deg); }
.shot-right { margin-left:  -16%; transform: rotate( 3.5deg); }
.shot-far-left  { margin-right: -12%; transform: rotate(-6deg); }
.shot-far-right { margin-left:  -12%; transform: rotate( 6deg); }

/* Which app is which, under the stack. */
.shot-captions {
  display: flex;
  justify-content: space-between;
  max-width: 500px;
  margin: -18px auto 26px;
  padding: 0 2%;
  font-size: 12px;
  color: var(--subtle);
}
.shot-captions a {
  color: var(--subtle);
  text-decoration: none;
  /* A generous hit area — the visible text is small, the target need not be. */
  padding: 8px 10px;
  margin: -8px -10px;
  border-radius: 8px;
  transition: color 0.12s ease, background 0.12s ease;
}
.shot-captions a:hover {
  color: var(--forest);
  background: rgba(64, 82, 45, 0.07);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.shot-captions .cap-mid { color: var(--forest); font-weight: 600; }

/* Narrow phones. At the desktop ratios the main screen would render tiny and
   its UI text would be illegible, so the hero gets rebalanced rather than just
   scaled down:
     - the stage bleeds through .wrap's 20px padding to use the FULL viewport
     - the main phone grows to 56% of it
     - the side phones shrink and peek by only ~14%, enough to read as depth
   29 - 15 + 56 - 15 + 29 = 84%, so it still cannot overflow. */
@media (max-width: 560px) {
  .shots {
    width: auto;
    max-width: none;
    margin: 8px -20px 20px;
    padding: 14px 0;
  }
  /* The two sibling phones disappear entirely: five phones on a narrow screen
     renders every one of them illegibly small. The captions row goes with
     them, and the layout reverts to the proven three-phone ratios. */
  .shot-suite, .shot-captions { display: none; }
  /* 56% keeps the app's own text readable while leaving the tagline and both
     store badges above the fold on a typical phone. */
  .shot-main  { width: 56%; }
  .shot-side  { width: 29%; opacity: 0.38; }
  .shot-left  { margin-right: -15%; transform: rotate(-3deg); }
  .shot-right { margin-left:  -15%; transform: rotate( 3deg); }
}

/* Hovering the main phone fans the other two outward, as if the stack were
   being opened. Gated to real pointers: on touch there is no hover, and the
   wider fan would push past the viewport on a narrow screen. :has() lets the
   siblings react to a hover on the main image without any script. */
@media (hover: hover) and (pointer: fine) {
  .shots:has(.shot-main:hover) .shot-left {
    transform: rotate(-8deg) translateX(-3%);
    opacity: 0.62;
  }
  .shots:has(.shot-main:hover) .shot-right {
    transform: rotate(8deg) translateX(3%);
    opacity: 0.62;
  }
}

@media (prefers-reduced-motion: reduce) {
  .shot-main, .shot-side { transition: none; }
  .shot-main:hover { transform: none; }
  /* Hold the resting tilt — no fan-out for anyone who asked for less motion. */
  .shots:has(.shot-main:hover) .shot-left  { transform: rotate(-3.5deg); opacity: 0.5; }
  .shots:has(.shot-main:hover) .shot-right { transform: rotate( 3.5deg); opacity: 0.5; }
}
.tagline {
  font-size: 19px;
  color: var(--forest);
  font-weight: 600;
  margin: 0 auto 6px;
  max-width: 30ch;
}
.subtag {
  font-size: 14px;
  color: var(--subtle);
  margin: 0 auto 26px;
  max-width: 40ch;
}

/* store badges */
.badges {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  justify-content: center;
}
.badges a {
  display: inline-flex;
  line-height: 0;
  transition: transform 0.12s ease, opacity 0.12s ease;
}
.badges a:hover { transform: translateY(-2px); opacity: 0.9; }
/* Official store artwork (Apple marketing-tools SVG, Google badge-generator
   PNG, Amazon devportal PNG) — required by all three brand guidelines; never
   hand-draw these. Google's asset ships with a uniform 41px transparent border
   baked in (their pre-applied clear space); it is TRIMMED in img/ so all three
   files size identically here — the row's gap provides the clear space. */
.badges img { height: 52px; width: auto; display: block; }
.badges img.badge-amazon { border-radius: 10px; }

/* ---- marketing sections (index + app pages) ---- */
.section {
  padding: 34px 0 8px;
  text-align: left;
}
.section > h2 {
  color: var(--forest);
  font-size: 24px;
  text-align: center;
  margin: 0 0 18px;
}
.section > .section-sub {
  text-align: center;
  color: var(--subtle);
  font-size: 14px;
  max-width: 52ch;
  margin: -10px auto 22px;
}

/* the three-app row */
.apps {
  display: grid;
  /* Four apps since 2026-08-07: 2x2 balances; three-across left the fourth
     card orphaned on its own row. */
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}
@media (max-width: 640px) { .apps { grid-template-columns: 1fr; } }
.app-card {
  background: var(--card);
  border: 1px solid var(--hairline);
  border-radius: 18px;
  padding: 18px;
  text-decoration: none;
  color: var(--ink);
  display: block;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.app-card:hover { transform: translateY(-3px); box-shadow: 0 10px 26px rgba(35,32,28,0.12); }
.app-card .app-emoji { font-size: 30px; line-height: 1; }
.app-card h3 {
  color: var(--forest);
  font-size: 18px;
  margin: 10px 0 6px;
}
.app-card p { font-size: 13.5px; color: var(--subtle); margin: 0; }
.app-card .more { display: inline-block; margin-top: 10px; color: var(--accent); font-size: 13px; font-weight: 600; }
.soon {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: var(--forest);
  background: rgba(64, 82, 45, 0.1);
  border-radius: 999px;
  padding: 3px 10px;
  margin-left: 8px;
  vertical-align: 2px;
}

/* feature grid */
.features {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}
@media (max-width: 560px) { .features { grid-template-columns: 1fr; } }
.feature {
  background: var(--card);
  border: 1px solid var(--hairline);
  border-radius: 12px;
  padding: 16px 18px;
}
.feature h3 { color: var(--forest); font-size: 15.5px; margin: 0 0 6px; }
.feature p { font-size: 13.5px; color: var(--subtle); margin: 0; line-height: 1.5; }
.feature .f-emoji { font-size: 20px; margin-right: 6px; }

/* how it works */
.steps { counter-reset: step; padding: 0; margin: 0; list-style: none; }
.steps li {
  counter-increment: step;
  display: flex;
  gap: 14px;
  align-items: baseline;
  padding: 10px 0;
  font-size: 15px;
}
.steps li::before {
  content: counter(step);
  flex: 0 0 auto;
  width: 26px; height: 26px;
  border-radius: 50%;
  background: var(--forest);
  color: var(--cream);
  font-size: 14px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transform: translateY(4px);
}
.steps b { color: var(--forest); }

/* FAQ */
.faq details {
  border-bottom: 1px solid var(--hairline);
  padding: 10px 2px;
}
.faq summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--forest);
  font-size: 15px;
}
.faq details p { font-size: 14px; color: var(--subtle); margin: 8px 0 4px; }

/* single-phone hero on the app pages */
.page-hero {
  text-align: center;
  padding: 4px 0 10px;
}
.page-hero img.shot { width: min(46%, 250px); margin: 14px auto 20px; }
.page-hero .tagline { margin-top: 4px; }

/* content pages */
.page {
  padding: 8px 0 48px;
}
.page h2 {
  color: var(--forest);
  font-size: 24px;
  margin: 24px 0 4px;
}
.page h3 {
  color: var(--forest);
  font-size: 16px;
  margin: 26px 0 6px;
}
.page p, .page li { font-size: 15px; color: var(--ink); }
.page a { color: var(--accent); }
.updated { color: var(--subtle); font-size: 13px; margin-top: 0; }

/* legal documents */
.legal h3 {
  color: var(--forest);
  font-size: 20px;
  margin: 32px 0 10px;
  border-bottom: 1px solid var(--hairline);
  padding-bottom: 4px;
}
.legal h4 {
  color: var(--forest);
  font-size: 16px;
  margin: 20px 0 6px;
}
.legal p {
  margin: 12px 0;
  line-height: 1.6;
}
.legal ul, .legal ol {
  padding-left: 24px;
  margin: 12px 0;
}
.legal li {
  margin-bottom: 8px;
  line-height: 1.55;
}

/* Health/medical disclaimer — the one clause that must not read as boilerplate. */
.legal .disclaimer {
  border: 1px solid var(--accent);
  border-left-width: 4px;
  border-radius: 10px;
  padding: 4px 18px 18px;
  margin: 28px 0;
  background: #fbf5f1;
}
.legal .disclaimer h3 {
  color: var(--accent);
  border-bottom: none;
  margin-top: 20px;
}


/* footer */
footer {
  border-top: 1px solid var(--hairline);
  margin-top: 12px;
  padding: 20px;
  text-align: center;
  font-size: 13px;
  color: var(--subtle);
}
footer a { color: var(--subtle); text-decoration: none; margin: 0 8px; }
footer a:hover { color: var(--forest); }
footer .off { display: block; margin-top: 10px; font-size: 12px; opacity: 0.85; }
