/* =====================================================================
   FLOW: build 2 (owner, 18 Nov 2026)

   Loaded after store.css. The Hims-style hero (three options, picked by
   home.hero in store.data.json), the homepage that gets to products
   straight away, transparent vials on soft grounds, GoldMorrow's lid on
   the product page, price and Add to cart above the fold on a phone, the
   cart's next-tier meter, and fluid motion. Every animation here stops
   under prefers-reduced-motion (last section).
   ===================================================================== */

:root {
  --spring:   cubic-bezier(.2, 1.15, .32, 1);     /* a little overshoot */
  --glide:    cubic-bezier(.22, .9, .26, 1);
  --vial-ground: radial-gradient(60% 46% at 50% 62%, color-mix(in srgb, var(--bright) 9%, transparent), transparent 72%),
                 linear-gradient(180deg, #F7F9FD 0%, var(--ice) 100%);
  --warm-wash: radial-gradient(70% 90% at 78% 38%, color-mix(in srgb, var(--sky) 22%, transparent), transparent 64%),
               radial-gradient(60% 70% at 10% 100%, color-mix(in srgb, #FFE9D6 70%, transparent), transparent 70%),
               linear-gradient(180deg, #FBFCFE 0%, var(--ice) 100%);
}

/* Short, centred and heading text never leaves a lone word (owner rule). */
.gate__title, .hero2__h, .hero2__sub, .volband h2, .volband p, .trust2__h, .tiernote, .cart-tier { text-wrap: balance; }
.pdp__lede, .trust2__list span { text-wrap: pretty; }

.textlink { display: inline-flex; align-items: center; gap: 8px; font: var(--fw-bold) 15px/1.2 var(--font-display); color: var(--accent); text-decoration: none; }
.textlink svg { width: 14px; height: 14px; transition: transform .35s var(--spring); }
.textlink:hover svg { transform: translateX(4px); }
.btn--lg { min-height: 56px; padding: 18px 36px; font-size: 16px; border-radius: var(--radius-pill); }

/* ---- 1. Hero ---------------------------------------------------------- */

.hero2 { position: relative; overflow: hidden; background: var(--warm-wash); }
.hero2__in { position: relative; z-index: 1; }
.hero2__h {
  margin: 0; font: var(--fw-black) clamp(40px, 4.3vw, 64px)/1.02 var(--font-display);
  letter-spacing: -.035em; color: var(--text);
}
.hero2__h em { font-style: normal; color: var(--royal); }
.hero2__sub { margin: 22px 0 32px; max-width: 40ch; font-size: clamp(17px, 1.5vw, 20px); line-height: 1.55; color: var(--text-body); }
.hero2__vials { display: block; width: 100%; height: auto; }

/* studio: copy left, vials right, generous air (recommended) */
.hero2--studio .hero2__in,
.hero2--navy .hero2__in {
  display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); align-items: center;
  gap: clamp(20px, 4vw, 64px); min-height: min(78vh, 760px);
  padding-top: clamp(40px, 6vw, 80px); padding-bottom: clamp(32px, 5vw, 64px);
}
.hero2--studio .hero2__art, .hero2--navy .hero2__art { max-width: 640px; justify-self: center; width: 100%; }

/* centered: one statement, the vials rising underneath */
.hero2--centered { text-align: center; }
.hero2--centered .hero2__in { display: flex; flex-direction: column; align-items: center; padding-top: clamp(56px, 8vw, 110px); }
.hero2--centered .hero2__h { max-width: 18ch; font-size: clamp(40px, 5.4vw, 80px); }
.hero2--centered .hero2__sub { margin-left: auto; margin-right: auto; }
.hero2--centered .hero2__stage { width: min(720px, 92vw); margin: clamp(8px, 2vw, 24px) auto 0; }

/* navy: the brand's dark panel, a sky accent */
.hero2--navy { background: radial-gradient(70% 90% at 78% 40%, color-mix(in srgb, var(--bright) 42%, transparent), transparent 62%),
                           linear-gradient(160deg, var(--navy) 0%, var(--navy-deep) 100%); }
.hero2--navy .hero2__h { color: #fff; }
.hero2--navy .hero2__h em { color: var(--sky); }
.hero2--navy .hero2__sub { color: color-mix(in srgb, #fff 78%, transparent); }
.hero2--navy .btn--solid { background: #fff; border-color: #fff; color: var(--navy); }
.hero2--navy .btn--solid:hover { background: var(--sky); border-color: var(--sky); color: var(--navy); }

@media (max-width: 900px) {
  .hero2--studio .hero2__in, .hero2--navy .hero2__in {
    grid-template-columns: minmax(0, 1fr); min-height: 0; text-align: left;
    padding-top: 28px; padding-bottom: 36px; gap: 8px;
  }
  .hero2--studio .hero2__art, .hero2--navy .hero2__art { order: -1; max-width: 420px; margin: 0 auto; }
  .hero2__h { font-size: clamp(38px, 11vw, 52px); }
  .hero2__sub { margin: 14px 0 22px; }
  .hero2__cta { width: 100%; }
  .hero2--centered .hero2__in { padding-top: 36px; }
}

/* ---- 2. Homepage ------------------------------------------------------ */

.sechead--row { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; flex-direction: row; margin-bottom: 18px; }
.sechead--row h2 { margin: 0; font-size: clamp(28px, 3vw, 40px); }
.homeshop { padding-top: clamp(40px, 5vw, 72px); }
.famchips--home { display: flex; gap: 8px; overflow-x: auto; margin: 0 0 22px; padding-bottom: 4px; scrollbar-width: none; }
.famchips--home::-webkit-scrollbar { display: none; }
.famchips--home .chip-f { flex: none; }

.volband { background: #fff; border-top: 1px solid var(--line-faint); }
.volband__in { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: clamp(24px, 5vw, 80px); align-items: center; }
.volband h2 { font-size: clamp(30px, 3.4vw, 46px); line-height: 1.05; margin: 0 0 12px; max-width: 16ch; }
.volband p { margin: 0 0 22px; color: var(--text-body); font-size: 17px; max-width: 38ch; }
.volsteps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.volsteps li {
  padding: clamp(18px, 2.4vw, 28px) 16px; border-radius: 20px; text-align: center;
  background: var(--vial-ground); border: 1px solid var(--line-faint);
}
.volsteps li:last-child { background: var(--navy); border-color: var(--navy); }
.volsteps b { display: block; font: var(--fw-black) clamp(34px, 4vw, 52px)/1 var(--font-display); letter-spacing: -.03em; color: var(--royal); }
.volsteps span { display: block; margin-top: 8px; font-size: 14px; color: var(--text-dim); }
.volsteps li:last-child b { color: var(--sky); }
.volsteps li:last-child span { color: color-mix(in srgb, #fff 76%, transparent); }

.trust2__h { margin: 0 0 22px; font-size: clamp(28px, 3vw, 40px); }
.trust2__list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.trust2__list li { padding: 22px; background: #fff; border-radius: 18px; border: 1px solid var(--line-faint); }
.trust2__list b { display: block; font: var(--fw-bold) 17px/1.3 var(--font-display); color: var(--text); margin-bottom: 6px; }
.trust2__list span { font-size: 15px; line-height: 1.6; color: var(--text-body); }
.trust2__more { margin: 20px 0 0; }

@media (max-width: 900px) {
  .volband__in { grid-template-columns: minmax(0, 1fr); }
  .trust2__list { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 420px) {
  .volsteps { gap: 8px; }
  .volsteps li { padding: 16px 6px; border-radius: 16px; }
  .volsteps span { font-size: 12px; }
}

/* ---- 3. Product cards: transparent vials on a soft ground -------------- */

.pcard { border-radius: 20px; transition: transform .5s var(--glide), box-shadow .5s var(--glide), border-color .3s; }
.pcard:hover { transform: translateY(-4px); box-shadow: var(--shadow-lift); }
.pcard__media { background: var(--vial-ground); border-radius: 20px 20px 0 0; }
.pcard__media img { aspect-ratio: 4 / 5; object-fit: contain; object-position: 50% 60%; padding: 6% 0 0; transition: transform .7s var(--glide), opacity .5s; }
.pcard:hover .pcard__media img { transform: translateY(-6px) scale(1.03); }
@media (max-width: 768px) {
  .pcard__media img { max-width: 100%; padding: 4% 6% 0; }
  .pcard .btn { font-size: 13px; letter-spacing: 0; min-height: 44px; }
}

/* Add to cart feedback: press, then a check while the cart opens. */
[data-add-to-cart] { position: relative; }
.btn.is-adding { pointer-events: none; }
.btn.is-added { background: var(--ok); border-color: var(--ok); color: #fff; }
.btn.is-added::after {
  content: ""; width: 14px; height: 8px; margin-left: 8px; flex: none;
  border-left: 2.5px solid currentColor; border-bottom: 2.5px solid currentColor;
  transform: translateY(-2px) rotate(-45deg); animation: tick .45s var(--spring) both;
}
@keyframes tick { from { opacity: 0; transform: translateY(-2px) rotate(-45deg) scale(.4); } }

/* ---- 4. Product page --------------------------------------------------- */

.pdp__media { background: var(--vial-ground); border-radius: 24px; border-color: var(--line-faint); }
.pdp__media > img { object-fit: contain; object-position: 50% 50%; }

/* GoldMorrow's lid (11 Nov 2026): the vial with its closure off, the
   closure on top, lifting along the vial's axis. Upright vial here, so
   the lift is straight up. Hover on a mouse, tap on a phone. */
/* The lid box IS the image's frame (2:3, full height, centred), the same
   box object-fit: contain gives #pdp-main, so the cap's percentages from
   cap.json land on the photo exactly. */
.lid {
  /* 9% headroom above, so the lifted cap stays inside the stage. */
  position: absolute; top: 9%; left: 50%; height: 91%; aspect-ratio: 2 / 3;
  transform: translateX(-50%); z-index: 1; cursor: pointer; -webkit-tap-highlight-color: transparent;
}
.lid img { position: absolute; display: block; max-width: none; pointer-events: none; }
.lid__vial { inset: 0; width: 100%; height: 100%; }
.lid__cap {
  height: auto; transform: translate3d(0, 0, 0); transform-origin: 50% 100%;
  transition: transform .7s var(--spring), filter .5s var(--glide);
}
.pdp__media.has-lid #pdp-main { opacity: 0; }
.pdp__media.is-alt .lid { display: none; }
.pdp__media.is-alt #pdp-main { opacity: 1; object-fit: cover; object-position: 50% 50%; }
@media (hover: hover) {
  .pdp__media:hover .lid__cap { transform: translate3d(0, -58%, 0); filter: drop-shadow(0 18px 14px rgba(6, 25, 77, .18)); }
}
.lid.is-open .lid__cap { transform: translate3d(0, -58%, 0); filter: drop-shadow(0 18px 14px rgba(6, 25, 77, .18)); }

.pdp__pricerow { margin-top: 14px; }
.pdp__pricerow .pbadge, .pdp__pricerow .lotchip { align-self: center; }
.btn--atc { min-height: 56px; font-size: 16px; border-radius: var(--radius-pill); }
.tiernote { margin: 12px 0 0; font-size: 14px; line-height: 1.5; color: var(--text-dim); }
.tiernote b { color: var(--text); font-weight: var(--fw-bold); }
.tiernote a { white-space: nowrap; }
.pdp__info .packs { margin-top: 18px; }
.pdp__info .coabtn { margin-top: 18px; }
.pdp__info .shipbar { margin-top: 18px; }
.pdp__info .pdp__lede { margin: 22px 0 12px; }
.pbadge--sku { font-family: var(--font-mono); letter-spacing: .04em; text-transform: none; }

@media (max-width: 900px) {
  .pdp-sec { padding-top: 12px; }
  .pdp-sec .crumbs { display: none; }
  .pdp { gap: 14px; }
  .pdp__gallery { position: relative; top: 0; }
  /* A short stage, so title, price, strength and Add to cart are on the
     first screen of a phone (owner, 18 Nov 2026). */
  .pdp__media > img, .pdp__media { max-height: 38vh; }
  .pdp__media { aspect-ratio: 5 / 4; }
  .pdp__media > img { height: 100%; aspect-ratio: auto; }
  .mchips { display: none; }
  .pdp__thumbs { position: absolute; right: 10px; top: 10px; flex-direction: column; gap: 6px; margin: 0; z-index: 2; }
  .thumb { width: 44px; height: 44px; border-radius: 12px; background: #fff; }
  .pdp__title { font-size: clamp(28px, 8vw, 36px); margin: 4px 0 0; }
  .pdp__pricerow { margin: 8px 0 0; gap: 10px; }
  .pdp__price { font-size: 28px; }
  .opt { margin-top: 12px; }
  .opt__label { margin-bottom: 8px; }
  #pdp-atc { margin-top: 14px; }
}

/* ---- 5. Cart: the next tier, as a meter -------------------------------- */

.cart-tier { display: block; padding: 12px 14px; margin-bottom: 12px; border-radius: 14px; background: var(--accent-soft); border: 1px solid var(--accent-line); }
.cart-tier__msg { display: block; font: var(--fw-bold) 14px/1.35 var(--font-display); color: var(--text); }
.cart-tier__sub { display: block; margin-top: 2px; font-size: 13px; color: var(--text-dim); }
.tiermeter { position: relative; height: 6px; margin: 12px 4px 20px; border-radius: 6px; background: color-mix(in srgb, var(--navy) 10%, transparent); }
.tiermeter i { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 6px; background: var(--bright); transition: width .6s var(--glide); }
.tiermeter span {
  position: absolute; top: 50%; width: 14px; height: 14px; margin: -7px 0 0 -7px; border-radius: 50%;
  background: #fff; border: 2px solid color-mix(in srgb, var(--navy) 22%, transparent); transition: background .3s, border-color .3s;
}
.tiermeter span.is-on { background: var(--bright); border-color: var(--bright); }
.tiermeter small { position: absolute; top: 12px; left: 50%; transform: translateX(-50%); font: 600 11px/1 var(--font-display); color: var(--text-dim); white-space: nowrap; }

/* ---- 6. Motion --------------------------------------------------------- */

/* Page to page: a soft cross-fade where the browser supports it. */
@view-transition { navigation: auto; }
::view-transition-old(root) { animation: vt-out .22s var(--glide) both; }
::view-transition-new(root) { animation: vt-in .38s var(--glide) both; }
@keyframes vt-out { to { opacity: 0; } }
@keyframes vt-in { from { opacity: 0; transform: translateY(8px); } }

/* Buttons answer the finger. */
.btn, .vpill, .chip-f, .pack, .thumb { transition: transform .35s var(--spring), background var(--t-fast), border-color var(--t-fast), color var(--t-fast), box-shadow var(--t-fast); }
.btn:active, .vpill:active, .chip-f:active, .pack:active, .thumb:active { transform: scale(.96); transition-duration: .08s; }

/* Reveals: only once motion.js has run (html.motion), so a page without
   script, or a crawler, sees everything at once. */
html.motion [data-reveal]:not(.is-in),
html.motion [data-reveal-group] > :not(.is-in) { opacity: 0; transform: translateY(18px); }
html.motion [data-reveal], html.motion [data-reveal-group] > * {
  transition: opacity .7s var(--glide), transform .8s var(--glide);
  transition-delay: calc(var(--i, 0) * 60ms);
}
/* The headline and the line under it rise in; the button is there at
   once (DESIGN.md: the call to action never waits on an animation). */
.hero2__h, .hero2__sub { animation: rise .9s var(--glide) both; }
.hero2__sub { animation-delay: .08s; }
.hero2__cta, .hero__ctas { animation: none; }
@media (max-width: 900px) { .hero__ctas .btn { width: 100%; } }
.hero2__art, .hero2__stage { animation: float-in 1.2s var(--glide) .1s both; }
@keyframes rise { from { opacity: 0; transform: translateY(16px); } }
@keyframes float-in { from { opacity: 0; transform: translateY(28px) scale(.98); } }

/* Images settle in when they arrive (motion.js adds .is-loaded). */
html.motion img.fade:not(.is-loaded) { opacity: 0; }
html.motion img.fade { transition: opacity .6s var(--glide); }

.cart-drawer { transition-timing-function: var(--glide); }

@media (prefers-reduced-motion: reduce) {
  @view-transition { navigation: none; }
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
  html.motion [data-reveal], html.motion [data-reveal-group] > *, html.motion img.fade { opacity: 1 !important; transform: none !important; }
  .pcard:hover, .pcard:hover .pcard__media img { transform: none; }
}

/* The vial thumbnail shows the whole vial, not a crop of its middle. */
.thumb[data-variant-thumb] img { object-fit: contain; background: var(--vial-ground); }
