/* ==========================================================================
   Caro Dast — Diseño estratégico
   Paleta: #ffffff #f2f2f2 #e0dede #EEF3A3 (acento) #2178c5 #828282 #3a3a3a #000000
   Tipografías: Work Sans (títulos y textos) · Space Grotesk (etiquetas, datos y detalles)
   ========================================================================== */

:root {
  --paper: #ffffff;
  --mist: #f2f2f2;
  --line: #e0dede;
  --accent: #EEF3A3;
  --blue: #2178c5;
  --grey: #828282;
  --graphite: #3a3a3a;
  --ink: #000000;
  --ink-soft: #0e0e0e;

  --font-sans: "Work Sans", system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-mono: "Space Grotesk", system-ui, -apple-system, "Segoe UI", Helvetica, Arial, sans-serif;

  --gutter: clamp(16px, 4vw, 56px);
  --maxw: 1440px;
  --radius: 6px;
  --radius-sm: 4px;
  --header-h: 112px;

  --ease-out: cubic-bezier(.16, 1, .3, 1);
  --ease-in-out: cubic-bezier(.65, 0, .35, 1);
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 17px;
  line-height: 1.6;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
img, video { display: block; max-width: 100%; height: auto; }
[hidden] { display: none !important; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
h1, h2, h3, h4, p, ul, ol, figure { margin: 0; }
ul { padding: 0; list-style: none; }
::selection { background: var(--accent); color: var(--ink); }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; border-radius: 4px; }

.skip-link {
  position: absolute; left: 16px; top: -60px; z-index: 200;
  background: var(--ink); color: var(--paper); padding: 10px 16px; border-radius: 999px;
  font-family: var(--font-mono); font-size: 13px; transition: top .3s var(--ease-out);
}
.skip-link:focus { top: 16px; }

/* ---------- Layout ---------- */
.container { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 var(--gutter); }
.section { padding: clamp(80px, 12vw, 180px) 0; }
.section--tight { padding: clamp(56px, 8vw, 110px) 0; }
.section--mist { background: var(--mist); }
.section--ink { background: var(--ink); color: var(--paper); }

/* ---------- Type ---------- */
.eyebrow {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--grey);
  display: inline-flex; align-items: center; gap: 12px;
}
.eyebrow::before {
  content: ""; width: 8px; height: 8px; border-radius: 50%;
  background: var(--accent); flex: none;
}
.section--ink .eyebrow { color: #a9a9a9; }

.display {
  font-size: clamp(2.3rem, 5.4vw, 5.4rem);
  line-height: 1.02;
  letter-spacing: -.035em;
  font-weight: 500;
}
.h1 {
  font-size: clamp(2.1rem, 4.4vw, 4.2rem);
  line-height: 1.04; letter-spacing: -.032em; font-weight: 500;
}
.h2 {
  font-size: clamp(1.65rem, 2.8vw, 2.7rem);
  line-height: 1.1; letter-spacing: -.028em; font-weight: 500;
}
.h3 { font-size: clamp(1.15rem, 1.5vw, 1.35rem); line-height: 1.25; letter-spacing: -.015em; font-weight: 600; }
.lead {
  font-size: clamp(1.05rem, 1.35vw, 1.28rem);
  line-height: 1.45; letter-spacing: -.012em; color: var(--graphite); font-weight: 400;
}
.section--ink .lead { color: #c9c9c9; }
.muted { color: var(--grey); }
.mono { font-family: var(--font-mono); }
.text-accent { color: var(--blue); }
.serif-swap { font-style: italic; font-weight: 300; }

/* ---------- Buttons ---------- */
.btn {
  --bg: var(--ink); --fg: var(--paper);
  position: relative; overflow: hidden; isolation: isolate;
  display: inline-flex; align-items: center; gap: 14px;
  padding: 16px 26px; border-radius: 999px;
  background: var(--bg); color: var(--fg);
  font-weight: 500; font-size: 16px; letter-spacing: -.01em;
  transition: color .5s var(--ease-out), transform .5s var(--ease-out);
}
.btn::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: var(--accent); border-radius: inherit;
  transform: translateY(101%); transition: transform .55s var(--ease-out);
}
.btn:hover::before { transform: translateY(0); }
.btn:hover { color: var(--ink); }
.btn .arrow { transition: transform .5s var(--ease-out); }
.btn:hover .arrow { transform: translateX(4px) rotate(-45deg); }
.btn--ghost { --bg: transparent; --fg: var(--ink); box-shadow: inset 0 0 0 1px var(--line); }
.btn--light { --bg: var(--paper); --fg: var(--ink); }
.arrow { width: 18px; height: 18px; flex: none; }

.link-underline {
  background: linear-gradient(currentColor, currentColor) 0 100% / 0 1px no-repeat;
  transition: background-size .5s var(--ease-out);
  padding-bottom: 2px;
}
.link-underline:hover { background-size: 100% 1px; }

/* ==========================================================================
   Header
   ========================================================================== */
.site-header {
  position: fixed; inset: 0 0 auto 0; z-index: 100;
  height: var(--header-h);
  display: flex; align-items: center;
  transition: transform .6s var(--ease-out), background-color .4s, box-shadow .4s, height .4s var(--ease-out);
}
.site-header .container { display: flex; align-items: center; justify-content: flex-start; gap: 24px; }
.site-header .brand { margin-right: auto; }

/* Selector de idioma */
.lang {
  display: inline-flex; align-items: center; gap: 2px; padding: 3px;
  border: 1px solid rgba(0, 0, 0, .14); border-radius: 999px;
  font-family: var(--font-mono); font-size: 12px; font-weight: 500; letter-spacing: .08em; line-height: 1;
  position: relative; z-index: 120; flex-shrink: 0;
  transition: border-color .3s;
}
.lang__opt {
  display: inline-flex; align-items: center; justify-content: center; min-width: 34px; height: 28px; padding: 0 8px;
  border-radius: 999px; color: inherit; opacity: .55;
  transition: opacity .25s, background-color .25s, color .25s;
}
.lang__opt:hover { opacity: 1; }
.lang__opt.is-active { opacity: 1; background: var(--ink); color: var(--paper); }
.lang__opt:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.has-dark-hero .site-header:not(.is-scrolled) .lang,
.menu-open .site-header .lang { color: var(--paper); border-color: rgba(255, 255, 255, .35); }
.has-dark-hero .site-header:not(.is-scrolled) .lang__opt.is-active,
.menu-open .site-header .lang__opt.is-active { background: var(--paper); color: var(--ink); }
.lang--footer { color: #8a8a8a; border-color: #2a2a2a; font-size: 11px; }
.lang--footer .lang__opt { height: 24px; min-width: 30px; }
.lang--footer .lang__opt.is-active { background: #2a2a2a; color: var(--paper); }
.site-header.is-scrolled {
  background: rgba(255, 255, 255, .82);
  -webkit-backdrop-filter: saturate(160%) blur(16px);
  backdrop-filter: saturate(160%) blur(16px);
  box-shadow: 0 1px 0 rgba(0, 0, 0, .06);
  height: 72px;
}

.brand { display: inline-flex; align-items: center; flex-shrink: 1; min-width: 0; }
.brand__logo {
  display: block; height: 44px; width: auto; max-width: 100%;
  transition: height .5s var(--ease-out), filter .4s;
}
.site-header.is-scrolled .brand__logo { height: 28px; }

.nav { display: flex; align-items: center; gap: 6px; }
.nav__link {
  position: relative; padding: 10px 16px; border-radius: 999px;
  font-size: 15px; font-weight: 500; letter-spacing: -.01em;
  transition: background-color .3s;
}
.nav__link:hover { background: var(--mist); }
.nav__link::after {
  content: ""; position: absolute; left: 50%; bottom: 4px; width: 5px; height: 5px; margin-left: -2.5px;
  border-radius: 50%; background: var(--accent); transform: scale(0); transition: transform .4s var(--ease-out);
}
body[data-page="proyectos"] .nav__link[data-nav="proyectos"]::after,
body[data-page="sobre-mi"] .nav__link[data-nav="sobre-mi"]::after,
body[data-page="contacto"] .nav__link[data-nav="contacto"]::after { transform: scale(1); }
.nav .btn { padding: 12px 20px; font-size: 15px; margin-left: 10px; }

.menu-toggle {
  display: none; width: 48px; height: 48px; border-radius: 50%;
  background: var(--ink); color: var(--paper); position: relative; z-index: 120;
}
.menu-toggle span {
  position: absolute; left: 15px; right: 15px; height: 1.5px; background: currentColor;
  transition: transform .5s var(--ease-out), top .5s var(--ease-out);
}
.menu-toggle span:nth-child(1) { top: 20px; }
.menu-toggle span:nth-child(2) { top: 27px; }
.menu-open .menu-toggle span:nth-child(1) { top: 23.5px; transform: rotate(45deg); }
.menu-open .menu-toggle span:nth-child(2) { top: 23.5px; transform: rotate(-45deg); }

.mobile-menu {
  position: fixed; inset: 0; z-index: 110; background: var(--ink); color: var(--paper);
  display: flex; flex-direction: column; justify-content: flex-end;
  padding: 120px 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; }
.mobile-menu a.big {
  display: block; font-size: clamp(2.6rem, 12vw, 4.5rem); font-weight: 600; letter-spacing: -.045em; line-height: 1.1;
  opacity: 0; transform: translateY(30px);
  transition: opacity .6s var(--ease-out), transform .6s var(--ease-out);
}
.menu-open .mobile-menu a.big { opacity: 1; transform: none; }
.menu-open .mobile-menu a.big:nth-child(2) { transition-delay: .08s; }
.menu-open .mobile-menu a.big:nth-child(3) { transition-delay: .16s; }
.menu-open .mobile-menu a.big:nth-child(4) { transition-delay: .24s; }
.mobile-menu__foot { margin-top: 48px; padding-top: 24px; border-top: 1px solid #262626; display: flex; flex-wrap: wrap; gap: 12px 24px; font-family: var(--font-mono); font-size: 13px; color: #a9a9a9; }
.menu-open .site-header { z-index: 115; transform: none; background: transparent; box-shadow: none; -webkit-backdrop-filter: none; backdrop-filter: none; }
.menu-open .site-header .brand__logo { filter: invert(1); }
.menu-open .menu-toggle { background: var(--paper); color: var(--ink); }

/* ==========================================================================
   Hero (home)
   ========================================================================== */
.hero { padding-top: calc(var(--header-h) + clamp(20px, 3.5vw, 48px)); padding-bottom: clamp(40px, 6vw, 80px); }
.hero__top { display: grid; grid-template-columns: 1fr; gap: 32px; }
.hero__title .accent-dot { display: inline-block; width: .18em; height: .18em; border-radius: 50%; background: var(--accent); margin-left: .04em; }
.hero__aside {
  display: flex; justify-content: space-between; align-items: flex-end; gap: 32px; flex-wrap: wrap;
  margin-top: clamp(28px, 4vw, 56px);
}
.hero__aside .lead { max-width: 520px; }
.hero__meta { display: flex; gap: 28px; font-family: var(--font-mono); font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--grey); }
.hero__meta strong { display: block; color: var(--ink); font-weight: 500; }

.showcase {
  position: relative; margin-top: clamp(40px, 6vw, 80px);
  border-radius: var(--radius); overflow: hidden; background: var(--mist);
  aspect-ratio: 16 / 9;
  transform-origin: 50% 0;
}
.showcase__slide {
  position: absolute; inset: 0; opacity: 0; transition: opacity 1.4s var(--ease-in-out);
}
.showcase__slide.is-active { opacity: 1; }
.showcase__slide img { width: 100%; height: 100%; object-fit: cover; transform: scale(1.08); transition: transform 7s linear; }
.showcase__slide.is-active img { transform: scale(1); }
.showcase__ui {
  position: absolute; left: 0; right: 0; bottom: 0; padding: clamp(16px, 2.4vw, 32px);
  display: flex; align-items: center; justify-content: flex-start; gap: 16px;
  color: var(--paper); z-index: 2; pointer-events: none;
}
.showcase__ui .showcase__dots { pointer-events: auto; }
.showcase__dots { display: flex; gap: 8px; }
.showcase__dot { width: 34px; height: 3px; border-radius: 2px; background: rgba(255,255,255,.35); overflow: hidden; position: relative; }
.showcase__dot i { position: absolute; inset: 0; background: var(--paper); transform: scaleX(0); transform-origin: 0 50%; }
.showcase__dot.is-active i { animation: dotfill 6s linear forwards; }
@keyframes dotfill { to { transform: scaleX(1); } }
.showcase__caption { font-family: var(--font-mono); font-size: 12px; letter-spacing: .08em; }

/* ---------- Marquee ---------- */
.marquee { overflow: hidden; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 22px 0; }
.marquee__track { display: flex; width: max-content; animation: marquee 38s linear infinite; }
.marquee:hover .marquee__track { animation-play-state: paused; }
.marquee__item {
  display: inline-flex; align-items: center; gap: 40px; padding-right: 40px;
  font-size: clamp(1.25rem, 2.2vw, 1.9rem); font-weight: 500; letter-spacing: -.025em; white-space: nowrap;
}
.marquee__item::after { content: ""; width: 12px; height: 12px; border-radius: 50%; background: var(--accent); }
.marquee__item:nth-child(even) { color: var(--grey); font-weight: 300; font-style: italic; }
@keyframes marquee { to { transform: translateX(-50%); } }

/* ==========================================================================
   Section heads
   ========================================================================== */
.section-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 32px; flex-wrap: wrap; margin-bottom: clamp(40px, 6vw, 80px); }
.section-head__title { max-width: 900px; }
.section-head__title .eyebrow { margin-bottom: 20px; }

/* ==========================================================================
   Project cards
   ========================================================================== */
.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(28px, 3vw, 44px) clamp(18px, 2vw, 28px); }
.cards--featured { grid-template-columns: repeat(2, 1fr); gap: clamp(40px, 5vw, 80px) clamp(20px, 3vw, 44px); align-items: start; }

.card { display: block; position: relative; }
.card__media {
  position: relative; overflow: hidden; border-radius: var(--radius);
  aspect-ratio: 4 / 3; background: var(--mist);
  transform: translateZ(0);
}
.cards--featured .card__media { aspect-ratio: 5 / 4; }
.card__media img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform 1.2s var(--ease-out), filter .8s;
}
.card:hover .card__media img { transform: scale(1.06); }
.card__media::after {
  content: ""; position: absolute; inset: 0; background: linear-gradient(to top, rgba(0,0,0,.28), transparent 55%);
  opacity: 0; transition: opacity .6s var(--ease-out);
}
.card:hover .card__media::after { opacity: 1; }
.card__tag {
  position: absolute; top: 16px; left: 16px; z-index: 2;
  padding: 7px 10px; border-radius: 3px;
  background: rgba(255,255,255,.88); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  font-family: var(--font-mono); font-size: 11px; letter-spacing: .08em; text-transform: uppercase;
}
.card__go {
  position: absolute; right: 18px; bottom: 18px; z-index: 2;
  width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center;
  background: var(--accent); color: var(--ink);
  transform: scale(.4) rotate(-45deg); opacity: 0;
  transition: transform .6s var(--ease-out), opacity .4s;
}
.card:hover .card__go { transform: scale(1) rotate(-45deg); opacity: 1; }
.card__body { display: grid; gap: 6px; padding: 20px 4px 0; }
.card__title { font-size: clamp(1.1rem, 1.35vw, 1.3rem); font-weight: 600; letter-spacing: -.02em; line-height: 1.2; }
.cards--featured .card__title { font-size: clamp(1.2rem, 1.6vw, 1.5rem); }
.card__summary { color: var(--grey); font-size: 15px; line-height: 1.5; max-width: 46ch; }
.card__title span { background: linear-gradient(currentColor, currentColor) 0 100% / 0 1.5px no-repeat; transition: background-size .6s var(--ease-out); }
.card:hover .card__title span { background-size: 100% 1.5px; }

/* filters */
.filters { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: clamp(32px, 4vw, 56px); }
.chip {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 11px 18px; border-radius: 999px; box-shadow: inset 0 0 0 1px var(--line);
  font-size: 15px; font-weight: 500; transition: background-color .3s, color .3s, box-shadow .3s;
}
.chip sup { font-family: var(--font-mono); font-size: 10px; color: var(--grey); top: -.4em; }
.chip:hover { box-shadow: inset 0 0 0 1px var(--ink); }
.chip.is-active { background: var(--ink); color: var(--paper); box-shadow: none; }
.chip.is-active sup { color: var(--accent); }
.card.is-filtered-out { display: none; }
.card.is-filtering-in { animation: cardIn .7s var(--ease-out) both; }
@keyframes cardIn { from { opacity: 0; transform: translateY(24px) scale(.98); } }

/* ==========================================================================
   About teaser / stats
   ========================================================================== */
.split { display: grid; grid-template-columns: 1.05fr 1fr; gap: clamp(40px, 6vw, 110px); align-items: center; }
.split--top { align-items: start; }
.portrait { border-radius: var(--radius); overflow: hidden; position: relative; aspect-ratio: 4 / 5; background: var(--mist); }
.portrait img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 56% 30%; }
.portrait__badge {
  position: absolute; left: 20px; bottom: 20px; padding: 14px 18px; border-radius: 4px;
  background: rgba(255,255,255,.9); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  font-family: var(--font-mono); font-size: 12px; line-height: 1.5;
}
.portrait__badge strong { font-family: var(--font-sans); font-size: 15px; display: block; letter-spacing: -.01em; }
.prose p + p { margin-top: 1.1em; }
.prose p { color: var(--graphite); }
.stats { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 24px; margin-top: 48px; padding-top: 32px; border-top: 1px solid var(--line); }
.stats > :last-child:not(:first-child) { text-align: right; }
.stat__num { font-size: clamp(1.9rem, 2.8vw, 2.6rem); font-weight: 500; letter-spacing: -.04em; line-height: 1; }
.stat__num sup { color: var(--blue); font-size: .45em; top: -.9em; }
.stat__label { font-family: var(--font-mono); font-size: 12px; color: var(--grey); margin-top: 10px; letter-spacing: .02em; }

/* ==========================================================================
   Services
   ========================================================================== */
.services { border-top: 1px solid #2a2a2a; }
.service {
  display: grid; grid-template-columns: 80px 1fr 1.1fr 40px; gap: 24px; align-items: center;
  padding: clamp(24px, 3vw, 38px) 0; border-bottom: 1px solid #2a2a2a;
  position: relative; transition: padding .6s var(--ease-out);
}
.service::before {
  content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, color-mix(in srgb, var(--accent) 8%, transparent), transparent 70%);
  opacity: 0; transition: opacity .5s;
}
.service:hover::before { opacity: 1; }
.service:hover { padding-left: 16px; }
.service__num { font-family: var(--font-mono); font-size: 13px; color: var(--accent); }
.service__name { font-size: clamp(1.3rem, 2vw, 1.85rem); font-weight: 500; letter-spacing: -.025em; line-height: 1.15; }
.service__desc { color: #a9a9a9; font-size: 16px; max-width: 46ch; }
.service__icon { width: 28px; height: 28px; color: var(--accent); transition: transform .6s var(--ease-out); }
.service:hover .service__icon { transform: rotate(-45deg); }

/* clients */
.clients { display: grid; grid-template-columns: repeat(6, 1fr); border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
.client {
  display: grid; place-items: center; min-height: 140px; padding: 20px; text-align: center;
  border-right: 1px solid var(--line); border-bottom: 1px solid var(--line);
  font-size: clamp(1.05rem, 1.5vw, 1.35rem); font-weight: 600; letter-spacing: -.03em; color: var(--graphite);
  transition: background-color .4s, color .4s;
}
.client small { display: block; font-family: var(--font-mono); font-weight: 400; font-size: 10px; letter-spacing: .1em; text-transform: uppercase; color: var(--grey); margin-top: 6px; }
.client:hover { background: var(--mist); color: var(--ink); }
/* logos: misma caja para todos (alineados), en gris; color al pasar el mouse */
.client { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; }
.client small { margin-top: 0; }
.client__logo, .client__name { display: flex; align-items: center; justify-content: center; height: 48px; width: 100%; }
.client__logo img {
  display: block; max-height: 40px; max-width: min(100%, 150px); width: auto; height: auto; object-fit: contain;
  filter: grayscale(1); opacity: .7; transition: filter .4s, opacity .4s;
}
.client:hover .client__logo img { filter: none; opacity: 1; }

/* ==========================================================================
   CTA
   ========================================================================== */
.cta { text-align: left; position: relative; overflow: hidden; }
.cta__title { font-size: clamp(2.6rem, 6.4vw, 6rem); line-height: 1; letter-spacing: -.04em; font-weight: 500; }
.cta__title a { display: inline-flex; align-items: center; gap: .18em; transition: color .5s var(--ease-out); }
.cta__title a:hover { color: var(--accent); }
.cta__title .cta__circle {
  width: .78em; height: .78em; border-radius: 50%; background: var(--accent); color: var(--ink);
  display: inline-grid; place-items: center; transition: transform .7s var(--ease-out);
}
.cta__title .cta__circle svg { width: 40%; height: 40%; }
.cta__title a:hover .cta__circle { transform: rotate(-45deg) scale(1.06); }
.cta__row { display: flex; justify-content: space-between; align-items: flex-end; gap: 32px; flex-wrap: wrap; margin-top: clamp(40px, 6vw, 80px); }
.cta__mail { font-size: clamp(1.2rem, 2.4vw, 2rem); letter-spacing: -.02em; }

/* ==========================================================================
   Footer
   ========================================================================== */
.site-footer { background: var(--ink); color: var(--paper); padding: 0 0 32px; }
.site-footer__grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 40px; padding: 56px 0 48px; border-top: 1px solid #222; }
.site-footer h4 { font-family: var(--font-mono); font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: #8a8a8a; font-weight: 400; margin-bottom: 18px; }
.site-footer li + li { margin-top: 8px; }
.site-footer .fl {
  position: relative; display: inline-flex; align-items: center; gap: 6px;
  color: #cfcfcf; padding-bottom: 3px; transition: color .35s var(--ease-out), transform .45s var(--ease-out);
}
.site-footer .fl::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 1px; background: var(--accent);
  transform: scaleX(0); transform-origin: right center; transition: transform .55s var(--ease-out);
}
.site-footer .fl:hover { color: var(--paper); }
.site-footer .fl:hover::after { transform: scaleX(1); transform-origin: left center; }
.site-footer ul .fl:hover { transform: translateX(4px); }
.fl__arrow { display: inline-block; color: var(--accent); transition: transform .45s var(--ease-out); }
.fl:hover .fl__arrow { transform: translate(2px, -2px); }
.site-footer__bottom .fl { color: #8a8a8a; }
.socials { display: flex; gap: 10px; margin-top: 28px; }
.social {
  width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center;
  color: var(--paper); box-shadow: inset 0 0 0 1px #333;
  transition: background-color .4s var(--ease-out), color .4s, box-shadow .4s, transform .5s var(--ease-out);
}
.social svg { width: 20px; height: 20px; }
.social:hover { background: var(--accent); color: var(--ink); box-shadow: inset 0 0 0 1px var(--accent); transform: translateY(-3px); }
.site-footer__claim { font-size: clamp(1.5rem, 2.6vw, 2.2rem); font-weight: 500; letter-spacing: -.035em; line-height: 1.15; max-width: 16ch; }
.site-footer__bottom { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; font-family: var(--font-mono); font-size: 12px; color: #8a8a8a; padding-top: 24px; border-top: 1px solid #222; }
.to-top { display: inline-flex; align-items: center; gap: 8px; }
.to-top svg { transform: rotate(-90deg); width: 14px; height: 14px; }

/* ==========================================================================
   Page hero (inner pages)
   ========================================================================== */
.page-hero { padding-top: calc(var(--header-h) + clamp(20px, 3.5vw, 48px)); padding-bottom: clamp(32px, 5vw, 64px); }
.page-hero .eyebrow { margin-bottom: 24px; }
.page-hero__row { display: flex; justify-content: space-between; align-items: flex-end; gap: 32px; flex-wrap: wrap; }
.page-hero__count { font-family: var(--font-mono); font-size: 13px; color: var(--grey); }
.page-hero__count b { font-family: var(--font-sans); color: var(--ink); font-size: clamp(1.9rem, 3vw, 2.8rem); font-weight: 500; letter-spacing: -.04em; margin-right: 8px; vertical-align: -.1em; }

/* ==========================================================================
   Project detail
   ========================================================================== */
.progress { position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 150; transform-origin: 0 50%; transform: scaleX(0); background: var(--accent); }
.crumbs { font-family: var(--font-mono); font-size: 12px; letter-spacing: .06em; color: var(--grey); display: flex; gap: 10px; align-items: center; margin-bottom: 28px; text-transform: uppercase; }
.crumbs a:hover { color: var(--ink); }
/* project hero: full-bleed image + gradient */
.project-hero {
  position: relative; overflow: hidden; isolation: isolate;
  min-height: min(92vh, 880px); display: flex; align-items: flex-end;
  background: #111; color: var(--paper);
  padding: calc(var(--header-h) + 60px) 0 clamp(36px, 5vw, 64px);
}
.project-hero__bg { position: absolute; left: 0; right: 0; top: -6%; bottom: -6%; z-index: -2; }
.project-hero__bg img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 35%; transform: scale(1.08); transition: transform 2.4s var(--ease-out); }
.is-loaded .project-hero__bg img { transform: scale(1); }
.project-hero::after {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background:
    linear-gradient(to top, rgba(0,0,0,.84) 0%, rgba(0,0,0,.55) 38%, rgba(0,0,0,.12) 72%, rgba(0,0,0,.38) 100%),
    linear-gradient(to right, rgba(0,0,0,.35), transparent 65%);
}
.project-hero .crumbs { color: rgba(255,255,255,.72); }
.project-hero .crumbs a:hover { color: var(--paper); }
.project-hero__title { max-width: 18ch; }
.project-hero__lead { max-width: 52ch; margin-top: 20px; color: rgba(255,255,255,.86); }
.hero-zoom {
  display: inline-flex; align-items: center; gap: 10px; margin-top: 26px;
  padding: 10px 16px; border-radius: 999px; font-size: 14px; font-weight: 500;
  background: rgba(255,255,255,.14); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.22); transition: background-color .3s, color .3s;
}
.hero-zoom:hover { background: var(--accent); color: var(--ink); }
.hero-zoom svg { width: 16px; height: 16px; }
.project-hero .project-meta { border-top-color: rgba(255,255,255,.22); }
.project-hero .project-meta dt { color: rgba(255,255,255,.62); }
.project-hero .tags li { background: rgba(255,255,255,.14); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }

/* header over dark hero */
.has-dark-hero .site-header:not(.is-scrolled) .nav__link { color: var(--paper); }
.has-dark-hero .site-header:not(.is-scrolled) .brand__logo { filter: invert(1); }
.has-dark-hero .site-header:not(.is-scrolled) .nav__link:hover { background: rgba(255,255,255,.12); }
.has-dark-hero .site-header:not(.is-scrolled) .nav .btn { --bg: var(--paper); --fg: var(--ink); }
.has-dark-hero .site-header:not(.is-scrolled) .menu-toggle { background: var(--paper); color: var(--ink); }

.project-meta {
  display: grid; grid-template-columns: 1fr 1fr 2fr; gap: 24px;
  margin-top: clamp(32px, 4vw, 52px); padding-top: 24px; border-top: 1px solid var(--line);
}
.project-meta dt { font-family: var(--font-mono); font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--grey); margin-bottom: 8px; }
.project-meta dd { margin: 0; font-weight: 500; }
.tags { display: flex; flex-wrap: wrap; gap: 8px; }
.tags li { padding: 6px 10px; border-radius: 3px; background: var(--mist); font-size: 14px; font-weight: 500; }

.project-cover { display: block; cursor: zoom-in; border-radius: var(--radius); overflow: hidden; background: var(--mist); aspect-ratio: 16 / 9; position: relative; }
.project-cover img { position: absolute; left: 0; top: -6%; width: 100%; height: 112%; object-fit: cover; }
.project-cover--contain img { object-fit: contain; }

.project-body { display: grid; grid-template-columns: 1fr 1.6fr; gap: clamp(32px, 6vw, 110px); }
.project-body__side { position: sticky; top: 110px; align-self: start; }
.project-body__side .h2 { margin-top: 18px; }
.project-body .prose p { font-size: clamp(1.05rem, 1.35vw, 1.22rem); line-height: 1.65; }
.project-body .prose p:first-child { font-size: clamp(1.12rem, 1.5vw, 1.35rem); line-height: 1.5; letter-spacing: -.01em; color: var(--ink); }
.project-body .btn { margin-top: 40px; }

/* gallery */
.gallery { display: grid; grid-template-columns: repeat(2, 1fr); gap: clamp(12px, 1.6vw, 24px); }
.gallery__item {
  position: relative; overflow: hidden; border-radius: var(--radius-sm); background: var(--mist);
  cursor: zoom-in; display: block; width: 100%;
}
.gallery__item--wide { grid-column: 1 / -1; }
.gallery__item img { width: 100%; height: 100%; object-fit: cover; transition: transform 1.1s var(--ease-out); }
.gallery__item:not(.gallery__item--wide) { aspect-ratio: 4 / 3; }
.gallery__item:hover img { transform: scale(1.04); }
.gallery__zoom {
  position: absolute; right: 14px; top: 14px; width: 44px; height: 44px; border-radius: 50%;
  display: grid; place-items: center; background: rgba(255,255,255,.92); color: var(--ink);
  opacity: 0; transform: scale(.7); transition: opacity .35s, transform .5s var(--ease-out);
}
.gallery__zoom svg { width: 18px; height: 18px; }
.gallery__item:hover .gallery__zoom, .gallery__item:focus-visible .gallery__zoom { opacity: 1; transform: none; }
.gallery-note { margin-top: 20px; font-family: var(--font-mono); font-size: 12px; color: var(--grey); text-align: center; }

/* next project */
.next-project { display: block; position: relative; border-top: 1px solid var(--line); padding: clamp(56px, 8vw, 120px) 0; overflow: hidden; }
.next-project .eyebrow { margin-bottom: 20px; }
.next-project__title { display: flex; flex-wrap: wrap; align-items: center; gap: .3em; transition: transform .8s var(--ease-out); }
.next-project:hover .next-project__title { transform: translateX(12px); }
.next-project__thumb {
  position: absolute; right: var(--gutter); top: 50%; width: min(32vw, 420px); aspect-ratio: 4/3;
  border-radius: var(--radius); overflow: hidden;
  transform: translateY(-50%) scale(.9); opacity: 0;
  transition: transform .8s var(--ease-out), opacity .5s;
  pointer-events: none;
}
.next-project__thumb img { width: 100%; height: 100%; object-fit: cover; }
.next-project:hover .next-project__thumb { opacity: 1; transform: translateY(-50%) scale(1); }
/* el título no puede pasar por debajo de la miniatura (se reserva su ancho + margen) */
@media (min-width: 861px) {
  .next-project__title { max-width: calc(100% - min(32vw, 420px) - 48px); }
}

/* ==========================================================================
   Lightbox
   ========================================================================== */
.lightbox {
  position: fixed; inset: 0; z-index: 300; background: rgba(8, 8, 8, .96);
  display: grid; grid-template-rows: auto 1fr auto; color: var(--paper);
  opacity: 0; visibility: hidden; transition: opacity .45s var(--ease-out), visibility 0s linear .45s;
}
.lightbox.is-open { opacity: 1; visibility: visible; transition: opacity .45s var(--ease-out); }
.lightbox__bar { display: flex; justify-content: space-between; align-items: center; padding: 18px var(--gutter); gap: 16px; }
.lightbox__count { font-family: var(--font-mono); font-size: 13px; letter-spacing: .08em; }
.lightbox__count b { color: var(--accent); font-weight: 500; }
.lightbox__title { font-size: 15px; font-weight: 500; color: #bdbdbd; flex: 1; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lightbox__btn {
  width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center;
  background: rgba(255,255,255,.08); color: var(--paper); transition: background-color .3s, color .3s, transform .4s var(--ease-out);
}
.lightbox__btn:hover { background: var(--accent); color: var(--ink); }
.lightbox__btn svg { width: 20px; height: 20px; }
.lightbox__stage { position: relative; display: grid; place-items: center; padding: 0 clamp(16px, 7vw, 110px) 24px; min-height: 0; touch-action: pan-y; }
.lightbox__img {
  max-width: 100%; width: auto; height: auto; object-fit: contain; border-radius: 3px;
  max-height: calc(100vh - 250px); max-height: calc(100dvh - 250px);
  box-shadow: 0 30px 80px -30px rgba(0,0,0,.8);
  user-select: none; -webkit-user-drag: none;
  transition: opacity .35s var(--ease-out), transform .5s var(--ease-out);
}
.lightbox__img.is-loading { opacity: 0; transform: scale(.98); }
.lightbox__img.slide-l { opacity: 0; transform: translateX(-40px); }
.lightbox__img.slide-r { opacity: 0; transform: translateX(40px); }
.lightbox__nav { position: absolute; top: 50%; transform: translateY(-50%); }
.lightbox__nav--prev { left: clamp(8px, 2vw, 32px); }
.lightbox__nav--next { right: clamp(8px, 2vw, 32px); }
.lightbox__nav--prev:hover { transform: translateY(-50%) translateX(-3px); }
.lightbox__nav--next:hover { transform: translateY(-50%) translateX(3px); }
.lightbox__spinner {
  position: absolute; width: 36px; height: 36px; border-radius: 50%;
  border: 2px solid rgba(255,255,255,.15); border-top-color: var(--accent);
  animation: spin .8s linear infinite; opacity: 0; transition: opacity .2s;
}
.lightbox.is-busy .lightbox__spinner { opacity: 1; }
@keyframes spin { to { transform: rotate(360deg); } }
.lightbox__thumbs {
  display: flex; gap: 10px; justify-content: center; padding: 18px var(--gutter) 24px; overflow-x: auto; scrollbar-width: none;
  border-top: 1px solid rgba(255,255,255,.08); background: rgba(0,0,0,.35);
}
.lightbox__thumbs::-webkit-scrollbar { display: none; }
.lightbox__thumb {
  flex: none; width: 88px; height: 60px; border-radius: 3px; overflow: hidden; opacity: .4;
  outline: 2px solid transparent; outline-offset: 2px; transition: opacity .3s, outline-color .3s;
}
.lightbox__thumb img { width: 100%; height: 100%; object-fit: cover; }
.lightbox__thumb:hover { opacity: .8; }
.lightbox__thumb.is-active { opacity: 1; outline-color: var(--accent); }
body.no-scroll { overflow: hidden; }

/* ==========================================================================
   Contact
   ========================================================================== */
.contact-grid { display: grid; grid-template-columns: 1fr 1.2fr; gap: clamp(40px, 7vw, 120px); }
.contact-list li { padding: 22px 0; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; gap: 16px; align-items: baseline; }
.contact-list li:first-child { border-top: 1px solid var(--line); }
.contact-list span { font-family: var(--font-mono); font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: var(--grey); }
.contact-list a { font-size: clamp(1.05rem, 1.6vw, 1.35rem); font-weight: 500; letter-spacing: -.02em; }
.form { display: grid; gap: 18px; }
.form__row { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.field { position: relative; }
.field input, .field textarea, .field select {
  width: 100%; padding: 26px 18px 10px; border-radius: 4px; border: 1px solid var(--line); background: var(--paper);
  font: inherit; font-size: 16px; color: var(--ink); transition: border-color .3s, box-shadow .3s;
  appearance: none;
}
.field textarea { min-height: 170px; resize: vertical; }
.field label {
  position: absolute; left: 18px; top: 18px; color: var(--grey); font-size: 16px; pointer-events: none;
  transform-origin: 0 0; transition: transform .3s var(--ease-out), color .3s;
}
.field input:focus, .field textarea:focus, .field select:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 25%, transparent); }
.field input:focus + label, .field input:not(:placeholder-shown) + label,
.field textarea:focus + label, .field textarea:not(:placeholder-shown) + label,
.field select + label { transform: translateY(-10px) scale(.75); color: var(--graphite); }
.budget { display: flex; flex-wrap: wrap; gap: 8px; }
.budget input { position: absolute; opacity: 0; pointer-events: none; }
.budget label { padding: 10px 16px; border-radius: 999px; box-shadow: inset 0 0 0 1px var(--line); cursor: pointer; font-size: 15px; transition: background-color .3s, color .3s; }
.budget input:checked + label { background: var(--ink); color: var(--paper); box-shadow: none; }
.budget input:focus-visible + label { outline: 2px solid var(--blue); outline-offset: 2px; }
.form__legend { font-family: var(--font-mono); font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: var(--grey); margin-bottom: 10px; display: block; }
.form__note { font-size: 14px; color: var(--grey); }

/* about page */
.timeline li { display: grid; grid-template-columns: 120px 1fr; gap: 24px; padding: 26px 0; border-bottom: 1px solid var(--line); }
.timeline li:first-child { border-top: 1px solid var(--line); }
.timeline__year { font-family: var(--font-mono); font-size: 13px; color: var(--blue); padding-top: 4px; }
.timeline__what { font-size: clamp(1.1rem, 1.6vw, 1.35rem); font-weight: 500; letter-spacing: -.02em; }
.timeline__what small { display: block; font-size: 15px; font-weight: 400; color: var(--grey); letter-spacing: 0; margin-top: 4px; }
.values { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.value { padding: 36px 32px; border-radius: var(--radius); background: var(--paper); transition: transform .6s var(--ease-out), box-shadow .6s; }
.value:hover { transform: translateY(-6px); box-shadow: 0 30px 60px -30px rgba(0,0,0,.2); }
.value__n { font-family: var(--font-mono); font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: var(--blue); }
.value h3 { margin: 28px 0 12px; }
.value p { color: var(--graphite); font-size: 16px; }
.wide-photo { position: relative; border-radius: var(--radius); overflow: hidden; aspect-ratio: 21 / 9; }
.wide-photo img { position: absolute; left: 0; top: -12.5%; width: 100%; height: 125%; object-fit: cover; object-position: 50% 30%; }

/* ==========================================================================
   Scroll reveal animations
   ========================================================================== */
.js [data-reveal] {
  opacity: 0; transform: translateY(40px);
  transition: opacity 1s var(--ease-out), transform 1.1s var(--ease-out);
  transition-delay: var(--d, 0s);
}
.js [data-reveal="fade"] { transform: none; }
.js [data-reveal="scale"] { transform: scale(.94); }
.js [data-reveal="clip"] { opacity: 1; transform: none; clip-path: inset(12% 6% 12% 6% round var(--radius)); transition: clip-path 1.4s var(--ease-out); }
.js [data-reveal].is-in { opacity: 1; transform: none; }
.js [data-reveal="clip"].is-in { clip-path: inset(0 0 0 0 round var(--radius)); }

.js [data-split] .w { display: inline-block; overflow: hidden; vertical-align: top; padding-bottom: .08em; margin-bottom: -.08em; }
.js [data-split] .w > span { display: inline-block; transform: translateY(105%); transition: transform 1.1s var(--ease-out); transition-delay: calc(var(--i) * 55ms + var(--d, 0s)); }
.js [data-split].is-in .w > span { transform: none; }

/* page transition */
.page-fade { position: fixed; inset: 0; z-index: 400; background: var(--paper); pointer-events: none; opacity: 1; transition: opacity .6s var(--ease-out); }
.is-loaded .page-fade { opacity: 0; }
.is-leaving .page-fade { opacity: 1; transition-duration: .35s; }

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 1100px) {
  .cards { grid-template-columns: repeat(2, 1fr); }
  .clients { grid-template-columns: repeat(3, 1fr); }
  .service { grid-template-columns: 60px 1fr 40px; }
  .service__desc { grid-column: 2 / 3; grid-row: 2; }
  .service__icon { grid-column: 3; grid-row: 1; }
}
@media (max-width: 860px) {
  :root { --header-h: 88px; }
  .brand__logo { height: 32px; }
  .site-header.is-scrolled { height: 64px; }
  .site-header.is-scrolled .brand__logo { height: 24px; }
  .nav { display: none; }
  .menu-toggle { display: block; }
  .split, .contact-grid, .project-body { grid-template-columns: 1fr; }
  .project-body__side { position: static; }
  .cards--featured { grid-template-columns: 1fr; }
  .project-meta { grid-template-columns: 1fr 1fr; }
  .project-meta > div:last-child { grid-column: 1 / -1; }
  .site-footer__grid { grid-template-columns: 1fr 1fr; }
  .site-footer__grid > div:first-child { grid-column: 1 / -1; }
  .values { grid-template-columns: 1fr; }
  .next-project__thumb { display: none; }
  .showcase { aspect-ratio: 4 / 3; }
}
@media (max-width: 600px) {
  body { font-size: 16px; }
  .cards { grid-template-columns: 1fr; }
  .gallery { grid-template-columns: 1fr; }
  .gallery__item:not(.gallery__item--wide) { aspect-ratio: auto; }
  .clients { grid-template-columns: repeat(2, 1fr); }
  .form__row { grid-template-columns: 1fr; }
  .hero__meta { gap: 18px; flex-wrap: wrap; }
  .timeline li { grid-template-columns: 1fr; gap: 6px; }
  .lightbox__nav { display: none; }
  .lightbox__title { display: none; }
  .service { grid-template-columns: 40px 1fr 28px; gap: 12px 16px; }
  .wide-photo { aspect-ratio: 4 / 3; }
  .site-header .container { gap: 10px; }
  .brand__logo { height: 30px; }
  .site-header.is-scrolled .brand__logo { height: 25px; }
  .site-header .lang__opt { min-width: 30px; height: 26px; padding: 0 6px; }
  .filters { gap: 8px; }
  .chip { padding: 8px 14px; font-size: 14px; gap: 6px; }
  .chip sup { font-size: 9px; }
}
@media (max-width: 360px) {
  .brand__logo, .site-header.is-scrolled .brand__logo { height: 23px; }
  .chip { padding: 7px 12px; font-size: 13px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; transition-delay: 0s !important; }
  html { scroll-behavior: auto; }
  .js [data-reveal], .js [data-split] .w > span { opacity: 1; transform: none; clip-path: none; }
}
