/*
 * Homepage only. Loaded by /index.html after site.css.
 * Every rule is scoped to body.hp-body so nothing here can restyle the blog,
 * guides, legal pages or recipe-app page (which still use .home-page from site.css).
 */

@font-face {
  font-family: 'Bricolage Grotesque';
  font-style: normal;
  font-weight: 800;
  font-display: swap;
  src: url('/fonts/bricolage-grotesque-800-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: 'Instrument Serif';
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url('/fonts/instrument-serif-italic-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ---------- Tokens ---------- */

.hp-body {
  --paper: #FFFBF3;
  --ink: #252735;
  --ink-2: #535563;
  --rule: #D8D2C6;
  --yellow: #FFD13F;
  --apricot: #F7AB61;
  --navy: #283449;
  --cream: #FFF5DE;
  --blue: #ACDDE7;
  --blue-ink: #172F3C;
  --coral: #F3AD9F;
  --lavender: #C9BFEA;
  --gold: #F8CF78;
  --sheet-teal: #99C9B7;
  --sheet-tan: #EBC694;
  --green: #244D42;
  --star: #9A6408;

  --display: 'Bricolage Grotesque', 'Avenir Next', 'Segoe UI', system-ui, sans-serif;
  --serif: 'Instrument Serif', 'Iowan Old Style', Georgia, serif;
  --sans: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;

  --gutter: 20px;
  --section-gap: 80px;
  --shot-shadow: 0 1px 2px rgba(37, 39, 53, 0.12), 0 12px 28px -10px rgba(37, 39, 53, 0.28);

  background-color: var(--paper);
}

@media (max-width: 360px) {
  .hp-body { --gutter: 16px; }
}
@media (min-width: 768px) {
  .hp-body { --gutter: 32px; --section-gap: 104px; }
}
@media (min-width: 960px) {
  .hp-body { --gutter: 48px; --section-gap: 128px; }
}

/* ---------- Shared navbar: same markup and behaviour, homepage colours ---------- */

.hp-body .navbar.home {
  background-color: var(--paper);
  border-bottom: 1px solid var(--rule);
}
.hp-body .navbar a:focus-visible,
.hp-body .navbar button:focus-visible {
  outline: 2px solid var(--green);
  outline-offset: 2px;
  box-shadow: none;
}

/* ---------- Base ---------- */

.hp {
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.5;
  color: var(--ink);
  text-align: left;
}
@media (min-width: 768px) {
  .hp { font-size: 17px; }
}
@media (min-width: 960px) {
  .hp { font-size: 18px; }
}

.hp-wrap {
  max-width: calc(1160px + 2 * var(--gutter));
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--gutter);
  padding-right: var(--gutter);
}

.hp-section { padding-top: var(--section-gap); }

.hp h1,
.hp h2,
.hp h3 {
  font-family: var(--display);
  font-weight: 800;
  color: inherit;
  margin: 0;
  letter-spacing: -0.01em;
}
.hp h2 {
  font-size: clamp(30px, 1.75vw + 24px, 46px);
  line-height: 1.1;
}
.hp h3 {
  font-size: clamp(20px, 0.55vw + 18px, 26px);
  line-height: 1.22;
}
/* zero-specificity reset so class-level margins (.hp-hero-text, .hp-lede, .hp-more) still apply */
.hp :where(p) { margin: 0; }

.hp-lede {
  margin-top: 16px;
  max-width: 29em;
}
.hp-serif {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
  letter-spacing: 0;
}

.hp a {
  color: var(--green);
  font-weight: 600;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}
.hp a:hover { text-decoration-thickness: 2px; }
.hp a:focus-visible,
.hp summary:focus-visible {
  outline: 2px solid var(--green);
  outline-offset: 3px;
  border-radius: 4px;
}

.hp img { max-width: 100%; }

.hp-sr {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* App Store badge + caption: one group, 8px apart, left-aligned */
.hp-get {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
}
.hp-get a { display: inline-block; line-height: 0; border-radius: 9px; }
.hp-get img { width: 156px; height: 52px; }
.hp-get-note {
  font-size: 14.5px;
  font-weight: 600;
  line-height: 1.4;
  color: var(--ink);
}

/* Decorative food engravings, recoloured from the white handoff artwork (ink by default) */
.hp-engraving {
  position: absolute;
  display: block;
  aspect-ratio: 240 / 198;
  background-color: var(--ink);
  -webkit-mask: url('/images/engravings/toast.png') center / contain no-repeat;
          mask: url('/images/engravings/toast.png') center / contain no-repeat;
  pointer-events: none;
}
.hp-engraving--tomatoes {
  aspect-ratio: 1 / 1;
  -webkit-mask-image: url('/images/engravings/tomatoes.png');
          mask-image: url('/images/engravings/tomatoes.png');
}
.hp-engraving--cake {
  aspect-ratio: 255 / 280;
  -webkit-mask-image: url('/images/engravings/cake.png');
          mask-image: url('/images/engravings/cake.png');
}
.hp-engraving--bag {
  aspect-ratio: 240 / 280;
  -webkit-mask-image: url('/images/engravings/grocery-bag.png');
          mask-image: url('/images/engravings/grocery-bag.png');
}

/* Heading, then body copy with an engraving beside it */
.hp-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  column-gap: 20px;
  align-items: center;
}
.hp-head > h2,
.hp-head > h3 { grid-column: 1 / -1; }
.hp-head > p { grid-column: 1; }
.hp-head > .hp-engraving {
  position: static;
  grid-column: 2;
  grid-row: 2;
  width: 56px;
  /* negative margins let the drawing overhang the paragraph row instead of stretching it;
     the 12px difference matches the paragraph's top margin so the two stay centred */
  margin: -10px 0 -22px;
}
@media (min-width: 960px) {
  .hp-head > .hp-engraving { width: 80px; }
}

/*
 * Screenshot art well. The original image is never edited: it is scaled so the
 * crop box (--cx, --cy, --cw, --ch in the image's own pixels) fills the well
 * width, and anchored on the crop's top-left corner. All offsets are percentages
 * of the well width, so the crop stays proportional at every size.
 */
.hp-shot {
  --cx: 0;
  --cy: 0;
  position: relative;
  overflow: hidden;
  background-color: #fff;
  box-shadow: var(--shot-shadow);
  aspect-ratio: var(--cw) / var(--ch);
}
.hp-shot > img {
  display: block;
  max-width: none;
  height: auto;
  width: calc(var(--iw) / var(--cw) * 100%);
  margin-left: calc(var(--cx) / var(--cw) * -100%);
  margin-top: calc(var(--cy) / var(--cw) * -100%);
}
/* Screens that run off the bottom edge of their panel */
.hp-shot--bleed {
  border-radius: 16px 16px 0 0;
  flex: 1 0 auto;
}

/* ---------- 1. Hero ---------- */

.hp-hero { padding-top: 32px; }
.hp-hero-grid {
  display: grid;
  gap: 48px;
}
.hp-hero-copy { container-type: inline-size; }

/* Sized to the copy column so "All the recipes" always holds one line */
.hp h1 {
  font-size: 46px;
  font-size: clamp(40px, 14.5cqi, 76px);
  line-height: 1.04;
  letter-spacing: -0.02em;
}
.hp h1 .hp-serif {
  display: block;
  font-size: 1.08em;
  line-height: 1.04;
}
.hp-hero-text {
  margin-top: 28px;
  font-size: 18px;
  max-width: 28em;
}
.hp-hero .hp-get { margin-top: 36px; }

.hp-hero-art {
  position: relative;
  overflow: hidden;
  background-color: var(--yellow);
  border-radius: 12px;
  aspect-ratio: 5 / 6;
}
.hp-hero-sheet {
  position: absolute;
  top: 11%;
  bottom: -10%;
  left: 20%;
  width: 60%;
  background-color: var(--apricot);
  border-radius: 12px;
  transform: rotate(3deg);
  transform-origin: top left;
}
.hp-hero-screen {
  --iw: 800; --cy: 88; --cw: 800;
  position: absolute;
  top: 8%;
  bottom: 0;
  left: 14%;
  width: 60%;
  border-radius: 20px 20px 0 0;
  aspect-ratio: auto;
}
.hp-engraving--hero {
  top: 4%;
  right: 4%;
  width: 14%;
}

@media (min-width: 600px) {
  .hp-hero-art { aspect-ratio: 1 / 1; max-width: 540px; }
  .hp-hero-screen { width: 52%; left: 20%; }
  .hp-hero-sheet { width: 52%; left: 26%; }
  .hp-engraving--hero { width: 15%; }
}

@media (min-width: 960px) {
  .hp-hero { padding-top: 48px; }
  .hp-hero-grid {
    grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
    column-gap: 32px;
    align-items: center;
  }
  .hp-hero-art { justify-self: end; width: 100%; }
  .hp-hero-text { font-size: 20px; margin-top: 40px; }
  .hp-hero .hp-get { margin-top: 48px; }
}

/* ---------- 2. Categories ---------- */

.hp-cats {
  list-style: none;
  margin: 40px 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}
.hp-cats li { margin: 0; }
.hp-cats img {
  display: block;
  width: 100%;
  height: auto;
}

@media (min-width: 600px) {
  .hp-cats {
    grid-template-columns: repeat(3, minmax(0, 168px));
    justify-content: center;
    gap: 24px 40px;
  }
}
@media (min-width: 960px) {
  .hp-cats {
    margin-top: 48px;
    grid-template-columns: repeat(6, minmax(0, 145px));
    justify-content: space-between;
    gap: 16px;
  }
}

/* ---------- Feature panels (sections 3 and 4) ---------- */

.hp-spread {
  display: grid;
  gap: 16px;
  margin-top: 40px;
}
.hp-panel {
  position: relative;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-radius: 12px;
  padding: 28px 24px 0;
}
.hp-panel .hp-head > p {
  margin-top: 12px;
  max-width: 28em;
}
.hp-panel--web .hp-engraving { background-color: var(--cream); }
.hp-panel--card .hp-engraving { background-color: var(--blue-ink); }

/* Offset paper sheets behind screens */
.hp-sheet {
  position: absolute;
  z-index: -1;
  border-radius: 12px;
}
.hp-panel--card .hp-panel-art { isolation: isolate; }
.hp-sheet--photo {
  top: 22px;
  bottom: -40px;
  left: 1%;
  right: 3%;
  background-color: var(--sheet-tan);
  transform: rotate(-3deg);
}
.hp-panel-art {
  position: relative;
  flex: 1 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-top: 28px;
}

@media (min-width: 960px) {
  .hp-spread { gap: 20px; margin-top: 48px; }
  .hp-spread--plan { margin-top: 0; }
  .hp-panel { padding: 40px 40px 0; }
  .hp-panel-art { margin-top: 36px; }
}

/* ---------- 3. Two ways to save ---------- */

.hp-panel--web { background-color: var(--navy); color: var(--cream); }
.hp-panel--card { background-color: var(--blue); color: var(--blue-ink); }

.hp-shot--link {
  --iw: 1125; --cx: 40; --cy: 560; --cw: 1045; --ch: 290;
  width: 92%;
  align-self: flex-start;
  border-radius: 10px;
}

/* Imported recipe, set to the right so the arrow can lead from the link field into it */
.hp-web-result {
  position: relative;
  flex: 1 0 auto;
  display: flex;
  flex-direction: column;
  align-self: flex-end;
  width: 72%;
  max-width: 340px;
  margin-top: 44px;
  margin-right: 4%;
}
.hp-shot--imported {
  /* Pumpkin Soup recipe screen, below the status bar: photo, title, servings and times */
  --iw: 1179; --cx: 0; --cy: 125; --cw: 1179; --ch: 1727;
  width: 100%;
}
.hp-arrow {
  position: absolute;
  top: -40px;
  right: calc(100% + 6px);
  width: 56px;
  height: 72px;
  color: var(--yellow);
  overflow: visible;
}
.hp-shot--photo {
  --iw: 1125; --cx: 0; --cy: 0; --cw: 1125; --ch: 1000;
  width: 92%;
}

.hp-more { margin-top: 20px; }
.hp-more a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  font-size: 17px;
  font-weight: 700;
}
.hp-more a span { text-decoration: none; display: inline-block; }

@media (min-width: 960px) {
  .hp-spread--save { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .hp-shot--link { width: 84%; }
  .hp-web-result { width: 62%; margin-top: 56px; margin-right: 6%; }
  .hp-arrow { top: -52px; width: 72px; height: 92px; }
  .hp-shot--photo { width: 88%; }
}

/* ---------- 4. Planning and shopping ---------- */

.hp-panel--planner { background-color: var(--lavender); color: var(--ink); }
.hp-panel--list { background-color: var(--gold); color: var(--ink); }

.hp-panel--planner .hp-panel-art { isolation: isolate; }
.hp-planner-sheet {
  position: absolute;
  z-index: -1;
  top: 18px;
  bottom: -40px;
  left: 18%;
  width: 76%;
  background-color: var(--coral);
  border-radius: 12px;
  transform: rotate(3deg);
  transform-origin: top left;
}
.hp-shot--planner {
  --iw: 800; --cx: 0; --cy: 100; --cw: 800; --ch: 1000;
  width: 76%;
}
.hp-list-stack {
  position: relative;
  isolation: isolate;
  align-self: stretch;
  flex: 1 0 auto;
  display: flex;
  flex-direction: column;
  padding-top: 8px;
}
.hp-sheet--list {
  top: 24px;
  bottom: -40px;
  left: 0;
  width: 82%;
  background-color: var(--sheet-teal);
  transform: rotate(-4deg);
  transform-origin: top right;
}
.hp-shot--list {
  --iw: 800; --cx: 0; --cy: 96; --cw: 800; --ch: 800;
  width: 88%;
  margin-left: auto;
}

.hp-spread--plan { margin-top: 0; }

@media (min-width: 960px) {
  .hp-spread--plan {
    grid-template-columns: minmax(0, 3fr) minmax(0, 2fr);
    align-items: stretch;
  }
  .hp-shot--planner { width: 54%; }
  .hp-planner-sheet { left: 28%; width: 54%; }
}

/* ---------- 5. Cooking ---------- */

.hp-cook-grid {
  display: grid;
  gap: 28px;
}
.hp-cook-copy p {
  margin-top: 16px;
  max-width: 24em;
}
/* Two app screens on a cream mat: the checked ingredients, then the highlighted step */
.hp-cook-mat {
  display: grid;
  gap: 16px;
  justify-self: center;
  width: 100%;
  max-width: 440px;
  padding: 16px;
  background-color: var(--cream);
  border: 1px solid var(--rule);
  border-radius: 12px;
}
.hp-cook-mat .hp-shot { border-radius: 10px; }
/* Phones: tighter crops so the pair stays short. Ingredients: heading and first five rows. */
.hp-shot--ingredients {
  --iw: 1179; --cx: 40; --cy: 180; --cw: 1100; --ch: 1050;
}
/* Phones: the Directions heading through the highlighted step 2 */
.hp-shot--directions {
  --iw: 1179; --cx: 30; --cy: 170; --cw: 1120; --ch: 1450;
}
@media (min-width: 600px) {
  .hp-cook-mat {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    align-items: start;
    max-width: 760px;
  }
  /* Side by side: ingredients through the eggs row */
  .hp-shot--ingredients { --ch: 1520; }
  /* Side by side: the whole directions screen, with the ingredients centred beside it */
  .hp-shot--directions { --cx: 0; --cy: 0; --cw: 1179; --ch: 2410; }
  .hp-shot--ingredients { align-self: center; }
}

@media (min-width: 960px) {
  .hp-cook-grid {
    grid-template-columns: minmax(0, 4fr) minmax(0, 8fr);
    column-gap: 32px;
    align-items: center;
  }
}

/* ---------- 6. Reviews ---------- */

.hp-reviews {
  display: grid;
  gap: 16px;
  margin-top: 40px;
  align-items: start;
}
.hp-review {
  margin: 0;
  display: flex;
  flex-direction: column;
  padding: 24px;
  background-color: #fff;
  border: 1px solid var(--rule);
  border-radius: 16px;
  box-shadow: 0 2px 0 rgba(216, 210, 198, 0.55), 0 10px 24px -16px rgba(37, 39, 53, 0.25);
}
.hp-stars {
  display: flex;
  gap: 3px;
  color: var(--star);
}
.hp-stars svg { width: 16px; height: 16px; display: block; }
.hp-review h3 { margin-top: 12px; }
.hp-review blockquote {
  flex: 1 0 auto;
  margin: 10px 0 0;
  font-size: 17px;
  line-height: 1.5;
}
.hp-review figcaption {
  margin-top: 14px;
  font-size: 14px;
  line-height: 1.45;
  color: var(--ink-2);
  overflow-wrap: anywhere;
}

@media (min-width: 768px) {
  .hp-reviews {
    grid-template-columns: minmax(0, 1.12fr) minmax(0, 1fr);
    grid-template-rows: auto 1fr;
    gap: 20px;
    align-items: stretch;
  }
  .hp-review--long { grid-row: 1 / span 2; }
}
@media (min-width: 960px) {
  .hp-reviews {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    grid-template-rows: none;
    margin-top: 48px;
  }
  .hp-review--long { grid-row: auto; }
  .hp-review { padding: 28px 32px; }
  .hp-review blockquote { font-size: 18px; }
}

/* ---------- 7. Questions ---------- */

.hp-faq-grid {
  display: grid;
  gap: 20px;
  padding-top: calc(var(--section-gap) * 0.5);
  border-top: 1px solid var(--rule);
}
.hp-section.hp-faq { padding-top: calc(var(--section-gap) * 0.5); }
.hp-q { border-bottom: 1px solid var(--rule); }
.hp-q summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 56px;
  padding: 14px 0;
  cursor: pointer;
  list-style: none;
  font-size: 17px;
  font-weight: 700;
  line-height: 1.35;
}
.hp-q summary::-webkit-details-marker { display: none; }
.hp-q-icon {
  position: relative;
  flex: none;
  width: 14px;
  height: 14px;
}
.hp-q-icon::before,
.hp-q-icon::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  background-color: currentColor;
  transform: translate(-50%, -50%);
  transition: transform 0.2s ease;
}
.hp-q-icon::before { width: 14px; height: 2px; }
.hp-q-icon::after { width: 2px; height: 14px; }
.hp-q[open] .hp-q-icon::after { transform: translate(-50%, -50%) scaleY(0); }
.hp-q p {
  padding: 0 32px 20px 0;
  max-width: 34em;
  color: var(--ink-2);
}

@media (min-width: 960px) {
  .hp-faq-grid {
    grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
    column-gap: 32px;
    align-items: start;
  }
  .hp-q summary { font-size: 17px; }
}

@media (prefers-reduced-motion: reduce) {
  .hp-q-icon::before,
  .hp-q-icon::after { transition: none; }
}

/* ---------- 8. Closing download ---------- */

.hp-closing-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding: 40px 24px 44px;
  background-color: var(--yellow);
  border-radius: 12px;
}
.hp-closing-card h2 .hp-serif { font-size: 1.12em; }
.hp-closing-card .hp-get { margin-top: 32px; }
.hp-engraving--closing {
  position: static;
  order: -1;
  width: 84px;
}

@media (min-width: 768px) {
  .hp-closing-card {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    padding: 56px 48px;
  }
  .hp-engraving--closing { order: 0; width: 140px; flex: none; margin-right: 24px; }
}

/* ---------- Shared footer, homepage colours ---------- */

.hp-body #footer {
  margin-top: 64px;
  padding: 20px 0 28px;
  background-color: var(--paper);
  color: var(--ink);
  text-align: left;
}
.hp-body #footer .container {
  max-width: calc(1160px + 2 * var(--gutter));
  padding-left: var(--gutter);
  padding-right: var(--gutter);
}
.hp-body #footer .row { margin: 0; }
.hp-body #footer .col-12 {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 24px;
  padding: 0;
}
.hp-body #footer p {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  margin: 0;
  font-size: 15px;
}
.hp-body #footer p span { margin-right: 16px; }
.hp-body #footer p .bottom-link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  margin: 0;
  padding: 0 12px;
  color: var(--ink);
  font-weight: 700;
}
.hp-body #footer p .bottom-link:hover { text-decoration: underline; }
.hp-body #footer .social {
  display: flex;
  border-top: 0;
  padding: 0;
}
.hp-body #footer .social a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  margin: 0;
}
.hp-body #footer .social a img {
  width: 30px;
  height: 30px;
  filter: brightness(0);
  opacity: 0.82;
}
.hp-body #footer a:focus-visible {
  outline: 2px solid var(--green);
  outline-offset: 2px;
  border-radius: 4px;
}
