/*
  KARAT Meal Match — warm editorial storefront direction.
  Visual reference: the user-supplied KARAT collection concept.
*/

:root {
  --ink: #2b1c18;
  --ink-soft: #5b4037;
  --forest: #6f765d;
  --forest-deep: #454936;
  --lime: #d29b40;
  --lime-soft: #f5dfc9;
  --mint: #dfe2d2;
  --cream: #f8ece6;
  --white: #fffaf7;
  --coral: #b86f52;
  --line: #d9bfb3;
  --muted: #7e6258;
  --cocoa: #6b3f2d;
  --peach: #e6aa91;
  --blush: #f5ddd2;
  --gold: #c88f32;
  --shadow: 0 22px 54px rgba(72, 43, 31, 0.14);
  --radius-lg: 10px;
  --radius-md: 8px;
  --radius-sm: 5px;
}

html {
  background: var(--cream);
}

body {
  background: var(--cream);
  background-image: none;
  color: var(--ink);
  font-family: 'DM Sans', system-ui, sans-serif;
}

::selection {
  background: var(--peach);
  color: var(--ink);
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
summary:focus-visible {
  outline: 2px solid var(--cocoa);
  outline-offset: 4px;
}

.preview {
  min-height: 30px;
  justify-content: space-between;
  padding-inline: clamp(20px, 4vw, 64px);
  background: var(--cocoa);
  color: rgba(255, 250, 247, 0.9);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.11em;
}

.preview span:last-child {
  color: rgba(255, 250, 247, 0.62);
}

header {
  max-width: none;
  min-height: 88px;
  padding: 14px clamp(22px, 5vw, 76px);
  border-bottom: 1px solid rgba(107, 63, 45, 0.12);
  background: rgba(248, 236, 230, 0.96);
}

.brand,
.footer-brand,
.mini-brand {
  gap: 12px;
  letter-spacing: 0;
}

.brand-mark,
.mini-brand-mark {
  width: 42px;
  height: 42px;
  border-radius: 0;
  background: var(--gold);
}

.brand-lockup {
  min-width: 150px;
}

.brand-lockup strong {
  color: var(--ink);
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 39px;
  font-weight: 500;
  letter-spacing: -0.055em;
  line-height: 0.72;
}

.brand-lockup strong span {
  margin-left: 3px;
  color: var(--gold);
  font-family: Georgia, serif;
  font-size: 0.42em;
  vertical-align: top;
}

.brand-lockup small {
  margin: 8px 0 0 2px;
  color: var(--cocoa);
  font-size: 7px;
  font-weight: 700;
  letter-spacing: 0.27em;
}

nav {
  gap: 2px;
}

nav button {
  min-height: 42px;
  padding: 10px 13px;
  border-radius: 0;
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 15px;
  font-weight: 600;
}

nav button:hover {
  background: transparent;
  color: var(--coral);
}

nav .nav-cta {
  margin-left: 12px;
  padding-inline: 20px;
  border: 1px solid var(--ink);
  border-radius: 5px;
  background: var(--ink);
  color: var(--white);
  font-family: 'DM Sans', system-ui, sans-serif;
  font-size: 11px;
}

nav .nav-cta:hover {
  background: var(--cocoa);
  color: var(--white);
}

nav .nav-cta span {
  margin-left: 12px;
  color: var(--white);
}

main {
  overflow: hidden;
}

.shop-hero {
  position: relative;
  min-height: min(720px, calc(100vh - 118px));
  display: flex;
  align-items: center;
  overflow: hidden;
  background: #9b6e59;
  color: var(--white);
}

.shop-hero > img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.shop-hero-shade {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(47, 27, 21, 0.76) 0%, rgba(63, 35, 26, 0.52) 31%, rgba(63, 35, 26, 0.05) 62%, rgba(63, 35, 26, 0) 100%);
}

.shop-hero-copy {
  position: relative;
  z-index: 1;
  width: min(620px, 50vw);
  margin-left: clamp(30px, 7vw, 112px);
  padding: 80px 0;
}

.hero-brandline {
  margin-bottom: 20px;
  color: #f4cf9b;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.26em;
}

.shop-hero h1 {
  max-width: 660px;
  margin: 0 0 24px;
  color: var(--white);
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: clamp(58px, 6.7vw, 96px);
  font-weight: 500;
  letter-spacing: -0.045em;
  line-height: 0.87;
}

.shop-hero h1 em {
  color: #f5d8c8;
  font-family: inherit;
  font-weight: 500;
}

.shop-hero-copy > p:not(.hero-brandline) {
  max-width: 500px;
  margin-bottom: 30px;
  color: rgba(255, 250, 247, 0.86);
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: clamp(19px, 1.7vw, 25px);
  line-height: 1.35;
}

.primary,
.secondary,
.outline-button {
  min-height: 52px;
  padding: 13px 22px;
  border-radius: 5px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.primary {
  border-color: var(--ink);
  background: var(--ink);
  color: var(--white);
  box-shadow: 0 14px 28px rgba(44, 28, 24, 0.16);
}

.primary:hover {
  background: var(--cocoa);
  box-shadow: 0 18px 34px rgba(44, 28, 24, 0.22);
}

.primary span {
  color: inherit;
}

.secondary.light {
  border-color: rgba(255, 250, 247, 0.8);
  background: rgba(255, 250, 247, 0.08);
  color: var(--white);
}

.secondary.light:hover {
  background: var(--white);
  color: var(--ink);
}

.hero-edition {
  position: absolute;
  right: clamp(26px, 5vw, 80px);
  bottom: 34px;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--white);
}

.hero-edition span {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 44px;
  line-height: 1;
}

.hero-edition small {
  padding-left: 12px;
  border-left: 1px solid rgba(255, 250, 247, 0.5);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.12em;
  line-height: 1.5;
  text-transform: uppercase;
}

.benefit-ribbon {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  padding: 26px clamp(24px, 5vw, 76px);
  border-bottom: 1px solid rgba(107, 63, 45, 0.14);
  background: #faeee8;
}

.benefit-ribbon > div {
  min-height: 58px;
  padding: 0 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  border-right: 1px solid rgba(107, 63, 45, 0.16);
}

.benefit-ribbon > div:first-child {
  padding-left: 0;
}

.benefit-ribbon > div:last-child {
  padding-right: 0;
  border-right: 0;
}

.benefit-ribbon svg {
  width: 28px;
  height: 28px;
  flex: 0 0 auto;
  fill: none;
  stroke: var(--cocoa);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.5;
}

.benefit-ribbon span,
.benefit-ribbon strong,
.benefit-ribbon small {
  display: block;
}

.benefit-ribbon strong {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 16px;
  font-weight: 600;
}

.benefit-ribbon small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 8px;
}

.shop-collection {
  max-width: 1320px;
  margin: 0 auto;
  padding: 100px clamp(22px, 5vw, 66px) 116px;
}

.collection-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 30px;
}

.collection-heading h2,
.story-copy h2,
.ritual-banner h2,
.savings-copy h2,
.wellness-head h2,
.membership-copy h2 {
  color: var(--ink);
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: clamp(48px, 5.2vw, 76px);
  font-weight: 500;
  letter-spacing: -0.045em;
  line-height: 0.92;
}

.collection-heading h2 {
  margin-bottom: 0;
}

.collection-heading p {
  max-width: 420px;
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.7;
}

.collection-tabs {
  margin: 36px 0 28px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.collection-tabs button {
  min-height: 38px;
  padding: 8px 15px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: transparent;
  color: var(--ink);
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 15px;
  font-weight: 600;
}

.collection-tabs button.active,
.collection-tabs button:hover {
  border-color: var(--ink);
}

.collection-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
}

.collection-card,
.category-card,
.collection-card:nth-child(n) {
  min-height: 0;
  padding: 0;
  display: block;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--ink);
  text-align: left;
  box-shadow: none;
}

.collection-card:hover,
.category-card:hover {
  transform: none;
  background: transparent;
  box-shadow: none;
}

.collection-image {
  position: relative;
  aspect-ratio: 0.92;
  display: block;
  overflow: hidden;
  background: #edd2c5;
}

.collection-image::after {
  content: '';
  position: absolute;
  inset: 0;
  border: 1px solid rgba(107, 63, 45, 0.1);
  pointer-events: none;
}

.collection-image img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  transition: transform 520ms cubic-bezier(.2,.8,.2,1);
}

.collection-card:hover .collection-image img {
  transform: scale(1.035);
}

.collection-card-copy {
  padding: 15px 2px 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.collection-card-copy span,
.collection-card-copy strong,
.collection-card-copy small {
  display: block;
}

.collection-card-copy strong {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 21px;
  font-weight: 600;
  line-height: 1;
}

.collection-card-copy small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 8px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.collection-card-copy b {
  font-size: 21px;
  font-weight: 400;
}

.collection-description {
  min-height: 48px;
  padding: 0 2px;
  display: block;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.55;
}

.collection-story {
  max-width: 1320px;
  margin: 0 auto 120px;
  padding: 0 clamp(22px, 5vw, 66px);
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(330px, 0.75fr);
  align-items: center;
  gap: clamp(46px, 7vw, 100px);
}

.story-collage {
  min-height: 560px;
  display: grid;
  grid-template-columns: 1.25fr 0.75fr;
  grid-template-rows: 1fr 1fr;
  gap: 10px;
}

.story-collage img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.story-collage img:first-child {
  grid-row: 1 / -1;
}

.story-copy h2 em,
.ritual-banner h2 em,
.savings-copy h2 em,
.wellness-head h2 em,
.membership-copy h2 em {
  color: var(--coral);
  font-family: inherit;
  font-weight: 500;
}

.story-copy > p {
  margin: 26px 0 22px;
  color: var(--ink-soft);
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 20px;
  line-height: 1.35;
}

.story-copy ul {
  margin: 0 0 30px;
  padding: 0;
  list-style: none;
}

.story-copy li {
  padding: 10px 0;
  border-bottom: 1px solid rgba(107, 63, 45, 0.15);
  color: var(--muted);
  font-size: 10px;
}

.outline-button {
  border: 1px solid var(--ink);
  background: transparent;
  color: var(--ink);
}

.outline-button:hover {
  background: var(--ink);
  color: var(--white);
}

.ritual-banner {
  min-height: 440px;
  padding: 80px clamp(30px, 7vw, 112px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 40px;
  background:
    linear-gradient(115deg, rgba(255, 250, 247, 0.83) 0%, rgba(255, 250, 247, 0.46) 48%, rgba(255, 250, 247, 0.12) 100%),
    radial-gradient(ellipse at 82% 36%, #c07f61 0%, #dba28a 28%, #efd1c1 60%, #e7b59e 100%);
  box-shadow: inset 0 24px 70px rgba(101, 56, 39, 0.08);
}

.ritual-banner > div:first-child {
  max-width: 620px;
}

.ritual-banner h2 {
  margin-bottom: 22px;
}

.ritual-banner p {
  max-width: 520px;
  color: var(--ink-soft);
  font-size: 13px;
  line-height: 1.7;
}

.ritual-mark {
  color: #f0bd5b;
  font-family: Georgia, serif;
  font-size: clamp(70px, 10vw, 150px);
  text-shadow: 0 18px 34px rgba(107, 63, 45, 0.18);
}

.savings-section {
  max-width: none;
  margin: 0;
  padding: 116px clamp(28px, 7vw, 112px);
  border-radius: 0;
  background: var(--cocoa);
}

.savings-copy h2,
.membership-copy h2 {
  color: var(--white);
}

.savings-copy h2 em,
.membership-copy h2 em {
  color: #f3cbb8;
}

.savings-copy > p,
.membership-copy > p {
  color: rgba(255, 250, 247, 0.74);
}

.savings-note {
  border-radius: 5px;
}

.calculator {
  border-radius: 8px;
  background: #fff7f2;
  box-shadow: 0 30px 70px rgba(43, 28, 24, 0.26);
}

.calculator::before {
  display: none;
}

.calculator input[type='range'] {
  accent-color: var(--coral);
}

.wellness-section {
  max-width: 1240px;
  padding: 120px clamp(22px, 5vw, 66px);
}

.wellness-head {
  align-items: end;
}

.guidance-grid {
  gap: 1px;
  background: rgba(107, 63, 45, 0.16);
}

.guidance-grid article,
.guidance-grid article:nth-child(2),
.guidance-grid article:nth-child(3) {
  min-height: 360px;
  border: 0;
  border-radius: 0;
  background: #fff8f4;
  color: var(--ink);
}

.guidance-grid article:nth-child(2) {
  background: #f1d4c7;
}

.guidance-grid article:nth-child(3) {
  background: var(--forest-deep);
  color: var(--white);
}

.guidance-grid p,
.guidance-grid article:nth-child(3) p {
  color: var(--muted);
}

.guidance-grid article:nth-child(3) p {
  color: rgba(255, 250, 247, 0.7);
}

.guidance-grid h3 {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 30px;
  font-weight: 600;
}

.goal-bar {
  border-radius: 0;
}

.membership-section {
  max-width: none;
  margin: 0;
  padding: 100px clamp(28px, 7vw, 112px);
  border-radius: 0;
  background: #7c846c;
}

.pricing-card {
  border-radius: 8px;
  background: #fff7f2;
}

.pricing-card .primary {
  background: var(--cocoa);
  border-color: var(--cocoa);
}

/* Functional views inherit the same editorial system. */
.quiz-shell,
.results,
.empty-state {
  background: var(--cream);
}

.quiz-shell {
  max-width: 1240px;
  margin: 46px auto 90px;
  border: 1px solid rgba(107, 63, 45, 0.18);
  border-radius: 8px;
  overflow: hidden;
}

.quiz-aside,
.library-cta {
  border-radius: 0;
  background: var(--cocoa);
}

.quiz-aside::before,
.quiz-aside::after {
  border-color: rgba(245, 221, 210, 0.22);
}

.quiz-aside h2,
.quiz-aside h2 em {
  color: var(--white);
  font-family: 'Cormorant Garamond', Georgia, serif;
}

.quiz-aside h2 em {
  color: #f0c9b5;
}

.mini-brand .brand-lockup strong {
  color: var(--white);
}

.mini-brand .brand-lockup small {
  color: rgba(255, 250, 247, 0.62);
}

.quiz h2,
.result-head h2,
.library-head h2,
.meal-content h3,
.empty-state h2 {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-weight: 600;
  letter-spacing: -0.045em;
}

.option,
.preference-box,
.meal,
.library-controls,
.database-tile,
.library-empty,
.notice,
.portion-callout,
.filter-summary,
.meal-detail,
dialog {
  border-radius: 6px;
}

.option:hover,
.option:focus-visible {
  border-color: var(--coral);
  background: #fff8f4;
}

.option-icon,
.option-key {
  border-radius: 4px;
  background: var(--blush);
  color: var(--cocoa);
}

.pill,
.category-filters button,
.library-diet button {
  border-radius: 999px;
}

.pill[aria-pressed='true'],
.category-filters button[aria-pressed='true'],
.library-diet button[aria-pressed='true'] {
  border-color: var(--cocoa);
  background: var(--cocoa);
  color: var(--white);
}

.meal-visual,
.tile-art,
.meal-fallback {
  background: #ecd1c4;
}

.meal-fallback > span {
  color: var(--cocoa);
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: clamp(54px, 8vw, 96px);
  font-weight: 500;
  letter-spacing: -0.06em;
  filter: none;
}

.library-controls,
.search-control input,
.select-filters select {
  background: #fff8f4;
}

.database-tile .tile-art.meal-fallback,
.database-tile:nth-child(4n + 2) .tile-art,
.database-tile:nth-child(4n + 3) .tile-art {
  background: #ecd1c4;
}

.eyebrow,
.step-count,
.tile-meta,
.match-topline {
  color: var(--cocoa);
}

.progress i {
  background: var(--coral);
}

footer {
  max-width: none;
  margin: 0;
  padding: 54px clamp(22px, 5vw, 76px);
  border-top: 1px solid rgba(107, 63, 45, 0.16);
  background: #f3ded4;
}

.footer-brand .brand-mark {
  width: 36px;
  height: 36px;
}

.footer-brand .brand-lockup strong {
  font-size: 34px;
}

dialog {
  border: 1px solid rgba(107, 63, 45, 0.18);
  background: #fff8f4;
}

dialog::backdrop {
  background: rgba(44, 28, 24, 0.64);
}

@media (max-width: 1050px) {
  nav button:not(.nav-cta) {
    display: none;
  }

  .benefit-ribbon {
    grid-template-columns: 1fr 1fr;
  }

  .benefit-ribbon > div:nth-child(2) {
    border-right: 0;
  }

  .benefit-ribbon > div:nth-child(-n + 2) {
    padding-bottom: 18px;
    border-bottom: 1px solid rgba(107, 63, 45, 0.14);
  }

  .benefit-ribbon > div:nth-child(n + 3) {
    padding-top: 18px;
  }

  .collection-grid {
    grid-template-columns: 1fr 1fr;
    gap: 28px 18px;
  }

  .collection-story {
    grid-template-columns: 1fr;
  }

  .story-collage {
    min-height: 480px;
  }
}

@media (max-width: 760px) {
  .preview {
    justify-content: center;
  }

  .preview span:last-child {
    display: none;
  }

  header {
    min-height: 74px;
    padding-inline: 18px;
  }

  .brand-mark {
    width: 34px;
    height: 34px;
  }

  .brand-lockup {
    min-width: 104px;
  }

  .brand-lockup strong {
    font-size: 31px;
  }

  nav .nav-cta {
    margin-left: 0;
    padding-inline: 14px;
  }

  .shop-hero {
    min-height: 650px;
    align-items: flex-end;
  }

  .shop-hero > img {
    object-position: 63% center;
  }

  .shop-hero-shade {
    background: linear-gradient(0deg, rgba(47, 27, 21, 0.88) 0%, rgba(47, 27, 21, 0.48) 54%, rgba(47, 27, 21, 0.04) 100%);
  }

  .shop-hero-copy {
    width: auto;
    margin: 0;
    padding: 70px 24px 94px;
  }

  .shop-hero h1 {
    font-size: clamp(52px, 15vw, 74px);
  }

  .hero-edition {
    right: 24px;
    bottom: 20px;
  }

  .hero-edition span {
    font-size: 32px;
  }

  .benefit-ribbon {
    padding-inline: 18px;
  }

  .benefit-ribbon > div {
    justify-content: flex-start;
    padding-inline: 10px;
  }

  .collection-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .shop-collection {
    padding-top: 78px;
    padding-bottom: 84px;
  }

  .collection-tabs {
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .collection-tabs::-webkit-scrollbar {
    display: none;
  }

  .collection-tabs button {
    flex: 0 0 auto;
  }

  .collection-story {
    margin-bottom: 84px;
  }

  .story-collage {
    min-height: 370px;
  }

  .ritual-banner {
    min-height: 400px;
    padding: 62px 24px;
  }

  .ritual-mark {
    display: none;
  }

  .savings-section,
  .membership-section {
    margin: 0;
    padding: 82px 24px;
    border-radius: 0;
  }

  .wellness-section {
    padding-top: 90px;
    padding-bottom: 90px;
  }

  .quiz-shell {
    margin: 18px 14px 60px;
  }
}

@media (max-width: 520px) {
  nav .nav-cta {
    min-height: 38px;
    font-size: 9px;
  }

  nav .nav-cta span {
    display: none;
  }

  .shop-hero-copy .hero-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .shop-hero-copy .primary,
  .shop-hero-copy .secondary {
    width: 100%;
  }

  .benefit-ribbon {
    grid-template-columns: 1fr;
  }

  .benefit-ribbon > div,
  .benefit-ribbon > div:nth-child(n) {
    min-height: 72px;
    padding: 12px 4px;
    border-right: 0;
    border-bottom: 1px solid rgba(107, 63, 45, 0.14);
  }

  .benefit-ribbon > div:last-child {
    border-bottom: 0;
  }

  .collection-grid {
    grid-template-columns: 1fr;
  }

  .collection-image {
    aspect-ratio: 1.05;
  }

  .story-collage {
    min-height: 420px;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1.25fr 0.75fr;
  }

  .story-collage img:first-child {
    grid-column: 1 / -1;
    grid-row: auto;
  }

  .collection-heading h2,
  .story-copy h2,
  .ritual-banner h2,
  .savings-copy h2,
  .wellness-head h2,
  .membership-copy h2 {
    font-size: clamp(44px, 13vw, 58px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .collection-image img {
    transition: none;
  }
}
