/*
 * Homepage sections below the hero. Tokens (--brand, --ink, --paper, --white, --muted, --ease-out, radii, shadows)
 * come from design-tokens.css + the shared block at the top of hero.css.
 */

/* ---------- Shared section basics ---------- */
.bm-section *, .bm-section *::before, .bm-section *::after { box-sizing: border-box; }
.bm-section :where(p, h2, h3, ul, figure) { margin: 0; padding: 0; }
.bm-section :where(ul) { list-style: none; }
.bm-section a { color: inherit; text-decoration: none; }
.bm-section :focus-visible { outline: 2px solid var(--brand); outline-offset: 3px; }

.bm-wrap { width: min(1280px, calc(100% - 48px)); margin-inline: auto; }

.bm-sec-head {
	display: grid;
	grid-template-columns: 1fr auto;
	align-items: end;
	gap: 24px;
	margin-bottom: clamp(32px, 4vw, 48px);
}
/* Section label = the "Our story" pill everywhere: looks like a button, isn't one; same font as body text */
.bm-sec-kicker {
	display: inline-flex;
	align-items: center;
	margin-bottom: 16px;
	padding: 8px 18px;
	border-radius: var(--radius-md);
	background: #e7edf2;                      /* lighter tint of #ced8e2 */
	font-family: inherit;
	font-size: var(--text-base);
	font-weight: 500;
	line-height: 1.3;
	color: var(--brand);
	cursor: default;
	user-select: none;
}
.bm-sec-title {
	font-size: clamp(32px, 4vw, 56px);
	font-weight: 500;
	line-height: 1.05;
	letter-spacing: -.04em;
	color: var(--ink);
}
.bm-sec-sub { max-width: 52ch; margin-top: 16px; font-size: var(--text-2xl); line-height: 1.5; color: rgba(36, 31, 33, .7); }
.bm-link {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 8px 0;
	font-size: var(--text-lg);
	font-weight: 500;
	color: var(--brand) !important;
	white-space: nowrap;
	border-bottom: 1px solid currentColor;
}
.bm-link span { transition: transform .25s var(--ease-out); }
.bm-link:hover span { transform: translateX(4px); }

/* ---------- Our story + counters (white band, brand navy numbers) ---------- */
.bm-story { padding: clamp(56px, 6vw, 96px) 0; background: var(--white); color: var(--ink); }
/* Side padding = the hero's 76px edge strip, so the content lines up with it */
.bm-story .bm-wrap { width: calc(100% - 2 * var(--strip)); }
.bm-story__grid { display: grid; grid-template-columns: minmax(0, 6fr) minmax(0, 4fr); gap: clamp(40px, 5vw, 96px); align-items: start; } /* 60 / 40 */
/* Label row holding the shared .bm-sec-kicker pill */
.bm-story__kicker { display: flex; align-items: center; margin-bottom: clamp(24px, 3vw, 40px); }
.bm-story__kicker .bm-sec-kicker { margin-bottom: 0; }
.bm-story__statement {
	max-width: 44ch;
	font-size: clamp(24px, 2.4vw, 36px);
	font-weight: 400;
	line-height: 1.32;
	letter-spacing: -.02em;
	color: var(--ink);
}
.bm-story__cta { gap: 10px; margin-top: clamp(28px, 3vw, 40px); }
.bm-story__cta span { transition: transform .25s var(--ease-out); }
.bm-story__cta:hover span { transform: translateX(4px); }

/* Counters: stacked rows in the right half; number left, label right, hairline between rows */
.bm-story__counters { margin-top: clamp(0px, 5vw, 88px); }   /* starts a little lower than the statement, like the reference */
.bm-count {
	position: relative;
	display: grid;
	grid-template-columns: 1fr auto;
	align-items: start;
	gap: 16px;
	padding: 18px 0 clamp(22px, 2.4vw, 36px);
}
.bm-count::before {                         /* hairline that draws in */
	content: "";
	position: absolute;
	inset: 0 0 auto 0;
	height: 1px;
	background: rgba(36, 31, 33, .16);
	transform-origin: left;
}
.bm-count__num {
	font-size: clamp(40px, 3.6vw, 64px);
	font-weight: 400;
	line-height: .95;
	white-space: nowrap;
	letter-spacing: -.05em;
	color: var(--brand);
	font-variant-numeric: tabular-nums;
}
.bm-count__label { padding-top: 6px; font-size: var(--text-lg); line-height: 1.4; text-align: right; color: rgba(36, 31, 33, .72); }

/* Scroll-in animation (only when motion is OK; JS adds .is-in) */
@media (prefers-reduced-motion: no-preference) {
	.bm-story__kicker { opacity: 0; transform: translateY(10px); transition: opacity .6s var(--ease-out), transform .6s var(--ease-out); }
	.bm-story__cta { opacity: 0; transform: translateY(12px); transition: opacity .6s var(--ease-out) 1.2s, transform .6s var(--ease-out) 1.2s, background-color .2s; }
	.bm-story.is-in .bm-story__cta { opacity: 1; transform: none; }
	.bm-story .w { display: inline-block; opacity: 0; transform: translateY(.4em); transition: opacity .6s var(--ease-out), transform .6s var(--ease-out); transition-delay: calc(var(--w) * 28ms + .15s); }
	.bm-count::before { transform: scaleX(0); transition: transform 1.1s var(--ease-out); transition-delay: calc(var(--i) * .15s + .2s); }
	.bm-count__num, .bm-count__label { opacity: 0; transform: translateY(14px); transition: opacity .7s var(--ease-out), transform .7s var(--ease-out); transition-delay: calc(var(--i) * .15s + .45s); }
	.bm-story.is-in .bm-story__kicker,
	.bm-story.is-in .w,
	.bm-story.is-in .bm-count__num,
	.bm-story.is-in .bm-count__label { opacity: 1; transform: none; }
	.bm-story.is-in .bm-count::before { transform: none; }
}

/* ---------- Sleep scroll-story ----------
   Default (phones, reduced motion, no JS): six stacked blocks, each image shown WHOLE (never cropped) with its text below.
   Desktop + JS adds .is-pinned: the stage sticks, steps crossfade as you scroll, the rail jumps between them. */
.bm-scroll { --stage-bg: #c2cfde; background: var(--white); color: var(--ink); }   /* card colour = average of the six photos' backdrops */
.bm-scroll__stage { padding: clamp(56px, 8vw, 96px) 0; }
.bm-scroll__head { width: calc(100% - 32px); margin: 0 auto clamp(24px, 3vw, 40px); text-align: center; }
.bm-scroll__head .bm-sec-kicker { justify-content: center; }
/* Rounded container: same side padding as the Our Story section (the hero's 76px edge strip) */
.bm-scroll__card { position: relative; margin: 0; padding: 0; border-radius: 0; background: none; overflow: hidden; }   /* stacked: blue photo on top, text on white below (pinned sets the blue stage) */
.bm-scroll__title { font-size: clamp(32px, 4vw, 52px); font-weight: 500; line-height: 1.05; letter-spacing: -.04em; }
.bm-step + .bm-step { margin-top: 56px; }
.bm-step__img { display: block; width: 100%; height: auto; }                 /* whole image, natural ratio */
.bm-step__text { width: calc(100% - 32px); margin: 20px auto 0; }
.bm-step__count { font-size: var(--text-sm); letter-spacing: .08em; color: rgba(36, 31, 33, .55); font-variant-numeric: tabular-nums; }
.bm-step__title { margin-top: 10px; font-size: clamp(30px, 3.6vw, 56px); font-weight: 500; line-height: 1.04; letter-spacing: -.04em; }
.bm-step__sub { margin-top: 14px; max-width: 34ch; font-size: var(--text-2xl); line-height: 1.45; color: rgba(36, 31, 33, .72); }
.bm-step__facts { display: grid; gap: 8px; margin-top: 20px; font-size: var(--text-lg); }
.bm-step__facts li { display: flex; gap: 10px; align-items: baseline; }
.bm-step__facts li::before { content: "✓"; color: var(--brand); font-weight: 600; }
.bm-step .bm-pill { gap: 10px; margin-top: 26px; }
.bm-scroll__rail { display: none; }
.bm-scroll__all { margin: 40px 16px 0; }

/* ---------- Pinned (desktop) ---------- */
.bm-scroll.is-pinned .bm-scroll__track { height: calc(100svh + 5 * 75svh); }    /* ~75% of a screen of scrolling per step */
.bm-scroll.is-pinned .bm-scroll__stage {
	position: sticky;
	top: 0;
	height: 100svh;
	min-height: 640px;
	display: flex;
	flex-direction: column;
	padding: clamp(28px, 4vh, 48px) 0 0;          /* the blue stage runs to the bottom of the screen */
}
.bm-scroll.is-pinned .bm-scroll__card { flex: 1; padding: 0; }
.bm-scroll.is-pinned .bm-step { position: absolute; inset: 0; margin: 0; visibility: hidden; transition: visibility 0s .6s; }
.bm-scroll.is-pinned .bm-step.is-active { visibility: visible; transition: visibility 0s; }
/* Image: whole picture, 92% wide, right-aligned and vertically centred; its empty left side fades into the stage */
.bm-scroll.is-pinned .bm-step__img {
	position: absolute;
	top: 50%;
	right: 0;
	width: 92%;
	opacity: 0;
	transform: translate(48px, -50%) scale(1.02);
	transition: opacity .6s var(--ease-out), transform .9s var(--ease-out);
	-webkit-mask-image: linear-gradient(90deg, transparent 0, #000 18%), linear-gradient(180deg, transparent 0, #000 8%, #000 92%, transparent 100%);
	-webkit-mask-composite: source-in;
	mask-image: linear-gradient(90deg, transparent 0, #000 18%), linear-gradient(180deg, transparent 0, #000 8%, #000 92%, transparent 100%);
	mask-composite: intersect;
}
.bm-scroll.is-pinned .bm-step.is-active .bm-step__img { opacity: 1; transform: translate(0, -50%); }
.bm-scroll.is-pinned .bm-step__text {
	position: absolute;
	z-index: 2;
	top: 50%;
	left: var(--strip);
	width: clamp(280px, 26vw, 420px);
	margin: 0;
	transform: translateY(-46%);
}
.bm-scroll.is-pinned .bm-step__text > * { opacity: 0; transform: translateY(18px); transition: opacity .5s var(--ease-out), transform .6s var(--ease-out); }
.bm-scroll.is-pinned .bm-step.is-active .bm-step__text > * { opacity: 1; transform: none; }
.bm-scroll.is-pinned .bm-step.is-active .bm-step__text > :nth-child(2) { transition-delay: .06s; }
.bm-scroll.is-pinned .bm-step.is-active .bm-step__text > :nth-child(3) { transition-delay: .12s; }
.bm-scroll.is-pinned .bm-step.is-active .bm-step__text > :nth-child(4) { transition-delay: .18s; }
.bm-scroll.is-pinned .bm-step.is-active .bm-step__text > :nth-child(5) { transition-delay: .24s; }
.bm-scroll.is-pinned .bm-scroll__rail {
	position: absolute;
	z-index: 2;
	left: calc(var(--strip) - 14px);
	bottom: clamp(20px, 3vh, 36px);
	display: flex;
	gap: 6px;
}
.bm-scroll__rail button {
	padding: 10px 14px 12px;
	border: 0;
	border-bottom: 2px solid rgba(36, 31, 33, .14);
	background: none;
	color: rgba(36, 31, 33, .6);
	font: inherit;
	font-size: var(--text-base);
	cursor: pointer;
	transition: color .3s var(--ease-out), border-color .3s var(--ease-out);
}
.bm-scroll__rail button:hover { color: var(--ink); }
.bm-scroll__rail button[aria-current="true"] { color: var(--brand); border-bottom-color: var(--brand); }
.bm-scroll.is-pinned .bm-scroll__all { position: absolute; z-index: 2; right: var(--strip); bottom: clamp(24px, 3.4vh, 40px); margin: 0; }

@media (prefers-reduced-motion: reduce) {
	.bm-scroll * { transition: none !important; }
}

/* ---------- GSAP-driven version (motion.js adds .is-gsap): the timeline owns every state, so no CSS transitions ---------- */
.bm-mask { display: block; overflow: hidden; padding-bottom: .08em; }   /* title slides up from behind this edge */
.bm-mask__in { display: block; }
.bm-scroll__num, .bm-scroll__progress { display: none; }
.bm-scroll.is-gsap .bm-step { visibility: visible; transition: none; }
.bm-scroll.is-gsap .bm-step:not(.is-active) { pointer-events: none; }
.bm-scroll.is-gsap .bm-step__img,
.bm-scroll.is-gsap .bm-step__text > * { transition: none; opacity: 1; transform: none; }
/* Big outlined number, top-right of the card (over the photo's empty sky), rolls 01 → 06 */
.bm-scroll.is-gsap .bm-scroll__num {
	display: block;
	position: absolute;
	z-index: 1;
	top: clamp(16px, 3vh, 32px);
	right: var(--strip);
	height: 1em;
	overflow: hidden;
	font-size: clamp(110px, 12vw, 200px);
	font-weight: 500;
	line-height: 1;
	letter-spacing: -.05em;
	color: transparent;
	-webkit-text-stroke: 1.5px rgba(21, 35, 121, .28);
	pointer-events: none;
	font-variant-numeric: tabular-nums;
}
.bm-scroll__reel span { display: block; height: 1em; }
/* Progress line along the bottom edge of the card */
.bm-scroll.is-gsap .bm-scroll__progress {
	display: block;
	position: absolute;
	z-index: 3;
	left: 0;
	right: 0;
	bottom: 0;
	height: 3px;
	background: rgba(21, 35, 121, .12);
}
.bm-scroll__progress span { display: block; height: 100%; background: var(--brand); transform-origin: left; transform: scaleX(0); }

/* ---------- Tablet ---------- */
@media (max-width: 960px) {
	.bm-story .bm-wrap { width: calc(100% - 48px); }
	.bm-story__grid { grid-template-columns: 1fr; gap: 48px; }
	.bm-story__statement { max-width: 36ch; }
	.bm-story__counters { margin-top: 0; }
}

/* ---------- Phone ---------- */
@media (max-width: 600px) {
	.bm-wrap, .bm-story .bm-wrap { width: calc(100% - 32px); }
	.bm-sec-head { grid-template-columns: 1fr; align-items: start; gap: 16px; }
	.bm-link { justify-self: start; }
	.bm-sec-sub { font-size: var(--text-lg); }
	.bm-count__label { font-size: var(--text-base); }
}

/* ---------- Sleep showcase (hover a name → its mattress wipes in) ----------
   Desktop: names on the left inside a rounded card, the active mattress image on the right, auto-plays until touched.
   Tablet/phone (≤960px): accordion — tap a name, its image + text open under it. Images are never cropped. */
.bm-show { --show-bg: #c4d1db; --show-dur: 5s; padding: clamp(56px, 8vw, 96px) 0; background: var(--white); color: var(--ink); }
.bm-show__head { width: calc(100% - 32px); margin: 0 auto clamp(24px, 3vw, 40px); text-align: center; }
.bm-show__head .bm-sec-kicker { justify-content: center; }
.bm-show__title { font-size: clamp(32px, 4vw, 52px); font-weight: 500; line-height: 1.05; letter-spacing: -.04em; }
.bm-show__card {
	position: relative;
	display: flex;
	align-items: center;
	min-height: clamp(560px, 74vh, 740px);
	margin: 0 var(--strip);
	padding: clamp(32px, 4vw, 64px);
	border-radius: var(--radius-2xl);
	background: var(--show-bg);
	overflow: hidden;
}
.bm-show__list { width: 36%; }                       /* static on purpose: images position against the card */
.bm-show__item { border-top: 1px solid rgba(36, 31, 33, .12); }
.bm-show__item:last-child { border-bottom: 1px solid rgba(36, 31, 33, .12); }
.bm-show__name {
	position: relative;
	z-index: 1;
	display: flex;
	align-items: baseline;
	gap: 16px;
	width: 100%;
	padding: 14px 0 15px;
	border: 0;
	background: none;
	color: rgba(36, 31, 33, .38);
	font: inherit;
	font-size: clamp(22px, 2.3vw, 36px);
	font-weight: 500;
	line-height: 1.1;
	letter-spacing: -.03em;
	text-align: left;
	cursor: pointer;
	transition: color .35s var(--ease-out);
}
.bm-show__name:hover, .bm-show__item.is-active .bm-show__name { color: var(--ink); }
.bm-show__n { min-width: 22px; font-size: var(--text-xs); letter-spacing: .06em; font-variant-numeric: tabular-nums; color: var(--brand); opacity: .7; }
.bm-show__bar {                                         /* fills while auto-play waits on this item */
	position: absolute;
	left: 0;
	right: 0;
	bottom: -1px;
	height: 2px;
	background: var(--brand);
	transform: scaleX(0);
	transform-origin: left;
}
.bm-show__item.is-active .bm-show__bar { transform: scaleX(1); transition: transform .5s var(--ease-out); }
.bm-show.is-playing .bm-show__item.is-active .bm-show__bar { transform: scaleX(0); animation: bm-show-fill var(--show-dur) linear forwards; }
@keyframes bm-show-fill { to { transform: scaleX(1); } }

/* Panel opens with the grid 0fr → 1fr trick (smooth height, no JS measuring) */
.bm-show__panel { position: relative; z-index: 1; display: grid; grid-template-rows: 0fr; transition: grid-template-rows .55s var(--ease-out); }
.bm-show__item.is-active .bm-show__panel { grid-template-rows: 1fr; }
.bm-show__panel-in { min-height: 0; overflow: hidden; }
.bm-show__panel-in > * { opacity: 0; transform: translateY(10px); transition: opacity .4s var(--ease-out), transform .5s var(--ease-out); }
.bm-show__item.is-active .bm-show__panel-in > * { opacity: 1; transform: none; transition-delay: .15s; }
.bm-show__sub { padding-top: 2px; max-width: 34ch; font-size: var(--text-xl); line-height: 1.5; color: rgba(36, 31, 33, .72); }
.bm-show__facts { display: grid; gap: 6px; margin-top: 14px; font-size: var(--text-base); }
.bm-show__facts li { display: flex; gap: 10px; align-items: baseline; }
.bm-show__facts li::before { content: "✓"; color: var(--brand); font-weight: 600; }
.bm-show__panel-in .bm-pill { gap: 10px; margin: 20px 0 22px; }

/* Image stage: whole picture, 64% of the card, right-aligned; wipes in from the right */
.bm-show__img {
	position: absolute;
	z-index: 0;
	top: 50%;
	right: 0;
	width: 64%;
	height: auto;
	opacity: 0;
	clip-path: inset(0 0 0 100%);
	transform: translate(60px, -50%) scale(1.03);
	transition: opacity .45s var(--ease-out), clip-path 0s .5s, transform 0s .5s;   /* outgoing: fade, then reset quietly */
	-webkit-mask-image: linear-gradient(90deg, transparent 0, #000 16%), linear-gradient(180deg, transparent 0, #000 8%, #000 92%, transparent 100%);
	-webkit-mask-composite: source-in;
	mask-image: linear-gradient(90deg, transparent 0, #000 16%), linear-gradient(180deg, transparent 0, #000 8%, #000 92%, transparent 100%);
	mask-composite: intersect;
	pointer-events: none;
}
.bm-show__item.is-active .bm-show__img {
	opacity: 1;
	clip-path: inset(0 0 0 0);
	transform: translate(0, -50%);
	transition: opacity .3s var(--ease-out), clip-path .9s cubic-bezier(.65, 0, .35, 1), transform 1.1s var(--ease-out);
}
.bm-show__all { position: absolute; z-index: 1; right: clamp(32px, 4vw, 64px); bottom: clamp(24px, 3vw, 40px); }

@media (prefers-reduced-motion: reduce) {
	.bm-show *, .bm-show *::before { transition: none !important; animation: none !important; }
}

/* ---------- Tablet / phone: accordion ---------- */
@media (max-width: 960px) {
	.bm-show__card { display: block; min-height: 0; margin: 0 24px; padding: 8px 20px 24px; }
	.bm-show__list { width: 100%; }
	.bm-show__item:first-child { border-top: 0; }
	.bm-show__item { display: flex; flex-direction: column; }
	.bm-show__name { order: 1; font-size: clamp(22px, 5.6vw, 30px); padding: 18px 0; }
	.bm-show__img {                                       /* the open item's image sits between its name and its text */
		order: 2;
		position: static;
		display: none;
		width: 100%;
		opacity: 1;
		clip-path: none;
		transform: none;
		-webkit-mask-image: none;
		mask-image: none;
	}
	.bm-show__item.is-active .bm-show__img { display: block; transform: none; }
	.bm-show__panel { order: 3; }
	.bm-show__all { position: static; display: inline-flex; margin-top: 20px; }
}
@media (max-width: 600px) {
	.bm-show__card { margin: 0 16px; border-radius: var(--radius-lg); padding: 4px 16px 20px; }
}

/* ---------- Scroll-story: first full-width layout (user, 2026-11-08) ----------
   Desktop/pinned: one edge-to-edge blue stage; the title sits top-left INSIDE it, text left, whole photo right
   (92% wide, left edge fading into the stage), rail bottom-left, "View all" bottom-right, number top-right. */
.bm-scroll.is-pinned .bm-scroll__stage { display: block; padding: 0; background: var(--stage-bg); }
.bm-scroll.is-pinned .bm-scroll__card { position: absolute; inset: 0; margin: 0; padding: 0; border-radius: 0; background: var(--stage-bg); overflow: hidden; }
.bm-scroll.is-pinned .bm-scroll__head { position: absolute; z-index: 3; top: clamp(40px, 7vh, 80px); left: var(--strip); width: auto; margin: 0; text-align: left; }

/* Glass sweep line: rides the incoming photo's wipe edge during each transition (motion.js moves it).
   A soft frosted band with a bright hairline in the middle; sits above the photos, below the text. */
.bm-scroll__sweep {
	position: absolute; z-index: 1; top: 0; bottom: 0; left: 100%;
	width: 80px; transform: translateX(-50%);
	pointer-events: none; opacity: 0; visibility: hidden;
	background: linear-gradient(90deg, rgba(255,255,255,0) 0%, rgba(255,255,255,.18) 44%, rgba(255,255,255,.9) 50%, rgba(255,255,255,.18) 56%, rgba(255,255,255,0) 100%);
	-webkit-backdrop-filter: blur(6px) saturate(1.1); backdrop-filter: blur(6px) saturate(1.1);
	-webkit-mask-image: linear-gradient(90deg, transparent, #000 35%, #000 65%, transparent);
	        mask-image: linear-gradient(90deg, transparent, #000 35%, #000 65%, transparent);
}

/* Phones, stacked story: crop the empty left of each photo (subjects sit in the right ~66%) so the mattress fills the width */
@media (max-width: 767px) {
	.bm-scroll:not(.is-pinned) .bm-step__img { aspect-ratio: 6 / 5; object-fit: cover; object-position: 100% 50%; }
}
