/* ==========================================================
   Mediatelos 2026 · Sitio de proyectos
   Bulma + animate.css + estilos propios
   ========================================================== */

:root {
	--bg: #f6f5f0;
	--bg-2: #eceae3;
	--ink: #1c1e1d;
	--grey: #505151;          /* gris del logo */
	--mute: #8b8d8a;
	--line: rgba(28, 30, 29, .12);
	--green: #73c58b;         /* verde del logo */
	--green-deep: #3d9a5a;
	--dark: #141615;
	--dark-2: #1d201f;
	--on-dark: #ecebe6;
	--on-dark-mute: #8f938f;

	--font: 'Geist', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
	--mono: 'Geist Mono', ui-monospace, 'SFMono-Regular', Menlo, monospace;

	--gutter: clamp(16px, 3.2vw, 48px);
	--ease: cubic-bezier(.22, 1, .36, 1);
	--ease-in-out: cubic-bezier(.77, 0, .175, 1);
	--radius: 28px;           /* esquinas de imágenes y tarjetas */
	--radius-sm: 18px;
	--nav-glass: rgba(246, 245, 240, .78);
	--cursor-ring: rgba(28, 30, 29, .35);
	color-scheme: light;
}

/* ---------- Modo oscuro ---------- */
/* Se activa con <html data-theme="dark"> (botón del menú) o, sin JS, con la preferencia del sistema */
:root[data-theme="dark"] {
	--bg: #101211;
	--bg-2: #171a19;
	--ink: #ecebe6;
	--grey: #b4b7b2;
	--mute: #7d817d;
	--line: rgba(236, 235, 230, .12);
	--green-deep: #8fd6a3;
	--dark: #070808;
	--dark-2: #0d0f0e;
	--nav-glass: rgba(16, 18, 17, .78);
	--cursor-ring: rgba(236, 235, 230, .4);
	color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
	:root:not([data-theme="light"]) {
		--bg: #101211; --bg-2: #171a19; --ink: #ecebe6; --grey: #b4b7b2; --mute: #7d817d;
		--line: rgba(236, 235, 230, .12); --green-deep: #8fd6a3; --dark: #070808; --dark-2: #0d0f0e;
		--nav-glass: rgba(16, 18, 17, .78); --cursor-ring: rgba(236, 235, 230, .4); color-scheme: dark;
	}
}
/* Logo: versión clara en oscuro */
.logo-dark { display: none !important; }
:root[data-theme="dark"] .logo-light { display: none !important; }
:root[data-theme="dark"] .logo-dark { display: block !important; }
/* En oscuro, las secciones "dark" se separan con una línea */
:root[data-theme="dark"] .numbers,
:root[data-theme="dark"] .site-footer,
:root[data-theme="dark"] .p-screens { border-top: 1px solid var(--line); }
/* Transición suave al cambiar de tema */
html.theme-anim, html.theme-anim *, html.theme-anim *::before { transition: background-color .5s ease, color .5s ease, border-color .5s ease !important; }

/* Botón de tema */
.theme-toggle {
	width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--line);
	background: transparent; color: var(--ink); cursor: pointer; display: grid; place-items: center;
	position: relative; overflow: hidden; flex: none; transition: border-color .3s, background .3s;
}
.theme-toggle:hover { border-color: var(--green); }
.theme-toggle svg { width: 18px; height: 18px; position: absolute; transition: transform .6s var(--ease), opacity .4s; }
.theme-toggle .i-moon { transform: translateY(0) rotate(0); }
.theme-toggle .i-sun { transform: translateY(130%) rotate(90deg); opacity: 0; }
:root[data-theme="dark"] .theme-toggle .i-moon { transform: translateY(-130%) rotate(-90deg); opacity: 0; }
:root[data-theme="dark"] .theme-toggle .i-sun { transform: none; opacity: 1; }
.theme-toggle:focus-visible { outline: 2px solid var(--green); outline-offset: 3px; }
.theme-toggle--menu { margin-top: 0; border-color: rgba(255,255,255,.2); color: var(--on-dark); width: auto; padding: 0 18px 0 46px; border-radius: 999px; height: 44px; font-family: var(--mono); font-size: 12px; text-transform: uppercase; }
.theme-toggle--menu svg { left: 16px; }

/* ---------- Base ---------- */
html { background: var(--bg); scroll-behavior: auto; }
html, body { overflow-x: clip; }
body {
	font-family: var(--font);
	color: var(--grey);
	background: var(--bg);
	font-size: 16px;
	line-height: 1.55;
	-webkit-font-smoothing: antialiased;
	text-rendering: optimizeLegibility;
}
body.is-loading { overflow: hidden; }
::selection { background: var(--green); color: var(--ink); }
a { color: inherit; transition: color .3s var(--ease); }
a:hover { color: var(--ink); }
img { display: block; max-width: 100%; height: auto; }
strong { color: var(--ink); font-weight: 600; }
.mono { font-family: var(--mono); text-transform: uppercase; letter-spacing: .02em; font-size: 12px; }
.wrap { padding-left: var(--gutter); padding-right: var(--gutter); max-width: 1680px; margin: 0 auto; }
.container.is-fluid.wrap { padding-left: var(--gutter); padding-right: var(--gutter); }
.hide-mobile { }
@media (max-width: 768px) { .hide-mobile { display: none !important; } }

.eyebrow { color: var(--mute); margin-bottom: 1.4rem; display: flex; align-items: center; gap: .6rem; }
.eyebrow::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--green); flex: none; }

.section-x { padding-top: clamp(80px, 12vw, 180px); padding-bottom: clamp(80px, 12vw, 180px); }
.section-head { max-width: 1100px; margin-bottom: clamp(48px, 7vw, 110px); }
.section-title {
	font-family: var(--font);
	font-weight: 400;
	font-size: clamp(1.6rem, 3.2vw, 3rem);
	line-height: 1.12;
	letter-spacing: -.025em;
	color: var(--ink);
	max-width: 22ch;
	text-wrap: balance;
}
.section-head .section-title { max-width: 28ch; }
.body-copy { font-size: clamp(1rem, 1.15vw, 1.125rem); max-width: 60ch; margin-top: 1.2rem; color: var(--grey); }

/* ---------- Split text ---------- */
.split-lines .w { display: inline-block; overflow: hidden; vertical-align: top; padding-bottom: .08em; margin-bottom: -.08em; }
.split-lines .wi { display: inline-block; transform: translate3d(0, 105%, 0); will-change: transform; }
.split-lines.is-in .wi { transform: none; transition: transform 1.1s var(--ease); transition-delay: calc(var(--i, 0) * 28ms); }
.no-js .split-lines .wi { transform: none; }

.reveal-up { opacity: 0; transform: translate3d(0, 28px, 0); }
.reveal-up.is-in { opacity: 1; transform: none; transition: opacity 1s var(--ease), transform 1s var(--ease); transition-delay: var(--d, 0ms); }
.reveal-clip { clip-path: inset(12% 6% 12% 6% round var(--radius)); }
.reveal-clip.is-in { clip-path: inset(0 0 0 0 round var(--radius)); transition: clip-path 1.4s var(--ease); }
.reveal-chip { opacity: 0; transform: scale(.85); }
.reveal-chip.is-in { opacity: 1; transform: none; transition: opacity .6s var(--ease), transform .6s var(--ease), background .3s, color .3s; transition-delay: var(--d, 0ms); }
.hero-anim { opacity: 0; }

@media (prefers-reduced-motion: reduce) {
	.split-lines .wi, .reveal-up, .reveal-chip, .hero-anim { opacity: 1 !important; transform: none !important; transition: none !important; }
	.reveal-clip { clip-path: none !important; }
	.marquee__track { animation: none !important; }
}

/* ---------- Preloader ---------- */
.preloader {
	position: fixed; inset: 0; z-index: 1000;
	background: var(--dark);
	color: var(--on-dark);
	display: grid; place-items: center;
	transition: clip-path 1.1s var(--ease-in-out);
	clip-path: inset(0 0 0 0);
}
.preloader.is-done { clip-path: inset(0 0 100% 0); pointer-events: none; }
.preloader__logo { width: min(540px, 64vw); opacity: 0; animation: fadeIn .8s .1s var(--ease) forwards; }
.preloader__logo img { filter: brightness(0) invert(1); opacity: .92; }
.preloader__count {
	position: absolute; right: var(--gutter); bottom: calc(var(--gutter) + 6px);
	font-size: clamp(56px, 11vw, 160px); line-height: .8; letter-spacing: -.04em; color: var(--green);
}
.preloader__bar { position: absolute; left: 0; bottom: 0; height: 2px; width: 100%; background: rgba(255,255,255,.08); }
.preloader__bar span { display: block; height: 100%; width: 0; background: var(--green); transition: width .2s linear; }

/* ---------- Cursor ---------- */
.cursor { position: fixed; top: 0; left: 0; z-index: 999; pointer-events: none; mix-blend-mode: normal; }
.cursor__dot, .cursor__ring { position: absolute; top: 0; left: 0; border-radius: 50%; transform: translate(-50%, -50%); }
.cursor__dot { width: 6px; height: 6px; background: var(--ink); transition: opacity .2s, background .3s; }
.cursor__ring {
	width: 34px; height: 34px; border: 1px solid var(--cursor-ring);
	display: grid; place-items: center;
	transition: width .5s var(--ease), height .5s var(--ease), background .4s var(--ease), border-color .4s;
}
.cursor__label { opacity: 0; color: var(--ink); font-size: 11px; transition: opacity .3s; white-space: nowrap; }
.cursor.is-hover .cursor__ring { width: 92px; height: 92px; background: var(--green); border-color: var(--green); }
.cursor.is-hover .cursor__label { opacity: 1; }
.cursor.is-hover .cursor__dot { opacity: 0; }
.cursor.is-link .cursor__ring { width: 54px; height: 54px; border-color: var(--green); }
.cursor.on-dark .cursor__dot { background: var(--on-dark); }
.cursor.on-dark .cursor__ring { border-color: rgba(236,235,230,.4); }
@media (hover: none), (pointer: coarse) { .cursor { display: none; } }

/* ---------- Navegación ---------- */
.site-nav {
	position: fixed; top: 0; left: 0; right: 0; z-index: 100;
	transition: transform .6s var(--ease), background .4s, backdrop-filter .4s;
}
.site-nav__inner {
	display: flex; align-items: center; gap: 2rem;
	padding: 18px var(--gutter);
	max-width: 1680px; margin: 0 auto;
}
.site-nav.is-scrolled { background: var(--nav-glass); backdrop-filter: blur(14px) saturate(1.3); -webkit-backdrop-filter: blur(14px) saturate(1.3); box-shadow: 0 1px 0 var(--line); }
.site-nav.is-hidden { transform: translateY(-110%); }
.site-nav__brand img { height: 40px; width: auto; }
.site-nav__links { display: flex; gap: 2rem; margin-left: auto; color: var(--grey); }
.site-nav .pill-btn { margin-left: .5rem; }
.site-nav .theme-toggle { margin-left: .25rem; }
.site-nav__burger { display: none; }

/* link con efecto "roll" */
.link-roll { display: inline-block; overflow: hidden; vertical-align: top; }
.link-roll span { display: inline-block; position: relative; transition: transform .5s var(--ease); }
.link-roll span::after { content: attr(data-text); position: absolute; left: 0; top: 100%; color: var(--green-deep); }
.link-roll:hover span { transform: translateY(-100%); }

/* botón píldora */
.pill-btn {
	display: inline-flex; align-items: center; gap: .65rem;
	padding: 12px 20px; border-radius: 999px;
	background: var(--ink); color: var(--bg) !important;
	border: 0; cursor: pointer; font-size: 12px;
	transition: background .4s var(--ease), color .4s;
	will-change: transform;
}
.pill-btn__dot { width: 7px; height: 7px; border-radius: 50%; background: var(--green); transition: transform .4s var(--ease); }
.pill-btn:hover { background: var(--green); color: var(--ink) !important; }
.pill-btn:hover .pill-btn__dot { transform: scale(1.6); background: var(--ink); }
.pill-btn:focus-visible { outline: 2px solid var(--green); outline-offset: 3px; }

@media (max-width: 900px) {
	.site-nav__links, .site-nav .pill-btn { display: none; }
	.site-nav .theme-toggle { margin-left: auto; }
	.site-nav__burger {
		display: grid; gap: 6px; margin-left: 10px; width: 44px; height: 44px; place-content: center;
		background: var(--ink); border: 0; border-radius: 50%; cursor: pointer; position: relative; z-index: 102;
	}
	.site-nav__burger span { width: 18px; height: 1.5px; background: var(--bg); transition: transform .4s var(--ease); }
	.menu-open .site-nav__burger span:first-child { transform: translateY(3.75px) rotate(45deg); }
	.menu-open .site-nav__burger span:last-child { transform: translateY(-3.75px) rotate(-45deg); }
}
.mobile-menu {
	position: fixed; inset: 0; z-index: 99; background: var(--dark); color: var(--on-dark);
	display: flex; flex-direction: column; justify-content: flex-end; padding: 100px var(--gutter) 40px;
	clip-path: circle(0% at calc(100% - 40px) 40px); transition: clip-path .8s var(--ease-in-out);
	visibility: hidden;
}
.menu-open .mobile-menu { clip-path: circle(150% at calc(100% - 40px) 40px); visibility: visible; }
.menu-open .site-nav__brand img { filter: brightness(0) invert(1); }
.mobile-menu__links { display: flex; flex-direction: column; gap: .2rem; }
.mobile-menu__links a { font-size: clamp(2.4rem, 11vw, 4rem); letter-spacing: -.04em; line-height: 1.1; color: var(--on-dark); }
.mobile-menu__links a:hover { color: var(--green); }
.mobile-menu__foot { color: var(--on-dark-mute); margin-top: 2rem; }

/* ---------- Hero ---------- */
.hero-x { position: relative; min-height: 100svh; display: flex; overflow: hidden; }
.hero-x__canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.hero-x__inner { position: relative; z-index: 2; width: 100%; display: flex; flex-direction: column; padding-top: 110px; padding-bottom: clamp(28px, 4vw, 48px); pointer-events: none; }
.hero-x__inner a { pointer-events: auto; }
.hero-x__top { display: flex; gap: clamp(1.5rem, 5vw, 5rem); color: var(--mute); }
.hero-x__title {
	margin-top: auto;
	font-size: clamp(2.4rem, 7.2vw, 8.4rem);
	line-height: .92;
	letter-spacing: -.055em;
	color: var(--ink);
	font-weight: 500;
	max-width: 14ch;
	text-transform: uppercase;
}
.hero-x__title .w:nth-last-child(-n+3) .wi { color: var(--green-deep); }
.hero-x__bottom { display: flex; justify-content: space-between; align-items: flex-end; gap: 2rem; margin-top: clamp(2rem, 4vw, 3.5rem); }
.hero-x__lead { max-width: 46ch; font-size: clamp(1rem, 1.2vw, 1.15rem); color: var(--grey); }
.hero-x__scroll { display: inline-flex; align-items: center; gap: .9rem; color: var(--ink); white-space: nowrap; }
.hero-x__scroll-line { width: 1px; height: 46px; background: var(--line); position: relative; overflow: hidden; }
.hero-x__scroll-line::after { content: ''; position: absolute; left: 0; top: -50%; width: 100%; height: 50%; background: var(--green-deep); animation: scrollLine 2s var(--ease-in-out) infinite; }
@keyframes scrollLine { to { top: 100%; } }
@media (max-width: 768px) {
	.hero-x__bottom { flex-direction: column; align-items: flex-start; }
	.hero-x__title { font-size: clamp(2.3rem, 11.5vw, 4rem); }
}

/* ---------- Marquee ---------- */
.marquee { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); overflow: hidden; padding: 22px 0; color: var(--ink); background: var(--bg); }
.marquee__track { display: flex; gap: 2.4rem; width: max-content; animation: marquee 38s linear infinite; font-size: clamp(14px, 1.4vw, 18px); }
.marquee__track i { color: var(--green); font-style: normal; }
.marquee:hover .marquee__track { animation-play-state: paused; }
@keyframes marquee { to { transform: translateX(-50%); } }

/* ---------- Tags ---------- */
.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tags li { border: 1px solid var(--line); border-radius: 999px; padding: 6px 11px; font-size: 11px; color: var(--grey); transition: background .3s, color .3s, border-color .3s; }

/* ---------- Work cards ---------- */
.work-list { display: grid; gap: clamp(80px, 11vw, 170px); }
.work-card { display: grid; grid-template-columns: repeat(12, 1fr); gap: 0 var(--gutter); align-items: end; }
.work-card__media { grid-column: 1 / span 9; display: block; position: relative; border-radius: var(--radius); overflow: hidden; background: var(--accent, var(--dark)); aspect-ratio: 16 / 9; isolation: isolate; }
.work-card__img { position: absolute; inset: -3%; will-change: transform; }
.work-card__img img { width: 100%; height: 100%; object-fit: cover; transition: transform 1.4s var(--ease), filter .8s var(--ease); }
.work-card__media::after { content: ''; position: absolute; inset: 0; border-radius: inherit; box-shadow: inset 0 0 0 1px rgba(255,255,255,.06); pointer-events: none; }
.work-card:hover .work-card__img img { transform: scale(1.05); }
.work-card__meta { grid-column: 10 / span 3; display: grid; gap: 1.1rem; padding-bottom: 6px; }
.work-card.is-alt .work-card__media { grid-column: 4 / span 9; order: 2; }
.work-card.is-alt .work-card__meta { grid-column: 1 / span 3; order: 1; }
.work-card__num { color: var(--green-deep); }
.work-card__title { font-size: clamp(1.15rem, 1.55vw, 1.6rem); line-height: 1.2; letter-spacing: -.02em; color: var(--mute); font-weight: 400; text-wrap: pretty; }
.work-card__title strong { color: var(--ink); font-weight: 500; }
.work-card__title a { color: inherit; }
.work-card:hover .tags li { border-color: var(--green); }
.work-card__year { color: var(--mute); }
@media (max-width: 900px) {
	.work-card, .work-card.is-alt { grid-template-columns: 1fr; gap: 1.4rem; }
	.work-card__media, .work-card.is-alt .work-card__media, .work-card__meta, .work-card.is-alt .work-card__meta { grid-column: 1 / -1; order: initial; }
}

/* ---------- Índice con preview ---------- */
.index-list { padding-top: 0; position: relative; }
.index-rows { border-top: 1px solid var(--line); }
.index-row a {
	display: grid; grid-template-columns: 60px 1.4fr 1fr 1fr 110px; align-items: center; gap: 1rem;
	padding: clamp(18px, 2.2vw, 30px) 0; border-bottom: 1px solid var(--line); position: relative;
	transition: color .4s var(--ease), padding .5s var(--ease);
}
.index-row a::before { content: ''; position: absolute; inset: 0; background: var(--ink); transform: scaleY(0); transform-origin: bottom; transition: transform .5s var(--ease); z-index: -1; }
.index-rows:hover .index-row a { color: var(--mute); }
.index-row a:hover { color: var(--bg) !important; padding-left: 18px; padding-right: 18px; }
.index-row a:hover::before { transform: scaleY(1); }
.index-row a:hover .index-row__t { color: var(--bg); }
.index-row a:hover .index-row__n { color: var(--green); }
.index-row { position: relative; z-index: 0; }
.index-row__t { font-size: clamp(1.4rem, 2.8vw, 2.6rem); letter-spacing: -.035em; color: var(--ink); line-height: 1.05; transition: color .4s; }
.index-row__n { color: var(--green-deep); }
.index-row__y { text-align: right; }
@media (max-width: 768px) { .index-row a { grid-template-columns: 40px 1fr auto; } }
.index-preview {
	position: fixed; top: 0; left: 0; width: 340px; aspect-ratio: 16/9; z-index: 50; pointer-events: none;
	border-radius: var(--radius-sm); overflow: hidden; opacity: 0; transform: translate(-50%, -50%) scale(.6);
	transition: opacity .35s var(--ease), transform .5s var(--ease);
	box-shadow: 0 30px 60px -20px rgba(0,0,0,.35);
}
.index-preview.is-on { opacity: 1; transform: translate(-50%, -50%) scale(1); }
.index-preview img { width: 100%; height: 100%; object-fit: cover; }
@media (hover: none) { .index-preview { display: none; } }

/* ---------- Servicios / acordeón ---------- */
.services { background: var(--bg-2); }
.accordion { border-top: 1px solid var(--line); }
.accordion__item { border-bottom: 1px solid var(--line); }
.accordion__head {
	width: 100%; display: grid; grid-template-columns: 48px 1fr 24px; align-items: center; gap: 1rem;
	padding: 26px 0; background: none; border: 0; cursor: pointer; text-align: left; color: var(--ink); font-family: var(--font);
}
.accordion__n { color: var(--green-deep); }
.accordion__t { font-size: clamp(1.25rem, 2vw, 1.9rem); letter-spacing: -.03em; transition: transform .5s var(--ease); }
.accordion__head:hover .accordion__t { transform: translateX(8px); }
.accordion__plus { width: 16px; height: 16px; position: relative; justify-self: end; }
.accordion__plus::before, .accordion__plus::after { content: ''; position: absolute; left: 0; top: 50%; width: 100%; height: 1.5px; background: var(--ink); transition: transform .5s var(--ease); }
.accordion__plus::after { transform: rotate(90deg); }
.accordion__item.is-open .accordion__plus::after { transform: rotate(0); }
.accordion__body { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .6s var(--ease); }
.accordion__body > p { overflow: hidden; padding-left: calc(48px + 1rem); max-width: 56ch; color: var(--grey); }
.accordion__item.is-open .accordion__body { grid-template-rows: 1fr; }
.accordion__item.is-open .accordion__body > p { padding-bottom: 26px; }

/* ---------- Números ---------- */
.numbers { background: var(--dark); color: var(--on-dark); }
.numbers .section-title { color: var(--on-dark); max-width: 26ch; }
.numbers .eyebrow { color: var(--on-dark-mute); }
.numbers-grid { display: grid; grid-template-columns: repeat(4, 1fr); margin-top: clamp(48px, 7vw, 100px); border-top: 1px solid rgba(255,255,255,.1); }
.num { padding: 32px 24px 0 0; display: grid; gap: .8rem; align-content: start; border-right: 1px solid rgba(255,255,255,.08); padding-left: 0; }
.num + .num { padding-left: 24px; }
.num:last-child { border-right: 0; }
.num__v { font-size: clamp(2.6rem, 5.4vw, 5.6rem); letter-spacing: -.05em; line-height: 1; color: var(--green); font-weight: 400; font-variant-numeric: tabular-nums; }
.num__l { color: var(--on-dark-mute); max-width: 22ch; }
@media (max-width: 900px) {
	.numbers-grid { grid-template-columns: 1fr 1fr; }
	.num { border-right: 0; padding-left: 0 !important; padding-bottom: 32px; border-bottom: 1px solid rgba(255,255,255,.08); }
}

/* ---------- Stack ---------- */
.stack-cloud { display: flex; flex-wrap: wrap; gap: 10px; }
.stack-cloud li { padding: 12px 18px; border-radius: 999px; border: 1px solid var(--line); color: var(--ink); font-size: 12px; cursor: default; }
.stack-cloud li:hover { background: var(--green); border-color: var(--green); }

/* ---------- Footer / contacto ---------- */
.site-footer { background: var(--dark); color: var(--on-dark); padding-top: clamp(90px, 12vw, 180px); overflow: hidden; }
.site-footer .eyebrow { color: var(--on-dark-mute); }
.footer-title { font-size: clamp(2rem, 5vw, 5rem); letter-spacing: -.045em; line-height: 1.02; color: var(--on-dark); max-width: 18ch; font-weight: 400; }
.footer-title em { font-style: normal; color: var(--green); }
.footer-grid { margin-top: clamp(48px, 7vw, 100px) !important; }
.contact-form .label { color: var(--on-dark-mute); font-weight: 400; font-size: 11px; }
.contact-form .input, .contact-form .textarea {
	background: transparent; border: 0; border-bottom: 1px solid rgba(255,255,255,.18); border-radius: 0; box-shadow: none;
	color: var(--on-dark); font-family: var(--font); font-size: 1.15rem; padding-left: 0; padding-right: 0;
	transition: border-color .3s;
}
.contact-form .input:focus, .contact-form .textarea:focus { border-color: var(--green); box-shadow: none; }
.contact-form .textarea { resize: vertical; min-height: 90px; }
.contact-form .field { margin-bottom: 1.6rem; }
.contact-form .pill-btn { margin-top: .8rem; background: var(--green); color: var(--ink) !important; }
.contact-form .pill-btn .pill-btn__dot { background: var(--ink); }
.contact-form .pill-btn:hover { background: var(--on-dark); }
.contact-form .pill-btn[disabled] { opacity: .6; pointer-events: none; }
.form-status { margin-top: 1rem; min-height: 1.4em; color: var(--green); }
.form-status.is-error { color: #f08a7a; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.footer-mail { display: inline-block; font-size: clamp(1.5rem, 2.6vw, 2.4rem); letter-spacing: -.03em; color: var(--on-dark); border-bottom: 1px solid rgba(255,255,255,.2); padding-bottom: 4px; transition: color .3s, border-color .3s; }
.footer-mail:hover { color: var(--green); border-color: var(--green); }
.footer-dl { margin-top: 2.6rem; display: grid; gap: 1.4rem; }
.footer-dl dt { color: var(--on-dark-mute); margin-bottom: .3rem; font-size: 11px; }
.footer-dl dd { color: var(--on-dark); font-size: 12px; line-height: 1.8; }
.footer-dl a { color: var(--on-dark); }
.footer-dl a:hover { color: var(--green); }
.footer-giant { margin-top: clamp(60px, 9vw, 140px); }
.footer-giant img { width: 100%; filter: brightness(0) invert(1); opacity: .07; }
.footer-bottom { display: flex; flex-wrap: wrap; gap: 1rem 2rem; justify-content: space-between; padding: 28px 0 36px; border-top: 1px solid rgba(255,255,255,.08); margin-top: 28px; color: var(--on-dark-mute); font-size: 11px; }
.footer-bottom a { color: var(--on-dark); }
.footer-bottom a:hover { color: var(--green); }

/* ==========================================================
   Página de proyecto
   ========================================================== */
.p-hero { padding-top: clamp(130px, 16vw, 210px); padding-bottom: clamp(40px, 5vw, 70px); }
.back-link { color: var(--mute); margin-bottom: 2.6rem; }
.p-hero__title { font-size: clamp(2rem, 5vw, 5.2rem); line-height: 1.02; letter-spacing: -.045em; color: var(--mute); font-weight: 400; max-width: 20ch; margin-bottom: 2rem; text-wrap: balance; }
.p-hero__title strong { color: var(--ink); font-weight: 500; }
.p-hero__title strong .wi { color: var(--ink); font-weight: 500; }

.p-cover__frame { border-radius: var(--radius); overflow: hidden; background: var(--accent); aspect-ratio: 16/9; position: relative; }
/* La máscara de entrada de la portada aplica a "parallax" y "clip" (ver bloque de animaciones al final) */
.p-cover__frame img, .p-wide img { width: 100%; height: 100%; object-fit: cover; will-change: transform; }

.p-facts { display: grid; gap: 0; border-top: 1px solid var(--line); position: sticky; top: 100px; }
.p-facts > div { display: grid; grid-template-columns: 90px 1fr; gap: 1rem; padding: 16px 0; border-bottom: 1px solid var(--line); }
.p-facts dt { color: var(--mute); }
.p-facts dd { color: var(--ink); text-transform: none; font-family: var(--font); font-size: 14px; letter-spacing: 0; display: flex; align-items: center; gap: .5rem; }
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 0 rgba(115,197,139,.6); animation: pulse 2s infinite; flex: none; }
@keyframes pulse { 70% { box-shadow: 0 0 0 9px rgba(115,197,139,0); } 100% { box-shadow: 0 0 0 0 rgba(115,197,139,0); } }
.p-lead { font-size: clamp(1.4rem, 2.4vw, 2.3rem); line-height: 1.18; letter-spacing: -.03em; color: var(--ink); text-wrap: pretty; }
.p-block { margin-top: clamp(40px, 5vw, 70px); }
.p-block .body-copy { margin-top: 0; }
@media (max-width: 768px) { .p-facts { position: static; margin-bottom: 2rem; } }

.p-wide a { display: block; border-radius: var(--radius); overflow: hidden; aspect-ratio: 16/9; background: var(--dark); }

.feature-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; border-top: 1px solid var(--line); }
.feature { padding: 32px 28px 40px 0; border-bottom: 1px solid var(--line); display: grid; gap: .9rem; align-content: start; transition: background .5s var(--ease); }
.feature:not(:nth-child(3n+1)) { padding-left: 28px; border-left: 1px solid var(--line); }
.feature__n { color: var(--green-deep); }
.feature__t { font-size: clamp(1.15rem, 1.5vw, 1.45rem); letter-spacing: -.02em; color: var(--ink); line-height: 1.2; }
.feature__d { color: var(--grey); max-width: 38ch; }
@media (max-width: 900px) {
	.feature-grid { grid-template-columns: 1fr; }
	.feature:not(:nth-child(3n+1)) { padding-left: 0; border-left: 0; }
}

/* Galería horizontal */
.p-screens { background: var(--dark); color: var(--on-dark); padding: clamp(70px, 9vw, 130px) 0; overflow: hidden; position: relative; }
.p-screens::before { content: ''; position: absolute; inset: 0; background: radial-gradient(60% 80% at 20% 0%, color-mix(in srgb, var(--accent) 70%, transparent), transparent 70%); opacity: .55; pointer-events: none; }
.p-screens__head { display: flex; justify-content: space-between; align-items: center; position: relative; }
.p-screens .eyebrow { color: var(--on-dark-mute); margin-bottom: 0; }
.p-screens__hint { color: var(--on-dark-mute); }
.p-screens__viewport { margin-top: 40px; overflow-x: auto; overflow-y: hidden; scrollbar-width: none; cursor: grab; position: relative; -webkit-overflow-scrolling: touch; }
.p-screens__viewport::-webkit-scrollbar { display: none; }
.p-screens__viewport.is-dragging { cursor: grabbing; }
.p-screens__track { display: flex; gap: clamp(14px, 2vw, 28px); padding: 0 var(--gutter); width: max-content; }
.screen { flex: none; width: clamp(200px, 21vw, 320px); transition: transform .7s var(--ease); }
.screen img { width: 100%; height: auto; pointer-events: none; user-select: none; border-radius: var(--radius); filter: drop-shadow(0 30px 40px rgba(0,0,0,.45)); }
.screen:hover { transform: translateY(-14px) rotate(-1deg); }

.p-stats { display: grid; gap: 0; border-top: 1px solid var(--line); }
.p-stat { display: flex; align-items: baseline; justify-content: space-between; gap: 1.5rem; padding: 26px 0; border-bottom: 1px solid var(--line); }
.p-stat__v { font-size: clamp(2.4rem, 5vw, 4.6rem); letter-spacing: -.05em; line-height: 1; color: var(--ink); }
.p-stat__l { color: var(--mute); text-align: right; max-width: 20ch; }

.p-duo { display: grid; grid-template-columns: 1fr 1fr; gap: var(--gutter); }
.p-duo a { display: block; border-radius: var(--radius); overflow: hidden; background: var(--dark); }
.p-duo img { width: 100%; transition: transform 1.2s var(--ease); }
.p-duo a:hover img { transform: scale(1.04); }
@media (max-width: 768px) { .p-duo { grid-template-columns: 1fr; } }

/* Siguiente proyecto */
.next-project { display: block; position: relative; overflow: hidden; background: var(--bg-2); padding: clamp(80px, 11vw, 160px) 0; color: var(--ink); border-top: 1px solid var(--line); }
.next-project .wrap { position: relative; z-index: 2; display: grid; gap: 1rem; }
.next-project__title { font-size: clamp(2.6rem, 8vw, 8rem); letter-spacing: -.055em; line-height: .95; transition: transform .8s var(--ease), color .4s; }
.next-project__sub { color: var(--mute); font-size: clamp(1rem, 1.4vw, 1.3rem); max-width: 40ch; }
.next-project__img { position: absolute; right: var(--gutter); top: 50%; width: min(520px, 40vw); aspect-ratio: 16/9; border-radius: var(--radius); overflow: hidden; transform: translateY(-50%) rotate(4deg) scale(.85); opacity: 0; transition: opacity .6s var(--ease), transform .9s var(--ease); }
.next-project__img img { width: 100%; height: 100%; object-fit: cover; }
.next-project:hover .next-project__img { opacity: 1; transform: translateY(-50%) rotate(0) scale(1); }
.next-project:hover .next-project__title { transform: translateX(14px); color: var(--green-deep); }
@media (hover: none) { .next-project__img { display: none; } }

/* Lightbox ajustes */
.lightboxOverlay { background: var(--dark); opacity: .95 !important; }
.lightbox .lb-image { border: 0; border-radius: var(--radius-sm); }
.lb-outerContainer { background: transparent; }
.lb-data .lb-caption, .lb-data .lb-number { font-family: var(--mono); text-transform: uppercase; font-size: 11px; }


/* ==========================================================
   Switch de idioma (EN / ES)
   ========================================================== */
.lang-switch { position: relative; display: inline-flex; padding: 3px; border: 1px solid var(--line); border-radius: 999px; font-size: 11px; isolation: isolate; flex: none; }
.lang-switch__opt { position: relative; z-index: 1; padding: 7px 10px; border-radius: 999px; color: var(--mute); line-height: 1; transition: color .35s var(--ease); }
.lang-switch__opt:hover { color: var(--ink); }
.lang-switch__opt.is-on { color: var(--bg); }
.lang-switch__pill { position: absolute; z-index: 0; top: 3px; bottom: 3px; left: 3px; width: calc(50% - 3px); border-radius: 999px; background: var(--ink); transition: transform .45s var(--ease); }
.lang-switch .lang-switch__opt.is-on:nth-child(2) ~ .lang-switch__pill { transform: translateX(100%); }
.site-nav .lang-switch { margin-left: .5rem; }
.lang-switch--menu { border-color: rgba(255,255,255,.2); font-size: 12px; }
.lang-switch--menu .lang-switch__opt { color: var(--on-dark-mute); padding: 13px 16px; }
.lang-switch--menu .lang-switch__opt.is-on { color: var(--dark); }
.lang-switch--menu .lang-switch__pill { background: var(--on-dark); }
.mobile-menu__row { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin-top: 1.6rem; }
.footer-lang a { color: var(--on-dark-mute) !important; }
.footer-lang a:hover { color: var(--green) !important; }
.footer-lang strong { color: var(--on-dark); font-weight: 500; }

/* Logos de cliente (subidos desde el CMS) */
.work-card__logo { max-height: 34px; max-width: 150px; width: auto; object-fit: contain; }
.p-hero__logo { max-height: 48px; max-width: 200px; width: auto; margin-bottom: 1.6rem; object-fit: contain; }
:root[data-theme="dark"] .work-card__logo, :root[data-theme="dark"] .p-hero__logo { filter: brightness(0) invert(1); opacity: .9; }

/* ==========================================================
   Animaciones por proyecto (campo "animation" del CMS)
   parallax · clip · zoom · tilt · fade · none
   ========================================================== */
/* clip: la imagen se descubre con una máscara */
[data-anim="clip"] .work-card__media { clip-path: inset(14% 10% 14% 10% round var(--radius)); }
[data-anim="clip"].is-in .work-card__media { clip-path: inset(0 round var(--radius)); transition: clip-path 1.5s var(--ease); }
[data-anim="parallax"] .p-cover__frame, [data-anim="clip"] .p-cover__frame { clip-path: inset(8% 4% 8% 4% round var(--radius)); }
[data-anim="parallax"] .p-cover__frame.is-in, [data-anim="clip"] .p-cover__frame.is-in { clip-path: inset(0 round var(--radius)); transition: clip-path 1.6s var(--ease); }

/* zoom: entra más grande y se asienta */
[data-anim="zoom"] .work-card__img img, [data-anim="zoom"] .p-cover__frame img { transform: scale(1.28); opacity: .25; }
[data-anim="zoom"].is-in .work-card__img img, [data-anim="zoom"].is-in .p-cover__frame img { transform: scale(1); opacity: 1; transition: transform 1.8s var(--ease), opacity 1s var(--ease); }
[data-anim="zoom"].is-in.work-card:hover .work-card__img img { transform: scale(1.05); }

/* tilt: inclinación 3D con el cursor (js/site.js) */
[data-anim="tilt"] .work-card__media, [data-anim="tilt"] .p-cover__frame { transition: transform .6s var(--ease); transform-style: preserve-3d; will-change: transform; }
[data-anim="tilt"] .work-card__media:hover, [data-anim="tilt"] .p-cover__frame:hover { transition: transform .15s linear; }
[data-anim="tilt"] { opacity: 0; transform: translate3d(0, 40px, 0); }
[data-anim="tilt"].is-in { opacity: 1; transform: none; transition: opacity 1s var(--ease), transform 1.2s var(--ease); }

/* fade: animate.css fadeInUp al entrar (js/site.js) */
[data-anim="fade"] .work-card__media, [data-anim="fade"] .p-cover__frame { opacity: 0; }
[data-anim="fade"] .animate__fadeInUp { --animate-duration: 1.1s; }
[data-anim="fade"] .work-card__media.animate__animated, [data-anim="fade"] .p-cover__frame.animate__animated { opacity: 1; }

@media (prefers-reduced-motion: reduce) {
	[data-anim] .work-card__media, [data-anim] .p-cover__frame, [data-anim] img, [data-anim] { clip-path: none !important; transform: none !important; opacity: 1 !important; }
}
@media (max-width: 900px) {
	.site-nav .lang-switch { margin-left: auto; }
	.site-nav .lang-switch + .pill-btn + .theme-toggle { margin-left: .5rem; }
}
