/* ==========================================================================
   Caveman's Projects: la cueva
   Pared de roca iluminada por antorchas. Las opciones son pinturas rupestres
   hechas con los pigmentos de siempre: almagre, ocre, caolín y carbón.
   ========================================================================== */

:root {
	--roca: #2E231C;
	--roca-osc: #1C1410;
	--roca-luz: #4A382C;
	--caolin: #EFE3CC;
	--arena: #CDBDA5;
	--almagre: #C4552F;
	--almagre-osc: #A63C22;
	--ocre: #D9A441;
	--brillo: #9CF0CC;
	--antorcha: 255, 154, 61;
	--tinta: #221A16;
	--linea: rgba(239, 227, 204, .14);
	--linea-2: rgba(239, 227, 204, .32);

	--f-display: "Bowlby One", "Arial Black", Impact, sans-serif;
	--f-text: "Hanken Grotesk", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
	--f-screen: "VT323", ui-monospace, monospace;

	--wrap: 1240px;
	--gutter: clamp(16px, 4vw, 40px);
	--pared: url("../img/cave-wall.webp");

	/* Alias de la versión anterior del tema */
	--hueso: var(--caolin);
	--lava: var(--almagre);
	--basalto: var(--roca);
	--toba: var(--roca-osc);
}

/* ---------- Base ---------- */

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

html {
	-webkit-text-size-adjust: 100%;
	scroll-behavior: smooth;
	scroll-padding-top: 104px;
	overflow-x: clip;
}

body {
	margin: 0;
	background-color: var(--roca);
	background-image: var(--pared);
	background-size: 768px;
	color: var(--caolin);
	font-family: var(--f-text);
	font-size: 1.0625rem;
	line-height: 1.6;
	-webkit-font-smoothing: antialiased;
	overflow-x: clip;
}
@media (min-width: 900px) {
	body { font-size: 1.125rem; }
}

/* Luz de antorchas sobre la pared: queda detrás del contenido, que se lee siempre limpio. */
body::before,
body::after {
	content: "";
	position: fixed;
	inset: 0;
	z-index: -1;
	pointer-events: none;
}
body::before {
	background:
		radial-gradient(ellipse 120% 90% at 50% 45%, transparent 50%, rgba(8, 5, 3, .62) 100%),
		rgba(10, 6, 4, .18);
}
body::after {
	background:
		radial-gradient(ellipse 45% 55% at 0% 8%, rgba(var(--antorcha), .2), transparent 70%),
		radial-gradient(ellipse 40% 50% at 100% 60%, rgba(var(--antorcha), .1), transparent 70%);
	animation: llama 5.2s ease-in-out infinite;
}
@keyframes llama {
	0%, 100% { opacity: .85; }
	12% { opacity: 1; }
	20% { opacity: .78; }
	34% { opacity: .95; }
	47% { opacity: .82; }
	61% { opacity: 1; }
	74% { opacity: .88; }
	86% { opacity: .97; }
}

/* Antorcha que sigue al ratón (solo con ratón; la crea main.js). */
.torch {
	position: fixed;
	inset: 0;
	z-index: -1;
	pointer-events: none;
	background: radial-gradient(circle 340px at var(--mx, -999px) var(--my, -999px), rgba(var(--antorcha), .16), rgba(var(--antorcha), .05) 45%, transparent 70%);
}

img, video, iframe, svg { max-width: 100%; }
img { height: auto; }
a { color: inherit; }
::selection { background: var(--ocre); color: var(--tinta); }

:focus-visible {
	outline: 3px solid var(--brillo);
	outline-offset: 3px;
	border-radius: 4px;
}

h1, h2, h3, h4 { text-wrap: balance; }
p { text-wrap: pretty; }

.wrap {
	width: 100%;
	max-width: calc(var(--wrap) + var(--gutter) * 2);
	margin-inline: auto;
	padding-inline: var(--gutter);
}

.screen-reader-text {
	position: absolute !important;
	width: 1px; height: 1px;
	padding: 0; margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

.skip-link {
	position: absolute;
	left: -9999px;
	top: 12px;
	z-index: 100;
	padding: 12px 18px;
	background: var(--caolin);
	color: var(--tinta);
	font-weight: 700;
}
.skip-link:focus { left: 12px; }

/* Iconos de interfaz (lanza, menú, cerrar): el color sale del pigmento (currentColor). */
.picto { display: inline-block; flex: none; height: 1em; width: auto; overflow: visible; }

/* Pinturas rupestres: PNG transparentes, solo pigmento sobre la pared.
   En reposo están en penumbra; al pasar o al elegirlas, la antorcha las alumbra. */
.pintura {
	display: block;
	flex: none;
	max-width: none;
	height: auto;
	filter: brightness(.92) saturate(.95);
	transition: filter .3s ease, transform .3s ease;
	pointer-events: none;
	-webkit-user-select: none;
	user-select: none;
}

/* Titulares pintados con pigmento seco sobre la roca. */
@supports ((-webkit-background-clip: text) or (background-clip: text)) {
	.hero__title,
	.section__title,
	.page-title,
	.work-title,
	.service__name,
	.work-cta__title,
	.brand__name {
		background: url("../img/pigmento.webp") 0 0 / 192px;
		-webkit-background-clip: text;
		background-clip: text;
		color: transparent;
	}
	.service__name a { color: inherit; }
}

/* ---------- Botones pintados ---------- */

.btn {
	display: inline-flex;
	align-items: center;
	gap: .55em;
	padding: 1em 1.7em;
	border: 0;
	background: transparent center / 100% 100% no-repeat;
	color: var(--caolin);
	font: 700 1rem/1.1 var(--f-text);
	text-decoration: none;
	cursor: pointer;
}
.btn:active { transform: translateY(1px) rotate(-.4deg); }
.btn--lava { background-image: url("../img/boton-almagre.svg"); }
.btn--lava:hover { background-image: url("../img/boton-almagre-hover.svg"); }
.btn--line { background-image: url("../img/boton-linea.svg"); }
.btn--line:hover { background-image: url("../img/boton-linea-hover.svg"); }
.btn .picto { height: .8em; }

/* ---------- Cabecera: el techo de la cueva ---------- */

.site-header {
	position: sticky;
	top: env(safe-area-inset-top, 0px);
	z-index: 50;
	background: linear-gradient(rgba(16, 11, 8, .82), rgba(16, 11, 8, .82)), var(--pared) 0 0 / 768px;
}
.admin-bar .site-header { top: 32px; }
@media (max-width: 782px) { .admin-bar .site-header { top: 0; } }

/* Estalactitas colgando del borde inferior */
.site-header::after {
	content: "";
	position: absolute;
	left: 0;
	right: 0;
	top: 100%;
	height: 22px;
	background: inherit;
	-webkit-mask: url("../img/estalactitas.svg") 0 0 / 600px 100% repeat-x;
	mask: url("../img/estalactitas.svg") 0 0 / 600px 100% repeat-x;
	pointer-events: none;
}

.site-header__in {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	min-height: 78px;
}

.brand {
	display: inline-flex;
	align-items: center;
	gap: 12px;
	color: var(--caolin);
	text-decoration: none;
}
.brand__logo { display: block; width: 52px; height: auto; }
.brand__name {
	font-family: var(--f-display);
	font-size: 1.125rem;
	line-height: 1.1;
	letter-spacing: .005em;
}

/* Menú: cada opción es una pintura rupestre con su nombre */
.nav__list {
	display: flex;
	align-items: center;
	gap: clamp(14px, 2.4vw, 34px);
	margin: 0;
	padding: 0;
	list-style: none;
}
.nav__list a {
	display: flex;
	align-items: center;
	gap: 4px;
	padding: 0 2px;
	color: var(--caolin);
	text-decoration: none;
}
.nav__pintura { width: 104px; margin: -8px -8px -8px -16px; }
.nav__label {
	padding-bottom: 7px;
	background: url("../img/trazo.svg") 0 100% / 0 7px no-repeat;
	font-family: var(--f-display);
	font-size: 1rem;
	letter-spacing: .01em;
	transition: background-size .25s ease;
}
.nav__list a:hover .nav__pintura,
.nav__list a:focus-visible .nav__pintura,
.nav__list .current-menu-item > a .nav__pintura,
.nav__list a[aria-current="page"] .nav__pintura { filter: brightness(1.3) saturate(1.08) drop-shadow(0 0 10px rgba(var(--antorcha), .45)); }
.nav__list a:hover .nav__label,
.nav__list .current-menu-item > a .nav__label,
.nav__list a[aria-current="page"] .nav__label { background-size: 100% 7px; }

.nav-toggle {
	display: none;
	width: 52px;
	height: 52px;
	margin-right: -8px;
	padding: 6px;
	border: 0;
	background: none;
	color: var(--caolin);
	cursor: pointer;
}
.nav-toggle .picto { height: 36px; }
.nav-toggle__close { display: none !important; }
.nav-toggle[aria-expanded="true"] .nav-toggle__open { display: none !important; }
.nav-toggle[aria-expanded="true"] .nav-toggle__close { display: inline-block !important; color: var(--almagre); }

@media (max-width: 860px) {
	.nav-toggle { display: block; }
	.nav {
		position: fixed;
		inset: calc(78px + env(safe-area-inset-top, 0px)) 0 auto 0;
		display: none;
		padding: 30px var(--gutter) 40px;
		background: linear-gradient(rgba(16, 11, 8, .9), rgba(16, 11, 8, .9)), var(--pared) 0 0 / 768px;
		box-shadow: 0 30px 40px rgba(0, 0, 0, .45);
	}
	.admin-bar .nav { top: 124px; }
	.nav.is-open { display: block; }
	.nav__list { flex-direction: column; align-items: stretch; gap: 6px; }
	.nav__list a { gap: 12px; padding: 2px 0; }
	.nav__pintura { width: 132px; margin: -8px 0 -8px -18px; }
	.nav__label { font-size: 1.75rem; }
}

/* ---------- Portada: la cueva con el ordenador de piedra ---------- */

.hero {
	position: relative;
	overflow: clip;
	padding: clamp(40px, 7vw, 100px) 0 clamp(64px, 8vw, 120px);
}

.hero__in {
	position: relative;
	display: grid;
	grid-template-columns: minmax(0, 1fr) minmax(0, 1.12fr);
	gap: clamp(24px, 4vw, 64px);
	align-items: center;
}

.hero__title {
	margin: 0 0 .45em;
	font-family: var(--f-display);
	font-weight: 400;
	font-size: clamp(2.25rem, 4.6vw, 4rem);
	line-height: 1.04;
	letter-spacing: -.012em;
}

.hero__text {
	max-width: 32em;
	margin: 0 0 2em;
	color: var(--arena);
	font-size: clamp(1.0625rem, 1.35vw, 1.25rem);
}

.hero__actions { display: flex; flex-wrap: wrap; gap: 12px; }

.hero__art {
	position: relative;
	isolation: isolate;
	width: 100%;
	max-width: 680px;
	justify-self: end;
	container-type: inline-size;
}
/* El resplandor de la hoguera detrás del cavernícola */
.hero__art::before {
	content: "";
	position: absolute;
	inset: -12% -10% -6%;
	z-index: -1;
	background: radial-gradient(closest-side, rgba(var(--antorcha), .26), rgba(var(--antorcha), .08) 60%, transparent);
	animation: llama 3.6s ease-in-out infinite;
}
.hero__art > img {
	display: block;
	width: 100%;
	filter: drop-shadow(0 28px 36px rgba(0, 0, 0, .5));
}

/* La pantalla del ordenador de piedra: las palabras se escriben solas. */
.screen {
	position: absolute;
	left: 47.6%;
	top: 14%;
	width: 23.4%;
	height: 28.6%;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: .3em;
	padding: 0 2%;
	border: 0;
	border-radius: 14% / 12%;
	background: none;
	color: #0F4A39;
	font-family: var(--f-screen);
	font-size: max(15px, 3.9cqw);
	line-height: 1;
	text-align: center;
	text-shadow: 0 0 .35em rgba(156, 240, 204, .95);
	transform: rotate(.8deg);
	overflow: hidden;
}
.screen::after {
	content: "";
	position: absolute;
	inset: 0;
	pointer-events: none;
	background: repeating-linear-gradient(0deg, rgba(15, 74, 57, .07) 0 1px, transparent 1px 3px);
}
.screen__line { display: inline-block; max-width: 100%; overflow-wrap: anywhere; }
.screen__cursor { animation: blink 1s steps(1) infinite; }
.screen__hint { font-size: .62em; opacity: .85; }
button.screen { cursor: pointer; }
button.screen:hover { background: rgba(156, 240, 204, .22); }
button.screen:focus-visible { outline-offset: 0; }
@keyframes blink { 50% { opacity: 0; } }

@media (max-width: 860px) {
	.hero__in { grid-template-columns: 1fr; }
	.hero__art { order: -1; justify-self: center; max-width: 520px; }
}

/* ---------- Frisos: una pintura a todo el ancho entre secciones, sin texto ---------- */

.cave-break {
	position: relative;
	isolation: isolate;
	padding: clamp(12px, 3vw, 40px) 0;
}
/* La luz de la antorcha sobre la pared donde está pintado el friso */
.cave-break::before {
	content: "";
	position: absolute;
	inset: 0;
	z-index: -1;
	background: radial-gradient(ellipse 60% 62% at 50% 50%, rgba(var(--antorcha), .2), rgba(var(--antorcha), .06) 60%, transparent 78%);
	animation: llama 4.4s ease-in-out infinite;
	pointer-events: none;
}
.cave-break img {
	display: block;
	width: 100%;
	height: auto;
	pointer-events: none;
	-webkit-user-select: none;
	user-select: none;
}
@media (max-width: 700px) {
	/* En el móvil el friso ocupa todo el ancho de la pantalla */
	.cave-break .wrap { padding-inline: 4px; }
}
.cave-break + .section { padding-top: clamp(24px, 4vw, 48px); }
.section:has(+ .cave-break),
.hero:has(+ .cave-break) { padding-bottom: clamp(16px, 3vw, 40px); }
.cave-break + .section::before { display: none; }

/* ---------- Secciones separadas por grietas en la roca ---------- */

.section {
	position: relative;
	overflow-x: clip;
	padding: clamp(64px, 9vw, 120px) 0;
}
.section::before {
	content: "";
	position: absolute;
	left: 0;
	right: 0;
	top: 0;
	height: 14px;
	background: url("../img/grieta.svg") 0 0 / 640px 14px repeat-x;
	pointer-events: none;
}
.section--first { padding-top: clamp(48px, 6vw, 80px); }
.section--first::before { display: none; }

.section__head {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 20px 40px;
	margin-bottom: clamp(28px, 4vw, 48px);
}

.section__title,
.page-title {
	margin: 0;
	font-family: var(--f-display);
	font-weight: 400;
	font-size: clamp(2.25rem, 4.6vw, 3.5rem);
	line-height: 1.04;
	letter-spacing: -.01em;
}
.section__title--solo { margin-bottom: clamp(28px, 4vw, 48px); }

.page-head { margin-bottom: clamp(24px, 3vw, 36px); }
.page-head--picto { display: flex; align-items: center; gap: clamp(16px, 3vw, 32px); }
.page-head__pintura { width: clamp(150px, 20vw, 260px); margin: -16px -10px -16px -24px; filter: brightness(1.15) drop-shadow(0 0 14px rgba(var(--antorcha), .3)); }
.page-head__text { min-width: 0; }
.page-lead { max-width: 40em; margin-top: 12px; color: var(--arena); font-size: 1.1875rem; }
.page-lead p { margin: 0; }
.page-date { margin: 0 0 8px; color: var(--ocre); font-weight: 650; }

/* ---------- Filtros: pinturas por disciplina ---------- */

.filters {
	display: flex;
	flex-wrap: wrap;
	gap: 6px 8px;
	margin: 0;
	padding: 0;
	list-style: none;
}
.page-head + .filters { margin-bottom: clamp(28px, 4vw, 44px); }

.chip {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 0;
	width: 128px;
	color: var(--arena);
	font-size: .9375rem;
	font-weight: 650;
	line-height: 1.2;
	text-align: center;
	text-decoration: none;
	cursor: pointer;
}
.chip__pintura { width: 150px; margin: -10px -11px -8px; filter: brightness(.86) saturate(.92); }
.chip__label { padding-bottom: 6px; background: url("../img/trazo.svg") 50% 100% / 0 6px no-repeat; transition: background-size .25s ease; }
.chip:hover { color: var(--caolin); }
.chip:hover .chip__pintura,
.chip:focus-visible .chip__pintura { filter: brightness(1.08) saturate(1); }
.chip[aria-current="page"],
.chip[aria-pressed="true"] { color: var(--caolin); }
.chip[aria-current="page"] .chip__pintura,
.chip[aria-pressed="true"] .chip__pintura { filter: brightness(1.3) saturate(1.08) drop-shadow(0 0 12px rgba(var(--antorcha), .45)); }
.chip[aria-current="page"] .chip__label,
.chip[aria-pressed="true"] .chip__label { background-size: 100% 6px; }
.filters { gap: 4px 6px; }

@media (max-width: 600px) {
	.filters { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); width: 100%; }
	.chip { width: auto; font-size: .875rem; }
	.chip__pintura { width: calc(100% + 16px); margin: -6px -8px -4px; }
}

/* ---------- Trabajos: pinturas sobre lajas de piedra ---------- */

.works-grid {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	grid-auto-flow: dense;
	gap: clamp(32px, 4vw, 52px) clamp(16px, 2.2vw, 28px);
}

.card { display: flex; flex-direction: column; min-width: 0; }
.card[hidden] { display: none; }

.card__link {
	display: flex;
	flex-direction: column;
	color: var(--caolin);
	text-decoration: none;
}

.card__media {
	position: relative;
	display: block;
	aspect-ratio: 16 / 10;
	overflow: hidden;
	background: var(--roca-osc);
	-webkit-mask: url("../img/roca-1.svg") 0 0 / 100% 100% no-repeat;
	mask: url("../img/roca-1.svg") 0 0 / 100% 100% no-repeat;
}
.card:nth-child(3n + 2) .card__media { -webkit-mask-image: url("../img/roca-2.svg"); mask-image: url("../img/roca-2.svg"); }
.card:nth-child(3n + 3) .card__media { -webkit-mask-image: url("../img/roca-3.svg"); mask-image: url("../img/roca-3.svg"); }
.card__media img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: filter .25s ease;
}
.card__link:hover .card__media img { filter: brightness(1.12) sepia(.1); }

.card__ph {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: flex-end;
	padding: 16px 18px;
	background: linear-gradient(rgba(0, 0, 0, .25), rgba(0, 0, 0, .25)), var(--pared) 0 0 / 512px;
	color: var(--arena);
	font-family: var(--f-display);
	font-size: 1rem;
	line-height: 1.1;
}

.card__play {
	position: absolute;
	left: 14px;
	bottom: 14px;
	width: 46px;
	height: 46px;
	background: url("../img/punto-almagre.svg") center / contain no-repeat;
}
.card__play::after {
	content: "";
	position: absolute;
	left: 18px;
	top: 14px;
	border-style: solid;
	border-width: 9px 0 9px 14px;
	border-color: transparent transparent transparent var(--caolin);
}

.card__title {
	margin: 14px 0 6px;
	font-family: var(--f-display);
	font-weight: 400;
	font-size: 1.375rem;
	line-height: 1.1;
}
.card__link:hover .card__title {
	text-decoration: underline;
	text-decoration-color: var(--ocre);
	text-decoration-thickness: 3px;
	text-underline-offset: 5px;
}

.card__meta {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 4px 14px;
	margin: 0;
	color: var(--arena);
	font-size: .9375rem;
}
.card__disc { color: var(--ocre); font-weight: 650; }

/* Trabajo destacado: el doble de grande. */
.card--wide { grid-column: span 2; grid-row: span 2; }
.card--wide .card__link { flex: 1; }
.card--wide .card__media { flex: 1; aspect-ratio: auto; min-height: 280px; }
.card--wide .card__title { font-size: clamp(1.75rem, 2.6vw, 2.25rem); }
.card--wide .card__play { width: 68px; height: 68px; left: 20px; bottom: 20px; }
.card--wide .card__play::after { left: 27px; top: 21px; border-width: 13px 0 13px 20px; }

@media (max-width: 1024px) {
	.works-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.card--wide { grid-row: span 1; }
	.card--wide .card__link { flex: none; }
	.card--wide .card__media { flex: none; aspect-ratio: 16 / 9; min-height: 0; }
}
@media (max-width: 600px) {
	.works-grid { grid-template-columns: 1fr; }
	.card--wide { grid-column: auto; }
	.card--wide .card__media { aspect-ratio: 16 / 10; }
	.card--wide .card__title { font-size: 1.625rem; }
}

.works-empty { color: var(--arena); }
.works-more { margin: clamp(36px, 5vw, 56px) 0 0; }

.empty-state {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 16px 28px;
	padding: 28px;
	border: 2px dashed var(--linea-2);
	color: var(--arena);
}
.empty-state p { margin: 0; max-width: 46em; }

/* ---------- Qué hacemos: un panel pintado por disciplina ---------- */

.services { margin: 0; padding: 0; list-style: none; }

.service {
	display: grid;
	grid-template-columns: clamp(200px, 22vw, 280px) minmax(0, 1fr) minmax(0, 1.25fr);
	gap: 10px clamp(20px, 4vw, 56px);
	align-items: center;
	padding: 8px 0;
	background: url("../img/grieta.svg") 0 100% / 640px 12px repeat-x;
}
.service__pintura { width: calc(100% + 30px); margin: -10px -10px -10px -20px; filter: brightness(.95) saturate(.96); }
.service:hover .service__pintura { filter: brightness(1.25) saturate(1.06) drop-shadow(0 0 12px rgba(var(--antorcha), .4)); }
.service__name {
	margin: 0;
	font-family: var(--f-display);
	font-weight: 400;
	font-size: clamp(1.75rem, 3.4vw, 2.625rem);
	line-height: 1.05;
}
.service__name a { text-decoration: none; }
.service__name a:hover {
	text-decoration: underline;
	text-decoration-color: var(--ocre);
	text-decoration-thickness: .08em;
	text-underline-offset: .12em;
}
.service__desc { max-width: 34em; margin: 0; color: var(--arena); }
.service__count {
	display: inline-block;
	margin-top: 10px;
	color: var(--ocre);
	font-weight: 650;
	text-underline-offset: 4px;
}

@media (max-width: 760px) {
	.service { grid-template-columns: minmax(0, 1fr); gap: 6px; padding: 10px 0 26px; }
	.service__pintura { width: min(250px, 72vw); margin: -6px 0 -14px -22px; }
}

/* ---------- El estudio ---------- */

.about__in {
	display: grid;
	grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
	gap: clamp(32px, 6vw, 96px);
	align-items: center;
}
.about__text { max-width: 34em; font-size: 1.1875rem; }
.about__text p { margin: 0 0 1em; }
.about__text a { text-decoration-color: var(--ocre); text-underline-offset: 3px; }
.about__subtitle { margin: 2em 0 .75em; color: var(--arena); font-size: 1rem; font-weight: 650; }
.clients { display: flex; flex-wrap: wrap; gap: 8px 28px; margin: 0; padding: 0; list-style: none; font-weight: 650; }
.about__art { position: relative; isolation: isolate; }
.about__art::before {
	content: "";
	position: absolute;
	inset: -8%;
	z-index: -1;
	background: radial-gradient(closest-side, rgba(var(--antorcha), .2), transparent);
}
.about__art img { display: block; width: 100%; max-width: 440px; margin-inline: auto; }

@media (max-width: 800px) {
	.about__in { grid-template-columns: 1fr; }
	.about__art { order: -1; }
	.about__art img { max-width: 260px; margin: 0; }
}

/* ---------- Contacto: la pared de las manos ---------- */

.contact {
	overflow: clip;
	background: linear-gradient(rgba(14, 9, 7, .4), rgba(14, 9, 7, .55));
	box-shadow: inset 0 40px 60px -30px rgba(0, 0, 0, .55);
}
.contact__in {
	position: relative;
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	gap: 40px clamp(32px, 6vw, 96px);
}
.contact__copy { max-width: 40em; }
.contact__in:has(.contact__form) { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.contact__text { max-width: 34em; margin: 20px 0 28px; color: var(--arena); font-size: 1.1875rem; }

.contact__mail {
	display: inline-block;
	max-width: 100%;
	color: var(--caolin);
	font-family: var(--f-display);
	font-size: clamp(1.5rem, 4.6vw, 3.25rem);
	line-height: 1.1;
	overflow-wrap: anywhere;
	text-decoration: underline;
	text-decoration-color: var(--almagre);
	text-decoration-thickness: .07em;
	text-underline-offset: .16em;
}
.contact__mail:hover { color: var(--ocre); }

.contact__phone { display: flex; flex-wrap: wrap; gap: 8px 24px; margin: 24px 0 0; font-weight: 650; }
.contact__phone a { text-underline-offset: 4px; text-decoration-color: var(--ocre); }

.social { display: flex; flex-wrap: wrap; gap: 10px 24px; margin: 28px 0 0; padding: 0; list-style: none; }
.social a { font-weight: 650; text-underline-offset: 4px; text-decoration-color: var(--ocre); }
.social a:hover { color: var(--ocre); }

.admin-hint {
	margin: 0;
	padding: 14px 18px;
	border-left: 4px solid var(--ocre);
	background: rgba(217, 164, 65, .12);
	color: var(--caolin);
	font-size: .9375rem;
}

@media (max-width: 760px) {
}

/* Formularios de plugins (Contact Form 7, WPForms…) */
.contact__form label { display: block; margin-bottom: 6px; font-weight: 650; }
.contact__form input:not([type="submit"]):not([type="checkbox"]):not([type="radio"]),
.contact__form textarea,
.contact__form select {
	width: 100%;
	padding: 12px 14px;
	border: 1.5px solid var(--linea-2);
	border-radius: 4px;
	background: rgba(14, 9, 7, .6);
	color: var(--caolin);
	font: inherit;
}
.contact__form input:focus,
.contact__form textarea:focus { border-color: var(--brillo); outline: none; }
.contact__form input[type="submit"],
.contact__form button[type="submit"] {
	padding: 1em 1.7em;
	border: 0;
	background: url("../img/boton-almagre.svg") center / 100% 100% no-repeat;
	color: var(--caolin);
	font: 700 1rem/1.1 var(--f-text);
	cursor: pointer;
}

@media (max-width: 860px) {
	.contact__in:has(.contact__form) { grid-template-columns: 1fr; }
}

/* ---------- Pie: el suelo de la cueva ---------- */

.site-footer {
	position: relative;
	margin-top: 22px;
	padding: 34px 0 44px;
	background: linear-gradient(rgba(16, 11, 8, .82), rgba(16, 11, 8, .82)), var(--pared) 0 0 / 768px;
	color: var(--arena);
	font-size: .9375rem;
}
.site-footer::before {
	content: "";
	position: absolute;
	left: 0;
	right: 0;
	bottom: 100%;
	height: 22px;
	background: inherit;
	-webkit-mask: url("../img/suelo.svg") 0 0 / 600px 100% repeat-x;
	mask: url("../img/suelo.svg") 0 0 / 600px 100% repeat-x;
}
.site-footer__in { display: flex; flex-wrap: wrap; align-items: center; gap: 16px 28px; }
.site-footer__text { margin: 0; flex: 1 1 260px; }
.brand--small .brand__logo { width: 40px; }
.footer-nav__list { display: flex; flex-wrap: wrap; gap: 8px 20px; margin: 0; padding: 0; list-style: none; }
.footer-nav__list a, .social--footer a { color: var(--arena); }
.social--footer { margin: 0; }

/* ---------- Ficha de trabajo ---------- */

.work-head { padding-top: clamp(36px, 4vw, 56px); padding-bottom: clamp(24px, 3vw, 36px); }

.back {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	color: var(--arena);
	font-weight: 650;
	text-decoration: none;
}
.back:hover { color: var(--caolin); }
.icon-back { height: 13px; color: var(--ocre); transform: scaleX(-1); }
.icon-external { height: 11px; transform: rotate(-35deg); }

.work-title {
	margin: .35em 0 0;
	font-family: var(--f-display);
	font-weight: 400;
	font-size: clamp(2.5rem, 6.4vw, 5rem);
	line-height: 1.02;
	letter-spacing: -.015em;
}
.work-lead { max-width: 38em; margin: 20px 0 0; color: var(--arena); font-size: clamp(1.125rem, 1.6vw, 1.375rem); }

.work-media { margin-bottom: clamp(32px, 4vw, 48px); }
.work-cover,
.work-media > .video {
	display: block;
	width: 100%;
	-webkit-mask: url("../img/roca-2.svg") 0 0 / 100% 100% no-repeat;
	mask: url("../img/roca-2.svg") 0 0 / 100% 100% no-repeat;
}

.work-facts {
	display: flex;
	flex-wrap: wrap;
	align-items: flex-start;
	justify-content: space-between;
	gap: 24px 48px;
	margin-bottom: clamp(36px, 5vw, 56px);
}
.facts {
	display: flex;
	flex: 1 1 520px;
	flex-wrap: wrap;
	gap: 20px clamp(28px, 4vw, 56px);
	margin: 0;
}
.facts > div { min-width: 120px; max-width: 22em; }
.facts dt { margin-bottom: 2px; color: var(--arena); font-size: .875rem; font-weight: 650; }
.facts dd { margin: 0; font-weight: 600; }
.facts a { text-decoration-color: var(--ocre); text-underline-offset: 3px; }

.work-nav {
	position: relative;
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 16px;
	margin-top: clamp(48px, 7vw, 96px);
	padding-top: 34px;
	background: url("../img/grieta.svg") 0 0 / 640px 12px repeat-x;
}
.work-nav__item { display: flex; flex-direction: column; gap: 4px; text-decoration: none; }
.work-nav__item--end { grid-column: 2; align-items: flex-end; text-align: right; }
.work-nav__label { color: var(--arena); font-size: .9375rem; font-weight: 650; }
.work-nav__title { font-family: var(--f-display); font-size: clamp(1.25rem, 2.4vw, 1.75rem); line-height: 1.1; }
.work-nav__item:hover .work-nav__title { color: var(--ocre); }

.work-cta {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 16px 32px;
	margin-top: clamp(40px, 6vw, 72px);
	margin-bottom: clamp(56px, 8vw, 104px);
	padding-top: 32px;
	padding-bottom: 32px;
	background:
		url("../img/grieta.svg") 0 0 / 640px 12px repeat-x,
		url("../img/grieta.svg") 0 100% / 640px 12px repeat-x;
}
.work-cta__title { margin: 0; font-family: var(--f-display); font-size: clamp(1.5rem, 3vw, 2.25rem); line-height: 1.05; }

@media (max-width: 600px) {
	.work-nav { grid-template-columns: 1fr; }
	.work-nav__item--end { grid-column: auto; align-items: flex-start; text-align: left; }
}

/* ---------- Vídeo ---------- */

.video {
	position: relative;
	aspect-ratio: 16 / 9;
	overflow: hidden;
	background: #000;
}
.video iframe,
.video video {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	border: 0;
}
.video--oembed { aspect-ratio: auto; background: none; }
.video--oembed iframe { position: static; aspect-ratio: 16 / 9; height: auto; }

.video__btn {
	position: absolute;
	inset: 0;
	display: grid;
	place-items: center;
	width: 100%;
	padding: 0;
	border: 0;
	background: var(--roca-osc);
	color: var(--caolin);
	cursor: pointer;
}
.video__btn img {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: filter .2s ease;
}
.video__btn:hover img { filter: brightness(.85); }
.video__play {
	position: relative;
	display: grid;
	place-items: center;
	width: clamp(68px, 9vw, 96px);
	aspect-ratio: 1;
	padding-left: 5px;
	background: url("../img/punto-almagre.svg") center / contain no-repeat;
	filter: drop-shadow(0 10px 20px rgba(0, 0, 0, .45));
	transition: transform .2s ease;
}
.video__btn:hover .video__play { transform: scale(1.06) rotate(-3deg); }
.video__fallback { position: absolute; inset: auto 0 0 0; padding: 12px; background: var(--roca-osc); }

/* Showreel en ventana */
.reel {
	width: min(1120px, 94vw);
	max-width: none;
	padding: 0;
	border: 0;
	background: transparent;
	overflow: visible;
}
.reel::backdrop { background: rgba(14, 9, 7, .92); }
.reel__close {
	position: absolute;
	right: 0;
	bottom: calc(100% + 10px);
	display: grid;
	place-items: center;
	width: 52px;
	height: 52px;
	border: 0;
	background: url("../img/punto-ocre.svg") center / contain no-repeat;
	color: var(--tinta);
	cursor: pointer;
}
.icon-close { height: 24px; }

/* ---------- Contenido del editor (bloques) ---------- */

.entry-content { max-width: 760px; }
.entry-content > * { margin-top: 0; margin-bottom: 1.25em; }
.entry-content > *:last-child { margin-bottom: 0; }

.entry-content h2 {
	margin-top: 1.6em;
	font-family: var(--f-display);
	font-weight: 400;
	font-size: clamp(1.75rem, 3vw, 2.25rem);
	line-height: 1.08;
}
.entry-content h3 { margin-top: 1.4em; font-size: 1.375rem; line-height: 1.2; }
.entry-content a { text-decoration-color: var(--ocre); text-underline-offset: 3px; }
.entry-content a:hover { color: var(--ocre); }
.entry-content figure { margin-left: 0; margin-right: 0; }
.entry-content figcaption { margin-top: 8px; color: var(--arena); font-size: .875rem; }
.entry-content blockquote {
	margin-left: 0;
	padding-left: 1.2em;
	border-left: 5px solid var(--almagre);
	font-size: 1.25rem;
}
.entry-content hr { height: 12px; border: 0; margin: 2.5em 0; background: url("../img/grieta.svg") 0 0 / 640px 12px repeat-x; }
.entry-content .wp-block-gallery { gap: 12px; }
.entry-content .wp-block-embed iframe { width: 100%; }
.entry-content .wp-block-button__link {
	border-radius: 0;
	padding: 1em 1.7em;
	background: url("../img/boton-almagre.svg") center / 100% 100% no-repeat;
	color: var(--caolin);
	font-weight: 700;
	text-decoration: none;
}

/* El texto va alineado a la izquierda: «ancho» crece hacia la derecha y «completo» ocupa toda la pantalla. */
.entry-content .alignwide {
	width: min(1100px, calc(100vw - var(--gutter) * 2));
	max-width: none;
}
.entry-content .alignfull {
	width: 100vw;
	max-width: none;
	margin-left: calc((min(100vw, var(--wrap) + var(--gutter) * 2) - 100vw) / 2 - var(--gutter));
}

.has-lava-color, .has-almagre-color { color: var(--almagre); }
.has-ocre-color { color: var(--ocre); }
.has-brillo-color { color: var(--brillo); }
.has-hueso-color, .has-caolin-color { color: var(--caolin); }
.has-arena-color { color: var(--arena); }
.has-lava-background-color, .has-almagre-background-color { background-color: var(--almagre-osc); }
.has-ocre-background-color { background-color: var(--ocre); }
.has-toba-background-color, .has-roca-background-color { background-color: var(--roca-osc); }
.has-basalto-background-color { background-color: var(--roca); }

/* ---------- Paginación: puntos de pigmento ---------- */

.pagination { margin-top: clamp(40px, 5vw, 64px); }
.pagination .nav-links { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.page-numbers {
	display: inline-grid;
	place-items: center;
	min-width: 48px;
	height: 48px;
	padding: 0 14px;
	background: url("../img/punto-linea.svg") center / 100% 100% no-repeat;
	color: var(--caolin);
	font-weight: 700;
	text-decoration: none;
}
.page-numbers.current { background-image: url("../img/punto-ocre.svg"); color: var(--tinta); }
.page-numbers.dots { background: none; }
.page-numbers.prev, .page-numbers.next { padding: 0 20px; }

/* ---------- 404 ---------- */

.notfound__in {
	display: grid;
	grid-template-columns: minmax(0, .9fr) minmax(0, 1fr);
	gap: clamp(24px, 5vw, 72px);
	align-items: center;
}
.notfound__art-wrap { position: relative; max-width: 460px; }
.notfound__art { display: block; width: 100%; filter: grayscale(.4) brightness(.75); }
.notfound__hand { position: absolute; left: 36%; top: -2%; width: 52%; transform: rotate(-6deg); filter: brightness(1); }
.notfound .page-lead { margin-bottom: 28px; }
@media (max-width: 760px) {
	.notfound__in { grid-template-columns: 1fr; }
	.notfound__art-wrap { max-width: 300px; }
}

/* ---------- Movimiento reducido ---------- */

@media (prefers-reduced-motion: reduce) {
	html { scroll-behavior: auto; }
	*, *::before, *::after { animation: none !important; transition: none !important; }
	.torch { display: none; }
}

/* ==========================================================================
   Portada: la pared de pinturas
   Al entrar, la cueva está a oscuras y una antorcha descubre la pared.
   La pintura que queda en el centro recibe la luz, tiembla y suelta una nube
   de pigmento soplado (como las manos en negativo) con brasas de la antorcha.
   ========================================================================== */

.home .site-main { position: relative; }

@property --torch {
	syntax: "<percentage>";
	inherits: false;
	initial-value: 0%;
}

/* La entrada: oscuridad y la antorcha que se enciende */
.cave-intro {
	position: fixed;
	inset: 0;
	z-index: 60;
	pointer-events: none;
	background: #0B0705;
	-webkit-mask: radial-gradient(circle at 50% 46%, transparent var(--torch), #000 calc(var(--torch) + 26%));
	mask: radial-gradient(circle at 50% 46%, transparent var(--torch), #000 calc(var(--torch) + 26%));
	animation: antorcha-entra 2.6s cubic-bezier(.3, .1, .25, 1) .3s forwards;
}
@keyframes antorcha-entra {
	0% { --torch: 0%; opacity: 1; }
	12% { --torch: 7%; }
	18% { --torch: 4%; }
	30% { --torch: 16%; }
	38% { --torch: 13%; }
	70% { --torch: 70%; opacity: 1; }
	100% { --torch: 130%; opacity: 0; visibility: hidden; }
}

.gallery {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: clamp(64px, 18vh, 220px);
	/* Arriba y abajo hay pared vacía para que la primera y la última pintura puedan quedar centradas */
	padding: max(48px, calc(50vh - 210px)) var(--gutter) 42vh;
	overflow: hidden;
	overflow: clip;
}

.gallery__item {
	position: relative;
	isolation: isolate;
	display: block;
	width: min(780px, 100%);
	color: inherit;
	text-decoration: none;
	-webkit-tap-highlight-color: transparent;
}
.gallery__item--wide { width: min(1240px, 100%); }
/* El logotipo pintado: un poco más grande que las pinturas sueltas */
.gallery__item--logo { width: min(900px, 100%); }

/* Primero se ve pintado en la roca; cuando la antorcha lo ilumina, la luz se abre
   desde el centro y descubre el logotipo original, nítido. Al alejarse vuelve a ser pintura. */
@property --revela {
	syntax: "<percentage>";
	inherits: false;
	initial-value: -20%;
}
.gallery__item--logo .gallery__art { position: relative; }
.gallery__art .logo-real {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	opacity: 0;
	filter: none;
	-webkit-mask: radial-gradient(circle at 50% 50%, #000 var(--revela), transparent calc(var(--revela) + 16%));
	mask: radial-gradient(circle at 50% 50%, #000 var(--revela), transparent calc(var(--revela) + 16%));
	transition: opacity .7s ease;
}
.gallery__item--logo.is-lit .gallery__art .logo-real {
	opacity: 1;
	filter: drop-shadow(0 18px 30px rgba(0, 0, 0, .45));
	animation: revela 1.7s cubic-bezier(.3, .1, .2, 1) .9s both;
}
@keyframes revela {
	0% { --revela: -20%; }
	18% { --revela: 6%; }
	26% { --revela: 3%; }
	100% { --revela: 72%; }
}
@media (prefers-reduced-motion: reduce) {
	.gallery__item--logo.is-lit .gallery__art .logo-real { -webkit-mask: none; mask: none; }
}

.gallery__art {
	display: block;
	border-radius: 12px;
	transition: transform .9s cubic-bezier(.2, .8, .2, 1);
}
.gallery__art img {
	display: block;
	width: 100%;
	height: auto;
	opacity: .42;
	transition: opacity 1s ease, filter 1s ease;
	-webkit-user-drag: none;
	user-select: none;
}

/* El círculo de luz de la antorcha sobre la roca */
.gallery__glow {
	position: absolute;
	inset: -24% -14%;
	z-index: -1;
	pointer-events: none;
	background: radial-gradient(closest-side, rgba(var(--antorcha), .32), rgba(var(--antorcha), .12) 52%, transparent 100%);
	opacity: 0;
	transform: scale(.82);
	transition: opacity 1s ease, transform 1.3s ease;
}

.gallery__item:hover .gallery__art img { opacity: .7; }
.gallery__item:focus-visible { outline: none; }
.gallery__item:focus-visible .gallery__art { outline: 3px solid var(--brillo); outline-offset: 12px; }

/* La pintura centrada: luz, temblor y pigmento */
.gallery__item.is-lit .gallery__glow {
	opacity: 1;
	transform: none;
	animation: llama 3s ease-in-out infinite;
}
.gallery__item.is-lit .gallery__art { transform: scale(1.035); }
.gallery__item.is-lit .gallery__art img {
	opacity: 1;
	filter: brightness(1.18) saturate(1.06);
	animation: temblor .8s cubic-bezier(.36, .07, .19, .97) .12s both;
}

@keyframes temblor {
	0%, 100% { transform: translate(0, 0) rotate(0); }
	10% { transform: translate(-4px, 1px) rotate(-.6deg); }
	20% { transform: translate(4px, -1px) rotate(.6deg); }
	32% { transform: translate(-3px, 1px) rotate(-.4deg); }
	44% { transform: translate(3px, 0) rotate(.35deg); }
	58% { transform: translate(-2px, 0) rotate(-.2deg); }
	72% { transform: translate(1px, 0) rotate(.1deg); }
	86% { transform: translate(-1px, 0) rotate(0); }
}

.gallery__fx {
	position: absolute;
	inset: 0;
	pointer-events: none;
}

/* Pigmento soplado: motas de almagre y ocre que salen del borde de la pintura */
.mota {
	position: absolute;
	left: var(--x);
	top: var(--y);
	width: var(--s);
	height: var(--s);
	margin: calc(var(--s) / -2) 0 0 calc(var(--s) / -2);
	border-radius: 50%;
	background: radial-gradient(circle, var(--c) 38%, transparent 72%);
	opacity: 0;
	animation: soplo var(--d) cubic-bezier(.15, .65, .3, 1) var(--delay) forwards;
}
@keyframes soplo {
	0% { opacity: 0; transform: translate(0, 0) scale(.3); }
	14% { opacity: .9; }
	100% { opacity: 0; transform: translate(var(--dx), var(--dy)) scale(1.15); }
}

/* La bruma de pigmento soplado que se abre alrededor de la pintura */
.nube {
	position: absolute;
	inset: -6% -4%;
	border-radius: 50%;
	background: radial-gradient(closest-side, transparent 58%, rgba(166, 60, 34, .34) 74%, rgba(201, 137, 58, .14) 86%, transparent 100%);
	opacity: 0;
	animation: nube 1.8s cubic-bezier(.2, .7, .3, 1) .1s forwards;
}
@keyframes nube {
	0% { opacity: 0; transform: scale(.72); }
	22% { opacity: 1; }
	100% { opacity: 0; transform: scale(1.12); }
}

/* Brasas que suben de la antorcha */
.brasa {
	position: absolute;
	left: var(--x);
	bottom: 6%;
	width: var(--s);
	height: var(--s);
	border-radius: 50%;
	background: #FFD089;
	box-shadow: 0 0 6px 2px rgba(255, 138, 40, .75);
	opacity: 0;
	animation: brasa var(--d) ease-out var(--delay) forwards;
}
@keyframes brasa {
	0% { opacity: 0; transform: translate(0, 0); }
	12% { opacity: 1; }
	55% { opacity: .85; }
	100% { opacity: 0; transform: translate(var(--dx), var(--dy)); }
}

@media (max-width: 700px) {
	.gallery { gap: clamp(48px, 12vh, 120px); padding-top: max(40px, calc(50vh - 140px)); }
	/* El lienzo del logotipo tiene margen a los lados: se amplía para que el logo ocupe la pantalla */
	.gallery__item--logo { width: 142%; max-width: none; }
	.gallery__art img { opacity: .5; }
}

@media (prefers-reduced-motion: reduce) {
	.cave-intro { display: none; }
	.gallery__item.is-lit .gallery__art { transform: none; }
}

/* ---------- Páginas Estudio y Contacto ---------- */

.about__caveman {
	display: block;
	width: 100%;
	padding: 0;
	border: 0;
	background: none;
	cursor: pointer;
}
.about__caveman img,
.about__art > img { display: block; width: 100%; max-width: 520px; margin-inline: auto; filter: drop-shadow(0 24px 32px rgba(0, 0, 0, .5)); }
.about__reel { margin: 28px 0 0; }
.page-extra { margin-top: clamp(32px, 5vw, 56px); }
.contact.section--first { background: none; box-shadow: none; }
