/* FONT */
@font-face {
	font-family: 'ClashGrotesk';
	src: url('../fonts/ClashGrotesk-Variable.woff2') format('woff2'),
		 url('../fonts/ClashGrotesk-Variable.woff') format('woff'),
		 url('../fonts/ClashGrotesk-Variable.ttf') format('truetype'),
		 url('../fonts/ClashGrotesk-Variable.eot') format('eot');
	font-weight: 200 700;
	font-display: swap;
	font-style: normal;
}

@font-face {
	font-family: 'Albert';
	src: url('../fonts/Albert-extrabold.woff2') format('woff2'),
		 url('../fonts/Albert-extrabold.woff') format('woff');
	font-weight: 200 800;
	font-display: swap;
	font-style: normal;
}

/* Fallbacks con metricas ajustadas para evitar CLS al cargar las webfonts */
@font-face {
	font-family: 'ClashGrotesk Fallback';
	src: local('Arial'), local('Helvetica'), local('Liberation Sans');
	size-adjust: 111.44%;
	ascent-override: 79.86%;
	descent-override: 22.43%;
	line-gap-override: 8.08%;
}

@font-face {
	font-family: 'Albert Fallback';
	src: local('Arial Bold'), local('Arial'), local('Helvetica'), local('Liberation Sans');
	size-adjust: 146.28%;
	ascent-override: 64.94%;
	descent-override: 17.09%;
	line-gap-override: 0%;
}

/* BASIC */

:root {
	--black: #000;
	--white: #fff;
	--gray: #767676;
	--light-gray: #c7c7c7;
	--red: #601010;
	--cubic-bezier: cubic-bezier(0.5, 0, 0.5, 1);
	--gap-big: 25svh;
	--gap-medium: 10svh;
	--gap-small: 5svh;
	--gap-tiny: 10px;
	--padding-section: calc(125px + 15svh) 10px 0;
	interpolate-size: allow-keywords;

	@media (max-width:950px) {
		--gap-big: 17svh;
		--gap-medium: 5svh;
		--gap-small: 2svh;
		--gap-tiny: 5px;
		--padding-section: calc(125px + 15svh) 10px 0;
	}
}


/* Selección: invierte texto y fondo. Se hereda por variables para poder darle la vuelta por zonas */
:root {
	--sel-fg: var(--white);
	--sel-bg: var(--black);
}

/* Bloques con colores ya invertidos */
:is(.visit-button, .notification, .case-back, .budget-bar, .budget-card:has(input:checked), .budget-pill:has(input:checked) span, .budget-row:has(input:checked), .projects .post:hover, .ar-panel .ar-check:hover, .ar-item:has(.ar-link:hover)) {
	--sel-fg: var(--black);
	--sel-bg: var(--white);
}

.budget-bar a {
	--sel-fg: var(--white);
	--sel-bg: var(--black);
}

/* Textos con mix-blend-mode: difference */
:is(header, .not-found) {
	--sel-fg: var(--black);
	--sel-bg: var(--white);
}

:is(header .menu a:last-of-type, header .menu-toggle, .not-found .nf-home) {
	--sel-fg: var(--white);
	--sel-bg: var(--black);
}

::-moz-selection {
	color: var(--sel-fg);
	background: var(--sel-bg);
}

::selection {
	color: var(--sel-fg);
	background: var(--sel-bg);
}

.nojq  {
	display: none;
}

* {
	/* Designer mode */
	/* outline: 1px solid blue; */
	margin: 0;
	padding: 0;
	-webkit-tap-highlight-color: rgba(0,0,0,0);
}

body,
html {
	overflow-x:hidden;
}

/* clip no convierte body en contenedor de scroll: permite position: sticky */
@supports (overflow-x: clip) {
	body,
	html {
		overflow-x: clip;
	}
}

body {
	width: 100%;
	height: 100%;
	font-family: 'ClashGrotesk', 'ClashGrotesk Fallback', sans-serif;
	font-weight: 500;
	font-variation-settings: 'wght' 450;
	letter-spacing: 0.05ch;
	color: var(--black);
	background-color: var(--white);
	font-size: 14.5px;
	font-weight: 400;
	margin: 0;
	padding: 0;
	transition: color .3s, background-color .3s;

	@media (max-width:950px) {
		& {
			font-variation-settings: 'wght' 500;
		}
	}
}

h1,
h2,
h3,
h4,
h5,
h6 {
	font-weight: 700;
	line-height: 0.9;
}

h1 {
	font-size: 78.54px;
	font-family: 'Albert', 'Albert Fallback', sans-serif;
}

h2 {
	font-size: 58.92px;
}

h3 {  
	font-size: 44.2px;  
}

h4 {  
	font-size: 33.16px;  
}

h5 {  
	font-size: 24.88px;  
}

h6 {  
	font-size: 18.66px;  
}

p {
	font-size: 14px;
}

a {
	text-decoration: none;
	color: var(--white);
	width: fit-content;
	height: fit-content;
}

b {
	font-weight: 700;
}

/* ANIMATION */
@-webkit-keyframes noise {
	to { transform: translate3d(-7rem,0,0) }
}

@keyframes noise {
	0% { transform: translate3d(0,9rem,0) }
	10% { transform: translate3d(-1rem,-4rem,0) }
	20% { transform: translate3d(-8rem,2rem,0) }
	30% { transform: translate3d(9rem,-9rem,0) }
	40% { transform: translate3d(-2rem,7rem,0) }
	50% { transform: translate3d(-9rem,-4rem,0) }
	60% { transform: translate3d(2rem,6rem,0) }
	70% { transform: translate3d(7rem,-8rem,0) }
	80% { transform: translate3d(-9rem,1rem,0) }
	90% { transform: translate3d(6rem,-5rem,0) }
	to { transform: translate3d(-7rem,0,0) }
}

@keyframes float {
	0% { transform: translate3d(-177%, 180%, 0); }
	9% { transform: translate3d(-23%, -61%, 0); }
	18% { transform: translate3d(45%, -19%, 0); }
	27% { transform: translate3d(-67%, 54%, 0); }
	36% { transform: translate3d(33%, -72%, 0); }
	45% { transform: translate3d(-58%, 29%, 0); }
	54% { transform: translate3d(71%, -41%, 0); }
	63% { transform: translate3d(-39%, 68%, 0); }
	72% { transform: translate3d(56%, -83%, 0); }
	81% { transform: translate3d(-91%, 12%, 0); }
	90% { transform: translate3d(24%, -65%, 0); }
	100% { transform: translate3d(-177%, 180%, 0); }
}

/* CURSOR */
.cursor-1,
.cursor-2 {
	position: fixed;
	border-radius: 500px;
	mix-blend-mode: difference;
	pointer-events: none;
	transition: background-color .15s, border .15s, filter .3s, width .3s ease-out, height .3s ease-out, opacity .2s;

	&.is-hidden {
		opacity: 0;
	}
}

.cursor-1 {
	width: 25px;
	height: 25px;
	background-color: var(--white);
	border: 1px solid var(--white);
	z-index: 10;
	animation: easeInCursorSmall .3s cubic-bezier(0.215, 0.610, 0.355, 1);

	&.hovering {
		background-color: transparent;
	}
}

.cursor-2 {
	width: 120px;
	height: 120px;
	background-color: var(--white);
	z-index: 9;
	filter: blur(10px);
	border: 10px solid #601010;
	animation: easeInCursorBig .6s cubic-bezier(0.215, 0.610, 0.355, 1);

	&.hovering {
		width: 70px;
		height: 70px;
	}

	&.is-media {
		width: 220px;
		height: 220px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.cursor-1,
	.cursor-2 {
		display: none !important;
	}
}

/* Colores de página. Banner y sección proyectos: azul/negro */
body {
	--page-fg: var(--black);
	--page-bg: var(--white);
}

body.in-projects,
.banner {
	--page-fg: var(--black);
	--page-bg: var(--light-gray);
}

body {
	--projects-mix: 0;
	background-color: color-mix(in srgb, var(--light-gray) calc(var(--projects-mix) * 100%), var(--white));
	transition: color .3s;
}

body.in-projects {
	color: var(--page-fg);

	.cursor-2 {
		border-color: transparent;
		filter: blur(25px);
	}
}

/* NAV */
header {
	position: fixed;
	inset: 0 0 auto 0;
	display: grid;
	grid-template-columns: repeat(12, 1fr);
	gap: var(--gap-tiny);
	padding: 10px;
	mix-blend-mode: difference;
	z-index: 9999;
	transition: translate .45s var(--cubic-bezier);

	.logo {
		width: 12vw;
		max-width: 120px;
		min-width: 80px;
		height: auto;
	}

	.menu {
		grid-column: 4 / 10;
		display: flex;
		justify-content: space-around;

		a {
			position: relative;
			display: inline-block;
			padding: 3px 4px;
			text-transform: uppercase;

			&:last-of-type {
				background-color: var(--white);
				color: var(--black);
			}

			@media (min-width:950px) {
				&:hover {
					font-style: italic;
				}
			}
		}
	}

	.menu-toggle {
		display: none;
	}

	/* Hora y botón del menú: el botón empuja a la hora al cambiar de ancho */
	.header-end {
		grid-column: 11 / 13;
		justify-self: end;
		align-self: start;
		display: flex;
		align-items: center;
		gap: var(--gap-tiny);
	}

	/* Hora local y disponibilidad */
	.local-time {
		position: relative;
		display: flex;
		align-items: center;
		gap: 6px;
		padding: 3px 4px;
		font-size: inherit;
		color: var(--white);
		text-transform: uppercase;
		font-variant-numeric: tabular-nums;
		white-space: nowrap;
		cursor: default;

		/* Icono del momento del día */
		.lt-icon {
			display: grid;
			width: 15px;
			height: 15px;
		}

		.lt-i {
			grid-area: 1 / 1;
			display: none;
			width: 100%;
			height: 100%;
			overflow: visible;
			fill: none;
			stroke: currentColor;
			stroke-width: 1.25;
			stroke-linecap: round;
			stroke-linejoin: round;
		}

		&[data-icon="coffee"] .lt-i-coffee,
		&[data-icon="bowl"] .lt-i-bowl,
		&[data-icon="sunrise"] .lt-i-sunrise,
		&[data-icon="sun"] .lt-i-sun,
		&[data-icon="sunset"] .lt-i-sunset,
		&[data-icon="moon"] .lt-i-moon,
		&[data-icon="sleep"] .lt-i-sleep {
			display: block;
		}

		.lt-steam path {
			animation: lt-steam 2.4s ease-in-out infinite;

			&:last-child {
				animation-delay: -1.2s;
			}
		}

		.lt-sun {
			animation: lt-rise 3s ease-in-out infinite alternate;
		}

		.lt-rays {
			transform-origin: 8px 8px;
			animation: lt-spin 14s linear infinite;
		}

		.lt-star {
			transform-box: fill-box;
			transform-origin: center;
			animation: lt-twinkle 2.2s ease-in-out infinite;
		}

		.lt-z {
			animation: lt-float 3s ease-in-out infinite;
		}

		.lt-z-2 {
			animation-delay: -1.5s;
		}

		.lt-colon {
			animation: lt-blink 1s steps(1) infinite;
		}

		/* Estado a la izquierda, fuera del flujo: se revela con recorte sin mover la hora */
		.lt-status {
			position: absolute;
			top: 0;
			bottom: 0;
			right: 100%;
			display: flex;
			align-items: center;
			padding-right: 6px;
			pointer-events: none;
			clip-path: inset(-50% 0 -50% 100%);
			transition: clip-path .5s var(--cubic-bezier);
		}

		@media (min-width:950px) {
			&:hover .lt-status {
				clip-path: inset(-50% -10px -50% 0);
			}
		}
	}

	/* Móvil: barra inferior al alcance del pulgar */
	@media (max-width:950px) {
		inset: auto 0 0 0;
		align-items: center;
		grid-template-columns: repeat(6, 1fr);

		.header-end {
			grid-column: 2 / 7;
		}

		.local-time .lt-status {
			display: none;
		}

		/* .logo {
			width: 15vw;
			max-width: 120px;
			min-width: 80px;
		} */

		/* Panel del menú: tipografía a gran escala con la altura de su contenido, oculto bajo el borde inferior.
		   Su fondo negro es body::before, fuera del difference del header */
		.menu {
			grid-column: auto;
			position: absolute;
			inset: auto 0 0;
			z-index: -1;
			flex-direction: column;
			padding: 10px 0 76px;
			translate: 0 100%;
			visibility: hidden;
			transition: translate .4s cubic-bezier(.25, 1, .5, 1), visibility 0s .4s;

			a {
				display: block;
				width: auto;
				padding: 0 10px;
				font-family: 'Albert', 'Albert Fallback', sans-serif;
				font-weight: 700;
				/* Mismo tamaño que el h1 de .main-content en móvil */
				font-size: 7.5vw;
				text-align: right;
				line-height: 1.16;
				color: var(--white);
				background: none;

				&:active {
					opacity: .55;
				}

				/* Sin la caja de llamada a la acción de escritorio */
				&:last-of-type {
					color: var(--white);
					background: none;
				}
			}
		}

		/* Etiquetas apiladas: sus caracteres se cruzan (app.js los separa) y el ancho sigue a la visible (--w) */
		.menu-toggle {
			display: grid;
			grid-template-columns: var(--w, auto);
			overflow: hidden;
			padding: 3px;
			transition: grid-template-columns .5s cubic-bezier(.16, 1, .3, 1);
			font: inherit;
			font-size: 14px;
			letter-spacing: inherit;
			text-transform: uppercase;
			color: var(--black);
			background-color: var(--white);
			border: 0;
			border-radius: 0;
			cursor: pointer;
		}

		.menu-toggle-open,
		.menu-toggle-close {
			grid-area: 1 / 1;
			justify-self: start;
			white-space: nowrap;
		}

		.menu-toggle .ch {
			display: inline-block;
			transition: translate .5s cubic-bezier(.16, 1, .3, 1) calc(var(--i) * 25ms);
		}

		/* Cerrar espera abajo, oculta hasta que acaban de salir sus caracteres */
		.menu-toggle-close {
			visibility: hidden;
			transition: visibility 0s .6s;

			.ch {
				translate: 0 110%;
			}
		}

	}
}

/* GSAP deja translate: none en línea al animar la entrada del header: !important */
body.header-hidden header {
	translate: 0 -110% !important;
}

@media (max-width:950px) {
	body.header-hidden header {
		translate: 0 110% !important;
	}
}

body.header-hidden header:focus-within {
	translate: none !important;
}

/* Menú móvil abierto: el panel sube desde la barra inferior sobre un velo. Ambos van bajo el header, fuera de su
   difference, que sobre el negro deja logo, botón, hora y enlaces en claro */
@media (max-width:950px) {
	/* Fondo del panel: misma altura (--menu-h, app.js) y movimiento que .menu */
	body::before {
		content: "";
		position: fixed;
		inset: auto 0 0;
		z-index: 9998;
		height: var(--menu-h, 0);
		background-color: var(--black);
		translate: 0 100%;
		visibility: hidden;
		transition: translate .4s cubic-bezier(.25, 1, .5, 1), visibility 0s .4s;
	}

	/* Velo bajo el panel: un toque fuera cierra (app.js) */
	body::after {
		content: "";
		position: fixed;
		inset: 0;
		z-index: 9997;
		background-color: color-mix(in srgb, var(--black) 55%, transparent);
		opacity: 0;
		visibility: hidden;
		transition: opacity .5s var(--cubic-bezier), visibility 0s .5s;
	}
	header .logo path {
		transition: fill .4s;
	}

	:root.menu-open {
		overflow: hidden;

		body::before {
			translate: none;
			visibility: visible;
			transition: translate .45s cubic-bezier(.16, 1, .3, 1);
		}

		body::after {
			opacity: 1;
			visibility: visible;
			transition: opacity .5s var(--cubic-bezier);
		}

		body header {
			translate: none;

			/* #dfdfdf en difference sobre negro: a blanco puro */
			.logo path {
				fill: var(--white);
			}

			.menu {
				translate: none;
				visibility: visible;
				transition: translate .45s cubic-bezier(.16, 1, .3, 1);
			}

			/* Menú sale hacia arriba con el panel y Cerrar sube a su sitio */
			.menu-toggle-open {
				visibility: hidden;
				transition: visibility 0s .6s;

				.ch {
					translate: 0 -110%;
				}
			}

			.menu-toggle-close {
				visibility: visible;
				transition: none;

				.ch {
					translate: none;
				}
			}
		}
	}
}

/* Cierre al cambiar de página (app.js, closeMenu): sin transición */
.menu-instant header,
.menu-instant body::before,
.menu-instant body::after,
.menu-instant header .logo path,
.menu-instant header .menu,
.menu-instant header .menu-toggle,
.menu-instant header .menu-toggle * {
	transition: none !important;
}

@media (prefers-reduced-motion: reduce) {
	header,
	body::before,
	body::after,
	header .logo path,
	header .menu,
	header .menu-toggle,
	header .menu-toggle * {
		transition: none !important;
	}
}

/* Accesibilidad: salto al contenido y foco visible */
.skip-link {
	position: fixed;
	top: 10px;
	left: 10px;
	z-index: 2147483647;
	padding: 6px 10px;
	background-color: var(--black);
	color: var(--white);
	text-transform: uppercase;
	white-space: nowrap;

	/* Oculto sin salir del viewport: desplazado fuera, Chrome móvil lo pinta en la captura de la View Transition */
	&:not(:focus-visible) {
		width: 1px;
		height: 1px;
		padding: 0;
		overflow: hidden;
		clip-path: inset(50%);
	}
}

main:focus {
	outline: none;
}

:is(a, button, summary):focus-visible {
	outline: 2px solid currentColor;
	outline-offset: 3px;
}

.visit-button:focus-visible {
	outline-color: var(--black);
}

/* Helper del reloj (solo con $vlc_debug) */
.lt-debug {
	position: fixed;
	left: 10px;
	bottom: 10px;
	z-index: 2147483647;
	display: flex;
	flex-direction: column;
	gap: 8px;
	width: 240px;
	padding: 10px;
	background-color: var(--white);
	color: var(--black);
	border: 1px solid var(--black);
	font-size: 12px;
	text-transform: uppercase;
	font-variant-numeric: tabular-nums;

	button {
		font: inherit;
		text-transform: inherit;
		color: inherit;
		background: none;
		border: 1px solid var(--black);
		padding: 2px 4px;
		cursor: pointer;

		&.is-active {
			background-color: var(--black);
			color: var(--white);
		}
	}

	.lt-debug-days {
		display: grid;
		grid-template-columns: repeat(7, 1fr);
		gap: 2px;
	}

	input {
		width: 100%;
		accent-color: var(--black);
	}

	.lt-debug-info {
		display: flex;
		justify-content: space-between;
		align-items: center;
	}
}

@keyframes lt-blink {
	50% { opacity: 0; }
}

@keyframes lt-steam {
	0% { transform: translateY(1.5px); opacity: 0; }
	40% { opacity: 1; }
	100% { transform: translateY(-1.5px); opacity: 0; }
}

@keyframes lt-rise {
	from { transform: translateY(1px); }
	to { transform: translateY(-1px); }
}

@keyframes lt-spin {
	to { transform: rotate(360deg); }
}

@keyframes lt-twinkle {
	0%, 100% { transform: scale(1); opacity: 1; }
	50% { transform: scale(.4); opacity: .3; }
}

@keyframes lt-float {
	0% { transform: translate(0, 1px); opacity: 0; }
	30% { opacity: 1; }
	100% { transform: translate(1px, -1.5px); opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
	header .local-time * {
		animation: none !important;
	}
}

/* MAIN CONTENT */
main {
	display: flex;
	flex-direction: column;
}

.grain-overlay {
	position: fixed;
	inset: 0;
	pointer-events: none;
	opacity: 0.6;
	z-index: 100;

	&:before {
		content: "";
		top: -10rem;
		left: -10rem;
		width: calc(100% + 20rem);
		height: calc(100% + 20rem);
		z-index: 9999;
		position: fixed;
		background-image: url(../images/gaussian_noise.webp);
		opacity: 0.15;
		pointer-events: none;
		-webkit-animation: noise 1s steps(2) infinite;
		animation: noise 1s steps(2) infinite;

		@media (prefers-reduced-motion: reduce) {
			-webkit-animation: none;
			animation: none;
		}
	}
}

.banner {
	width: calc(100% - 20px);
	height: calc(100svh - 20px);
	min-height: 600px;
	display: flex;
	flex-direction: column;
	justify-content: flex-end;
	align-items: center;
	gap: 10svh;
	position: relative;
	padding: 10px;
	background-color: var(--page-bg);
	color: var(--page-fg);
	isolation: isolate;
	transition: color .3s, background-color .3s;

	.banner-intro {
		width: 100%;
		display: flex;
		flex-direction: row;
		justify-content: flex-end;
        align-items: flex-start;
        gap: 20vw;
	}

	.headline {
		color: inherit;

		p {
			max-width: 30ch;
		}

		.word {
			opacity: 0;
		}

		.banner-data {
			margin-top: 10px;
			text-transform: uppercase;
			font-variant-numeric: tabular-nums;
		}
	}

	.banner-video {
		flex-shrink: 0;
		width: clamp(180px, 22vw, 320px);
		aspect-ratio: 16 / 9;
		z-index: 3;

		video {
			width: 100%;
			height: 100%;
			object-fit: cover;
			display: block;
		}
	}

	.main-content {
		width: 100%;
		display: flex;
		flex-direction: row;
		justify-content: space-between;
		align-items: flex-end;

		h1,
		h2 {
			color: inherit;

			.word {
				opacity: 0;
			}
		}

		h1 {
			font-size: clamp(60px, 5vw, 120px);
			text-transform: uppercase;
			text-wrap: balance;
			max-width: 80vw;
		}

		h2 {
			text-transform: uppercase;
			font-size: clamp(20px, 3vw, 30px);
			text-wrap: nowrap;
			width: fit-content;
			text-align: right;
			display: flex;
			flex-direction: column;
			align-items: flex-end;
		}
	}

	/* Manchas en canvas por encima del texto, en difference sobre el fondo azul */
	.background {
		position: absolute;
		top: 0;
		left: 0;
		width: 100%;
		height: 100%;
		overflow: hidden;
		mix-blend-mode: difference;
		pointer-events: none;
		z-index: 2;

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

	/* Móvil: alineado arriba, la barra inferior queda sobre las manchas. Crece si el contenido no cabe */
	@media (max-width:950px) {
		& {
			height: auto;
			min-height: calc(100svh - 20px);
			padding-bottom: calc(10px + var(--header-h, 0px));
			flex-direction: column;
			justify-content: flex-start;
			align-items: flex-start;
			gap: 15svh;

			.banner-intro {
				flex-direction: column;
				gap: 20px;
			}

			.banner-video {
				width: clamp(160px, 45vw, 240px);
				align-self: flex-end;
			}

			.main-content {
				flex-direction: column;
				gap: 15svh;
				align-items: flex-start;

				h1 {
					font-size: 7.5vw;
					max-width: 90vw;
					align-self: flex-end;
					text-align: right;
				}

				h2 {
					align-items: flex-start;
					text-align: left;
					font-size: 18px;
				}
			}
		}
	}
}

.featured-projects {
	display: grid;
	grid-template-columns: repeat(2, 1fr);
	gap: 10px;
	padding: var(--padding-section);

	.project {
		display: flex;
		flex-direction: column;
		gap: 10px;
		position: relative;
		cursor: pointer;

		/* Area clicable de toda la tarjeta */
		.visit-button::after {
			content: "";
			position: absolute;
			inset: 0;
			z-index: 1;
		}

		@media (min-width:950px) {
			&:hover .visit-button svg {
				transform: translateX(5px);
			}
		}

		.video-container {
			width: 100%;
			height: 100%;
			position: relative;

			&::after {
				content: "";
				position: absolute;
				inset: 0;
				background-color: var(--gray);
				z-index: -1;
			}

			video {
				width: 100%;
				height: 100%;
				object-fit: cover;
				aspect-ratio: 16 / 9;
			}
		}

		.project-info {
			display: flex;
			flex-direction: row;
			justify-content: space-between;
			gap: 10px;

			h3 {
				font-size: clamp(20px, 3vw, 30px);
			}

			.project-title {
				display: flex;
				flex-direction: column;
				gap: 6px;
			}

			.project-meta {
				text-transform: uppercase;
				color: var(--gray);
			}
		}
	}

	@media (max-width:1150px) {
		& {
			.project {
				.project-info {
					.top-info,
					.bottom-info {
						grid-column: auto;
					}

					h3 {
						font-size: 20px;
					}
				}
			}
		}
	}

	@media (max-width:850px) {
		& {
			grid-template-columns: repeat(1, 1fr);
			padding-top: 2svh;
			gap: var(--gap-small);
			
			.project {
				.video-container {
					grid-column: 1;
					order: -1;
				}

				.project-info {
					flex-direction: column;
				}
			}
		}
	}
}

.visit-button {
	display: flex;
	flex-direction: row;
	align-items: center;
	gap: 10px;
	background-color: var(--black);
	color: var(--white);
	text-transform: uppercase;
	padding: 10px 20px;
	transition: color .3s, background-color .3s;

	svg {
		transition: transform .3s var(--cubic-bezier);

		path {
			fill: var(--white);
			transition: fill .3s;
		}
	}

	@media (min-width:950px) {
		&:hover {
			svg {
				transform: translateX(5px);
			}
		}
	}
}

/* Hover de botones: fondo azul y texto negro */
@media (min-width:950px) {
	:is(.visit-button:hover, .featured-projects .project:hover .visit-button) {
		background-color: var(--light-gray);
		color: var(--black);

		svg path {
			fill: var(--black);
		}
	}
}

.projects {
	display: flex;
	flex-direction: column;
	gap: var(--gap-small);
	padding: var(--padding-section);

	.section-title {
		font-size: 10.8vw;
		display: flex;
		justify-content: center;
		text-transform: uppercase;
		font-family: 'Albert', 'Albert Fallback', sans-serif;
		text-align: center;
	}

	.post-grid {
		display: flex;
		flex-direction: column;
		padding: 20px 0;

		.post {
			display: grid;
			grid-template-columns: repeat(12, 1fr);
			border-top: 1px solid var(--page-fg);
			padding: 5px 0;
			width: 100%;
			position: relative;
			color: inherit;
			transition: border .3s;

			&:last-of-type {
				border-bottom: 1px solid var(--page-fg);
			}

			h3 {
				grid-column: 1 / 6;
				font-size: clamp(20px, 3vw, 30px);
			}

			span {
				text-transform: uppercase;
			}

			.year {
				grid-column: 6 / 7;
				letter-spacing: 0;
			}

			.type {
				grid-column: 7 / 11;
			}

			img {
				grid-column: 12 / 13;
				width: 100%;
				height: auto;
				filter: saturate(0);
			}

			&:after {
				content: "";
				position: absolute;
				inset: -1px -10px;
				background-color: var(--page-fg);
				pointer-events: none;
				z-index: -1;
				opacity: 0;
				transition: opacity .1s;
			}

			@media (min-width:950px) {
				&:hover {
					font-style: italic;
					color: var(--page-bg);

					&:after {
						opacity: 1;
					}
				}
			}

			@media (max-width:950px) {
				& {
					grid-template-columns: repeat(6, 1fr);

					h3 {
						grid-column: 1 / 4;
						font-size: initial;
					}

					.year {
						grid-column: 4 / 5;
					}

					.type {
						grid-column: 5 / 6;
					}

					img {
						grid-column: 6 / 7;
					}
				}
			}

			@media (max-width:550px) {
				& {
					padding: 5px 0 0;
					gap: var(--gap-tiny);
					grid-template-areas:
						"a a a"
						"b c c"
						"b c c";

					h3 {
                        order: 1;
						grid-column: 1 / 4;
                        grid-row: 1 / 2;
					}

					.year {
                        order: 3;
						grid-column: 1 / 2;
                        align-self: end;
					}

					.type {
                        order: 4;
						grid-column: 2 / 4;
                        align-self: end;
						text-align: right;
					}

					img {
						order: 2;
                        grid-column: 4 / 7;
                        grid-row: 1 / 3;
					}
				}
			}
		}

		@media (max-width:950px) {
			& {
				padding: 0;
			}
		}
	}

	@media (max-width: 950px) {
		& {
			.section-title {
				font-size: 10.5vw;
			}
		}
	}
}

.about {
	display: grid;
	grid-template-columns: repeat(2, 1fr);
	gap: var(--gap-small);
	padding: var(--padding-section);

	.section-title {
		grid-column: 1 / 3;
		font-size: 10.8vw;
		justify-content: center;
		display: flex;
		text-transform: uppercase;
		font-family: 'Albert', 'Albert Fallback', sans-serif;
		text-align: center;
	}

	.about-content {
		display: flex;
		flex-direction: column;
		justify-content: space-between;

		.skills {
			display: flex;
			flex-direction: row;
			flex-wrap: wrap;
			gap: var(--gap-tiny);
			max-width: 60rem;

			span {
				font-size: clamp(20px, 3vw, 30px);
				padding: max(2px, 0.25vw) max(10px, 0.75vw);
				border-radius: 100px;
				border: 1px solid var(--gray);
			}
		}
	}

	.description {
		max-width: 80ch;

		p {
			font-size: clamp(15px, 1.25vw, 20px);
			line-height: 1.25;
		}

		/* p {
			font-size: clamp(14px, 2vw, 18px);
			text-transform: uppercase;
		} */
	}

	img {
		width: 100%;
        height: auto;
		min-height: 800px;
		max-height: 1200px;
        object-fit: cover;
		filter: saturate(0) contrast(1.25) brightness(0.85);
		transition: filter 0.6s ease;
	}

	@media (hover: hover) {
		.about-image:hover img {
			filter: none;
		}
	}

	.about-image.is-color img {
		filter: none;
	}

	@media (max-width:950px) {
		& {
			grid-template-columns: repeat(1, 1fr);

			.section-title {
				grid-column: 1 / 2;
				font-size: 10.5vw;
			}

			.about-content {
				gap: 40px;
				padding: 0 10px;

				.skills {
					justify-content: center;
					max-width: 600px;
					margin: auto;

					span {
						font-size: 18px;
					}
				}

				.description {
					padding: 10vw;
					text-align: center;
				}
			}

			img {
				max-height: auto;
				min-height: auto;
			}
		}
	}

	@media (max-width:550px) {
		& {
			.about-content {
				.description {
					padding: 5vw;
				}
			}
		}
	}
}

footer {
	display: flex;
	flex-direction: column;
	gap: 20svh;
	padding: 20svh 10px 10px;
	position: relative;

	/* Créditos fuera de la barra inferior */
	@media (max-width:950px) {
		& {
			padding-bottom: calc(10px + var(--header-h, 0px));
		}
	}

	a {
		color: inherit;
	}

	.social-links {
		display: flex;
		flex-direction: column;
		align-items: center;

		h2 {
			/* text-transform: uppercase; */
			font-size: clamp(16px, 2vw, 20px);
			max-width: 25ch;
			margin: auto;
			text-align: center;
			padding: 0 var(--gap-tiny);
			text-wrap: balance;
			margin-bottom: 50px;
		}

		.social-link {
			font-size: 11.25vw;
			line-height: 90%;
			display: flex;
			justify-content: center;
			text-transform: uppercase;
			font-family: 'Albert', 'Albert Fallback', sans-serif;
			text-align: center;

			/* El clip-path inline de GSAP (inset 0 abajo) recorta el outline */
			&:focus-visible {
				clip-path: none !important;
			}

			@media (min-width:950px) {
				&:hover {
					font-style: italic;
				}
			}

			@media (max-width: 950px) {
				& {
					font-size: 11vw;
				}
			}
		}
	}

	.legal {
		display: grid;
		grid-template-columns: 1fr auto 1fr;
		align-items: center;

		> :first-child {
			justify-self: start;
		}

		> :last-child {
			justify-self: end;
		}

		.volver-arriba,
		a {
			text-transform: uppercase;
			font-size: clamp(20px, 3vw, 36px);
			cursor: pointer;
			line-height: 105%;

			&:last-of-type {
				text-align: right;
			}

			@media (min-width:950px) {
				&:hover {
					font-style: italic;
				}
			}

			@media (max-width:950px) {
				& {
					font-size: clamp(14px, 2vw, 18px);
					padding: 5px 0;
				}
			}
		}

		@media (max-width:550px) {
			& {
				grid-template-columns: 1fr;
				justify-items: center;
				text-align: center;

				> :is(:first-child, :last-child) {
					justify-self: center;
					text-align: center;
				}
			}
		}
	}
}

.char {
	display: block;
	margin: -0.01ch;
}

.legal-content {
	display: flex;
	flex-direction: column;
	max-width: 600px;
	margin: auto;
	padding: 100px 10px 10px;

	@media (max-width:950px) {
		& {
			padding-top: 20px;
		}
	}

	h1,
	h2,
	h3,
	h4,
	h5,
	h6 {
		padding-top: 20px;
	}

	ul,
	p {
		padding-top: 10px;
	}

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

	ul {
		padding-left: 30px;
	}
}

input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus,
input:-webkit-autofill:active {
    -webkit-animation: autofill 0s forwards;
    animation: autofill 0s forwards;
}

/* Aviso flotante: junto al cursor (left/top desde JS) o, en táctil, centrado abajo */
.notification {
	position: fixed;
	top: 0;
	left: 0;
	z-index: 10000;
	margin: 0;
	background-color: var(--black);
	color: var(--white);
	display: flex;
	flex-direction: row;
	align-items: center;
	justify-content: center;
	gap: 10px;
	padding: 10px 6px;
	height: fit-content;
	width: fit-content;
	pointer-events: none;
	transform-origin: center;
	animation: notificationIn .3s var(--cubic-bezier);

	&.is-docked {
		top: auto;
		left: 50%;
		bottom: calc(10px + env(safe-area-inset-bottom, 0px));
		translate: -50% 0;

		/* Sobre la barra inferior */
		@media (max-width:950px) {
			& {
				bottom: calc(10px + var(--header-h, 0px));
			}
		}
	}

	p {
		white-space: nowrap;
	}

	svg {
		display: block;
		width: 20px;
		height: 20px;

		path {
		fill: var(--white);
		}
	}
}

@keyframes autofill {
    100% {
        background: transparent;
        color: inherit;
    }
}

@-webkit-keyframes autofill {
    100% {
        background: transparent;
        color: inherit;
    }
}

/* Escala como propiedad propia, independiente de la posición */
@keyframes notificationIn {
	from {
		scale: 0.7;
		filter: blur(10px);
		opacity: 0;
	}
	to {
		scale: 1;
		filter: blur(0);
		opacity: 1;
	}
}

@keyframes notificationOut {
	from {
		scale: 1;
		filter: blur(0);
		opacity: 1;
	}
	to {
		scale: 0.7;
		filter: blur(10px);
		opacity: 0;
	}
}

/* Cursor heredado de la página anterior: sin animación de entrada */
.cursor-carried :is(.cursor-1, .cursor-2) {
	top: 0;
	left: 0;
	animation: none;
}

/* Cursor por encima de la capa de entrada */
.cursor-carried body:has(> #page-intro) {
	.cursor-1 {
		z-index: 2147483647;
	}

	.cursor-2 {
		z-index: 2147483646;
	}
}

/* TRANSICIÓN ENTRE PÁGINAS */
/* View Transition de la navegación interna (app.js): la página actual retrocede hacia la base y la nueva sube por encima */
::view-transition {
	background-color: var(--black);
}

/* Sonda de app.js: su grupo sitúa el viewport dentro de la captura. Lo que queda encima (bajo las barras
   dinámicas de Chrome Android y Safari iOS, en blanco) se recorta con --vt-top */
.vt-probe {
	position: fixed;
	inset: 0;
	pointer-events: none;
	view-transition-name: vt-probe;
}

::view-transition-old(root),
::view-transition-new(root) {
	mix-blend-mode: normal;
	animation: .9s cubic-bezier(0.76, 0, 0.24, 1) both;
}

::view-transition-old(root) {
	transform-origin: 50% 100%;
	animation-name: page-recede;
}

::view-transition-new(root) {
	animation-name: page-rise;
	clip-path: inset(var(--vt-top, 0px) 0 0 0);
}

/* Clic fallido (enlace a la página actual): intenta salir y vuelve a su sitio */
.vt-nope::view-transition-old(root) {
	animation: page-nope .55s cubic-bezier(0.65, 0, 0.35, 1) both;
}

.vt-nope::view-transition-new(root) {
	animation: none;
	opacity: 0;
}

@keyframes page-nope {
	from,
	to {
		clip-path: inset(var(--vt-top, 0px) 0 0 0 round 0 0 0 0);
	}
	40% {
		transform: scale(.97);
		clip-path: inset(var(--vt-top, 0px) 0 0 0 round 1rem 1rem 0 0);
		filter: brightness(.85);
	}
}

@keyframes page-recede {
	from {
		clip-path: inset(var(--vt-top, 0px) 0 0 0 round 0 0 0 0);
	}
	to {
		transform: scale(.92);
		clip-path: inset(var(--vt-top, 0px) 0 0 0 round 1.5rem 1.5rem 0 0);
		filter: brightness(.7);
	}
}

@keyframes page-rise {
	from {
		transform: translateY(100%);
	}
}

@keyframes easeInCursorSmall {
	from {
		width: 0;
		height: 0;
	}
	to {
		width: 25px;
		height: 25px;
	}
}

@keyframes easeInCursorBig {
	from {
		width: 0;
		height: 0;
	}
	to {
		width: 120px;
		height: 120px;
	}
}

.services-section {
	padding: var(--padding-section);

	#canvas-container {
		height: 100svh;
		min-width: 0;
		z-index: -100;

		canvas {
			display: block;
			width: 100%;
			height: 100%;
			filter: saturate(0.8);
			pointer-events: none;
		}
	}

	.section-title {
		font-size: 10.8vw;
		display: flex;
		justify-content: center;
		text-transform: uppercase;
		font-family: 'Albert', 'Albert Fallback', sans-serif;
		text-align: center;
	}

	.services {
		display: grid;
		grid-template-columns: repeat(2, 1fr);
		gap: 10px;

		.section {
            min-height: 100svh;
			display: flex;
			flex-direction: column;
			justify-content: center;
			gap: 30px;
			padding: 50px 0;

			h3 {
				font-family: 'Albert', 'Albert Fallback', sans-serif;
				font-size: clamp(25px, 4vw, 46px);
				max-width: 20ch;
				text-transform: uppercase;
				text-wrap: balance;
			}

			.content {
				display: flex;
				flex-direction: column;

				p {
					margin-top: 10px;
					max-width: 50ch;
				}

				strong {
					font-weight: 700;
					font-variation-settings: 'wght' 600;
				}
			}

			.list {
				display: flex;
				flex-direction: column;
				text-transform: uppercase;

				span {
					width: 100%;
					border-top: 1px solid var(--gray);
					padding: 2px 0;
					/* font-size: clamp(12px, 1.8vw, 16px); */

					&:last-of-type {
						border-bottom: 1px solid var(--gray);
					}
				}
			}
		}
	}

	@media (max-width: 950px) {
		& {
			.section-title {
				font-size: 10.5vw;
			}

			.services {
				display: flex;
				flex-direction: column;
				position: relative;

				#scroll-content {
					order: 1;
				}

				#canvas-container {
					order: 2;
					position: absolute;
					top: 0;
					left: 0;
					width: 100%;
					height: 50svh;
					pointer-events: none;
				}

				h2 {
					font-size: 18px;
				}

				/* Contenido en la mitad inferior, alineado abajo */
				.section {
					box-sizing: border-box;
					min-height: 100svh;
					justify-content: flex-end;
					padding: 0 0 10px;
				}
			}
		}
	}
}

.inspiring-phrase {
	padding: var(--padding-section);

	p {
		display: flex;
		flex-wrap: wrap;
		justify-content: center;
		gap: 0 0.3em;
		font-size: clamp(25px, 4vw, 46px);
		font-weight: 700;
		line-height: 100%;
		width: 75vw;
		max-width: 1300px;
		text-wrap: balance;
		margin: auto;
		text-transform: uppercase;
		font-family: 'Albert', 'Albert Fallback', sans-serif;
		text-align: center;

		.word {
			display: inline-flex;

			.char {
				display: inline-block;
				padding: 6px 0 0;
				overflow: hidden;

				span {
					display: inline-block;
				}
			}
		}
	}

	@media (max-width:950px) {
		& {
			p {
				width: 90vw;
				font-size: clamp(20px, 4vw, 46px);
			}
		}
	}
}

/* PRESUPUESTO */
.budget {
	--fg: var(--black);
	--bg: var(--white);
	display: flex;
	flex-direction: column;
	gap: var(--gap-small);
	padding: 100px 10px 0;

	/* Título editable: se reduce si no cabe en una línea */
	.section-title {
		--len: 11;
		font-size: min(10.8vw, 96vw / (var(--len) * 0.95));
		display: flex;
		justify-content: center;
		text-transform: uppercase;
		font-family: 'Albert', 'Albert Fallback', sans-serif;
		text-align: center;
	}

	.budget-intro {
		max-width: 45ch;
		margin: 0 auto;
		text-align: center;
		text-wrap: balance;
	}

	.budget-form {
		display: grid;
		grid-template-columns: repeat(12, 1fr);
		gap: 0 10px;
		padding-top: var(--gap-small);
	}

	.budget-options,
	.budget-contact {
		grid-column: 1 / 8;
	}

	/* Pasos */
	.budget-step {
		display: flex;
		flex-direction: column;
		gap: 20px;
		min-width: 0;
		border: 0;
		border-top: 1px solid var(--gray);
		padding: 10px 0 60px;

		&:last-of-type {
			padding: 10px 0 0;
		}

		legend {
			float: left;
			display: flex;
			align-items: baseline;
			gap: 10px;
			width: 100%;
			padding: 0;
			font-size: clamp(20px, 3vw, 30px);
			font-weight: 700;
			line-height: 0.9;
			text-transform: uppercase;
		}
	}

	.budget-num {
		font-size: 14px;
		font-weight: 400;
		letter-spacing: 0;
		color: var(--gray);
	}

	.budget-help {
		max-width: 60ch;
		opacity: 0.65;
	}

	/* Opciones: input real oculto pero accesible por teclado */
	.budget-options {
		display: flex;
		flex-direction: column;

		input[type=radio],
		input[type=checkbox] {
			position: absolute;
			width: 1px;
			height: 1px;
			margin: 0;
			opacity: 0;
			pointer-events: none;
		}

		label {
			position: relative;
			cursor: pointer;

			&:has(input:focus-visible) {
				outline: 2px solid var(--fg);
				outline-offset: 2px;
			}
		}
	}

	.budget-cards {
		display: grid;
		grid-template-columns: repeat(2, 1fr);
		gap: 10px;
	}

	.budget-card {
		display: flex;
		flex-direction: column;
		gap: 10px;
		min-height: 200px;
		padding: 15px;
		border: 1px solid var(--gray);
		transition: color .3s, background-color .3s, border-color .3s;

		.budget-card-title {
			font-family: 'Albert', 'Albert Fallback', sans-serif;
			font-size: clamp(20px, 2.4vw, 30px);
			line-height: 0.9;
			text-transform: uppercase;
		}

		.budget-card-desc {
			max-width: 40ch;
			opacity: 0.65;
		}

		&:has(input:checked) {
			background-color: var(--fg);
			border-color: var(--fg);
			color: var(--bg);
		}

		@media (min-width:950px) {
			&:hover {
				font-style: italic;
			}
		}
	}

	.budget-range {
		display: grid;
		grid-template-columns: 1fr auto;
		align-items: center;
		gap: 20px;

		output {
			min-width: 2ch;
			font-family: 'Albert', 'Albert Fallback', sans-serif;
			font-size: clamp(36px, 4vw, 60px);
			line-height: 0.9;
			text-align: right;
			font-variant-numeric: tabular-nums;
		}

		input[type=range] {
			--p: 50%;
			--track: linear-gradient(to right, var(--fg) var(--p), var(--gray) var(--p));
			-webkit-appearance: none;
			appearance: none;
			width: 100%;
			height: 30px;
			background: transparent;
			cursor: pointer;

			&::-webkit-slider-runnable-track {
				height: 2px;
				background: var(--track);
			}

			&::-moz-range-track {
				height: 2px;
				background: var(--track);
			}

			&::-webkit-slider-thumb {
				-webkit-appearance: none;
				width: 25px;
				height: 25px;
				margin-top: -11.5px;
				border: 0;
				border-radius: 50%;
				background-color: var(--fg);
			}

			&::-moz-range-thumb {
				width: 25px;
				height: 25px;
				border: 0;
				border-radius: 50%;
				background-color: var(--fg);
			}

			&:focus-visible {
				outline: none;

				&::-webkit-slider-thumb {
					outline: 2px solid var(--fg);
					outline-offset: 3px;
				}

				&::-moz-range-thumb {
					outline: 2px solid var(--fg);
					outline-offset: 3px;
				}
			}
		}
	}

	.budget-list {
		display: flex;
		flex-direction: column;
	}

	.budget-row {
		display: grid;
		grid-template-columns: auto 1fr;
		align-items: baseline;
		gap: 10px;
		padding: 8px 0;
		border-top: 1px solid var(--gray);
		text-transform: uppercase;
		isolation: isolate;
		transition: color .1s;

		&:last-of-type {
			border-bottom: 1px solid var(--gray);
		}

		&::after {
			content: "";
			position: absolute;
			inset: -1px -10px;
			background-color: var(--fg);
			pointer-events: none;
			z-index: -1;
			opacity: 0;
			transition: opacity .1s;
		}

		.budget-check {
			width: 12px;
			height: 12px;
			border: 1px solid currentColor;
			border-radius: 50%;
		}

		.budget-row-text small {
			display: block;
			margin-top: 2px;
			font-size: 12px;
			text-transform: none;
			opacity: 0.65;
		}

		&:has(input:checked) {
			color: var(--bg);

			&::after {
				opacity: 1;
			}

			.budget-check {
				background-color: currentColor;
			}
		}

		@media (min-width:950px) {
			&:hover {
				font-style: italic;
			}
		}
	}

	.budget-pills {
		display: flex;
		flex-wrap: wrap;
		gap: var(--gap-tiny);
	}

	.budget-pill span {
		display: block;
		min-width: 1ch;
		font-size: clamp(18px, 2vw, 24px);
		padding: max(2px, 0.25vw) max(12px, 0.9vw);
		border: 1px solid var(--gray);
		border-radius: 100px;
		text-align: center;
		transition: color .3s, background-color .3s, border-color .3s;
	}

	.budget-pill:has(input:checked) span {
		background-color: var(--fg);
		border-color: var(--fg);
		color: var(--bg);
	}

	@media (min-width:950px) {
		.budget-pill:hover span {
			font-style: italic;
		}
	}

	/* Resumen */
	.budget-summary {
		grid-column: 9 / 13;
		grid-row: 1 / 3;
		align-self: start;
		position: sticky;
		top: 90px;
		display: flex;
		flex-direction: column;
		gap: 15px;
		padding-top: 10px;
		border-top: 1px solid var(--gray);
	}

	.budget-label,
	.budget-meta {
		text-transform: uppercase;
	}

	.budget-total {
		font-family: 'Albert', 'Albert Fallback', sans-serif;
		font-size: clamp(30px, 2.8vw, 56px);
		line-height: 0.9;
		font-variant-numeric: tabular-nums;
	}


	.budget-note,
	.budget-legal {
		font-size: 12px;
		opacity: 0.65;
	}

	.budget-cta,
	.budget-submit {
		justify-content: space-between;
	}

	/* Contacto */
	.budget-fields {
		display: grid;
		grid-template-columns: repeat(2, 1fr);
		gap: 20px 10px;
	}

	.budget-field {
		display: flex;
		flex-direction: column;
		gap: 5px;
		text-transform: uppercase;

		input,
		textarea {
			width: 100%;
			padding: 8px 0;
			font: inherit;
			font-size: 16px;
			letter-spacing: inherit;
			text-transform: none;
			color: inherit;
			background: transparent;
			border: 0;
			border-bottom: 1px solid var(--gray);
			border-radius: 0;
			outline: none;
			transition: border-color .3s;

			&:focus {
				border-color: var(--fg);
			}
		}

		textarea {
			min-height: 100px;
			resize: vertical;
		}
	}

	.budget-field-full {
		grid-column: 1 / -1;
	}

	.budget-hp {
		position: absolute;
		left: -9999px;
		width: 1px;
		height: 1px;
		overflow: hidden;
	}

	.budget-privacy {
		display: flex;
		align-items: flex-start;
		gap: 10px;
		cursor: pointer;

		input {
			flex-shrink: 0;
			width: 16px;
			height: 16px;
			margin-top: 1px;
			accent-color: var(--fg);
		}

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

	.budget-submit {
		width: 100%;
		border: 0;
		font: inherit;
		letter-spacing: inherit;
		cursor: pointer;

		&:disabled {
			opacity: 0.5;
			cursor: wait;
		}
	}

	.budget-status:empty {
		display: none;
	}

	.budget-form.is-sent {
		.budget-fields,
		.budget-privacy,
		.budget-legal,
		.budget-submit {
			display: none;
		}

		.budget-status {
			font-size: clamp(20px, 3vw, 30px);
			line-height: 1;
			text-transform: uppercase;
			text-wrap: balance;
		}
	}

	/* Barra de total en móvil */
	.budget-bar {
		display: none;
	}

	@media (max-width:950px) {
		& {
			/* Página propia: sin header arriba que salvar */
			.budget-page & {
				padding-top: 20px;
			}

			.section-title {
				font-size: min(10.5vw, 96vw / (var(--len) * 0.95));
			}

			.budget-total {
				font-size: clamp(30px, 8vw, 56px);
			}

			.budget-form {
				display: flex;
				flex-direction: column;
			}

			.budget-summary {
				position: static;
				padding-bottom: 60px;
			}

			/* Sobre la barra inferior; baja a su sitio cuando esta se oculta */
			.budget-bar {
				position: sticky;
				bottom: var(--header-h, 0px);
				z-index: 5;
				display: flex;
				justify-content: space-between;
				align-items: center;
				gap: 10px;
				margin: 0 -10px;
				padding: 10px;
				background-color: var(--fg);
				color: var(--bg);
				text-transform: uppercase;
				transition: transform .4s var(--cubic-bezier), bottom .45s var(--cubic-bezier);

				body.header-hidden & {
					bottom: 0;
				}

				strong {
					font-family: 'Albert', 'Albert Fallback', sans-serif;
					font-size: 20px;
				}

				small {
					white-space: nowrap;
				}

				a {
					padding: 3px 4px;
					background-color: var(--bg);
					color: var(--fg);
				}

				&.is-hidden {
					transform: translateY(calc(110% + var(--header-h, 0px)));
				}
			}
		}
	}

	@media (max-width:550px) {
		& {
			.budget-cards,
			.budget-fields {
				grid-template-columns: 1fr;
			}

			.budget-card {
				min-height: 0;
			}
		}
	}
}

/* Encabezado de seccion oculto visualmente */
.visually-hidden{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0;}

/* PÁGINA DE PROYECTO */
.case {
	--fg: var(--black);
	--bg: var(--white);

	img,
	video {
		display: block;
		width: 100%;
		height: auto;
	}

	video {
		aspect-ratio: 16 / 9;
		object-fit: cover;
		background-color: var(--gray);
	}

	.section-title {
		font-size: 10.8vw;
		display: flex;
		justify-content: center;
		text-transform: uppercase;
		font-family: 'Albert', 'Albert Fallback', sans-serif;
		text-align: center;

		@media (max-width:950px) {
			& {
				font-size: 10.5vw;
			}
		}
	}

	.visit-button {
		width: auto;
		justify-content: space-between;
	}
}

.case-label {
	font-size: 14px;
	font-weight: 400;
	letter-spacing: 0;
	text-transform: uppercase;
	color: var(--gray);
}

/* Cabecera */
.case-hero {
	display: flex;
	flex-direction: column;
	justify-content: flex-end;
	box-sizing: border-box;
	min-height: 100svh;
	padding: 180px 10px 10px;

	/* Título editable: se reduce si no cabe en una línea */
	.case-title {
		--len: 10;
		font-size: clamp(40px, 96vw / (var(--len) * 0.95), 10.8vw);
		line-height: 0.85;
		text-transform: uppercase;
		text-wrap: balance;
		margin-bottom: 100px;
		max-width: 10ch;
	}

	/* Línea entre título e intro: crece desde la izquierda, como en el archivo */
	.case-rule {
		margin: 0;
		border: 0;
		border-top: 1px solid var(--fg);
		transform-origin: left;
	}

	.case-intro {
		display: grid;
		grid-template-columns: repeat(12, 1fr);
		gap: 40px 10px;
		padding-top: 23px;
	}

	.case-lead {
		grid-column: 1 / 8;
		display: flex;
		flex-direction: column;
		gap: 30px;

		p {
			max-width: 32ch;
			font-size: clamp(20px, 2.4vw, 34px);
			line-height: 1;
			text-wrap: pretty;
		}
	}

	.case-pills {
		display: flex;
		flex-wrap: wrap;
		gap: var(--gap-tiny);
		list-style: none;

		li {
			font-size: clamp(16px, 1.6vw, 22px);
			padding: max(2px, 0.25vw) max(10px, 0.75vw);
			border: 1px solid var(--gray);
			border-radius: 100px;
		}
	}

	.case-side {
		grid-column: 9 / 13;
		display: flex;
		flex-direction: column;
		gap: 20px;
	}

	.case-meta {
		text-transform: uppercase;

		div {
			display: flex;
			justify-content: space-between;
			gap: 10px;
			padding: 2px 0;
			border-top: 1px solid var(--gray);

			&:last-child {
				border-bottom: 1px solid var(--gray);
			}
		}

		dt {
			color: var(--gray);
		}

		dd {
			text-align: right;
		}
	}

	/* Móvil: alineada arriba y con su altura; la portada asoma en el primer pantallazo */
	@media (max-width:950px) {
		& {
			justify-content: flex-start;
			min-height: 0;
			padding: 20px 10px 50px;

			.case-title {
				margin-bottom: 50px;
			}

			.case-intro {
				padding-top: 18px;
				gap: 20px 10px;
			}

			.case-lead,
			.case-side {
				grid-column: 1 / -1;
			}

			.case-lead {
				gap: 20px;
			}
		}
	}
}

/* Media principal */
.case-cover {
	padding: 0 10px;

	img {
		aspect-ratio: 16 / 9;
		object-fit: cover;
	}
}

/* Proceso */
.case-process {
	display: flex;
	flex-direction: column;
	gap: var(--gap-medium);
	padding: var(--padding-section);

	.inspiring-phrase {
		padding: var(--gap-medium) 0;
	}
}

.case-step {
	display: flex;
	flex-direction: column;
	gap: var(--gap-small);
	padding-top: 10px;
	border-top: 1px solid var(--gray);

	.case-step-main {
		display: grid;
		grid-template-columns: repeat(12, 1fr);
		gap: 20px 10px;
		align-items: start;
	}

	.case-step-head {
		grid-column: 1 / 6;
		position: sticky;
		top: 90px;
		display: flex;
		flex-direction: column;
		gap: 20px;

		h3 {
			max-width: 20ch;
			font-family: 'Albert', 'Albert Fallback', sans-serif;
			font-size: clamp(25px, 4vw, 46px);
			text-transform: uppercase;
			text-wrap: balance;
		}
	}

	.case-step-body {
		grid-column: 7 / 13;
	}

	@media (max-width:950px) {
		& {
			.case-step-head {
				grid-column: 1 / -1;
				position: static;
			}

			.case-step-body {
				grid-column: 1 / -1;
			}
		}
	}
}

/* Texto enriquecido */
.case-text {
	display: flex;
	flex-direction: column;
	gap: 10px;
	max-width: 60ch;

	p {
		font-size: clamp(14px, 1.2vw, 18px);
	}

	strong,
	b {
		font-weight: 700;
		font-variation-settings: 'wght' 600;
	}

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

	ul,
	ol {
		list-style: none;
		text-transform: uppercase;

		li {
			padding: 2px 0;
			border-top: 1px solid var(--gray);

			&:last-child {
				border-bottom: 1px solid var(--gray);
			}
		}
	}

	ol {
		counter-reset: case;

		li::before {
			counter-increment: case;
			content: counter(case, decimal-leading-zero) " ";
			color: var(--gray);
			letter-spacing: 0;
		}
	}
}

/* Imágenes y vídeo */
.case-figure {
	display: grid;
	grid-template-columns: repeat(12, 1fr);
	gap: 10px;

	> * {
		grid-column: 1 / -1;
	}

	&.is-centrado > * {
		grid-column: 3 / 11;
	}

	&.is-izquierda > * {
		grid-column: 1 / 7;
	}

	&.is-derecha > * {
		grid-column: 7 / 13;
	}

	figcaption {
		font-size: 12px;
		text-transform: uppercase;
		opacity: 0.65;
	}

	@media (max-width:950px) {
		&.is-centrado > *,
		&.is-izquierda > *,
		&.is-derecha > * {
			grid-column: 1 / -1;
		}
	}
}

.case-gallery {
	--cols: 2;
	display: grid;
	grid-template-columns: repeat(var(--cols), 1fr);
	gap: 10px;
	align-items: start;

	@media (max-width:950px) {
		& {
			grid-template-columns: repeat(auto-fit, minmax(max(40%, 160px), 1fr));
		}
	}

	@media (max-width:550px) {
		& {
			grid-template-columns: 1fr;
		}
	}
}

/* Cifras */
.case-stats {
	display: flex;
	flex-direction: column;
	gap: 10px;

	dl {
		display: grid;
		grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
		gap: 0 10px;
	}

	.case-stat {
		display: flex;
		flex-direction: column-reverse;
		justify-content: flex-end;
		gap: 10px;
		padding: 10px 0 40px;
		border-top: 1px solid var(--gray);
	}

	dd {
		font-family: 'Albert', 'Albert Fallback', sans-serif;
		font-size: clamp(48px, 5vw, 110px);
		line-height: 0.8;
		font-variant-numeric: tabular-nums;
	}

	dt {
		max-width: 30ch;
		text-transform: uppercase;
	}
}

/* Paleta */
.case-palette {
	display: flex;
	flex-direction: column;
	gap: 10px;

	ul {
		display: grid;
		grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
		gap: 10px;
		list-style: none;
	}

	.case-swatch {
		display: flex;
		flex-direction: column;
		gap: 2px;
		text-transform: uppercase;

		&::before {
			content: "";
			aspect-ratio: 3 / 4;
			margin-bottom: 8px;
			background-color: var(--swatch);
			border: 1px solid var(--gray);
		}

		span:last-child {
			color: var(--gray);
			letter-spacing: 0;
		}
	}
}

/* Siguiente proyecto */
.case-next {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 20px;
	padding: var(--padding-section);
	text-align: center;

	a {
		--len: 10;
		font-family: 'Albert', 'Albert Fallback', sans-serif;
		font-size: clamp(40px, 96vw / (var(--len) * 0.95), 10.8vw);
		font-weight: 700;
		line-height: 0.85;
		text-transform: uppercase;
		text-wrap: balance;
		color: inherit;

		@media (min-width:950px) {
			&:hover {
				font-style: italic;
			}
		}
	}
}

/* ARCHIVO DE PROYECTOS */
.archive {
	--fg: var(--black);
	--bg: var(--white);
	--stripe: color-mix(in srgb, var(--gray) 12%, transparent);
	--line: color-mix(in srgb, var(--fg) 15%, var(--bg));
	--list-cols: minmax(0, 4fr) minmax(0, 3fr) 6ch;
	padding: 90px 10px 0;

	/* Móvil: sin header arriba, solo el hueco del total sobre el título */
	@media (max-width:950px) {
		& {
			--list-cols: minmax(0, 3fr) minmax(0, 2fr);
			padding-top: 34px;
		}
	}

	[hidden] {
		display: none !important;
	}

	a {
		color: inherit;
	}

	img {
		display: block;
	}
}

/* Cabecera: título a la izquierda, texto breve arriba a la derecha */
.ar-mast {
	display: grid;
	grid-template-columns: repeat(12, 1fr);
	align-items: start;
	gap: 20px 10px;
	padding-bottom: 14px;

	.ar-heading {
		grid-column: 1 / -1;
		position: relative;
		display: flex;
		align-items: flex-start;
		gap: 6px;
	}

	/* Mismo tamaño que el título de la página de proyecto */
	.ar-title {
		--len: 10;
		font-size: clamp(40px, 96vw / (var(--len) * 0.95), 10.8vw);
		line-height: 0.85;
		text-transform: uppercase;
	}

	.ar-total {
		font-size: clamp(14px, 1.4vw, 24px);
		line-height: 1;
		letter-spacing: 0;
		font-variant-numeric: tabular-nums;
	}

	/* El total no cabe junto al título: pasa encima, a la derecha */
	@media (max-width:1200px) {
		& {
			.ar-total {
				position: absolute;
				right: 0;
				bottom: 100%;
				margin-bottom: 6px;
			}
		}
	}
}

.ar-rule {
	margin: 0;
	border: 0;
	border-top: 1px solid var(--fg);
	transform-origin: left;
}

/* Casilla entre corchetes: [ ] [●] [+] [-] */
.ar-box {
	display: inline-grid;
	grid-template-columns: auto 1.3ch auto;
	align-items: center;
	justify-items: center;
	margin-right: 0.4ch;
	font-style: normal;

	&::before {
		content: "[";
	}

	&::after {
		content: "]";
	}

	i {
		display: grid;
		place-items: center;
		font-style: normal;

		svg {
			width: 0.55em;
			height: 0.55em;
			transform: rotate(-45deg);
		}
	}
}

.ar-check {
	position: relative;
	display: inline-flex;
	align-items: baseline;
	cursor: pointer;

	input {
		position: absolute;
		width: 1px;
		height: 1px;
		margin: 0;
		opacity: 0;
		pointer-events: none;
	}

	.ar-box i::before {
		content: "";
		width: 0.45em;
		height: 0.45em;
		border-radius: 50%;
		background-color: currentColor;
		transform: scale(0);
		transition: transform .2s var(--cubic-bezier);
	}

	&:has(input:checked) .ar-box i::before {
		transform: scale(1);
	}

	&:has(input:focus-visible) {
		outline: 2px solid var(--fg);
		outline-offset: 2px;
	}
}

/* Panel: filtro por etiqueta */
.ar-panel {
	padding: 20px 0 var(--gap-medium);
	font-size: clamp(14px, 1.1vw, 18px);
	line-height: 1.15;
	text-transform: uppercase;

	.ar-tags {
		display: flex;
		flex-wrap: wrap;
		align-items: baseline;
		gap: 0.6ch;
		min-inline-size: 0;
		padding: 0;
		border: 0;

		.ar-check {
			padding: 2px 4px;
		}
	}

	/* Hover invertido, como las filas de la vista lista */
	@media (min-width:950px) {
		.ar-check:hover {
			background-color: var(--fg);
			color: var(--bg);
		}
	}
}

/* Grupo por año */
.ar-group-head {
	display: flex;
	align-items: baseline;
	gap: 10px;
	padding: 16px 0 4px;
	border-bottom: 1px solid var(--line);

	/* Misma tipografía y tamaño que el texto del panel */
	.ar-year {
		font-size: clamp(14px, 1.1vw, 18px);
		font-weight: inherit;
		line-height: 1.15;
	}
}

/* Lista: tabla compacta con filas alternas */
.ar-cols {
	display: grid;
	grid-template-columns: var(--list-cols);
	gap: 10px;
	padding: 0 4px 4px;
	font-size: 12px;
	text-transform: uppercase;
	color: var(--gray);
	border-bottom: 1px solid var(--line);

	> :last-child {
		text-align: right;
	}
}

.ar-grid {
	padding: 0 0 var(--gap-small);
	list-style: none;
}

.ar-item {
	position: relative;
	display: grid;
	grid-template-columns: var(--list-cols);
	align-items: baseline;
	gap: 10px;
	padding: 5px 4px;
	text-transform: uppercase;

	&:nth-child(odd of :not([hidden])) {
		background-color: var(--stripe);
	}

	&:has(.ar-link:focus-visible) {
		outline: 2px solid var(--fg);
		outline-offset: 4px;
	}
}

.ar-media {
	display: contents;

	img {
		display: none;
	}
}

.ar-name {
	grid-column: 1;
	font-size: clamp(14px, 1.2vw, 18px);
	font-variation-settings: 'wght' 500;
	line-height: 1;

	.ar-link {
		&::after {
			content: "";
			position: absolute;
			inset: 0;
			z-index: 1;
		}

		&:focus-visible {
			outline: none;
		}
	}
}

/* Tipo y año como celdas de la fila */
.ar-spec {
	&,
	div {
		display: contents;
	}

	dt {
		display: none;
	}

	dd {
		font-variant-numeric: tabular-nums;
	}

	.is-type dd {
		grid-column: 2;
	}

	.is-year dd {
		grid-column: 3;
		text-align: right;
	}
}

/* Fila invertida con la imagen flotando sobre la tabla */
@media (min-width:951px) {
	.ar-item:has(.ar-link:hover) {
		background-color: var(--fg);
		color: var(--bg);
		font-style: italic;

		.ar-media img {
			display: block;
			position: absolute;
			top: 50%;
			right: calc(100% - 4px - (100% - 28px - 6ch) * 4 / 7);
			z-index: 2;
			width: clamp(160px, 16vw, 280px);
			height: auto;
			aspect-ratio: var(--ratio, auto);
			background-color: var(--gray);
			transform: translateY(-50%);
			pointer-events: none;
		}
	}
}

@media (max-width:950px) {
	.ar-cols > :nth-child(3),
	.ar-spec .is-year {
		display: none;
	}

	.ar-cols > :nth-child(2),
	.ar-spec .is-type dd {
		text-align: right;
	}
}

/* MEJORAS DE PRESENTACIÓN */

/* Lista de proyectos de la home: caso propio o web externa, vista previa al pasar */
.projects .post-grid .post {
	.go {
		grid-column: 11 / 12;
		justify-self: end;
		align-self: start;
		display: inline-flex;
		align-items: center;
		gap: 6px;

		svg {
			transition: transform .3s var(--cubic-bezier);
		}

		&.is-external svg {
			transform: rotate(-45deg);
		}
	}

	@media (min-width:951px) {
		img {
			position: relative;
			z-index: 1;
			transition: filter .3s;
		}

		&:hover {
			img {
				z-index: 2;
				filter: none;
			}

			.go svg {
				transform: translateX(4px);
			}

			.go.is-external svg {
				transform: rotate(-45deg) translateX(4px);
			}
		}
	}

	@media (max-width:950px) {
		.go {
			display: none;
		}
	}
}

.projects .projects-more {
	align-self: center;
}

@media (min-width:950px) {
	.projects .visit-button.projects-more:hover {
		background-color: var(--white);
	}
}

/* Sobre mí (home): enlace a la página */
.about .about-more {
	margin-top: 30px;

	@media (max-width:950px) {
		margin-inline: auto;
	}
}

/* Pie: disponibilidad, email visible y créditos */
footer {
	.social-links {
		.availability {
			display: inline-flex;
			align-items: center;
			gap: 8px;
			padding: 0 var(--gap-tiny);
			text-align: center;
			text-wrap: balance;
			margin: -20px auto 40px;
			text-transform: uppercase;

			&::before {
				content: "";
				width: 8px;
				height: 8px;
				border-radius: 50%;
				background-color: currentColor;
			}
		}

		/* Texto bajo Email y redes: enlaza al mismo destino que su social-link */
		.link-note {
			margin: 0 auto 30px;
			font-size: clamp(14px, 1.4vw, 20px);
			letter-spacing: 0;
		}
	}

	.legal .credits {
		font-size: 12px;
		text-transform: uppercase;
		text-align: center;

		.colophon {
			display: block;
			color: var(--gray);
		}
	}
}

/* Títulos de Proceso y Testimonios en la home: se reducen si no caben */
:is(.home-process, .testimonials) .section-title {
	--len: 11;
	font-size: min(10.8vw, 96vw / (var(--len) * 0.95));
	display: flex;
	justify-content: center;
	text-transform: uppercase;
	font-family: 'Albert', 'Albert Fallback', sans-serif;
	text-align: center;

	@media (max-width:950px) {
		font-size: min(10.5vw, 96vw / (var(--len) * 0.95));
	}
}

/* Testimonios: home y casos de estudio */
.testimonials {
	display: flex;
	flex-direction: column;
	gap: var(--gap-small);
	padding: var(--padding-section);
}

.testimonials-list {
	display: flex;
	flex-direction: column;
	gap: var(--gap-small);
}

.case-quote {
	display: grid;
	grid-template-columns: repeat(12, 1fr);
	gap: 20px 10px;
	padding-top: 10px;
	border-top: 1px solid var(--gray);

	blockquote,
	figcaption {
		grid-column: 4 / 13;
	}

	blockquote p {
		max-width: 32ch;
		font-size: clamp(20px, 2.4vw, 34px);
		line-height: 1;
		text-wrap: pretty;

		&::before {
			content: "«";
		}

		&::after {
			content: "»";
		}
	}

	figcaption {
		display: flex;
		flex-wrap: wrap;
		align-items: baseline;
		gap: 4px 10px;
		text-transform: uppercase;
	}

	@media (max-width:950px) {
		blockquote,
		figcaption {
			grid-column: 1 / -1;
		}
	}
}

/* Presupuesto en la home: llamada a la página de la calculadora */
.budget-teaser-actions {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 10px;
}

.visit-button.is-ghost {
	background-color: transparent;
	color: var(--black);
	box-shadow: inset 0 0 0 1px var(--black);

	svg path {
		fill: var(--black);
	}
}

/* Página Sobre mí */
.about-portrait {
	padding: 0 10px;
}

/* PÁGINA 404 */
.not-found {
	display: flex;
	flex-direction: column;
	justify-content: center;
	align-items: center;
	gap: 30px;
	min-height: 100svh;
	padding: 125px 10px 10svh;
	box-sizing: border-box;
	text-align: center;
	color: var(--white);

	/* Móvil: el hueco del header pasa abajo */
	@media (max-width:950px) {
		& {
			padding: 10svh 10px calc(10svh + var(--header-h, 0px));
		}
	}

	.nf-digits,
	h1,
	.nf-home {
		mix-blend-mode: difference;
	}

	.nf-digits {
		display: flex;
		justify-content: center;
		align-items: center;
		margin-bottom: 10px;
		font-family: 'Albert', 'Albert Fallback', sans-serif;
		font-weight: 700;
		font-size: clamp(120px, 26vw, 420px);
		line-height: .8;
		letter-spacing: 0;
		user-select: none;
	}

	h1 {
		font-size: clamp(36px, 5vw, 120px);
		text-transform: uppercase;
		text-wrap: balance;
		max-width: 16ch;
	}

	.nf-digit {
		display: inline-block;
		will-change: transform;
	}

	.nf-zero {
		position: relative;
		width: .72em;
		height: .8em;
		margin: 0 -.02em;
	}

	.nf-blob {
		position: absolute;
		inset: 4% 2%;
		border-radius: 50%;
		background-color: var(--white);
		border: clamp(8px, 1vw, 16px) solid #601010;
		filter: blur(clamp(10px, 1.6vw, 26px));
		animation: nfWobble 9s var(--cubic-bezier) infinite, nfDrift 14s var(--cubic-bezier) infinite;
	}

	.nf-home {
		padding: 3px 4px;
		background-color: var(--white);
		color: var(--black);
		text-transform: uppercase;
		font-size: clamp(18px, 3vw, 30px);
		font-weight: 700;
		line-height: .9;

		@media (min-width:950px) {
			&:hover {
				font-style: italic;
			}
		}
	}

	@media (prefers-reduced-motion: reduce) {
		.nf-blob {
			animation: none;
		}
	}
}

@keyframes nfWobble {
	0%, 100% { border-radius: 50% 50% 50% 50% / 50% 50% 50% 50%; }
	25% { border-radius: 58% 42% 55% 45% / 45% 58% 42% 55%; }
	50% { border-radius: 42% 58% 45% 55% / 55% 42% 58% 45%; }
	75% { border-radius: 55% 45% 42% 58% / 42% 55% 45% 58%; }
}

@keyframes nfDrift {
	0%, 100% { transform: translate3d(0, 0, 0) scale(1); }
	20% { transform: translate3d(6%, -8%, 0) scale(1.05); }
	40% { transform: translate3d(-5%, 4%, 0) scale(.95); }
	60% { transform: translate3d(4%, 7%, 0) scale(1.08); }
	80% { transform: translate3d(-7%, -3%, 0) scale(.97); }
}
