/*=====
Theme Name: Pedro Gris
Author: Pedro Gris
Author URI: https://pedrogris.es
Description: A custom WordPress theme developed with ♥ by Pedro Gris. All rights reserved. This theme is not intended for redistribution, modification, or resale.
Version: 1.1.1
Requires at least: 5.0
Tested up to: 6.6.1
Requires PHP: 7.0
License: Proprietary - All Rights Reserved
License URI: https://pedrogris.es/license
Text Domain: pedro-gris
Tags: custom, modern, responsive, SEO-friendly, accessible
=======*/



/* 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: #808080;
	--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);
}

.dark-mode {
	--sel-fg: var(--black);
	--sel-bg: var(--white);
}

/* 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, .archive:has(#ar-view-lista:checked) .ar-item:has(.ar-link:hover)) {
	--sel-fg: var(--black);
	--sel-bg: var(--white);
}

.dark-mode :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, .archive:has(#ar-view-lista:checked) .ar-item:has(.ar-link:hover)) {
	--sel-fg: var(--white);
	--sel-bg: var(--black);
}

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

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

/* Textos con mix-blend-mode: difference, iguales en ambos modos */
:is(header, .banner .headline, .banner .main-content, .not-found) {
	--sel-fg: var(--black);
	--sel-bg: var(--white);
}

:is(header .menu a:last-of-type, .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, width .3s ease-out, height .3s ease-out;
}

.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: 250px;
	height: 250px;
	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: 150px;
		height: 150px;
	}
}

/* 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;

	.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;
				}
			}
		}
	}

	.theme-toggle {
		grid-column: 13;
		justify-self: end;
		width: 25px;
		height: 25px;
		background-color: var(--white);
		border: none;
		border-radius: 50%;
		cursor: pointer;
	}

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

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

		.menu {
			grid-column: 4 / 6;
			display: flex;
			flex-direction: column;
			align-items: flex-end;
			gap: 0;

			a {
				font-size: 14px;
				display: none;

				&:last-of-type {
					display: block;
					padding: 3px;
					/* margin-top: 3px; */
				}
			}
		}

		.theme-toggle {
			grid-column: 6;
		}
	}
}

/* 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;
	}
}

.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;

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

	.headline {
		color: var(--white);
		mix-blend-mode: difference;
		z-index: 1;

		p {
			max-width: 30ch;
		}
	}

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

		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: var(--white);
			mix-blend-mode: difference;
			z-index: 2;

			.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 de fondo renderizadas en canvas (ver assets/js/banner-background.js) */
	.background {
		position: absolute;
		top: 0;
		left: 0;
		width: 100%;
		height: 100%;
		overflow: hidden;

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

	@media (max-width:950px) {
		& {
			flex-direction: column;
            justify-content: flex-end;
            align-items: flex-start;
			gap: 10svh;

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

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

			.main-content {
				flex-direction: column;
				gap: 30svh;
				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);
			}
		}
	}

	@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);
			gap: var(--gap-small);
			
			.project {
				.video-container {
					grid-column: 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;

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

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

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

.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(--gray);
			padding: 5px 0;
			width: 100%;
			position: relative;
			color: inherit;
			transition: border .3s;

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

			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(--black);
				pointer-events: none;
				z-index: -1;
				opacity: 0;
				transition: opacity .1s;
			}

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

					&: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(14px, 2vw, 18px);
			text-transform: uppercase;
		} */
	}

	img {
		width: 100%;
        height: auto;
		min-height: 800px;
		max-height: 1200px;
        object-fit: cover;
	}

	@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;
				}
			}
		}
	}

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

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

	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;
			display: flex;
			justify-content: center;
			text-transform: uppercase;
			font-family: 'Albert', 'Albert Fallback', sans-serif;
			text-align: center;

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

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

	.legal {
		display: flex;
		flex-direction: row;
		align-items: center;
		justify-content: space-between;

		.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) {
			& {
				flex-direction: column;
			}
		}
	}
}

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

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

	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;
}

.notification {
	position: fixed;
	left: 50%;
	bottom: 50%;
	transform: translateX(-50%);
	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;
	transform-origin: center center !important;
	animation: notificationIn .3s var(--cubic-bezier);

	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;
    }
}

@keyframes notificationIn {
	from {
		transform: translateX(-50%) scale(0.7);
		filter: blur(10px);
		opacity: 0;
	}
	to {
		transform: translateX(-50%) scale(1);
		filter: blur(0);
		opacity: 1;
	}
}

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

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

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

.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: 100svh;
					max-height: 500px;
					min-height: 220px;
					pointer-events: none;
				}

				h2 {
					font-size: 18px;
				}

				.section {
					min-height: auto;
					padding: 250px 0;
				}
			}
		}
	}
}

.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: var(--padding-section);

	/* 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;

		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;
		}

		.budget-card-price {
			margin-top: auto;
			text-transform: uppercase;
		}

		&: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 auto;
		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;
		}

		.budget-row-price {
			white-space: nowrap;
			font-variant-numeric: tabular-nums;
		}

		&: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-meta {
		display: flex;
		flex-wrap: wrap;
		justify-content: space-between;
		gap: 10px;
	}

	.budget-lines {
		list-style: none;
		text-transform: uppercase;

		li {
			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);
			}

			span:last-child {
				white-space: nowrap;
				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) {
		& {
			.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;
			}

			.budget-bar {
				position: sticky;
				bottom: 0;
				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);

				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(110%);
				}
			}
		}
	}

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

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

.dark-mode {
	background-color: var(--black);
	color: var(--white);

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

	.notification {
		background-color: var(--white);
		color: var(--black);

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

	.projects .post {
		&:after {
			background-color: var(--white);
		}

		@media (min-width:950px) {
			&:hover {
				color: var(--black);
			}
		}

		img {
			filter: saturate(0) invert(1);
		}
	}

	.visit-button {
		background-color: var(--white);
		color: var(--black);

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

/* 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;
	}

	.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;
		}
	}

	@media (max-width:950px) {
		& {
			.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;
			}
		}
	}
}

.dark-mode .case {
	--fg: var(--white);
	--bg: var(--black);
}

/* 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;

	[hidden] {
		display: none !important;
	}

	a {
		color: inherit;
	}

	img {
		display: block;
	}
}

.dark-mode .archive {
	--fg: var(--white);
	--bg: var(--black);
}

/* 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: vista a la izquierda, recuento a la derecha */
.ar-panel {
	display: flex;
	justify-content: space-between;
	align-items: baseline;
	flex-wrap: wrap;
	gap: 10px;
	padding: 20px 0 var(--gap-medium);
	font-size: clamp(14px, 1.1vw, 18px);
	line-height: 1.15;
	text-transform: uppercase;

	p {
		font-size: inherit;
	}

	.ar-views {
		display: flex;
		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-bottom: 10px;
	border-bottom: 1px solid var(--line);

	.ar-year {
		font-family: 'Albert', 'Albert Fallback', sans-serif;
		font-size: clamp(32px, 4vw, 72px);
		line-height: 0.8;
		letter-spacing: 0;
	}

}

/* Fichas: filas completas, puntos de registro en las esquinas */
.ar-grid {
	display: grid;
	grid-template-columns: repeat(12, 1fr);
	gap: 10px;
	padding: 20px 0 var(--gap-medium);
	list-style: none;
}

.ar-item {
	--span: 6;
	grid-column: span var(--span);
	position: relative;
	display: flex;
	flex-direction: column;
	padding-bottom: 30px;

	&[data-span="4"] { --span: 4; }
	&[data-span="3"] { --span: 3; }

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

.ar-media {
	display: flex;
	flex-direction: column;

	img,
	.ar-empty {
		width: 100%;
		height: auto;
		aspect-ratio: 3 / 2;
		object-fit: cover;
		background-color: var(--gray);
		filter: saturate(0);
		transition: filter .4s var(--cubic-bezier);
	}

	.ar-empty {
		--x: transparent calc(50% - .5px), var(--gray) calc(50% - .5px), var(--gray) calc(50% + .5px), transparent calc(50% + .5px);
		box-sizing: border-box;
		border: 1px solid var(--line);
		background: linear-gradient(to top right, var(--x)), linear-gradient(to bottom right, var(--x));
	}
}

.ar-item:is([data-span="4"], [data-span="3"]) :is(img, .ar-empty) {
	aspect-ratio: 4 / 5;
}

.ar-name {
	display: flex;
	align-items: baseline;
	gap: 8px;
	padding: 10px 0 6px;
	font-size: clamp(16px, 1.4vw, 22px);
	font-variation-settings: 'wght' 600;
	line-height: 1;
	text-transform: uppercase;

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

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

/* Tabla técnica: etiqueta / valor */
.ar-spec {
	font-size: 12px;
	text-transform: uppercase;

	div {
		display: grid;
		grid-template-columns: 1fr auto 1fr;
		gap: 10px;
		padding: 3px 0;
		border-bottom: 1px solid var(--line);

		&::before {
			content: "/";
			order: 1;
			color: var(--gray);
		}
	}

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

	dd {
		order: 2;
		text-align: right;
		font-variant-numeric: tabular-nums;
	}
}

.ar-go {
	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) {
	.ar-item:has(.ar-link:hover) {
		img {
			filter: none;
		}

		.ar-name {
			font-style: italic;
		}

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

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

@media (max-width:950px) {
	.ar-grid {
		grid-template-columns: repeat(2, 1fr);
	}

	.ar-item {
		grid-column: span 2;

		&[data-span="4"],
		&[data-span="3"] {
			grid-column: span 1;
		}
	}
}

@media (max-width:550px) {
	.ar-item[data-span] {
		grid-column: 1 / -1;
	}
}

/* Vista lista: tabla compacta con filas alternas */
.ar-cols {
	display: none;
}

.archive:has(#ar-view-lista:checked) {
	.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-group-head {
		padding: 16px 0 4px;

		.ar-year {
			font-size: clamp(20px, 2vw, 30px);
		}
	}

	.ar-grid {
		display: block;
		padding: 0 0 var(--gap-small);
	}

	.ar-item {
		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);
		}
	}

	.ar-media {
		display: contents;
	}

	.ar-media img,
	.ar-empty {
		display: none;
	}

	.ar-name {
		grid-column: 1;
		padding: 0;
		font-size: clamp(14px, 1.2vw, 18px);
		border: 0;
	}

	.ar-spec,
	.ar-spec div {
		display: contents;
	}

	.ar-spec {
		font-size: inherit;
	}

	.ar-spec div::before,
	.ar-spec dt {
		display: none;
	}

	.ar-spec dd {
		text-align: left;
	}

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

	.ar-spec .is-go {
		display: none;
	}

	/* 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%;
				left: 50%;
				z-index: 2;
				width: clamp(160px, 16vw, 280px);
				aspect-ratio: 4 / 3;
				transform: translateY(-50%);
				filter: none;
				pointer-events: none;
			}
		}
	}

	@media (max-width:950px) {
		--list-cols: minmax(0, 1fr) 5ch;

		.ar-cols > :nth-child(2),
		.ar-spec .is-type {
			display: none;
		}

		.ar-cols > :nth-child(3),
		.is-year dd {
			grid-column: 2;
			text-align: right;
		}
	}
}
