/*
 * The links page (/links/, dna-links.php). Standalone: main.css is not
 * loaded here, so the few tokens it needs are repeated below.
 *
 * A showroom. The page ground (--ground, set on <html>) is what the
 * photograph stands on, and the photograph ends in it:
 *
 * - the studio photograph (the default, .is-studio) has its backdrop blended
 *   at every edge to exactly #F6F6F5, baked into the image files, so on that
 *   ground it needs no mask and shows no rectangle at any size. A vignette
 *   on the page, or a mask over a backdrop that was never quite the page's
 *   colour, showed the box;
 * - any other photograph, or the studio one on another colour (.is-masked),
 *   fades into the ground at its edges, the ground being the photograph's
 *   own edge colour unless the owner chose one.
 *
 * The copy is navy on a light ground and ivory on a dark one (.is-dark),
 * whichever reads better (dna_links_tone()). On a phone everything stacks
 * around the photograph; from 960px the photograph takes the right of the
 * screen and everything else stands to its left, where the truck's bonnet
 * points.
 */

@font-face {
	font-family: 'Archivo';
	src: url('../fonts/archivo-var-latin-ro.woff2') format('woff2');
	font-weight: 400 900;
	font-stretch: 62% 125%;
	font-display: swap;
	unicode-range: U+0000-00FF, U+0102-0103, U+0131, U+0152-0153, U+015E-015F, U+0162-0163, U+0218-021B, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
	font-family: 'InterVar';
	src: url('../fonts/inter-var-latin-ro.woff2') format('woff2');
	font-weight: 300 800;
	font-display: swap;
	unicode-range: U+0000-00FF, U+0102-0103, U+0131, U+0152-0153, U+015E-015F, U+0162-0163, U+0218-021B, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
	--navy: #101A22;
	--gold: #C9A227;
	--champagne: #E0C56E;
	--ivory: #F7F3E8;
	--r: 22px;
	--ease: cubic-bezier(0.22, 1, 0.36, 1);
	--ease-out: cubic-bezier(0.23, 1, 0.32, 1);
	--display: 'Archivo', 'Arial Narrow', system-ui, sans-serif;
	--body: 'InterVar', system-ui, -apple-system, 'Segoe UI', sans-serif;

	/* Light ground: navy copy, white tiles, the navy action. */
	--ink: var(--navy);
	--ink-dim: #5A646C;
	--tile: #fff;
	--tile-ink: var(--navy);
	--tile-line: rgb(16 26 34 / 0.06);
	--chip: rgb(16 26 34 / 0.07);
	--go: var(--navy);
	--go-ink: var(--ivory);
	--go-label: var(--champagne);
	--go-dot: var(--gold);
	--go-arrow: var(--gold);
	--go-arrow-ink: var(--navy);
	--focus: var(--navy);
	--shade: 16 26 34;
}

/* Dark ground: ivory copy, glass tiles, the gold action. */
.is-dark {
	--ink: var(--ivory);
	--ink-dim: #B6B3A8;
	--tile: rgb(255 255 255 / 0.07);
	--tile-ink: var(--ivory);
	--tile-line: rgb(255 255 255 / 0.12);
	--chip: rgb(255 255 255 / 0.1);
	--go: var(--gold);
	--go-ink: var(--navy);
	--go-label: var(--navy);
	--go-dot: var(--navy);
	--go-arrow: var(--navy);
	--go-arrow-ink: var(--gold);
	--focus: var(--gold);
	--shade: 0 0 0;
}

*, *::before, *::after { box-sizing: border-box; }

html {
	background: var(--ground, #F6F6F5);
	-webkit-text-size-adjust: 100%;
	text-size-adjust: 100%;
}

body {
	margin: 0;
	min-height: 100vh;
	min-height: 100dvh;
	font: 500 1rem/1.5 var(--body);
	color: var(--ink);
	background: var(--ground, #F6F6F5);
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
	-webkit-tap-highlight-color: transparent;
	overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }

:focus-visible {
	outline: 2.5px solid var(--focus);
	outline-offset: 3px;
}

/* ---------------------------------------------------------------------
 * Phone first: one column, the photograph between the brand and the
 * buttons
 * ------------------------------------------------------------------- */

.lk {
	display: flex;
	flex-direction: column;
	align-items: center;
	width: 100%;
	max-width: 480px;
	min-height: 100vh;
	min-height: 100dvh;
	margin: 0 auto;
	padding:
		max(28px, calc(env(safe-area-inset-top) + 16px))
		max(16px, env(safe-area-inset-right))
		max(20px, calc(env(safe-area-inset-bottom) + 12px))
		max(16px, env(safe-area-inset-left));
}

.lk__id {
	position: relative;
	z-index: 2;
	display: flex;
	flex-direction: column;
	align-items: center;
	margin-top: auto;
	text-align: center;
}

/* The logo, round like the profile picture of the accounts it leads to:
   the brand's own, or the owner's (cut to the circle, centred). */
.lk__mark {
	display: block;
	width: 84px;
	height: 84px;
	border-radius: 50%;
	object-fit: cover;
	background: var(--navy);
	box-shadow:
		0 0 0 3px #fff,
		0 2px 4px rgb(var(--shade) / 0.12),
		0 14px 28px -12px rgb(var(--shade) / 0.55);
}

.lk__name {
	margin: 16px 0 0;
	font: 800 1.625rem/1.1 var(--display);
	font-stretch: 112%;
	letter-spacing: -0.01em;
	text-wrap: balance;
}

.lk__handle {
	margin: 4px 0 0;
	font-size: 0.9375rem;
	color: var(--ink-dim);
}

.lk__stage {
	position: relative;
	z-index: 1;
	width: 100vw;
	max-width: 760px;
	overflow: hidden;
	pointer-events: none;
}

.lk__car {
	display: block;
	width: 100%;
	max-width: none;
	height: 100%;
	object-fit: cover;
}

/* The studio photograph, a tenth wider than the screen, so the truck fills
   it nose to tailgate (its own studio is the margin); tucked up under the
   name and down under the buttons, where the photograph is only backdrop
   and floor. 4% of it to the left: the nose sits 14px in on a 390px screen
   and the tailgate 7px short of the other side. */
.is-studio .lk__stage {
	aspect-ratio: 2000 / 1642;
	margin: -10% 0 -8%;
}

.is-studio .lk__car {
	width: 110%;
	margin-left: -4%;
}

/* Any other photograph: whole, in its own shape, never taller than most
   of the screen, with room around it (it may have its subject anywhere). */
.is-photo .lk__stage {
	aspect-ratio: var(--ar, 4 / 3);
	max-height: 58vh;
	margin: 22px 0 18px;
}

/* A photograph whose edges are not the ground fades into it. */
.is-masked .lk__stage {
	-webkit-mask-image:
		linear-gradient(to right, transparent 0, #000 7%, #000 93%, transparent 100%),
		linear-gradient(to bottom, transparent 0, #000 14%, #000 86%, transparent 100%);
	        mask-image:
		linear-gradient(to right, transparent 0, #000 7%, #000 93%, transparent 100%),
		linear-gradient(to bottom, transparent 0, #000 14%, #000 86%, transparent 100%);
	-webkit-mask-composite: source-in;
	        mask-composite: intersect;
}

.lk__links {
	position: relative;
	z-index: 2;
	display: grid;
	gap: 10px;
	width: 100%;
}

/* The one thing to do: into the competitions, or into the one the owner
   promotes. */
.lk__go {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	min-height: 72px;
	padding: 12px 12px 12px 22px;
	border-radius: var(--r);
	background: var(--go);
	color: var(--go-ink);
	box-shadow:
		inset 0 1px 0 rgb(255 255 255 / 0.07),
		0 2px 4px rgb(var(--shade) / 0.14),
		0 18px 34px -18px rgb(var(--shade) / 0.7);
	transition: transform 160ms var(--ease-out), box-shadow 220ms var(--ease-out);
}

.lk__go-txt {
	display: flex;
	flex-direction: column;
	gap: 3px;
	min-width: 0;
}

.lk__live {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	font-size: 0.75rem;
	font-weight: 600;
	line-height: 1.2;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	color: var(--go-label);
	font-variant-numeric: tabular-nums;
}

.is-dark .lk__live { font-weight: 700; }

.lk__live i {
	position: relative;
	flex: none;
	width: 7px;
	height: 7px;
	border-radius: 50%;
	background: var(--go-dot);
}

/* Live means live: a slow ring, the only thing on the page that keeps moving. */
.lk__live i::after {
	content: '';
	position: absolute;
	inset: 0;
	border-radius: inherit;
	background: var(--go-dot);
	animation: lk-ping 2.2s var(--ease-out) infinite;
}

.lk__go-title {
	display: -webkit-box;
	overflow: hidden;
	font: 700 1.125rem/1.2 var(--display);
	font-stretch: 108%;
	letter-spacing: -0.005em;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
}

.lk__go-arrow {
	display: grid;
	place-items: center;
	flex: none;
	width: 46px;
	height: 46px;
	border-radius: 50%;
	background: var(--go-arrow);
	color: var(--go-arrow-ink);
}

.lk__arrow {
	width: 20px;
	height: 20px;
	transition: transform 220ms var(--ease-out);
}

/* Coming soon: the same card, not a button, so no arrow and no press. */
.lk__go.is-soon {
	min-height: 76px;
	padding-right: 22px;
	cursor: default;
}

.lk__go.is-soon:active { transform: none; }

/* With a promoted competition, the way to all of them, one step down. */
.lk__all {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	min-height: 56px;
	padding: 0 18px 0 22px;
	border-radius: var(--r);
	background: var(--tile);
	color: var(--tile-ink);
	font-size: 0.9375rem;
	font-weight: 600;
	box-shadow:
		0 0 0 1px var(--tile-line),
		0 1px 2px rgb(var(--shade) / 0.06),
		0 12px 24px -16px rgb(var(--shade) / 0.4);
	transition: transform 160ms var(--ease-out), box-shadow 220ms var(--ease-out);
}

.lk__all-end {
	display: inline-flex;
	align-items: center;
	gap: 10px;
}

.lk__all .lk__arrow { width: 18px; height: 18px; }

.lk__count {
	padding: 3px 9px;
	border-radius: 999px;
	background: var(--chip);
	font-size: 0.75rem;
	font-weight: 700;
	letter-spacing: 0.02em;
	font-variant-numeric: tabular-nums;
}

.lk__social {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 10px;
	margin: 0;
	padding: 0;
	list-style: none;
}

/* An odd number of accounts: the last one takes the whole row. */
.lk__social.is-odd li:last-child { grid-column: 1 / -1; }

.lk__tile {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	min-height: 60px;
	padding: 0 14px;
	border-radius: var(--r);
	background: var(--tile);
	color: var(--tile-ink);
	font-size: 0.9375rem;
	font-weight: 600;
	letter-spacing: -0.005em;
	box-shadow:
		0 0 0 1px var(--tile-line),
		0 1px 2px rgb(var(--shade) / 0.06),
		0 12px 24px -16px rgb(var(--shade) / 0.4);
	transition: transform 160ms var(--ease-out), box-shadow 220ms var(--ease-out);
}

.lk__glyph {
	flex: none;
	width: 21px;
	height: 21px;
}

/* Pressed: the button gives under the finger. */
.lk__go:active { transform: scale(0.98); }
.lk__all:active { transform: scale(0.98); }
.lk__tile:active { transform: scale(0.96); }

@media (hover: hover) and (pointer: fine) {
	.lk__go:hover {
		box-shadow:
			inset 0 1px 0 rgb(255 255 255 / 0.07),
			0 2px 4px rgb(var(--shade) / 0.14),
			0 22px 40px -18px rgb(var(--shade) / 0.8);
	}
	.lk__go:hover .lk__arrow,
	.lk__all:hover .lk__arrow { transform: translateX(3px); }
	.lk__tile:hover {
		transform: translateY(-2px);
		box-shadow:
			0 0 0 1px var(--tile-line),
			0 2px 4px rgb(var(--shade) / 0.06),
			0 18px 30px -16px rgb(var(--shade) / 0.45);
	}
	.lk__tile:hover:active { transform: translateY(-2px) scale(0.96); }
}

.lk__foot {
	margin-top: auto;
	padding-top: 28px;
	font-size: 0.8125rem;
	color: var(--ink-dim);
}

.lk__foot a,
.lk__foot span {
	display: inline-block;
	padding: 6px 4px;
	letter-spacing: 0.02em;
}

/* English / Română, after the site's address. */
.lk__lang { margin-left: 10px; padding: 0; }
.lk__lang a + a::before { content: "·"; margin: 0 8px 0 4px; color: var(--ink-dim); }
.lk__lang [aria-current] { color: var(--ink); font-weight: 600; }

@media (hover: hover) and (pointer: fine) {
	.lk__foot a:hover { color: var(--ink); }
}

/* ---------------------------------------------------------------------
 * A larger phone or a tablet: the same column, the photograph larger
 * ------------------------------------------------------------------- */

@media (min-width: 600px) {
	.lk { max-width: 520px; padding-top: 48px; }
	.is-studio .lk__stage { aspect-ratio: 2000 / 1493; margin: -7% 0 -6%; }
	.is-studio .lk__car { width: 100%; margin-left: 0; }
}

/* A short phone (an SE, or a tall one inside an app's browser chrome):
   the whole truck at the screen's width, and less air, so the buttons
   are on the first screen. */
@media (max-width: 599px) and (max-height: 700px) {
	.lk { padding-top: max(20px, calc(env(safe-area-inset-top) + 12px)); }
	.lk__mark { width: 68px; height: 68px; }
	.lk__name { margin-top: 12px; font-size: 1.5rem; }
	.is-studio .lk__stage { aspect-ratio: 2000 / 1493; margin: -11% 0 -8%; }
	.is-studio .lk__car { width: 100%; margin-left: 0; }
	.is-photo .lk__stage { max-height: 42vh; margin: 14px 0 12px; }
	.lk__foot { padding-top: 16px; }
}

/* ---------------------------------------------------------------------
 * Desktop: the photograph on the right, everything else to its left
 * ------------------------------------------------------------------- */

@media (min-width: 960px) {
	.lk {
		display: grid;
		grid-template-columns: minmax(340px, 400px) minmax(0, 1fr);
		grid-template-rows: 1fr auto auto auto 1fr;
		grid-template-areas:
			".     stage"
			"id    stage"
			"links stage"
			"foot  stage"
			".     stage";
		align-items: center;
		column-gap: clamp(24px, 4vw, 80px);
		max-width: 1680px;
		padding: 48px clamp(32px, 6vw, 112px);
	}

	.lk__id {
		grid-area: id;
		align-items: flex-start;
		margin-top: 0;
		text-align: left;
	}
	.lk__mark { width: 96px; height: 96px; }
	.lk__name { margin-top: 22px; font-size: 2.25rem; }
	.lk__handle { font-size: 1rem; }

	.lk__links { grid-area: links; margin-top: 32px; }

	.lk__foot { grid-area: foot; margin-top: 0; padding-top: 20px; }

	.lk__stage,
	.is-studio .lk__stage,
	.is-photo .lk__stage {
		grid-area: stage;
		align-self: center;
		justify-self: center;
		width: 100%;
		max-width: 1100px;
		max-height: none;
		margin: 0;
	}
	.is-studio .lk__stage { aspect-ratio: 2000 / 1493; }
	.is-studio .lk__car { width: 100%; margin-left: 0; }

	/* Whole, and no taller than the screen allows. */
	.is-photo .lk__stage {
		width: min(100%, calc((100vh - 96px) * var(--ar, 1.3333)));
		aspect-ratio: var(--ar, 4 / 3);
	}
}

/* ---------------------------------------------------------------------
 * Arrival, once, in CSS from the first frame: the brand settles, the
 * photograph rolls the last few feet into place, the buttons follow it
 * in. Only transform and opacity; backwards fill, so nothing is held
 * after. Not in the console's preview, which redraws on every change.
 * ------------------------------------------------------------------- */

@keyframes lk-rise { from { opacity: 0; transform: translateY(10px); } }
@keyframes lk-pop  { from { opacity: 0; transform: scale(0.9); } }
@keyframes lk-roll { from { opacity: 0; transform: translateX(5%) scale(1.01); } }
@keyframes lk-fade { from { opacity: 0; } }
@keyframes lk-ping {
	from { transform: scale(1); opacity: 0.55; }
	70%, to { transform: scale(2.8); opacity: 0; }
}

.lk__mark         { animation: lk-pop 640ms var(--ease-out) 40ms backwards; }
.lk__name         { animation: lk-rise 560ms var(--ease-out) 110ms backwards; }
.lk__handle       { animation: lk-rise 560ms var(--ease-out) 150ms backwards; }
.lk__car          { animation: lk-roll 1300ms var(--ease) 80ms backwards; }
.lk__go           { animation: lk-rise 560ms var(--ease-out) 240ms backwards; }
.lk__all          { animation: lk-rise 560ms var(--ease-out) 280ms backwards; }
.lk__social li    { animation: lk-rise 560ms var(--ease-out) backwards; animation-delay: calc(300ms + var(--i, 0) * 45ms); }
.lk__foot         { animation: lk-fade 600ms var(--ease-out) 520ms backwards; }

.is-preview :is(.lk__mark, .lk__name, .lk__handle, .lk__car, .lk__go, .lk__all, .lk__social li, .lk__foot) { animation: none; }

@media (prefers-reduced-motion: reduce) {
	.lk__mark, .lk__name, .lk__handle, .lk__go, .lk__all, .lk__social li, .lk__foot { animation: none; }
	.lk__car { animation: lk-fade 400ms var(--ease-out) backwards; }
	.is-preview .lk__car { animation: none; }
	.lk__live i::after { animation: none; }
	.lk__go, .lk__all, .lk__tile, .lk__arrow { transition: none; }
}

/* Romanian typography (see main.css): a two-line clamp opens just enough
   under the second line for the comma of ș ț, at a leading where the hidden
   third line's accents stay out of sight. */
:lang(ro) .lk__go-title { line-height: 1.35; padding-bottom: 0.11em; margin-bottom: -0.11em; }
