/* ==========================================================================
   smudgechild — clinical pathway (scroll-linked timeline)
   Shared component: only the copy, background image, step content and the
   .tl--mirror modifier (pathway_mirror ACF field) differ per page.
   Depends on :root variables in style.css and the .section-title / .btn
   rules in style.css and custom.css.
   ========================================================================== */

.tl { position: relative; background: #0a1018; height: 340vh; }
.tl__sticky { position: sticky; top: 0; height: 100vh; overflow: hidden; }

.tl__bg {
	position: absolute;
	inset: 0;
	z-index: 0;
	background-color: #0a1018;
	background-size: cover;
	background-position: 50% 42%;
}

.tl__scrim {
	position: absolute; inset: 0; z-index: 1; pointer-events: none;
	background: linear-gradient(90deg, rgba(8,12,18,0) 55%, rgba(8,12,18,0.16) 80%, rgba(8,12,18,0.34) 100%);
}

.tl__inner {
	position: relative; z-index: 2; height: 100%; width: min(1240px, 92vw); margin: 0 auto;
	display: grid; grid-template-columns: 1.15fr 0.85fr; align-items: center; gap: clamp(24px, 4vw, 56px);
}

.tl__left { max-width: 30rem; color: #fff; }
.tl__left .section-title { color: #fff; }
.tl__lead { font-family: var(--sans); font-size: clamp(15px, 1.2vw, 18px); line-height: 1.55; color: #fff; margin: 18px 0 0; text-wrap: pretty; }
.tl__cta { margin-top: clamp(24px, 3.4vh, 36px); }

.tl__rail { position: relative; height: 70vh; align-self: center; }
.tl__line { position: absolute; left: 6px; top: 4%; bottom: 4%; width: 2px; background: var(--accent); }
.tl__fill { position: absolute; left: 6px; top: 4%; width: 2px; height: 0; background: var(--accent); transition: height 0.6s cubic-bezier(0.22,1,0.36,1); }

.tl__node { position: absolute; left: 0; transform: translateY(-50%); display: flex; align-items: center; gap: 15px; transition: top 0.6s cubic-bezier(0.22,1,0.36,1); }
.tl__dot { position: relative; z-index: 2; flex: none; width: 14px; height: 14px; border-radius: 50%; background: var(--accent); border: 2px solid var(--accent); transition: box-shadow 0.4s ease, transform 0.4s ease; }
.tl__node.is-done .tl__dot { background: var(--accent); border-color: var(--accent); }
.tl__node.is-active .tl__dot { background: var(--accent); border-color: var(--accent); transform: scale(1.15); box-shadow: 0 0 0 5px rgba(239,108,35,0.25), 0 0 18px 2px rgba(239,108,35,0.9); }

.tl__time { font-family: var(--mono); font-size: clamp(12px, 1vw, 15px); font-weight: 500; letter-spacing: 0.12em; text-transform: uppercase; color: rgba(255,255,255,0.5); white-space: nowrap; transition: color 0.4s ease; }
.tl__node.is-active .tl__time { color: #fff; }

/* Lids, 3 Dec 11:12: more room between the STEP label and its text (was clamp(86px, 9vw, 132px)). */
.tl__detail { position: absolute; left: clamp(124px, 12vw, 176px); top: 50%; transform: translateY(-42%); width: min(23rem, 30vw); opacity: 0; pointer-events: none; transition: opacity 0.5s ease; }
.tl__detail.is-active { opacity: 1; }
.tl__detail-title { font-family: var(--sans); font-weight: 500; font-size: clamp(24px, 2.5vw, 38px); line-height: 1.04; letter-spacing: -0.02em; color: #fff; margin: 0 0 14px; text-wrap: balance; }
.tl__detail-desc { font-family: var(--sans); font-size: clamp(15px, 1.15vw, 18px); line-height: 1.55; color: #fff; margin: 0; text-wrap: pretty; }

@media (prefers-reduced-motion: reduce) {
	.tl__fill { transition: none; }
	.tl__node { transition: none; }
}

/* ── Mirrored variant (.tl--mirror, pathway_mirror ACF field): rail on the
      left, copy on the right, right-aligned — GLP-1's layout. ── */
@media (min-width: 881px) {
	.tl--mirror .tl__inner { grid-template-columns: 0.85fr 1.15fr; }
	.tl--mirror .tl__rail { order: -1; }
	.tl--mirror .tl__left { order: 1; max-width: 30rem; margin-left: auto; text-align: right; }
	.tl--mirror .tl__left .tl__lead { margin-left: auto; }
	.tl--mirror .tl__line, .tl--mirror .tl__fill { left: auto; right: 6px; }
	.tl--mirror .tl__node { left: auto; right: 0; flex-direction: row-reverse; }
	.tl--mirror .tl__detail { left: auto; right: clamp(124px, 12vw, 176px); text-align: right; }
}

/*
 * ── Small tablets (861–880px): a plain stacked timeline (line left, copy
 *    right), every step showing. Below 860px the pinned phone layout further
 *    down takes over. ──
 */
@media (max-width: 880px) {
	.tl { height: auto; }
	.tl__sticky { position: static; height: auto; overflow: visible; padding: clamp(72px, 10vh, 120px) 0; }
	.tl__inner { grid-template-columns: 1fr; align-items: start; }
	.tl__left { max-width: none; margin-bottom: clamp(36px, 6vh, 56px); }
	.tl__rail { height: auto; padding-left: 2px; }
	.tl__fill { display: none; }
	.tl__node { position: static; transform: none; display: grid; grid-template-columns: auto 1fr; column-gap: 16px; align-items: start; padding-bottom: 30px; }
	.tl__node:last-child { padding-bottom: 0; }
	.tl__dot { margin-top: 4px; }
	.tl__node.is-active .tl__dot { box-shadow: none; }
	.tl__time { grid-column: 2; color: rgba(255,255,255,0.6); }
	.tl__node.is-active .tl__time { color: rgba(255,255,255,0.6); }
	.tl__detail { position: static; transform: none; opacity: 1; pointer-events: auto; width: auto; grid-column: 2; margin-top: 6px; }
	.tl__detail-title { font-size: clamp(20px, 5.5vw, 26px); margin-bottom: 8px; }
}

/*
 * ── Phones (≤860px): stays pinned + scroll-scrubbed like desktop. Vertical
 *    rail on the left, the glowing dot walks down, the active step's copy
 *    shows to its right and hides again when the next step takes over, so
 *    the section's height never changes. Same for the standard and mirrored
 *    variants. --fit (set by pathway.js) shrinks the step type a little on
 *    phones where the longest step wouldn't otherwise clear the dots below. ──
 */
@media (max-width: 860px) {
	.tl { height: 320svh; }
	.tl__sticky { position: sticky; top: 0; height: 100svh; overflow: hidden; padding: 0; }
	.tl__scrim { background: linear-gradient(180deg, rgba(8,10,14,0.66) 0%, rgba(8,10,14,0.46) 45%, rgba(8,10,14,0.74) 100%); }
	.tl--mirror .tl__bg { background-position: 62% 32%; }
	.tl__inner {
		display: flex; flex-direction: column; align-items: stretch; justify-content: flex-start; gap: 0;
		height: 100%; width: 100%; padding: clamp(88px, 13svh, 116px) 22px calc(22px + env(safe-area-inset-bottom, 0px));
	}
	.tl__left { max-width: none; margin: 0; flex: none; text-align: left; }
	.tl__left .section-title { font-size: clamp(28px, 7.8vw, 36px); }
	.tl__lead { font-size: 16px; line-height: 1.5; margin-top: 12px; }
	.tl__cta {
		position: absolute; left: 22px; right: 22px; bottom: calc(22px + env(safe-area-inset-bottom, 0px)); margin: 0;
		display: flex; align-items: center; justify-content: center; text-align: center; min-height: 48px;
	}
	.tl__rail {
		position: relative; flex: 1 1 auto; min-height: 0; height: auto; padding: 0; align-self: stretch;
		margin: clamp(24px, 4svh, 40px) 0 calc(48px + 22px + env(safe-area-inset-bottom, 0px));
	}
	.tl__line { display: block; left: 6px; top: 4%; bottom: 4%; width: 2px; background: var(--accent); }
	.tl__fill { display: block; left: 6px; top: 4%; width: 2px; background: var(--accent); }
	.tl__node { position: absolute; left: 0; transform: translateY(-50%); display: flex; align-items: center; gap: 12px; padding: 0; transition: top 0.6s cubic-bezier(0.22,1,0.36,1); }
	.tl__node:last-child { padding-bottom: 0; }
	.tl__time { display: block; grid-column: auto; font-size: 11px; color: rgba(255,255,255,0.5); }
	.tl__node.is-done .tl__time { color: rgba(255,255,255,0.7); }
	.tl__node.is-active .tl__time { display: none; }
	.tl__dot { margin: 0; width: 14px; height: 14px; background: var(--accent); border-color: var(--accent); transition: box-shadow 0.35s ease, transform 0.35s ease; }
	.tl__node.is-done .tl__dot,
	.tl__node.is-active .tl__dot { background: var(--accent); border-color: var(--accent); }
	.tl__node.is-active .tl__dot { transform: scale(1.15); box-shadow: 0 0 0 5px rgba(239,108,35,0.25), 0 0 18px 2px rgba(239,108,35,0.9); }
	.tl__detail {
		position: absolute; left: 32px; top: 50%; transform: translateY(-9px) translateX(8px);
		width: calc(100vw - 44px - 32px); margin: 0; opacity: 0; pointer-events: none; text-align: left;
		transition: opacity 0.45s ease, transform 0.45s cubic-bezier(0.22,1,0.36,1);
	}
	.tl__detail.is-active { opacity: 1; transform: translateY(-9px); pointer-events: auto; }
	.tl__detail-title { font-size: calc(clamp(22px, 6vw, 27px) * var(--fit, 1)); line-height: 1.12; margin-bottom: 8px; }
	.tl__detail-desc { font-size: calc(15.5px * var(--fit, 1)); line-height: 1.5; color: rgba(255,255,255,0.9); }
}

/*
 * shorter phones: hide the pathway CTA so the step copy never collides with
 * it (it's back on taller phones)
 */
@media (max-width: 860px) and (max-height: 700px) {
	.tl__cta { display: none; }
	.tl__lead { font-size: 15px; }
	.tl__inner { padding-top: clamp(76px, 11svh, 96px); }
}

/*
 * very short phones (≤600px tall, e.g. 320×568): the heading and intro take
 * most of the screen, so trim them a little to leave the steps room.
 * Nothing is hidden.
 */
@media (max-width: 860px) and (max-height: 600px) {
	.tl__inner { padding-top: 72px; }
	.tl__left .section-title { font-size: 24px; }
	.tl__lead { font-size: 14px; line-height: 1.45; margin-top: 8px; }
	.tl__rail { margin-top: 18px; margin-bottom: 18px; }
}

@media (max-width: 860px) and (prefers-reduced-motion: reduce) {
	.tl__node, .tl__detail { transition: none; }
}
/* Lumart, 12 Nov (iPhone): Peptides and GLP-1 step ladder.
   1. Full bleed: the pinned screen was 100svh, so with Safari's toolbar tucked
      away a dark band showed below the photo. It is now the full 100lvh; the
      content keeps to the small viewport (the extra height is padding), so the
      button never sits under the toolbar when it is showing.
   2. A lighter scrim, and the step text solid white at a heavier weight. */
@media (max-width: 860px) {
	.tl__sticky { height: 100vh; height: 100lvh; }
	.tl__inner { padding-bottom: calc(22px + env(safe-area-inset-bottom, 0px) + (100lvh - 100svh)); }
	.tl__cta { bottom: calc(22px + env(safe-area-inset-bottom, 0px) + (100lvh - 100svh)); }
	.tl__scrim { background: linear-gradient(180deg, rgba(8,10,14,0.5) 0%, rgba(8,10,14,0.26) 45%, rgba(8,10,14,0.55) 100%); }
	.tl__lead { color: #fff; font-weight: 500; }
	.tl__detail-desc { color: #fff; font-weight: 500; }
	.tl__detail-title, .tl__detail-desc, .tl__lead { text-shadow: 0 1px 12px rgba(0,0,0,0.35); }
}

/* Lumart, 12 Nov: the ladder stretches into the space the toolbar frees as it
   shrinks (--barpad, style.css) instead of always reserving its full height. */
@media (max-width: 860px) {
	.tl__inner { padding-bottom: calc(22px + env(safe-area-inset-bottom, 0px) + var(--barpad, 0px)); }
	.tl__cta { bottom: calc(22px + env(safe-area-inset-bottom, 0px) + var(--barpad, 0px)); }
}
/* no button on this page (Peptides): the ladder runs down to the bottom gap */
@media (max-width: 860px) {
	.tl__inner:not(:has(.tl__cta)) .tl__rail { margin-bottom: 8px; }
}

/* Lumart, 13 Nov (desktop): Superpower-style subheading, bigger and bolder
   (Peptides and GLP-1, the two pages that use this section). */
@media (min-width: 861px) {
	.tl__lead { font-size: clamp(19px, 1.5vw, 22px); line-height: 1.45; font-weight: 500; max-width: 560px; }
}

/* Lumart, 15 Nov (phones): the pathway is no longer pinned. At 860px and below
   the timeline above is hidden and .tl-m shows instead: a normal, shorter
   section with a lighter overlay, heading and subheading top left, and the
   steps on dark glass cards that swipe and move on by themselves, with a
   progress bar and "n / total" under them (Superpower's testimonials).
   js/pathway-m.js runs it. Desktop is unchanged. */
.tl-m { display: none; }
@media (max-width: 860px) {
	.tl { display: none; }
	.tl-m { display: block; position: relative; overflow: hidden; background: #0a1018; color: #fff; }
	.tl-m__bg { position: absolute; inset: 0; z-index: 0; background-size: cover; background-position: 50% 40%; }
	.tl--mirror + .tl-m .tl-m__bg { background-position: 62% 32%; }
	.tl-m__scrim { position: absolute; inset: 0; z-index: 1; pointer-events: none; background: linear-gradient(180deg, rgba(8,10,14,0.34) 0%, rgba(8,10,14,0.14) 45%, rgba(8,10,14,0.4) 100%); }
	.tl-m__inner { position: relative; z-index: 2; padding: 64px 0 40px; }
	.tl-m__title { font-family: var(--sans); font-weight: 500; font-size: clamp(28px, 7.8vw, 34px); line-height: 1.1; letter-spacing: -0.02em; color: #fff; margin: 0; padding: 0 22px; text-align: left; text-wrap: balance; text-shadow: 0 1px 14px rgba(0,0,0,0.3); }
	.tl-m__lead { font-family: var(--sans); font-size: 16px; line-height: 1.5; font-weight: 500; color: #fff; margin: 12px 0 0; padding: 0 22px; text-align: left; text-wrap: pretty; text-shadow: 0 1px 12px rgba(0,0,0,0.35); }

	.tl-m__track {
		list-style: none; margin: 30px 0 0; padding: 0 30px; display: flex; gap: 12px; align-items: stretch;
		overflow-x: auto; scroll-snap-type: x mandatory; scroll-padding: 0 30px; overscroll-behavior-x: contain;
		scrollbar-width: none; -webkit-overflow-scrolling: touch;
	}
	.tl-m__track::-webkit-scrollbar { display: none; }
	.tl-m__card {
		flex: none; width: calc(100vw - 60px); scroll-snap-align: center; scroll-snap-stop: always;
		display: flex; flex-direction: column; padding: 22px 22px 24px; border-radius: 20px;
		background: rgba(10, 13, 18, 0.5); border: 1px solid rgba(255, 255, 255, 0.14);
		-webkit-backdrop-filter: blur(18px) saturate(140%); backdrop-filter: blur(18px) saturate(140%);
		box-shadow: 0 18px 40px -24px rgba(0, 0, 0, 0.6);
		position: relative; transform: translateZ(0); will-change: transform;
	}
	/* inactive cards are dimmed by an overlay, not opacity: Safari draws the
	   glass blur late (or not at all) on a layer whose opacity changes */
	.tl-m__card::after { content: ""; position: absolute; inset: 0; border-radius: inherit; background: rgba(8, 10, 14, 0.42); pointer-events: none; transition: opacity 0.45s ease; }
	.tl-m__card.is-active::after { opacity: 0; }
	.tl-m__tag { display: inline-flex; align-items: center; gap: 8px; align-self: flex-start; font-family: var(--mono); font-size: 11.5px; font-weight: 500; letter-spacing: 0.14em; text-transform: uppercase; color: rgba(255,255,255,0.75); }
	.tl-m__tagdot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 10px 2px rgba(239,108,35,0.55); }
	.tl-m__h { font-family: var(--sans); font-weight: 500; font-size: 24px; line-height: 1.15; letter-spacing: -0.015em; color: #fff; margin: 16px 0 10px; text-wrap: balance; }
	.tl-m__p { font-family: var(--sans); font-size: 16px; line-height: 1.5; color: rgba(255,255,255,0.88); margin: 0; text-wrap: pretty; }

	.tl-m__progress { display: flex; align-items: center; gap: 16px; margin: 22px 30px 0; }
	.tl-m__bars { flex: 1; display: flex; gap: 6px; align-items: center; }
	.tl-m__bar { position: relative; flex: 1 1 0; height: 3px; padding: 10px 0; margin: -10px 0; border: 0; background: none; cursor: pointer; transition: flex-grow 0.45s cubic-bezier(0.22,1,0.36,1); }
	.tl-m__bar::before { content: ""; position: absolute; left: 0; right: 0; top: 50%; height: 3px; transform: translateY(-50%); border-radius: 3px; background: rgba(255,255,255,0.3); }
	.tl-m__bar.is-active { flex-grow: 5; }
	.tl-m__fill { position: absolute; left: 0; top: 50%; height: 3px; width: 0; transform: translateY(-50%); border-radius: 3px; background: #fff; }
	.tl-m__bar.is-active .tl-m__fill { animation: tl-m-fill var(--step-ms, 7000ms) linear forwards; }
	.tl-m.is-paused .tl-m__bar.is-active .tl-m__fill { animation-play-state: paused; }
	@keyframes tl-m-fill { from { width: 0; } to { width: 100%; } }
	.tl-m__count { flex: none; font-family: var(--sans); font-size: 14px; color: rgba(255,255,255,0.8); font-variant-numeric: tabular-nums; }
	.tl-m__cta { display: flex; align-items: center; justify-content: center; min-height: 48px; margin: 26px 22px 0; text-align: center; }
}
@media (max-width: 860px) and (prefers-reduced-motion: reduce) {
	.tl-m__bar.is-active .tl-m__fill { animation: none; width: 100%; }
	.tl-m__card, .tl-m__bar { transition: none; }
}

/* Lumart, 15 Nov: the step-card section 60% taller on phones. */
@media (max-width: 860px) {
	.tl-m__inner { padding: 190px 0 150px; }
	.tl-m__track { margin-top: 84px; }
	/* Lumart, 15 Nov: smaller glass cards (the section keeps its height) */
	.tl-m__card { min-height: 0; padding: 18px 20px 20px; border-radius: 18px; }
	.tl-m__h { font-size: 21px; margin: 12px 0 8px; }
	.tl-m__p { font-size: 15px; line-height: 1.48; }
}

/* Lumart, 17 Nov (desktop): the same thin white frame as the heroes, on Peptides and GLP-1. */
@media (min-width: 961px) {
	.tl__sticky::after {
		content: ""; position: absolute; inset: 10px; z-index: 60; pointer-events: none;
		border-radius: 24px; box-shadow: 0 0 0 60px var(--bg);
	}
}
