/* ============================================================
   Transmission repair page — templates/page-transmission-repair.html

   A sticky stage holds the transmission while six chapter cards scroll
   past it: beside it on desktop, under it on phones. The section is a
   fixed dark band in BOTH colour modes, so everything on it uses the
   fixed tokens, never the mode-aware ones.

   Part labels are positioned by the scene (tx-scene.js) in stage pixels;
   the stage is their containing block.
   ============================================================ */

.ar-tx {
	--ar-tx-stage-h: calc(100svh - var(--ar-head-h, 0px));
	position: relative;
	background: var(--ar-fixed-dark);
	color: var(--ar-on-accent);
	isolation: isolate;
}

.ar-tx__grid {
	display: grid;
	grid-template-columns: 1fr;
}

/* ---------- the stage ---------- */

.ar-tx__stage {
	position: sticky;
	top: var(--ar-head-h, 0px);
	z-index: 2;
	/* Phones: at most half the screen, and short enough that the hero's kicker and H1 sit
	   above the quick-action bar on the first screen. Below 260px the exploded view's
	   label rows collide, so that is the floor (a 667px-tall phone still fits the H1). */
	height: clamp(260px, calc(100svh - 430px), 52svh);
	overflow: hidden;
	background: radial-gradient(120% 90% at 35% 45%, color-mix(in srgb, var(--ar-fixed-dark) 84%, var(--ar-on-accent)) 0%, var(--ar-fixed-dark) 62%, var(--ar-fixed-darker) 100%);
}
/* Phones: the cards slide under the stage, so its bottom edge fades into the band. */
.ar-tx__stage::after {
	content: "";
	position: absolute;
	right: 0;
	bottom: 0;
	left: 0;
	height: 70px;
	background: linear-gradient(180deg, transparent, var(--ar-fixed-dark));
	pointer-events: none;
}

.ar-tx__poster,
.ar-tx__canvas {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	display: block;
	transition: opacity 400ms ease;
}
.ar-tx__poster { object-fit: contain; }
.ar-tx__canvas { opacity: 0; }
.ar-tx__stage.is-live .ar-tx__canvas { opacity: 1; }
.ar-tx__stage.is-live .ar-tx__poster { opacity: 0; }

.ar-tx__labels {
	position: absolute;
	inset: 0;
	pointer-events: none;
}
.ar-tx__label {
	position: absolute;
	top: 0;
	left: 0;
	transform: translate(-50%, -100%);
	opacity: 0;
	transition: opacity 250ms ease;
	padding: 0.2rem 0.5rem 0.25rem;
	font-size: 0.62rem;
	font-weight: 600;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	white-space: nowrap;
	background: color-mix(in srgb, var(--ar-fixed-dark) 78%, transparent);
	border: 1px solid rgba(255, 255, 255, 0.28);
	border-radius: var(--ar-radius-xs);
	-webkit-backdrop-filter: blur(3px);
	backdrop-filter: blur(3px);
}
/* A leader line from the label down to its part; the top row reaches further. */
.ar-tx__label::after {
	content: "";
	position: absolute;
	top: 100%;
	left: 50%;
	width: 1px;
	height: 14px;
	background: rgba(255, 255, 255, 0.5);
}
.ar-tx__label--up::after { height: 42px; }
.ar-tx__label--top::after { height: 70px; }

.ar-tx__hud {
	position: absolute;
	right: 1rem;
	bottom: 0.9rem;
	left: 1rem;
	z-index: 1;
	display: flex;
	justify-content: space-between;
	align-items: flex-end;
	gap: 1rem;
	font-size: 0.75rem;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: rgba(255, 255, 255, 0.72);
	pointer-events: none;
}
.ar-tx__hud b {
	display: block;
	font-family: var(--ar-font-display);
	font-size: 1.1rem;
	letter-spacing: 0.02em;
	color: var(--ar-on-accent);
}
.ar-tx__hint { display: none; opacity: 0.8; }

.ar-tx.is-static .ar-tx__labels,
.ar-tx.is-static .ar-tx__hud { display: none; }

/* ---------- chapters ---------- */

.ar-tx__chapters {
	position: relative;
	z-index: 1;
	padding: 0 1rem 10svh;
}

.ar-tx__chapter {
	min-height: 70svh;
	display: flex;
	align-items: center;
	padding: 2.5rem 0;
	box-sizing: border-box;
}

.ar-tx__card {
	max-width: 35rem;
	transition: opacity 350ms ease, transform 350ms ease;
}
/* Cards away from the reading line dim, so the one being read leads.
   Only when JS is running: without it every card stays fully visible. */
.ar-tx.is-scripted .ar-tx__chapter:not(.is-active) .ar-tx__card {
	opacity: 0.38;
	transform: translateY(8px);
}
.ar-tx__chapters.is-boot .ar-tx__card { transition: none; }

/* Two classes: the eyebrow is a <p>, and `.ar-tx__card p` below would otherwise set its size and colour. */
.ar-tx__card .ar-tx__eyebrow {
	margin: 0 0 0.6rem;
	font-size: 0.75rem;
	font-weight: 600;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	color: var(--ar-fixed-accent-photo);
}

/* Headings set their own colour: theme.json styles h1/h2 with the contrast
   colour, which is near-black in light mode and vanishes on this band. */
.ar-tx__title,
.ar-tx__head {
	margin: 0 0 1rem;
	font-family: var(--ar-font-display);
	font-weight: 600;
	line-height: 1.05;
	letter-spacing: 0.005em;
	text-transform: uppercase;
	text-wrap: balance;
	color: var(--ar-on-accent);
}
.ar-tx__title { font-size: clamp(2.2rem, 6.4vw, 4rem); }
.ar-tx__head { font-size: clamp(1.8rem, 4.6vw, 2.9rem); }

.ar-tx__card p {
	margin: 0 0 1em;
	font-size: 1.05rem;
	line-height: 1.55;
	color: rgba(255, 255, 255, 0.82);
}
.ar-tx__card .ar-tx__lead {
	font-size: 1.15rem;
	color: var(--ar-on-accent);
}

.ar-tx__actions {
	display: flex;
	flex-wrap: wrap;
	gap: 0.75rem;
	margin-top: 1.25rem;
}

.ar-tx__trust {
	display: grid;
	grid-template-columns: repeat(2, 1fr);
	gap: 0.6rem 1rem;
	margin: 1.4rem 0 0;
	padding: 0;
	list-style: none;
	font-size: 0.9rem;
	color: rgba(255, 255, 255, 0.85);
}
.ar-tx__trust li {
	display: flex;
	gap: 0.5rem;
	align-items: flex-start;
}
.ar-tx__trust .ar-icon {
	flex: none;
	margin-top: 2px;
	color: var(--ar-on-accent);
}

.ar-tx__symptoms,
.ar-tx__steps {
	display: grid;
	margin: 1rem 0 0;
	padding: 0;
	list-style: none;
}
.ar-tx__symptoms { gap: 0.5rem; }
.ar-tx__symptoms li {
	display: flex;
	gap: 0.7rem;
	align-items: flex-start;
	padding: 0.6rem 0.8rem;
	background: rgba(255, 255, 255, 0.06);
	border: 1px solid rgba(255, 255, 255, 0.12);
	border-radius: var(--ar-radius-sm);
}
.ar-tx__symptoms .ar-icon {
	flex: none;
	margin-top: 2px;
	color: var(--ar-fixed-accent-photo);
}
.ar-tx__symptoms b,
.ar-tx__steps b {
	display: block;
	color: var(--ar-on-accent);
}
.ar-tx__symptoms span { font-size: 0.9rem; color: rgba(255, 255, 255, 0.75); }

.ar-tx__steps {
	gap: 0.6rem;
	counter-reset: ar-tx-step;
}
.ar-tx__steps li {
	counter-increment: ar-tx-step;
	display: grid;
	grid-template-columns: 2.2rem 1fr;
	gap: 0 0.6rem;
	align-items: start;
}
.ar-tx__steps li::before {
	content: counter(ar-tx-step, decimal-leading-zero);
	font-family: var(--ar-font-display);
	font-size: 1.3rem;
	line-height: 1.2;
	color: var(--ar-fixed-accent-photo);
}
.ar-tx__steps span { font-size: 0.92rem; color: rgba(255, 255, 255, 0.75); }

.ar-tx__options {
	display: grid;
	gap: 0.6rem;
	margin-top: 1rem;
}
.ar-tx__opt {
	padding: 0.8rem 0.9rem;
	border-radius: var(--ar-radius-sm);
	background: rgba(255, 255, 255, 0.06);
	border: 1px solid rgba(255, 255, 255, 0.12);
}
.ar-tx__opt.is-recommended {
	border-color: color-mix(in srgb, var(--ar-fixed-accent) 70%, transparent);
	background: color-mix(in srgb, var(--ar-fixed-accent) 14%, transparent);
}
.ar-tx__opt b {
	display: block;
	margin-bottom: 0.15rem;
	font-family: var(--ar-font-display);
	font-size: 1.15rem;
	letter-spacing: 0.02em;
	text-transform: uppercase;
}
.ar-tx__card .ar-tx__opt p {
	margin: 0;
	font-size: 0.92rem;
	color: rgba(255, 255, 255, 0.78);
}

.ar-tx__card .ar-tx__note {
	margin-top: 1rem;
	font-size: 0.85rem;
	color: rgba(255, 255, 255, 0.62);
}
.ar-tx__note a {
	color: var(--ar-on-accent);
	text-decoration-color: color-mix(in srgb, var(--ar-fixed-accent-photo) 70%, transparent);
	text-underline-offset: 0.25em;
}

.ar-tx__hours {
	display: grid;
	grid-template-columns: auto 1fr;
	gap: 0.2rem 1rem;
	margin: 1rem 0 0;
	font-size: 0.95rem;
}
.ar-tx__hours dt { color: rgba(255, 255, 255, 0.7); }
.ar-tx__hours dd { margin: 0; color: var(--ar-on-accent); }

/* Phones: the first card starts right under the stage, its kicker on one line, so the H1 is on the first screen. */
@media (max-width: 56.24rem) {
	.ar-tx__chapter:first-child {
		align-items: flex-start;
		padding-top: 1rem;
	}
	.ar-tx__title { font-size: clamp(1.9rem, 8.2vw, 2.4rem); }
}

/* ---------- phone quick-action bar ---------- */

.ar-tx__bar {
	position: fixed;
	right: 0;
	bottom: 0;
	left: 0;
	z-index: var(--ar-z-header);
	display: grid;
	grid-auto-flow: column;
	grid-auto-columns: 1fr;
	gap: 0.5rem;
	padding: 0.6rem 1rem calc(0.6rem + env(safe-area-inset-bottom));
	background: var(--ar-bg);
	border-top: 1px solid var(--ar-border);
	box-shadow: 0 -6px 24px rgba(0, 0, 0, 0.12);
}
.ar-tx__bar .ar-btn { justify-content: center; }
/* Keep the footer clear of the bar. */
body:has(.ar-tx__bar) { padding-bottom: 4.5rem; }

/* ---------- desktop: stage beside the cards ---------- */

@media (min-width: 56.25rem) {
	.ar-tx__grid { grid-template-columns: 1.12fr 0.88fr; }
	.ar-tx__stage {
		height: var(--ar-tx-stage-h);
		min-height: 520px;
	}
	.ar-tx__stage::after { display: none; }
	.ar-tx__label { font-size: 0.75rem; }
	.ar-tx__hud {
		right: clamp(1rem, 3vw, 2.5rem);
		left: clamp(1rem, 3vw, 2.5rem);
	}
	.ar-tx__hint { display: block; }
	.ar-tx__chapters { padding: 0 clamp(1rem, 4vw, 3.5rem) 20svh 0; }
	.ar-tx__chapter { min-height: 100svh; }
	.ar-tx.is-scripted .ar-tx__chapter:not(.is-active) .ar-tx__card { opacity: 0.3; }
	.ar-tx__bar { display: none; }
	body:has(.ar-tx__bar) { padding-bottom: 0; }
}

@media (prefers-reduced-motion: reduce) {
	.ar-tx__card,
	.ar-tx__poster,
	.ar-tx__canvas,
	.ar-tx__label { transition: none; }
	.ar-tx.is-scripted .ar-tx__chapter:not(.is-active) .ar-tx__card { transform: none; }
}
