/* =====================================================================
   InstaFarm · "Clean-label range" products section
   Drop-in component, measured from products-reference.png (stage = 1867px).
   Inner sizes use container-query units (cqi = 1% of .products__stage width)
   with px floors. DO NOT replace cqi values with px / vw / clamp.
   ===================================================================== */

.products {
  --pr-bg: #FDF7F4;
  --pr-ink: #17171D;
  --pr-text: #5E5654;
  --pr-red: #C4161C;
  --pr-red-dark: #A91218;
  --pr-line: #F1DFDA;

  position: relative;
  overflow: hidden;
  background: var(--pr-bg);
  scroll-margin-top: 80px;
}
.products__stage { container-type: inline-size; position: relative; max-width: 1600px; margin: 0 auto; }
.products__tray {
  position: absolute;
  right: 0;
  top: 0;
  width: 22.3cqi;
  height: auto;
  pointer-events: none;
  -webkit-mask-image: linear-gradient(90deg, transparent 0%, #000 35%), linear-gradient(180deg, #000 70%, transparent 100%);
  -webkit-mask-composite: source-in;
          mask-image: linear-gradient(90deg, transparent 0%, #000 30%), linear-gradient(180deg, #000 70%, transparent 100%);
          mask-composite: intersect;
}
.products__inner { position: relative; z-index: 1; padding: 2.8cqi 3.4cqi 2.2cqi 3.75cqi; }

/* ---------- header ---------- */
.products__head { display: flex; align-items: flex-end; justify-content: space-between; gap: 2cqi; padding-left: 2.25cqi; max-width: 73.5cqi; }
.products__eyebrow {
  margin: 0;
  font: 700 max(12px, .8cqi)/1 'Instrument Sans', system-ui, sans-serif;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--pr-red);
}
.products__title {
  margin: 1.35cqi 0 0;
  font-family: 'Fraunces', Georgia, serif;
  font-variation-settings: "opsz" 40, "SOFT" 0, "WONK" 0;
  font-weight: 600;
  font-size: max(32px, 3.9cqi);
  line-height: 1.03;
  letter-spacing: -.025em;
  color: var(--pr-ink);
}
.products__title span { display: block; white-space: nowrap; }
.products__title em { font-style: italic; color: var(--pr-red); }
.products__lede { margin: .75cqi 0 0; font: 400 max(15px, 1.14cqi)/1.4 'Instrument Sans', system-ui, sans-serif; color: var(--pr-text); white-space: nowrap; }
.products__ctas { display: flex; gap: .9cqi; flex: none; margin-bottom: 1.7cqi; }
.products__btn {
  display: inline-flex;
  align-items: center;
  gap: 1.1cqi;
  height: max(46px, 2.85cqi);
  padding: 0 1.9cqi;
  border-radius: 999px;
  font: 600 max(15px, .92cqi)/1 'Instrument Sans', system-ui, sans-serif;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color .25s, color .25s, transform .25s, box-shadow .25s;
}
.products__btn--primary { background: var(--pr-red); color: #FFFFFF; box-shadow: 0 10px 24px rgba(196, 22, 28, .25); }
.products__btn--primary:hover { background: var(--pr-red-dark); color: #FFFFFF; transform: translateY(-2px); }
.products__btn--ghost { border: 1.5px solid #E9A9A3; color: var(--pr-red); background: rgba(255, 255, 255, .7); }
.products__btn--ghost:hover { background: #FFFFFF; transform: translateY(-2px); }
.products__btn:focus-visible { outline: 2px solid var(--pr-red); outline-offset: 3px; }

/* ---------- product grid ---------- */
.products__grid {
  list-style: none;
  margin: 2cqi 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1.1cqi;
}
.product {
  --tint: #FCE5E1;
  --tint-ink: var(--pr-red);
  position: relative;
  overflow: hidden;
  height: 13.8cqi;
  border: 1px solid var(--pr-line);
  border-radius: 1.2cqi;
  background: #FFFBFA;
  box-shadow: 0 10px 28px rgba(150, 60, 50, .05);
  transition: transform .4s cubic-bezier(.2,.7,.2,1), box-shadow .4s cubic-bezier(.2,.7,.2,1);
}
.product--gold  { --tint: #FBEBD2; --tint-ink: #A5660F; }
.product--green { --tint: #EEF0DC; --tint-ink: #4E5E24; }
.product__img {
  position: absolute;
  right: 0;
  top: 0;
  height: 100%;
  width: 56%;
  object-fit: cover;
  object-position: 85% 50%;
  pointer-events: none;
  -webkit-mask-image: linear-gradient(90deg, transparent 0%, #000 30%);
          mask-image: linear-gradient(90deg, transparent 0%, #000 30%);
  transition: transform .6s cubic-bezier(.2,.7,.2,1);
  transform-origin: right center;
}
.product__link {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  height: 100%;
  box-sizing: border-box;
  padding: 1.05cqi 1.5cqi 1.15cqi;
  color: inherit;
  text-decoration: none;
}
.product__link:focus-visible { outline: 2px solid var(--pr-red); outline-offset: -4px; border-radius: 1.2cqi; }
.product__icon {
  width: max(40px, 3.2cqi);
  height: max(40px, 3.2cqi);
  border-radius: 50%;
  background: var(--tint);
  display: grid;
  place-items: center;
  color: var(--tint-ink);
}
.product__icon svg { width: 52%; height: 52%; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.product h3 {
  margin: 1.5cqi 0 0;
  font-family: 'Fraunces', Georgia, serif;
  font-variation-settings: "opsz" 40, "SOFT" 0, "WONK" 0;
  font-weight: 600;
  font-size: max(18px, 1.28cqi);
  line-height: 1.15;
  color: var(--pr-ink);
  white-space: nowrap;
}
.product p {
  margin: .5cqi 0 0;
  max-width: 12.4cqi;
  font: 400 max(13px, .83cqi)/1.45 'Instrument Sans', system-ui, sans-serif;
  color: var(--pr-text);
}
.product__go {
  margin-top: auto;
  width: max(34px, 2.46cqi);
  height: max(34px, 2.46cqi);
  border-radius: 50%;
  background: var(--tint);
  display: grid;
  place-items: center;
  color: var(--tint-ink);
  font: 500 max(14px, .95cqi)/1 'Instrument Sans', system-ui, sans-serif;
  transition: transform .3s ease, background-color .3s ease, color .3s ease;
}
@media (hover: hover) {
  .product:hover { transform: translateY(-4px); box-shadow: 0 18px 40px rgba(150, 60, 50, .10); }
  .product:hover .product__img { transform: scale(1.04); }
  .product:hover .product__go { transform: translateX(3px); background: var(--tint-ink); color: #FFFFFF; }
}

/* ---------- reveal ---------- */
.products [data-reveal] { opacity: 0; transform: translateY(18px); transition: opacity .7s cubic-bezier(.2,.7,.2,1), transform .7s cubic-bezier(.2,.7,.2,1); }
.products [data-reveal].is-in { opacity: 1; transform: none; }
.product[data-reveal]:nth-child(4n+2) { transition-delay: .06s; }
.product[data-reveal]:nth-child(4n+3) { transition-delay: .12s; }
.product[data-reveal]:nth-child(4n+4) { transition-delay: .18s; }

/* ---------- responsive ---------- */
@media (max-width: 1099px) {
  .products__tray { width: 40%; opacity: .6; }
  .products__inner { padding: 48px 28px 52px; }
  .products__head { display: block; padding-left: 0; max-width: none; }
  .products__title { font-size: clamp(34px, 6vw, 52px); }
  .products__lede { white-space: normal; margin-top: 12px; max-width: 34rem; }
  .products__ctas { margin: 22px 0 0; gap: 12px; flex-wrap: wrap; }
  .products__btn { padding: 0 24px; gap: 12px; }
  .products__grid { margin-top: 28px; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
  .product { height: 220px; border-radius: 18px; }
  .product__link { padding: 18px 20px; }
  .product h3 { margin-top: 18px; white-space: normal; }
  .product p { max-width: 55%; margin-top: 6px; }
}
@media (max-width: 639px) {
  .products__tray { display: none; }
  .products__inner { padding: 40px 20px 44px; }
  .products__title { font-size: clamp(30px, 8.6vw, 40px); }
  .products__title span { white-space: normal; }
  .products__ctas { flex-direction: column; }
  .products__btn { justify-content: center; }
  .products__grid { grid-template-columns: 1fr; }
  .product { height: 200px; }
  .product p { max-width: 50%; }
}

@media (prefers-reduced-motion: reduce) {
  .products *, .products [data-reveal] { transition: none !important; }
  .products [data-reveal] { opacity: 1; transform: none; }
  .product:hover, .product:hover .product__img { transform: none; }
}
