@font-face {
  font-family: 'Instrument Serif';
  src: url('assets/fonts/instrument-serif.woff2') format('woff2');
  font-display: swap;
}

@font-face {
  font-family: 'Instrument Serif';
  src: url('assets/fonts/instrument-serif-italic.woff2') format('woff2');
  font-style: italic;
  font-display: swap;
}

@font-face {
  font-family: 'Rethink Sans';
  src: url('assets/fonts/rethink-sans.woff2') format('woff2');
  font-weight: 400 700;
  font-display: swap;
}

:root {
  color-scheme: light;
  --paper: #f8f6ef;
  --ink: #1d211c;
  --muted: #555b50;
  --green: #10382d;
  --green-hover: #245745;
  --line: #cecfc1;
  --line-strong: #81877a;
  --sand: #eeebe1;
  --mint: #e5eddf;
  --display: 'Instrument Serif', Georgia, serif;
  --body: 'Rethink Sans', system-ui, sans-serif;
  --gutter: clamp(20px, 3.9vw, 68px);
  --measure: 1456px;
  --ease: cubic-bezier(.16, 1, .3, 1);
  font-family: var(--body);
  color: var(--ink);
  background: var(--paper);
  scroll-padding-top: 5.4rem;
  scrollbar-color: var(--line-strong) var(--paper);
}

*, *::before, *::after { box-sizing: border-box; }
[hidden], html:not(.enhanced) .js-only { display: none !important; }
body, figure, p, h1, h2, h3, dl, dd { margin: 0; }
body:has(dialog[open]) { overflow: hidden; }
body { font-size: 1rem; line-height: 1.5; }
img { display: block; max-width: 100%; }
button, input, select { font: inherit; color: inherit; }
button, select { cursor: pointer; }
button { border: 0; }
button:disabled { cursor: default; }
a { color: inherit; text-underline-offset: .2em; }
h1, h2, h3 { font-family: var(--display); font-weight: 400; line-height: 1; }
::selection { background: #d1e1c6; color: var(--green); }
:focus-visible { outline: 2px solid #36765b; outline-offset: 4px; }

.container { width: min(calc(100% - var(--gutter) - var(--gutter)), var(--measure)); margin-inline: auto; }
.symbol-library, .sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.icon {
  width: 1.2em;
  height: 1.2em;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.65;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.skip { position: fixed; z-index: 4; inset: .7rem auto auto var(--gutter); padding: .7rem 1rem; background: var(--paper); }
.skip:not(:focus) { clip-path: inset(50%); }

.demo-bar { color: var(--paper); background: var(--green); }
.demo-bar__inner { min-height: 36px; display: flex; align-items: center; justify-content: space-between; gap: .75rem; font-size: .875rem; }
.demo-bar a { display: inline-flex; align-items: center; gap: .3em; font-weight: 600; text-decoration: none; }
.demo-bar a:hover, .main-nav a:hover { text-decoration: underline; }
.demo-bar :focus-visible, .site-footer :focus-visible { outline-color: #bfdbb2; }

.site-header { position: sticky; top: 0; z-index: 3; background: var(--paper); border-bottom: 1px solid var(--line); }
.masthead { min-height: 72px; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 1.25rem; }
.wordmark { width: fit-content; font-family: var(--display); font-size: 3.15rem; letter-spacing: -.035em; line-height: .9; text-decoration: none; color: var(--green); }
.main-nav { display: flex; align-items: center; gap: clamp(1.6rem, 4.8vw, 4.5rem); font: 1.45rem var(--display); color: var(--green); }
.main-nav a { padding: .65rem 0; text-decoration: none; }

.bag-button {
  display: inline-flex;
  justify-self: end;
  align-items: center;
  gap: .55rem;
  min-height: 44px;
  border: 1px solid var(--green);
  border-radius: 6px;
  padding: .4rem .7rem .4rem .8rem;
  background: transparent;
  color: var(--green);
  font-size: .94rem;
  font-weight: 650;
  white-space: nowrap;
}

.bag-button:hover, .button--outline:hover, .product__add:hover, .icon-button:hover { background: var(--mint); }
.bag-count { min-width: 1.55rem; padding-inline: .25rem; border-radius: 2rem; background: var(--mint); text-align: center; line-height: 1.55rem; font-size: .8rem; font-variant-numeric: tabular-nums; }
.bag-button:hover .bag-count { background: var(--paper); }

.hero { --hero-height: clamp(385px, 29.15vw, 500px); display: grid; grid-template-columns: minmax(0, 36%) minmax(0, 1fr); max-width: 1690px; margin-inline: auto; }
.hero__copy { min-height: var(--hero-height); align-self: center; display: flex; flex-direction: column; justify-content: center; align-items: flex-start; padding: 2.4rem 1.3rem 2.7rem max(var(--gutter), calc((min(100vw, 1690px) - var(--measure)) / 2)); }
.hero h1 { font-size: clamp(3.6rem, 6.4vw, 6.15rem); letter-spacing: -.036em; line-height: .89; }
.hero h1 em { display: block; margin-top: .035em; color: var(--green); }
.hero__copy p { max-width: 30ch; margin: 1.45rem 0 1.85rem; color: var(--muted); font-size: clamp(1.04rem, 1.5vw, 1.42rem); line-height: 1.38; }
.hero__figure { min-height: var(--hero-height); position: relative; background: #b3a58b; }
.hero__figure img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center 57%; }
.hero__figure figcaption { position: absolute; bottom: 1.15rem; right: 1.2rem; }
.hero__product { display: inline-flex; align-items: center; gap: .3rem; min-height: 44px; border-radius: 5px; padding: .4rem .85rem; background: var(--paper); color: var(--green); font-size: .93rem; font-weight: 650; }
.hero__product:hover { background: var(--mint); }

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .6em;
  min-height: 48px;
  padding: .675rem 1.15rem;
  border: 1px solid transparent;
  border-radius: 5px;
  font-weight: 650;
  line-height: 1.22;
  text-align: center;
  text-decoration: none;
  transition: background-color 160ms ease, color 160ms ease;
}

.hero .button { font: 1.38rem var(--display); padding-inline: 1.4rem; }
.button--primary { background: var(--green); color: var(--paper); }
.button--primary:hover { background: var(--green-hover); }
.button--primary:disabled { background: var(--sand); color: var(--muted); }
.button--outline { border-color: var(--green); color: var(--green); background: transparent; }
.button--light { background: var(--paper); color: var(--green); }
.button--light:hover { background: var(--mint); }

.catalog { padding-block: clamp(1.55rem, 2.25vw, 2.4rem) clamp(3.6rem, 6vw, 6rem); }
.catalog__heading { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; margin-bottom: .65rem; }
.catalog__heading h2, .how h2, .site-footer h2 { font-size: clamp(3.1rem, 4.5vw, 4.65rem); letter-spacing: -.025em; }
.catalog__heading p { color: var(--muted); font-size: .91rem; }
.catalog__tools { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: clamp(1rem, 2.4vw, 2.6rem); margin-bottom: 1.9rem; }
.filters { display: flex; flex-wrap: wrap; column-gap: clamp(.3rem, 1.5vw, 1.75rem); box-shadow: inset 0 -1px var(--line); }
.filters button { position: relative; min-height: 44px; padding: .45rem .65rem .56rem; background: transparent; text-align: left; white-space: nowrap; }
.filters button[aria-pressed='true'] { color: var(--green); font-weight: 700; }
.filters button[aria-pressed='true']::after { position: absolute; inset: auto 0 0; height: 3px; content: ''; background: var(--green); }
.filters button:hover { color: var(--green); background: var(--mint); }
.catalog__inputs { display: grid; grid-template-columns: minmax(0, 1fr) 8.65rem; align-items: center; gap: .55rem; width: clamp(19rem, 32vw, 29rem); }
.search-field, .sort-field { display: flex; align-items: center; border: 1px solid var(--line-strong); border-radius: 5px; }
.search-field { gap: .55rem; padding-inline: .7rem .6rem; color: var(--green); }
.search-field input, .sort-field select { min-width: 0; width: 100%; min-height: 42px; padding: .35rem 0; border: 0; background: transparent; font-size: .95rem; }
.search-field input { caret-color: var(--green); }
.search-field input::placeholder { color: var(--muted); opacity: 1; }
.search-field:focus-within, .sort-field:focus-within { outline: 2px solid #36765b; outline-offset: 2px; }
.search-field input:focus, .sort-field select:focus { outline: none; }
.sort-field select { padding-inline: .65rem .35rem; }

.product-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 2.1rem clamp(.8rem, 1.6vw, 1.6rem); }
.product { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; column-gap: .45rem; border-bottom: 1px solid var(--line); padding-bottom: .85rem; }
.product__photo { grid-column: 1 / -1; display: block; position: relative; width: 100%; padding: 0; overflow: hidden; aspect-ratio: 1; background: var(--sand); }
.product__photo img { width: 100%; height: 100%; object-fit: cover; transition: transform .45s var(--ease); }
.enhanced .product__photo:hover img, .product__photo:focus-visible img { transform: scale(1.04); }
.product__peek { display: none; position: absolute; align-items: center; gap: .25rem; right: .55rem; bottom: .55rem; padding: .55rem .65rem; border-radius: 4px; background: var(--paper); color: var(--green); font-size: .86rem; font-weight: 650; }
.enhanced .product__photo:focus-visible .product__peek { display: flex; }
.product__info { margin-top: .78rem; }
.product__category { color: var(--muted); font-size: .82rem; }
.product__info h3 { margin-top: .15rem; font-size: clamp(1.5rem, 2.12vw, 2.15rem); }
.product__price { margin-top: .48rem; color: var(--green); font-size: .98rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.product__add, .icon-button { width: 44px; height: 44px; display: grid; place-items: center; flex: none; padding: 0; border: 1px solid var(--line-strong); border-radius: 6px; color: var(--green); background: var(--paper); }
.product__add .icon, .icon-button .icon { width: 1.35rem; height: 1.35rem; }
.empty-results { padding: 3.3rem 1.25rem; text-align: center; background: var(--sand); }
.empty-results > .icon, .order-empty > .icon { margin-bottom: .7rem; width: 2rem; height: 2rem; color: var(--green); }
.empty-results h3, .order-empty h3 { margin-bottom: .45rem; font-size: 2.25rem; }
.empty-results p, .order-empty p { margin-bottom: 1rem; color: var(--muted); }
.notice { margin-bottom: 1rem; color: var(--muted); }

.how { background: var(--sand); padding-block: clamp(2.65rem, 5.4vw, 5rem); }
.how__inner { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.65fr); align-items: start; gap: 2.3rem; }
.how__intro p { max-width: 32ch; margin-top: .7rem; color: var(--muted); }
.steps { list-style: none; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.25rem; margin: .3rem 0 0; padding: 0; counter-reset: steps; }
.steps li { padding: .8rem 0 0; border-top: 1px solid var(--line-strong); counter-increment: steps; }
.steps li::before { content: counter(steps, decimal-leading-zero); font-size: .85rem; font-weight: 650; color: var(--green); }
.steps h3 { font-size: 1.8rem; margin: .55rem 0 .4rem; }
.steps p { font-size: .93rem; color: var(--muted); }

.site-footer { color: var(--paper); background: var(--green); }
.footer__main { display: flex; justify-content: space-between; align-items: center; gap: 1.75rem; padding-block: clamp(2.75rem, 5.8vw, 5.4rem); }
.footer__main p { max-width: 53ch; margin-top: .7rem; color: #dbe8db; }
.footer__main .button { flex: none; }
.footer__base { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: .85rem 1.25rem; padding-block: 1rem 1.2rem; border-top: 1px solid #668276; color: #dbe8db; font-size: .87rem; }
.footer__base .wordmark { font-size: 2.4rem; color: var(--paper); }

.toast { position: fixed; inset: auto var(--gutter) 1.1rem auto; z-index: 4; max-width: min(25rem, calc(100% - var(--gutter) - var(--gutter))); pointer-events: none; color: var(--paper); }
.toast:not(:empty) { border-radius: 6px; padding: .7rem 1rem; background: var(--green); box-shadow: 0 6px 20px #102e2740; }

dialog { color: var(--ink); background: var(--paper); border: 0; padding: 0; }
dialog::backdrop { background: rgb(16 31 24 / .61); }
.product-dialog { width: min(53rem, calc(100% - 2rem)); max-height: calc(100% - 2rem); border-radius: 12px; }
.dialog-close { position: absolute; z-index: 1; top: .65rem; right: .65rem; }
.detail { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.detail > img { width: 100%; height: 100%; object-fit: cover; background: var(--sand); }
.detail__body { padding: 2.8rem 1.8rem 1.5rem; }
.detail__body h2 { margin: .25rem 0 .55rem; font-size: clamp(2.5rem, 4.5vw, 3.5rem); }
.detail__price { color: var(--green); font-size: 1.14rem; font-weight: 700; margin-bottom: .95rem; }
.detail__facts { margin: 1rem 0 1.15rem; padding-block: .65rem; border-block: 1px solid var(--line); }
.detail__facts > div { display: flex; justify-content: space-between; gap: .5rem; font-size: .9rem; }
.detail__facts > div + div { margin-top: .45rem; }
.detail__facts dt { font-weight: 650; }
.detail__facts dd { text-align: right; color: var(--muted); }
.detail__body .button, .order-total .button, .simulation .button { width: 100%; }
.detail__status { min-height: 1.3rem; margin-top: .35rem; font-size: .86rem; color: var(--green); }
.text-button { display: inline-flex; align-items: center; min-height: 44px; padding: 0; background: transparent; color: var(--green); font-weight: 650; text-decoration: underline; text-underline-offset: .22em; }
.text-button:hover { color: var(--green-hover); }

.order-dialog { margin: 0 0 0 auto; inset: 0 0 0 auto; width: min(100%, 29.5rem); max-width: none; height: 100%; height: 100dvh; max-height: none; overflow: hidden; }
.order-panel { display: flex; flex-direction: column; height: 100%; }
.order-panel__head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 82px; padding: .85rem clamp(1rem, 4.5vw, 1.55rem); border-bottom: 1px solid var(--line); }
.order-panel__head h2 { font-size: 3rem; }
.order-empty { align-self: center; margin: auto; padding: 1.3rem; text-align: center; }
.order-review { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.order-lines { flex: 1; list-style: none; overflow-y: auto; margin: 0; padding: .1rem clamp(1rem, 4.5vw, 1.55rem) .5rem; overscroll-behavior: contain; }
.order-item { display: grid; grid-template-columns: clamp(56px, 17vw, 84px) minmax(0, 1fr) auto; align-items: start; gap: .65rem; padding-block: .85rem; border-bottom: 1px solid var(--line); }
.order-item > img { width: 100%; height: auto; }
.order-item h3 { font-size: clamp(1.35rem, 5vw, 1.75rem); }
.order-item__unit { margin-top: .25rem; font-size: .82rem; color: var(--muted); }
.order-item__end { display: grid; justify-items: end; text-align: right; gap: .12rem; }
.order-item__end strong { font-size: .91rem; font-variant-numeric: tabular-nums; }
.order-item__end .text-button { font-size: .83rem; }
.quantity { width: fit-content; display: flex; align-items: stretch; margin-top: .35rem; border: 1px solid var(--line-strong); border-radius: 5px; }
.quantity button { display: grid; place-items: center; width: 38px; height: 42px; padding: 0; color: var(--green); border-radius: 4px; background: transparent; }
.quantity button:not(:disabled):hover { background: var(--mint); }
.quantity button:disabled { color: #73796f; }
.quantity__value { align-self: center; min-width: 1.5rem; text-align: center; font-size: .93rem; font-variant-numeric: tabular-nums; }
.order-total { padding: .9rem clamp(1rem, 4.5vw, 1.55rem) max(1.2rem, env(safe-area-inset-bottom)); border-top: 1px solid var(--line); }
.order-total > p { display: flex; justify-content: space-between; gap: .65rem; font-weight: 650; }
.order-total strong { color: var(--green); font-size: 1.2rem; font-variant-numeric: tabular-nums; }
.order-note { display: block; margin: .35rem 0 .8rem; color: var(--muted); font-size: .86rem; }

.simulation { flex: 1; overflow: auto; padding: 1.35rem clamp(1rem, 4.5vw, 1.55rem); }
.simulation h3 { font-size: clamp(2rem, 6vw, 2.6rem); }
.simulation > p { margin-top: .42rem; color: var(--muted); }
.chat-preview { display: flex; justify-content: flex-end; margin: 1rem 0; padding: 1rem; border-radius: 7px; background: var(--sand); }
.chat-preview__bubble { padding: .85rem; border-radius: .8rem .15rem .8rem .8rem; background: var(--mint); white-space: pre-wrap; overflow-wrap: anywhere; font-size: .93rem; line-height: 1.42; }

@media (hover: hover) {
  .enhanced .product__photo:hover .product__peek { display: flex; }
}

@media (max-width: 1020px) {
  .hero { grid-template-columns: minmax(0, 43%) minmax(0, 1fr); }
  .catalog__tools { grid-template-columns: 1fr; gap: .85rem; margin-bottom: 1.35rem; }
  .catalog__inputs { width: min(100%, 29rem); }
  .how__inner { grid-template-columns: 1fr; gap: 1.25rem; }
}

@media (max-width: 740px) {
  :root { scroll-padding-top: 4.35rem; }
  .masthead { min-height: 62px; grid-template-columns: 1fr auto; }
  .main-nav { display: none; }
  .wordmark { font-size: 2.6rem; }
  .hero { --hero-height: auto; grid-template-columns: 1fr; }
  .hero__copy { padding: 2.2rem var(--gutter) 1.75rem; }
  .hero h1 { font-size: clamp(3.7rem, 11.5vw, 5.65rem); }
  .hero__copy p { margin: .9rem 0 1.15rem; max-width: 37ch; }
  .hero__figure { min-height: clamp(15.25rem, 57vw, 22rem); }
  .hero__figure img { object-position: 62% 58%; }
  .hero__figure figcaption { bottom: .75rem; right: var(--gutter); }
  .product-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 1.3rem; }
  .product__info h3 { font-size: clamp(1.55rem, 4.8vw, 2.1rem); }
  .footer__main { align-items: flex-start; flex-direction: column; gap: 1.2rem; }
}

@media (max-width: 540px) {
  .demo-bar__inner { font-size: .77rem; }
  .catalog__tools { gap: .65rem; }
  .filters { column-gap: .1rem; }
  .filters button { padding-inline: clamp(.25rem, 1.35vw, .65rem); font-size: clamp(.77rem, 3.6vw, .95rem); }
  .catalog__inputs { grid-template-columns: minmax(0, 1fr) minmax(7.1rem, auto); }
  .search-field input, .sort-field select { font-size: 1rem; }
  .product { grid-template-columns: minmax(0, 1fr) auto; grid-template-rows: auto auto; position: relative; }
  .product__info { grid-column: 1 / -1; padding-bottom: .05rem; }
  .product__price { padding-right: 3rem; }
  .product__add { position: absolute; right: 0; bottom: .7rem; }
  .footer__base > span { order: 1; width: 100%; }
  .steps { grid-template-columns: 1fr; gap: .45rem; }
  .steps li { display: grid; grid-template-columns: 1.6rem 1fr; gap: .25rem .5rem; padding: .85rem 0; }
  .steps li::before { align-self: center; }
  .steps h3 { margin: 0; }
  .steps p { grid-column: 2; }
  .detail { grid-template-columns: 1fr; }
  .detail > img { height: min(60vw, 34dvh); object-position: center 57%; }
  .detail__body { padding: 1rem 1.1rem; }
  .detail__body h2 { margin-block: .15rem .45rem; }
}

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
  .order-dialog[open] { animation: drawer-in .3s var(--ease) both; }
  @keyframes drawer-in { from { transform: translateX(100%); } to { transform: translateX(0); } }
}

@media (prefers-reduced-motion: reduce) {
  .button, .product__photo img { transition: none; }
  .enhanced .product__photo:hover img, .product__photo:focus-visible img { transform: none; }
}
