/* Clevererexa: Market Fresh */

:root {
  --bg: #F3F2EC;
  --bg-alt: #E7E7DE;
  --surface: #FFFFFF;
  --ink: #14201A;
  --ink-soft: #3B4740;
  --muted: #5B675F;
  --line: #D6D7CD;
  --accent: #1C7F45;
  --accent-hover: #166B39;
  --accent-soft: #DCEBDF;
  --accent-on-dark: #8FD4A6;
  --dark: #14201A;
  --on-dark: #ECEDE4;
  --on-dark-muted: #A9B3AB;
  --line-dark: rgba(236, 237, 228, 0.16);

  --font-display: "Bricolage Grotesque", ui-sans-serif, system-ui, sans-serif;
  --font-body: "Instrument Sans", ui-sans-serif, system-ui, sans-serif;

  --r-input: 12px;
  --r-card: 20px;
  --r-pill: 999px;

  --container: 1240px;
  --gutter: clamp(16px, 4vw, 48px);
  --section: clamp(88px, 12vw, 168px);
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

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

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

/* Full-bleed elements use 100vw, which includes the scrollbar; clip the sliver. */
html,
body {
  overflow-x: clip;
}

html.lenis,
html.lenis body {
  height: auto;
}

.lenis.lenis-smooth {
  scroll-behavior: auto !important;
}

.lenis.lenis-stopped {
  overflow: hidden;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

::selection {
  background: var(--accent);
  color: #fff;
}

img,
video,
svg {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

:where(h1, h2, h3, h4, p, ul, ol, figure) {
  margin: 0;
}

h1,
h2,
h3,
h4 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.035em;
  font-variation-settings: "opsz" 96;
}

.container {
  width: min(var(--container), 100% - var(--gutter) * 2);
  margin-inline: auto;
}

/* Motion: start states only when motion.js is running. */
.motion-pending .hero-title,
.motion-pending [data-hero-fade],
.motion-pending .hero-frame,
.motion-pending .site-header .nav-wrap {
  visibility: hidden;
}

.w {
  display: inline-block;
  overflow: hidden;
  padding-bottom: 0.12em;
  margin-bottom: -0.12em;
  vertical-align: top;
}

.wi {
  display: inline-block;
  will-change: transform;
}

/* ----- Buttons and links ----- */

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55em;
  min-height: 52px;
  padding: 0 1.6rem;
  border: 1px solid transparent;
  border-radius: var(--r-pill);
  font-family: var(--font-body);
  font-size: 0.98rem;
  font-weight: 600;
  letter-spacing: -0.005em;
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 0.35s var(--ease), color 0.35s var(--ease), border-color 0.35s var(--ease), transform 0.35s var(--ease);
}

.button:active {
  transform: scale(0.97);
}

.button .arrow,
.text-link .arrow {
  display: inline-block;
  transition: transform 0.45s var(--ease);
}

.button:hover .arrow,
.text-link:hover .arrow,
a:hover .text-link .arrow {
  transform: translateX(4px);
}

.button-primary {
  background: var(--accent);
  color: #fff;
}

.button-primary:hover {
  background: var(--accent-hover);
}

.button-secondary {
  background: transparent;
  border-color: var(--ink);
  color: var(--ink);
}

.button-secondary:hover {
  background: var(--ink);
  color: var(--bg);
}

.button-ghost {
  background: transparent;
  border-color: var(--line);
  color: var(--ink);
}

.button-ghost:hover {
  border-color: var(--ink);
}

.button.on-dark {
  border-color: var(--on-dark);
  color: var(--on-dark);
}

.button.on-dark:hover {
  background: var(--on-dark);
  color: var(--dark);
}

.button-ghost.on-dark {
  border-color: var(--line-dark);
}

.button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.text-link {
  display: inline-flex;
  align-items: center;
  gap: 0.45em;
  font-weight: 600;
  color: var(--accent);
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

/* ----- Header ----- */

.site-header {
  position: fixed;
  inset: 0 0 auto;
  z-index: 50;
  transition: background-color 0.5s var(--ease), box-shadow 0.5s var(--ease), backdrop-filter 0.5s var(--ease);
}

.site-header.is-scrolled {
  background: rgba(243, 242, 236, 0.82);
  backdrop-filter: blur(16px) saturate(1.4);
  -webkit-backdrop-filter: blur(16px) saturate(1.4);
  box-shadow: 0 1px 0 var(--line);
}

.nav-wrap {
  display: flex;
  align-items: center;
  gap: 2rem;
  min-height: 84px;
  transition: min-height 0.5s var(--ease);
}

.is-scrolled .nav-wrap {
  min-height: 68px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--ink);
  margin-right: auto;
}

.brand-mark {
  width: 38px;
  height: 38px;
  flex: none;
  overflow: visible;
}

.brand-mark .mark-leaf {
  fill: var(--accent);
  transform-origin: 34.6px 13.4px;
  transition: transform 0.7s var(--ease);
}

.brand-mark .mark-vein {
  stroke: var(--bg);
}

.brand:hover .mark-leaf {
  transform: rotate(-14deg) scale(1.08);
}

.brand-word {
  font-family: var(--font-display);
  font-size: 1.42rem;
  font-weight: 700;
  letter-spacing: -0.045em;
  font-variation-settings: "opsz" 40;
}

.main-nav {
  display: flex;
  gap: 2rem;
  font-size: 0.95rem;
  font-weight: 500;
}

.main-nav a {
  position: relative;
  padding: 0.3rem 0;
  color: var(--ink-soft);
  transition: color 0.3s var(--ease);
}

.main-nav a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -2px;
  height: 2px;
  border-radius: 2px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.5s var(--ease);
}

.main-nav a:hover {
  color: var(--ink);
}

.main-nav a:hover::after {
  transform: scaleX(1);
  transform-origin: left;
}

.nav-cta {
  min-height: 46px;
  padding: 0 1.3rem;
  font-size: 0.92rem;
}

/* The homepage hero already has "Find a meal"; the header copy appears once you scroll past it. */
.home .site-header:not(.is-past-hero) .nav-cta {
  opacity: 0;
  pointer-events: none;
  transform: translateY(-8px);
}

.home .nav-cta {
  transition: opacity 0.5s var(--ease), transform 0.5s var(--ease), background-color 0.35s var(--ease);
}

.mobile-nav {
  display: none;
  position: relative;
}

.mobile-nav summary {
  display: grid;
  place-content: center;
  gap: 6px;
  width: 46px;
  height: 46px;
  border-radius: var(--r-pill);
  border: 1px solid var(--line);
  background: var(--surface);
  cursor: pointer;
  list-style: none;
}

.mobile-nav summary::-webkit-details-marker {
  display: none;
}

.mobile-nav summary span {
  display: block;
  width: 18px;
  height: 2px;
  border-radius: 2px;
  background: var(--ink);
  transition: transform 0.4s var(--ease);
}

.mobile-nav[open] summary span:first-child {
  transform: translateY(4px) rotate(45deg);
}

.mobile-nav[open] summary span:last-child {
  transform: translateY(-4px) rotate(-45deg);
}

.mobile-nav nav {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  display: grid;
  min-width: 220px;
  padding: 0.5rem;
  border-radius: var(--r-card);
  border: 1px solid var(--line);
  background: var(--surface);
}

.mobile-nav nav a {
  padding: 0.85rem 1rem;
  border-radius: var(--r-input);
  font-weight: 500;
}

.mobile-nav nav a:hover {
  background: var(--accent-soft);
}

/* ----- Hero ----- */

.hero {
  position: relative;
  padding: calc(84px + clamp(40px, 7vw, 96px)) 0 clamp(64px, 9vw, 120px);
  overflow: hidden;
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  align-items: center;
  gap: clamp(32px, 5vw, 80px);
}

.hero-title {
  font-size: clamp(3.1rem, 7.4vw, 7.4rem);
  line-height: 0.92;
  letter-spacing: -0.055em;
  font-weight: 700;
}

.hero-title em {
  font-style: normal;
  color: var(--accent);
}

.hero-lead {
  max-width: 34ch;
  margin-top: clamp(20px, 2.4vw, 32px);
  font-size: clamp(1.08rem, 1.3vw, 1.25rem);
  line-height: 1.55;
  color: var(--ink-soft);
}

.hero-search {
  max-width: 560px;
  margin-top: clamp(28px, 3vw, 40px);
}

.hero-search > label {
  display: block;
  margin-bottom: 0.6rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--ink-soft);
}

.hero-search-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 0.45rem 0.45rem 1.3rem;
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  background: var(--surface);
  transition: border-color 0.3s var(--ease), box-shadow 0.3s var(--ease);
}

.hero-search-row:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
}

.hero-search textarea {
  flex: 1;
  min-width: 0;
  height: 28px;
  min-height: 0;
  padding: 0;
  border: 0;
  background: transparent;
  resize: none;
  outline: none;
  font-size: 1.02rem;
  line-height: 28px;
  overflow: hidden;
}

.hero-search textarea::placeholder {
  color: #8A948C;
}

#hero-search-hint {
  margin-top: 0.6rem;
  padding-left: 1.3rem;
  font-size: 0.8rem;
  color: var(--muted);
}

.ingredient-chips,
.timer-presets,
.shopping-actions,
.timer-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.ingredient-chips {
  margin-top: 0.9rem;
}

.ingredient-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  min-height: 36px;
  padding: 0 0.9rem;
  border: 0;
  border-radius: var(--r-pill);
  background: var(--accent-soft);
  color: var(--accent-hover);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.3s var(--ease), color 0.3s var(--ease);
}

.ingredient-chip:hover {
  background: var(--accent);
  color: #fff;
}

.hero-visual {
  position: relative;
  margin-right: calc((100vw - min(var(--container), 100vw - var(--gutter) * 2)) / -2);
}

.hero-frame,
.article-hero-frame {
  position: relative;
}

.hero-frame {
  height: clamp(440px, 72vh, 760px);
  overflow: hidden;
  border-radius: 28px 0 0 28px;
}

/* Parallax images are 20% taller than their frame so the drift never shows an edge. */
.hero-image,
.article-hero-frame img {
  position: absolute;
  top: -10%;
  left: 0;
  width: 100%;
  height: 120%;
}

.hero-image {
  object-fit: cover;
  object-position: 50% 30%;
  will-change: transform;
}

/* ----- Statement ----- */

.statement {
  padding: var(--section) 0;
}

.statement-text {
  max-width: 22ch;
  font-family: var(--font-display);
  font-size: clamp(2.2rem, 5.2vw, 4.9rem);
  font-weight: 600;
  line-height: 1.04;
  letter-spacing: -0.045em;
  font-variation-settings: "opsz" 96;
}

.statement-num {
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}

/* ----- Films ----- */

.films {
  background: var(--dark);
  color: var(--on-dark);
}

.films-pin {
  padding: var(--section) 0 clamp(64px, 8vw, 112px);
  overflow: hidden;
}

.films-head {
  display: grid;
  gap: 1rem;
  margin-bottom: clamp(40px, 5vw, 72px);
}

.films-head h2 {
  max-width: 14ch;
  font-size: clamp(2.6rem, 5.6vw, 5.4rem);
  letter-spacing: -0.05em;
}

.films-head p {
  max-width: 44ch;
  color: var(--on-dark-muted);
  font-size: 1.08rem;
}

.films-track {
  display: flex;
  gap: clamp(16px, 2vw, 28px);
  padding-inline: max(var(--gutter), (100vw - var(--container)) / 2);
  width: max-content;
  will-change: transform;
}

.film {
  width: min(62vw, 820px);
  flex: none;
}

.film-media {
  overflow: hidden;
  border-radius: var(--r-card);
  background: #0B120E;
}

.film video {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
}

.film figcaption {
  margin-top: 1rem;
  font-family: var(--font-display);
  font-size: clamp(1.3rem, 2vw, 1.9rem);
  font-weight: 600;
  letter-spacing: -0.03em;
}

/* ----- Forms (shared) ----- */

.field {
  display: grid;
  gap: 0.45rem;
  min-width: 0;
}

.field label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--ink-soft);
}

.field input,
.field select,
.contact-field input,
.contact-field textarea {
  width: 100%;
  min-height: 50px;
  padding: 0 1rem;
  border: 1px solid var(--line);
  border-radius: var(--r-input);
  background: var(--surface);
  font-size: 0.98rem;
  transition: border-color 0.3s var(--ease), box-shadow 0.3s var(--ease);
}

.field select {
  appearance: none;
  padding-right: 2.6rem;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%2314201A' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  cursor: pointer;
}

.field input:focus,
.field select:focus,
.contact-field input:focus,
.contact-field textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
}

.tool-note {
  font-size: 0.86rem;
  line-height: 1.6;
  color: var(--muted);
}

#densityGroup[hidden] {
  display: none;
}

/* ----- Planner ----- */

.planner {
  padding: var(--section) 0;
  scroll-margin-top: 80px;
}

.planner-head {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  justify-content: space-between;
  gap: 1.5rem;
  margin-bottom: clamp(28px, 3.5vw, 48px);
}

.planner-head h2,
.section-title {
  font-size: clamp(2.5rem, 5vw, 4.6rem);
  letter-spacing: -0.05em;
  line-height: 0.96;
}

.planner-filters {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr)) 120px;
  gap: 1rem;
  padding: 1.25rem;
  border-radius: var(--r-card);
  background: var(--bg-alt);
}

#recipeStatus {
  margin: 1.6rem 0 1.2rem;
  font-size: 0.95rem;
  color: var(--ink-soft);
}

.recipe-results {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  scroll-margin-top: 110px;
}

.recipe-card {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  padding: clamp(22px, 2.4vw, 32px);
  border-radius: var(--r-card);
  background: var(--surface);
  transition: transform 0.5s var(--ease);
}

.recipe-card:hover {
  transform: translateY(-4px);
}

.recipe-empty {
  grid-column: 1 / -1;
}

.recipe-card-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.recipe-type {
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.match-pill {
  padding: 0.35rem 0.75rem;
  border-radius: var(--r-pill);
  background: var(--accent);
  color: #fff;
  font-size: 0.78rem;
  font-weight: 700;
}

.recipe-card h3 {
  font-size: clamp(1.6rem, 2.3vw, 2.1rem);
  letter-spacing: -0.04em;
  line-height: 1.02;
}

.recipe-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.recipe-meta span {
  padding: 0.3rem 0.7rem;
  border-radius: var(--r-pill);
  background: var(--bg);
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--ink-soft);
}

.recipe-ingredients {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 1.1rem;
  padding: 0.9rem 0 0;
  border-top: 1px solid var(--line);
  list-style: none;
  font-size: 0.94rem;
}

.recipe-ingredients li {
  position: relative;
  padding-left: 1rem;
}

.recipe-ingredients li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.62em;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  border: 1.5px solid var(--muted);
}

.recipe-ingredients li.is-have::before {
  border-color: var(--accent);
  background: var(--accent);
}

.recipe-missing {
  font-size: 0.92rem;
  color: var(--ink-soft);
}

.recipe-method summary {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 600;
  color: var(--accent);
  cursor: pointer;
  list-style: none;
}

.recipe-method summary::-webkit-details-marker {
  display: none;
}

.recipe-method summary::after {
  content: "+";
  font-size: 1.2rem;
  line-height: 1;
  transition: transform 0.4s var(--ease);
}

.recipe-method[open] summary::after {
  transform: rotate(45deg);
}

.recipe-steps {
  display: grid;
  gap: 0.5rem;
  margin-top: 0.9rem;
  padding-left: 1.2rem;
  color: var(--ink-soft);
  font-size: 0.95rem;
}

.recipe-steps li::marker {
  color: var(--accent);
  font-weight: 700;
}

.scale-note {
  margin-top: 0.8rem;
  font-size: 0.84rem;
  color: var(--muted);
}

.recipe-card .add-shopping {
  align-self: flex-start;
  margin-top: auto;
  min-height: 44px;
  font-size: 0.9rem;
}

.shopping-list {
  margin-top: 1.4rem;
  padding: clamp(22px, 2.4vw, 32px);
  border-radius: var(--r-card);
  background: var(--accent-soft);
}

.shopping-list h3 {
  font-size: 1.6rem;
  letter-spacing: -0.035em;
}

.shopping-list ul {
  columns: 2 180px;
  margin: 1rem 0 1.2rem;
  padding-left: 1.2rem;
}

.dietary-warning {
  max-width: 80ch;
  margin-top: 2rem;
  padding-top: 1.2rem;
  border-top: 1px solid var(--line);
}

/* ----- Kitchen tools bento ----- */

.kitchen-tools {
  padding: 0 0 var(--section);
}

.kitchen-tools .section-title {
  max-width: 13ch;
  margin-bottom: clamp(32px, 4vw, 56px);
}

.bento {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 1rem;
}

.bento-cell {
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
  padding: clamp(24px, 3vw, 40px);
  border-radius: var(--r-card);
}

.bento-cell h3 {
  font-size: clamp(1.7rem, 2.6vw, 2.4rem);
  letter-spacing: -0.04em;
}

.cell-nutrition {
  grid-column: span 5;
  background: var(--surface);
}

.cell-converter {
  grid-column: span 7;
  background: var(--accent-soft);
}

.cell-timer {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  align-items: end;
  gap: clamp(24px, 4vw, 64px);
  background: var(--dark);
  color: var(--on-dark);
}

.tool-form {
  display: grid;
  gap: 0.9rem;
}

.converter-form {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: end;
}

.converter-form #densityGroup {
  grid-column: 1 / -1;
}

.converter-form .button,
.tool-form .button {
  justify-self: start;
}

.converter-form .button {
  grid-column: 1 / -1;
}

.tool-result:empty {
  display: none;
}

.nutrition-card,
.converter-card {
  padding: 1.2rem 1.3rem;
  border-radius: var(--r-input);
  background: var(--bg);
}

.cell-converter .converter-card {
  background: var(--surface);
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.6rem;
}

.nutrition-card strong,
.converter-card strong {
  font-family: var(--font-display);
  font-size: 1.5rem;
  letter-spacing: -0.03em;
}

.converter-card p {
  color: var(--muted);
}

.nutrition-card p {
  margin-top: 0.3rem;
}

.nutrition-card small {
  display: block;
  margin-top: 0.6rem;
  color: var(--muted);
  font-size: 0.8rem;
}

.timer-display {
  margin-top: 0.4rem;
  font-family: var(--font-display);
  font-size: clamp(5rem, 15vw, 12rem);
  font-weight: 600;
  line-height: 0.9;
  letter-spacing: -0.06em;
  font-variant-numeric: tabular-nums;
  color: var(--on-dark);
}

.cell-timer .tool-note {
  color: var(--on-dark-muted);
  min-height: 1.4em;
}

.timer-controls {
  display: grid;
  gap: 1rem;
}

.cell-timer .field label {
  color: var(--on-dark-muted);
}

.cell-timer .field input {
  background: rgba(236, 237, 228, 0.06);
  border-color: var(--line-dark);
  color: var(--on-dark);
}

.preset-button {
  min-height: 40px;
  padding: 0 1rem;
  border-radius: var(--r-pill);
  border: 1px solid var(--line-dark);
  background: transparent;
  color: var(--on-dark);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.3s var(--ease), color 0.3s var(--ease);
}

.preset-button:hover {
  background: var(--accent-on-dark);
  border-color: var(--accent-on-dark);
  color: var(--dark);
}

/* ----- Game ----- */

.game {
  padding: var(--section) 0;
  background: var(--dark);
  color: var(--on-dark);
  border-radius: clamp(28px, 4vw, 56px) clamp(28px, 4vw, 56px) 0 0;
}

.game-layout {
  display: grid;
  grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr);
  align-items: center;
  gap: clamp(40px, 6vw, 96px);
}

.game-copy h2 {
  font-size: clamp(2.4rem, 4.6vw, 4.2rem);
  letter-spacing: -0.05em;
  line-height: 0.98;
}

.game-copy > p {
  max-width: 40ch;
  margin-top: 1.2rem;
  color: var(--on-dark-muted);
}

.game-status {
  margin: 1.6rem 0 1.4rem !important;
  font-weight: 600;
  color: var(--accent-on-dark) !important;
}

.memory-board {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(8px, 1vw, 14px);
}

.memory-card {
  position: relative;
  display: grid;
  place-items: center;
  aspect-ratio: 1;
  min-width: 0;
  border: 1px solid var(--line-dark);
  border-radius: var(--r-card);
  background: rgba(236, 237, 228, 0.04);
  color: var(--on-dark);
  cursor: pointer;
  transition: background-color 0.4s var(--ease), transform 0.4s var(--ease), border-color 0.4s var(--ease);
}

.memory-card:hover {
  transform: translateY(-3px);
  border-color: var(--accent-on-dark);
}

.memory-back {
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 3vw, 2.4rem);
  color: var(--accent-on-dark);
}

.memory-face {
  display: none;
  text-align: center;
}

.memory-face b {
  display: block;
  font-size: clamp(1.4rem, 3vw, 2.2rem);
  font-weight: 500;
}

.memory-face small {
  display: block;
  margin-top: 0.2rem;
  font-size: 0.78rem;
  font-weight: 600;
}

.memory-card.is-open,
.memory-card.is-matched {
  background: var(--on-dark);
  color: var(--dark);
  animation: card-flip 0.5s var(--ease);
}

.memory-card.is-matched {
  background: var(--accent-on-dark);
  border-color: var(--accent-on-dark);
}

.memory-card.is-open .memory-back,
.memory-card.is-matched .memory-back {
  display: none;
}

.memory-card.is-open .memory-face,
.memory-card.is-matched .memory-face {
  display: block;
}

@keyframes card-flip {
  from { transform: rotateY(90deg); }
  to { transform: rotateY(0); }
}

/* ----- Shop ----- */

.shop {
  padding: var(--section) 0;
  background: var(--dark);
  color: var(--on-dark);
}

.eyebrow {
  margin-bottom: 1.2rem;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
}

.shop .eyebrow {
  color: var(--accent-on-dark);
}

.section-intro {
  max-width: 46ch;
  margin-top: 1.1rem;
  font-size: 1.08rem;
  color: var(--muted);
}

.shop .section-intro {
  color: var(--on-dark-muted);
}

.shop-list {
  margin-top: clamp(40px, 5vw, 72px);
  border-top: 1px solid var(--line-dark);
}

.shop-row {
  display: grid;
  grid-template-columns: 140px minmax(0, 1.1fr) minmax(0, 1fr) auto;
  align-items: center;
  gap: clamp(16px, 3vw, 40px);
  padding: 1.4rem 0;
  border-bottom: 1px solid var(--line-dark);
  transition: padding 0.5s var(--ease);
}

.shop-thumb {
  display: block;
  overflow: hidden;
  border-radius: var(--r-input);
  aspect-ratio: 4 / 3;
}

/* Picks without a photo show the leaf mark instead of an empty box. */
.shop-thumb:empty {
  background: rgba(236, 237, 228, 0.06) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 48 48'%3E%3Cpath d='M36.2 34.6A16 16 0 1 1 35.4 12.6' fill='none' stroke='%23ECEDE4' stroke-width='7.5' stroke-linecap='round'/%3E%3Cpath d='M34.6 13.4C34.4 7.2 38.4 2.8 45.6 2.2C46.2 9.2 42.2 13.6 34.6 13.4Z' fill='%238FD4A6'/%3E%3C/svg%3E") center / 34% no-repeat;
}

.shop-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.8s var(--ease);
}

.shop-name {
  font-family: var(--font-display);
  font-size: clamp(1.4rem, 2.4vw, 2.2rem);
  font-weight: 600;
  letter-spacing: -0.04em;
  line-height: 1.05;
}

.shop-name small {
  display: block;
  margin-top: 0.4rem;
  font-family: var(--font-body);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent-on-dark);
}

.shop-desc {
  color: var(--on-dark-muted);
}

.shop-cta {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-weight: 600;
  white-space: nowrap;
}

.shop-cta .arrow {
  display: inline-block;
  transition: transform 0.5s var(--ease);
}

.shop-row:hover {
  padding-left: 0.8rem;
  padding-right: 0.8rem;
}

.shop-row:hover .shop-thumb img {
  transform: scale(1.08);
}

.shop-row:hover .shop-cta .arrow {
  transform: translate(3px, -3px);
}

.affiliate-disclosure {
  margin-top: 1.6rem;
  font-size: 0.84rem;
  color: var(--on-dark-muted);
}

.associate-statement {
  margin: 1.6rem 0;
  font-size: 1rem;
  font-weight: 600;
  color: var(--on-dark);
}

.associate-statement + .affiliate-disclosure {
  margin-top: 0;
}

.shop .affiliate-disclosure + .affiliate-disclosure {
  margin-top: 0.6rem;
}

.shop-more {
  margin-top: 1.8rem;
}

.shop .text-link {
  color: var(--accent-on-dark);
}

/* ----- Pantry page ----- */

.pantry-head {
  padding: calc(84px + clamp(56px, 9vw, 120px)) 0 clamp(56px, 7vw, 96px);
}

.pantry-head h1 {
  max-width: 14ch;
  font-size: clamp(2.8rem, 6.4vw, 5.6rem);
  letter-spacing: -0.055em;
  line-height: 0.94;
}

.pantry-intro {
  max-width: 58ch;
  margin-top: clamp(20px, 2.4vw, 32px);
}

/* ----- Journal ----- */

.journal {
  padding: var(--section) 0;
}

.journal-head {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  justify-content: space-between;
  gap: 1.5rem;
  margin-bottom: clamp(36px, 4vw, 60px);
}

.journal-head .section-title {
  max-width: 12ch;
}

.journal-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  grid-auto-rows: auto;
  gap: clamp(16px, 2vw, 28px);
}

.article-card {
  grid-column: span 5;
}

.article-card.is-featured {
  grid-column: span 7;
  grid-row: span 2;
}

.article-link {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.article-media {
  overflow: hidden;
  border-radius: var(--r-card);
  aspect-ratio: 16 / 10;
}

.is-featured .article-media {
  aspect-ratio: 4 / 3.4;
}

.article-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: filter 0.6s var(--ease);
}

.article-link:hover .article-media img {
  filter: saturate(1.15) brightness(1.03);
}

.article-body {
  display: grid;
  gap: 0.6rem;
  padding-top: 1.2rem;
}

.article-tag {
  justify-self: start;
  padding: 0.3rem 0.75rem;
  border-radius: var(--r-pill);
  background: var(--accent-soft);
  color: var(--accent-hover);
  font-size: 0.78rem;
  font-weight: 700;
}

.article-body h3 {
  font-size: clamp(1.5rem, 2.2vw, 2rem);
  letter-spacing: -0.04em;
  line-height: 1.05;
}

.is-featured .article-body h3 {
  font-size: clamp(2rem, 3.4vw, 3rem);
}

.article-body p {
  max-width: 48ch;
  color: var(--muted);
}

/* ----- Footer ----- */

.site-footer {
  padding: clamp(72px, 9vw, 128px) 0 2rem;
  background: var(--dark);
  color: var(--on-dark);
  overflow: hidden;
}

.footer-top {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 3rem;
}

.footer-pitch {
  max-width: 22ch;
  font-family: var(--font-display);
  font-size: clamp(1.7rem, 3vw, 2.6rem);
  font-weight: 600;
  letter-spacing: -0.04em;
  line-height: 1.08;
}

.footer-links {
  display: grid;
  grid-template-columns: repeat(2, max-content);
  gap: 0.75rem 3.5rem;
  align-content: start;
  justify-content: end;
}

.footer-links a {
  color: var(--on-dark-muted);
  transition: color 0.3s var(--ease);
}

.footer-links a:hover {
  color: var(--accent-on-dark);
}

.footer-word {
  margin: clamp(56px, 8vw, 112px) 0 1.6rem;
  font-family: var(--font-display);
  /* Sized so the wordmark (about 4.6em wide) spans the container. */
  font-size: min(calc((100vw - 2 * var(--gutter)) / 4.7), calc(var(--container) / 4.7));
  font-weight: 700;
  line-height: 0.8;
  letter-spacing: -0.07em;
  color: var(--on-dark);
  white-space: nowrap;
  overflow: hidden;
  padding-bottom: 0.06em;
}

.footer-word .fl {
  display: inline-block;
}

.footer-base {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 1rem;
  padding-top: 1.4rem;
  border-top: 1px solid var(--line-dark);
  font-size: 0.86rem;
  color: var(--on-dark-muted);
}

/* ----- Inner pages ----- */

.article-page {
  max-width: 760px;
  padding-top: calc(84px + clamp(56px, 9vw, 120px));
  padding-bottom: var(--section);
}

.article-page h1 {
  font-size: clamp(2.8rem, 6.4vw, 5.6rem);
  letter-spacing: -0.055em;
  line-height: 0.94;
  margin-bottom: clamp(28px, 4vw, 48px);
}

.article-page .eyebrow {
  margin-bottom: 1.4rem;
}

.article-hero {
  margin: 0 calc(50% - 50vw) clamp(40px, 5vw, 64px);
  padding-inline: var(--gutter);
}

.article-hero-frame {
  max-width: 1240px;
  margin-inline: auto;
  overflow: hidden;
  border-radius: var(--r-card);
  aspect-ratio: 21 / 9;
}

.article-hero-frame img {
  object-fit: cover;
}

.entry-content {
  font-size: 1.12rem;
  line-height: 1.75;
  color: var(--ink-soft);
}

.entry-content > * + * {
  margin-top: 1.3em;
}

.entry-content h2 {
  margin-top: 2.2em;
  font-size: clamp(1.8rem, 3vw, 2.4rem);
  letter-spacing: -0.04em;
  line-height: 1.05;
  color: var(--ink);
}

.entry-content a {
  color: var(--accent);
  font-weight: 600;
  text-decoration: underline;
  text-decoration-thickness: 1.5px;
  text-underline-offset: 0.2em;
}

/* Contact */

.contact-form {
  display: grid;
  gap: 1.1rem;
  margin: 2rem 0;
  padding: clamp(24px, 4vw, 40px);
  border-radius: var(--r-card);
  background: var(--surface);
}

.contact-field {
  display: grid;
  gap: 0.45rem;
}

.contact-field label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--ink);
}

.contact-field textarea {
  min-height: 160px;
  padding: 0.9rem 1rem;
  resize: vertical;
}

.contact-form > .button {
  justify-self: start;
}

.contact-form .tool-note {
  margin: 0;
}

/* Journal archive */

.journal-archive {
  padding-top: calc(84px + clamp(56px, 9vw, 120px));
}

.journal-archive h1 {
  max-width: 14ch;
  font-size: clamp(2.8rem, 6.4vw, 5.6rem);
  letter-spacing: -0.055em;
  line-height: 0.94;
}

/* ----- Responsive ----- */

@media (max-width: 1080px) {
  .main-nav {
    gap: 1.3rem;
  }

  .planner-filters {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .main-nav,
  .nav-cta {
    display: none;
  }

  .mobile-nav {
    display: block;
  }

  .hero-grid,
  .game-layout,
  .footer-top {
    grid-template-columns: 1fr;
  }

  .hero-visual {
    margin-right: calc(var(--gutter) * -1);
  }

  .hero-frame {
    height: clamp(320px, 60vw, 520px);
  }

  .films-track {
    width: auto;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    padding-bottom: 0.5rem;
  }

  .films-track::-webkit-scrollbar {
    display: none;
  }

  .film {
    width: min(82vw, 560px);
    scroll-snap-align: center;
  }

  .recipe-results {
    grid-template-columns: 1fr;
  }

  .cell-nutrition,
  .cell-converter {
    grid-column: 1 / -1;
  }

  .cell-timer {
    grid-template-columns: 1fr;
  }

  .shop-row {
    grid-template-columns: 96px minmax(0, 1fr);
  }

  .shop-desc,
  .shop-cta {
    grid-column: 2;
  }

  .article-card,
  .article-card.is-featured {
    grid-column: 1 / -1;
    grid-row: auto;
  }

  .footer-links {
    justify-content: start;
  }
}

@media (max-width: 600px) {
  body {
    font-size: 16px;
  }

  .brand-word {
    font-size: 1.25rem;
  }

  .hero-search-row {
    flex-direction: column;
    align-items: stretch;
    padding: 0.6rem;
    border-radius: var(--r-card);
  }

  .hero-search textarea {
    height: 48px;
    padding: 0 0.6rem;
    line-height: 48px;
  }

  #hero-search-hint {
    padding-left: 0.4rem;
  }

  .planner-filters {
    grid-template-columns: 1fr 1fr;
  }

  .planner-filters .field-small {
    grid-column: span 2;
  }

  .converter-form {
    grid-template-columns: 1fr;
  }

  .memory-board {
    gap: 8px;
  }

  .memory-card {
    border-radius: var(--r-input);
  }

  .footer-links {
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem 1.5rem;
  }
}

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