/* ============================================================
   AFTERSWEAT — shared styles
   Palette + type from AFTERSWEAT_brand_pack.html v1.0:
   paper / ink / studio neutrals, Archivo + Space Mono,
   one eucalyptus acid-green accent (PMS 802 C → #57c93c).
   ============================================================ */

:root {
  --paper: #f8f7f4;      /* page background (brand: --paper) */
  --panel: #e9e8e4;      /* cards, image mats (brand: --studio) */
  --panel-deep: #dddcd7; /* pressed / hover surfaces */
  --ink: #111;           /* primary text (brand: --ink) */
  --ink-soft: #8a8a84;   /* secondary text (brand: --note) */
  --line: #dedcd5;       /* hairlines (brand: --rule) */
  --accent: #57c93c;     /* eucalyptus acid green — signature + CTAs only */
  --accent-deep: #3e7a2e;

  --font: "Archivo", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --font-mono: "Space Mono", "SFMono-Regular", Menlo, monospace;
  --radius-pill: 999px;
  --radius: 14px;
  --max: 1200px;
  --pad: clamp(20px, 4vw, 48px);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

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

body {
  font-family: var(--font);
  background: var(--paper);
  color: var(--ink);
  line-height: 1.5;
  font-size: 16px;
  letter-spacing: -0.01em;
  -webkit-font-smoothing: antialiased;
}

img { display: block; max-width: 100%; height: auto; }

a { color: inherit; }

/* ---- focus ---- */
:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 3px;
  border-radius: 4px;
}
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--ink);
  color: var(--paper);
  padding: 10px 18px;
  border-radius: 0 0 10px 0;
  z-index: 200;
}
.skip-link:focus { left: 0; }

/* ============================================================
   Nav — Cove-style floating pill
   ============================================================ */
.nav-wrap {
  position: sticky;
  top: 14px;
  z-index: 100;
  display: flex;
  justify-content: center;
  padding: 0 var(--pad);
}
.nav {
  display: flex;
  align-items: center;
  gap: clamp(10px, 3vw, 34px);
  background: rgba(210, 209, 203, 0.72);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-radius: var(--radius-pill);
  padding: 12px 26px;
  width: 100%;
  max-width: 880px;
}
.nav-brand {
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: -0.02em;
  text-decoration: none;
  margin-right: auto;
  white-space: nowrap;
}
.nav-brand .tld { color: var(--accent-deep); }
.nav a:not(.nav-brand) {
  text-decoration: none;
  color: #4c4b47;
  font-size: 0.95rem;
  white-space: nowrap;
}
.nav a[aria-current="page"] { color: var(--ink); font-weight: 600; }
.nav a:not(.nav-brand):hover { color: var(--ink); }
.nav-cart {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: var(--paper);
  border: none;
  font: inherit;
  font-size: 0.95rem;
  border-radius: var(--radius-pill);
  padding: 7px 15px;
  cursor: pointer;
  color: var(--ink);
}
.nav-cart:hover { background: #fff; }
.cart-dot {
  display: inline-block;
  min-width: 20px;
  text-align: center;
  background: var(--accent);
  color: var(--ink);
  font-weight: 600;
  font-size: 0.8rem;
  border-radius: var(--radius-pill);
  padding: 1px 6px;
}

/* ============================================================
   Layout helpers
   ============================================================ */
.container { max-width: var(--max); margin: 0 auto; padding: 0 var(--pad); }
.section { padding: clamp(56px, 9vw, 120px) 0; }
.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--ink-soft);
  margin-bottom: 14px;
}

h1, h2, h3 { letter-spacing: -0.03em; line-height: 1.12; font-weight: 600; }
h1 { font-size: clamp(2.1rem, 5.4vw, 3.9rem); }
h2 { font-size: clamp(1.6rem, 3.4vw, 2.5rem); }
h3 { font-size: 1.12rem; }

.sub {
  color: var(--ink-soft);
  font-size: clamp(1rem, 1.6vw, 1.2rem);
  max-width: 44ch;
}

/* black-line / grey-line pair, borrowed from Cove's feature grid */
.pair strong { display: block; font-weight: 600; }
.pair span { display: block; color: var(--ink-soft); }

/* ---- buttons ---- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font: inherit;
  font-weight: 600;
  text-decoration: none;
  border-radius: var(--radius-pill);
  padding: 14px 30px;
  cursor: pointer;
  border: 1px solid var(--ink);
  transition: transform 0.15s ease, background 0.15s ease;
}
.btn:active { transform: scale(0.98); }
.btn-primary { background: var(--ink); color: var(--paper); }
.btn-primary:hover { background: #000; }
.btn-ghost { background: transparent; color: var(--ink); }
.btn-ghost:hover { background: var(--panel); }
.btn-accent { background: var(--accent); border-color: var(--accent); color: var(--ink); }
.btn-accent:hover { filter: brightness(1.05); }
.btn[disabled] { opacity: 0.45; cursor: not-allowed; }

/* ============================================================
   Signature: evaporating halftone
   Decorative dot fields are injected by app.js into any
   element with [data-halftone]. aria-hidden, animation off
   under reduced motion.
   ============================================================ */
.halftone { display: block; width: 100%; height: auto; }
.halftone circle { transform-origin: center; }
@media (prefers-reduced-motion: no-preference) {
  .halftone [data-rise] { animation: rise 5.2s ease-in-out infinite alternate; }
  @keyframes rise {
    from { transform: translateY(0); opacity: 1; }
    to   { transform: translateY(-6px); opacity: 0.35; }
  }
}
.divider-halftone {
  display: flex;
  justify-content: center;
  padding: 0 var(--pad);
}
.divider-halftone > div { width: min(520px, 70%); }

/* ============================================================
   Hero
   ============================================================ */
.hero { text-align: center; padding-top: clamp(48px, 8vw, 96px); }
.hero .sub { margin: 18px auto 30px; }
.hero-cta { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }
.hero-stage {
  position: relative;
  max-width: 560px;
  margin: clamp(36px, 6vw, 64px) auto 0;
}
.hero-stage .halftone-bg {
  position: absolute;
  inset: auto 0 -6%;
  z-index: 0;
}
.hero-stage img {
  position: relative;
  z-index: 1;
  border-radius: var(--radius);
}

/* ============================================================
   Benefit grid (Cove-style: pairs flanking the product)
   ============================================================ */
.benefit-grid {
  display: grid;
  grid-template-columns: 1fr minmax(260px, 420px) 1fr;
  gap: clamp(24px, 4vw, 56px);
  align-items: center;
}
.benefit-col { display: grid; gap: clamp(36px, 6vw, 84px); }
.benefit-col.left { text-align: right; }
.benefit-center img { border-radius: var(--radius); }
@media (max-width: 820px) {
  .benefit-grid { grid-template-columns: 1fr; text-align: center; }
  .benefit-col.left { text-align: center; }
  .benefit-center { order: -1; max-width: 380px; margin: 0 auto; }
}

/* ============================================================
   Ritual strip
   ============================================================ */
.ritual-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}
.ritual-card {
  background: var(--panel);
  border-radius: var(--radius);
  padding: 26px 24px 30px;
}
.ritual-card .step {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent-deep);
  font-weight: 600;
}
.ritual-card h3 { margin: 10px 0 8px; }
.ritual-card p { color: var(--ink-soft); font-size: 0.95rem; }
@media (max-width: 720px) { .ritual-strip { grid-template-columns: 1fr; } }

/* ============================================================
   Quote band + closing CTA
   ============================================================ */
.quote-band { text-align: center; }
.quote-band blockquote {
  font-size: clamp(1.3rem, 2.6vw, 1.9rem);
  font-weight: 500;
  letter-spacing: -0.02em;
  max-width: 26ch;
  margin: 0 auto 16px;
}
.quote-band cite { color: var(--ink-soft); font-style: normal; font-size: 0.95rem; }

.cta-band {
  background: var(--ink);
  color: var(--paper);
  border-radius: calc(var(--radius) + 8px);
  text-align: center;
  padding: clamp(48px, 7vw, 88px) var(--pad);
}
.cta-band .sub { color: #b9b8b2; margin: 14px auto 28px; }

/* ============================================================
   Product page
   ============================================================ */
.product-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  gap: clamp(28px, 5vw, 72px);
  align-items: start;
}
@media (max-width: 860px) { .product-layout { grid-template-columns: 1fr; } }

.gallery-main {
  background: var(--panel);
  border-radius: var(--radius);
  overflow: hidden;
}
.gallery-thumbs {
  margin-top: 12px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}
.gallery-thumbs button {
  border: 2px solid transparent;
  border-radius: 10px;
  overflow: hidden;
  padding: 0;
  cursor: pointer;
  background: var(--panel);
}
.gallery-thumbs button[aria-pressed="true"] { border-color: var(--ink); }

.buy-card h1 { font-size: clamp(1.8rem, 3.4vw, 2.6rem); }
.price-row {
  display: flex;
  align-items: baseline;
  gap: 14px;
  margin: 14px 0 6px;
}
.price { font-size: 1.4rem; font-weight: 600; }
.ship-note { color: var(--ink-soft); font-size: 0.92rem; }

fieldset.variants { border: none; margin: 26px 0 8px; }
fieldset.variants legend {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--ink-soft);
  margin-bottom: 12px;
}
.variant-options { display: flex; flex-wrap: wrap; gap: 10px; }
.variant-options label {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  padding: 10px 18px;
  cursor: pointer;
  background: var(--paper);
}
.variant-options input { position: absolute; opacity: 0; }
.variant-options input:focus-visible + span {
  outline: 2px solid var(--ink);
  outline-offset: 6px;
  border-radius: 4px;
}
.variant-options label:has(input:checked) {
  border-color: var(--ink);
  background: var(--panel);
  font-weight: 600;
}
.swatch {
  width: 14px; height: 14px;
  border-radius: 50%;
  border: 1px solid rgba(0,0,0,0.15);
}

.qty-row { display: flex; align-items: center; gap: 16px; margin: 22px 0 26px; }
.qty {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  overflow: hidden;
}
.qty button {
  border: none;
  background: transparent;
  font: inherit;
  font-size: 1.1rem;
  width: 42px; height: 42px;
  cursor: pointer;
}
.qty button:hover { background: var(--panel); }
.qty output { min-width: 34px; text-align: center; font-weight: 600; }

.buy-actions { display: grid; gap: 10px; max-width: 420px; }

.accordion { border-top: 1px solid var(--line); margin-top: 34px; }
.accordion-item { border-bottom: 1px solid var(--line); }
.accordion-trigger {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  background: none;
  border: none;
  font: inherit;
  font-weight: 600;
  text-align: left;
  padding: 18px 2px;
  cursor: pointer;
}
.accordion-trigger .chev { transition: transform 0.2s ease; color: var(--ink-soft); }
.accordion-trigger[aria-expanded="true"] .chev { transform: rotate(45deg); }
.accordion-panel { padding: 0 2px 20px; color: var(--ink-soft); max-width: 60ch; }
.accordion-panel[hidden] { display: none; }
.accordion-panel ul { padding-left: 18px; }

/* ============================================================
   Ritual + FAQ page
   ============================================================ */
.page-head { text-align: center; padding-top: clamp(40px, 6vw, 72px); }
.page-head .sub { margin: 16px auto 0; }
.narrow { max-width: 720px; margin: 0 auto; }

/* ============================================================
   Cart (page + drawer share these)
   ============================================================ */
.cart-lines { display: grid; gap: 14px; }
.cart-line {
  display: grid;
  grid-template-columns: 76px 1fr auto;
  gap: 16px;
  align-items: center;
  background: var(--panel);
  border-radius: var(--radius);
  padding: 12px;
}
.cart-line img { border-radius: 8px; }
.cart-line .meta strong { display: block; }
.cart-line .meta span { color: var(--ink-soft); font-size: 0.9rem; }
.cart-line .line-end { text-align: right; display: grid; gap: 6px; justify-items: end; }
.remove-line {
  border: none; background: none; font: inherit;
  font-size: 0.85rem; color: var(--ink-soft);
  cursor: pointer; text-decoration: underline;
}
.remove-line:hover { color: var(--ink); }
.cart-summary {
  margin-top: 26px;
  border-top: 1px solid var(--line);
  padding-top: 20px;
  display: grid;
  gap: 14px;
}
.cart-summary[hidden] { display: none; } /* author display would beat UA [hidden] */
.cart-summary .row { display: flex; justify-content: space-between; font-weight: 600; }
.cart-empty { color: var(--ink-soft); padding: 30px 0; }

/* drawer */
.drawer-backdrop {
  position: fixed; inset: 0;
  background: rgba(27, 27, 26, 0.35);
  z-index: 150;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}
.drawer {
  position: fixed;
  top: 0; right: 0; bottom: 0;
  width: min(420px, 92vw);
  background: var(--paper);
  z-index: 160;
  transform: translateX(105%);
  transition: transform 0.25s ease;
  display: flex;
  flex-direction: column;
  padding: 24px;
  overflow-y: auto;
  box-shadow: -18px 0 40px rgba(0,0,0,0.12);
}
body.drawer-open .drawer { transform: translateX(0); }
body.drawer-open .drawer-backdrop { opacity: 1; pointer-events: auto; }
.drawer-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 22px;
}
.drawer-close {
  border: none; background: var(--panel);
  border-radius: 50%;
  width: 36px; height: 36px;
  font-size: 1.1rem;
  cursor: pointer;
}

/* ============================================================
   Footer
   ============================================================ */
footer {
  border-top: 1px solid var(--line);
  margin-top: clamp(56px, 8vw, 100px);
  padding: 36px 0 48px;
  color: var(--ink-soft);
  font-size: 0.9rem;
}
.footer-row {
  display: flex;
  flex-wrap: wrap;
  gap: 18px 34px;
  justify-content: space-between;
  align-items: center;
}
.footer-row nav { display: flex; gap: 22px; flex-wrap: wrap; }
.footer-row a { text-decoration: none; }
.footer-row a:hover { color: var(--ink); }

/* toast */
.toast {
  position: fixed;
  left: 50%;
  bottom: 26px;
  transform: translate(-50%, 20px);
  background: var(--ink);
  color: var(--paper);
  border-radius: var(--radius-pill);
  padding: 12px 22px;
  font-size: 0.95rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 170;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 560px) {
  .nav { padding: 10px 16px; gap: 14px; }
  .nav a.nav-link-hide-sm { display: none; }
}

/* legal / prose pages */
.prose h2 { font-size: 1.12rem; margin: 34px 0 10px; }
.prose h3 { font-size: 1rem; margin: 24px 0 8px; }
.prose p { margin: 0 0 14px; }
.prose ul, .prose ol { margin: 0 0 14px; padding-left: 22px; }
.prose li { margin-bottom: 7px; }
.prose a { text-decoration: underline; }
.prose a:hover { color: var(--accent-deep); }
.prose code { font-family: var(--font-mono); font-size: 0.88em; background: var(--panel); padding: 1px 5px; border-radius: 4px; }
.prose .updated { color: var(--ink-soft); font-size: 0.85rem; margin-bottom: 26px; }
