/* ==========================================================================
   Tan & Co — styles.css
   Design tokens → base → layout → components → pages
   ========================================================================== */

/* ---------- Tokens ------------------------------------------------------- */
:root {
  --cream: #F7F3EE;        /* page background */
  --paper: #FCFAF7;        /* raised surfaces (drawer, cards) */
  --tile: #EEE8E0;         /* product image tiles */
  --sand: #C9A277;         /* accent */
  --sand-deep: #A57E52;    /* accent hover / text-safe accent */
  --espresso: #1C1917;     /* text + primary CTAs */
  --ink-2: #57534E;        /* secondary text */
  --ink-3: #8C857D;        /* tertiary text / meta */
  --line: #E4DBD0;         /* hairlines */
  --line-strong: #CFC3B4;
  --sale: #9A4A2F;         /* muted saddle red for sale prices */
  --ok: #4D6B4F;

  --serif: "Fraunces", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  --sans: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;

  --gutter: clamp(16px, 4vw, 48px);
  --max: 1440px;
  --radius: 2px;
  --ease: cubic-bezier(.2,.7,.2,1);
  --header-h: 64px;
}

/* ---------- Base --------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--cream);
  color: var(--espresso);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
body.no-scroll { overflow: hidden; }
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3, h4 { font-family: var(--serif); font-weight: 400; line-height: 1.12; margin: 0; letter-spacing: -0.01em; font-variation-settings: "SOFT" 30, "WONK" 0; }
p { margin: 0; }
:focus-visible { outline: 2px solid var(--sand-deep); outline-offset: 3px; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.container { width: 100%; max-width: var(--max); margin: 0 auto; padding-inline: var(--gutter); }
.eyebrow { font-size: 11px; letter-spacing: .16em; text-transform: uppercase; color: var(--ink-3); font-weight: 500; }
.lede { font-size: 17px; color: var(--ink-2); max-width: 46ch; }
.link-underline { border-bottom: 1px solid currentColor; padding-bottom: 2px; transition: color .2s, border-color .2s; }
.link-underline:hover { color: var(--sand-deep); }

/* ---------- Buttons ------------------------------------------------------ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 50px; padding: 0 28px;
  font-size: 12px; font-weight: 500; letter-spacing: .14em; text-transform: uppercase;
  border: 1px solid var(--espresso); border-radius: var(--radius);
  transition: background .25s var(--ease), color .25s var(--ease), border-color .25s var(--ease);
  white-space: nowrap;
}
.btn-dark { background: var(--espresso); color: var(--cream); }
.btn-dark:hover { background: #3A332D; border-color: #3A332D; }
.btn-light { background: var(--cream); color: var(--espresso); border-color: var(--cream); }
.btn-light:hover { background: transparent; color: var(--cream); }
.btn-ghost { background: transparent; }
.btn-ghost:hover { background: var(--espresso); color: var(--cream); }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .45; cursor: not-allowed; }

/* ---------- Announcement + header --------------------------------------- */
.announce {
  background: var(--espresso); color: #E9E1D6;
  font-size: 12px; letter-spacing: .06em; text-align: center; padding: 9px var(--gutter);
}
.announce a { border-bottom: 1px solid rgba(233,225,214,.4); }

.site-header {
  position: sticky; top: 0; z-index: 40;
  background: rgba(247,243,238,.94);
  backdrop-filter: saturate(1.2) blur(10px);
  -webkit-backdrop-filter: saturate(1.2) blur(10px);
  border-bottom: 1px solid transparent;
  transition: border-color .3s;
}
.site-header.is-scrolled { border-bottom-color: var(--line); }
.header-top {
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center;
  height: var(--header-h);
}
.header-left, .header-right { display: flex; align-items: center; gap: 22px; }
.header-right { justify-content: flex-end; }
.header-util { font-size: 13px; color: var(--ink-2); transition: color .2s; }
.header-util:hover { color: var(--espresso); }

.wordmark {
  font-family: var(--serif); font-size: 28px; font-weight: 400; letter-spacing: -0.01em;
  line-height: 1; white-space: nowrap;
  font-variation-settings: "SOFT" 50, "WONK" 1;
}
.wordmark .amp { font-style: italic; color: var(--sand-deep); padding: 0 .04em; }

.icon-btn {
  position: relative; width: 40px; height: 40px;
  display: inline-grid; place-items: center; border-radius: 50%;
  transition: background .2s;
}
.icon-btn:hover { background: rgba(28,25,23,.06); }
.icon-btn svg { width: 21px; height: 21px; stroke: currentColor; fill: none; stroke-width: 1.4; }
.cart-count {
  position: absolute; top: 3px; right: 1px;
  min-width: 17px; height: 17px; padding: 0 4px; border-radius: 9px;
  background: var(--sand-deep); color: #fff; font-size: 10px; font-weight: 600;
  display: grid; place-items: center; line-height: 1;
  transform: scale(0); transition: transform .3s var(--ease);
}
.cart-count.has-items { transform: scale(1); }
.cart-count.bump { animation: bump .5s var(--ease); }
@keyframes bump { 40% { transform: scale(1.35); } }

.menu-toggle { display: none; }

.cat-nav { border-top: 1px solid var(--line); }
.cat-nav ul {
  list-style: none; margin: 0; padding: 0;
  display: flex; justify-content: safe center; gap: clamp(16px, 1.8vw, 30px);
  overflow-x: auto; scrollbar-width: none;
}
.cat-nav ul::-webkit-scrollbar { display: none; }
.cat-nav a {
  display: block; padding: 13px 0 12px; font-size: 13px; color: var(--ink-2); white-space: nowrap;
  position: relative; transition: color .2s;
}
.cat-nav a::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 1px; background: var(--espresso);
  transform: scaleX(0); transform-origin: left; transition: transform .35s var(--ease);
}
.cat-nav a:hover, .cat-nav a[aria-current="page"] { color: var(--espresso); }
.cat-nav a:hover::after, .cat-nav a[aria-current="page"]::after { transform: scaleX(1); }

/* Mobile menu */
.mobile-menu {
  position: fixed; inset: 0; z-index: 60; pointer-events: none; overflow: hidden;
}
.mobile-menu .scrim { position: absolute; inset: 0; background: rgba(28,25,23,.35); opacity: 0; transition: opacity .35s; }
.mobile-menu .panel {
  position: absolute; top: 0; bottom: 0; left: 0; width: min(88vw, 380px);
  background: var(--paper); padding: 20px 24px 32px; overflow-y: auto;
  transform: translateX(-100%); transition: transform .45s var(--ease);
  display: flex; flex-direction: column;
}
.mobile-menu.is-open { pointer-events: auto; }
.mobile-menu.is-open .scrim { opacity: 1; }
.mobile-menu.is-open .panel { transform: none; }
.mobile-menu .panel-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 18px; }
.mobile-menu ul { list-style: none; margin: 0; padding: 0; }
.mobile-menu li a {
  display: flex; justify-content: space-between; align-items: center;
  padding: 15px 0; border-bottom: 1px solid var(--line);
  font-family: var(--serif); font-size: 21px;
}
.mobile-menu li a span { font-family: var(--sans); font-size: 12px; color: var(--ink-3); }
.mobile-menu .secondary { margin-top: 26px; display: grid; gap: 12px; font-size: 14px; color: var(--ink-2); }

/* ---------- Cart drawer -------------------------------------------------- */
.drawer { position: fixed; inset: 0; z-index: 70; pointer-events: none; overflow: hidden; }
.drawer .scrim { position: absolute; inset: 0; background: rgba(28,25,23,.35); opacity: 0; transition: opacity .35s; }
.drawer .panel {
  position: absolute; top: 0; right: 0; bottom: 0; width: min(100vw, 440px);
  background: var(--paper); display: flex; flex-direction: column;
  transform: translateX(100%); transition: transform .5s var(--ease);
}
.drawer.is-open { pointer-events: auto; }
.drawer.is-open .scrim { opacity: 1; }
.drawer.is-open .panel { transform: none; box-shadow: -20px 0 60px rgba(28,25,23,.08); }
.drawer-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 24px; border-bottom: 1px solid var(--line);
}
.drawer-head h2 { font-size: 22px; }
.drawer-head h2 small { font-family: var(--sans); font-size: 12px; color: var(--ink-3); margin-left: 6px; letter-spacing: .02em; }
.drawer-body { flex: 1; overflow-y: auto; padding: 8px 24px; }
.drawer-foot { border-top: 1px solid var(--line); padding: 18px 24px 22px; background: var(--paper); }

.cart-empty { text-align: center; padding: 64px 12px; }
.cart-empty h3 { font-size: 24px; margin-bottom: 8px; }
.cart-empty p { color: var(--ink-2); margin-bottom: 24px; }

.line-item { display: grid; grid-template-columns: 84px 1fr; gap: 16px; padding: 18px 0; border-bottom: 1px solid var(--line); }
.line-item:last-child { border-bottom: 0; }
.line-thumb { aspect-ratio: 4/5; background: var(--tile); overflow: hidden; }
.line-thumb img { width: 100%; height: 100%; object-fit: cover; mix-blend-mode: multiply; }
.line-top { display: flex; justify-content: space-between; gap: 10px; }
.line-name { font-size: 14px; font-weight: 500; line-height: 1.35; }
.line-price { font-size: 14px; white-space: nowrap; }
.line-meta { font-size: 12.5px; color: var(--ink-2); margin-top: 3px; line-height: 1.5; }
.line-personal {
  margin-top: 8px; padding: 8px 10px; background: var(--cream); border: 1px solid var(--line);
  font-size: 12px; color: var(--ink-2); display: flex; gap: 10px; align-items: center;
}
.line-personal img { width: 34px; height: 34px; object-fit: cover; border-radius: 2px; filter: grayscale(1) sepia(.5); }
.line-personal strong { color: var(--espresso); font-weight: 500; }
.line-personal .engr { font-family: var(--serif); font-style: italic; font-size: 14px; color: var(--espresso); }
.line-actions { display: flex; justify-content: space-between; align-items: center; margin-top: 12px; }
.line-remove { font-size: 12px; color: var(--ink-3); border-bottom: 1px solid var(--line-strong); }
.line-remove:hover { color: var(--espresso); }

.qty { display: inline-flex; align-items: center; border: 1px solid var(--line-strong); height: 34px; }
.qty button { width: 32px; height: 100%; font-size: 16px; color: var(--ink-2); }
.qty button:hover { color: var(--espresso); background: rgba(28,25,23,.04); }
.qty span, .qty input { width: 30px; text-align: center; font-size: 13px; border: 0; background: transparent; }

.subtotal { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 4px; }
.subtotal span:first-child { font-size: 13px; letter-spacing: .1em; text-transform: uppercase; }
.subtotal span:last-child { font-family: var(--serif); font-size: 24px; }
.foot-note { font-size: 12px; color: var(--ink-3); margin-bottom: 14px; }
.final-sale {
  display: flex; gap: 8px; align-items: flex-start;
  font-size: 12.5px; color: var(--ink-2); background: #F3ECE2; border-left: 2px solid var(--sand);
  padding: 9px 12px; margin-bottom: 14px;
}
.final-sale svg { width: 16px; height: 16px; flex-shrink: 0; stroke: currentColor; fill: none; stroke-width: 1.4; margin-top: 2px; }
.checkout-soon {
  margin-top: 12px; font-size: 12.5px; color: var(--ink-2); text-align: center;
  padding: 10px; border: 1px dashed var(--line-strong); display: none;
}
.checkout-soon.show { display: block; animation: fadeUp .4s var(--ease); }

/* ---------- Toast -------------------------------------------------------- */
.toast {
  position: fixed; left: 50%; bottom: 24px; z-index: 80;
  transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  background: var(--espresso); color: var(--cream); font-size: 13px;
  padding: 12px 18px; border-radius: 2px; transition: all .35s var(--ease);
  max-width: calc(100vw - 32px);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- Product card ------------------------------------------------- */
.product-grid {
  display: grid; gap: 40px 20px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
.card { position: relative; }
.card-media {
  position: relative; aspect-ratio: 4/5; background: var(--tile); overflow: hidden; display: block;
}
.card-media img {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
  mix-blend-mode: multiply; transition: opacity .6s var(--ease), transform 1.2s var(--ease);
}
.card-media img.alt { opacity: 0; }
@media (hover: hover) {
  .card:hover .card-media img.primary { transform: scale(1.03); }
  .card:hover .card-media img.alt { opacity: 1; transform: scale(1.03); }
  .card:hover .card-media.has-alt img.primary { opacity: 0; }
}
.badge {
  position: absolute; top: 12px; left: 12px; z-index: 2;
  font-size: 10px; letter-spacing: .14em; text-transform: uppercase; font-weight: 500;
  background: var(--paper); color: var(--espresso); padding: 5px 8px;
}
.badge.engrave { left: auto; right: 12px; background: transparent; color: var(--ink-2); padding: 0; }
.badge.engrave svg { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 1.3; }
.card-quick {
  position: absolute; left: 12px; right: 12px; bottom: 12px; z-index: 2;
  opacity: 0; transform: translateY(8px); transition: all .35s var(--ease);
  min-height: 42px; font-size: 11px;
}
@media (hover: hover) { .card:hover .card-quick { opacity: 1; transform: none; } }
.card-body { padding-top: 14px; }
.card-name { font-size: 14px; line-height: 1.4; font-weight: 450; }
.card-name a:hover { color: var(--sand-deep); }
.card-meta { display: flex; justify-content: space-between; gap: 12px; margin-top: 4px; font-size: 13px; }
.card-colors { color: var(--ink-3); font-size: 12.5px; }
.price { white-space: nowrap; }
.price .was { color: var(--ink-3); text-decoration: line-through; margin-left: 6px; font-size: .92em; }
.price.on-sale .now { color: var(--sale); }

img.is-broken { visibility: hidden; }
.img-fallback { background: repeating-linear-gradient(135deg, #EAE2D7 0 12px, #E4DBCF 12px 24px); }

/* ---------- Section scaffolding ----------------------------------------- */
.section { padding-block: clamp(56px, 8vw, 110px); }
.section-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; margin-bottom: 36px; }
.section-head h2 { font-size: clamp(30px, 3.4vw, 46px); }
.section-head p { color: var(--ink-2); margin-top: 10px; max-width: 52ch; }

/* ---------- Home: hero -------------------------------------------------- */
.hero {
  position: relative; min-height: clamp(520px, 78vh, 820px);
  display: flex; align-items: flex-end; color: var(--cream); overflow: hidden; background: #2A211B;
}
.hero-media { position: absolute; inset: 0; }
.hero-media img {
  width: 100%; height: 100%; object-fit: cover; object-position: 72% 40%;
  transform: scale(1.06); animation: heroZoom 2.4s var(--ease) forwards;
}
@keyframes heroZoom { to { transform: scale(1); } }
.hero::after {
  content: ""; position: absolute; inset: 0;
  background:
    linear-gradient(90deg, rgba(24,18,14,.72) 0%, rgba(24,18,14,.42) 38%, rgba(24,18,14,0) 64%),
    linear-gradient(0deg, rgba(24,18,14,.45) 0%, rgba(24,18,14,0) 40%);
}
.hero-content { position: relative; z-index: 2; padding-bottom: clamp(48px, 8vw, 110px); }
.hero .eyebrow { color: #E2D3BF; margin-bottom: 18px; }
.hero h1 {
  font-size: clamp(46px, 7.2vw, 108px); line-height: .98; font-weight: 300; max-width: 12ch;
  font-variation-settings: "SOFT" 60, "WONK" 1;
}
.hero h1 em { font-style: italic; color: #E9CBA2; }
.hero p { margin-top: 22px; font-size: clamp(15px, 1.4vw, 18px); max-width: 40ch; color: #EFE6DA; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 32px; }
.hero .btn-ghost { color: var(--cream); border-color: rgba(247,243,238,.6); }
.hero .btn-ghost:hover { background: var(--cream); color: var(--espresso); border-color: var(--cream); }

.fade-up { opacity: 0; transform: translateY(18px); animation: fadeUp .9s var(--ease) forwards; }
.fade-up.d1 { animation-delay: .15s; } .fade-up.d2 { animation-delay: .3s; } .fade-up.d3 { animation-delay: .45s; }
@keyframes fadeUp { to { opacity: 1; transform: none; } }

/* Value strip */
.values { border-bottom: 1px solid var(--line); }
.values ul { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); }
.values li { padding: 22px 16px; text-align: center; font-size: 13px; color: var(--ink-2); border-right: 1px solid var(--line); }
.values li:last-child { border-right: 0; }
.values strong { display: block; font-family: var(--serif); font-weight: 400; font-size: 17px; color: var(--espresso); margin-bottom: 2px; }

/* Rail */
.rail-wrap { position: relative; }
.rail {
  display: grid; grid-auto-flow: column; grid-auto-columns: calc((100% - 60px) / 4);
  gap: 20px; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; padding-bottom: 4px;
}
.rail::-webkit-scrollbar { display: none; }
.rail > * { scroll-snap-align: start; }
.rail-nav { display: flex; gap: 8px; }
.rail-nav button {
  width: 44px; height: 44px; border: 1px solid var(--line-strong); border-radius: 50%;
  display: grid; place-items: center; transition: all .2s;
}
.rail-nav button:hover { background: var(--espresso); color: var(--cream); border-color: var(--espresso); }
.rail-nav svg { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 1.5; }

/* Category tiles */
.cat-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.cat-tile { position: relative; display: block; }
.cat-tile .media { aspect-ratio: 1/1; background: var(--tile); overflow: hidden; }
.cat-tile img { width: 100%; height: 100%; object-fit: cover; mix-blend-mode: multiply; transition: transform 1.2s var(--ease); }
.cat-tile:hover img { transform: scale(1.04); }
.cat-tile .label { display: flex; justify-content: space-between; align-items: baseline; padding-top: 14px; gap: 12px; }
.cat-tile h3 { font-size: 22px; }
.cat-tile .count { font-size: 12px; color: var(--ink-3); white-space: nowrap; }
.cat-tile .arrow { display: inline-block; transition: transform .3s var(--ease); }
.cat-tile:hover .arrow { transform: translateX(4px); }

/* Personalization band */
.engrave-band { background: #EBE3D8; }
.engrave-band .inner { display: grid; grid-template-columns: 1.05fr 1fr; gap: clamp(32px, 6vw, 96px); align-items: center; }
.engrave-band h2 { font-size: clamp(32px, 4vw, 56px); margin: 14px 0 18px; }
.engrave-band ol { list-style: none; counter-reset: s; margin: 28px 0 32px; padding: 0; display: grid; gap: 14px; }
.engrave-band li { counter-increment: s; display: grid; grid-template-columns: 34px 1fr; font-size: 14.5px; color: var(--ink-2); }
.engrave-band li::before { content: "0" counter(s); font-family: var(--serif); font-style: italic; color: var(--sand-deep); }
.engrave-band .inner > * { min-width: 0; }
.engrave-demo > div { width: 100%; display: flex; flex-direction: column; align-items: center; }
.engrave-demo { display: grid; place-items: center; padding: clamp(24px, 4vw, 56px); background: var(--tile); aspect-ratio: 5/4; }

/* Story */
.story { display: grid; grid-template-columns: 1.2fr 1fr; gap: clamp(32px, 6vw, 96px); align-items: center; }
.story .media { aspect-ratio: 5/4; overflow: hidden; background: var(--tile); }
.story .media img { width: 100%; height: 100%; object-fit: cover; object-position: 78% 50%; }
.story h2 { font-size: clamp(32px, 4vw, 54px); margin: 14px 0 20px; }
.story p { color: var(--ink-2); margin-bottom: 16px; max-width: 48ch; }
.story .link-underline { display: inline-block; margin-top: 12px; font-size: 13px; letter-spacing: .08em; text-transform: uppercase; }

/* ---------- Engraving badge (shared: home demo + PDP preview) ----------- */
.patch {
  --w: 300px;
  width: min(var(--w), 100%); aspect-ratio: 1.55/1;
  position: relative; border-radius: 18px;
  background:
    radial-gradient(120% 90% at 30% 20%, rgba(255,255,255,.18), transparent 60%),
    radial-gradient(90% 90% at 80% 100%, rgba(0,0,0,.22), transparent 60%),
    linear-gradient(135deg, #B8844F 0%, #9C6B3C 45%, #7E5430 100%);
  box-shadow: 0 1px 0 rgba(255,255,255,.25) inset, 0 -2px 6px rgba(0,0,0,.18) inset, 0 18px 40px -18px rgba(60,35,15,.55);
  display: grid; place-items: center; overflow: hidden;
}
.patch::before { /* grain */
  content: ""; position: absolute; inset: 0; opacity: .35; mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .35 0 0 0 0 .22 0 0 0 0 .12 0 0 0 .55 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
.patch::after { /* stitching */
  content: ""; position: absolute; inset: 10px; border-radius: 11px;
  border: 1.5px dashed rgba(246,226,196,.55);
}
.patch-text {
  position: relative; z-index: 1; padding: 0 18px; text-align: center;
  font-family: var(--serif); font-style: italic; font-weight: 400;
  font-size: clamp(26px, calc(var(--w) * .15), 48px); line-height: 1; letter-spacing: .01em;
  color: #5A3A1E;
  text-shadow: 0 1px 0 rgba(255,236,205,.35), 0 -1px 0 rgba(40,20,5,.45);
  word-break: break-word;
  transition: font-size .2s;
}
.patch-text.is-placeholder { color: rgba(90,58,30,.45); }
.patch-img {
  position: relative; z-index: 1; width: 52%; aspect-ratio: 1; border-radius: 6px; overflow: hidden;
  box-shadow: 0 -1px 0 rgba(40,20,5,.35), 0 1px 0 rgba(255,236,205,.3);
}
.patch-img img { width: 100%; height: 100%; object-fit: cover; filter: grayscale(1) sepia(1) saturate(.9) contrast(1.35) brightness(.72); mix-blend-mode: multiply; }
.patch-caption { margin-top: 14px; font-size: 12px; color: var(--ink-3); text-align: center; letter-spacing: .04em; }

/* ---------- Page header (category / about / contact) -------------------- */
.page-head { padding-block: clamp(36px, 5vw, 64px) clamp(20px, 3vw, 32px); }
.crumbs { font-size: 12px; color: var(--ink-3); margin-bottom: 16px; display: flex; flex-wrap: wrap; gap: 6px; }
.crumbs a:hover { color: var(--espresso); }
.page-head h1 { font-size: clamp(40px, 5.4vw, 72px); font-weight: 300; }
.page-head p { color: var(--ink-2); margin-top: 12px; max-width: 56ch; font-size: 16px; }

/* ---------- Category page ----------------------------------------------- */
.toolbar {
  position: sticky; top: calc(var(--header-h) + 46px); z-index: 20;
  background: rgba(247,243,238,.96); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  border-block: 1px solid var(--line); margin-bottom: 36px;
}
.toolbar .container { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 60px; flex-wrap: wrap; padding-block: 8px; }
.filters { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; }
.filter-label { font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-3); margin-right: 4px; }
.pill { position: relative; }
.pill input { position: absolute; opacity: 0; inset: 0; cursor: pointer; margin: 0; }
.pill span {
  display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 14px;
  border: 1px solid var(--line-strong); border-radius: 999px; font-size: 13px; color: var(--ink-2);
  transition: all .2s; user-select: none;
}
.pill span::before {
  content: ""; width: 12px; height: 12px; border: 1px solid var(--line-strong); border-radius: 2px; transition: all .2s;
  background: var(--paper) center/10px no-repeat;
}
.pill input:checked + span { border-color: var(--espresso); color: var(--espresso); background: var(--paper); }
.pill input:checked + span::before {
  background-color: var(--espresso); border-color: var(--espresso);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M2.5 6.2 5 8.5l4.5-5' fill='none' stroke='%23F7F3EE' stroke-width='1.6'/%3E%3C/svg%3E");
}
.pill input:focus-visible + span { outline: 2px solid var(--sand-deep); outline-offset: 2px; }
.divider-v { width: 1px; height: 22px; background: var(--line); margin: 0 6px; }
.select {
  appearance: none; -webkit-appearance: none;
  height: 36px; padding: 0 34px 0 14px; border: 1px solid var(--line-strong); border-radius: 999px;
  background: var(--cream) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='m1 1.5 5 5 5-5' fill='none' stroke='%231C1917' stroke-width='1.3'/%3E%3C/svg%3E") right 13px center/10px no-repeat;
  font-size: 13px; color: var(--espresso); cursor: pointer;
}
.toolbar-right { display: flex; align-items: center; gap: 14px; }
.result-count { font-size: 13px; color: var(--ink-3); white-space: nowrap; }
.clear-filters { font-size: 12.5px; color: var(--ink-2); border-bottom: 1px solid var(--line-strong); }
.no-results { grid-column: 1 / -1; text-align: center; padding: 72px 16px; color: var(--ink-2); }
.no-results h3 { font-size: 26px; color: var(--espresso); margin-bottom: 8px; }

.subcats { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 22px; }
.subcats a { font-size: 13px; padding: 7px 14px; border: 1px solid var(--line); border-radius: 999px; color: var(--ink-2); transition: all .2s; }
.subcats a:hover { border-color: var(--espresso); color: var(--espresso); }

/* ---------- Product page ------------------------------------------------- */
.pdp { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: clamp(28px, 5vw, 80px); padding-block: 24px 80px; align-items: start; }
.gallery { display: grid; grid-template-columns: 76px minmax(0,1fr); gap: 14px; position: sticky; top: calc(var(--header-h) + 64px); }
.thumbs { display: flex; flex-direction: column; gap: 10px; max-height: 640px; overflow-y: auto; scrollbar-width: none; }
.thumbs::-webkit-scrollbar { display: none; }
.thumbs button { flex-shrink: 0; aspect-ratio: 4/5; background: var(--tile); border: 1px solid transparent; overflow: hidden; transition: border-color .2s, opacity .2s; opacity: .7; }
.thumbs button:hover { opacity: 1; }
.thumbs button[aria-current="true"] { border-color: var(--espresso); opacity: 1; }
.thumbs img { width: 100%; height: 100%; object-fit: cover; mix-blend-mode: multiply; }
.main-image { position: relative; aspect-ratio: 4/5; background: var(--tile); overflow: hidden; }
.main-image img { width: 100%; height: 100%; object-fit: cover; mix-blend-mode: multiply; transition: opacity .35s var(--ease); }
.main-image img.swapping { opacity: 0; }

.buybox { max-width: 520px; }
.buybox h1 { font-size: clamp(30px, 3vw, 42px); font-weight: 350; margin: 10px 0 12px; }
.buybox .price { font-size: 18px; }
.buybox .price .save { font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--sale); margin-left: 10px; }
.buybox .desc { color: var(--ink-2); margin-top: 18px; font-size: 14.5px; }
.opt-block { margin-top: 28px; }
.opt-label { display: flex; justify-content: space-between; font-size: 13px; margin-bottom: 12px; }
.opt-label b { font-weight: 500; }
.opt-label span { color: var(--ink-2); }
.swatches { display: flex; flex-wrap: wrap; gap: 10px; }
.swatch {
  width: 52px; height: 52px; border-radius: 50%; padding: 3px; border: 1px solid transparent; transition: border-color .2s;
}
.swatch span { display: block; width: 100%; height: 100%; border-radius: 50%; overflow: hidden; background: var(--tile); }
.swatch img { width: 100%; height: 100%; object-fit: cover; transform: scale(1.6); mix-blend-mode: multiply; }
.swatch:hover { border-color: var(--line-strong); }
.swatch[aria-checked="true"] { border-color: var(--espresso); }

/* Personalization module */
.personalize { margin-top: 28px; border: 1px solid var(--line-strong); background: var(--paper); }
.p-toggle {
  display: flex; align-items: center; justify-content: space-between; gap: 16px; width: 100%;
  padding: 16px 18px; text-align: left;
}
.p-toggle .t { display: flex; gap: 12px; align-items: center; }
.p-toggle .t svg { width: 22px; height: 22px; stroke: var(--sand-deep); fill: none; stroke-width: 1.3; flex-shrink: 0; }
.p-toggle .t b { display: block; font-weight: 500; font-size: 14px; }
.p-toggle .t small { display: block; font-size: 12.5px; color: var(--ink-2); }
.switch { position: relative; width: 42px; height: 24px; border-radius: 12px; background: var(--line-strong); transition: background .25s; flex-shrink: 0; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.2); transition: transform .3s var(--ease); }
.p-toggle[aria-checked="true"] .switch { background: var(--espresso); }
.p-toggle[aria-checked="true"] .switch::after { transform: translateX(18px); }
.p-panel { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .45s var(--ease); }
.p-panel.open { grid-template-rows: 1fr; }
.p-panel > .p-inner { overflow: hidden; }
.p-content { padding: 4px 18px 20px; border-top: 1px solid var(--line); }
.p-step { margin-top: 18px; }
.p-step-title { font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-3); margin-bottom: 10px; }
.seg { display: grid; grid-template-columns: 1fr 1fr; border: 1px solid var(--line-strong); }
.seg label { position: relative; cursor: pointer; }
.seg input { position: absolute; opacity: 0; }
.seg span { display: flex; flex-direction: column; align-items: center; padding: 11px 8px; font-size: 13.5px; transition: all .2s; text-align: center; }
.seg span small { font-size: 12px; color: var(--ink-3); }
.seg label + label span { border-left: 1px solid var(--line-strong); }
.seg input:checked + span { background: var(--espresso); color: var(--cream); }
.seg input:checked + span small { color: #CFC3B4; }
.seg input:focus-visible + span { outline: 2px solid var(--sand-deep); outline-offset: -3px; }

.field { display: block; }
.field-input {
  width: 100%; height: 48px; padding: 0 14px; background: var(--cream);
  border: 1px solid var(--line-strong); border-radius: var(--radius); font-size: 15px; transition: border-color .2s;
}
.field-input:focus { outline: none; border-color: var(--espresso); }
textarea.field-input { height: auto; min-height: 130px; padding: 12px 14px; resize: vertical; }
.field-row { display: flex; justify-content: space-between; margin-top: 6px; font-size: 12px; color: var(--ink-3); }
.field-row .err { color: var(--sale); }
.counter.near { color: var(--sand-deep); }

.file-drop {
  display: flex; align-items: center; gap: 14px; padding: 14px; border: 1px dashed var(--line-strong); background: var(--cream); cursor: pointer; transition: border-color .2s;
}
.file-drop:hover { border-color: var(--espresso); }
.file-drop input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.file-drop .thumb { width: 56px; height: 56px; background: var(--tile); display: grid; place-items: center; flex-shrink: 0; overflow: hidden; }
.file-drop .thumb img { width: 100%; height: 100%; object-fit: cover; }
.file-drop .thumb svg { width: 22px; height: 22px; stroke: var(--ink-3); fill: none; stroke-width: 1.4; }
.file-drop b { font-weight: 500; font-size: 13.5px; display: block; }
.file-drop small { font-size: 12px; color: var(--ink-3); }
.file-note { font-size: 12px; color: var(--ink-2); margin-top: 8px; line-height: 1.55; }
.file-warn { font-size: 12px; color: var(--sand-deep); margin-top: 6px; }

.style-chip { display: inline-flex; align-items: center; gap: 8px; padding: 9px 14px; border: 1px solid var(--espresso); font-size: 13px; background: var(--cream); }
.style-chip::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--espresso); }
.placement { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink-2); }
.placement svg { width: 16px; height: 16px; stroke: var(--sand-deep); fill: none; stroke-width: 1.4; }
.preview-wrap { margin-top: 20px; background: var(--tile); padding: 26px 16px 18px; display: flex; flex-direction: column; align-items: center; }
.preview-wrap .patch { --w: 260px; }
.p-final { font-size: 12px; color: var(--ink-3); margin-top: 14px; }

.add-row { display: grid; grid-template-columns: auto 1fr; gap: 12px; margin-top: 24px; }
.add-row .qty { height: 52px; }
.add-row .qty button { width: 40px; }
.add-row .btn { min-height: 52px; }
.assure { margin-top: 18px; display: grid; gap: 8px; font-size: 13px; color: var(--ink-2); }
.assure div { display: flex; gap: 10px; align-items: center; }
.assure svg { width: 17px; height: 17px; stroke: var(--ink-2); fill: none; stroke-width: 1.3; flex-shrink: 0; }

.accordion { margin-top: 32px; border-top: 1px solid var(--line); }
.accordion details { border-bottom: 1px solid var(--line); }
.accordion summary { list-style: none; display: flex; justify-content: space-between; align-items: center; padding: 16px 0; cursor: pointer; font-size: 14px; font-weight: 500; }
.accordion summary::-webkit-details-marker { display: none; }
.accordion summary::after { content: "+"; font-weight: 300; font-size: 20px; color: var(--ink-2); transition: transform .3s; }
.accordion details[open] summary::after { transform: rotate(45deg); }
.accordion .acc-body { padding-bottom: 18px; color: var(--ink-2); font-size: 14px; }
.accordion .acc-body ul { margin: 0; padding-left: 18px; }

.not-found { text-align: center; padding: 120px 16px; }
.not-found h1 { font-size: 48px; margin-bottom: 12px; }
.not-found p { color: var(--ink-2); margin-bottom: 28px; }

/* ---------- About ------------------------------------------------------- */
.about-hero { position: relative; min-height: 440px; display: flex; align-items: flex-end; color: var(--cream); overflow: hidden; background: #2A211B; }
.about-hero img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 80% 50%; }
.about-hero::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(24,18,14,.75), rgba(24,18,14,.15) 70%); }
.about-hero .container { position: relative; z-index: 1; padding-block: 64px; }
.about-hero h1 { font-size: clamp(42px, 6vw, 84px); font-weight: 300; max-width: 13ch; }
.about-hero .eyebrow { color: #E2D3BF; margin-bottom: 14px; }
.prose { max-width: 700px; margin: 0 auto; }
.prose .big { font-family: var(--serif); font-size: clamp(24px, 2.6vw, 34px); line-height: 1.3; font-weight: 350; margin-bottom: 28px; }
.prose p { color: var(--ink-2); font-size: 16.5px; margin-bottom: 18px; line-height: 1.75; }
.pillars { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--line); border-block: 1px solid var(--line); }
.pillars > div { background: var(--cream); padding: clamp(28px, 4vw, 48px); }
.pillars .num { font-family: var(--serif); font-style: italic; color: var(--sand-deep); font-size: 18px; }
.pillars h3 { font-size: 26px; margin: 12px 0 10px; }
.pillars p { color: var(--ink-2); font-size: 14.5px; }
.split-img { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.split-img div { aspect-ratio: 4/5; overflow: hidden; background: var(--tile); }
.split-img img { width: 100%; height: 100%; object-fit: cover; }

/* ---------- Contact ----------------------------------------------------- */
.contact { display: grid; grid-template-columns: 1fr 1.3fr; gap: clamp(32px, 6vw, 96px); padding-bottom: 96px; }
.contact-aside h2 { font-size: 26px; margin-bottom: 10px; }
.contact-aside p { color: var(--ink-2); margin-bottom: 22px; }
.contact-aside .mail { font-family: var(--serif); font-size: clamp(22px, 2.2vw, 30px); border-bottom: 1px solid var(--line-strong); }
.contact-aside .mail:hover { color: var(--sand-deep); }
.faq { margin-top: 44px; }
.faq h3 { font-size: 11px; font-family: var(--sans); letter-spacing: .14em; text-transform: uppercase; color: var(--ink-3); margin-bottom: 6px; }
.form { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.form .full { grid-column: 1 / -1; }
.form label > span { display: block; font-size: 12px; letter-spacing: .06em; color: var(--ink-2); margin-bottom: 7px; }
.form select.field-input { appearance: none; background: var(--cream) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='m1 1.5 5 5 5-5' fill='none' stroke='%231C1917' stroke-width='1.3'/%3E%3C/svg%3E") right 14px center/10px no-repeat; }
.form .field-input.invalid { border-color: var(--sale); }
.form-success { display: none; padding: 40px; background: var(--paper); border: 1px solid var(--line); text-align: center; }
.form-success.show { display: block; animation: fadeUp .5s var(--ease); }
.form-success h3 { font-size: 30px; margin-bottom: 10px; }
.form-success p { color: var(--ink-2); }

/* ---------- Footer ------------------------------------------------------ */
.site-footer { background: var(--espresso); color: #CFC6BA; padding-top: clamp(56px, 7vw, 96px); margin-top: 0; }
.footer-top { display: grid; grid-template-columns: 1.4fr repeat(2, 1fr) 1.5fr; gap: 40px; padding-bottom: 56px; border-bottom: 1px solid #36302B; }
.site-footer .wordmark { color: var(--cream); font-size: 34px; }
.site-footer .wordmark .amp { color: var(--sand); }
.footer-brand p { margin-top: 16px; font-size: 13.5px; max-width: 30ch; color: #A89F94; }
.footer-brand .mail { display: inline-block; margin-top: 18px; color: var(--cream); border-bottom: 1px solid #5B524A; font-size: 14px; }
.footer-brand .mail:hover { border-color: var(--sand); }
.site-footer h4 { font-family: var(--sans); font-size: 11px; letter-spacing: .16em; text-transform: uppercase; color: #8C837A; margin-bottom: 16px; font-weight: 500; }
.site-footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 9px; font-size: 13.5px; }
.site-footer ul a:hover { color: var(--cream); }
.newsletter p { font-size: 13.5px; margin-bottom: 16px; color: #A89F94; }
.newsletter form { display: flex; border-bottom: 1px solid #5B524A; }
.newsletter input { flex: 1; min-width: 0; background: transparent; border: 0; padding: 12px 0; color: var(--cream); font-size: 14px; }
.newsletter input::placeholder { color: #7D746B; }
.newsletter input:focus { outline: none; }
.newsletter button { font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--cream); padding-left: 12px; }
.newsletter button:hover { color: var(--sand); }
.newsletter .ok { font-size: 13px; color: var(--sand); margin-top: 10px; min-height: 20px; }
.socials { display: flex; gap: 10px; margin-top: 22px; }
.socials a { width: 38px; height: 38px; border: 1px solid #453E38; border-radius: 50%; display: grid; place-items: center; transition: all .2s; }
.socials a:hover { border-color: var(--sand); color: var(--cream); }
.socials svg { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 1.4; }
.footer-bottom { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px; padding-block: 22px 28px; font-size: 12px; color: #7D746B; }

/* ---------- Responsive -------------------------------------------------- */
@media (max-width: 1180px) {
  .product-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .rail { grid-auto-columns: calc((100% - 40px) / 3); }
  .footer-top { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 1023px) {
  :root { --header-h: 58px; }
  .cat-nav { display: none; }
  .menu-toggle { display: inline-grid; }
  .header-util { display: none; }
  .wordmark { font-size: 25px; }
  .toolbar { top: var(--header-h); }
  .pdp { grid-template-columns: 1fr; }
  .gallery { position: static; grid-template-columns: 1fr; }
  .thumbs { order: 2; flex-direction: row; max-height: none; overflow-x: auto; }
  .thumbs button { width: 64px; flex-shrink: 0; }
  .buybox { max-width: none; }
  .engrave-band .inner, .story { grid-template-columns: 1fr; }
  .values ul { grid-template-columns: repeat(2, 1fr); }
  .values li:nth-child(2) { border-right: 0; }
  .values li:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .contact { grid-template-columns: 1fr; }
  .pillars { grid-template-columns: 1fr; }
}
@media (max-width: 767px) {
  body { font-size: 14.5px; }
  .product-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 28px 12px; }
  .rail { grid-auto-columns: 66%; gap: 12px; }
  .rail-nav { display: none; }
  .cat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .cat-tile h3 { font-size: 17px; }
  .cat-tile .count { display: none; }
  .card-name { font-size: 13px; }
  .card-meta { flex-direction: column; gap: 0; }
  .card-quick { display: none; }
  .badge { top: 8px; left: 8px; font-size: 9px; padding: 4px 6px; }
  .badge.engrave { right: 8px; }
  .section-head { flex-direction: column; align-items: flex-start; }
  .hero { min-height: 600px; }
  .hero-media img { object-position: 70% 30%; }
  .hero::after { background: linear-gradient(0deg, rgba(24,18,14,.85) 0%, rgba(24,18,14,.4) 55%, rgba(24,18,14,.1) 100%); }
  .hero-cta .btn { flex: 1 1 auto; }
  .toolbar .container { gap: 10px; }
  .filters { width: 100%; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
  .filters::-webkit-scrollbar { display: none; }
  .filters > * { flex-shrink: 0; }
  .toolbar-right { width: 100%; justify-content: space-between; }
  .form { grid-template-columns: 1fr; }
  .split-img { grid-template-columns: 1fr; }
  .footer-top { grid-template-columns: 1fr; gap: 36px; }
  .drawer-body, .drawer-head, .drawer-foot { padding-inline: 18px; }
  .add-row { grid-template-columns: 1fr; }
  .add-row .qty { justify-self: start; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
