/* ==========================================================================
   POOLS PROS — water layer
   Boot basin, caustics canvas, scroll spine, telemetry, clip headlines.
   ========================================================================== */

/* ------------------------------------------------------------- boot basin -- */
.boot {
	position: fixed;
	inset: 0;
	z-index: 9999;
	background: var(--ink);
	display: grid;
	place-items: center;
	transition: opacity 0.9s var(--ease), visibility 0.9s;
}

body.is-loaded .boot { opacity: 0; visibility: hidden; }

.boot__inner {
	position: relative;
	width: min(360px, 76vw);
	display: grid;
	gap: 1.25rem;
	justify-items: center;
}

.boot__mark {
	width: min(180px, 46vw);
	filter: brightness(0) invert(1);
	opacity: 0.9;
	margin-bottom: 0.75rem;
}

/* The tank: a real water surface, simulated on a canvas. */
.boot__tank {
	position: relative;
	width: 100%;
	height: clamp(74px, 11vw, 96px);
	border: 1px solid var(--line-strong);
	overflow: hidden;
	background: #070a0c;
}

.boot__tank canvas {
	display: block;
	width: 100%;
	height: 100%;
}

/* the inlet pipe, so the water has a visible source */
.boot__tank-mark {
	position: absolute;
	top: 0;
	left: 50%;
	width: 46px;
	height: 3px;
	transform: translateX(-50%);
	background: var(--line-strong);
}

.boot__tank-mark::after {
	content: "";
	position: absolute;
	left: 50%;
	top: 3px;
	width: 1px;
	height: 10px;
	transform: translateX(-50%);
	background: linear-gradient(to bottom, var(--aqua), transparent);
	opacity: 0.7;
}

.boot__row {
	width: 100%;
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 1rem;
}

.boot__pct {
	font-family: var(--font-mono);
	font-size: 0.6875rem;
	letter-spacing: 0.14em;
	color: var(--aqua);
	font-variant-numeric: tabular-nums;
}

.boot__log {
	font-family: var(--font-mono);
	font-size: 0.625rem;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	color: var(--text-3);
	text-align: right;
	min-height: 1em;
}

.boot__status {
	display: inline-flex;
	align-items: center;
	gap: 0.55rem;
	font-family: var(--font-mono);
	font-size: 0.5625rem;
	letter-spacing: 0.2em;
	text-transform: uppercase;
	color: var(--text-3);
}

.boot__status::before {
	content: "";
	width: 6px;
	height: 6px;
	border-radius: 50%;
	background: var(--aqua);
	animation: pulse 1.6s var(--ease-io) infinite;
}

@keyframes pulse {
	0%, 100% { opacity: 0.25; }
	50% { opacity: 1; }
}

/* ---------------------------------------------------------------- caustics -- */
/* width/height must be explicit: a canvas is a replaced element, so absolute
   positioning alone will not stretch it to the hero. */
.caustics {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	z-index: 1;
	pointer-events: none;
	mix-blend-mode: screen;
	opacity: 0.9;
}

.caustics--hero { z-index: -1; mix-blend-mode: screen; }

@media (prefers-reduced-motion: reduce) { .caustics { display: none; } }

/* ------------------------------------------------------------------- spine -- */
.spine {
	position: fixed;
	left: max(14px, calc((100vw - 1560px) / 2 - 74px));
	top: 50%;
	transform: translateY(-50%);
	z-index: 700;
	display: none;
	flex-direction: column;
	align-items: center;
	gap: 0.85rem;
	pointer-events: none;
}

@media (min-width: 1500px) { .spine { display: flex; } }

.spine__idx {
	font-family: var(--font-mono);
	font-size: 0.625rem;
	letter-spacing: 0.14em;
	color: var(--text-3);
	display: flex;
	gap: 3px;
}

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

.spine__track {
	position: relative;
	width: 1px;
	height: 170px;
	background: rgba(255, 255, 255, 0.1);
}

.spine__track i {
	position: absolute;
	left: 0;
	top: 0;
	width: 1px;
	height: 100%;
	background: linear-gradient(to bottom, var(--aqua), rgba(87, 224, 196, 0.25));
	transform: scaleY(var(--sp, 0));
	transform-origin: top;
}

.spine__track b {
	position: absolute;
	left: 50%;
	width: 7px;
	height: 7px;
	margin-left: -3px;
	margin-top: -3px;
	background: var(--aqua);
	border-radius: 50%;
	top: 0;
	box-shadow: 0 0 10px rgba(87, 224, 196, 0.7);
	transition: top 0.18s linear;
}

.spine__label {
	font-family: var(--font-mono);
	font-size: 0.5625rem;
	letter-spacing: 0.18em;
	color: var(--text-3);
	writing-mode: vertical-rl;
	max-height: 130px;
	overflow: hidden;
	white-space: nowrap;
	text-overflow: ellipsis;
}

/* ---------------------------------------------------- clip (word mask) text */
[data-clip] { display: block; }

/* The mask has to be taller than the glyphs it hides, or descenders get
   shaved: the box is expanded with padding and pulled back by an equal
   negative margin, so the layout footprint is unchanged. */
.clip__w {
	display: inline-block;
	overflow: hidden;
	vertical-align: bottom;
	padding: 0.18em 0.02em 0.20em 0;
	margin: -0.18em 0 -0.20em 0.02em;
}

.clip__w > i {
	display: inline-block;
	font-style: inherit;
	transform: translateY(110%);
	transition: transform 1s var(--ease);
	transition-delay: var(--wd, 0ms);
}

[data-clip].is-in .clip__w > i { transform: none; }

@media (prefers-reduced-motion: reduce) {
	.clip__w > i { transform: none; }
}

/* --------------------------------------------------------------- telemetry -- */
.panel {
	border: 1px solid var(--line);
	background: linear-gradient(180deg, var(--ink-2), var(--ink));
}

.panel__head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
	padding: 0.85rem clamp(0.9rem, 2vw, 1.4rem);
	border-bottom: 1px solid var(--line);
	background: rgba(255, 255, 255, 0.015);
}

.panel__title {
	font-family: var(--font-mono);
	font-size: 0.5625rem;
	letter-spacing: 0.2em;
	text-transform: uppercase;
	color: var(--text-2);
}

.panel__state {
	display: inline-flex;
	align-items: center;
	gap: 0.5rem;
	font-family: var(--font-mono);
	font-size: 0.5625rem;
	letter-spacing: 0.16em;
	text-transform: uppercase;
	color: var(--text-3);
}

.panel__state::before {
	content: "";
	width: 5px;
	height: 5px;
	border-radius: 50%;
	background: var(--text-3);
	transition: background 0.5s;
}

.panel__state.is-live { color: var(--aqua); }
.panel__state.is-live::before { background: var(--aqua); box-shadow: 0 0 8px rgba(87, 224, 196, 0.8); }

.gauges {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
}

@media (min-width: 760px) { .gauges { grid-template-columns: repeat(4, minmax(0, 1fr)); } }

.gauge {
	padding: clamp(1rem, 2vw, 1.6rem);
	border-right: 1px solid var(--line);
	border-bottom: 1px solid var(--line);
	position: relative;
}

.gauge:nth-child(2n) { border-right: 0; }
@media (min-width: 760px) {
	.gauge { border-right: 1px solid var(--line); }
	.gauge:nth-child(2n) { border-right: 1px solid var(--line); }
	.gauge:last-child { border-right: 0; }
}

.gauge__val {
	font-size: clamp(1.4rem, 2.6vw, 2.15rem);
	line-height: 1;
	letter-spacing: -0.03em;
	font-variant-numeric: tabular-nums;
	color: var(--text);
	min-height: 1em;
}

.gauge__bar {
	margin-top: 0.85rem;
	height: 2px;
	background: var(--line);
	position: relative;
	overflow: hidden;
}

.gauge__bar::after {
	content: "";
	position: absolute;
	inset: 0;
	background: var(--aqua);
	transform: scaleX(0);
	transform-origin: 0 50%;
	transition: transform 1.6s var(--ease);
	transition-delay: 0.2s;
}

.gauge.is-live .gauge__bar::after { transform: scaleX(var(--fill, 0.6)); }

.gauge__label { margin-top: 0.7rem; }

/* --------------------------------------------------------------- waterline -- */
.waterline {
	display: block;
	width: 100%;
	height: 60px;
	opacity: 0.9;
}

/* ------------------------------------------------------------ pointer cards */
[data-tilt] {
	transform-style: preserve-3d;
	transition: box-shadow 0.6s var(--ease), border-color 0.6s var(--ease);
	will-change: transform;
}

[data-tilt]:hover {
	border-color: var(--line-strong);
	box-shadow: 0 24px 60px -30px rgba(0, 0, 0, 0.9);
}

/* -------------------------------------------------------------- specimens --- */
/* Technical specimen cards: no gloss, no rounded corners, just material. */
.specimens {
	display: grid;
	gap: 1px;
	background: var(--line);
	border: 1px solid var(--line);
}

@media (min-width: 720px) { .specimens { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1180px) { .specimens { grid-template-columns: repeat(4, minmax(0, 1fr)); } }

.specimen {
	background: var(--ink);
	padding: clamp(1.25rem, 2.2vw, 1.9rem);
	display: grid;
	gap: 0.75rem;
	align-content: start;
	position: relative;
	overflow: hidden;
}

.specimen::after {
	content: attr(data-n);
	position: absolute;
	top: 0.4rem;
	right: 0.75rem;
	font-family: var(--font-mono);
	font-size: 3.4rem;
	line-height: 1;
	color: transparent;
	-webkit-text-stroke: 1px rgba(233, 244, 244, 0.08);
	pointer-events: none;
}

.specimen h4 {
	font-size: 1rem;
	font-weight: 600;
	letter-spacing: -0.015em;
}

.specimen p { font-size: 0.875rem; color: var(--text-2); }

.specimen__u {
	font-family: var(--font-mono);
	font-size: 0.5625rem;
	letter-spacing: 0.16em;
	text-transform: uppercase;
	color: var(--aqua);
}
/* ------------------------------------------------------------- live tanks -- */
/* A real simulation viewport: instrument panel, not a video player. */
.live-tank {
	position: relative;
	border: 1px solid var(--line);
	background: #05080a;
	overflow: hidden;
	aspect-ratio: 21 / 8;
	cursor: crosshair;
}

.live-tank canvas {
	display: block;
	width: 100%;
	height: 100%;
}

.live-tank--shallow { aspect-ratio: 21 / 7; }

.live-tank__chrome {
	position: absolute;
	inset: auto 0 0 0;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
	padding: 0.75rem clamp(0.75rem, 2vw, 1.25rem);
	background: linear-gradient(to top, rgba(5, 8, 10, 0.92), rgba(5, 8, 10, 0));
	pointer-events: none;
}

@media (max-width: 620px) {
	.live-tank__chrome { flex-direction: column; align-items: flex-start; gap: 0.25rem; }
}
