/* Marenza Estate. Shared tokens, layout and components.
   Shape rule: interactive controls are full pills, containers use --r, form inputs use 1rem. */

:root {
  --paper: #ECEBE3;
  --paper-2: #E3E2D8;
  --card: #F5F4EE;
  --ink: #1C2117;
  --ink-2: #4B5244;
  --ink-3: #676D5F;
  --olive: #34422A;
  --olive-2: #28331F;
  --olive-3: #1B2315;
  --accent: #C5B650;
  --error: #9B2C1F;
  --line: rgba(28, 33, 23, .13);
  --line-2: rgba(28, 33, 23, .07);

  --serif: "Cormorant Garamond", Cormorant, Georgia, "Times New Roman", serif;
  --sans: Geist, "Segoe UI", system-ui, -apple-system, sans-serif;

  --ease: cubic-bezier(.32, .72, 0, 1);
  --ease-out: cubic-bezier(.16, 1, .3, 1);

  --r: 1.75rem;
  --r-in: calc(var(--r) - .375rem);
  --pad: clamp(1.25rem, 4vw, 3rem);
  --max: 1360px;
  --section: clamp(5rem, 11vw, 9.5rem);
  --shadow: 0 30px 60px -30px rgba(40, 51, 31, .3), 0 12px 24px -16px rgba(40, 51, 31, .18);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 1.0625rem/1.65 var(--sans);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
/* Paper grain. Fixed and non-interactive so it never repaints on scroll. */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 90;
  pointer-events: none;
  opacity: .07;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
body.lock { overflow: hidden; }

img { display: block; max-width: 100%; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
p { margin: 0; }
:focus-visible { outline: 2px solid var(--olive); outline-offset: 3px; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip {
  position: fixed; left: 1rem; top: -5rem; z-index: 100;
  background: var(--olive); color: var(--paper); padding: .75rem 1.25rem;
  border-radius: 999px; text-decoration: none; transition: top .4s var(--ease);
}
.skip:focus { top: 1rem; }

.container { width: 100%; max-width: var(--max); margin-inline: auto; padding-inline: var(--pad); }
.section { padding-block: var(--section); }

/* Type */
h1, h2, h3 { font-family: var(--serif); font-weight: 500; letter-spacing: -.015em; margin: 0; }
h1 em, h2 em { font-style: italic; color: var(--olive); }
.display { font-size: clamp(3rem, 5.6vw, 5.4rem); line-height: 1.08; }
.h2 { font-size: clamp(2.5rem, 4.6vw, 4.25rem); line-height: 1.08; }
.h3 { font-size: clamp(1.55rem, 2.1vw, 1.95rem); line-height: 1.15; }
.lede { font-size: clamp(1.05rem, 1.3vw, 1.2rem); color: var(--ink-2); max-width: 42ch; }
.muted { color: var(--ink-2); }
.eyebrow {
  display: inline-flex; align-items: center;
  padding: .4rem .85rem; border-radius: 999px;
  background: rgba(52, 66, 42, .09); color: var(--olive);
  font: 500 .6875rem/1 var(--sans); letter-spacing: .2em; text-transform: uppercase;
}

/* Buttons: pill with the icon nested in its own circle */
.btn {
  --h: 3.25rem;
  display: inline-flex; align-items: center; justify-content: space-between; gap: .9rem;
  height: var(--h); padding: 0 .375rem 0 1.5rem;
  border: 0; border-radius: 999px; cursor: pointer; text-decoration: none; white-space: nowrap;
  font: 500 .95rem/1 var(--sans);
  transition: transform .5s var(--ease), background-color .5s var(--ease), box-shadow .5s var(--ease), color .5s var(--ease);
}
.btn:active { transform: scale(.98); }
.btn__icon {
  width: 2.5rem; height: 2.5rem; border-radius: 999px;
  display: grid; place-items: center; font-size: 1.05rem;
  transition: transform .6s var(--ease);
}
.btn:hover .btn__icon { transform: translate(3px, -1px) scale(1.05); }
.btn--solid {
  background: var(--olive); color: var(--paper);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .12), 0 12px 24px -14px rgba(40, 51, 31, .6);
}
.btn--solid:hover { background: var(--olive-2); }
.btn--solid .btn__icon { background: rgba(236, 235, 227, .14); }
.btn--ghost { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 1px var(--line); }
.btn--ghost:hover { background: rgba(28, 33, 23, .04); }
.btn--ghost .btn__icon { background: rgba(28, 33, 23, .06); }
.btn--light { background: var(--paper); color: var(--olive-3); }
.btn--light:hover { background: #fff; }
.btn--light .btn__icon { background: rgba(52, 66, 42, .1); }
.btn--sm { --h: 2.75rem; padding-left: 1.15rem; gap: .7rem; font-size: .875rem; }
.btn--sm .btn__icon { width: 2rem; height: 2rem; font-size: .95rem; }
.btn--block { width: 100%; }
.btn.is-done .btn__icon { background: var(--accent); color: var(--olive-3); }

.link-arrow {
  display: inline-flex; align-items: center; gap: .5rem;
  font-weight: 500; font-size: .95rem; text-decoration: none;
  padding-bottom: .25rem; border-bottom: 1px solid var(--line);
  transition: border-color .4s var(--ease);
}
.link-arrow i { transition: transform .5s var(--ease); }
.link-arrow:hover { border-color: var(--ink); }
.link-arrow:hover i { transform: translate(3px, -1px); }

.icon-btn {
  position: relative; width: 3rem; height: 3rem; border: 0; border-radius: 999px;
  display: grid; place-items: center; cursor: pointer; font-size: 1.3rem;
  background: rgba(28, 33, 23, .05);
  transition: background-color .4s var(--ease), transform .4s var(--ease);
}
.icon-btn:hover { background: rgba(28, 33, 23, .09); }
.icon-btn:active { transform: scale(.95); }

/* Double bezel: outer tray plus inner core */
.bezel {
  display: block; padding: .375rem; border-radius: var(--r);
  background: rgba(28, 33, 23, .045);
  box-shadow: inset 0 0 0 1px rgba(28, 33, 23, .05);
}
.bezel--solid { background: var(--paper); box-shadow: inset 0 0 0 1px rgba(28, 33, 23, .06), var(--shadow); }
.bezel__core {
  position: relative; overflow: hidden; border-radius: var(--r-in);
  background: var(--paper-2);
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, .5);
}
.media img { width: 100%; height: 100%; object-fit: cover; }
.media--zoom img { transition: transform 1.4s var(--ease); }
a:hover > .media--zoom img, .media--zoom:hover img { transform: scale(1.045); }

/* Floating island nav */
.nav {
  position: fixed; top: 1rem; left: 0; right: 0; z-index: 40;
  display: flex; justify-content: center; padding-inline: 1rem; pointer-events: none;
}
.nav__bar {
  pointer-events: auto; width: min(1120px, 100%); height: 4rem;
  display: flex; align-items: center; justify-content: space-between; gap: 1.5rem;
  padding: 0 .5rem 0 1.4rem; border-radius: 999px;
  background: rgba(236, 235, 227, .74);
  -webkit-backdrop-filter: blur(18px) saturate(1.4);
  backdrop-filter: blur(18px) saturate(1.4);
  box-shadow: inset 0 0 0 1px rgba(28, 33, 23, .07), inset 0 1px 0 rgba(255, 255, 255, .5), 0 14px 30px -20px rgba(40, 51, 31, .4);
}
.brand { display: inline-flex; align-items: center; gap: .6rem; text-decoration: none; font: 500 1.6rem/1 var(--serif); letter-spacing: .01em; }
.brand__mark {
  width: 2rem; height: 2rem; border-radius: 999px; display: grid; place-items: center;
  background: var(--olive); color: var(--paper); font: italic 500 1.15rem/1 var(--serif);
}
.nav__links { display: flex; gap: .15rem; }
.nav__links a {
  padding: .6rem 1rem; border-radius: 999px; text-decoration: none; font-size: .9rem; color: var(--ink-2);
  transition: background-color .4s var(--ease), color .4s var(--ease);
}
.nav__links a:hover { background: rgba(28, 33, 23, .05); color: var(--ink); }
.nav__links a[aria-current="page"] { background: rgba(52, 66, 42, .09); color: var(--ink); }
.nav__actions { display: flex; align-items: center; gap: .375rem; }
.bag-count {
  position: absolute; top: .2rem; right: .15rem; min-width: 1.2rem; height: 1.2rem; padding: 0 .3rem;
  border-radius: 999px; background: var(--olive); color: var(--paper);
  font: 600 .65rem/1.2rem var(--sans); text-align: center;
  transform: scale(0); transition: transform .5s var(--ease);
}
.bag-count.has { transform: scale(1); }
.bag-count.bump { animation: bump .6s var(--ease); }
@keyframes bump { 40% { transform: scale(1.35); } 100% { transform: scale(1); } }

.currency { display: inline-flex; align-items: center; gap: .75rem; }
.currency__box { position: relative; display: inline-flex; align-items: center; }
.currency select {
  appearance: none; height: 3rem; padding: 0 2.1rem 0 1rem; border: 0; border-radius: 999px; cursor: pointer;
  background: rgba(28, 33, 23, .05); font-size: .85rem; font-weight: 500; letter-spacing: .02em;
  transition: background-color .4s var(--ease);
}
.currency select:hover { background: rgba(28, 33, 23, .09); }
.currency__box i { position: absolute; right: .8rem; font-size: .85rem; pointer-events: none; }
.currency__label { font-size: .95rem; color: var(--ink-2); }
.currency--menu { margin-top: 1.5rem; }

.burger { display: none; }
.burger span {
  position: absolute; left: 50%; top: 50%; width: 1.1rem; height: 1.5px; border-radius: 2px; background: var(--ink);
  transition: transform .55s var(--ease);
}
.burger span:first-child { transform: translate(-50%, -4px); }
.burger span:last-child { transform: translate(-50%, 4px); }
.burger[aria-expanded="true"] span:first-child { transform: translate(-50%, 0) rotate(45deg); }
.burger[aria-expanded="true"] span:last-child { transform: translate(-50%, 0) rotate(-45deg); }

.menu {
  position: fixed; inset: 0; z-index: 35;
  display: flex; flex-direction: column; justify-content: center;
  padding: 7rem var(--pad) 3rem;
  background: rgba(236, 235, 227, .9);
  -webkit-backdrop-filter: blur(28px);
  backdrop-filter: blur(28px);
  opacity: 0; visibility: hidden;
  transition: opacity .5s var(--ease), visibility 0s linear .5s;
}
.menu.is-open { opacity: 1; visibility: visible; transition: opacity .5s var(--ease); }
.menu a {
  display: block; width: fit-content; text-decoration: none;
  font: 500 clamp(2.6rem, 11vw, 4rem)/1.2 var(--serif);
  opacity: 0; transform: translateY(2.5rem);
  transition: opacity .6s var(--ease-out), transform .9s var(--ease-out);
  transition-delay: calc(var(--i) * 70ms + 60ms);
}
.menu.is-open a { opacity: 1; transform: none; }
.menu__foot { margin-top: 2.5rem; color: var(--ink-2); font-size: .95rem; }

@media (max-width: 900px) {
  .nav__links, .currency--nav { display: none; }
  .burger { display: grid; }
}

/* Bag drawer */
.scrim {
  position: fixed; inset: 0; z-index: 50; background: rgba(27, 35, 21, .35);
  opacity: 0; visibility: hidden; transition: opacity .5s var(--ease), visibility 0s linear .5s;
}
.scrim.is-open { opacity: 1; visibility: visible; transition: opacity .5s var(--ease); }
.drawer {
  position: fixed; top: .75rem; right: .75rem; bottom: .75rem; z-index: 51;
  width: min(28rem, calc(100% - 1.5rem));
  display: flex; flex-direction: column;
  border-radius: var(--r); background: var(--card);
  box-shadow: inset 0 0 0 1px rgba(28, 33, 23, .06), 0 40px 80px -30px rgba(27, 35, 21, .5);
  transform: translateX(calc(100% + 1rem)); visibility: hidden;
  transition: transform .7s var(--ease), visibility 0s linear .7s;
}
.drawer.is-open { transform: none; visibility: visible; transition: transform .7s var(--ease); }
.drawer__head { display: flex; align-items: center; justify-content: space-between; padding: 1.1rem 1.1rem .75rem 1.75rem; }
.drawer__head h2 { font-size: 2rem; }
.drawer__body { flex: 1; overflow-y: auto; padding: 0 1.75rem; }
.drawer__foot { padding: 1.25rem 1.75rem 1.5rem; border-top: 1px solid var(--line-2); }
.drawer__row { display: flex; align-items: baseline; justify-content: space-between; }
.drawer__total { font: 500 1.75rem/1 var(--serif); }
.drawer__note { font-size: .875rem; color: var(--ink-2); margin: .4rem 0 1.25rem; }
.demo-note { font-size: .8rem; color: var(--ink-2); text-align: center; margin-top: .85rem; min-height: 1.3em; }

.line-item { display: grid; grid-template-columns: 5rem 1fr auto; gap: 1rem; padding: 1.25rem 0; align-items: start; }
.line-item + .line-item { border-top: 1px solid var(--line-2); }
.line-item__img { width: 5rem; aspect-ratio: 4 / 5; border-radius: .9rem; overflow: hidden; background: var(--paper-2); }
.line-item__img img { width: 100%; height: 100%; object-fit: cover; }
.line-item__name { font: 500 1.3rem/1.15 var(--serif); text-decoration: none; }
.line-item__meta { font-size: .85rem; color: var(--ink-2); }
.line-item__price { font: 500 1.2rem/1.2 var(--serif); }
.remove { display: block; margin-top: .6rem; padding: 0; border: 0; background: none; cursor: pointer; font-size: .8rem; color: var(--ink-2); text-decoration: underline; text-underline-offset: 3px; }

.stepper { display: inline-flex; align-items: center; margin-top: .6rem; border-radius: 999px; box-shadow: inset 0 0 0 1px var(--line); }
.stepper button {
  width: 2.75rem; height: 2.75rem; border: 0; border-radius: 999px; background: none; cursor: pointer;
  display: grid; place-items: center; transition: background-color .3s var(--ease);
}
.stepper button:hover { background: rgba(28, 33, 23, .06); }
.stepper output, .stepper span { min-width: 1.5rem; text-align: center; font-size: .9rem; font-variant-numeric: tabular-nums; }

.empty { text-align: center; padding: 3.5rem 1rem; }
.empty i { font-size: 2.5rem; color: var(--olive); }
.empty h3 { font-size: 1.7rem; margin: .75rem 0 .35rem; }
.empty p { color: var(--ink-2); margin-bottom: 1.5rem; }

/* Footer */
.footer { margin-top: var(--section); padding: clamp(3.5rem, 7vw, 6rem) 0 2rem; background: var(--paper-2); border-radius: var(--r) var(--r) 0 0; }
.footer__top { display: grid; grid-template-columns: 1.3fr .8fr .8fr 1.5fr; gap: 3rem; }
.footer__label { font-size: .8rem; color: var(--ink-3); margin-bottom: 1rem; }
.footer ul { list-style: none; padding: 0; margin: 0; display: grid; gap: .55rem; }
.footer ul a { text-decoration: none; color: var(--ink-2); font-size: .95rem; transition: color .3s var(--ease); }
.footer ul a:hover { color: var(--ink); }
.footer__about { color: var(--ink-2); max-width: 30ch; margin-top: 1.25rem; }
.footer__word {
  margin: clamp(3rem, 7vw, 5rem) 0 2rem;
  font: 500 clamp(4.5rem, 19vw, 17rem)/.8 var(--serif); letter-spacing: -.03em; color: var(--olive);
}
.footer__base {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: .5rem 2rem;
  padding-top: 1.5rem; border-top: 1px solid var(--line); font-size: .8rem; color: var(--ink-3);
}

.inline-form {
  display: flex; gap: .5rem; padding: .375rem; border-radius: 999px;
  background: var(--card); box-shadow: inset 0 0 0 1px var(--line);
  transition: box-shadow .4s var(--ease);
}
.inline-form:focus-within { box-shadow: inset 0 0 0 1.5px var(--olive), 0 0 0 4px rgba(52, 66, 42, .12); }
.inline-form input { flex: 1; min-width: 0; border: 0; background: none; padding: 0 1rem; }
.inline-form input:focus { outline: none; }
.form-msg { font-size: .85rem; margin-top: .6rem; min-height: 1.3em; color: var(--ink-2); }
.form-msg.is-error { color: var(--error); }

@media (max-width: 1000px) { .footer__top { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) {
  .footer__top { grid-template-columns: 1fr; gap: 2.25rem; }
  .inline-form { flex-direction: column; border-radius: 1.5rem; }
  .inline-form input { height: 3rem; }
}

/* Scroll reveal. Only hides content when JS is running. */
.js .reveal {
  opacity: 0; transform: translateY(2.5rem); filter: blur(6px);
  transition: opacity 1s var(--ease-out), transform 1.1s var(--ease-out), filter 1s var(--ease-out);
  transition-delay: var(--d, 0ms);
}
.js .reveal.is-in { opacity: 1; transform: none; filter: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; transition-delay: 0ms !important; }
  .js .reveal { opacity: 1; transform: none; filter: none; }
}
