/* ==========================================================================
   LORELACE — Design System
   Premium boutique POD storefront. Editorial, grounded, dark.
   Deep petrol + warm clay. Lace as thread, never wallpaper.
   Palette source: https://colorhunt.co/palette/0f3040464858a56f63d99b7f
   (published: #0F3040 #464858 #A56F63 #D99B7F; surface tints derived)
   ========================================================================== */

/* Fraunces + Karla are the UI faces. Bebas Neue / Nunito / Caveat are NOT UI —
   they mirror the Pillow compositor's text_overlays.font_style and are what
   gets printed on the garment, so they stay regardless of any UI type change. */
@import url('https://fonts.googleapis.com/css2?family=Fraunces:ital,opsz,wght@0,9..144,400;0,9..144,500;0,9..144,600;1,9..144,400&family=Karla:ital,wght@0,400;0,500;0,600;1,400&family=Bebas+Neue&family=Nunito:wght@400;700&family=Caveat:wght@400;700&display=swap');

/* --------------------------------------------------------------------------
   1. Tokens
   -------------------------------------------------------------------------- */
:root {
  /* Palette */
  /* Published clay #A56F63 is a mid-tone: white on it is 4.16:1 and dark is
     3.33:1, so it fails AA either way as a button base. The button surface
     steps one shade down; the published value lives on as --gold-deep. */
  --sage:        #8D5C52;   /* white label = 5.55:1 */
  --sage-deep:   #74483F;
  --sage-ink:    #D99B7F;   /* light enough to be a link on --cream */
  --sage-pale:   #3A4A50;
  --sage-mist:   #1B3A4A;
  --gold:        #D99B7F;   /* published warm sand — the accent/CTA surface */
  --gold-deep:   #A56F63;
  --gold-pale:   #43424A;
  --gold-mist:   #243F4E;
  --cream:       #0F3040;   /* published — the page canvas. Dark. */
  --surface:     #173C4E;   /* cards, one step up from canvas */
  --surface-2:   #21495C;
  --ink:         #F1E7E2;   /* 12.4:1 on --cream */
  --ink-soft:    #D6C4BC;
  --ink-mute:    #A9B3BC;   /* 5.9:1 on --cream */
  /* Form fields keep a WHITE background, so their text must contrast the
     field, not the canvas — --ink on #fff is near-invisible. 14.6:1 on #fff. */
  --field-ink:   #1F2B33;
  --field-mute:  #66757F;   /* placeholders on the white field, 4.6:1 */
  --sand:        #2C5266;   /* hairlines / dividers */
  --sand-soft:   #21495C;
  /* Swatch ring: a garment chip's boundary IS its identity, so it needs 3:1
     against the panel behind it (WCAG 1.4.11). --sand manages only 1.27:1 and
     let white/butter garments vanish; this is deliberately darker.
     3.46:1 on --cream · 3.40:1 on --surface · 3.21:1 on --surface-2. */
  --swatch-ring: #8FA3AF;
  /* Button label inks. Tokenised because whether a label is light or dark
     depends on the palette's brand-surface value, not on the button. */
  --on-sage:      #fff;
  --on-gold:      #0F3040;
  --on-gold-deep: #fff;
  /* Translucent chrome (sticky header, preview chips, mobile band). These were
     hardcoded cream rgba() and survived two palette swaps as a light band on a
     dark page — hence the tokens. Alphas differ, so one token each. */
  --glass-strong: rgba(15, 48, 64, 0.92);
  --glass-soft:   rgba(15, 48, 64, 0.85);
  --glass-solid:  rgba(15, 48, 64, 0.97);
  --glass-sheen:  rgba(45, 82, 100, 0.75);
  --rose:        #A33B46;
  --rose-pale:   #F3DEE0;

  /* Typography */
  --font-serif: 'Fraunces', Georgia, 'Times New Roman', serif;
  --font-sans:  'Karla', system-ui, -apple-system, 'Segoe UI', sans-serif;

  /* Text-overlay fonts — mirror the Pillow compositor's text_overlays.font_style
     (display|body|script). Driven by JS via inline style, but the family stacks
     live here as the single source of truth. */
  --font-overlay-display: 'Bebas Neue', var(--font-sans);
  --font-overlay-body:    'Nunito', var(--font-sans);
  --font-overlay-script:  'Caveat', var(--font-serif);

  /* Fluid type scale */
  --text-xs:   0.8125rem;                            /* 13px */
  --text-sm:   0.875rem;                             /* 14px */
  --text-base: 1rem;                                 /* 16px — never below for inputs */
  --text-md:   1.0625rem;
  --text-lg:   clamp(1.125rem, 1rem + 0.5vw, 1.3125rem);
  --text-xl:   clamp(1.375rem, 1.2rem + 0.9vw, 1.75rem);
  --text-2xl:  clamp(1.75rem, 1.4rem + 1.6vw, 2.5rem);
  --text-3xl:  clamp(2.125rem, 1.6rem + 2.4vw, 3.25rem);

  /* Spacing — 4px base, no arbitrary values */
  --sp-1: 4px;  --sp-2: 8px;   --sp-3: 12px; --sp-4: 16px;
  --sp-5: 20px; --sp-6: 24px;  --sp-8: 32px; --sp-10: 40px;
  --sp-12: 48px; --sp-16: 64px; --sp-20: 80px; --sp-24: 96px;

  /* Radius */
  --r-sm: 6px; --r-md: 10px; --r-lg: 16px; --r-xl: 24px; --r-pill: 999px;

  /* Shadows — warm, never gray */
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.08), 0 2px 4px rgba(0, 0, 0, 0.04);
  --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.12), 0 4px 8px rgba(0, 0, 0, 0.05);
  --shadow-gold: 0 4px 20px rgba(228, 176, 40, 0.28);

  /* Z-index scale */
  --z-raised: 5;
  --z-dropdown: 10;
  --z-sticky: 50;
  --z-modal: 100;
  --z-toast: 110;

  /* Motion */
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --speed: 0.25s;

  /* Layout */
  --container: 1200px;
  --header-h: 72px;
}

/* --------------------------------------------------------------------------
   2. Reset & base
   -------------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: 1.6;
  color: var(--ink);
  background-color: var(--cream);
  overflow-x: hidden;
  max-width: 100vw;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img, svg, video { display: block; max-width: 100%; }

/* [hidden] must always win, even over display:flex/grid component rules */
[hidden] { display: none !important; }

h1, h2, h3, h4 {
  font-family: var(--font-serif);
  font-weight: 400;
  line-height: 1.2;
  margin: 0 0 var(--sp-4);
  color: var(--ink);
  text-wrap: balance;
}

h1 { font-size: var(--text-3xl); letter-spacing: -0.01em; }
h2 { font-size: var(--text-2xl); letter-spacing: -0.005em; }
h3 { font-size: var(--text-xl); }
h4 { font-size: var(--text-lg); }

p { margin: 0 0 var(--sp-4); }

a {
  color: var(--sage-ink);
  text-decoration: none;
  transition: color var(--speed) var(--ease-out);
}
a:hover { color: var(--gold-deep); }

button {
  font-family: inherit;
  font-size: inherit;
  cursor: pointer;
  border: none;
  background: none;
  color: inherit;
}

/* Custom focus — champagne gold, never browser blue */
:focus { outline: none; }
:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
  border-radius: var(--r-sm);
}

::selection { background: var(--gold-pale); color: var(--ink); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* --------------------------------------------------------------------------
   3. Layout utilities
   -------------------------------------------------------------------------- */
.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding-inline: var(--sp-5);
}
@media (min-width: 768px) {
  .container { padding-inline: var(--sp-8); }
}

.section { padding-block: var(--sp-16); }
@media (min-width: 768px) {
  .section { padding-block: var(--sp-20); }
}

.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* Eyebrow label — small caps accent above headings */
.eyebrow {
  display: block;
  font-size: var(--text-xs);
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gold-deep);
  margin-bottom: var(--sp-3);
}

/* Subtle lace net texture — hero / accent sections only, never full-page */
.texture-lace { position: relative; }
.texture-lace::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='72' height='72' viewBox='0 0 72 72'%3E%3Cg fill='none' stroke='%237A9E7E' stroke-width='0.7'%3E%3Ccircle cx='36' cy='36' r='14'/%3E%3Ccircle cx='36' cy='36' r='26'/%3E%3Cpath d='M0 36 Q18 22 36 36 T72 36'/%3E%3Cpath d='M36 0 Q22 18 36 36 T36 72'/%3E%3C/g%3E%3Cg fill='%23C9A84C'%3E%3Ccircle cx='36' cy='10' r='1.1'/%3E%3Ccircle cx='36' cy='62' r='1.1'/%3E%3Ccircle cx='10' cy='36' r='1.1'/%3E%3Ccircle cx='62' cy='36' r='1.1'/%3E%3C/g%3E%3C/svg%3E");
  background-size: 72px 72px;
}
.texture-lace > * { position: relative; }

/* Lace-thread divider — thin lines meeting a small ornament */
.lace-divider {
  display: flex;
  align-items: center;
  gap: var(--sp-4);
  margin-block: var(--sp-10);
  border: none;
}
.lace-divider::before,
.lace-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: linear-gradient(to var(--dir, right), transparent, var(--sand));
}
.lace-divider::before { --dir: right; }
.lace-divider::after  { --dir: left; }
.lace-divider .ornament { flex: none; color: var(--gold); }

/* --------------------------------------------------------------------------
   4. Header & navigation
   -------------------------------------------------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: var(--z-sticky);
  background: var(--glass-strong);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--sand-soft);
}

.site-header .container {
  display: flex;
  align-items: center;
  gap: var(--sp-6);
  min-height: var(--header-h);
}

.brand {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  color: var(--ink);
  min-height: 44px;
}
.brand:hover { color: var(--ink); }
.brand svg { flex: none; }
.brand-name {
  font-family: var(--font-serif);
  font-size: 1.5rem;
  letter-spacing: 0.02em;
  line-height: 1;
}
.brand-name .accent { color: var(--gold-deep); }

.main-nav {
  display: none;
  align-items: center;
  gap: var(--sp-2);
  margin-inline-start: var(--sp-4);
}
@media (min-width: 900px) {
  .main-nav { display: flex; }
}

.nav-link {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-1);
  min-height: 44px;
  padding: var(--sp-2) var(--sp-4);
  font-size: var(--text-sm);
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--ink-soft);
  border-radius: var(--r-pill);
  transition: color var(--speed) var(--ease-out), background var(--speed) var(--ease-out);
}
.nav-link:hover { color: var(--ink); background: var(--sage-mist); }

/* Collections dropdown — scales from 2 links to 10+ via its own scroll */
.nav-dropdown { position: relative; }
.nav-dropdown-menu {
  position: absolute;
  top: calc(100% + var(--sp-2));
  left: 0;
  z-index: var(--z-dropdown);
  min-width: 260px;
  max-height: 420px;
  overflow-y: auto;
  padding: var(--sp-3);
  background: var(--cream);
  border: 1px solid var(--sand);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-lg);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px);
  transition: opacity var(--speed) var(--ease-out),
              transform var(--speed) var(--ease-out),
              visibility var(--speed);
}
.nav-dropdown:hover .nav-dropdown-menu,
.nav-dropdown:focus-within .nav-dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.nav-dropdown-menu a {
  display: block;
  padding: var(--sp-3) var(--sp-4);
  min-height: 44px;
  border-radius: var(--r-md);
  color: var(--ink-soft);
  font-size: var(--text-sm);
  font-weight: 500;
}
.nav-dropdown-menu a:hover { background: var(--sage-mist); color: var(--ink); }
.nav-dropdown-menu a .menu-note {
  display: block;
  font-weight: 400;
  font-size: var(--text-xs);
  color: var(--ink-mute);
  margin-top: 2px;
}
/* Mid-tier links nested under a hub entry (§13.1 hierarchical menu) */
.nav-dropdown-menu a.menu-sub {
  /* Indentation alone marks the sub-level; the "↳" glyph that used to sit in
     ::before is folded into this padding so the visual indent is unchanged. */
  padding-left: calc(var(--sp-4) + var(--sp-5));
  font-size: var(--text-xs);
  font-weight: 400;
  color: var(--ink-mute);
}
.nav-dropdown-menu .menu-all {
  margin-top: var(--sp-2);
  padding-top: var(--sp-3);
  border-top: 1px solid var(--sand-soft);
  color: var(--gold-deep);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  margin-inline-start: auto;
}

.icon-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: var(--r-pill);
  color: var(--ink-soft);
  transition: background var(--speed) var(--ease-out), color var(--speed) var(--ease-out);
}
.icon-btn:hover { background: var(--sage-mist); color: var(--ink); }

.cart-badge {
  position: absolute;
  top: 4px;
  right: 2px;
  min-width: 18px;
  height: 18px;
  padding-inline: 5px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--gold);
  color: #fff;
  font-size: 0.6875rem;
  font-weight: 600;
  border-radius: var(--r-pill);
  border: 2px solid var(--cream);
}
.cart-badge[hidden] { display: none; }

/* Slide-down search row */
.search-row {
  overflow: hidden;
  max-height: 0;
  transition: max-height 0.35s var(--ease-out);
  border-bottom: 0 solid var(--sand-soft);
}
.search-row.open { max-height: 88px; border-bottom-width: 1px; }
.search-row .container {
  display: flex;
  gap: var(--sp-3);
  padding-block: var(--sp-4);
}
.search-row input { flex: 1; }

/* 2026-07-26: header search is HIDDEN until search is actually implemented —
   the toggle/row markup and their JS listeners stay, they just never show. */
#searchToggle,
.search-row { display: none !important; }

/* Mobile nav strip (simple horizontal scroll of links under header) */
.mobile-nav {
  display: flex;
  gap: var(--sp-2);
  overflow-x: auto;
  padding: var(--sp-2) var(--sp-5) var(--sp-3);
  scrollbar-width: none;
}
.mobile-nav::-webkit-scrollbar { display: none; }
.mobile-nav .nav-link {
  flex: none;
  background: var(--surface);
  border: 1px solid var(--sand-soft);
}
@media (min-width: 900px) {
  .mobile-nav { display: none; }
}

/* --------------------------------------------------------------------------
   5. Buttons
   -------------------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  min-height: 48px;
  padding: var(--sp-3) var(--sp-6);
  font-family: var(--font-sans);
  font-size: var(--text-base);
  font-weight: 500;
  letter-spacing: 0.02em;
  border-radius: var(--r-pill);
  transition: background var(--speed) var(--ease-out),
              color var(--speed) var(--ease-out),
              border-color var(--speed) var(--ease-out),
              box-shadow var(--speed) var(--ease-out),
              transform var(--speed) var(--ease-out);
}
.btn:active { transform: scale(0.98); }
.btn[disabled] { opacity: 0.55; cursor: not-allowed; }

.btn-primary {
  background: var(--sage);
  /* --sage is now dark forest, so the label goes light: 9.98:1 here,
     12.86:1 on the --sage-deep hover. */
  color: var(--on-sage);
  box-shadow: var(--shadow-sm);
}
.btn-primary:hover { background: var(--sage-deep); box-shadow: var(--shadow-md); }

.btn-gold {
  background: var(--gold);
  /* --gold is the one light brand surface, so this label stays dark: 8.49:1.
     The hover swaps to dark --gold-deep, so the label flips light there. */
  color: var(--on-gold);
  box-shadow: var(--shadow-sm);
}
.btn-gold:hover {
  background: var(--gold-deep);
  color: var(--on-gold-deep);
  box-shadow: var(--shadow-gold);
}

.btn-secondary {
  background: transparent;
  color: var(--sage-ink);
  border: 1.5px solid var(--sage);
}
.btn-secondary:hover { background: var(--sage-mist); color: var(--sage-deep); }

.btn-ghost {
  background: transparent;
  color: var(--ink-soft);
  min-height: 44px;
  padding: var(--sp-2) var(--sp-4);
}
.btn-ghost:hover { color: var(--ink); background: var(--surface-2); }

.btn-block { width: 100%; }
.btn-lg { min-height: 56px; font-size: var(--text-md); }

/* Inline spinner for loading buttons */
.spinner {
  width: 18px;
  height: 18px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* --------------------------------------------------------------------------
   6. Forms
   -------------------------------------------------------------------------- */
.field { display: flex; flex-direction: column; gap: var(--sp-2); }

.field-label {
  font-size: var(--text-sm);
  font-weight: 500;
  letter-spacing: 0.03em;
  color: var(--ink);
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--sp-3);
}
.field-hint { font-size: var(--text-xs); font-weight: 400; color: var(--ink-mute); }
/* Shown when a keystroke would overflow the print area — the line is already
   as long as it can be, so this explains the refusal rather than just
   swallowing the character. */
.field-hint.at-limit { color: var(--gold); }
.field-caption {
  font-size: var(--text-xs);
  color: var(--ink-mute);
  margin: 0;
  line-height: 1.35;
}

input[type="text"],
input[type="email"],
input[type="search"],
textarea,
select {
  width: 100%;
  min-height: 48px;
  padding: var(--sp-3) var(--sp-4);
  font-family: var(--font-sans);
  font-size: 16px; /* ≥16px — prevents iOS zoom */
  color: var(--field-ink);
  background: #fff;
  border: 1.5px solid var(--sand);
  border-radius: var(--r-md);
  transition: border-color var(--speed) var(--ease-out), box-shadow var(--speed) var(--ease-out);
}
input::placeholder, textarea::placeholder { color: var(--field-mute); opacity: 1; }
input:hover, textarea:hover, select:hover { border-color: var(--sage-pale); }
input:focus-visible, textarea:focus-visible, select:focus-visible {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px var(--gold-pale);
}

/* --------------------------------------------------------------------------
   7. Selectors — option pills, color swatches
   -------------------------------------------------------------------------- */
.option-group {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2);
}

.option-pill {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  min-height: 48px;
  min-width: 48px;
  padding: var(--sp-2) var(--sp-4);
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--ink-soft);
  background: #fff;
  border: 1.5px solid var(--sand);
  border-radius: var(--r-md);
  transition: border-color var(--speed) var(--ease-out),
              background var(--speed) var(--ease-out),
              color var(--speed) var(--ease-out),
              box-shadow var(--speed) var(--ease-out);
}
.option-pill:hover { border-color: var(--sage); color: var(--ink); }
.option-pill[aria-pressed="true"] {
  border-color: var(--sage);
  background: var(--sage-mist);
  color: var(--sage-deep);
  box-shadow: inset 0 0 0 1px var(--sage);
}
.option-pill .pill-sub {
  font-size: var(--text-xs);
  font-weight: 400;
  color: var(--ink-mute);
}
.option-pill[aria-pressed="true"] .pill-sub { color: var(--sage-ink); }

/* Color swatches */
.swatch {
  position: relative;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1.5px solid var(--swatch-ring);
  padding: 0;
  transition: transform var(--speed) var(--ease-out), box-shadow var(--speed) var(--ease-out);
}
.swatch::after {
  content: "";
  position: absolute;
  inset: 5px;
  border-radius: 50%;
  background: var(--swatch-color, #ccc);
  /* Was rgba(45,42,38,0.08) ~= 1.03:1 — a white or butter garment had no edge
     at all against the gap. The ring token keeps pale fills legible. */
  border: 1px solid var(--swatch-ring);
}
.swatch:hover { transform: scale(1.08); }
.swatch[aria-pressed="true"] {
  border: 2px solid var(--gold);
  box-shadow: 0 0 0 3px var(--gold-pale);
}
.swatch .swatch-star {
  position: absolute;
  top: -5px;
  right: -5px;
  z-index: var(--z-raised);
  width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--gold);
  color: #fff;
  border-radius: 50%;
  font-size: 0.625rem;
  border: 2px solid var(--cream);
}

/* Product picker — scales from 2 to 30+ whitelisted products.
   Trigger shows the current choice; options open in a grouped panel:
   anchored dropdown on desktop, bottom sheet on mobile. */
.product-picker { position: relative; scroll-margin-top: calc(var(--header-h) + var(--sp-4)); }

/* Tinted, not white: among the white cards on this panel a white box read as
   another spec line rather than a control (operator, 2026-07-26). */
.picker-trigger {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-4);
  min-height: 56px;
  padding: var(--sp-3) var(--sp-4);
  text-align: left;
  font-size: var(--text-base);
  background: var(--sage-mist);
  border: 1.5px solid var(--sage-pale);
  border-radius: var(--r-md);
  transition: border-color var(--speed) var(--ease-out), box-shadow var(--speed) var(--ease-out);
}
.picker-trigger:hover { border-color: var(--sage); }
.picker-action {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: var(--sp-1);
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--gold-deep);
}
.picker-trigger[aria-expanded="true"] {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px var(--gold-pale);
}
.picker-value { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.picker-name { font-weight: 500; color: var(--ink); }
.picker-meta { font-size: var(--text-xs); color: var(--ink-mute); }
.picker-chevron {
  flex: none;
  color: var(--ink-mute);
  transition: transform var(--speed) var(--ease-out);
}
.picker-action .picker-chevron { color: currentColor; }
.picker-trigger[aria-expanded="true"] .picker-chevron { transform: rotate(180deg); }

.picker-backdrop {
  position: fixed;
  inset: 0;
  z-index: calc(var(--z-modal) - 1);
  background: rgba(0, 0, 0, 0.35);
}
.picker-backdrop[hidden] { display: none; }

.picker-panel {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: var(--z-modal);
  max-height: 72vh;
  overflow-y: auto;
  padding: var(--sp-2) var(--sp-3) var(--sp-4);
  background: var(--cream);
  border: 1px solid var(--sand);
  border-radius: var(--r-xl) var(--r-xl) 0 0;
  box-shadow: var(--shadow-lg);
  animation: sheet-up 0.3s var(--ease-out);
}
.picker-panel[hidden] { display: none; }
@keyframes sheet-up {
  from { transform: translateY(24px); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}

.picker-handle {
  width: 36px;
  height: 4px;
  margin: var(--sp-2) auto var(--sp-1);
  border-radius: var(--r-pill);
  background: var(--sand);
}

.picker-group-label {
  padding: var(--sp-4) var(--sp-4) var(--sp-1);
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold-deep);
}

.picker-option {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-4);
  min-height: 48px;
  padding: var(--sp-3) var(--sp-4);
  border-radius: var(--r-md);
  font-size: var(--text-base);
  color: var(--ink-soft);
  transition: background var(--speed) var(--ease-out), color var(--speed) var(--ease-out);
}
.picker-option:hover { background: var(--sage-mist); color: var(--ink); }
.picker-option .opt-name { display: flex; align-items: center; gap: var(--sp-2); text-align: left; }
.picker-option .opt-name svg { flex: none; color: var(--sage-deep); }
.picker-option .opt-price { flex: none; font-size: var(--text-sm); color: var(--ink-mute); }
.picker-option[aria-selected="true"] {
  background: var(--sage-mist);
  color: var(--sage-deep);
  font-weight: 500;
}
.picker-option[aria-selected="true"] .opt-price { color: var(--sage-ink); }

@media (min-width: 920px) {
  .picker-backdrop { background: transparent; } /* click-away only, no dimming */
  .picker-panel {
    position: absolute;
    top: calc(100% + var(--sp-2));
    bottom: auto;
    max-height: 380px;
    border-radius: var(--r-lg);
    padding: var(--sp-2);
    animation: panel-in 0.25s var(--ease-out);
  }
  .picker-handle { display: none; }
  @keyframes panel-in {
    from { transform: translateY(-6px); opacity: 0; }
    to   { transform: translateY(0);    opacity: 1; }
  }
}

/* --------------------------------------------------------------------------
   8. Cards
   -------------------------------------------------------------------------- */
.product-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
  background: var(--surface);
  border: 1px solid var(--sand-soft);
  border-radius: var(--r-lg);
  padding: var(--sp-4);
  color: var(--ink);
  transition: transform var(--speed) var(--ease-out),
              box-shadow var(--speed) var(--ease-out),
              border-color var(--speed) var(--ease-out);
}
.product-card:hover {
  transform: translateY(-4px) scale(1.01);
  box-shadow: var(--shadow-lg);
  border-color: var(--sand);
  color: var(--ink);
}

.card-media {
  position: relative;
  aspect-ratio: 4 / 5;
  border-radius: var(--r-md);
  overflow: hidden;
  background: var(--surface-2);
}
.card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s var(--ease-out);
}
.product-card:hover .card-media img { transform: scale(1.04); }

/* Image-failed fallback */
.card-media.no-image {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--sp-6);
  background: linear-gradient(150deg, var(--sage-pale), var(--gold-pale));
}
.card-media.no-image span {
  font-family: var(--font-serif);
  font-size: var(--text-lg);
  color: var(--ink-soft);
  text-align: center;
}

.badge {
  position: absolute;
  top: var(--sp-3);
  left: var(--sp-3);
  z-index: var(--z-raised);
  padding: var(--sp-1) var(--sp-3);
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink);
  background: var(--gold-pale);
  border-radius: var(--r-pill);
}

/* "Personalize" chip — designs that take custom text announce it on the card,
   before the product page makes it obvious (P3-45). Top-left (operator: it
   went unnoticed at the bottom); live cards don't carry a .badge, so the
   corner is free. */
.personalize-chip {
  position: absolute;
  top: var(--sp-3);
  left: var(--sp-3);
  z-index: var(--z-raised);
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: var(--sp-1) var(--sp-3);
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--sage-ink);
  background: var(--sage-pale);
  border-radius: var(--r-pill);
}
.personalize-chip svg { flex: none; }

.card-body { display: flex; flex-direction: column; gap: var(--sp-1); }
.card-title {
  font-family: var(--font-serif);
  font-size: var(--text-md);
  line-height: 1.35;
  margin: 0;
}
/* Gold thread grows under the title on hover — the lace touch */
.card-title span {
  background-image: linear-gradient(var(--gold), var(--gold));
  background-repeat: no-repeat;
  background-size: 0% 1px;
  background-position: 0 100%;
  transition: background-size 0.4s var(--ease-out);
  padding-bottom: 2px;
}
.product-card:hover .card-title span { background-size: 100% 1px; }

.card-price { font-size: var(--text-sm); font-weight: 500; color: var(--ink-soft); }
.card-collection {
  font-size: var(--text-xs);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--gold-deep);
}

/* Product grid — 1 / 2 / 3 columns */
.product-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--sp-5);
}
@media (min-width: 560px)  { .product-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 960px)  { .product-grid { grid-template-columns: repeat(3, 1fr); gap: var(--sp-6); } }

/* --------------------------------------------------------------------------
   9. Skeleton / shimmer
   -------------------------------------------------------------------------- */
.skeleton {
  position: relative;
  overflow: hidden;
  background: var(--surface-2);
  border-radius: var(--r-md);
}
.skeleton::after {
  content: "";
  position: absolute;
  inset: 0;
  transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, var(--glass-sheen), transparent);
  animation: shimmer 1.4s infinite;
}
@keyframes shimmer { to { transform: translateX(100%); } }

/* --------------------------------------------------------------------------
   10. Toast
   -------------------------------------------------------------------------- */
.toast {
  position: fixed;
  bottom: var(--sp-6);
  left: 50%;
  z-index: var(--z-toast);
  transform: translate(-50%, calc(100% + var(--sp-8)));
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  max-width: min(90vw, 420px);
  padding: var(--sp-3) var(--sp-5);
  background: var(--ink);
  color: var(--cream);
  font-size: var(--text-sm);
  border-radius: var(--r-pill);
  box-shadow: var(--shadow-lg);
  transition: transform 0.4s var(--ease-out);
  pointer-events: none;
}
.toast.show { transform: translate(-50%, 0); }
.toast svg { color: var(--gold); flex: none; }

/* --------------------------------------------------------------------------
   11. Breadcrumb
   -------------------------------------------------------------------------- */
.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--sp-2);
  padding-block: var(--sp-5);
  font-size: var(--text-xs);
  letter-spacing: 0.04em;
  color: var(--ink-mute);
}
.breadcrumb a {
  color: var(--ink-mute);
  display: inline-flex;
  align-items: center;
  min-height: 44px; /* touch target — padding, not visual bulk */
  margin-block: calc(-1 * var(--sp-3));
}
.breadcrumb a:hover { color: var(--gold-deep); }
.breadcrumb .sep { color: var(--sand); user-select: none; }
.breadcrumb .current { color: var(--ink-soft); font-weight: 500; }

/* --------------------------------------------------------------------------
   12. Product detail page
   -------------------------------------------------------------------------- */
.product-hero {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--sp-10);
  padding-bottom: var(--sp-16);
}
@media (min-width: 920px) {
  .product-hero {
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
    gap: var(--sp-12);
    align-items: start;
  }
  .preview-column { position: sticky; top: calc(var(--header-h) + var(--sp-5)); }
}

/* Preview canvas */
.preview-stage {
  position: relative;
  container-type: inline-size; /* enables cqw units for preview text scaling */
  aspect-ratio: 4 / 5;
  border-radius: var(--r-xl);
  overflow: hidden;
  background-color: #C9B99A; /* replaced by selected shirt hex via JS */
  transition: background-color 0.45s var(--ease-out);
  box-shadow: var(--shadow-md);
}

.preview-design {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--sp-4);
  padding: var(--sp-8);
  transition: opacity 0.35s var(--ease-out);
}
.preview-design img {
  width: min(85%, 480px);
  height: auto; /* neutralize the height="…" attribute hint */
  filter: drop-shadow(0 6px 16px rgba(0, 0, 0, 0.12));
}
.preview-design .no-image {
  width: min(62%, 340px);
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: var(--sp-6);
  font-family: var(--font-serif);
  border-radius: var(--r-sm);
  background: linear-gradient(150deg, var(--sage-pale), var(--gold-pale));
  color: var(--ink-soft);
}

/* Base layout only — font-family, color, and font-size are set inline per
   overlay from text_overlays metadata (font_style/color/size_hint). The
   custom properties below are per-element fallbacks if JS hasn't run yet. */
.preview-text {
  max-width: 82%;
  font-family: var(--overlay-font, var(--font-serif));
  font-weight: var(--overlay-weight, 500);
  text-align: center;
  line-height: 1.15;
  letter-spacing: 0.04em;
  overflow-wrap: break-word;
  color: var(--overlay-color, var(--preview-ink, #2D2A26));
  text-shadow: 0 1px 6px rgba(45, 42, 38, 0.12);
  transition: color 0.45s var(--ease-out);
}
/* size_hint scale reference (1024px-wide Pillow canvas → cqw of the preview
   stage): small 36px≈3.5cqw, medium 56px≈5.5cqw, large 80px≈7.8cqw,
   xlarge 110px≈10.75cqw. Exact per-overlay size is computed in JS. */
.preview-text-primary { font-size: clamp(1.5rem, 5cqw + 0.5rem, 2.375rem); }
.preview-text-secondary {
  font-size: clamp(0.875rem, 2.5cqw + 0.375rem, 1.1875rem);
  letter-spacing: 0.22em;
  text-transform: uppercase;
  font-weight: 400;
}

.preview-text-group {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--sp-2);
  max-width: 100%;
}
.preview-text-group:empty { display: none; }

.preview-mockup {
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s var(--ease-out);
  background: var(--surface-2);
  /* Center the shrink-wrapped image wrapper. The image must display
     UNCROPPED (no object-fit: cover): #mockupOverlay is positioned in
     image-fraction coordinates, so the wrapper box must equal the visible
     image box exactly. */
  display: flex;
  align-items: center;
  justify-content: center;
}
.preview-mockup img { display: block; width: auto; height: auto; max-width: 100%; max-height: 100%; }
.preview-mockup > div { max-width: 100%; max-height: 100%; }

.preview-stage.show-mockup .preview-design { opacity: 0; pointer-events: none; }
.preview-stage.show-mockup .preview-mockup { opacity: 1; pointer-events: auto; }

/* Non-blocking render indicator — the live canvas stays visible beneath */
.render-pill {
  position: absolute;
  bottom: var(--sp-4);
  left: 50%;
  z-index: var(--z-raised);
  transform: translate(-50%, calc(100% + var(--sp-5)));
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  padding: var(--sp-2) var(--sp-4);
  background: var(--glass-strong);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  border-radius: var(--r-pill);
  box-shadow: var(--shadow-md);
  font-size: var(--text-xs);
  font-weight: 500;
  color: var(--ink-soft);
  transition: transform 0.35s var(--ease-out);
  pointer-events: none;
}
/* `notice` = the same pill carrying a settled message (e.g. no render exists
   for this option) instead of a spinner — see setPreviewStatus in product.js. */
.preview-stage.generating .render-pill,
.preview-stage.notice .render-pill { transform: translate(-50%, 0); }
.render-pill .spinner { width: 14px; height: 14px; color: var(--gold-deep); }

.preview-chip {
  position: absolute;
  top: var(--sp-4);
  left: var(--sp-4);
  z-index: var(--z-raised);
  padding: var(--sp-1) var(--sp-3);
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  background: var(--glass-soft);
  backdrop-filter: blur(4px);
  color: var(--ink-soft);
  border-radius: var(--r-pill);
}

/* The product-page chip is a button (the product switcher). Scoped to
   button.preview-chip so the static chip on index.html is untouched. */
button.preview-chip {
  max-width: calc(100% - var(--sp-8));
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  min-height: 36px;                       /* touch target: it opens the picker */
  padding: var(--sp-1) var(--sp-3);
  text-align: left;
  border: 1px solid var(--sand);
  -webkit-backdrop-filter: blur(4px);
  transition: border-color var(--speed) var(--ease-out), box-shadow var(--speed) var(--ease-out);
}
button.preview-chip:hover { border-color: var(--sage-pale); color: var(--ink); }
button.preview-chip[aria-expanded="true"] {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px var(--gold-pale);
}
button.preview-chip[aria-expanded="true"] .picker-chevron { transform: rotate(180deg); }
.preview-chip-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.preview-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-4);
  margin-top: var(--sp-4);
}
.share-link {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  min-height: 44px;
  font-size: var(--text-sm);
  color: var(--ink-mute);
}
.share-link:hover { color: var(--gold-deep); }

/* Info panel */
.product-panel { display: flex; flex-direction: column; gap: var(--sp-6); }

.product-title { margin-bottom: var(--sp-2); }
.product-collection-tag {
  font-size: var(--text-xs);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gold-deep);
  font-weight: 500;
}

.price-row {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: var(--sp-3);
}
.price {
  font-family: var(--font-serif);
  font-size: var(--text-xl);
  color: var(--ink);
}
.shipping-note {
  font-size: var(--text-sm);
  color: var(--sage-deep);
  font-weight: 500;
}

.panel-section { display: flex; flex-direction: column; gap: var(--sp-3); }
.panel-heading {
  font-size: var(--text-sm);
  font-weight: 500;
  letter-spacing: 0.03em;
  color: var(--ink);
  margin: 0;
  font-family: var(--font-sans);
  display: flex;
  align-items: baseline;
  gap: var(--sp-2);
}
.panel-heading .selected-value { font-weight: 400; color: var(--ink-mute); }

.personalize-card {
  display: flex;
  flex-direction: column;
  gap: var(--sp-4);
  padding: var(--sp-5);
  background: var(--surface);
  border: 1px solid var(--sand-soft);
  border-radius: var(--r-lg);
}
.personalize-card .personalize-title {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  font-family: var(--font-serif);
  font-size: var(--text-lg);
  color: var(--ink);
}
.personalize-card .personalize-title svg { color: var(--gold); }
.personalize-hint { margin: 0; font-size: var(--text-xs); color: var(--ink-mute); }

/* Mobile in-page personalization ----------------------------------------------
   The normal product page remains intact. After the large hero begins to scroll
   away, its SAME exact preview becomes a compact sticky element above the
   existing product form. Focus never opens a modal or reparents either surface. */
@media (max-width: 919px) {
  body.mobile-personalization-ready {
    --mobile-preview-size: 300px;
    --mobile-preview-sticky-top: var(--header-h);
  }

  body.mobile-personalization-ready .product-hero {
    gap: var(--sp-6);
  }

  body.mobile-personalization-ready .preview-column {
    transition: padding 180ms ease, background-color 180ms ease;
  }

  body.mobile-personalization-ready.mobile-preview-compact .preview-column {
    position: sticky;
    top: var(--mobile-preview-sticky-top);
    z-index: 40;
    margin-inline: calc(-1 * var(--sp-3));
    padding: 7px var(--sp-3) 9px;
    background: var(--glass-solid);
    border-bottom: 1px solid var(--sand);
    box-shadow: 0 7px 16px rgba(0, 0, 0, 0.06);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
  }

  body.mobile-personalization-ready.mobile-preview-compact .preview-stage {
    width: min(100%, var(--mobile-preview-size));
    height: min(100vw, var(--mobile-preview-size));
    margin-inline: auto;
    aspect-ratio: 1 / 1;
    border-radius: 16px;
    box-shadow: none;
    transition: width 180ms ease, height 180ms ease;
  }

  body.mobile-personalization-ready.mobile-preview-compact .preview-toolbar {
    display: none;
  }

  /* The chip STAYS when the preview pins — it is the only product control
     that survives the scroll (the panel's own picker is far below by then).
     Tightened inset so it fits the 300px compact square. */
  body.mobile-personalization-ready.mobile-preview-compact .preview-chip {
    top: var(--sp-2);
    left: var(--sp-2);
    max-width: calc(100% - var(--sp-4));
  }

  body.mobile-personalization-ready.mobile-personalization-editing .site-header {
    transform: translateY(-100%);
    opacity: 0;
    pointer-events: none;
  }

  body.mobile-personalization-ready.mobile-personalization-editing .preview-column {
    border-bottom-color: var(--sand);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.09);
  }

  body.mobile-personalization-ready.mobile-personalization-editing .personalize-card {
    position: relative;
    z-index: 41;
    gap: 8px;
    padding: 10px 12px 12px;
    background: var(--surface);
    border-color: var(--sage-pale);
    box-shadow: 0 7px 18px rgba(0, 0, 0, 0.08);
  }

  body.mobile-personalization-ready.mobile-personalization-editing .personalize-title {
    font-size: 16px;
  }

  body.mobile-personalization-ready.mobile-personalization-editing .personalize-hint {
    display: none;
  }

  body.mobile-personalization-ready.mobile-personalization-editing #textSlots {
    gap: 8px !important;
  }

  body.mobile-personalization-ready.mobile-personalization-editing #textSlots input {
    min-height: 48px;
    padding: 10px 13px;
    scroll-margin-top: calc(var(--mobile-preview-size) + 28px);
    border-color: var(--gold-deep);
    border-radius: 10px;
    font-size: 17px;
    box-shadow: 0 0 0 2px rgba(217, 155, 127, 0.20);
  }
}

.cta-stack { display: flex; flex-direction: column; gap: var(--sp-3); }

.assurance {
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
  padding: var(--sp-4) var(--sp-5);
  background: var(--sage-mist);
  border-radius: var(--r-lg);
}
.assurance-row {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  font-size: var(--text-sm);
  color: var(--ink-soft);
}
.assurance-row svg { color: var(--sage-deep); flex: none; }
.assurance-row strong { color: var(--ink); font-weight: 500; }

/* Description / story */
.product-story {
  max-width: 720px;
}
.product-story p {
  font-size: var(--text-md);
  line-height: 1.75;
  color: var(--ink-soft);
}
.story-detail-list {
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
  margin: var(--sp-6) 0 0;
  padding: 0;
  list-style: none;
}
.story-detail-list li {
  display: flex;
  gap: var(--sp-3);
  align-items: baseline;
  font-size: var(--text-sm);
  color: var(--ink-soft);
}
.story-detail-list li::before {
  content: "";
  flex: none;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--gold);
  transform: translateY(-2px);
}

/* --------------------------------------------------------------------------
   13. Footer
   -------------------------------------------------------------------------- */
.site-footer {
  margin-top: var(--sp-20);
  background: var(--surface);
  border-top: 1px solid var(--sand-soft);
}
.site-footer .container {
  display: flex;
  flex-direction: column;
  gap: var(--sp-8);
  padding-block: var(--sp-12);
}
@media (min-width: 768px) {
  .footer-main {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: var(--sp-10);
  }
}
.footer-brand { max-width: 320px; display: flex; flex-direction: column; gap: var(--sp-4); }
.footer-brand p { margin: 0; font-size: var(--text-sm); color: var(--ink-mute); }

.footer-cols { display: flex; gap: var(--sp-12); flex-wrap: wrap; margin-top: var(--sp-8); }
@media (min-width: 768px) { .footer-cols { margin-top: 0; } }
.footer-col { display: flex; flex-direction: column; gap: var(--sp-2); }
.footer-col h4 {
  font-family: var(--font-sans);
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-mute);
  margin-bottom: var(--sp-2);
}
.footer-col a {
  color: var(--ink-soft);
  font-size: var(--text-sm);
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}
.footer-col a:hover { color: var(--gold-deep); }

.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-4);
  padding-top: var(--sp-6);
  border-top: 1px solid var(--sand-soft);
  font-size: var(--text-xs);
  color: var(--ink-mute);
}
.footer-social { display: flex; gap: var(--sp-2); }

/* --------------------------------------------------------------------------
   14. Related products strip
   -------------------------------------------------------------------------- */
.related-section h2 { margin-bottom: var(--sp-2); }
.related-section .section-sub {
  color: var(--ink-mute);
  margin-bottom: var(--sp-8);
}

/* --------------------------------------------------------------------------
   15. Homepage
   -------------------------------------------------------------------------- */
.home-hero { padding-block: var(--sp-12) var(--sp-16); }
.home-hero .container {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--sp-10);
  align-items: center;
}
@media (min-width: 880px) {
  .home-hero { padding-block: var(--sp-16); }
  /* Copy top-aligned (not vertically centered against the taller image),
     and the media column kept modest so the image doesn't dominate */
  .home-hero .container { grid-template-columns: 1.2fr 0.8fr; gap: var(--sp-16); align-items: start; }
}

.hero-copy h1 { margin-bottom: var(--sp-5); }
.hero-copy .lead {
  font-size: var(--text-lg);
  line-height: 1.65;
  color: var(--ink-soft);
  max-width: 34em;
  margin-bottom: var(--sp-8);
}
.hero-ctas { display: flex; flex-wrap: wrap; gap: var(--sp-3); }

/* Hero image renders at its natural ratio — no forced aspect, no crop, and no
   decorative offset frame (it read as a misplaced container). max-width keeps
   it modest on wide screens; margin centers it in its column. */
.hero-media img {
  width: 100%;
  max-width: 420px;
  height: auto;
  margin-inline: auto;
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-lg);
}

.section-head { max-width: 640px; margin-bottom: var(--sp-10); }
.section-head p { color: var(--ink-mute); margin: 0; }
.section-head-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--sp-6);
  flex-wrap: wrap;
}
.section-head-row .section-head { margin-bottom: 0; }

/* Featured collections */
.collection-cards {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--sp-6);
}
@media (min-width: 640px)  { .collection-cards { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1000px) { .collection-cards { grid-template-columns: repeat(3, 1fr); } }

.collection-card {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--sand-soft);
  border-radius: var(--r-xl);
  overflow: hidden;
  color: var(--ink);
  transition: transform var(--speed) var(--ease-out), box-shadow var(--speed) var(--ease-out);
}
.collection-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); color: var(--ink); }
.collection-card .card-media { aspect-ratio: 3 / 2; border-radius: 0; }
.collection-card .collection-body {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  padding: var(--sp-6);
  flex: 1;
}
.collection-card h3 { margin: 0; }
.collection-card .collection-desc { font-size: var(--text-sm); color: var(--ink-mute); margin: 0; flex: 1; }
.collection-card .collection-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-3);
  margin-top: var(--sp-3);
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--sage-ink);
}
.collection-card .collection-meta .count { color: var(--ink-mute); font-weight: 400; }
.collection-card:hover .collection-meta .go { color: var(--gold-deep); }

/* Teaser card for lanes that haven't launched yet */
.collection-card.teaser {
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: var(--sp-10) var(--sp-6);
  border-style: dashed;
  border-color: var(--gold-pale);
  background: var(--gold-mist);
}
.collection-card.teaser h3 { margin-bottom: var(--sp-2); }
.collection-card.teaser p { font-size: var(--text-sm); color: var(--ink-mute); margin-bottom: var(--sp-4); }

/* Horizontal product scroller */
.scroll-row {
  display: flex;
  gap: var(--sp-5);
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding-block: var(--sp-2) var(--sp-4);
  margin-inline: calc(-1 * var(--sp-5));
  padding-inline: var(--sp-5);
  scrollbar-width: thin;
  scrollbar-color: var(--sand) transparent;
}
.scroll-row > * {
  flex: 0 0 min(72vw, 270px);
  scroll-snap-align: start;
}
.scroll-row::-webkit-scrollbar { height: 6px; }
.scroll-row::-webkit-scrollbar-thumb { background: var(--sand); border-radius: var(--r-pill); }
.scroll-row::-webkit-scrollbar-track { background: transparent; }

/* Brand story band */
.story-band {
  background: var(--surface);
  border-block: 1px solid var(--sand-soft);
}
.story-band .container {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--sp-10);
  align-items: center;
  padding-block: var(--sp-16);
}
@media (min-width: 880px) {
  .story-band .container { grid-template-columns: 1fr 1fr; gap: var(--sp-16); }
}
.story-band .story-copy p { color: var(--ink-soft); }
.story-mark {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--sp-10);
}
.story-mark svg { width: min(60%, 260px); height: auto; }

/* Current-page marker in the nav */
.nav-link[aria-current="page"] { color: var(--ink); background: var(--sage-mist); }

/* --------------------------------------------------------------------------
   16. Page heads — shop / collection / cart
   -------------------------------------------------------------------------- */
.page-band {
  background: var(--surface);
  border-bottom: 1px solid var(--sand-soft);
}
.page-hero {
  max-width: 680px;
  margin-inline: auto;
  padding-block: var(--sp-12);
  text-align: center;
}
.page-hero h1 { margin-bottom: var(--sp-4); }
.page-hero .lead {
  font-size: var(--text-lg);
  line-height: 1.65;
  color: var(--ink-soft);
  margin: 0;
}
.page-hero .design-count {
  display: inline-block;
  margin-top: var(--sp-4);
  font-size: var(--text-xs);
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-mute);
}

/* Shop toolbar — filter pills + sort */
.shop-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-4);
  padding-block: var(--sp-4);
  margin-bottom: var(--sp-8);
  border-bottom: 1px solid var(--sand-soft);
}
.filter-pills { display: flex; flex-wrap: wrap; gap: var(--sp-2); }
.toolbar-right {
  display: flex;
  align-items: center;
  gap: var(--sp-5);
  flex-wrap: wrap;
}
.results-count { font-size: var(--text-sm); color: var(--ink-mute); }
.sort-field {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-3);
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--ink-soft);
}
.sort-field select { width: auto; min-width: 190px; }

/* --------------------------------------------------------------------------
   17. Cart page
   -------------------------------------------------------------------------- */
.cart-title {
  display: flex;
  align-items: baseline;
  gap: var(--sp-3);
  flex-wrap: wrap;
  margin-bottom: var(--sp-6);
}
.cart-title .cart-count-label {
  font-family: var(--font-sans);
  font-size: var(--text-base);
  color: var(--ink-mute);
}

.cart-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--sp-8);
  align-items: start;
  padding-bottom: var(--sp-16);
}
@media (min-width: 920px) {
  .cart-layout { grid-template-columns: minmax(0, 1fr) 360px; gap: var(--sp-10); }
  .cart-summary { position: sticky; top: calc(var(--header-h) + var(--sp-5)); }
}

.cart-list { display: flex; flex-direction: column; gap: var(--sp-4); }

.cart-item {
  display: grid;
  grid-template-columns: 104px minmax(0, 1fr);
  gap: var(--sp-4);
  padding: var(--sp-4);
  background: var(--surface);
  border: 1px solid var(--sand-soft);
  border-radius: var(--r-lg);
}
.cart-item-media {
  aspect-ratio: 4 / 5;
  border-radius: var(--r-md);
  overflow: hidden;
  background: var(--surface-2);
}
.cart-item-media img { width: 100%; height: 100%; object-fit: cover; }
.cart-item-media.no-image {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--sp-2);
  background: linear-gradient(150deg, var(--sage-pale), var(--gold-pale));
}
.cart-item-media.no-image span {
  font-family: var(--font-serif);
  font-size: var(--text-xs);
  color: var(--ink-soft);
  text-align: center;
}

.cart-item-body { display: flex; flex-direction: column; gap: var(--sp-2); min-width: 0; }
.cart-item-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--sp-3);
}
.cart-item-title { margin: 0; font-size: var(--text-md); line-height: 1.3; }
.cart-item-price { flex: none; font-weight: 500; color: var(--ink); }
.cart-item-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--sp-2) var(--sp-4);
  font-size: var(--text-xs);
  color: var(--ink-mute);
}
.cart-item-meta .meta-chip { display: inline-flex; align-items: center; gap: var(--sp-2); }
.color-dot {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--dot, #ccc);
  border: 1px solid rgba(0, 0, 0, 0.15);
}
.cart-personalization {
  font-size: var(--text-xs);
  color: var(--ink-soft);
  padding: var(--sp-2) var(--sp-3);
  background: var(--gold-mist);
  border-radius: var(--r-sm);
  overflow-wrap: break-word;
}
.cart-personalization strong {
  font-weight: 600;
  color: var(--gold-deep);
  letter-spacing: 0.04em;
}

.cart-item-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-3);
  margin-top: auto;
}
.qty-stepper {
  display: inline-flex;
  align-items: center;
  background: #fff;
  border: 1.5px solid var(--sand);
  border-radius: var(--r-pill);
}
.qty-stepper button {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ink-soft);
  border-radius: var(--r-pill);
  transition: background var(--speed) var(--ease-out), color var(--speed) var(--ease-out);
}
.qty-stepper button:hover:not([disabled]) { color: var(--sage-deep); background: var(--sage-mist); }
.qty-stepper button[disabled] { opacity: 0.35; cursor: not-allowed; }
.qty-stepper .qty-value {
  min-width: 28px;
  text-align: center;
  font-size: var(--text-sm);
  font-weight: 500;
}

.remove-btn {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  min-height: 44px;
  padding-inline: var(--sp-2);
  font-size: var(--text-sm);
  color: var(--ink-mute);
  border-radius: var(--r-sm);
  transition: color var(--speed) var(--ease-out);
}
.remove-btn:hover { color: var(--rose); }

.summary-card {
  display: flex;
  flex-direction: column;
  gap: var(--sp-4);
  padding: var(--sp-6);
  background: var(--surface);
  border: 1px solid var(--sand-soft);
  border-radius: var(--r-xl);
}
.summary-card h2 { font-size: var(--text-xl); margin: 0; }
.summary-row {
  display: flex;
  justify-content: space-between;
  gap: var(--sp-4);
  font-size: var(--text-sm);
  color: var(--ink-soft);
}
.summary-row .free { color: var(--sage-deep); font-weight: 600; }
.summary-row.total {
  padding-top: var(--sp-4);
  border-top: 1px solid var(--sand-soft);
  font-family: var(--font-serif);
  font-size: var(--text-lg);
  color: var(--ink);
}
.summary-note { margin: 0; font-size: var(--text-xs); color: var(--ink-mute); text-align: center; }

.ship-progress {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  padding: var(--sp-3) var(--sp-4);
  background: var(--sage-mist);
  border-radius: var(--r-md);
  font-size: var(--text-xs);
  color: var(--sage-ink);
}
.ship-progress-track {
  height: 6px;
  border-radius: var(--r-pill);
  background: rgba(255, 255, 255, 0.75);
  overflow: hidden;
}
.ship-progress-fill {
  height: 100%;
  width: 0%;
  border-radius: var(--r-pill);
  background: var(--sage);
  transition: width 0.4s var(--ease-out);
}

.cart-empty {
  max-width: 460px;
  margin-inline: auto;
  padding-block: var(--sp-16) var(--sp-20);
  text-align: center;
}
.cart-empty svg { margin-inline: auto; color: var(--sage); margin-bottom: var(--sp-5); }
.cart-empty p { color: var(--ink-mute); margin-bottom: var(--sp-6); }

/* --------------------------------------------------------------------------
   18. About page
   -------------------------------------------------------------------------- */
.prose { max-width: 65ch; margin-inline: auto; }
.prose p { font-size: var(--text-md); line-height: 1.8; color: var(--ink-soft); }
.prose .eyebrow { text-align: center; }
.prose h2 { text-align: center; margin-bottom: var(--sp-6); }

.name-cards {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--sp-6);
  margin-top: var(--sp-10);
}
@media (min-width: 720px) { .name-cards { grid-template-columns: 1fr 1fr; } }
.name-card {
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
  padding: var(--sp-8);
  background: var(--surface);
  border: 1px solid var(--sand-soft);
  border-radius: var(--r-xl);
}
.name-card .name-letter {
  font-family: var(--font-serif);
  font-size: var(--text-2xl);
  line-height: 1;
  color: var(--gold-deep);
}
.name-card h3 { margin: 0; }
.name-card p { margin: 0; font-size: var(--text-sm); line-height: 1.7; color: var(--ink-soft); }

.guarantee-band {
  max-width: 820px;
  margin-inline: auto;
  padding: var(--sp-12) var(--sp-6);
  text-align: center;
  background: var(--gold-mist);
  border: 1.5px dashed var(--gold-pale);
  border-radius: var(--r-xl);
}
.guarantee-band h2 { margin-bottom: var(--sp-4); }
.guarantee-band p {
  max-width: 48em;
  margin-inline: auto;
  color: var(--ink-soft);
}
.guarantee-band p:last-child { margin-bottom: 0; }

.about-cta { text-align: center; padding-block: var(--sp-8) var(--sp-4); }

/* --------------------------------------------------------------------------
   19. Homepage hero demo — scripted scene loop
   Scenes are DOM-scripted (not video): cheap to edit, evolves with the
   product (v1.0 typing → v1.1 photos → Ada), future scenes config-gated.
   -------------------------------------------------------------------------- */
.hero-demo {
  max-width: 420px;
  margin-inline: auto;
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
}

.demo-stage {
  position: relative;
  container-type: inline-size;
  aspect-ratio: 1 / 1;
  border-radius: var(--r-xl);
  background: transparent;
  overflow: hidden;
  /* No box-shadow: the stage must never read as a card — the garment
     cutouts float directly on the page (operator, 2026-07-26). */
}
.demo-stage .demo-design-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: inherit;
  display: block;
}

.demo-text, .demo-text-top {
  position: absolute;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 60%;
  min-height: 1.3em;
  font-family: var(--overlay-font, var(--font-serif));
  font-weight: var(--overlay-weight, 400);
  font-size: calc(clamp(0.875rem, 3.5cqw, 1.5rem) * var(--overlay-scale, 1));
  letter-spacing: 0.04em;
  text-align: center;
  color: var(--overlay-color, #FFFFFF);
  pointer-events: none;
}

.demo-text {
  top: 72%;
  font-size: calc(clamp(0.7rem, 2.8cqw, 1.2rem) * var(--overlay-scale, 1));
}

.demo-text-top {
  top: 32%;
}
.demo-caret {
  display: inline-block;
  width: 2px;
  height: 1em;
  margin-left: 3px;
  vertical-align: -0.12em;
  background: var(--gold-deep);
  animation: caret-blink 1s steps(1) infinite;
}
@keyframes caret-blink { 50% { opacity: 0; } }

/* The sitewide .hero-media img card treatment (radius + shadow, styles for a
   single hero photo) must NOT skin the animation layers — it made every layer
   read as a rounded shadowed card (operator: "a border on an HTML element"). */
.hero-media .demo-stage img {
  max-width: none;
  width: 100%;
  height: 100%;
  border-radius: 0;
  box-shadow: none;
}

/* Hero process animation — layers for raw painting -> knockout -> garment.
   All frames are real pipeline artifacts; the artbox flies to the listing's
   stored print-box geometry so the art lands exactly where the print sits. */
.hero-layer {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: inherit;
  opacity: 0;
  transition: opacity 0.55s var(--ease-out);
}
.hero-layer.show { opacity: 1; }
#heroRaw { transition-duration: 0.24s; } /* fast fade = the knockout "snap" */

.hero-artbox {
  position: absolute;
  left: 0; top: 0; width: 100%; height: 100%;
  opacity: 0;
  pointer-events: none;
  transition:
    opacity 0.5s var(--ease-out),
    left 0.9s cubic-bezier(0.5, 0.05, 0.2, 1),
    top 0.9s cubic-bezier(0.5, 0.05, 0.2, 1),
    width 0.9s cubic-bezier(0.5, 0.05, 0.2, 1),
    height 0.9s cubic-bezier(0.5, 0.05, 0.2, 1);
}
.hero-artbox.show { opacity: 1; }
.hero-artbox.no-fly { transition: opacity 0.5s var(--ease-out); }
.hero-artbox img { width: 100%; height: 100%; object-fit: fill; display: block; }

.hero-typeline {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  width: 72%;
  text-align: center;
  pointer-events: none;
  white-space: pre-line;
  line-height: 1.18;
  opacity: 0;
  transition: opacity 0.3s var(--ease-out);
  font-family: var(--overlay-font, var(--font-serif));
  font-weight: var(--overlay-weight, 400);
  font-size: calc(clamp(0.7rem, 2.8cqw, 1.2rem) * var(--overlay-scale, 1));
  letter-spacing: 0.05em;
  color: var(--overlay-color, #FFFFFF);
}
.hero-typeline.show { opacity: 1; }

/* Footer: scene label + dots */
.demo-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-3);
}
.demo-label { font-size: var(--text-xs); color: var(--ink-mute); letter-spacing: 0.04em; }
.demo-label .soon { color: var(--gold-deep); font-weight: 600; }
.demo-dots { display: flex; gap: var(--sp-1); flex: none; }
.demo-dot {
  position: relative;
  width: 28px;
  height: 28px;
  padding: 0;
  border-radius: 50%;
}
.demo-dot::after {
  content: "";
  position: absolute;
  inset: 10px;
  border-radius: 50%;
  background: var(--sand);
  transition: background var(--speed) var(--ease-out), transform var(--speed) var(--ease-out);
}
.demo-dot:hover::after { background: var(--gold-pale); }
.demo-dot[aria-pressed="true"]::after { background: var(--gold); transform: scale(1.25); }
