/* ==========================================================================
   Site Loader (imgflash) — centred image-stack flash + counter, final frame
   expands to fullscreen then the plate fades. Companion to
   template-parts/site-loader-imgflash.php + assets/js/site-loader-imgflash.js.
   The flag loader (site-loader.css) is preserved untouched; only one variant
   is enqueued at a time.
   ========================================================================== */

/* Lock scroll only while the loader is up. */
body.teako-loading { overflow: hidden; }

/* Repeat-visit / no-JS: never paint the loader. */
html.teako-loaded .teako-imgloader { display: none !important; }

.teako-imgloader {
	position: fixed;
	inset: 0;
	z-index: 100000;
	background: var(--teako-color-paper, #FAFAF7);
	color: #1A1A18;
	font-family: 'Geologica', system-ui, sans-serif;
}
.teako-imgloader.is-done {
	opacity: 0;
	visibility: hidden;
	/* CRITICAL (2026-08-02): without this the invisible full-viewport plate
	   kept intercepting every click on the page after the intro finished. */
	pointer-events: none;
	transition: opacity .45s ease .05s, visibility 0s linear .5s;
}

/* ---------- centred image stack ---------- */
.teako-imgloader__stage {
	position: absolute;
	left: 50%;
	top: 50%;
	transform: translate(-50%, -50%);
	/* SQUARE stage (client ask) that zooms out to the entire page. Frames are
	   uniform 1:1 crops — no size variants — so the square reads as one clean
	   aperture. Rails: brand/counter need ~284px clearance each side, so the
	   square caps at (100vw - 568px); 56vh keeps it clear of the ruler and
	   meta line on short viewports. Height must be EXPLICIT (not aspect-ratio):
	   an auto height can't transition, so the expand snapped tall first and
	   read as a portrait strip instead of a block growing outward. */
	--tl-size: clamp(240px, min(30vw, 56vh, calc(100vw - 568px)), 480px);
	width: var(--tl-size);
	height: var(--tl-size);
	transition: width .72s cubic-bezier(.76, 0, .24, 1), height .72s cubic-bezier(.76, 0, .24, 1);
}
.teako-imgloader__im {
	position: absolute;
	left: 50%;
	top: 50%;
	transform: translate(-50%, -50%);
	margin: 0;
	overflow: hidden;
	visibility: hidden;
	width: 100%;
	height: 100%;
}
.teako-imgloader__im img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}
.teako-imgloader__im.is-on { visibility: visible; }

/* Ruler hairline under the stage — the site's survey motif carrying real
   progress: ink track, Milano red fill driven by --tl-p from the JS. */
.teako-imgloader__stage::after {
	content: '';
	position: absolute;
	left: 0;
	right: 0;
	bottom: -30px;
	height: 1px;
	background: rgba(26, 26, 24, 0.14);
}
.teako-imgloader__stage::before {
	content: '';
	position: absolute;
	left: 0;
	right: 0;
	bottom: -30px;
	height: 1px;
	background: #C42800;
	transform: scaleX(var(--tl-p, 0));
	transform-origin: left center;
	z-index: 1;
}
.teako-imgloader.is-final .teako-imgloader__stage::after,
.teako-imgloader.is-final .teako-imgloader__stage::before {
	opacity: 0;
	transition: opacity .25s ease;
}

/* Final frame expands to cover the viewport. */
.teako-imgloader.is-final .teako-imgloader__stage { width: 100vw; height: 100vh; }
.teako-imgloader.is-final .teako-imgloader__im { width: 100% !important; height: 100% !important; transition: width .72s cubic-bezier(.76, 0, .24, 1), height .72s cubic-bezier(.76, 0, .24, 1); }

/* ---------- fixed text: brand left, counter right, listings foot ---------- */
.teako-imgloader__brand,
.teako-imgloader__count {
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	z-index: 2;
	font-size: clamp(15px, 1.5vw, 22px);
	font-weight: 400;
	letter-spacing: -0.01em;
	line-height: 1;
	white-space: nowrap;
}
.teako-imgloader__brand {
	left: clamp(20px, 3.4vw, 56px);
	display: flex;
	flex-direction: column;
	gap: 12px;
}
.teako-imgloader__logo {
	display: block;
	width: 56px;
	height: 44.2px;
	filter: invert(1); /* white SVG -> ink on the paper plate */
}
.teako-imgloader__brand-tag {
	font-family: 'Space Mono', ui-monospace, monospace;
	font-size: 10.5px;
	letter-spacing: .16em;
	text-transform: uppercase;
	color: rgba(26, 26, 24, .55);
}
.teako-imgloader__count {
	right: clamp(20px, 3.4vw, 56px);
	font-family: 'Space Mono', ui-monospace, monospace;
	font-size: clamp(13px, 1.25vw, 18px);
	font-variant-numeric: tabular-nums;
}
.teako-imgloader__sep { display: inline-block; margin: 0 .55em; opacity: .45; }
.teako-imgloader__count-sl {
	display: inline-block;
	margin: 0 .5em;
	color: #C42800;
	font-weight: 700;
	letter-spacing: -.08em;
}

.teako-imgloader__meta {
	position: absolute;
	left: clamp(20px, 3.4vw, 56px);
	bottom: clamp(18px, 3vw, 44px);
	z-index: 2;
	font-family: 'Space Mono', ui-monospace, monospace;
	font-size: 11px;
	letter-spacing: .14em;
	text-transform: uppercase;
	color: rgba(26, 26, 24, .55);
}

/* On the fullscreen expand the chrome EXITS deliberately: fading the text
   is the cue the site is ready — and nothing ever sits illegibly on top of
   a light final frame (the old white-flip vanished on bright imagery). */
.teako-imgloader.is-final .teako-imgloader__brand,
.teako-imgloader.is-final .teako-imgloader__count,
.teako-imgloader.is-final .teako-imgloader__meta {
	opacity: 0;
	transition: opacity .32s ease;
}

/* Up to 960px there is no room for side rails: the brand line moves above
   the stack and the counter below, clear of the tallest (118%) crop. */
@media (max-width: 860px) {
	.teako-imgloader__brand { top: auto; bottom: calc(50% + clamp(180px, 22vh, 240px)); transform: none; font-size: 14px; left: clamp(20px, 3.4vw, 56px); }
	.teako-imgloader__count { top: calc(50% + clamp(180px, 22vh, 240px)); right: auto; left: clamp(20px, 3.4vw, 56px); transform: none; }
	.teako-imgloader__stage { --tl-size: clamp(220px, min(52vw, 42vh), 380px); }
}

/* Reduced motion: no flash, no expand — a quiet plate that fades. */
@media (prefers-reduced-motion: reduce) {
	.teako-imgloader__stage { transition: none; }
	.teako-imgloader.is-final .teako-imgloader__stage { width: var(--tl-size); height: var(--tl-size); }
}
