@font-face { font-family: "Bricolage Grotesque"; src: url("../../assets/fonts/bricolage-grotesque.woff2") format("woff2"); font-weight: 200 800; font-stretch: 75% 100%; font-display: swap; }
@font-face { font-family: "Bricolage Grotesque"; src: url("../../assets/fonts/bricolage-grotesque-rupee.woff2") format("woff2"); font-weight: 200 800; font-display: swap; unicode-range: U+20B9; }

:root {
  --cream: #f3ede2;
  --paper: #fbf8f2;
  --ink: #1b1a17;
  --ink-2: #4f4a40;
  --line: #d9d0bf;
  --tomato: #e5482f;
  --tomato-ink: #b7301b;
  --kraft: #d6b88f;
  --kraft-2: #c3a074;
  --font: "Bricolage Grotesque", "Avenir Next", "Segoe UI", sans-serif;
  --pad: clamp(1rem, 0.5rem + 2.5vw, 3rem);
  --r: 14px;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 5rem; }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
body, h1, h2, h3, p, ul, dl, dd, fieldset { margin: 0; }
ul { list-style: none; padding: 0; }
fieldset { border: 0; padding: 0; min-width: 0; }
button, input, select { font: inherit; color: inherit; }
svg { display: block; }

body { background: var(--cream); color: var(--ink); font-family: var(--font); font-size: 1.0625rem; line-height: 1.5; -webkit-font-smoothing: antialiased; }
p { text-wrap: pretty; }
a { color: inherit; text-underline-offset: 0.2em; }
:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip { position: absolute; left: 1rem; top: -5rem; z-index: 99; background: var(--ink); color: var(--cream); padding: 0.75rem 1rem; font-weight: 600; border-radius: 8px; }
.skip:focus { top: 1rem; }
.noscript { padding: 1rem var(--pad); font-weight: 600; }

h1, h2 { font-weight: 800; letter-spacing: -0.035em; line-height: 0.95; font-stretch: 80%; }
h2 { font-size: clamp(2.25rem, 1.4rem + 3.6vw, 4.5rem); text-wrap: balance; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem; min-height: 3rem; padding: 0.75rem 1.5rem; border-radius: 999px; font-weight: 700; text-decoration: none; border: 2px solid var(--ink); cursor: pointer; line-height: 1.1; background: none; }
.btn--ink { background: var(--ink); color: var(--cream); }
.btn--ink:hover { background: var(--tomato-ink); border-color: var(--tomato-ink); }
.btn--line:hover { background: var(--ink); color: var(--cream); }
.btn--wide { width: 100%; }

/* header */
.top { position: sticky; top: 0; z-index: 20; background: var(--cream); border-bottom: 2px solid var(--ink); }
.top__bar { display: flex; align-items: center; gap: 2rem; padding: 0.5rem var(--pad); max-width: 96rem; margin: 0 auto; min-height: 4rem; }
.logo { display: inline-flex; align-items: center; gap: 0.5rem; font-size: 1.625rem; font-weight: 800; letter-spacing: -0.05em; text-decoration: none; font-stretch: 80%; }
.logo svg { width: 2.25rem; fill: var(--tomato); }
.top__nav { display: flex; gap: 1.5rem; }
.top__nav a { text-decoration: none; font-weight: 600; padding-block: 0.75rem; }
.top__nav a:hover { text-decoration: underline; text-decoration-thickness: 2px; }
@media (max-width: 44em) { .top nav { display: none; } }
.cart-btn { margin-left: auto; display: inline-flex; align-items: center; gap: 0.5rem; min-height: 2.75rem; padding: 0.375rem 0.5rem 0.375rem 1rem; border-radius: 999px; border: 2px solid var(--ink); background: var(--paper); font-weight: 700; cursor: pointer; }
.cart-btn:hover { background: #fff; }
.cart-btn svg { width: 1.25rem; height: 1.25rem; fill: none; stroke: currentColor; stroke-width: 2; }
.cart-btn__count { display: inline-grid; place-items: center; min-width: 1.75rem; height: 1.75rem; padding: 0 0.375rem; border-radius: 999px; background: var(--ink); color: var(--cream); font-size: 0.875rem; font-variant-numeric: tabular-nums; }
.cart-btn.is-bumped .cart-btn__count { background: var(--tomato-ink); }
@media (prefers-reduced-motion: no-preference) { .cart-btn.is-bumped .cart-btn__count { animation: bump 0.4s ease; } @keyframes bump { 40% { transform: scale(1.3); } } }

/* bag (SVG pouch + HTML label) */
.bag { position: relative; width: 100%; aspect-ratio: 200 / 260; --kraft: var(--kraft); }
.bag svg { width: 100%; height: 100%; --kraft: #d6b88f; --kraft-2: #c3a074; }
.bag__label {
  position: absolute; left: 13%; right: 13%; top: 32%; bottom: 12%;
  background-color: var(--c); color: var(--k);
  display: flex; flex-direction: column; justify-content: flex-end; padding: 8% 7%;
  container-type: inline-size;
}
.bag__brand { position: absolute; top: 7%; left: 7%; font-weight: 800; letter-spacing: -0.04em; font-size: 11cqw; font-stretch: 80%; }
.bag__name { font-weight: 800; font-size: 17cqw; line-height: 0.9; letter-spacing: -0.04em; font-stretch: 75%; }
.bag__meta { font-size: 8.5cqw; font-weight: 600; margin-top: 4cqw; opacity: 0.9; }
.lab--stripes { background-image: repeating-linear-gradient(90deg, transparent 0 14%, rgba(0,0,0,.14) 14% 17%); }
.lab--dots { background-image: radial-gradient(rgba(0,0,0,.16) 18%, transparent 20%); background-size: 12% 9%; }
.lab--waves { background-image: repeating-radial-gradient(circle at 100% 0, transparent 0 9%, rgba(255,255,255,.14) 9% 12%); }
.lab--checks { background-image: conic-gradient(rgba(0,0,0,.1) 25%, transparent 0 50%, rgba(0,0,0,.1) 0 75%, transparent 0); background-size: 18% 14%; }
.lab--zig { background-image: linear-gradient(135deg, rgba(255,255,255,.12) 25%, transparent 25%), linear-gradient(225deg, rgba(255,255,255,.12) 25%, transparent 25%); background-size: 16% 16%; }
.lab--rain { background-image: repeating-linear-gradient(100deg, transparent 0 6%, rgba(255,255,255,.12) 6% 7%); }

/* hero */
.hero { display: grid; gap: 2rem; padding: clamp(2.5rem, 2rem + 4vw, 6rem) var(--pad); max-width: 96rem; margin: 0 auto; align-items: center; }
@media (min-width: 60em) { .hero { grid-template-columns: 6fr 5fr; } }
.hero h1 { font-size: clamp(2.75rem, 1.2rem + 6vw, 6.5rem); text-wrap: balance; }
.hero__copy p { font-size: 1.25rem; max-width: 36ch; margin: 1.5rem 0 2rem; color: var(--ink-2); }
.hero__bags { display: grid; grid-template-columns: repeat(3, 1fr); align-items: end; max-width: 34rem; margin-inline: auto; width: 100%; padding-block: 1rem; }
.bag--hero { filter: drop-shadow(0 18px 18px rgba(27, 26, 23, 0.18)); }
.bag--hero:nth-child(1) { transform: rotate(-7deg) translate(14%, 4%); z-index: 1; }
.bag--hero:nth-child(2) { transform: translateY(-6%) scale(1.12); z-index: 2; }
.bag--hero:nth-child(3) { transform: rotate(6deg) translate(-14%, 3%); z-index: 1; }

/* shop */
.shop { padding: clamp(3rem, 2rem + 4vw, 6rem) var(--pad); max-width: 96rem; margin: 0 auto; border-top: 2px solid var(--ink); }
.shop__head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: end; gap: 1.5rem; margin-bottom: 2rem; }
.shop__tools { display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: center; }
.seg { display: inline-flex; border: 2px solid var(--ink); border-radius: 999px; padding: 3px; background: var(--paper); }
.seg button { border: 0; background: none; border-radius: 999px; padding: 0.375rem 1rem; min-height: 2.5rem; font-weight: 600; cursor: pointer; }
.seg button[aria-pressed="true"] { background: var(--ink); color: var(--cream); }
.seg button:hover:not([aria-pressed="true"]) { background: var(--cream); }
.sort { display: inline-flex; align-items: center; gap: 0.5rem; font-weight: 600; }
.sort select, .grind select { appearance: none; border: 2px solid var(--ink); border-radius: 999px; background: var(--paper) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='m6 8 4 4 4-4' fill='none' stroke='%231b1a17' stroke-width='2'/%3E%3C/svg%3E") right 0.75rem center / 1rem no-repeat; padding: 0.5rem 2.25rem 0.5rem 1rem; min-height: 2.75rem; font-weight: 600; }

.products { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 17rem), 1fr)); gap: 2.5rem 1.5rem; }
@media (min-width: 56em) { .products { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 3rem 2rem; } }
.product { display: flex; flex-direction: column; }
.product__art { background: var(--paper); border: 2px solid var(--ink); border-radius: var(--r); padding: 7% 27% 3%; margin-bottom: 1rem; position: relative; overflow: hidden; }
.product__art::before { content: ""; position: absolute; left: -10%; right: -10%; bottom: -30%; height: 55%; background: var(--c); opacity: 0.18; border-radius: 50%; }
.product__art .bag { position: relative; }
@media (prefers-reduced-motion: no-preference) {
  .product__art .bag { transition: transform 0.35s cubic-bezier(.2,.7,.2,1); }
  .product:hover .product__art .bag { transform: rotate(-3deg) translateY(-3%); }
}
.product__name { font-size: 1.5rem; font-weight: 800; letter-spacing: -0.025em; line-height: 1.1; font-stretch: 85%; }
.product__origin { color: var(--ink-2); font-size: 0.9375rem; margin-top: 0.25rem; }
.product__notes { margin-top: 0.5rem; font-weight: 600; }
.product__roast { display: flex; align-items: center; gap: 0.5rem; font-size: 0.9375rem; color: var(--ink-2); margin-top: 0.375rem; }
.roast { display: inline-flex; gap: 3px; }
.roast::before, .roast::after, .roast { --on: var(--ink); }
.roast { width: 3.25rem; height: 0.625rem; border: 1.5px solid var(--ink); border-radius: 999px; background: linear-gradient(90deg, var(--ink) var(--fill), transparent 0); }
.roast[data-level="1"] { --fill: 33%; }
.roast[data-level="2"] { --fill: 66%; }
.roast[data-level="3"] { --fill: 100%; }
.product__buy { display: grid; grid-template-columns: auto 1fr; gap: 0.625rem 0.75rem; align-items: center; margin-top: auto; padding-top: 1rem; }
.product__price { font-size: 1.5rem; font-weight: 800; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.product__price span { font-size: 0.9375rem; font-weight: 500; color: var(--ink-2); letter-spacing: 0; }
.grind select { width: 100%; font-size: 0.9375rem; }
.add { grid-column: 1 / -1; }

/* subscription */
.sub { background: #f4643f; padding: clamp(3rem, 2rem + 5vw, 7rem) var(--pad); border-block: 2px solid var(--ink); }
.sub__grid { max-width: 96rem; margin: 0 auto; display: grid; gap: 2.5rem; }
@media (min-width: 60em) { .sub__grid { grid-template-columns: 1fr 1fr; gap: 5rem; align-items: start; } }
.sub h2 { color: var(--ink); }
.sub__grid > div > p { font-size: 1.25rem; max-width: 34ch; margin-top: 1.5rem; }
.sub__form { background: var(--paper); border: 2px solid var(--ink); border-radius: var(--r); padding: clamp(1.25rem, 1rem + 1.5vw, 2rem); display: grid; gap: 1.5rem; box-shadow: 6px 6px 0 var(--ink); }
.sub__form legend { font-weight: 700; margin-bottom: 0.625rem; }
.pills { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.pills label { position: relative; }
.pills input { position: absolute; inset: 0; opacity: 0; margin: 0; width: 100%; height: 100%; cursor: pointer; }
.pills span { display: inline-flex; align-items: center; min-height: 2.75rem; padding: 0.375rem 1rem; border: 2px solid var(--ink); border-radius: 999px; font-weight: 600; }
.pills input:checked + span { background: var(--ink); color: var(--cream); }
.pills input:focus-visible + span { outline: 3px solid var(--tomato-ink); outline-offset: 2px; }
.stepper { display: inline-flex; align-items: center; border: 2px solid var(--ink); border-radius: 999px; }
.stepper button { width: 2.75rem; height: 2.75rem; border: 0; background: none; font-size: 1.375rem; font-weight: 700; cursor: pointer; border-radius: 999px; }
.stepper button:hover { background: var(--cream); }
.stepper button:disabled { opacity: 0.35; cursor: not-allowed; }
.stepper output { min-width: 2.5rem; text-align: center; font-weight: 800; font-size: 1.25rem; font-variant-numeric: tabular-nums; }
.sub__total { border-top: 2px dashed var(--line); padding-top: 1rem; }
.sub__total p:first-child { font-size: 1.25rem; font-weight: 600; }
.sub__total span { font-size: 2.25rem; font-weight: 800; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.sub__small { color: var(--ink-2); font-size: 0.9375rem; }
.note { font-size: 0.9375rem; font-weight: 600; }
.note:empty { display: none; }

/* grind guide */
.grind-guide { padding: clamp(3rem, 2rem + 4vw, 6rem) var(--pad); max-width: 96rem; margin: 0 auto; }
.grind-guide__intro { font-size: 1.1875rem; max-width: 46ch; margin: 1.25rem 0 2rem; color: var(--ink-2); }
.table-wrap { overflow-x: auto; border: 2px solid var(--ink); border-radius: var(--r); background: var(--paper); position: relative; }
.table-wrap:focus-visible { outline-offset: 3px; }
.grind-guide table { width: 100%; border-collapse: collapse; min-width: 40rem; }
.grind-guide th, .grind-guide td { text-align: left; padding: 0.875rem 1.25rem; border-bottom: 1px solid var(--line); }
.grind-guide thead th { background: var(--ink); color: var(--cream); font-weight: 600; font-size: 0.9375rem; }
.grind-guide tbody tr:last-child > * { border-bottom: 0; }
.grind-guide tbody th { font-weight: 700; }

.foot { border-top: 2px solid var(--ink); padding: 2.5rem var(--pad); }
.foot__inner { max-width: 96rem; margin: 0 auto; display: flex; flex-wrap: wrap; gap: 1rem 3rem; align-items: center; justify-content: space-between; color: var(--ink-2); }
.logo--foot { color: var(--ink); }

/* cart dialog */
.cart { margin: 0 0 0 auto; height: 100%; max-height: 100%; width: min(28rem, 100%); border: 0; border-left: 2px solid var(--ink); padding: 0; background: var(--paper); color: var(--ink); display: none; flex-direction: column; }
.cart[open] { display: flex; }
.cart::backdrop { background: rgba(27, 26, 23, 0.45); }
@media (prefers-reduced-motion: no-preference) { .cart[open] { animation: in 0.28s cubic-bezier(.2,.7,.2,1); } @keyframes in { from { transform: translateX(100%); } } }
.cart__head { display: flex; justify-content: space-between; align-items: center; padding: 1rem 1.25rem; border-bottom: 2px solid var(--ink); }
.cart__head h2 { font-size: 2rem; }
.x { width: 2.75rem; height: 2.75rem; display: grid; place-items: center; border: 2px solid var(--ink); border-radius: 999px; background: none; cursor: pointer; }
.x:hover { background: var(--cream); }
.x svg { width: 1.125rem; height: 1.125rem; stroke: currentColor; stroke-width: 2.2; }
.ship { padding: 1rem 1.25rem; background: var(--cream); border-bottom: 1px solid var(--line); font-weight: 600; font-size: 0.9375rem; }
.ship__track { height: 0.5rem; background: var(--paper); border: 1.5px solid var(--ink); border-radius: 999px; margin-top: 0.5rem; overflow: hidden; }
.ship__track span { display: block; height: 100%; background: var(--tomato); width: 0; }
@media (prefers-reduced-motion: no-preference) { .ship__track span { transition: width 0.4s ease; } }
.lines { flex: 1; overflow-y: auto; padding: 0 1.25rem; }
.line { display: grid; grid-template-columns: 4rem 1fr auto; gap: 0.25rem 1rem; padding: 1rem 0; border-bottom: 1px solid var(--line); align-items: start; }
.line .bag { grid-row: span 3; }
.line__name { font-weight: 700; line-height: 1.2; }
.line__grind { font-size: 0.875rem; color: var(--ink-2); }
.line__price { font-weight: 700; font-variant-numeric: tabular-nums; text-align: right; }
.line__ctrl { grid-column: 2 / -1; display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; margin-top: 0.375rem; }
.qty { display: inline-flex; align-items: center; border: 1.5px solid var(--ink); border-radius: 999px; }
.qty button { width: 2.5rem; height: 2.5rem; border: 0; background: none; font-size: 1.125rem; font-weight: 700; cursor: pointer; border-radius: 999px; }
.qty button:hover { background: var(--cream); }
.qty span { min-width: 1.75rem; text-align: center; font-weight: 700; font-variant-numeric: tabular-nums; }
.remove { background: none; border: 0; text-decoration: underline; text-underline-offset: 0.2em; cursor: pointer; font-size: 0.875rem; color: var(--ink-2); min-height: 2.5rem; padding: 0 0.25rem; }
.remove:hover { color: var(--tomato-ink); }
.cart__empty { padding: 2rem 1.25rem; display: grid; gap: 1rem; justify-items: start; flex: 1; align-content: start; }
.cart__foot { border-top: 2px solid var(--ink); padding: 1rem 1.25rem 1.25rem; display: grid; gap: 1rem; }
.totals div { display: flex; justify-content: space-between; padding: 0.25rem 0; }
.totals dd { font-variant-numeric: tabular-nums; font-weight: 600; }
.totals__grand { font-size: 1.25rem; font-weight: 800; border-top: 1px solid var(--line); margin-top: 0.25rem; padding-top: 0.5rem !important; }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
@media (forced-colors: active) { .bag__label, .roast, .ship__track span { forced-color-adjust: none; } }
