/* The front page. */

/* ---------- Hero: simmering salsa on film, the brand set huge behind a real jar ---------- */
.hero {
  position: relative; isolation: isolate; overflow: hidden;
  display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-rows: minmax(0, 1fr) auto; gap: 0 32px;
  background: var(--maroon) url(../assets/poster-simmer.jpg) center / cover; color: var(--paper);
}
.hero__film { position: absolute; inset: -4% 0; z-index: -1; }
.hero__film video { width: 100%; height: 100%; object-fit: cover; }
.hero__film::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(22, 8, 7, .62) 0%, rgba(74, 14, 20, .38) 42%, rgba(22, 8, 7, .78) 100%);
}
/* The two words and the jar share the top row: FUEGO at its top left, LENTO at its bottom right, the jar in front. */
.hero__title, .hero__jar { grid-area: 1 / 1 / 2 / 3; }
.hero__title { display: flex; flex-direction: column; justify-content: space-between; pointer-events: none; line-height: .8; text-transform: uppercase; }
.hero__word { display: block; overflow: hidden; padding: .06em .02em; }
.hero__word > span { display: block; }
.hero__word--a { align-self: flex-start; margin-left: -.04em; }
.hero__word--b { align-self: flex-end; margin-right: -.04em; color: var(--marigold); }
.hero__jar { position: relative; z-index: 2; justify-self: center; align-self: center; }
.hero__jar::after {
  content: ""; position: absolute; z-index: -1; inset: 12% -18% -4%;
  background: radial-gradient(closest-side, rgba(10, 3, 2, .55), rgba(10, 3, 2, 0)); pointer-events: none;
}
.hero__copy { position: relative; z-index: 3; max-width: 26rem; display: grid; gap: 22px; }
.hero__lead { font-size: 1.25rem; line-height: 1.45; font-weight: 500; text-wrap: pretty; }
.hero__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 24px; }
.hero__find { color: var(--paper); }
.hero__ship { position: relative; z-index: 3; align-self: end; max-width: 16rem; text-align: right; font-weight: 700; }
.hero__toggle { position: absolute; z-index: 3; right: var(--gutter); top: 24px; }

@media (min-width: 900px) {
  /* Sized from the hero's own height as well as its width, so a short laptop screen keeps the words clear of the copy. */
  .hero { container-type: size; height: clamp(640px, calc(100svh - var(--head-h)), 960px); padding: 4cqh var(--gutter) 6cqh; }
  .hero__title { font-size: min(18.2vw, 29cqh); }
  .hero__jar { width: min(24vw, 37cqh); margin-top: -2cqh; }
}

@media (prefers-reduced-motion: no-preference) {
  .hero__word > span { animation: rise 1.1s var(--ease) both; }
  .hero__word--b > span { animation-delay: .12s; }
  .hero__jar { animation: drop 1.2s var(--ease) .25s both; }
  .hero__copy, .hero__ship { animation: fade-up .9s var(--ease) .55s both; }
}
@keyframes rise { from { transform: translateY(105%); } }
@keyframes drop { from { transform: translateY(-14%) rotate(-5deg); opacity: 0; } }
@keyframes fade-up { from { transform: translateY(16px); opacity: 0; } }

@media (max-width: 899px) {
  .hero { grid-template-columns: 1fr; grid-template-rows: auto; padding: 22px var(--gutter) 30px; gap: 26px; }
  .hero__title, .hero__jar { grid-area: 1 / 1; }
  .hero__title { font-size: 23vw; }
  .hero__jar { margin: 13vw auto 9vw; width: 50vw; }
  .hero__copy, .hero__ship { max-width: none; }
  .hero__copy { gap: 18px; }
  .hero__lead { font-size: 1.125rem; }
  .hero__ship { text-align: left; font-size: 1rem; }
  .hero__toggle { top: auto; bottom: 30px; right: var(--gutter); }
}

/* ---------- The shelf: four jars on four heats ---------- */
.shelf { background: var(--paper); }
.shelf__head {
  display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); align-items: end; gap: 24px 48px;
  padding: clamp(56px, 8vw, 112px) var(--gutter) clamp(28px, 4vw, 48px);
}
.shelf__head h2 { font-size: clamp(2.6rem, 5.6vw, 5.4rem); line-height: .9; max-width: 15ch; text-wrap: balance; }
.shelf__head p { max-width: 40ch; font-size: 1.125rem; color: var(--ink-soft); }
.shelf__row { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); }
/* Subgrid: jars, names, lines and prices sit on the same lines across the shelf, however long a name is. */
.shelf__item {
  position: relative; display: grid; grid-row: span 5; grid-template-rows: subgrid; row-gap: 10px;
  padding: 26px clamp(18px, 2vw, 30px) 30px;
}
.shelf__heat { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 1rem; }
.shelf__heat .chiles { color: var(--field-ink); }
[data-field="habanero"] .shelf__heat .chiles, [data-field="arbol"] .shelf__heat .chiles { color: var(--marigold); }
.shelf__jar { display: grid; place-items: end center; padding: 18px 0 26px; }
.shelf__jar .jar { width: min(62%, 220px); transition: transform .35s var(--ease); }
.shelf__item:hover .jar { transform: translateY(-8px) rotate(-1.5deg); }
.shelf__name { font-size: clamp(1.7rem, 2.3vw, 2.3rem); align-self: end; }
.shelf__name a { display: inline-block; padding: 12px 0; margin: -12px 0; text-decoration: none; }
.shelf__name a:hover { text-decoration: underline; text-decoration-thickness: 3px; }
.shelf__short { font-size: 1rem; line-height: 1.45; min-height: 2.9em; }
.shelf__buy { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 8px; align-self: end; }
.shelf__price { font: 400 1.9rem/1 var(--display); }
.shelf__add { padding: 0 1em; }

@media (max-width: 899px) {
  .shelf__head { grid-template-columns: 1fr; padding-top: 44px; gap: 14px; }
  .shelf__head p { font-size: 1rem; }
  .shelf__row { grid-template-columns: 1fr 1fr; }
  .shelf__item { padding: 16px 14px 18px; row-gap: 8px; }
  .shelf__heat { font-size: .9375rem; flex-wrap: wrap; gap: 4px 8px; }
  .shelf__heat .chile { width: 14px; height: 14px; }
  .shelf__jar { padding: 8px 0 14px; }
  .shelf__jar .jar { width: 64%; }
  .shelf__name { font-size: 1.45rem; }
  .shelf__short { min-height: 0; }
  .shelf__buy { flex-direction: column; align-items: stretch; gap: 10px; }
  .shelf__price { font-size: 1.6rem; }
  .shelf__add { width: 100%; padding: 6px .5em; white-space: normal; line-height: 1.15; text-align: center; }
}

/* ---------- The heat finder (the signature) ---------- */
.finder {
  position: relative; display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
  min-height: min(100svh, 900px); overflow: hidden;
}
.finder__stage { position: relative; display: grid; place-items: center; container-type: inline-size; min-height: 560px; }
.finder__giant {
  --len: 5;
  position: absolute; inset: 50% 0 auto; transform: translateY(-58%);
  color: var(--field-ink); font: 400 calc(96cqw / (var(--len) * .86)) / .8 var(--display);
  text-align: center; text-transform: uppercase; white-space: nowrap;
  filter: url(#haze); transition: color .7s var(--ease);
}
.finder__jar { position: relative; width: min(38cqw, 300px); }
.finder__jar .jar__body { transition-duration: 1s; }
.finder__panel { display: grid; align-content: center; gap: 22px; padding: clamp(48px, 7vw, 96px) var(--gutter) clamp(48px, 7vw, 96px) 0; max-width: 560px; }
.finder__title { font-size: clamp(2.6rem, 4.6vw, 4.4rem); }
.finder__lead { font-size: 1.125rem; }
.scale__steps { position: relative; display: grid; grid-template-columns: repeat(5, 1fr); align-items: end; gap: 4px; }
.scale__steps::before {
  content: ""; position: absolute; left: 10%; right: 10%; bottom: 70px; height: 4px; background: currentColor; opacity: .22;
}
.scale__step {
  --size: calc(26px + var(--n) * 7px);
  position: relative; display: grid; justify-items: center; gap: 6px; padding: 8px 2px 4px; cursor: pointer;
  text-align: center;
}
.scale__step input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.scale__chile {
  width: var(--size); height: var(--size); background: currentColor; opacity: .3;
  -webkit-mask: url(../assets/chile.svg) center / contain no-repeat; mask: url(../assets/chile.svg) center / contain no-repeat;
  transition: opacity .3s var(--ease), transform .3s var(--ease), background-color .3s var(--ease);
}
.scale__n { font: 400 1.6rem/1 var(--display); margin-top: 8px; }
.scale__word { font-size: .9375rem; font-weight: 600; line-height: 1.2; min-height: 2.4em; }
.scale__step:hover .scale__chile { opacity: .6; }
.scale__step:has(input:checked) .scale__chile { opacity: 1; transform: translateY(-4px) rotate(-8deg); }
.scale__step:has(input:checked) .scale__n { text-decoration: underline; text-decoration-thickness: 4px; text-underline-offset: 6px; }
.scale__step:has(input:focus-visible) { outline: 3px solid currentColor; outline-offset: 2px; }
/* Chiles up to the chosen level light up: the heat rises along the scale. */
.finder[data-heat="2"] .scale__step:nth-child(-n+2) .scale__chile,
.finder[data-heat="3"] .scale__step:nth-child(-n+3) .scale__chile,
.finder[data-heat="4"] .scale__step:nth-child(-n+4) .scale__chile,
.finder[data-heat="5"] .scale__step:nth-child(-n+5) .scale__chile { opacity: 1; }
.finder__result { display: grid; gap: 4px; min-height: 9.5em; }
.finder__pick { font-weight: 700; }
.finder__name { font: 400 clamp(2.2rem, 3.6vw, 3.4rem)/.95 var(--display); }
.finder__what { font-size: 1.125rem; }
.finder__note { font-weight: 700; }
.finder__buy { display: flex; flex-wrap: wrap; align-items: center; gap: 16px 22px; }
.finder__price { font: 400 2.4rem/1 var(--display); }

@media (max-width: 899px) {
  /* On a phone the question comes first, then the jar, then the scale right under it. */
  .finder { grid-template-columns: 1fr; min-height: 0; padding: 44px 0 48px; }
  .finder__panel { display: contents; }
  .finder__panel > *, .finder__stage { margin-inline: var(--gutter); }
  .finder__title { order: 1; }
  .finder__lead { order: 2; margin-top: 12px; }
  .finder__stage { order: 3; min-height: 0; padding: 18px 0 26px; margin-inline: 0; }
  .scale { order: 4; }
  .finder__result { order: 5; margin-top: 18px; }
  .finder__buy { order: 6; margin-top: 14px; }
  .finder__jar { width: 44vw; }
  .finder__title { font-size: 2.5rem; }
  .finder__lead { font-size: 1rem; }
  .scale__step { --size: calc(20px + var(--n) * 6px); }
  .scale__steps::before { bottom: 64px; }
  .scale__n { font-size: 1.35rem; }
  .scale__word { font-size: .875rem; }
  .finder__result { min-height: 8.5em; }
}

/* ---------- The gift box ---------- */
.trio { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: center; gap: 48px; padding: clamp(64px, 9vw, 128px) var(--gutter); }
.trio__pic { width: min(100%, 560px); justify-self: center; }
.trio__text { display: grid; gap: 18px; max-width: 30rem; }
.trio h2 { font-size: clamp(2.6rem, 5vw, 4.6rem); color: var(--marigold); }
.trio__lead { font-size: 1.2rem; }
.trio__price { font: 400 2rem/1 var(--display); }
.trio__save { color: rgba(245, 233, 217, .82); }
.trio__buy { display: flex; flex-wrap: wrap; align-items: center; gap: 16px 24px; margin-top: 6px; }
.trio .link-arrow { color: var(--paper); }
@media (max-width: 899px) {
  .trio { grid-template-columns: 1fr; gap: 30px; }
  .trio__pic { width: 88%; }
  .trio h2 { font-size: 2.6rem; }
  .trio__lead { font-size: 1.0625rem; }
}

/* ---------- Cooked slow ---------- */
.slow {
  position: relative; display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); align-items: center; gap: 0 24px;
  padding: clamp(72px, 10vw, 140px) var(--gutter);
}
.slow__film { position: relative; grid-column: 1 / 8; grid-row: 1; aspect-ratio: 5 / 4.6; overflow: hidden; background: var(--maroon) url(../assets/poster-cut.jpg) center / cover; }
.slow__film video { width: 100%; height: 100%; object-fit: cover; }
.slow__toggle { position: absolute; left: 14px; bottom: 14px; }
.slow__photo {
  grid-column: 6 / 9; grid-row: 1; align-self: end; width: 100%; height: auto; aspect-ratio: 3 / 4.6; object-fit: cover;
  margin-bottom: -48px; border: 8px solid var(--paper); position: relative; z-index: 1;
}
.slow__text { grid-column: 9 / 13; grid-row: 1; display: grid; gap: 18px; }
.slow h2 { font-size: clamp(2.4rem, 4.4vw, 4.2rem); }
.slow__text p { font-size: 1.125rem; max-width: 34ch; }
@media (max-width: 899px) {
  .slow { grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 0 12px; padding-bottom: 64px; }
  .slow__film { grid-column: 1 / 6; aspect-ratio: 4 / 4.6; }
  .slow__photo { grid-column: 4 / 7; margin-bottom: -36px; border-width: 6px; }
  .slow__text { grid-column: 1 / 7; grid-row: 2; margin-top: 64px; }
  .slow h2 { font-size: 2.4rem; }
  .slow__text p { font-size: 1.0625rem; }
}

/* ---------- Shipping band ---------- */
.shipband {
  display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); align-items: center; gap: 40px 64px;
  background: var(--marigold); color: var(--ink); padding: clamp(56px, 8vw, 104px) var(--gutter);
}
.shipband__inner { display: grid; gap: 14px; }
.shipband h2 { font-size: clamp(2.4rem, 5.4vw, 5rem); max-width: 14ch; }
.shipband__next { font: 700 1.3rem/1.35 var(--text); }
.shipband__sample { font-weight: 500; font-size: 1rem; }
.shipband p { font-size: 1.125rem; }

@media (max-width: 899px) { .shipband { grid-template-columns: 1fr; } }
