/* Mia's Heart Hemp Life prototype: shared system. Tokens from creative-direction.md section 5. */
:root {
  --mh-paper: #F4EBDD;
  --mh-ink: #1A1614;
  --mh-heart: #B12429;
  --mh-heart-deep: #7E1A1E;
  --mh-stalk: #3F6B45;
  --mh-sprout: #6F9A4E;
  --mh-seed: #8B5A3C;
  --mh-ochre: #D99A2B;
  --mh-greystone: #D9CFBF;
  /* derived, contrast-checked */
  --mh-muted: #5B4F46;      /* 7.0:1 on paper */
  --mh-mist: #D3C6B4;       /* 10.6:1 on ink */
  --mh-ink-2: #241E1B;
  --mh-card: #FBF6EE;

  --f-display: "Bricolage Grotesque", "Arial Narrow", system-ui, sans-serif;
  --f-body: "Figtree", system-ui, -apple-system, "Segoe UI", sans-serif;
  --f-label: "Courier Prime", "Courier New", monospace;
  --f-hand: "Caveat", "Segoe Print", cursive;

  --beat: 500ms;
  --half: 250ms;
  --ease-enter: cubic-bezier(.22, 1, .36, 1);
  --header-h: 64px;
  --bar-h: 64px;
  --gutter: 16px;
  --max: 1280px;
}
@media (min-width: 768px) { :root { --gutter: 24px; } }
@media (min-width: 1024px) { :root { --header-h: 72px; --gutter: 32px; } }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--header-h) + 16px); }
body {
  margin: 0; background: var(--mh-paper); color: var(--mh-ink);
  font-family: var(--f-body); font-size: 17px; line-height: 1.55;
  overflow-x: clip;
}
@media (min-width: 1024px) { body { font-size: 18px; } }
img, svg { max-width: 100%; display: block; }
a { color: var(--mh-heart); text-decoration-thickness: 2px; text-underline-offset: 3px; }
button, input, select { font: inherit; color: inherit; }
h1, h2, h3 { margin: 0; }
p { margin: 0 0 1em; }
.vh { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* paper grain: riso texture at 6% */
body::after {
  content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 90; opacity: .07;
  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='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .35 0 0 0 0 .22 0 0 0 0 .12 0 0 0 1.4 -.3'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* type roles */
.display, .h1, .h2 {
  font-family: var(--f-display); font-weight: 800; letter-spacing: -0.02em;
  font-variation-settings: "wdth" 75, "opsz" 96; line-height: .95;
}
.h1 { font-size: clamp(44px, 9vw, 128px); }
.h2 { font-size: clamp(32px, 5.5vw, 72px); line-height: 1; letter-spacing: -0.005em; font-variation-settings: "wdth" 80, "opsz" 72; }
.h3 { font-family: var(--f-display); font-weight: 700; font-size: clamp(22px, 3vw, 36px); line-height: 1.08; letter-spacing: -0.01em; font-variation-settings: "wdth" 85, "opsz" 36; }
.eyebrow { font-family: var(--f-label); font-weight: 700; font-size: 13px; letter-spacing: .08em; text-transform: uppercase; }
.hand { font-family: var(--f-hand); font-weight: 700; font-size: clamp(22px, 2.4vw, 28px); line-height: 1.25; }
.label { font-family: var(--f-label); }
.lede { font-size: 1.12em; max-width: 52ch; }
.muted { color: var(--mh-muted); }

.wrap { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter); }

/* skip links */
.skip { position: absolute; left: 8px; top: -60px; z-index: 300; background: var(--mh-ink); color: var(--mh-paper); padding: 10px 14px; border-radius: 8px; }
.skip:focus { top: 8px; }

/* focus */
:focus-visible { outline: 3px solid var(--mh-ink); outline-offset: 2px; border-radius: 4px; }
.on-dark :focus-visible, .on-dark:focus-visible { outline-color: var(--mh-paper); }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 48px; padding: 0 24px; border-radius: 8px; border: 2px solid transparent;
  font-weight: 700; font-size: 16px; text-decoration: none; cursor: pointer; line-height: 1.1;
  transition: transform var(--half) var(--ease-enter), background-color var(--half), color var(--half), border-color var(--half);
}
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: scale(.96); }
.btn-primary { background: var(--mh-heart); color: #fff; }
.btn-primary:hover { background: var(--mh-heart-deep); }
.btn-ghost { background: transparent; border-color: var(--mh-ink); color: var(--mh-ink); }
.btn-ghost:hover { background: var(--mh-ink); color: var(--mh-paper); }
.on-dark .btn-ghost { border-color: var(--mh-paper); color: var(--mh-paper); }
.on-dark .btn-ghost:hover { background: var(--mh-paper); color: var(--mh-ink); }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .45; pointer-events: none; }
.btn-sm { min-height: 44px; padding: 0 16px; font-size: 15px; }
.textlink { font-weight: 700; color: var(--mh-heart); text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 3px; background: none; border: 0; padding: 0; cursor: pointer; font-size: inherit; }
.on-dark .textlink { color: var(--mh-ochre); }
.on-dark { color: var(--mh-paper); }

/* ---------- placeholders (spec 15.3) ---------- */
.fill { font-family: var(--f-label); font-size: .86em; background: rgba(217, 154, 43, .22); color: inherit; padding: 1px 6px; border-radius: 4px; border: 1px dashed currentColor; -webkit-box-decoration-break: clone; box-decoration-break: clone; overflow-wrap: anywhere; }
.thc { display: inline-flex; align-items: center; gap: 4px; font-family: var(--f-label); font-weight: 700; font-size: 12px; letter-spacing: .04em; text-transform: uppercase; color: var(--mh-stalk); border: 1.5px solid currentColor; border-radius: 6px; padding: 2px 7px; line-height: 1.3; background: var(--mh-paper); }
.footnote { font-family: var(--f-label); font-size: 13px; color: var(--mh-muted); }
.on-dark .footnote { color: var(--mh-mist); }

/* ---------- header ---------- */
.site-header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100; height: var(--header-h);
  background: var(--mh-paper); transition: box-shadow var(--half);
}
.site-header.scrolled { box-shadow: 0 1px 0 var(--mh-greystone); }
.site-header .wrap { height: 100%; display: flex; align-items: center; gap: 16px; }
.brand { display: flex; align-items: center; gap: 8px; text-decoration: none; flex-shrink: 0; }
.brand img.mark { height: 34px; width: auto; }
.brand img.word { height: 26px; width: auto; }
@media (min-width: 1024px) { .brand img.mark { height: 40px; } .brand img.word { height: 32px; } }
.nav-main { display: none; margin: 0 auto; gap: 28px; }
.nav-main a { color: var(--mh-ink); text-decoration: none; font-weight: 600; padding: 8px 2px; border-bottom: 2px solid transparent; }
.nav-main a:hover, .nav-main a[aria-current="page"] { border-bottom-color: var(--mh-heart); }
@media (min-width: 1024px) { .nav-main { display: flex; } }
.header-actions { display: flex; align-items: center; gap: 8px; margin-left: auto; }
@media (min-width: 1024px) { .header-actions { margin-left: 0; } }
.icon-btn { width: 44px; height: 44px; border-radius: 8px; border: 0; background: transparent; display: inline-grid; place-items: center; cursor: pointer; position: relative; color: var(--mh-ink); }
.icon-btn:hover { background: rgba(26, 22, 20, .06); }
.icon-btn svg { width: 24px; height: 24px; }
.cart-count {
  position: absolute; top: 2px; right: 0; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 10px;
  background: var(--mh-heart); color: #fff; font: 700 12px/20px var(--f-body); text-align: center;
}
.cart-count[data-n="0"] { display: none; }
.cart-count.bump { animation: bump var(--beat) var(--ease-enter); }
@keyframes bump { 0% { transform: scale(1); } 40% { transform: scale(1.3); } 100% { transform: scale(1); } }
.header-shop { display: none; }
@media (min-width: 1024px) {
  .header-shop { display: inline-flex; opacity: 0; transform: translateY(-6px); pointer-events: none; transition: opacity var(--half), transform var(--half); }
  .header-shop.show { opacity: 1; transform: none; pointer-events: auto; }
  .menu-btn { display: none !important; }
}

/* Pulse progress line under the header: the page spine */
.pulse-progress { position: fixed; left: 0; right: 0; top: var(--header-h); height: 18px; z-index: 99; pointer-events: none; }
.pulse-progress svg { width: 100%; height: 18px; overflow: visible; }
.pulse-progress .track { stroke: var(--mh-greystone); stroke-width: 1.5; fill: none; opacity: .7; }
.pulse-progress .draw { stroke: var(--mh-heart); stroke-width: 3; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.pulse-progress .sprout { transform-origin: 100% 60%; transform: scale(0); transition: transform var(--beat) var(--ease-enter); }
.pulse-progress.done .sprout { transform: scale(1); }

/* mobile menu */
.mobile-menu { position: fixed; inset: 0; z-index: 210; background: var(--mh-paper); display: none; flex-direction: column; padding: 16px var(--gutter) 32px; overflow-y: auto; }
.mobile-menu.open { display: flex; }
.mobile-menu .mm-top { display: flex; justify-content: space-between; align-items: center; height: 48px; margin-bottom: 16px; }
.mobile-menu ul { list-style: none; margin: 0; padding: 0; }
.mobile-menu .mm-rituals a { display: block; padding: 12px 0; text-decoration: none; color: var(--mh-ink); border-bottom: 1px solid var(--mh-greystone); }
.mobile-menu .mm-rituals strong { font-family: var(--f-display); font-size: 30px; font-weight: 800; font-variation-settings: "wdth" 75; display: block; line-height: 1; }
.mobile-menu .mm-rituals span { font-size: 15px; color: var(--mh-muted); }
.mobile-menu .mm-links { margin-top: 24px; display: grid; grid-template-columns: 1fr 1fr; gap: 4px 16px; }
.mobile-menu .mm-links a { display: block; padding: 12px 0; color: var(--mh-ink); font-weight: 600; text-decoration: none; }

/* ---------- sticky shop bar (mobile) ---------- */
.shop-bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 95;
  height: calc(var(--bar-h) + env(safe-area-inset-bottom)); padding: 8px var(--gutter) calc(8px + env(safe-area-inset-bottom));
  background: var(--mh-ink); border-top: 1px solid #2E2723; display: flex; align-items: center; gap: 12px;
  transform: translateY(110%); transition: transform .3s var(--ease-enter);
}
.shop-bar.show { transform: none; }
.shop-bar .btn-primary { flex: 0 0 60%; }
.shop-bar .textlink { color: var(--mh-paper); flex: 1; text-align: center; min-height: 44px; }
@media (min-width: 1024px) { .shop-bar { display: none; } }
@media (max-width: 1023px) { body.has-bar .site-footer { padding-bottom: calc(32px + var(--bar-h) + env(safe-area-inset-bottom)); } }

/* ---------- toast ---------- */
.toast {
  position: fixed; z-index: 220; left: 50%; bottom: calc(var(--bar-h) + 16px + env(safe-area-inset-bottom));
  transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  background: var(--mh-ink); color: var(--mh-paper); padding: 12px 16px; border-radius: 12px; width: min(92vw, 380px);
  display: flex; align-items: center; gap: 12px; transition: opacity var(--half), transform var(--half) var(--ease-enter);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
.toast a, .toast button.textlink { color: var(--mh-ochre); margin-left: auto; white-space: nowrap; }
@media (min-width: 1024px) { .toast { left: auto; right: 24px; top: calc(var(--header-h) + 28px); bottom: auto; transform: translateY(-12px); } .toast.show { transform: none; } }

/* ---------- drawers and dialogs ---------- */
.scrim { position: fixed; inset: 0; background: rgba(26, 22, 20, .6); z-index: 230; opacity: 0; pointer-events: none; transition: opacity var(--half); }
.scrim.show { opacity: 1; pointer-events: auto; }
.drawer {
  position: fixed; z-index: 240; background: var(--mh-paper); display: flex; flex-direction: column;
  left: 0; right: 0; bottom: 0; max-height: 92svh; border-radius: 16px 16px 0 0;
  transform: translateY(105%); transition: transform .4s var(--ease-enter); visibility: hidden;
}
.drawer.open { transform: none; visibility: visible; }
@media (min-width: 768px) {
  .drawer { left: auto; top: 0; bottom: 0; width: min(480px, 100vw); max-height: none; border-radius: 0; transform: translateX(105%); }
}
.drawer-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--mh-greystone); }
.drawer-body { padding: 20px; overflow-y: auto; flex: 1; }
.drawer-foot { padding: 16px 20px calc(16px + env(safe-area-inset-bottom)); border-top: 1px solid var(--mh-greystone); background: var(--mh-card); }

/* cart lines */
.cart-line { display: grid; grid-template-columns: 64px 1fr auto; gap: 12px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--mh-greystone); }
.cart-line .thumb { width: 64px; height: 64px; border-radius: 10px; background: var(--mh-greystone); }
.cart-line .thumb img { width: 100%; height: 100%; }
.cart-line .meta { font-size: 15px; line-height: 1.3; }
.cart-line .meta strong { display: block; font-size: 16px; }
.cart-empty { text-align: center; padding: 32px 0; }

/* bundle builder */
.bb-progress { font-family: var(--f-label); font-weight: 700; font-size: 13px; letter-spacing: .08em; text-transform: uppercase; color: var(--mh-muted); }
.bb-step[hidden] { display: none; }
.bb-choices { display: grid; gap: 10px; margin: 16px 0; }
@media (min-width: 768px) { .bb-choices.two { grid-template-columns: 1fr 1fr; } }
.choice { position: relative; display: block; cursor: pointer; }
.choice input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.choice .face { display: flex; align-items: center; gap: 12px; min-height: 64px; padding: 12px 14px; border: 2px solid var(--mh-greystone); border-radius: 12px; background: var(--mh-card); transition: border-color var(--half), background-color var(--half); }
.choice input:checked + .face { border-color: var(--mh-heart); background: #fff; }
.choice input:focus-visible + .face { outline: 3px solid var(--mh-ink); outline-offset: 2px; }
.choice input:disabled + .face { opacity: .5; cursor: not-allowed; }
.choice .face strong { display: block; font-family: var(--f-display); font-weight: 800; font-size: 24px; line-height: 1; font-variation-settings: "wdth" 80; }
.choice .face small { color: var(--mh-muted); font-size: 14px; }
.choice .face img { width: 52px; height: 52px; flex-shrink: 0; }
.choice .check { margin-left: auto; width: 26px; height: 26px; border-radius: 6px; border: 2px solid var(--mh-greystone); display: grid; place-items: center; flex-shrink: 0; }
.choice input:checked + .face .check { background: var(--mh-heart); border-color: var(--mh-heart); }
.choice input:checked + .face .check::after { content: ""; width: 12px; height: 7px; border: 3px solid #fff; border-top: 0; border-right: 0; transform: rotate(-45deg) translate(1px, -1px); }
.bb-variant { margin-top: 6px; }
.bb-variant select { min-height: 40px; border-radius: 8px; border: 1px solid var(--mh-muted); background: #fff; padding: 0 8px; font-size: 15px; }
.bb-total { display: flex; justify-content: space-between; align-items: baseline; font-weight: 700; }
.bb-total .sum { font-family: var(--f-display); font-size: 30px; font-weight: 800; font-variation-settings: "wdth" 80; }
.bb-nav { display: flex; gap: 10px; justify-content: space-between; }
.bb-nav .btn { flex: 1; }
.bb-review li { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px dashed var(--mh-greystone); }
.bb-review ul { list-style: none; padding: 0; margin: 12px 0; }
.bb-error { color: var(--mh-heart-deep); font-weight: 600; font-size: 15px; min-height: 1.4em; }

/* ---------- forms ---------- */
.field { display: grid; gap: 6px; margin-bottom: 14px; }
.field label { font-weight: 600; font-size: 15px; }
.input { min-height: 48px; border-radius: 8px; border: 1px solid var(--mh-muted); background: #fff; padding: 0 14px; font-size: 16px; color: var(--mh-ink); width: 100%; }
.input:focus { border: 2px solid var(--mh-heart); outline: 3px solid var(--mh-ink); outline-offset: 2px; }
.on-dark .input { border-color: var(--mh-mist); }
.on-dark .input:focus { outline-color: var(--mh-paper); }
.err { color: var(--mh-heart-deep); font-size: 15px; font-weight: 600; min-height: 0; }
.on-dark .err { color: var(--mh-ochre); }
.check-row { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; line-height: 1.45; }
.check-row input { width: 22px; height: 22px; margin-top: 1px; accent-color: var(--mh-heart); flex-shrink: 0; }

/* ---------- age gate ---------- */
.age-gate { position: fixed; inset: 0; z-index: 400; background: rgba(26, 22, 20, .92); display: none; align-items: center; justify-content: center; padding: 16px; overflow-y: auto; }
html.gate-on .age-gate { display: flex; }
html.gate-on body { overflow: hidden; }
.age-card { background: var(--mh-paper); border-radius: 16px; width: min(100%, 460px); padding: 28px 24px 22px; position: relative; overflow: hidden; }
.age-card .brandline { display: flex; align-items: center; gap: 10px; margin-bottom: 18px; }
.age-card .brandline img.mark { height: 44px; width: auto; }
.age-card .brandline img.word { height: 30px; width: auto; }
.age-card h2 { font-family: var(--f-display); font-weight: 800; font-size: 36px; line-height: 1; font-variation-settings: "wdth" 78, "opsz" 72; letter-spacing: -.02em; margin-bottom: 10px; }
.dob { display: grid; grid-template-columns: 1fr 1fr 1.5fr; gap: 10px; margin: 18px 0 6px; }
.dob .field { margin: 0; }
.dob .input { text-align: center; font-size: 20px; font-family: var(--f-label); font-weight: 700; }
.age-legal { font-size: 14px; color: var(--mh-muted); margin-top: 14px; line-height: 1.45; }
.age-pulse { position: absolute; left: 0; right: 0; top: 0; height: 6px; background: var(--mh-heart); }
.age-denied { text-align: center; padding: 18px 0 4px; }

/* ---------- product tiles ---------- */
.tile { position: relative; display: flex; flex-direction: column; background: var(--mh-card); border: 1px solid var(--mh-greystone); border-radius: 12px; overflow: hidden; color: var(--mh-ink); }
.tile .pic { aspect-ratio: 1 / 1; display: grid; place-items: center; position: relative; }
.tile .pic img { width: 82%; height: auto; transition: transform var(--beat) var(--ease-enter); }
.tile:hover .pic img { transform: translateY(-4px); }
.tile .pic.paper { background: #EADFCC; }
.tile .pic.green { background: var(--mh-stalk); }
.tile .pic.ink { background: var(--mh-ink-2); }
.tile .pic .thc { position: absolute; top: 10px; left: 10px; }
.tile .body { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.tile .name { font-weight: 700; font-size: 17px; line-height: 1.2; }
.tile .name a { color: inherit; text-decoration: none; }
.tile .name a::after { content: ""; position: absolute; inset: 0; z-index: 0; }
.tile .price { font-family: var(--f-label); font-weight: 700; font-size: 15px; }
.tile .row { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: auto; position: relative; z-index: 1; }
.tile .row .textlink { font-size: 14px; }
.tile .soon { font-family: var(--f-label); font-weight: 700; font-size: 13px; color: var(--mh-muted); text-transform: uppercase; letter-spacing: .06em; }
.tile .add { position: relative; z-index: 1; }

/* ---------- footer ---------- */
.site-footer { background: var(--mh-ink); color: var(--mh-paper); padding: 64px 0 32px; position: relative; }
.site-footer .foot-pulse { position: absolute; left: 0; right: 0; top: -1px; height: 40px; transform: translateY(-50%); }
.site-footer .foot-pulse path { fill: none; stroke: var(--mh-heart); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.foot-grid { display: grid; gap: 32px; grid-template-columns: 1fr 1fr; }
@media (min-width: 1024px) { .foot-grid { grid-template-columns: 1.6fr 1fr 1fr 1fr 1fr; } }
.foot-grid .foot-brand { grid-column: 1 / -1; }
@media (min-width: 1024px) { .foot-grid .foot-brand { grid-column: auto; } }
.foot-grid h3 { font-family: var(--f-label); font-size: 13px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--mh-ochre); margin-bottom: 12px; }
.foot-grid ul { list-style: none; margin: 0; padding: 0; }
.foot-grid li a { display: inline-block; padding: 6px 0; color: var(--mh-paper); text-decoration: none; }
.foot-grid li a:hover { text-decoration: underline; }
.foot-brand img { height: 34px; width: auto; margin-bottom: 14px; }
.foot-legal { margin-top: 40px; padding-top: 20px; border-top: 1px solid #3A302B; font-size: 14px; color: var(--mh-mist); display: grid; gap: 10px; }
.foot-legal .fda { border: 1px solid #3A302B; border-radius: 8px; padding: 12px 14px; }
.socials { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 12px; }
.socials a { width: 44px; height: 44px; border-radius: 8px; display: grid; place-items: center; color: var(--mh-paper); border: 1px solid #3A302B; }
.socials svg { width: 20px; height: 20px; }
.concept-ribbon { justify-self: start; margin: 4px 0 0; font-family: var(--f-label); font-size: 12px; letter-spacing: .06em; text-transform: uppercase; color: var(--mh-mist); border: 1px dashed #5A4C44; border-radius: 6px; padding: 4px 8px; }
.rm-toggle { background: none; border: 1px solid #3A302B; color: var(--mh-paper); border-radius: 8px; min-height: 44px; padding: 0 14px; cursor: pointer; }

/* generic section helpers */
.section { padding: 64px 0; position: relative; }
@media (min-width: 1024px) { .section { padding: 96px 0; } }
.surface-ink { background: var(--mh-ink); color: var(--mh-paper); }
.surface-green { background: var(--mh-stalk); color: var(--mh-paper); }
.page-top { padding-top: calc(var(--header-h) + 18px); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; }
  .btn:hover { transform: none; }
}

/* Demo build 2026-11-15: drawers (cart, bundle, size) show product art over the page, so Hart steps out while one is open. */
body:has(.scrim.show) img[src*="hart.webp"], body:has(.scrim.show) .bubble { visibility: hidden !important; }
