/* ═══════════════════════════════════════════════════════════════════
   Rapid Roots — showcase site
   Brand: cream / blush rose / charcoal · Cormorant Garamond + Outfit
   ═══════════════════════════════════════════════════════════════════ */

:root {
  /* brand */
  --cream:      #F5F0EB;
  --porcelain:  #FDFBF9;
  --blush:      #D4A0A0;
  --rose:       #B87878;
  --gummy:      #F4C4C4;
  --charcoal:   #2D2D2D;
  --ink:        #1A1614;

  --line:       rgba(45, 45, 45, .14);
  --line-soft:  rgba(45, 45, 45, .08);
  --line-dark:  rgba(245, 240, 235, .16);

  /* type */
  --display: "Cormorant Garamond", "Times New Roman", serif;
  --body:    "Outfit", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

  --t-xs:  clamp(.69rem, .67rem + .08vw, .74rem);
  --t-sm:  clamp(.82rem, .79rem + .12vw, .89rem);
  --t-base:clamp(1rem, .96rem + .18vw, 1.09rem);
  --t-md:  clamp(1.1rem, 1.03rem + .3vw, 1.3rem);
  --t-lg:  clamp(1.5rem, 1.3rem + .9vw, 2.15rem);
  --t-xl:  clamp(2.1rem, 1.6rem + 2.2vw, 3.7rem);
  --t-hero:clamp(2.7rem, 1.7rem + 4.4vw, 5.6rem);

  --gut: clamp(1.25rem, .6rem + 2.8vw, 3.5rem);
  --shell: 1240px;

  --ease: cubic-bezier(.22, .61, .36, 1);
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--cream);
  color: var(--charcoal);
  font-family: var(--body);
  font-size: var(--t-base);
  font-weight: 300;
  line-height: 1.62;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

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

h1, h2, h3 {
  font-family: var(--display);
  font-weight: 300;
  letter-spacing: -.012em;
  line-height: 1.06;
  margin: 0;
}

:focus-visible {
  outline: 2px solid var(--rose);
  outline-offset: 3px;
  border-radius: 2px;
}

.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;
}

.skip-link {
  position: absolute; left: 50%; top: 0; z-index: 200;
  transform: translate(-50%, -120%);
  background: var(--ink); color: var(--cream);
  padding: .7rem 1.2rem; font-size: var(--t-sm); text-decoration: none;
}
.skip-link:focus { transform: translate(-50%, 0); }

.shell {
  width: 100%; max-width: var(--shell);
  margin-inline: auto;
  padding-inline: var(--gut);
}
.shell--narrow { max-width: 820px; }

/* ── shared type devices ─────────────────────────────────────────── */

.eyebrow {
  font-size: var(--t-xs);
  font-weight: 500;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--rose);
  margin: 0 0 1.1rem;
}

/* NB: `ch` on a wrapper resolves against the WRAPPER's font-size, not the
   display type inside it — a `34ch` wrapper is ~290px and forces the big
   serif headings to wrap every two or three words. Size the wrapper in rem
   and constrain the heading in `ch` on the heading itself. */
.lede { max-width: 46rem; margin-bottom: clamp(2.75rem, 5vw, 4.5rem); }
.lede h2 { font-size: var(--t-xl); max-width: 20ch; }
.lede__note {
  font-size: var(--t-md);
  margin: 1.4rem 0 0;
  max-width: 46ch;
  opacity: .78;
}
.lede--invert { color: var(--cream); }
.lede--invert .eyebrow { color: var(--blush); }

/* ── buttons ─────────────────────────────────────────────────────── */

.btn {
  display: inline-flex; align-items: center; gap: .6rem;
  font-family: var(--body);
  font-size: var(--t-sm);
  font-weight: 500;
  letter-spacing: .04em;
  text-decoration: none;
  padding: .82rem 1.5rem;
  border-radius: 999px;
  border: 1px solid transparent;
  transition: transform .35s var(--ease), background-color .35s var(--ease), color .35s var(--ease);
  white-space: nowrap;
}
.btn svg { width: 1.05em; height: 1.05em; fill: currentColor; flex: none; }
.btn:hover { transform: translateY(-2px); }

.btn--tiktok { background: var(--ink); color: var(--porcelain); }
.btn--tiktok:hover { background: var(--rose); }

.btn--lg { font-size: var(--t-base); padding: 1.05rem 2rem; }

/* ── ticker + masthead ───────────────────────────────────────────── */

.ticker {
  background: var(--rose); color: var(--porcelain);
  text-align: center;
  position: relative; z-index: 60;
}
.ticker p {
  margin: 0; padding: .58rem 1rem;
  font-size: var(--t-xs);
  letter-spacing: .11em;
  text-transform: uppercase;
  font-weight: 400;
}

.masthead {
  position: sticky; top: 0; z-index: 50;
  transition: background-color .4s var(--ease), border-color .4s var(--ease), backdrop-filter .4s var(--ease);
  border-bottom: 1px solid transparent;
}
.masthead__inner {
  max-width: var(--shell); margin-inline: auto;
  padding: 1.05rem var(--gut);
  display: flex; align-items: center; gap: clamp(1rem, 3vw, 2.5rem);
}

/* over the dark hero the bar is transparent; once past it, it solidifies */
.masthead--solid {
  background: rgba(253, 251, 249, .9);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom-color: var(--line-soft);
}

/* Centred, not baseline-aligned. Sharing a baseline between 22px serif caps and
   12px sans caps drops the small text to the bottom of the big one; optically
   they should sit across from each other. Both children are uppercase with
   line-height 1, so centring their boxes lines the cap bands up. */
.wordmark {
  display: flex; align-items: center; gap: .7rem;
  text-decoration: none; color: var(--porcelain);
  margin-right: auto;
  transition: color .4s var(--ease);
}
.wordmark__name {
  font-family: var(--display);
  font-size: clamp(1.15rem, 1rem + .5vw, 1.5rem);
  letter-spacing: .07em;
  text-transform: uppercase;
  line-height: 1;
}
/* Rides the parent's cross-axis centring. Under the old `align-items: baseline`
   this sat exactly where an underscore does, because a flex item with no text
   gets its baseline synthesised from its own bottom edge — and margin will not
   lift it, since Chrome synthesises from the border box, not the margin box. */
.wordmark__rule {
  width: 26px; height: 1px;
  background: currentColor;
  opacity: .5;
}
.wordmark__sub {
  font-size: var(--t-xs);
  line-height: 1;          /* hug the glyphs so centring is optical, not leading */
  letter-spacing: .16em;
  text-transform: uppercase;
  opacity: .72;
}
.masthead--solid .wordmark { color: var(--charcoal); }

.masthead__nav { display: flex; gap: clamp(1.1rem, 2.4vw, 2.2rem); }
.masthead__nav a {
  font-size: var(--t-sm);
  letter-spacing: .06em;
  text-decoration: none;
  color: var(--porcelain);
  opacity: .82;
  position: relative;
  padding-block: .3rem;
  transition: color .4s var(--ease), opacity .3s var(--ease);
}
.masthead__nav a::after {
  content: ""; position: absolute; left: 0; bottom: 0;
  width: 100%; height: 1px; background: currentColor;
  transform: scaleX(0); transform-origin: right;
  transition: transform .4s var(--ease);
}
.masthead__nav a:hover { opacity: 1; }
.masthead__nav a:hover::after { transform: scaleX(1); transform-origin: left; }
.masthead--solid .masthead__nav a { color: var(--charcoal); }

.masthead__cta { background: var(--porcelain); color: var(--ink); }
.masthead__cta:hover { background: var(--rose); color: var(--porcelain); }
.masthead--solid .masthead__cta { background: var(--ink); color: var(--porcelain); }
.masthead--solid .masthead__cta:hover { background: var(--rose); }

.masthead__toggle {
  display: none;
  width: 40px; height: 40px;
  background: none; border: 0; padding: 0; cursor: pointer;
  flex-direction: column; justify-content: center; align-items: flex-end; gap: 6px;
}
.masthead__toggle span {
  display: block; height: 1px; background: var(--porcelain);
  transition: background-color .4s var(--ease), transform .35s var(--ease), opacity .25s var(--ease);
}
.masthead__toggle span:nth-child(1) { width: 24px; }
.masthead__toggle span:nth-child(2) { width: 16px; }
.masthead--solid .masthead__toggle span { background: var(--charcoal); }
.masthead__toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(3.5px) rotate(45deg); }
.masthead__toggle[aria-expanded="true"] span:nth-child(2) { width: 24px; transform: translateY(-3.5px) rotate(-45deg); }

.drawer {
  position: fixed; inset: 0; z-index: 45;
  background: var(--ink);
  display: grid; place-items: center;
  animation: drawerIn .4s var(--ease);
}
.drawer[hidden] { display: none; }
@keyframes drawerIn { from { opacity: 0; } to { opacity: 1; } }
.drawer nav { display: flex; flex-direction: column; gap: 1.6rem; text-align: center; }
.drawer nav a {
  font-family: var(--display);
  font-size: clamp(1.9rem, 7vw, 2.8rem);
  color: var(--cream);
  text-decoration: none;
}
.drawer__shop {
  font-family: var(--body) !important;
  font-size: var(--t-sm) !important;
  letter-spacing: .16em; text-transform: uppercase;
  color: var(--blush) !important;
  margin-top: 1rem;
}

/* ═══ SHOWCASE (WebGL hero) ═══════════════════════════════════════ */

.showcase {
  position: relative;
  height: 100svh;
  min-height: 560px;
  margin-top: calc(-1 * var(--mast-h, 74px));
  background: var(--ink);
  overflow: hidden;
  isolation: isolate;
}

.showcase__canvas {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  display: block;
  opacity: 0;
  transition: opacity 1.1s var(--ease);
}
.showcase--live .showcase__canvas { opacity: 1; }

/* shown when WebGL is unavailable or reduced-motion is on */
.showcase__fallback {
  position: absolute; inset: 0;
  background-size: cover; background-position: center;
  transition: opacity .9s var(--ease), background-image 0s;
}
.showcase--live .showcase__fallback { opacity: 0; }

/* Anchored left so the copy has contrast, but clearing the right half
   entirely — the product photography is the point and a full-width wash
   turns it muddy. */
/* Clip sources for the WebGL textures. They must be in the document for iOS
   Safari to load them, but they are never seen — the canvas is the picture. */
.showcase__vid {
  position: absolute;
  width: 1px; height: 1px;
  top: 0; left: 0;
  opacity: 0;
  pointer-events: none;
}

.showcase__scrim {
  position: absolute; inset: 0;
  background:
    radial-gradient(120% 95% at 0% 100%, rgba(26, 22, 20, .92) 0%, rgba(26, 22, 20, .62) 32%, rgba(26, 22, 20, .18) 58%, transparent 76%),
    linear-gradient(to top, rgba(26, 22, 20, .52) 0%, transparent 40%),
    linear-gradient(to bottom, rgba(26, 22, 20, .40) 0%, transparent 24%);
}

/* Copy sits low-left. The bottle label runs through the vertical middle of
   every product frame, so centring the headline puts serif type straight on
   top of serif type. */
.showcase__body {
  position: relative; z-index: 2;
  height: 100%;
  max-width: var(--shell);
  margin-inline: auto;
  padding: var(--mast-h, 74px) var(--gut) clamp(6rem, 13vh, 8.5rem);
  display: flex; flex-direction: column; justify-content: flex-end;
  align-items: flex-start;
  max-inline-size: min(var(--shell), 100%);
  color: var(--porcelain);
}

.showcase__eyebrow {
  font-size: var(--t-xs);
  font-weight: 500;
  letter-spacing: .24em;
  text-transform: uppercase;
  color: var(--blush);
  margin: 0 0 1.3rem;
}

/* `balance` evens the lines out so a short word never strands on its own —
   "No chalk, / no / aftertaste" was wrapping badly at some widths. */
.showcase__title {
  font-size: var(--t-hero);
  line-height: .95;
  letter-spacing: -.02em;
  max-width: 12ch;
  text-wrap: balance;
  margin: 0;
}
/* words are the wrap unit; characters animate inside them */
.showcase__title .wd { display: inline-block; white-space: nowrap; }
.showcase__title .ch { display: inline-block; will-change: transform, opacity; }
.showcase__title .sp { display: inline; }

.showcase__desc {
  font-size: var(--t-md);
  font-weight: 200;
  max-width: 38ch;
  margin: 1.7rem 0 2.4rem;
  color: rgba(253, 251, 249, .84);
}

.showcase__body .btn { align-self: flex-start; }

/* slide counter */
.showcase__count {
  position: absolute; z-index: 3;
  left: var(--gut); bottom: clamp(2rem, 5vh, 3rem);
  display: flex; align-items: center; gap: .8rem;
  font-size: var(--t-xs);
  letter-spacing: .18em;
  color: rgba(253, 251, 249, .72);
  font-variant-numeric: tabular-nums;
}
.showcase__count-rule { width: 34px; height: 1px; background: currentColor; opacity: .45; }
.showcase__count-label {
  margin-left: .4rem; padding-left: 1rem;
  border-left: 1px solid rgba(253, 251, 249, .28);
  letter-spacing: .14em; text-transform: uppercase;
  color: var(--porcelain);
  white-space: nowrap;
}

/* slide navigation — progress lines double as the timer */
.showcase__nav {
  position: absolute; z-index: 3;
  right: var(--gut); bottom: clamp(2rem, 5vh, 3rem);
  display: flex; gap: .75rem;
  align-items: flex-end;
}
.snav {
  background: none; border: 0; padding: .5rem 0 0; cursor: pointer;
  width: clamp(30px, 5vw, 62px);
  display: block;
  color: rgba(253, 251, 249, .6);
  transition: color .35s var(--ease);
}
.snav:hover, .snav.is-active { color: var(--porcelain); }
.snav__line {
  height: 2px; width: 100%;
  background: rgba(253, 251, 249, .26);
  overflow: hidden; border-radius: 2px;
}
.snav__fill {
  display: block; height: 100%; width: 0;
  background: var(--porcelain);
  transition: width .1s linear, opacity .3s var(--ease);
}
.snav__line { display: block; }

/* ═══ brand marquee band ══════════════════════════════════════════ */

.band {
  background: var(--ink);
  color: var(--cream);
  overflow: hidden;
  padding: 1.15rem 0;
  border-block: 1px solid var(--line-dark);
}
.band__track {
  display: flex; align-items: center; gap: 2.4rem;
  width: max-content;
  animation: bandroll 44s linear infinite;
}
.band__track span {
  font-family: var(--display);
  font-size: clamp(1.05rem, .9rem + .5vw, 1.5rem);
  letter-spacing: .05em;
  white-space: nowrap;
  opacity: .9;
}
.band__track i { width: 5px; height: 5px; border-radius: 50%; background: var(--blush); flex: none; }
@keyframes bandroll { to { transform: translateX(-50%); } }

/* ═══ formula ═════════════════════════════════════════════════════ */

.formula { padding-block: clamp(4.5rem, 10vw, 8.5rem); background: var(--cream); }

.formula__grid {
  display: grid;
  grid-template-columns: minmax(0, .82fr) minmax(0, 1fr);
  gap: clamp(2.25rem, 5vw, 4.5rem);
  align-items: start;
}
.formula__shot { margin: 0; position: sticky; top: 110px; }
.formula__shot img { border-radius: 3px; }

.formula__list dl { margin: 0; }
.formula__list .active {
  padding: 1.35rem 0;
  border-top: 1px solid var(--line);
}
.formula__list .active:first-child { border-top: 0; padding-top: 0; }
.formula__list dt {
  font-family: var(--display);
  font-size: var(--t-lg);
  display: flex; align-items: baseline; gap: .7rem;
  margin-bottom: .45rem;
}
.formula__list dt span {
  font-family: var(--body);
  font-size: var(--t-xs);
  font-weight: 500;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--rose);
}
.formula__list dd { margin: 0; max-width: 48ch; opacity: .8; }

.formula__other {
  margin: 2rem 0 0;
  padding-top: 1.5rem;
  border-top: 1px solid var(--line);
  font-size: var(--t-sm);
  opacity: .62;
  max-width: 58ch;
}
.formula__other strong { font-weight: 500; }

/* ═══ routine ═════════════════════════════════════════════════════ */

.routine {
  background: var(--ink);
  color: var(--cream);
  padding-block: clamp(4.5rem, 10vw, 8.5rem);
}

.stages {
  list-style: none; margin: 0; padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: clamp(1.75rem, 4vw, 3.25rem);
}
.stages li { padding-top: 1.6rem; border-top: 1px solid var(--line-dark); }
.stages__mark {
  font-size: var(--t-xs);
  font-weight: 500;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--blush);
  margin: 0 0 1.1rem;
  font-variant-numeric: tabular-nums;
}
.stages h3 { font-size: var(--t-lg); margin-bottom: .8rem; }
.stages p { margin: 0; opacity: .74; font-size: var(--t-sm); }
.stages h3 + p { font-size: var(--t-base); }

/* ═══ standards ═══════════════════════════════════════════════════ */

.standards { background: var(--porcelain); padding-block: clamp(4.5rem, 10vw, 8.5rem); }
.standards__grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(2.25rem, 5vw, 5rem);
  align-items: center;
}
.standards__shot { margin: 0; }
.standards__shot img { border-radius: 3px; }
.standards__body h2 { font-size: var(--t-xl); margin-bottom: 2.2rem; }

.marks { list-style: none; margin: 0; padding: 0; }
.marks li {
  padding: 1.15rem 0;
  border-top: 1px solid var(--line);
  font-size: var(--t-sm);
  opacity: .82;
}
.marks li span {
  display: block;
  font-family: var(--display);
  font-size: var(--t-md);
  letter-spacing: .01em;
  color: var(--charcoal);
  opacity: 1;
  margin-bottom: .3rem;
}

/* ═══ faq ═════════════════════════════════════════════════════════ */

.faq { background: var(--cream); padding-block: clamp(4.5rem, 10vw, 8.5rem); }
.faq .lede { margin-inline: auto; text-align: center; max-width: 34rem; }
.faq .lede h2 { max-width: none; }

.accordion { border-top: 1px solid var(--line); }
.accordion details { border-bottom: 1px solid var(--line); }
.accordion summary {
  list-style: none;
  cursor: pointer;
  padding: 1.4rem 2.5rem 1.4rem 0;
  position: relative;
  font-family: var(--display);
  font-size: var(--t-md);
  transition: color .3s var(--ease);
}
.accordion summary::-webkit-details-marker { display: none; }
.accordion summary:hover { color: var(--rose); }
.accordion summary::after {
  content: ""; position: absolute; right: .35rem; top: 50%;
  width: 11px; height: 11px;
  border-right: 1px solid currentColor; border-bottom: 1px solid currentColor;
  transform: translateY(-70%) rotate(45deg);
  transition: transform .35s var(--ease);
}
.accordion details[open] summary::after { transform: translateY(-25%) rotate(-135deg); }
.accordion details > div { padding: 0 2.5rem 1.5rem 0; }
.accordion details p { margin: 0; opacity: .78; max-width: 62ch; }

/* ═══ closer ══════════════════════════════════════════════════════ */

.closer {
  background: var(--ink);
  color: var(--cream);
  padding-block: clamp(5rem, 11vw, 9rem);
  text-align: center;
}
.closer .eyebrow { color: var(--blush); }
.closer__inner { max-width: 38rem; margin-inline: auto; }
.closer h2 { font-size: var(--t-xl); }
.closer p { margin: 1.4rem auto 2.5rem; opacity: .76; max-width: 40ch; }
.closer .btn--tiktok { background: var(--porcelain); color: var(--ink); }
.closer .btn--tiktok:hover { background: var(--blush); }

/* ═══ footer ══════════════════════════════════════════════════════ */

.foot {
  background: var(--porcelain);
  padding-block: clamp(3rem, 6vw, 4.5rem);
  border-top: 1px solid var(--line-soft);
}
.foot__top {
  display: flex; flex-wrap: wrap; gap: 1.5rem 2.5rem;
  align-items: center; justify-content: space-between;
  padding-bottom: 2.25rem;
  border-bottom: 1px solid var(--line-soft);
  margin-bottom: 2.25rem;
}
.wordmark--foot { color: var(--charcoal); margin-right: 0; }
.foot__nav { display: flex; flex-wrap: wrap; gap: 1.5rem; }
.foot__nav a {
  font-size: var(--t-sm); text-decoration: none; opacity: .72;
  transition: opacity .3s var(--ease);
}
.foot__nav a:hover { opacity: 1; }

.foot__legal {
  font-size: var(--t-xs);
  line-height: 1.7;
  opacity: .56;
  max-width: 92ch;
  margin: 0 0 1rem;
}
.foot__meta {
  font-size: var(--t-xs);
  opacity: .48;
  margin: 1.75rem 0 0;
}

/* ═══ reveal-on-scroll ════════════════════════════════════════════ */

[data-reveal] {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity .85s var(--ease), transform .85s var(--ease);
}
[data-reveal].is-in { opacity: 1; transform: none; }

/* ═══ responsive ══════════════════════════════════════════════════ */

@media (max-width: 900px) {
  .masthead__nav, .masthead__cta { display: none; }
  .masthead__toggle { display: flex; }

  .formula__grid, .standards__grid { grid-template-columns: minmax(0, 1fr); }
  .formula__shot { position: static; max-width: 460px; }
  .standards__shot { max-width: 460px; }

  .showcase__scrim {
    background:
      linear-gradient(to top, rgba(26, 22, 20, .88) 0%, rgba(26, 22, 20, .45) 45%, rgba(26, 22, 20, .3) 100%);
  }
  .showcase__nav { right: var(--gut); bottom: clamp(1.4rem, 4vh, 2rem); }
  .showcase__count { left: var(--gut); bottom: clamp(1.4rem, 4vh, 2rem); }
  .showcase__count-label { display: none; }
  .showcase__body { padding-bottom: clamp(7rem, 18vh, 10rem); }
}

@media (max-width: 560px) {
  .showcase__title { max-width: 11ch; }
  .snav { width: 34px; }
  .foot__top { flex-direction: column; align-items: flex-start; }
}

/* ═══ reduced motion ══════════════════════════════════════════════ */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
  [data-reveal] { opacity: 1; transform: none; }
  .band__track { animation: none; }
}
