/* Homepage story: chapters scroll past and fill word by word beside a sticky energy rail. */
.seamkt-story {
	--story-ink: #111;
	--story-dim: #9a9a9a;
	--story-line: #e4e4e4;
	--story-paper: #fff;
	--story-sans: var(--seamkt-font);
	--energy: 0;
	position: relative;
	isolation: isolate;
	background: var(--story-paper);
	color: var(--story-ink);
	font-family: var(--story-sans);
}

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

.seamkt-story__sr {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: -1px;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
}

.seamkt-story__layout {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	max-width: 1760px;
	margin: 0 auto;
	padding: clamp(80px, 12vw, 160px) clamp(24px, 3vw, 60px);
}

/* Without JS there is no rail; the chapters simply read top to bottom. */
.seamkt-story__rail {
	display: none;
}

.seamkt-story__chapters {
	display: grid;
	gap: clamp(200px, 45svh, 440px);
}

.seamkt-story__chapter {
	--fill: 0;
	display: grid;
	grid-template-columns: minmax(0, 1fr) clamp(250px, 21vw, 330px);
	align-items: start;
	gap: clamp(48px, 7vw, 160px);
}

.seamkt-story .seamkt-story__text {
	max-width: 23em;
	margin: 0;
	color: var(--story-ink);
	font-family: inherit;
	font-size: clamp(22px, 2.1vw, 36px);
	font-weight: 400;
	line-height: 1.22;
	letter-spacing: -0.026em;
	text-wrap: pretty;
	font-kerning: normal;
}

/* Right-hand caption: an index line that charges with the paragraph, a bold title, a quiet list. */
.seamkt-story__meta {
	position: sticky;
	top: 38svh;
	padding-top: 0.45em;
	font-size: 15px;
	line-height: 1.4;
}

.seamkt-story .seamkt-story__index {
	display: flex;
	align-items: center;
	gap: 14px;
	margin: 0;
	font-size: 13px;
	font-variant-numeric: tabular-nums;
	letter-spacing: 0.08em;
	line-height: 1;
}

.seamkt-story__count {
	color: var(--story-ink);
}

.seamkt-story__total {
	color: var(--story-dim);
}

.seamkt-story__progress {
	position: relative;
	flex: 1;
	height: 1px;
	overflow: hidden;
	background: var(--story-line);
}

.seamkt-story__progress span {
	position: absolute;
	inset: 0;
	background: var(--story-ink);
	transform: scaleX(var(--fill));
	transform-origin: left center;
}

.seamkt-story .seamkt-story__title {
	margin: 22px 0 26px;
	padding: 0;
	color: var(--story-ink);
	font-family: var(--story-sans);
	font-size: clamp(22px, 1.7vw, 28px);
	font-weight: 500;
	line-height: 1.1;
	letter-spacing: -0.03em;
	text-transform: none;
}

.seamkt-story__tags {
	margin: 0;
	padding: 0;
	list-style: none;
	counter-reset: story-tag;
}

.seamkt-story__tags li {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 16px;
	margin: 0;
	padding: 15px 0;
	border-top: 1px solid var(--story-line);
	color: #4a4a4a;
	font-size: 17px;
	font-weight: 500;
	counter-increment: story-tag;
}

.seamkt-story__tags li:last-child {
	border-bottom: 1px solid var(--story-line);
}

.seamkt-story__tags li::after {
	color: #bdbdbd;
	font-size: 13px;
	font-variant-numeric: tabular-nums;
	letter-spacing: 0.08em;
	content: counter(story-tag, decimal-leading-zero);
}

.seamkt-story__cta {
	display: inline-flex;
	align-items: center;
	gap: 14px;
	margin-top: 30px;
	padding: 16px 22px 16px 26px;
	border-radius: 999px;
	background: var(--story-ink);
	color: #fff;
	font-size: 15px;
	font-weight: 600;
	letter-spacing: 0;
	text-decoration: none;
	transition: background 250ms ease, transform 250ms ease;
}

.seamkt-story__cta svg {
	width: 18px;
	height: 18px;
	fill: none;
	stroke: currentColor;
	stroke-width: 1.8;
	stroke-linecap: round;
	stroke-linejoin: round;
	transition: transform 250ms ease;
}

.seamkt-story__cta:hover,
.seamkt-story__cta:focus-visible {
	background: #2b2b2b;
	color: #fff;
}

.seamkt-story__cta:hover svg,
.seamkt-story__cta:focus-visible svg {
	transform: translateX(4px);
}

.seamkt-story__cta:focus-visible {
	outline: 1px solid var(--story-ink);
	outline-offset: 4px;
}

/* Enhanced: words start faint and light up as they scroll past the reading line. */
.seamkt-story.is-enhanced .seamkt-story__layout {
	grid-template-columns: clamp(88px, 8vw, 140px) minmax(0, 1fr);
	column-gap: clamp(28px, 5vw, 100px);
	padding-top: clamp(120px, 22svh, 240px);
	padding-bottom: 0;
}

/* The trailing space lives inside the chapters' row so the pinned rail
   stays put until the last paragraph has finished filling (the last one ends with its bottom at 72% of the screen). */
.seamkt-story.is-enhanced .seamkt-story__chapters {
	padding-bottom: 36svh;
}

/* Lit through the alpha of the ink (story.js), not opacity: no transparency group per word.
   No colour transition: the scroll it follows is already smooth (Lenis on desktop, which story.js
   draws in step with; native momentum on phones). A transition on every word kept dozens of
   them animating through each scroll frame, and ScrollTrigger (journey.js), which reads the
   layout on every frame, made the browser bring all of them up to date mid-frame: through this
   section frames ran late (14 to 41 over 20 ms in one pass with the CPU slowed 4x, 1 to 2
   without the transitions). */
.seamkt-story.is-enhanced .seamkt-story__word {
	color: rgba(17, 17, 17, 0.14);
}

/* The caption only appears beside the paragraph being read, piece by piece. */
.seamkt-story.is-enhanced .seamkt-story__index,
.seamkt-story.is-enhanced .seamkt-story__title,
.seamkt-story.is-enhanced .seamkt-story__tags li,
.seamkt-story.is-enhanced .seamkt-story__cta {
	opacity: 0;
	filter: blur(6px);
	transform: translate3d(0, 16px, 0);
	transition:
		opacity 450ms ease,
		filter 450ms ease,
		transform 700ms cubic-bezier(0.2, 0.7, 0.2, 1),
		background 250ms ease;
}

.seamkt-story.is-enhanced .seamkt-story__chapter:not(.is-current) .seamkt-story__meta {
	pointer-events: none;
}

.seamkt-story.is-enhanced .seamkt-story__chapter.is-current :is(.seamkt-story__index, .seamkt-story__title, .seamkt-story__tags li, .seamkt-story__cta) {
	opacity: 1;
	filter: none;
	transform: none;
	transition-duration: 700ms, 700ms, 900ms, 250ms;
}

.seamkt-story.is-enhanced .seamkt-story__chapter.is-current .seamkt-story__title {
	transition-delay: 90ms;
}

.seamkt-story.is-enhanced .seamkt-story__chapter.is-current .seamkt-story__tags li:nth-child(1) {
	transition-delay: 180ms;
}

.seamkt-story.is-enhanced .seamkt-story__chapter.is-current .seamkt-story__tags li:nth-child(2) {
	transition-delay: 240ms;
}

.seamkt-story.is-enhanced .seamkt-story__chapter.is-current .seamkt-story__tags li:nth-child(n + 3) {
	transition-delay: 300ms;
}

.seamkt-story.is-enhanced .seamkt-story__chapter.is-current .seamkt-story__cta {
	transition-delay: 400ms, 400ms, 400ms, 0ms;
}

/* Energy rail: a single hairline that charges in ink as the story is read. */
.seamkt-story.is-enhanced .seamkt-story__rail {
	position: sticky;
	top: 0;
	display: flex;
	align-items: center;
	align-self: start;
	height: 100svh;
	margin-top: calc(-1 * clamp(120px, 22svh, 240px));
}

.seamkt-story__energy {
	display: flex;
	flex-direction: column;
	gap: 22px;
}

.seamkt-story__energy-label {
	color: var(--story-dim);
	font-size: 11px;
	letter-spacing: 0.24em;
	text-transform: uppercase;
}

.seamkt-story__meter {
	--meter-h: clamp(240px, 52svh, 520px);
	position: relative;
	width: 48px;
	height: var(--meter-h);
}

.seamkt-story__meter-track,
.seamkt-story__meter-fill {
	position: absolute;
	top: 0;
	left: 4px;
	width: 1px;
}

.seamkt-story__meter-track {
	bottom: 0;
	background: var(--story-line);
}

/* The fill and its tip move by transform, on their own layers: changing their height and top
   on every scroll frame laid the page out again each time. */
.seamkt-story__meter-fill {
	bottom: 0;
	width: 2px;
	margin-left: -0.5px;
	background: var(--story-ink);
	transform: scaleY(var(--energy));
	transform-origin: 50% 0;
	will-change: transform;
}

/* The charging tip: a dot with a slow breathing halo. */
.seamkt-story__meter-head {
	position: absolute;
	z-index: 2;
	top: 0;
	left: 4.5px;
	width: 9px;
	height: 9px;
	border-radius: 50%;
	background: var(--story-ink);
	box-shadow: 0 0 0 4px var(--story-paper);
	transform: translate3d(-50%, calc(var(--energy) * var(--meter-h) - 50%), 0);
	will-change: transform;
}

.seamkt-story__meter-head::after {
	position: absolute;
	inset: -7px;
	border: 1px solid var(--story-ink);
	border-radius: 50%;
	opacity: 0;
	animation: seamkt-story-breathe 2.4s ease-out infinite;
	content: '';
}

@keyframes seamkt-story-breathe {
	0% {
		opacity: 0.35;
		transform: scale(0.5);
	}

	100% {
		opacity: 0;
		transform: scale(1.4);
	}
}

.seamkt-story__stop,
.seamkt-story__meter-end {
	position: absolute;
	left: 4.5px;
	width: 5px;
	height: 5px;
	border-radius: 50%;
	background: var(--story-line);
	transform: translate(-50%, -50%);
	transition: background 300ms ease;
}

.seamkt-story__stop {
	top: calc(var(--stop) * 100%);
}

.seamkt-story__meter-end {
	top: 100%;
}

.seamkt-story__stop.is-reached,
.seamkt-story__meter.is-full .seamkt-story__meter-end {
	background: var(--story-ink);
}

.seamkt-story__stop-num {
	position: absolute;
	top: 50%;
	left: 18px;
	color: #c4c4c4;
	font-size: 11px;
	font-variant-numeric: tabular-nums;
	letter-spacing: 0.06em;
	line-height: 1;
	transform: translateY(-50%);
	transition: color 300ms ease, transform 300ms ease;
}

.seamkt-story__stop.is-reached .seamkt-story__stop-num {
	color: var(--story-dim);
}

.seamkt-story__stop.is-current .seamkt-story__stop-num {
	color: var(--story-ink);
	transform: translate(4px, -50%);
}

.seamkt-story__energy-value {
	display: flex;
	align-items: flex-start;
	gap: 2px;
	margin-top: 6px;
	color: var(--story-ink);
	font-size: 30px;
	font-weight: 400;
	font-variant-numeric: tabular-nums;
	letter-spacing: -0.045em;
	line-height: 1;
}

.seamkt-story__energy-value small {
	margin-top: 3px;
	color: var(--story-dim);
	font-size: 12px;
	letter-spacing: 0;
}

@media (max-width: 1100px) {
	.seamkt-story__chapter {
		grid-template-columns: minmax(0, 1fr);
		gap: 22px;
	}

	.seamkt-story__meta {
		position: static;
		order: -1;
		padding-top: 0;
	}

	.seamkt-story .seamkt-story__index {
		max-width: 240px;
	}

	/* Stacked above its paragraph, a caption stays as a faint heading instead of vanishing. */
	.seamkt-story.is-enhanced .seamkt-story__chapter:not(.is-current) :is(.seamkt-story__index, .seamkt-story__title, .seamkt-story__tags li, .seamkt-story__cta) {
		opacity: 0.3;
		filter: none;
		transform: none;
	}

	.seamkt-story .seamkt-story__title {
		margin: 16px 0 10px;
	}

	.seamkt-story__tags {
		display: flex;
		flex-wrap: wrap;
	}

	.seamkt-story__tags li,
	.seamkt-story__tags li:last-child {
		padding: 0;
		border: 0;
		color: var(--story-dim);
	}

	.seamkt-story__tags li::after {
		content: none;
	}

	.seamkt-story__tags li + li::before {
		margin: 0 10px;
		color: #cfcfcf;
		content: '/';
	}

	.seamkt-story__cta {
		margin-top: 16px;
	}
}

/* Phones: the paragraph gets the full width and the energy rail becomes a floating dock
   that rides the bottom of the screen: one charging segment per chapter, its number and the value. */
@media (max-width: 767px) {
	/* No long trailing strip on phones: the dock lands just under the last paragraph instead. */
	.seamkt-story.is-enhanced .seamkt-story__layout {
		grid-template-columns: minmax(0, 1fr);
		gap: 40px 0;
		padding: clamp(52px, 9svh, 72px) 20px 32px;
	}

	.seamkt-story.is-enhanced .seamkt-story__chapters {
		padding-bottom: 0;
	}

	/* A light glass dock with one segment per chapter, each charging in turn. */
	.seamkt-story.is-enhanced .seamkt-story__rail {
		--story-count: 3;
		position: sticky;
		z-index: 4;
		top: auto;
		bottom: calc(14px + env(safe-area-inset-bottom, 0px));
		display: block;
		order: 2;
		height: auto;
		margin: 0;
		padding: 12px 18px;
		border-radius: 999px;
		background: rgba(255, 255, 255, 0.96);
		box-shadow:
			0 0 0 1px rgba(17, 17, 17, 0.06),
			0 12px 30px -12px rgba(17, 17, 17, 0.22);
	}

	.seamkt-story__energy {
		flex-direction: row;
		align-items: center;
		gap: 16px;
	}

	.seamkt-story__energy-label,
	.seamkt-story__meter-track,
	.seamkt-story__meter-fill,
	.seamkt-story__meter-head,
	.seamkt-story__meter-end {
		display: none;
	}

	.seamkt-story__meter {
		display: flex;
		flex: 1;
		gap: 12px;
		width: auto;
		height: auto;
	}

	.seamkt-story__stop {
		--seg: clamp(0, (var(--energy) - var(--stop)) * var(--story-count), 1);
		position: static;
		display: flex;
		flex: 1;
		align-items: center;
		gap: 8px;
		width: auto;
		height: auto;
		border-radius: 0;
		background: none;
		transform: none;
	}

	.seamkt-story__stop::after {
		flex: 1;
		height: 3px;
		border-radius: 3px;
		background: linear-gradient(90deg, var(--story-ink) calc(var(--seg) * 100%), var(--story-line) 0);
		content: '';
	}

	.seamkt-story__stop-num {
		position: static;
		color: #c4c4c4;
		font-size: 10px;
		font-weight: 500;
		transform: none;
	}

	.seamkt-story__stop.is-current .seamkt-story__stop-num {
		color: var(--story-ink);
		font-weight: 600;
		transform: none;
	}

	.seamkt-story__stop.is-reached,
	.seamkt-story__meter.is-full .seamkt-story__meter-end {
		background: none;
	}

	.seamkt-story__energy-value {
		justify-content: flex-end;
		min-width: 3.6ch;
		margin: 0;
		font-size: 15px;
		font-weight: 500;
		letter-spacing: -0.02em;
	}

	.seamkt-story__energy-value small {
		margin-top: 0;
		font-size: 9px;
	}

	.seamkt-story__chapters {
		gap: 120px;
	}

	.seamkt-story .seamkt-story__text {
		max-width: none;
		font-size: clamp(19px, 5.2vw, 23px);
		line-height: 1.26;
		letter-spacing: -0.022em;
	}

	.seamkt-story__chapter {
		gap: 18px;
	}

	.seamkt-story .seamkt-story__index {
		max-width: none;
		font-size: 11px;
	}

	.seamkt-story .seamkt-story__title {
		margin: 18px 0 14px;
		font-size: 26px;
	}

	/* Words light up through their colour's alpha (story.js), not their opacity: the same look
	   without a transparency group per word for Safari to paint on every scroll frame. */
	.seamkt-story.is-enhanced .seamkt-story__word {
		color: rgba(17, 17, 17, 0.14);
		opacity: 1;
	}

	/* Tags become numbered chips instead of a slash list that broke across lines. */
	.seamkt-story__tags {
		gap: 6px;
	}

	.seamkt-story .seamkt-story__tags li,
	.seamkt-story .seamkt-story__tags li:last-child {
		align-items: center;
		gap: 0;
		padding: 6px 11px 6px 9px;
		border: 1px solid var(--story-line);
		border-radius: 999px;
		color: #4a4a4a;
		font-size: 12px;
		line-height: 1.2;
		white-space: nowrap;
	}

	.seamkt-story .seamkt-story__tags li::before,
	.seamkt-story .seamkt-story__tags li + li::before {
		margin: 0 6px 0 0;
		color: #bdbdbd;
		font-size: 9px;
		font-variant-numeric: tabular-nums;
		letter-spacing: 0.06em;
		content: counter(story-tag, decimal-leading-zero);
	}

	/* The caption waits faint and a little low above its paragraph, then settles in when that paragraph is read. */
	.seamkt-story.is-enhanced .seamkt-story__chapter:not(.is-current) :is(.seamkt-story__index, .seamkt-story__title, .seamkt-story__tags li, .seamkt-story__cta) {
		opacity: 0.25;
		transform: translate3d(0, 8px, 0);
	}

	.seamkt-story__cta {
		justify-content: space-between;
		width: 100%;
		margin-top: 20px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.seamkt-story__meter-head::after {
		animation: none;
	}

	.seamkt-story.is-enhanced .seamkt-story__word,
	.seamkt-story__stop-num {
		transition: none;
	}

	.seamkt-story.is-enhanced .seamkt-story__meta :is(.seamkt-story__index, .seamkt-story__title, .seamkt-story__tags li, .seamkt-story__cta) {
		filter: none !important;
		transform: none !important;
		transition: opacity 200ms linear !important;
	}
}
