/* ==========================================================================
   POOLS PROS — extended system
   Discipline sections, technical drawing language, premium motion.
   No gradients-as-decoration, no glass, no glows: this reads like a
   specification sheet that happens to move.
   ========================================================================== */

/* ------------------------------------------------------ technical canvas -- */
/* Measured grid: faint drafting lines that anchor the whole page. */
.tech-grid {
	position: fixed;
	inset: 0;
	z-index: -3;
	pointer-events: none;
	background-image:
		linear-gradient(to right, rgba(233, 244, 244, 0.032) 1px, transparent 1px),
		linear-gradient(to bottom, rgba(233, 244, 244, 0.032) 1px, transparent 1px);
	background-size: calc(100% / 6) 100%, 100% 140px;
	mask-image: linear-gradient(to bottom, transparent, #000 12%, #000 78%, transparent);
}

@media (max-width: 700px) { .tech-grid { background-size: 100% 100%, 100% 110px; } }

/* ------------------------------------------------------------ annotations -- */
/* Engineering callouts pinned to an image. */
.callout {
	position: absolute;
	z-index: 3;
	font-family: var(--font-mono);
	font-size: 0.5625rem;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	color: var(--text);
	display: inline-flex;
	align-items: center;
	gap: 0.5rem;
	white-space: nowrap;
}

.callout::before {
	content: "";
	width: 28px;
	height: 1px;
	background: var(--aqua);
	flex: none;
}

.callout::after {
	content: "";
	position: absolute;
	left: -3px;
	top: -3px;
	width: 7px;
	height: 7px;
	border: 1px solid var(--aqua);
	border-radius: 50%;
}

.callout--end { flex-direction: row-reverse; }
.callout--end::before { order: 2; }
.callout--end::after { left: auto; right: -3px; }

.callout b { color: var(--aqua); font-weight: 400; }

/* Corner registration marks, like a drawing sheet. */
.reg {
	position: absolute;
	width: 16px;
	height: 16px;
	border: 1px solid var(--line-strong);
	z-index: 3;
	pointer-events: none;
}

.reg--tl { top: 12px; left: 12px; border-right: 0; border-bottom: 0; }
.reg--tr { top: 12px; right: 12px; border-left: 0; border-bottom: 0; }
.reg--bl { bottom: 12px; left: 12px; border-right: 0; border-top: 0; }
.reg--br { bottom: 12px; right: 12px; border-left: 0; border-top: 0; }

/* Dimension line with ticks. */
.dimension {
	position: absolute;
	left: 12px;
	right: 12px;
	bottom: 14px;
	height: 9px;
	border-top: 1px solid var(--line-strong);
	z-index: 3;
	pointer-events: none;
}

.dimension::before,
.dimension::after {
	content: "";
	position: absolute;
	top: -5px;
	width: 1px;
	height: 9px;
	background: var(--line-strong);
}

.dimension::before { left: 0; }
.dimension::after { right: 0; }

.dimension span {
	position: absolute;
	left: 50%;
	top: -7px;
	transform: translateX(-50%);
	background: var(--ink);
	padding-inline: 8px;
	font-family: var(--font-mono);
	font-size: 0.5rem;
	letter-spacing: 0.16em;
	color: var(--text-3);
}

/* ----------------------------------------------------- discipline panels -- */
/* The three flagships. Full-bleed, tall, dark, image-led. */
.discipline {
	position: relative;
	isolation: isolate;
	min-height: 100svh;
	display: flex;
	align-items: flex-end;
	overflow: hidden;
	padding-block: clamp(4rem, 9vw, 8rem);
	border-top: 1px solid var(--line);
}

.discipline__bg {
	position: absolute;
	inset: 0;
	z-index: -2;
	overflow: hidden;
}

.discipline__bg img {
	width: 100%;
	height: 122%;
	object-fit: cover;
	filter: saturate(0.72) brightness(0.62) contrast(1.06);
	will-change: transform;
}

.discipline__bg::after {
	content: "";
	position: absolute;
	inset: 0;
	background:
		linear-gradient(to top, var(--ink) 4%, rgba(6, 8, 10, 0.55) 46%, rgba(6, 8, 10, 0.35) 100%),
		linear-gradient(to right, rgba(6, 8, 10, 0.86) 0%, rgba(6, 8, 10, 0.25) 58%, transparent 100%);
}

.discipline__inner { position: relative; width: 100%; }

.discipline__head {
	display: grid;
	gap: clamp(1.25rem, 3vw, 2.5rem);
	margin-bottom: clamp(2rem, 4vw, 3rem);
}

@media (min-width: 1000px) {
	.discipline__head { grid-template-columns: minmax(0, 1fr) minmax(0, 0.85fr); align-items: end; }
}

/* The reveal masks each line with overflow:hidden, and 0.86 line-height
   is shorter than the glyph box — the descenders of "ming Pools" were being
   shaved. Padding opens the clip box; the matching negative margin gives the
   space back, so the layout does not move. */
.discipline__name {
	font-size: clamp(2.6rem, 8vw, 8.5rem);
	line-height: 0.86;
	letter-spacing: -0.045em;
	font-weight: 600;
	text-transform: uppercase;
	white-space: nowrap;
	overflow: hidden;
	padding-bottom: 0.14em;
	margin-bottom: -0.14em;
}

.discipline__name span {
	display: block;
	transform: translateY(105%);
	transition: transform 1.15s var(--ease);
	transition-delay: var(--d, 0ms);
}

.discipline.is-in .discipline__name span { transform: none; }

/* The discipline pages put a small label at the top of the panel. It was
   absolutely positioned from the header height, which put it at 108px — inside
   the name's box, which is 186px tall, so the two overprinted. In flow it
   simply sits above the name and no magic number can put it back. */
.discipline__inner > .callout {
	position: static;
	display: flex;
	margin-bottom: clamp(1.5rem, 3.5vh, 2.75rem);
}

.discipline__copy { color: var(--text-2); max-width: 48ch; font-size: clamp(0.95rem, 0.9rem + 0.25vw, 1.1rem); }

.discipline__foot {
	display: flex;
	flex-wrap: wrap;
	align-items: flex-end;
	justify-content: space-between;
	gap: 1.5rem;
	padding-top: 1.25rem;
	border-top: 1px solid var(--line);
}

.discipline__list {
	display: flex;
	flex-wrap: wrap;
	gap: 0.4rem 1.25rem;
	max-width: 46ch;
}

.discipline__list span {
	font-family: var(--font-mono);
	font-size: 0.625rem;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	color: var(--text-3);
	position: relative;
	padding-left: 0.9rem;
}

.discipline__list span::before {
	content: "";
	position: absolute;
	left: 0;
	top: 0.5em;
	width: 5px;
	height: 1px;
	background: var(--aqua);
}

.discipline__num {
	position: absolute;
	top: clamp(2rem, 5vw, 4rem);
	right: var(--gutter);
	z-index: 2;
	font-family: var(--font-mono);
	font-size: 0.6875rem;
	letter-spacing: 0.18em;
	color: var(--text-3);
}

.discipline__metrics {
	display: flex;
	flex-wrap: wrap;
	gap: clamp(1.25rem, 3vw, 3rem);
	margin-top: clamp(1.5rem, 3vw, 2.5rem);
}

.discipline__metrics div strong {
	display: block;
	font-size: clamp(1.4rem, 2.6vw, 2.2rem);
	font-weight: 500;
	letter-spacing: -0.03em;
	line-height: 1;
	font-variant-numeric: tabular-nums;
}

/* --------------------------------------------------------------- rail ----- */
/* Horizontal scroll of project stills. Drag, wheel or swipe. */
.rail {
	position: relative;
	border-top: 1px solid var(--line);
	border-bottom: 1px solid var(--line);
	padding-block: clamp(1.5rem, 3vw, 2.5rem);
}

.rail__head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1.5rem;
	margin-bottom: 1.5rem;
}

.rail__track {
	display: flex;
	gap: clamp(0.75rem, 1.5vw, 1.25rem);
	overflow-x: auto;
	scroll-snap-type: x mandatory;
	scrollbar-width: none;
	cursor: grab;
	padding-bottom: 0.25rem;
}

.rail__track::-webkit-scrollbar { display: none; }
.rail__track.is-dragging { cursor: grabbing; scroll-snap-type: none; }

.rail__track > * { scroll-snap-align: start; flex: none; }

.rail__card {
	width: clamp(240px, 30vw, 420px);
	display: block;
}

.rail__card .figure { aspect-ratio: 4 / 3; }

.rail__card img {
	transition: transform 1.2s var(--ease), filter 0.8s var(--ease);
	filter: saturate(0.85) contrast(1.03);
}

.rail__card:hover img { transform: scale(1.05); filter: saturate(1.05); }

.rail__meta {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 1rem;
	margin-top: 0.9rem;
	padding-top: 0.7rem;
	border-top: 1px solid var(--line);
}

.rail__title { font-size: 0.9375rem; letter-spacing: -0.01em; line-height: 1.25; }

.rail__nav { display: flex; gap: 0.5rem; }

.rail__btn {
	width: 34px;
	height: 34px;
	border: 1px solid var(--line-strong);
	display: grid;
	place-items: center;
	transition: background 0.4s var(--ease), border-color 0.4s var(--ease), color 0.4s var(--ease);
}

.rail__btn:hover { background: var(--aqua); border-color: var(--aqua); color: var(--ink); }

/* ------------------------------------------------------------ spec table --- */
/* Numbers-heavy layout: reads like a drawing schedule, not a card grid. */
.spec { width: 100%; border-collapse: collapse; }

.spec th,
.spec td {
	text-align: left;
	padding: clamp(0.8rem, 1.4vw, 1.15rem) clamp(0.5rem, 1.5vw, 1.5rem) clamp(0.8rem, 1.4vw, 1.15rem) 0;
	border-bottom: 1px solid var(--line);
	vertical-align: baseline;
}

.spec th {
	font-family: var(--font-mono);
	font-size: 0.5625rem;
	letter-spacing: 0.16em;
	text-transform: uppercase;
	color: var(--text-3);
	font-weight: 400;
}

.spec td { font-size: 0.9375rem; color: var(--text-2); }
.spec td:first-child { color: var(--text); }
.spec tr:hover td { color: var(--text); }

.spec__wrap { overflow-x: auto; border-top: 1px solid var(--line); }

/* --------------------------------------------------------------- odometer -- */
/* Counter with a sliding digit column, for an instrument-panel feel. */
.odo { display: inline-flex; font-variant-numeric: tabular-nums; }

/* ------------------------------------------------------------ mask reveal -- */
/* Image wipes in with a clip-path instead of a lazy fade. */
.mask {
	overflow: hidden;
	position: relative;
}

.mask img {
	clip-path: inset(0 100% 0 0);
	transition: clip-path 1.4s var(--ease);
	transition-delay: var(--d, 0ms);
}

.mask.is-in img { clip-path: inset(0 0 0 0); }

/* ------------------------------------------------------------- line list --- */
/* Numbered lines that slide in from the left, one by one. */
.lines { display: grid; }

.lines > * {
	display: grid;
	grid-template-columns: auto minmax(0, 1fr);
	gap: 1rem;
	padding-block: clamp(0.85rem, 1.6vw, 1.25rem);
	border-bottom: 1px solid var(--line);
	opacity: 0;
	transform: translateX(-18px);
	transition: opacity 0.8s var(--ease), transform 0.8s var(--ease);
	transition-delay: var(--d, 0ms);
}

.lines.is-in > * { opacity: 1; transform: none; }

.lines .mono { padding-top: 0.2rem; }
.lines p { color: var(--text-2); max-width: 62ch; }

/* ------------------------------------------------------------ big numerals -- */
.bignum {
	position: relative;
	z-index: 0;
	font-size: clamp(6rem, 26vw, 24rem);
	line-height: 0.72;
	letter-spacing: -0.06em;
	font-weight: 600;
	color: transparent;
	-webkit-text-stroke: 1px rgba(233, 244, 244, 0.07);
	user-select: none;
	pointer-events: none;
}

/* ------------------------------------------------------------- scrollbar --- */
.scroll-progress {
	position: fixed;
	top: 0;
	left: 0;
	height: 2px;
	width: 100%;
	transform-origin: 0 50%;
	transform: scaleX(0);
	background: var(--aqua);
	z-index: 1001;
}

/* ---------------------------------------------------------------- ticker --- */
/* Scrolling data strip, like a site readout. */
.ticker {
	border-top: 1px solid var(--line);
	border-bottom: 1px solid var(--line);
	overflow: hidden;
	padding-block: 0.75rem;
}

.ticker__track {
	display: flex;
	width: max-content;
	animation: slide 38s linear infinite;
}

.ticker__track span {
	font-family: var(--font-mono);
	font-size: 0.625rem;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	color: var(--text-3);
	padding-right: 2.5rem;
	display: inline-flex;
	align-items: center;
	gap: 2.5rem;
}

.ticker__track span b { color: var(--aqua); font-weight: 400; }

@media (max-width: 700px) { .discipline__name { white-space: normal; } }