/* Carat & Grace — base layer: reset, type scale, and the primitives every screen reuses
   (eyebrow, display headings, buttons, links, chips, pills, inputs, price, star row, shimmer).
   Values measured off the Figma frames. */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--cg-pearl);
  color: var(--cg-text);
  font-family: var(--cg-sans);
  font-size: 15px;
  font-weight: 400;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;              /* the brief requires 0 horizontal page scroll at every width */
}
img, svg, video { 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; }
:where(h1,h2,h3,h4,h5,h6) { margin: 0; font-weight: 400; }
p { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
[hidden] { display: none !important; }

/* every image shimmers until it has loaded (snippets/cng-img-shimmer marks it data-cg-ld when it has, or
   when it failed). Drawn as the image's own background, so it fills exactly the box the image will fill —
   a card photo, a menu tile, a 22px badge icon — and needs no wrapper. */
img:not([data-cg-ld]) {
  background-color: var(--cg-image);
  background-image: linear-gradient(100deg, rgba(255,255,255,0) 35%, rgba(255,255,255,.6) 50%, rgba(255,255,255,0) 65%);
  background-size: 300% 100%; background-repeat: no-repeat;
  animation: cg-img-sheen 1.3s linear infinite;
}
@keyframes cg-img-sheen { from { background-position: 100% 0; } to { background-position: 0 0; } }
@media (prefers-reduced-motion: reduce) { img:not([data-cg-ld]) { animation: none; background-image: none; } }

/* a visible focus ring — the design has none, so this is ours and must not change the layout */
:focus-visible { outline: 2px solid var(--cg-rose); outline-offset: 2px; }
.cg-sr { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* ---------------------------------------------------------------- wrap */
.cg-wrap { width: 100%; max-width: var(--cg-max); margin-inline: auto; padding-inline: var(--cg-gutter); }

/* ---------------------------------------------------------------- type scale
   Figma text styles. letterSpacing in the file is a percent, converted to em here. */
.cg-eyebrow {
  font-family: var(--cg-sans); font-weight: 500; font-size: 11px; line-height: 1.3;
  letter-spacing: 0.18em; text-transform: uppercase; color: var(--cg-accent);
}
.cg-label {
  font-weight: 500; font-size: 11px; line-height: 1.3; letter-spacing: 0.14em; text-transform: uppercase;
}
.cg-caption {
  font-weight: 500; font-size: 10px; line-height: 1.3; letter-spacing: 0.14em; text-transform: uppercase;
}
.cg-nav-t { font-weight: 400; font-size: 12px; line-height: 1; letter-spacing: 0.14em; text-transform: uppercase; }
.cg-small { font-size: 13px; line-height: 1.5; }
.cg-small-strong { font-size: 13px; line-height: 1.5; font-weight: 500; }
.cg-body-l { font-size: 18px; font-weight: 300; line-height: 1.6; }
.cg-body-strong { font-size: 15px; font-weight: 500; line-height: 1.6; }
.cg-muted { color: var(--cg-text-2); }

/* display headings — Playfair. The prototype's two-line headings put the second word in italic rose
   on some sections; that is per-section, never global. */
.cg-d1, .cg-d2, .cg-d3, .cg-d4 { font-family: var(--cg-display); font-weight: 400; }
.cg-d1 { font-size: clamp(40px, 4.65vw, 67px); line-height: 1.0; letter-spacing: -0.01em; }
.cg-d2 { font-size: clamp(33px, 4.03vw, 58px); line-height: 1.0; letter-spacing: -0.01em; }
.cg-d3 { font-size: clamp(31px, 3.47vw, 50px); line-height: 1.04; letter-spacing: -0.01em; }
.cg-d4 { font-size: clamp(27px, 1.94vw, 28px); line-height: 1.18; letter-spacing: -0.018em; }
.cg-it { font-style: italic; color: var(--cg-rose); }

/* ---------------------------------------------------------------- buttons */
.cg-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 22px;
  font-family: var(--cg-sans); font-weight: 500; font-size: 12px; line-height: 1;
  letter-spacing: 0.16em; text-transform: uppercase;
  background: var(--cg-onyx); color: var(--cg-inverse);
  border: 1px solid var(--cg-onyx); border-radius: 0;
  transition: background .2s ease, color .2s ease, border-color .2s ease;
}
.cg-btn:hover { background: var(--cg-plum); border-color: var(--cg-plum); }
.cg-btn--rose { background: var(--cg-rose); border-color: var(--cg-rose); }
.cg-btn--rose:hover { background: var(--cg-accent); border-color: var(--cg-accent); }
.cg-btn--ghost { background: transparent; color: var(--cg-text); border-color: var(--cg-line-strong); }
.cg-btn--ghost:hover { background: var(--cg-onyx); color: var(--cg-inverse); }
.cg-btn--light { background: transparent; color: var(--cg-inverse); border-color: var(--cg-inverse); }
.cg-btn--light:hover { background: var(--cg-inverse); color: var(--cg-onyx); }
.cg-btn--block { width: 100%; }
.cg-btn--tall { min-height: 54px; }
.cg-btn[disabled], .cg-btn[aria-disabled='true'] { opacity: .45; cursor: not-allowed; }

/* link with the rose underline that grows on hover (the prototype's Link/… component) */
.cg-link {
  position: relative; display: inline-flex; align-items: center; gap: 8px;
  font-size: 13px; line-height: 1.5; font-weight: 500;
}
.cg-link::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: -3px; height: 1.5px;
  background: var(--cg-rose); transform: scaleX(0); transform-origin: left; transition: transform .25s ease;
}
.cg-link:hover::after { transform: scaleX(1); }
.cg-link--arrow::before { content: ''; }

/* ---------------------------------------------------------------- chips / pills */
.cg-chip {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 42px; padding: 0 16px;
  border: 1px solid var(--cg-line); background: var(--cg-white);
  font-size: 13px; line-height: 1.5;
  transition: border-color .18s ease, background .18s ease;
}
.cg-chip:hover { border-color: var(--cg-rose); }
.cg-chip[aria-pressed='true'], .cg-chip.is-on, .cg-chip[aria-current='true'] {
  border-color: var(--cg-line-strong); background: var(--cg-porcelain);
}
.cg-chip--sm { min-height: 36px; padding: 0 12px; font-size: 12px; }

/* ---------------------------------------------------------------- price */
.cg-price { font-weight: 500; font-size: 15px; line-height: 1.3; }
.cg-price-was { color: var(--cg-text-2); text-decoration: line-through; margin-left: 10px; font-weight: 400; }
.cg-price-save {
  display: inline-block; margin-left: 10px; padding: 4px 8px;
  background: var(--cg-blush); color: var(--cg-sale);
  font-size: 10px; font-weight: 500; letter-spacing: 0.14em; text-transform: uppercase;
}

/* ---------------------------------------------------------------- stars */
.cg-stars { display: inline-flex; gap: 2px; }
.cg-stars svg { width: 14px; height: 14px; fill: var(--cg-champagne); }

/* ---------------------------------------------------------------- media frame + shimmer
   Product photos sit on surface/image so a missing photo never flashes white. The shimmer is used
   by the card metal swap (PHASE B) while a sibling's photo loads. */
.cg-media { position: relative; overflow: hidden; background: var(--cg-image); }
.cg-media > img { width: 100%; height: 100%; object-fit: cover; }
.cg-media--4x5 { aspect-ratio: 4 / 5; }
.cg-media--1x1 { aspect-ratio: 1 / 1; }
.cg-shimmer::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.55), transparent);
  animation: cg-sheen 1.1s linear infinite;
}
@keyframes cg-sheen { from { transform: translateX(-100%); } to { transform: translateX(100%); } }
@media (prefers-reduced-motion: reduce) {
  .cg-shimmer::after { animation: none; }
  * { scroll-behavior: auto !important; }
}

/* the wordmark placeholder a product with no photo gets (never another product's picture) */
.cg-ph {
  position: absolute; inset: 0; display: grid; place-content: center; gap: 6px;
  background: var(--cg-image); text-align: center; padding: 12%;
}
/* LOGO-SET: the tile carries the real lockup now, so it is sized by width (the artwork keeps its own
   ratio) instead of by font-size — the old type rules went with the <span> they styled. The cap is the
   same 158px the header draws, so a wide tile looks as it did; a narrow card tile (two-up on a phone) can
   only ever shrink it, never overflow. Specificity beats .cg-logo__img's height, which is why it is
   written as .cg-ph .cg-ph__mark. */
.cg-ph .cg-ph__mark { width: min(100%, 158px); height: auto; margin-inline: auto; }
.cg-ph__sub { font-size: 9px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--cg-text-2); }
.cg-media { container-type: inline-size; }

/* ---------------------------------------------------------------- section rhythm */
.cg-sec { padding-block: 120px; }
.cg-sec--tight { padding-block: 80px; }
@media (max-width: 1023px) { .cg-sec { padding-block: 88px; } .cg-sec--tight { padding-block: 60px; } }
@media (max-width: 767px) { .cg-sec { padding-block: 64px; } .cg-sec--tight { padding-block: 44px; } }

/* horizontal scrollers (mobile rails) */
.cg-rail { display: flex; gap: 12px; overflow-x: auto; scroll-snap-type: x mandatory; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
.cg-rail::-webkit-scrollbar { display: none; }
.cg-rail > * { scroll-snap-align: start; flex: 0 0 auto; }

/* shape tile — 143x79 in the prototype's collection filter */
.cg-stile {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  padding: 14px 22px 12px; border: 1px solid var(--cg-line); background: transparent;
  color: var(--cg-text); transition: border-color .18s ease, background .18s ease;
}
.cg-stile:hover { border-color: var(--cg-rose); }
.cg-stile.is-on { border-color: var(--cg-line-strong); background: var(--cg-white); }
.cg-stile .cg-caption { color: inherit; white-space: nowrap; }
.cg-sh { flex: 0 0 auto; }

/* round prev/next control (48px in the prototype) */
.cg-arrow {
  display: inline-flex; align-items: center; justify-content: center;
  width: 48px; height: 48px; border: 1px solid var(--cg-line); background: var(--cg-white);
  transition: border-color .18s ease, background .18s ease;
}
.cg-arrow:hover { border-color: var(--cg-line-strong); }
.cg-arrow[disabled] { opacity: .35; }
.cg-arrow svg { width: 14px; height: 14px; }

/* shapes = real diamond photos (snippets/cng-shape, user 2026-10-25): a cut-out stone on a clear ground, never
   stretched, a touch of contrast so the white stone reads on pearl and white tiles */
img.cg-sh--dia { display: block; object-fit: contain; filter: contrast(1.06) drop-shadow(0 1px 1.5px rgba(30, 22, 32, .14)); }
.cg-ref__o img.cg-sh--dia { flex: 0 0 24px; margin-right: 2px; }
/* fancy-colour diamonds (header Fancy Colour, builder colour chips): the real stone, a little larger than the drawn gems */
img.cg-gem--dia { width: 18px; height: 18px; flex: 0 0 18px; object-fit: contain; filter: drop-shadow(0 1px 1px rgba(30, 22, 32, .16)); }
