/* ===========================================================================
   BASE — reset, typography, layout primitives, buttons, utilities
   Everything global. Section-specific rules belong in sections.css.
   =========================================================================== */

/* ---------------------------------------------------------------------------
   1. Self-hosted fonts (optional)
   Drop .woff2 files into assets/fonts/ and uncomment, then point
   --vub-font-display at the family name in variables.css.

   @font-face {
       font-family: "VUB Display";
       src: url("../fonts/vub-display.woff2") format("woff2");
       font-weight: 700 900;
       font-display: swap;
   }
--------------------------------------------------------------------------- */

/* ---------------------------------------------------------------------------
   2. Reset / normalisation
--------------------------------------------------------------------------- */
*,
*::before,
*::after {
	box-sizing: border-box;
}

html {
	-webkit-text-size-adjust: 100%;
	/* The same ground as <body>. Painted before any stylesheet has finished, so
	   the gap between one document leaving and the next one painting is black
	   rather than the browser's default white. */
	background-color: var(--vub-black);
	scroll-behavior: smooth;
	/* Anchor links must not slide under the sticky header. */
	scroll-padding-top: calc(var(--vub-header-height) + var(--vub-space-md));
}

@media (prefers-reduced-motion: reduce) {
	html { scroll-behavior: auto; }
}

body.vub-theme {
	margin: 0;
	background-color: var(--vub-black);
	color: var(--vub-text);
	font-family: var(--vub-font-body);
	font-size: var(--vub-text-md);
	line-height: var(--vub-leading-relaxed);
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
	overflow-x: hidden;
}

img,
picture,
video,
canvas,
svg {
	display: block;
	max-width: 100%;
	height: auto;
}

input,
button,
textarea,
select {
	font: inherit;
	color: inherit;
}

/* ---------------------------------------------------------------------------
   3. Typography
--------------------------------------------------------------------------- */
/* The element list is wrapped in :where() so these defaults carry the
   specificity of `.vub-theme` alone (0,1,0) instead of (0,1,1).

   Why it matters: a component rule like .vub-footer__heading or
   .vub-hero__title is also (0,1,0). Without :where(), the base rule below
   was MORE specific and silently overrode every component font-size —
   footer column headings rendered at h2 size, and the hero h1 was capped at
   --vub-text-4xl instead of --vub-text-hero.

   With :where(), specificity ties and the later file wins. Since the cascade
   order is base -> header -> hero -> sections -> footer -> responsive, every
   component file naturally overrides these defaults. */
.vub-theme :where(h1, h2, h3, h4, h5, h6) {
	margin: 0 0 var(--vub-space-sm);
	font-family: var(--vub-font-display);
	font-weight: var(--vub-weight-black);
	line-height: var(--vub-leading-tight);
	letter-spacing: var(--vub-tracking-tight);
	color: var(--vub-white);
	text-wrap: balance;
}

.vub-theme :where(h1) { font-size: var(--vub-text-4xl); }
.vub-theme :where(h2) { font-size: var(--vub-text-3xl); }
.vub-theme :where(h3) { font-size: var(--vub-text-xl); }
.vub-theme :where(h4) { font-size: var(--vub-text-lg); }

.vub-theme p {
	margin: 0 0 var(--vub-space-md);
	text-wrap: pretty;
}

.vub-theme p:last-child { margin-bottom: 0; }

.vub-theme a {
	color: var(--vub-white);
	text-decoration-color: var(--vub-red);
	text-underline-offset: 0.2em;
	transition: var(--vub-transition-color);
}

.vub-theme a:hover { color: var(--vub-red); }

.vub-theme strong { font-weight: var(--vub-weight-bold); color: var(--vub-white); }

.vub-theme ul,
.vub-theme ol { margin: 0 0 var(--vub-space-md); padding-left: 1.25em; }

.vub-theme li { margin-bottom: var(--vub-space-2xs); }

::selection {
	background: var(--vub-red);
	color: var(--vub-white);
}

/* Accessible, always-visible focus. Never remove this. */
.vub-theme :focus-visible {
	outline: 2px solid var(--vub-focus);
	outline-offset: 3px;
}

/* Softens the ring on elements with no radius of their own. Kept apart, at the
   lowest specificity, because it reshapes the element as well as the ring: any
   component that sets its own radius — the square buttons — keeps it when
   focused, and the ring follows that shape instead. */
.vub-theme :where(:focus-visible) { border-radius: var(--vub-radius-sm); }

/* ---------------------------------------------------------------------------
   4. Layout primitives
--------------------------------------------------------------------------- */
/* Full-bleed: no centred max-width, just --vub-gutter on both sides. The token
   carries the width ramp (see variables.css), so the content column is always
   the viewport less two gutters — 100px each on a desktop, 20px on a phone. */
.vub-container {
	width: 100%;
	padding-inline: var(--vub-gutter);
}

.vub-container--narrow { max-width: var(--vub-container-narrow); }
.vub-container--wide   { max-width: var(--vub-container-wide); }

.vub-main { display: block; }

/* Every homepage band. Alternating background handled by a modifier. */
.vub-section {
	position: relative;
	padding-block: var(--vub-section-y);
}

.vub-section--alt      { background-color: var(--vub-surface); }
.vub-section--flush    { padding-block: 0; }
.vub-section--tight    { padding-block: var(--vub-section-y-tight); }

/* Hairline between two sections that share a background. */
.vub-section--divided { border-top: var(--vub-rule); }

/* Generic responsive grid. Set --cols per section in sections.css. */
.vub-grid {
	display: grid;
	gap: var(--vub-grid-gap);
	grid-template-columns: repeat(var(--cols, 1), minmax(0, 1fr));
}

/* Auto-fitting grid for card sets of unknown length. */
.vub-grid--auto {
	grid-template-columns: repeat(auto-fit, minmax(min(var(--min, 280px), 100%), 1fr));
}

/* ---------------------------------------------------------------------------
   5. Section heading pattern (output by vub_section_head())
--------------------------------------------------------------------------- */
.vub-section__head {
	max-width: 46rem;
	margin-bottom: var(--vub-space-xl);
}

.vub-section__head--center {
	margin-inline: auto;
	text-align: center;
}

.vub-eyebrow {
	margin: 0 0 var(--vub-space-xs);
	font-size: var(--vub-text-xs);
	font-weight: var(--vub-weight-bold);
	letter-spacing: var(--vub-tracking-wider);
	text-transform: uppercase;
	color: var(--vub-red);
}

/* One size whatever the element: a section that is the whole page carries an
   h1, and it should not jump a size because of it. */
.vub-section__title {
	font-size: var(--vub-text-3xl);
	margin-bottom: var(--vub-space-sm);
}

.vub-section__intro {
	font-size: var(--vub-text-lg);
	color: var(--vub-text-muted);
	margin-bottom: 0;
}

/* ---------------------------------------------------------------------------
   6. Buttons
--------------------------------------------------------------------------- */
.vub-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: var(--vub-space-2xs);
	padding: 0.9em 2em;
	border: var(--vub-border-width) solid transparent;
	border-radius: var(--vub-radius-button);
	font-size: var(--vub-text-sm);
	font-weight: var(--vub-weight-bold);
	letter-spacing: var(--vub-tracking-wide);
	text-transform: uppercase;
	text-decoration: none;
	line-height: 1;
	cursor: pointer;
	transition: var(--vub-transition-color);
}

.vub-btn--primary {
	background-color: var(--vub-red);
	border-color: var(--vub-red);
	color: var(--vub-white);
}

.vub-btn--primary:hover,
.vub-btn--primary:focus-visible {
	background-color: var(--vub-red-hover);
	border-color: var(--vub-red-hover);
	color: var(--vub-white);
}

.vub-btn--secondary {
	background-color: transparent;
	border-color: var(--vub-border-strong);
	color: var(--vub-white);
}

.vub-btn--secondary:hover,
.vub-btn--secondary:focus-visible {
	background-color: var(--vub-white);
	border-color: var(--vub-white);
	color: var(--vub-black);
}

.vub-btn--ghost {
	padding-inline: 0;
	background: none;
	border: 0;
	color: var(--vub-white);
	border-bottom: 2px solid var(--vub-red);
	border-radius: 0;
	padding-bottom: 0.4em;
}

.vub-btn--ghost:hover { color: var(--vub-red); }

.vub-btn-group {
	display: flex;
	flex-wrap: wrap;
	gap: var(--vub-space-sm);
}

/* Astra's scroll-to-top button, worn as a red glove punching up instead of
   Astra's blue square and arrow. Astra styles it by ID in its inline CSS, so
   every override needs the ID too. Its own dotted :focus border goes; the
   theme's :focus-visible ring stays for the keyboard. */
.vub-theme #ast-scroll-top,
.vub-theme #ast-scroll-top:hover {
	width: 38px;
	height: 60px;
	background: url("../images/Scroll Top Glove.webp") center / contain no-repeat;
	border: 0;
	border-radius: var(--vub-radius-sm);
	filter: drop-shadow(0 6px 10px rgb(0 0 0 / 0.55));
}

.vub-theme #ast-scroll-top .ast-icon { display: none; }

/* "UP" on the glove's padded face: the face is the top ~64% of the picture,
   with the thumb in its right ~20%. Empty alt text keeps screen readers on
   Astra's own "Scroll to Top" label; browsers without the alt syntax keep the
   first declaration. In Albanian and German the word is the translation's,
   set by vub_enqueue_styles() (inc/enqueue.php). */
.vub-theme #ast-scroll-top::after {
	content: "UP";
	content: "UP" / "";
	position: absolute;
	top: 26%;
	left: 0;
	right: 18%;
	color: var(--vub-white);
	font-family: var(--vub-font-display);
	font-size: 12px;
	font-weight: 900;
	letter-spacing: 0.04em;
	line-height: 1;
	text-align: center;
	text-shadow: 0 1px 2px rgb(0 0 0 / 0.5);
	pointer-events: none;
}

@media (hover: hover) and (pointer: fine) and (prefers-reduced-motion: no-preference) {
	.vub-theme #ast-scroll-top { transition: transform var(--vub-duration) var(--vub-ease-out); }
	.vub-theme #ast-scroll-top:hover { transform: translateY(-6px); }
}

/* ---------------------------------------------------------------------------
   7. Cards and media
--------------------------------------------------------------------------- */
.vub-card {
	display: flex;
	flex-direction: column;
	background-color: var(--vub-surface-2);
	border: var(--vub-rule);
	border-radius: var(--vub-radius-box);
	padding: var(--vub-space-lg);
	transition: border-color var(--vub-duration) var(--vub-ease),
	            background-color var(--vub-duration) var(--vub-ease);
}

.vub-card:hover {
	border-color: var(--vub-border-strong);
	background-color: var(--vub-surface-3);
}

.vub-card__title { margin-bottom: var(--vub-space-2xs); }

.vub-card__text {
	color: var(--vub-text-muted);
	font-size: var(--vub-text-base);
	margin-bottom: 0;
}

.vub-media {
	position: relative;
	overflow: hidden;
	border-radius: var(--vub-radius-box);
	background-color: var(--vub-surface-2);
}

.vub-media img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

/* The frame's only moving part. Every photograph vub_image() prints sits in
   this wrapper rather than directly in the box, so anything that shifts the
   picture — today the camera drift further down — moves this and leaves the
   box, its border, its radius and its overflow clip completely still.

   It carries a small permanent overscan and nothing else: the picture is a
   little larger than the box at rest, so there is always some of it beyond all
   four edges to move into. That is the whole of the effect with no JavaScript,
   on a touch screen and under reduced motion — the crop is 7% tighter than a
   bare <img> would be and it never moves. Everything below writes only the
   four --vub-tilt-* offsets, never the transform itself, so the resting
   overscan cannot be overwritten by accident. */
.vub-media__inner {
	--vub-tilt-x: 0px;
	--vub-tilt-y: 0px;
	--vub-tilt-rx: 0deg;
	--vub-tilt-ry: 0deg;
	--vub-tilt-scale: 1.07;
	--vub-tilt-depth: 1000px;

	position: absolute;
	inset: 0;
	transform: scale(var(--vub-tilt-scale));
}

/* Block, so the inline baseline's descender cannot push the picture down
   inside a wrapper that is exactly as tall as it is. */
.vub-media__inner img { display: block; }

/* Stand-in until real photography is dropped into assets/images/. */
.vub-media--placeholder {
	display: grid;
	place-items: center;
	border: 1px dashed var(--vub-border-strong);
	color: var(--vub-text-faint);
	font-size: var(--vub-text-xs);
	letter-spacing: var(--vub-tracking-wider);
	text-transform: uppercase;
}

/* Construction lines — the white lines drawn over a photograph traced from a
   sketch (the gallery's frames, the About photograph's frame). One SVG, its
   viewBox stretched to exactly the box the photographs are placed in, so the
   lines and the clips share one set of coordinates; whatever runs on past that
   box is still drawn. The stroke stays one width however large the drawing is
   shown. Half a pixel is a single device pixel on a high-density screen: a
   hairline, at half strength so it sits into the ground rather than on top of
   it. */
.vub-lines {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	overflow: visible;
	pointer-events: none;
	fill: none;
	stroke: var(--vub-white);
	stroke-width: 0.5px;
	opacity: 0.5;
}

.vub-lines path { vector-effect: non-scaling-stroke; }

/* ---------------------------------------------------------------------------
   Camera drift — the picture answers the pointer.

   Once main.js has switched a box live (.is-interactive, see mediaArm())
   the photograph slides a little against the pointer and turns a couple of
   degrees toward it, so crossing the picture reads as a camera easing that way
   rather than as a card being tipped. main.js writes only the four offsets;
   the shape of the transform, the perspective and the resting overscan all
   live on .vub-media__inner further up.

   Three things keep it honest:

     - Only the wrapper moves. The box, its border, its radius and its overflow
       clip are never transformed, so the frame is dead still and the picture
       is clipped by it exactly as before.
     - The perspective is a function inside the wrapper's own transform rather
       than the `perspective` property on the box. Same projection — the
       wrapper is the box's size and both origins are its centre — but the box
       never becomes a 3D rendering context, so the canvas and the border
       pseudo-element keep stacking above the picture by z-index alone.
     - The gate is a media query, not the class. Without a fine pointer that
       can hover, or with motion turned down, .is-interactive can sit on the
       box all it likes and the offsets are never read.
--------------------------------------------------------------------------- */
@media (hover: hover) and (pointer: fine) and (prefers-reduced-motion: no-preference) {
	.vub-media.is-interactive > .vub-media__inner {
		transform: perspective(var(--vub-tilt-depth))
		           translate3d(var(--vub-tilt-x), var(--vub-tilt-y), 0)
		           rotateX(var(--vub-tilt-rx))
		           rotateY(var(--vub-tilt-ry))
		           scale(var(--vub-tilt-scale));
	}

	/* Only while the pointer is actually over the box. main.js drops the class
	   again once the picture has come back to rest, so the hint is never left
	   standing on an idle layer. */
	.vub-media.is-tilting > .vub-media__inner { will-change: transform; }
}

/* ---------------------------------------------------------------------------
   Media link — the whole picture as one click target.

   The box itself is the <a>. Nothing is layered over it to catch the click, so
   it is one tab stop, Enter activates it, the browser's own middle-click and
   context menu work, and with JavaScript off it is simply a link to the About
   page. The caption and the vignette are decorative children of it, hidden
   from assistive technology and untouchable by the pointer.

   Both sit on the box rather than on .vub-media__inner. The camera drift moves
   the wrapper; the caption is not in it, so it stays dead centre and dead
   still while the photograph travels underneath it.
--------------------------------------------------------------------------- */
.vub-media--link {
	display: block;
	text-decoration: none;
	cursor: pointer;
}

/* The theme turns link text red on hover. This link carries a photograph, and
   its caption sets its own colours. */
.vub-theme .vub-media--link,
.vub-theme .vub-media--link:hover { color: inherit; }

/* The theme's focus ring, at the box's own radius rather than the 2px default,
   and standing off the edge far enough to read against the photograph. */
.vub-theme .vub-media--link:focus-visible {
	outline: 3px solid var(--vub-focus);
	outline-offset: 4px;
	border-radius: var(--vub-radius-box);
}

.vub-media__veil,
.vub-media__cta {
	position: absolute;
	pointer-events: none;
	opacity: 0;
}

/* Darkest at the very centre, where the words go, and again around the outside;
   lightest through the ring between them, so the room is never hidden. Under
   the border (z-index 2), so the vignette cannot dim the frame. */
.vub-media__veil {
	inset: 0;
	z-index: 1;
	background: radial-gradient(
		ellipse at center,
		rgba(8, 9, 10, 0.56) 0%,
		rgba(8, 9, 10, 0.24) 44%,
		rgba(8, 9, 10, 0.62) 100%
	);
	transition: opacity 250ms var(--vub-ease);
}

.vub-media__cta {
	left: 50%;
	top: 50%;
	z-index: 3;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 0.7em;
	/* Centring and entrance in one transform, so the two can never fight over
	   the property. */
	transform: translate(-50%, -50%) translateY(6px) scale(0.96);
	transition: opacity 250ms var(--vub-ease),
	            transform 250ms var(--vub-ease-out);
}

.vub-media__cta-label {
	font-family: var(--vub-font-display);
	font-size: var(--vub-text-sm);
	font-weight: var(--vub-weight-black);
	line-height: 1;
	letter-spacing: var(--vub-tracking-wider);
	text-transform: uppercase;
	color: var(--vub-white);
	white-space: nowrap;
	/* Against the vignette this is white on roughly #14161a — far past AA at
	   any size — and the shadow only steadies it over the brightest part of
	   the photograph. */
	text-shadow: 0 1px 12px rgba(8, 9, 10, 0.55);
}

.vub-media__cta-mark {
	display: block;
	width: 28px;
	height: 2px;
	background-color: var(--vub-red);
}

/* Only once main.js has switched the box live (.is-interactive), so the
   caption never promises a journey the script is not there to make. */
@media (hover: hover) and (pointer: fine) {
	.vub-media--link.is-interactive:hover .vub-media__veil { opacity: 1; }

	.vub-media--link.is-interactive:hover .vub-media__cta {
		opacity: 1;
		transform: translate(-50%, -50%) translateY(0) scale(1);
	}
}

.vub-media--link.is-interactive:focus-visible .vub-media__veil { opacity: 1; }

.vub-media--link.is-interactive:focus-visible .vub-media__cta {
	opacity: 1;
	transform: translate(-50%, -50%) translateY(0) scale(1);
}

/* No pointer to hover with: the caption stands there from the moment the box
   is interactive, so it is obvious the picture goes somewhere. Smaller and
   over a lighter vignette, since it is permanent rather than a response. One
   tap follows the link — there is no reveal step to get through first. */
@media (hover: none), (pointer: coarse) {
	.vub-media--link.is-interactive .vub-media__veil { opacity: 1; }

	.vub-media--link.is-interactive .vub-media__cta {
		opacity: 1;
		transform: translate(-50%, -50%);
	}

	.vub-media--link .vub-media__veil {
		background: radial-gradient(
			ellipse at center,
			rgba(8, 9, 10, 0.44) 0%,
			rgba(8, 9, 10, 0.16) 46%,
			rgba(8, 9, 10, 0.48) 100%
		);
	}

	.vub-media--link .vub-media__cta-label { font-size: var(--vub-text-xs); }
	.vub-media--link .vub-media__cta-mark { width: 20px; }
}

/* Motion turned down: the caption still answers the pointer, it just arrives
   by fading rather than by moving. */
@media (prefers-reduced-motion: reduce) {
	.vub-media__cta {
		transform: translate(-50%, -50%);
		transition: opacity 250ms var(--vub-ease);
	}

	.vub-media--link.is-interactive:hover .vub-media__cta,
	.vub-media--link.is-interactive:focus-visible .vub-media__cta {
		transform: translate(-50%, -50%);
	}
}

/* ---------------------------------------------------------------------------
   Entering the gym — the homepage card becomes the About page hero.

   Two routes to the same effect, chosen by what the browser can do:

     1. A cross-document view transition. The browser snapshots the card here
        and the hero there, and morphs one into the other itself. Everything
        below from @view-transition to the ::view-transition-* rules is that
        route, and main.js only decides WHICH navigations are allowed to use
        it — every other link on the site navigates exactly as it did before.

     2. Failing that, main.js clones the card into a fixed box and animates it
        to fill the viewport. Same 800ms, same curve, same 1.15 push into the
        photograph; the classes it needs are at the end of this block.

   The shared name has to appear exactly once per document. Here that is the
   About card — and only once main.js has made it interactive, since the
   opening below is what the transition picks up from.
--------------------------------------------------------------------------- */
@media (prefers-reduced-motion: no-preference) {
	@view-transition { navigation: auto; }
}

/* Once the journey starts the clone is the picture on screen, so the name has
   to move with it — the same name may only appear once in a document, and a
   duplicate makes the browser abandon the transition altogether. */
.vub-media--link.is-interactive.vub-vt-gym { view-transition-name: about-gym-image; }

.vub-entering-gym .vub-media--link.vub-vt-gym { view-transition-name: none; }

.vub-enter-clone { view-transition-name: about-gym-image; }

/* The handoff, not the opening. By the time this runs the clone has already
   finished growing and sits on exactly the rectangle the About hero occupies,
   so this group has nowhere to travel: it holds the picture still across the
   document boundary while the browser swaps the page underneath it. Short,
   because there is nothing to watch. */
::view-transition-group(about-gym-image) {
	animation-duration: 260ms;
	animation-timing-function: linear;
}

/* Both snapshots fill the group and are cropped rather than stretched, so a
   near-square card can become a wide hero without the room distorting on the way.
   Same object-position at both ends, so the focal point does not drift. */
::view-transition-old(about-gym-image),
::view-transition-new(about-gym-image) {
	width: 100%;
	height: 100%;
	object-fit: cover;
	object-position: 50% 50%;
	animation-duration: 260ms;
	animation-timing-function: linear;
}

/* Everything that is not the photograph goes to black while the photograph
   expands: both documents paint on --vub-black, so fading the old root out is
   fading it to black. */
/* Everything that is not the photograph. At this point that is the header and
   nothing else — the opening has already covered the page — and the two headers
   are the same bar at the same height, so this crossfade has almost nothing to
   crossfade. Kept short and simple for that reason. */
::view-transition-old(root) {
	animation: vub-vt-out 200ms linear both;
}

::view-transition-new(root) {
	animation: vub-vt-in 200ms linear both;
}

@keyframes vub-vt-out { to { opacity: 0; } }
@keyframes vub-vt-in { from { opacity: 0; } }

/* --- The opening ---------------------------------------------------------

   The card is copied into a fixed layer at exactly the rectangle it already
   occupies, and that rectangle is then grown until it is the viewport below
   the header. Nothing is scaled: width and height are animated, so
   object-fit: cover re-solves the crop on every frame and the extra width of
   the photograph — the room hidden off each side of the card — comes into view
   as the box makes room for it, while the card's slanted clip opens out to the
   full rectangle. The picture is never stretched, never replaced and never
   re-framed; only the window over it changes size.

   Both layers stop at the header. They are also ordered below it, so the
   header cannot be covered even by a rounding error, and it never moves.
------------------------------------------------------------------------- */

/* The homepage receding behind the opening. Starts at the header, so the bar
   above it is left exactly as it is. */
.vub-enter-veil {
	position: fixed;
	inset: var(--vub-enter-top, 0px) 0 0 0;
	z-index: calc(var(--vub-z-header) - 2);
	background-color: var(--vub-black);
	opacity: 0;
	pointer-events: none;
}

/* Measured, never seen: the homepage asks this what the About hero's height
   resolves to here, then throws it away. Off-screen and hidden so it cannot
   paint, cannot be read out and cannot be tabbed to. */
.vub-enter-probe {
	position: fixed;
	left: -9999px;
	top: 0;
	width: 1px;
	visibility: hidden;
	pointer-events: none;
}

.vub-enter-clone {
	position: fixed;
	z-index: calc(var(--vub-z-header) - 1);
	overflow: hidden;
	background-color: #000000;
	pointer-events: none;
}

/* Carries the card's overscan, unchanged for the whole journey and matched by
   the About hero, so the crop factor is identical at both ends and there is
   nothing for the handoff to give away. */
.vub-enter-clone__inner {
	position: absolute;
	inset: 0;
	transform: scale(var(--vub-tilt-scale, 1.07));
}

.vub-enter-clone__inner img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	object-position: 50% 50%;
}

.vub-enter-clone__scrim {
	z-index: 1;
	opacity: 0;
}

/* The caption and the vignette go the moment the journey starts, so the
   photograph is on its own before anything is captured. Same specificity as the
   :hover and :focus-visible rules above and later in the file, so it wins the
   tie against whichever of them is standing. */
.vub-entering-gym .vub-media--link.is-interactive .vub-media__veil,
.vub-entering-gym .vub-media--link.is-interactive .vub-media__cta {
	opacity: 0;
	transition: opacity 200ms var(--vub-ease);
}

/* Parallax photographic backdrop, printed by vub_parallax_backdrop() and driven
   by initParallax() in main.js: the script writes --vub-parallax to the section
   (+1 below the fold → 0 centred → -1 once past) and the shift below turns that
   number into movement. With no JS, with reduced motion, or before the script
   runs, the value is 0 and the photograph simply sits still.

   The layer is taller than its section so it can slide without ever exposing an
   edge: 120% height gives 10% of overscan at each end against a 7% shift. It is
   kept as tight as the movement allows, because every extra percent of height
   is another percent of the frame that object-fit crops off the sides. */
.vub-parallax {
	overflow: hidden;
	/* clip, not hidden, where it is understood: the same cut edge, but not a
	   box that can be scrolled. Opening the homepage at /#schedule scrolls
	   every scrollable box above the section to bring it into view, and a
	   hidden band was one — it slid its own contents up inside itself, out of
	   line with its picture, and the page stopped short of the section. */
	overflow: clip;
	isolation: isolate;
}

.vub-parallax__media {
	position: absolute;
	top: -10%;
	left: 0;
	right: 0;
	height: 120%;
	z-index: -2;
	transform: translate3d(0, calc(var(--vub-parallax, 0) * 7%), 0);
	will-change: transform;
}

/* The <picture> that offers a phone its twin (vub_phone_source()) is no box
   of its own: the picture inside it is laid out as if it stood here alone. */
.vub-parallax__media picture,
.vub-relief__media picture { display: contents; }

.vub-parallax__media img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	/* Sections lift this when their photograph is too dark to read through the
	   scrim — see .vub-achievements in sections.css. */
	filter: brightness(var(--vub-parallax-brightness, 1));
}

.vub-parallax__scrim {
	position: absolute;
	inset: 0;
	z-index: -1;
	background-color: var(--vub-parallax-scrim, var(--vub-overlay));
}

/* A band of sections on one shared backdrop — templates/sections/band.php:
   on the homepage, About with the programs and the schedule, and the gallery
   with membership and contact. The backdrop is drawn dark
   already, so it takes only a light scrim; the sections in it give up their
   own backgrounds so it shows straight through them, with nothing between. */
.vub-band {
	--vub-parallax-scrim: rgba(8, 9, 10, 0.15);

	position: relative;
}

.vub-band > .vub-section { background-color: transparent; }

/* A wall inside a band — vub_relief(), the schedule on the homepage. The band's
   picture reaches it as relief: its twin, the same planes, rules and dots
   raised out of the wall the way the schedule's clock is. Laid out exactly as
   the band lays out its own backdrop (.vub-parallax__media above: the band's
   width, 10% of its height above it, 120% of it tall, the same drift), so the
   two pictures line up and the printed one carries straight on as relief.
   main.js measures where that frame falls from inside the section and writes
   it here (initRelief()); the section is clipped to its own box, so only the
   part of the twin inside it is ever seen.

   The change is a clean line at the section's top edge, not a fade: above it
   the band's picture is printed in its colours, below it the same picture is
   the wall, all one grey.

   With no JavaScript the section never becomes .is-relief: this stays hidden
   and the section keeps its own flat wall. */
.vub-band > .vub-section.is-relief {
	/* Its own stacking context, so the relief sits under its content but over
	   the band's picture, scrim and seam. */
	isolation: isolate;
	background-color: transparent;
}

.vub-relief {
	position: absolute;
	inset: 0;
	z-index: -1;
	display: none;
	overflow: hidden;
	pointer-events: none;
	/* The wall itself, until the twin has loaded over it. */
	background-color: var(--vub-relief-wall, transparent);
}

.is-relief > .vub-relief { display: block; }

.vub-relief__media {
	position: absolute;
	top: var(--vub-relief-y, 0px);
	left: 0;
	right: 0;
	height: var(--vub-relief-h, 100%);
	transform: translate3d(0, calc(var(--vub-parallax, 0) * 7%), 0);
	will-change: transform;
}

.vub-relief__media img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

/* The shimmer's wave, carried on through the studs: shimmer.js places these
   over the studs in the frame, as it does the red dots' over the band's. */
.vub-relief__media canvas {
	position: absolute;
	display: block;
}

/* Words painted on the wall — the words of a wall section, once main.js has
   placed the relief's ink map under each (initRelief()). Each keeps its own
   colour, multiplied by the map: brighter where the wall catches the light,
   darker in a stud's shadow, along a ridge, at a slab's edge — so it takes
   the wall's form rather than standing in front of it. The map moves with the
   wall's drift, and with any box the words scroll in (--vub-ink-sx/-sy). The
   text itself is untouched: selectable, read out, and in forced colours
   simply drawn in the forced colour. */
.vub-ink {
	-webkit-text-fill-color: transparent;
	background-image: var(--vub-ink), linear-gradient(currentColor, currentColor);
	background-blend-mode: multiply;
	background-repeat: no-repeat;
	background-size: var(--vub-ink-size), 100% 100%;
	background-position:
		calc(var(--vub-ink-x) + var(--vub-ink-sx, 0px))
		calc(var(--vub-ink-y) + var(--vub-ink-sy, 0px) + var(--vub-parallax, 0) * var(--vub-ink-drift)),
		0 0;
	-webkit-background-clip: text;
	background-clip: text;
}

/* A band whose picture carries on the band above's (band.php, 'run_on'): the
   ring between them (assets/js/ring.js) lays the picture out where the band
   above's would be, run on past the ring's floor — one picture, one scale.
   Until then, and without it, it is cover-fitted like any band's. It drifts
   from where the ring let it go: main.js holds it while the ring is on
   screen and writes that hold here. */
.vub-band--run > .vub-parallax__media {
	top: var(--vub-run-top, -10%);
	height: var(--vub-run-height, 120%);
	transform: translate3d(0, calc((var(--vub-parallax, 0) - var(--vub-parallax-hold, 0)) * 7%), 0);
}

/* A backdrop that has to meet its neighbours without a seam — the band's. Over
   the last stretch at the top and the bottom it fades to the page's own black,
   so where it meets a plain section both sides are the same colour and there
   is no line. Fixed to the element's edges rather than the picture's, so the
   parallax drift can never open the seam up again; above the picture and its
   shimmer, below the content. */
.vub-parallax--seamless::after {
	--vub-seam: clamp(5rem, 12%, 10rem);

	content: "";
	position: absolute;
	inset: 0;
	z-index: -1;
	pointer-events: none;
	background: linear-gradient(
		to bottom,
		var(--vub-black) 0,
		rgba(8, 9, 10, 0) var(--vub-seam),
		rgba(8, 9, 10, 0) calc(100% - var(--vub-seam)),
		var(--vub-black) 100%
	);
}

/* The shimmer over a generated backdrop's red dots — a .vub-parallax__media
   layer of its own, so it drifts with the picture, and assets/js/shimmer.js
   draws on its canvas. The script fits the picture into the layer exactly as
   the backdrop's own layer fits it, then places and sizes the canvas over just
   the red dots, so each live dot lands on its printed one. Empty between
   waves. */
.vub-shimmer canvas {
	position: absolute;
	display: block;
}

/* One red streak as live 3D spheres (assets/js/spheres.js). Like the shimmer,
   a .vub-parallax__media layer of its own, above the shimmer's, so it drifts
   with the picture. The script lays the box over the streak, fitted the way
   the picture is fitted. In it are the picture's own patch with that streak's
   dots left out, and the Spline scene's canvas over the patch. The patch fades
   out over the last few pixels of the margin round the dots, so it meets the
   picture without a line.

   The box stays hidden until the spheres are laid out, then fades in over the
   printed dots. Without the script the printed dots are all there is. */
.vub-spheres__box {
	position: absolute;
	opacity: 0;
	visibility: hidden;
	transition: opacity 900ms var(--vub-ease-out), visibility 0s linear 900ms;
}

.vub-spheres.is-live .vub-spheres__box {
	opacity: 1;
	visibility: visible;
	transition-delay: 0s;
}

.vub-spheres__ground,
.vub-spheres__stage {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
}

.vub-spheres__ground {
	display: block;
	-webkit-mask-image:
		linear-gradient(to right, transparent, #000 2.5%, #000 97.5%, transparent),
		linear-gradient(to bottom, transparent, #000 2.3%, #000 97.7%, transparent);
	-webkit-mask-composite: source-in;
	mask-image:
		linear-gradient(to right, transparent, #000 2.5%, #000 97.5%, transparent),
		linear-gradient(to bottom, transparent, #000 2.3%, #000 97.7%, transparent);
	mask-composite: intersect;
}

.vub-spheres__stage canvas {
	display: block;
	width: 100%;
	height: 100%;
}

/* A wall with a painting under it — vub_peek(), the site footer. Both pictures
   are laid out by the one rule below and are twins (2172 x 724, every feature
   in the same place), so every pixel of the painting lies exactly under its
   pixel of wall, at any width — neither ever moves or scales. The block's own
   content stands in front: the pictures are a layer behind it in the block's
   own stacking context, clipped to its box, and never take a pointer, so every
   link stays exactly as clickable as before. */
.vub-has-peek {
	position: relative;
	isolation: isolate;
}

.vub-peek {
	position: absolute;
	inset: 0;
	z-index: -1;
	overflow: hidden;
	pointer-events: none;
}

.vub-peek img {
	position: absolute;
	inset: 0;
	width: 100%;
	max-width: none;
	height: 100%;
	object-fit: cover;
	/* The boxer stands about a quarter of the way in; on a narrow, tall block
	   this keeps him in the crop. */
	object-position: 25% 50%;
}

/* The painting shows only through a 350px circle on the cursor. main.js writes
   the centre, in the block's own pixels, and adds .is-peeking to the block
   while a mouse is over it (initPeek()). Only the circle and the fade change —
   the edge is the clip's own, with nothing drawn round it. A screen that
   cannot hover never shows the painting (and vub_peek() never lets it
   download it). */
.vub-peek__paint {
	display: none;
	opacity: 0;
	clip-path: circle(175px at var(--vub-peek-x, 50%) var(--vub-peek-y, 50%));
	transition: opacity 0.22s ease-out;
}

@media (hover: hover) and (pointer: fine) {
	.vub-peek__paint { display: block; }
}

.is-peeking > .vub-peek .vub-peek__paint {
	opacity: 1;
	transition-duration: 0.15s;
}

/* With .vub-has-peek--reveal the block's own content hides on the wall as well
   and shows only through the same circle, over the painting, with the same
   fade. main.js places the circle in each child's own pixels and adds
   .is-peek-ready once it is listening, so without it, or on a screen that
   cannot hover, the content stays in plain view on the wall. Outside the circle
   it cannot be clicked either — the clip is the hit area. Tabbing into it with
   the keyboard shows all of it. */
@media (hover: hover) and (pointer: fine) {
	.vub-has-peek--reveal.is-peek-ready > :not(.vub-peek) {
		opacity: 0;
		clip-path: circle(175px at var(--vub-peek-x, 50%) var(--vub-peek-y, 50%));
		transition: opacity 0.22s ease-out;
	}

	.vub-has-peek--reveal.is-peeking > :not(.vub-peek) {
		opacity: 1;
		transition-duration: 0.15s;
	}

	.vub-has-peek--reveal.is-peek-ready:has(:focus-visible) > :not(.vub-peek) {
		opacity: 1;
		clip-path: none;
	}
}

/* With .vub-has-peek--ink the block's content wears one set of colours on the
   wall and another over the painting, split exactly at the circle's edge. The
   caller styles both: the wall's by default, the painting's for the content
   itself while the block .is-peeking. main.js stacks a copy of the content on
   the very same spot (.vub-peek-copy: hidden from screen readers, inert, never
   takes a pointer). While the circle shows, the content is clipped to the
   circle and the copy, still in the wall's colours, fills everything round
   it. The real content is the one under the cursor, so hover, clicks and
   focus behave exactly as before. Without the copy, the wall's colours are all
   there is. */
@media (hover: hover) and (pointer: fine) {
	.vub-has-peek--ink.is-peek-ready {
		display: grid;
		grid-template-columns: minmax(0, 1fr);
	}

	/* The content and its copy share one grid cell, so they lay out alike. */
	.vub-has-peek--ink.is-peek-ready > :not(.vub-peek) { grid-area: 1 / 1; }

	.vub-peek-copy {
		visibility: hidden;
		pointer-events: none;
	}

	.vub-has-peek--ink.is-peeking > :not(.vub-peek):not(.vub-peek-copy) {
		clip-path: circle(175px at var(--vub-peek-x, 50%) var(--vub-peek-y, 50%));
	}

	/* The same circle, cut out. The softened pixel matches the clip's own
	   anti-aliased edge, so the two inks meet without a seam. */
	.vub-has-peek--ink.is-peeking > .vub-peek-copy {
		visibility: visible;
		-webkit-mask-image: radial-gradient(circle 175px at var(--vub-peek-x, 50%) var(--vub-peek-y, 50%), transparent 174.5px, #000 175.5px);
		mask-image: radial-gradient(circle 175px at var(--vub-peek-x, 50%) var(--vub-peek-y, 50%), transparent 174.5px, #000 175.5px);
	}
}

/* ---------------------------------------------------------------------------
   8. Utilities
--------------------------------------------------------------------------- */
.vub-visually-hidden {
	position: absolute !important;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

/* Skip link — visible only when focused by keyboard. */
.vub-skip-link {
	position: absolute;
	top: -100px;
	left: var(--vub-space-sm);
	z-index: var(--vub-z-modal);
	padding: var(--vub-space-2xs) var(--vub-space-sm);
	background: var(--vub-white);
	color: var(--vub-black);
	border-radius: var(--vub-radius-md);
}

.vub-skip-link:focus { top: var(--vub-space-sm); }

.vub-text-center { text-align: center; }
.vub-text-muted  { color: var(--vub-text-muted); }
.vub-accent      { color: var(--vub-red); }

.vub-stack > * + * { margin-top: var(--vub-space-md); }

/* Scroll reveal. main.js adds .is-visible; without JS everything stays visible
   because the hidden state is only applied once .js-reveal-ready is set. */
.js-reveal-ready .vub-reveal {
	opacity: 0;
	transform: translateY(16px);
	transition: opacity var(--vub-duration-slow) var(--vub-ease-out),
	            transform var(--vub-duration-slow) var(--vub-ease-out);
}

.js-reveal-ready .vub-reveal.is-visible {
	opacity: 1;
	transform: none;
}

@media (prefers-reduced-motion: reduce) {
	.js-reveal-ready .vub-reveal { opacity: 1; transform: none; }
}
