/* ==========================================================================
   FS Construcciones — sitio público (diseño editorial)
   Paleta monocromática + acento champagne. Tipografías: Manrope (títulos y
   texto) y Cormorant Garamond (carrusel). Sin estilos en línea (CSP estricta).
   ========================================================================== */

:root {
  /* Respaldo en hex para navegadores sin oklch */
  --background: #f9f6f2;
  --foreground: #0f0d0c;
  --card: #f2f0eb;
  --secondary: #e7e4df;
  --muted: #615d59;
  --navy: #1c345c;
  --sky: #8fa8d1;
  --accent: var(--navy);
  --cursor: #5f86c9;
  --border: rgba(15, 13, 12, 0.14);
  --ink: #060605;
  --ink-fg: #f1eee9;
  --ink-muted: rgba(241, 238, 233, 0.55);
  --ink-border: rgba(241, 238, 233, 0.14);

  --text: var(--foreground);
  --radius: 0;
  --font-display: "Cormorant Garamond", Georgia, serif;
  --font-sans: "Manrope", system-ui, -apple-system, "Segoe UI", sans-serif;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-io: cubic-bezier(0.76, 0, 0.24, 1);
  --wrap: 1500px;
  --gutter: clamp(1.5rem, 4vw, 3rem);
}

@supports (color: oklch(0 0 0)) {
  :root {
    --background: oklch(0.975 0.006 85);
    --foreground: oklch(0.16 0.004 60);
    --card: oklch(0.955 0.007 85);
    --secondary: oklch(0.92 0.008 80);
    --muted: oklch(0.48 0.008 70);
    --border: oklch(0.16 0.004 60 / 14%);
    --ink: oklch(0.12 0.003 60);
    --ink-fg: oklch(0.95 0.008 85);
    --ink-muted: oklch(0.95 0.008 85 / 55%);
    --ink-border: oklch(0.95 0.008 85 / 14%);
  }
}

/* Sobre fondos oscuros el acento es una versión clara del azul marino */
.dark, .hero, .intro, .site-header, .mobile-menu, .lightbox, .site-footer { --accent: var(--sky); }

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: auto; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font-sans);
  font-weight: 400;
  line-height: 1.6;
  color: var(--foreground);
  background: var(--background);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
[hidden] { display: none !important; }
h1, h2, h3, p, figure, ul { margin: 0; }
ul { padding: 0; list-style: none; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
img, video { display: block; max-width: 100%; }
::selection { background: var(--navy); color: var(--ink-fg); }
html.no-scroll, html.is-intro { overflow: hidden; }
html.no-scroll .grain::after { animation-play-state: paused; }

.display {
  font-family: var(--font-sans);
  font-weight: 400;
  letter-spacing: -0.025em;
}
.eyebrow {
  font-size: 0.68rem;
  letter-spacing: 0.35em;
  text-transform: uppercase;
  font-weight: 600;
}
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }
.section { padding: 7rem 0; }
@media (min-width: 768px) { .section { padding: 10rem 0; } }
.dark { background: var(--ink); color: var(--ink-fg); }
.sec-num { color: var(--accent); }

/* ---------- Cabecera de sección ---------- */
.sec-head { display: grid; gap: 2rem; margin-bottom: 4rem; }
.sec-eyebrow { color: var(--muted); }
.dark .sec-eyebrow { color: var(--ink-muted); }
.sec-title {
  font-size: clamp(2.5rem, 5.2vw, 4.75rem);
  line-height: 1.04;
}
.sec-lead { color: var(--muted); line-height: 1.8; max-width: 34rem; }
.dark .sec-lead { color: var(--ink-muted); }
@media (min-width: 768px) {
  .sec-head { grid-template-columns: repeat(12, 1fr); margin-bottom: 6rem; }
  .sec-eyebrow { grid-column: span 3; }
  .sec-title { grid-column: span 9; }
  .sec-lead { grid-column: 4 / span 6; }
}

/* ---------- Píldoras / botones ---------- */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 1rem;
  border-radius: 9999px;
  padding: 1.25rem 2rem;
  font-size: 0.68rem;
  letter-spacing: 0.35em;
  text-transform: uppercase;
  font-weight: 600;
  line-height: 1.4;
  transition: transform 0.45s cubic-bezier(0.34, 1.56, 0.64, 1), background-color 0.5s, color 0.5s, border-color 0.5s;
}
.pill svg { width: 1rem; height: 1rem; flex-shrink: 0; transition: transform 0.3s; }
.pill:hover svg { transform: rotate(45deg); }
.pill-outline { border: 1px solid rgba(241, 238, 233, 0.4); color: var(--ink-fg); }
.pill-outline:hover { background: var(--ink-fg); color: var(--ink); }
.pill-solid { background: var(--ink-fg); color: var(--ink); padding: 1.5rem 2.5rem; }
.pill-solid:hover { background: var(--navy); color: var(--ink-fg); }

/* ---------- Grano ---------- */
.grain { position: relative; }
.grain::after {
  content: "";
  position: fixed;
  inset: -50%;
  pointer-events: none;
  z-index: 60;
  opacity: 0.06;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: grain 8s steps(10) infinite;
}
@keyframes grain {
  0%, 100% { transform: translate(0, 0); }
  20% { transform: translate(-5%, 3%); }
  40% { transform: translate(4%, -6%); }
  60% { transform: translate(-3%, 5%); }
  80% { transform: translate(6%, 2%); }
}
@media (max-width: 767px) { .grain::after { animation: none; } }

/* ---------- Intro ---------- */
.intro { display: none; }
html.is-intro .intro {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: var(--ink);
  color: var(--ink-fg);
  clip-path: inset(0 0 0 0);
  transition: clip-path 1.1s var(--ease-io);
}
html.is-intro .intro.is-out { clip-path: inset(0 0 100% 0); }
.intro-logo { position: relative; }
.intro-logo img {
  height: 8rem;
  width: auto;
  clip-path: inset(100% 0 0 0);
  transform: translateY(20px);
  animation: introLogo 1.4s var(--ease-out) forwards;
}
@media (min-width: 768px) { .intro-logo img { height: 10rem; } }
.intro-line {
  position: absolute;
  left: -30%;
  right: -30%;
  top: 0;
  height: 1px;
  background: var(--accent);
  opacity: 0;
  animation: introLine 1.4s var(--ease-out) forwards;
}
.intro-name {
  margin-top: 2.5rem;
  color: var(--ink-muted);
  opacity: 0;
  letter-spacing: 0.1em;
  animation: introName 1.2s 1s forwards;
}
@keyframes introLogo { to { clip-path: inset(0 0 0 0); transform: none; } }
@keyframes introLine {
  0% { transform: translateY(10rem); opacity: 0; }
  50% { opacity: 1; }
  100% { transform: translateY(0); opacity: 0; }
}
@keyframes introName { to { opacity: 1; letter-spacing: 0.5em; } }

/* ---------- Cursor personalizado ---------- */
.cursor-ring, .cursor-dot {
  position: fixed;
  left: 0;
  top: 0;
  pointer-events: none;
  will-change: transform;
  opacity: 0;
  transition: opacity 0.3s;
}
.cursor-ring { z-index: 100; }
.cursor-dot { z-index: 101; }
html.cursor-live .cursor-ring, html.cursor-live .cursor-dot { opacity: 1; }
html.cursor-on, html.cursor-on a, html.cursor-on button, html.cursor-on [data-cursor] { cursor: none; }
.cursor-ring > span {
  position: absolute;
  left: 0;
  top: 0;
  width: 34px;
  height: 34px;
  border-radius: 9999px;
  border: 1px solid var(--cursor);
  transform: translate(-50%, -50%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.55rem;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--ink-fg);
  transition: width 0.35s var(--ease-io), height 0.35s var(--ease-io), background-color 0.35s, border-color 0.35s;
}
.cursor-ring[data-mode="hover"] > span {
  width: 56px;
  height: 56px;
  background: rgba(95, 134, 201, 0.18);
}
@supports (background: color-mix(in oklab, red 50%, blue)) {
  .cursor-ring[data-mode="hover"] > span { background: color-mix(in oklab, var(--cursor) 18%, transparent); }
}
.cursor-ring[data-mode="label"] > span {
  width: 88px;
  height: 88px;
  background: var(--navy);
  border-color: var(--sky);
}
.cursor-dot > span {
  display: block;
  width: 6px;
  height: 6px;
  border-radius: 9999px;
  background: var(--cursor);
  transform: translate(-50%, -50%);
  transition: opacity 0.2s;
}
/* El punto se oculta cuando el anillo muestra el texto "Ver", para no taparlo */
.cursor-ring[data-mode="label"] ~ .cursor-dot > span { opacity: 0; }

/* ---------- Cabecera fija ---------- */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  padding: 1.75rem 0;
  color: var(--ink-fg);
  transition: background-color 0.7s, padding 0.7s, backdrop-filter 0.7s;
}
.site-header.is-solid {
  padding: 1rem 0;
  background: rgba(6, 6, 5, 0.85);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
}
.header-inner {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 var(--gutter);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}
.logo { display: flex; align-items: center; gap: 0.75rem; }
.logo-mark-img { height: 2.25rem; width: auto; }
.logo-text {
  display: none;
  padding-left: 0.75rem;
  border-left: 1px solid var(--ink-border);
}
@media (min-width: 640px) { .logo-text { display: block; } }
.main-nav { display: none; align-items: center; gap: 2.5rem; }
.main-nav > a { color: var(--ink-muted); transition: color 0.3s; }
.main-nav > a:hover { color: var(--ink-fg); }

/* Desplegable de Proyectos en cabecera */
.nav-dropdown { position: relative; }
.nav-dropdown-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  color: var(--ink-muted);
  transition: color 0.3s;
}
.nav-dropdown:hover .nav-dropdown-toggle,
.nav-dropdown:focus-within .nav-dropdown-toggle,
.nav-dropdown.is-open .nav-dropdown-toggle { color: var(--ink-fg); }
.nav-dropdown-chevron {
  flex-shrink: 0;
  transition: transform 0.35s var(--ease-out);
}
.nav-dropdown:hover .nav-dropdown-chevron,
.nav-dropdown:focus-within .nav-dropdown-chevron,
.nav-dropdown.is-open .nav-dropdown-chevron { transform: rotate(180deg); }
.nav-dropdown-menu {
  position: absolute;
  top: calc(100% + 1.25rem);
  left: 50%;
  transform: translateX(-50%) translateY(8px);
  display: grid;
  grid-template-columns: repeat(2, minmax(14rem, 1fr));
  gap: 0.25rem 1.25rem;
  padding: 1.25rem;
  background: rgba(10, 10, 9, 0.96);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  border: 1px solid var(--ink-border);
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.48);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.3s var(--ease-out), transform 0.3s var(--ease-out), visibility 0s 0.3s;
}
/* Puente invisible para que el cursor no cierre el menú al bajar */
.nav-dropdown-menu::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: -1.35rem;
  height: 1.35rem;
}
.nav-dropdown:hover .nav-dropdown-menu,
.nav-dropdown:focus-within .nav-dropdown-menu,
.nav-dropdown.is-open .nav-dropdown-menu {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateX(-50%) translateY(0);
  transition: opacity 0.3s var(--ease-out), transform 0.3s var(--ease-out), visibility 0s;
}
.nav-dropdown-link {
  display: flex;
  align-items: center;
  padding: 0.6rem 0.75rem;
  font-size: 0.64rem;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  font-weight: 600;
  line-height: 1.4;
  color: var(--ink-muted);
  transition: color 0.25s, background-color 0.25s, padding-left 0.25s;
}
.nav-dropdown-link:hover,
.nav-dropdown-link:focus-visible {
  color: var(--ink-fg);
  background: rgba(143, 168, 209, 0.1);
  padding-left: 1rem;
  outline: none;
}
.nav-dropdown-link--all {
  grid-column: 1 / -1;
  margin-top: 0.4rem;
  padding-top: 0.85rem;
  border-top: 1px solid var(--ink-border);
  color: var(--accent);
}

.header-cta {
  display: none;
  padding: 0.75rem 1.5rem;
  border: 1px solid rgba(143, 168, 209, 0.35);
  background: var(--navy);
  color: var(--ink-fg);
  transition: background-color 0.3s, color 0.3s, border-color 0.3s;
}
.header-cta:hover { background: var(--ink-fg); border-color: var(--ink-fg); color: var(--ink); }
.menu-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  border: 1px solid var(--ink-border);
  border-radius: 9999px;
  color: inherit;
  transition: border-color 0.3s, background-color 0.3s;
}
.menu-btn:hover { border-color: var(--accent); background: rgba(143, 168, 209, 0.1); }
@media (min-width: 768px) {
  .main-nav { display: flex; }
  .header-cta { display: block; }
  .menu-btn { display: none; }
}

/* ---------- Menú móvil ---------- */
.mobile-menu {
  position: fixed;
  inset: 0;
  height: 100vh;
  height: 100dvh;
  z-index: 70;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 1.25rem var(--gutter) 1.75rem;
  overflow-y: auto;
  overscroll-behavior: contain;
  background: linear-gradient(165deg, #0c0e13 0%, var(--ink) 55%, #090b0f 100%);
  color: var(--ink-fg);
  clip-path: circle(0% at calc(100% - 2.5rem) 2.5rem);
  visibility: hidden;
  transition: clip-path 0.7s var(--ease-io), visibility 0s 0.7s;
}
.mobile-menu.is-open {
  clip-path: circle(150% at calc(100% - 2.5rem) 2.5rem);
  visibility: visible;
  transition: clip-path 0.7s var(--ease-io), visibility 0s;
}
.mobile-menu-mark {
  position: fixed;
  right: -14%;
  bottom: 12%;
  height: 52%;
  width: auto;
  opacity: 0.04;
  pointer-events: none;
}
.mobile-menu-head {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--ink-border);
  flex-shrink: 0;
}
.mobile-logo-text {
  padding-left: 0.75rem;
  border-left: 1px solid var(--ink-border);
}
.menu-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  border: 1px solid var(--ink-border);
  border-radius: 9999px;
  color: var(--ink-fg);
  transition: background-color 0.3s, color 0.3s, border-color 0.3s, transform 0.3s var(--ease-out);
}
.menu-close:hover {
  background: var(--ink-fg);
  border-color: var(--ink-fg);
  color: var(--ink);
  transform: rotate(90deg);
}
.mobile-menu-links {
  position: relative;
  display: flex;
  flex-direction: column;
  margin-bottom: auto;
}
.mobile-nav-item {
  border-bottom: 1px solid var(--ink-border);
  padding: 1.05rem 0;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.45s var(--ease-out), transform 0.45s var(--ease-out);
}
.mobile-nav-item:first-child { border-top: 0; }
a.mobile-nav-item,
.mobile-nav-title {
  display: flex;
  align-items: baseline;
  gap: 0.85rem;
}
.mobile-nav-num {
  color: var(--accent);
  min-width: 1.65rem;
}
.mobile-nav-label {
  font-family: var(--font-sans);
  font-weight: 400;
  letter-spacing: -0.025em;
  font-size: clamp(1.6rem, 6.2vw, 2.25rem);
  line-height: 1.15;
  transition: color 0.25s, transform 0.3s var(--ease-out);
}
a.mobile-nav-item:hover .mobile-nav-label,
.mobile-nav-title:hover .mobile-nav-label {
  color: var(--accent);
  transform: translateX(0.35rem);
}
.mobile-nav-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.mobile-sub-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  flex-shrink: 0;
  border: 1px solid var(--ink-border);
  border-radius: 9999px;
  color: var(--ink-muted);
  transition: color 0.3s, border-color 0.3s, background-color 0.3s;
}
.mobile-sub-toggle svg { transition: transform 0.35s var(--ease-out); }
.mobile-nav-group.is-open .mobile-sub-toggle {
  color: var(--ink-fg);
  border-color: var(--accent);
  background: rgba(143, 168, 209, 0.12);
}
.mobile-nav-group.is-open .mobile-sub-toggle svg { transform: rotate(180deg); }
.mobile-sub-links {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.4s var(--ease-io), margin-top 0.4s;
}
.mobile-sub-links > div {
  overflow: hidden;
  min-height: 0;
  padding-left: 2.5rem;
}
.mobile-nav-group.is-open .mobile-sub-links {
  grid-template-rows: 1fr;
  margin-top: 0.85rem;
}
.mobile-sub-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.25rem 0.85rem;
  padding-left: 0.85rem;
  border-left: 1px solid var(--ink-border);
}
@media (min-width: 400px) {
  .mobile-sub-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.mobile-sub-link {
  display: block;
  padding: 0.4rem 0;
  font-size: 0.6rem;
  letter-spacing: 0.2em;
  line-height: 1.45;
  color: var(--ink-muted);
  transition: color 0.25s, transform 0.25s;
}
.mobile-sub-link:hover { color: var(--ink-fg); transform: translateX(0.25rem); }
.mobile-sub-link--all {
  margin-top: 0.55rem;
  padding-top: 0.55rem;
  padding-left: 0.85rem;
  border-top: 1px solid var(--ink-border);
  color: var(--accent);
}

.mobile-menu-foot {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
  padding-top: 0.5rem;
  flex-shrink: 0;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.45s var(--ease-out), transform 0.45s var(--ease-out);
}
.mobile-menu-cta {
  width: 100%;
  justify-content: center;
  padding: 1.1rem 1.5rem;
  background: var(--navy);
  border: 1px solid rgba(143, 168, 209, 0.4);
  color: var(--ink-fg);
}
.mobile-menu-cta:hover { background: var(--ink-fg); color: var(--ink); border-color: var(--ink-fg); }
.mobile-menu-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem 1rem;
}
.mobile-menu-phone {
  color: var(--ink-muted);
  letter-spacing: 0.2em;
  transition: color 0.25s;
}
.mobile-menu-phone:hover { color: var(--ink-fg); }
.mobile-menu-socials { display: flex; gap: 0.5rem; }
.mobile-menu-socials .social-btn { width: 2.35rem; height: 2.35rem; }

.mobile-menu.is-open .mobile-nav-item,
.mobile-menu.is-open .mobile-menu-foot { opacity: 1; transform: none; }
.mobile-menu.is-open .mobile-menu-links > :nth-child(1) { transition-delay: 0.16s; }
.mobile-menu.is-open .mobile-menu-links > :nth-child(2) { transition-delay: 0.22s; }
.mobile-menu.is-open .mobile-menu-links > :nth-child(3) { transition-delay: 0.28s; }
.mobile-menu.is-open .mobile-menu-foot { transition-delay: 0.34s; }

/* ---------- Animaciones de entrada (solo con JS y sin "movimiento reducido") ---------- */
html.anim [data-reveal] {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 1.1s var(--ease-out), transform 1.1s var(--ease-out);
}
html.anim [data-reveal].is-in { opacity: 1; transform: none; }

.ln {
  display: block;
  overflow: hidden;
  padding: 0.14em 0.06em 0.12em;
  margin: -0.14em -0.06em -0.12em;
}
.ln-in { display: block; }
html.anim .ln-in { transform: translateY(110%); transition: transform 1.2s var(--ease-out); }
html.anim .is-in .ln-in { transform: none; }
.ln-accent { font-style: normal; color: var(--accent); }

html.anim .imgrev img,
html.anim .imgrev video { transform: scale(1.3); transition: transform 1.8s var(--ease-out); }
html.anim .imgrev::after {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--ink);
  transform-origin: top;
  transition: transform 1.2s var(--ease-io);
  pointer-events: none;
}
html.anim .imgrev.is-in img,
html.anim .imgrev.is-in video { transform: none; }
html.anim .imgrev.is-in::after { transform: scaleY(0); }
.imgrev { position: relative; overflow: hidden; }
.imgrev img,
.imgrev video { width: 100%; height: 100%; object-fit: cover; }

/* ---------- Portada ---------- */
.hero {
  position: relative;
  height: 100vh;
  height: 100svh;
  min-height: 640px;
  overflow: hidden;
  background: var(--ink);
  color: var(--ink-fg);
}
.hero-media { position: absolute; inset: 0; will-change: transform; }
.hero-img,
.hero-video { width: 100%; height: 100%; object-fit: cover; opacity: 0.55; }
html.anim .hero-img,
html.anim .hero-video { transform: scale(1.35); }
html.anim.hero-in .hero-img,
html.anim.hero-in .hero-video { transform: scale(1.08); transition: transform 4s var(--ease-out); }
.hero-shade {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, var(--ink) 0%, rgba(6, 6, 5, 0.3) 50%, rgba(6, 6, 5, 0.6) 100%);
}
.hero-mark {
  display: none;
  position: absolute;
  right: 6%;
  top: 18%;
  height: 48%;
  width: auto;
  opacity: 0.14;
  pointer-events: none;
}
@media (min-width: 768px) { .hero-mark { display: block; } }
html.anim .hero-mark { opacity: 0; transform: translateY(40px); }
html.anim.hero-in .hero-mark {
  opacity: 0.14;
  transform: none;
  transition: opacity 2s var(--ease-out) 0.6s, transform 2s var(--ease-out) 0.6s;
}
.hero-lines {
  position: absolute;
  inset: 0;
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 var(--gutter);
  pointer-events: none;
}
.hero-lines span {
  position: absolute;
  top: 0;
  height: 100%;
  width: 1px;
  background: var(--ink-border);
  transform-origin: top;
}
.hero-lines span:nth-child(1) { left: 20%; }
.hero-lines span:nth-child(2) { left: 40%; }
.hero-lines span:nth-child(3) { left: 60%; }
.hero-lines span:nth-child(4) { left: 80%; }
html.anim .hero-lines span { transform: scaleY(0); }
html.anim.hero-in .hero-lines span { transform: scaleY(1); transition: transform 1.6s var(--ease-io); }
html.anim.hero-in .hero-lines span:nth-child(2) { transition-delay: 0.15s; }
html.anim.hero-in .hero-lines span:nth-child(3) { transition-delay: 0.3s; }
html.anim.hero-in .hero-lines span:nth-child(4) { transition-delay: 0.45s; }

.hero-content {
  position: relative;
  max-width: var(--wrap);
  margin: 0 auto;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 0 var(--gutter) 4rem;
}
@media (min-width: 768px) { .hero-content { padding-bottom: 6rem; } }
.hero-eyebrow { color: var(--accent); margin-bottom: 2rem; }
html.anim .hero-eyebrow { opacity: 0; }
html.anim.hero-in .hero-eyebrow { opacity: 1; transition: opacity 1s 0.4s; }
.hero-title {
  font-size: min(12.5vw, 16vh);
  font-size: min(12.5vw, 16svh);
  line-height: 0.96;
  letter-spacing: -0.03em;
}
@media (min-width: 768px) {
  .hero-title { font-size: min(8vw, 16vh); font-size: min(8vw, 16svh); }
}
html.anim .hero-title .ln-in { transform: none; transition: none; }
.hero-title .ch { display: inline-block; }
html.anim .hero-title .ch { transform: translateY(110%); transition: transform 1.2s var(--ease-out); }
html.anim.hero-in .hero-title .ch { transform: none; }
.hero-title .ln-in.is-accent { font-style: normal; }
@media (min-width: 768px) { .hero-title .ln-in.is-accent { padding-left: 12vw; } }
.hero-bottom {
  display: flex;
  flex-direction: column;
  gap: 2rem;
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid var(--ink-border);
}
@media (min-width: 768px) {
  .hero-bottom { flex-direction: row; align-items: flex-end; justify-content: space-between; }
}
.hero-lead { max-width: 28rem; font-size: 0.875rem; line-height: 1.7; color: var(--ink-muted); }
html.anim .hero-bottom { opacity: 0; transform: translateY(20px); }
html.anim.hero-in .hero-bottom { opacity: 1; transform: none; transition: opacity 1s 0.7s, transform 1s 0.7s; }

/* ---------- Franja de servicios (única sección con tipografía cursiva) ---------- */
.marquee {
  overflow: hidden;
  padding: 2rem 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  background: var(--background);
}
.marquee-track {
  display: flex;
  width: max-content;
  white-space: nowrap;
  font-family: var(--font-display);
  font-weight: 300;
  font-style: italic;
  font-size: clamp(2.25rem, 5vw, 3.75rem);
  animation: marquee 40s linear infinite;
}
.marquee-track span { display: flex; align-items: center; gap: 4rem; padding-right: 4rem; }
.marquee-track i { font-style: normal; color: var(--accent); font-size: 1.5rem; }
@keyframes marquee { to { transform: translateX(-50%); } }

/* ---------- 01 ¿Qué quieres construir? ---------- */
.choose .wrap, .portfolio .wrap { position: relative; }
.choose-grid { display: grid; gap: 1.5rem; }
@media (min-width: 768px) { .choose-grid { grid-template-columns: repeat(3, 1fr); } }
.choose-card { display: block; }
.choose-frame { overflow: hidden; }
.choose-media { aspect-ratio: 3 / 4; transition: transform 1.4s ease-out; }
.choose-card:hover .choose-media { transform: scale(1.04); }
.choose-body {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 1.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border);
}
.choose-n { color: var(--muted); }
.choose-body h3 { margin-top: 0.5rem; font-size: 1.5rem; font-weight: 500; line-height: 1.25; }
.choose-desc { margin-top: 0.75rem; font-size: 0.875rem; line-height: 1.7; color: var(--muted); }
.choose-arrow svg { width: 1.25rem; height: 1.25rem; transition: transform 0.5s; }
.choose-card:hover .choose-arrow svg { transform: rotate(45deg); }

/* ---------- 02 Servicios ---------- */
.services-layout { display: grid; gap: 3rem; }
@media (min-width: 768px) {
  .services-layout { grid-template-columns: repeat(12, 1fr); }
  .svc-list { grid-column: span 7; }
  .svc-stage { grid-column: 8 / span 5; }
}
.svc-item {
  position: relative;
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 1rem;
  align-items: baseline;
  padding: 1.5rem 0;
  border-top: 1px solid var(--ink-border);
  outline: none;
  cursor: default;
}
.svc-item:last-child { border-bottom: 1px solid var(--ink-border); }
.svc-bar {
  position: absolute;
  left: 0;
  top: -1px;
  width: 0;
  height: 1px;
  background: var(--accent);
  transition: width 0.7s var(--ease-io);
}
.svc-item.is-active .svc-bar { width: 100%; }
.svc-num { grid-column: span 2; color: var(--ink-muted); transition: color 0.5s; }
.svc-item.is-active .svc-num { color: var(--accent); }
.svc-main { grid-column: span 10; }
.svc-title {
  font-size: clamp(1.5rem, 2.4vw, 2.15rem);
  line-height: 1.2;
  opacity: 0.45;
  transition: opacity 0.5s ease-out, transform 0.5s ease-out, color 0.5s ease-out;
}
.svc-item.is-active .svc-title { opacity: 1; transform: translateX(0.75rem); font-style: normal; color: var(--accent); }
.svc-desc {
  display: grid;
  grid-template-rows: 0fr;
  opacity: 0;
  font-size: 0.875rem;
  line-height: 1.7;
  color: var(--ink-muted);
  transition: grid-template-rows 0.5s, opacity 0.5s, margin-top 0.5s;
}
.svc-desc > div { overflow: hidden; min-height: 0; }
.svc-item.is-active .svc-desc { grid-template-rows: 1fr; opacity: 1; margin-top: 0.75rem; }
@media (min-width: 768px) { .svc-desc > div { padding-left: 0.75rem; } }
.svc-mobile-media { display: none; }
.service-link { display: inline-block; margin-top: 1rem; color: var(--accent); }
.svc-stage { display: none; }
@media (min-width: 768px) { .svc-stage { display: block; } }
.svc-frame {
  position: sticky;
  top: 7rem;
  aspect-ratio: 4 / 5;
  overflow: hidden;
  background: var(--ink);
}
.svc-img,
.svc-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transform: scale(1.1);
  clip-path: inset(0 0 100% 0);
  transition: opacity 0.9s var(--ease-io), transform 0.9s var(--ease-io), clip-path 0.9s var(--ease-io);
}
.svc-img.is-active,
.svc-video.is-active { opacity: 1; transform: none; clip-path: inset(0 0 0 0); }
.svc-caption {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.5rem;
  background: linear-gradient(to top, rgba(6, 6, 5, 0.8), transparent);
}
.svc-cap-titles { position: relative; flex: 1; min-height: 2rem; }
.svc-cap-title {
  position: absolute;
  left: 0;
  bottom: 0;
  font-size: 1.25rem;
  font-weight: 500;
  line-height: 1.25;
  opacity: 0;
  transition: opacity 0.4s;
}
.svc-cap-title.is-active { opacity: 1; }
.svc-cap-count { color: var(--accent); white-space: nowrap; }

/* ---------- 03 / 04 Bloques técnicos ---------- */
.tech-alt { background: var(--card); }
.tech-grid { display: grid; gap: 4rem; }
@media (min-width: 768px) {
  .tech-grid { grid-template-columns: repeat(12, 1fr); }
  .tech-left { grid-column: span 5; }
  .tech-right { grid-column: 7 / span 6; }
}
.tech-media { aspect-ratio: 4 / 5; }
.tech-intro { margin-top: 2rem; line-height: 1.8; color: var(--muted); }
.tech-step { padding: 2.5rem 0; border-top: 1px solid var(--border); }
.tech-num { font-size: 3rem; font-weight: 300; line-height: 1; color: var(--accent); }
.tech-step h3 { margin-top: 1rem; font-size: 1.5rem; font-weight: 500; line-height: 1.25; }
.tech-text { margin-top: 1rem; line-height: 1.8; color: var(--muted); }

/* ---------- 05 Estudio ---------- */
.studio { position: relative; overflow: hidden; padding: 8rem 0; }
@media (min-width: 768px) { .studio { padding: 12rem 0; } }
.studio-mark {
  position: absolute;
  right: -10%;
  top: 5%;
  height: 90%;
  width: auto;
  opacity: 0.04;
  pointer-events: none;
  will-change: transform;
}
.studio-eyebrow { position: relative; margin-bottom: 3rem; color: var(--accent); }
.studio-title { font-size: clamp(2.5rem, 5.5vw, 7rem); line-height: 1.06; }
.studio-title .w { display: inline-block; }
.studio-title em { font-style: normal; color: var(--accent); }
html.anim .studio-title .w { opacity: 0.12; transition: opacity 0.6s; }
html.anim .studio-title .w.is-in { opacity: 1; }
.studio-grid { display: grid; gap: 3rem; margin-top: 5rem; }
@media (min-width: 768px) {
  .studio-grid { grid-template-columns: repeat(12, 1fr); gap: 3rem; }
  .studio-media { grid-column: span 7; }
  .studio-side { grid-column: 9 / span 4; }
}
.studio-media img,
.studio-media video { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; transform-origin: center; }
.studio-side { display: flex; flex-direction: column; justify-content: space-between; }
.studio-lead { line-height: 1.8; color: var(--ink-muted); }
.studio-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid var(--ink-border);
}
.stat { font-size: 3.25rem; font-weight: 300; line-height: 1.1; }
.studio-stats .eyebrow { margin-top: 0.5rem; color: var(--ink-muted); }

/* ---------- 06 Por qué elegirnos ---------- */
.why-grid { display: grid; border-left: 1px solid var(--border); }
@media (min-width: 768px) { .why-grid { grid-template-columns: repeat(4, 1fr); } }
.why-card {
  position: relative;
  overflow: hidden;
  padding: 2rem;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  border-right: 1px solid var(--border);
}
@media (min-width: 768px) { .why-card { min-height: 380px; } }
.why-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--ink);
  transform-origin: bottom;
  transform: scaleY(0);
  transition: transform 0.7s var(--ease-io);
}
.why-card:hover::before { transform: scaleY(1); }
.why-card-in {
  position: relative;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 4rem;
  transition: color 0.5s;
}
.why-card:hover .why-card-in { color: var(--ink-fg); }
.why-num { font-size: 3.5rem; font-weight: 300; line-height: 1; color: var(--accent); }
.why-card h3 { font-size: 1.5rem; font-weight: 500; line-height: 1.25; }
.why-card p:not(.why-num) { margin-top: 0.75rem; font-size: 0.875rem; line-height: 1.7; opacity: 0.7; }

/* ---------- 07 Proceso ---------- */
.process { background: var(--card); }
.process-track { position: relative; }
.process-line, .process-fill {
  display: none;
  position: absolute;
  left: 0;
  right: 0;
  top: 7px;
  height: 1px;
}
.process-line { background: var(--border); }
.process-fill { background: var(--accent); transform-origin: left; }
@media (min-width: 768px) { .process-line, .process-fill { display: block; } }
.process-grid { position: relative; display: grid; gap: 3rem; }
@media (min-width: 768px) { .process-grid { grid-template-columns: repeat(4, 1fr); } }
.process-dot {
  display: block;
  position: relative;
  width: 15px;
  height: 15px;
  border-radius: 9999px;
  border: 1px solid var(--accent);
  background: var(--background);
}
.process-number { margin-top: 2rem; color: var(--accent); }
.process-step h3 { margin-top: 0.75rem; font-size: 1.75rem; font-weight: 500; line-height: 1.2; }
.process-desc { margin-top: 1rem; font-size: 0.875rem; line-height: 1.7; color: var(--muted); }

/* ---------- 08 Portafolio ---------- */
.gallery-filters { display: flex; flex-wrap: wrap; gap: 0.75rem 2rem; margin-bottom: 3.5rem; }
.gallery-filter {
  position: relative;
  padding-bottom: 0.5rem;
  font-size: 0.68rem;
  letter-spacing: 0.35em;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--muted);
  transition: color 0.3s;
}
.gallery-filter::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 1px;
  background: var(--foreground);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.5s var(--ease-io);
}
.gallery-filter:hover, .gallery-filter.is-active { color: var(--foreground); }
.gallery-filter.is-active::after { transform: scaleX(1); }
.gallery-grid { display: grid; grid-template-columns: 1fr; gap: 1.5rem; }
@media (min-width: 640px) { .gallery-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .gallery-grid { grid-template-columns: repeat(3, 1fr); } }
.gallery-item { position: relative; display: block; width: 100%; text-align: left; }
.gallery-thumb { display: block; overflow: hidden; aspect-ratio: 4 / 5; background: var(--secondary); }
.gallery-item[data-ratio="square"] .gallery-thumb { aspect-ratio: 1 / 1; }
.gallery-item[data-ratio="wide"] .gallery-thumb { aspect-ratio: 4 / 3; }
.gallery-thumb img,
.gallery-thumb video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: grayscale(35%);
  transition: transform 1.2s ease, filter 1.2s ease;
}
.gallery-thumb video { pointer-events: none; }
.gallery-item:hover .gallery-thumb img,
.gallery-item:hover .gallery-thumb video { transform: scale(1.05); filter: none; }
.gallery-meta { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; margin-top: 0.75rem; }
.gallery-title { font-size: 1.125rem; font-weight: 500; line-height: 1.25; }
.gallery-cat { color: var(--muted); text-align: right; }
.gallery-item.is-pop { animation: popIn 0.7s var(--ease-out) both; }
@keyframes popIn {
  from { opacity: 0; transform: translateY(30px) scale(0.96); }
  to { opacity: 1; transform: none; }
}
.gallery-more {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 14rem;
  border: 1px solid var(--border);
  transition: background-color 0.4s, color 0.4s;
}
.gallery-more:hover { background: var(--ink); color: var(--ink-fg); }
.gallery-more-icon { font-size: 1.75rem; line-height: 1; }
.gallery-more-title { font-family: var(--font-sans); font-weight: 500; font-size: 1.35rem; letter-spacing: -0.01em; }
.gallery-more-count { font-size: 0.68rem; letter-spacing: 0.35em; text-transform: uppercase; font-weight: 600; color: var(--muted); }
.gallery-more:hover .gallery-more-count { color: var(--ink-muted); }
.gallery-footnote { margin-top: 3rem; font-size: 0.9rem; color: var(--muted); }
.gallery-footnote a { color: var(--foreground); border-bottom: 1px solid var(--accent); }

/* Visor */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  background: rgba(6, 6, 5, 0.96);
  color: var(--ink-fg);
  opacity: 0;
  will-change: opacity;
  transition: opacity 0.28s var(--ease-out);
}
.lightbox.is-open { opacity: 1; }
.lightbox-figure {
  max-height: 100%;
  opacity: 0;
  transform: translate3d(0, 14px, 0) scale(0.96);
  will-change: transform, opacity;
  transition: transform 0.36s var(--ease-out), opacity 0.28s var(--ease-out);
}
.lightbox.is-open .lightbox-figure {
  opacity: 1;
  transform: translate3d(0, 0, 0) scale(1);
}
.lightbox-figure img,
.lightbox-figure video { max-height: 80vh; max-width: 100%; width: auto; object-fit: contain; margin: 0 auto; }
.lightbox-figure figcaption { display: flex; justify-content: space-between; gap: 2rem; margin-top: 1rem; }
.lightbox-figure figcaption .display { font-size: 1.25rem; font-weight: 500; }
.lightbox-figure figcaption .eyebrow { color: var(--ink-muted); }
.lightbox-close { position: absolute; top: 1.5rem; right: 1.5rem; color: inherit; }
.lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 3rem;
  height: 3rem;
  border: 1px solid var(--ink-border);
  border-radius: 9999px;
  font-size: 1.25rem;
  color: inherit;
  transition: background-color 0.3s, color 0.3s;
}
.lightbox-nav:hover { background: var(--ink-fg); color: var(--ink); }
.lightbox-prev { left: 1.5rem; }
.lightbox-next { right: 1.5rem; }
@media (max-width: 767px) { .lightbox-nav { top: auto; bottom: 1.5rem; transform: none; } }

/* ---------- 09 Contacto ---------- */
.contact-grid { display: grid; gap: 5rem; }
@media (min-width: 768px) {
  .contact-grid { grid-template-columns: repeat(12, 1fr); }
  .contact-info { grid-column: span 5; }
  .contact-form-wrap { grid-column: 7 / span 6; }
}
.contact-eyebrow { margin-bottom: 2.5rem; color: var(--accent); }
.contact-title { font-size: clamp(2.75rem, 5vw, 4.5rem); line-height: 1.04; }
.contact-lead { margin-top: 2rem; max-width: 26rem; line-height: 1.8; color: var(--ink-muted); }
.contact-list { display: grid; gap: 1.75rem; margin-top: 3.5rem; color: var(--ink-muted); }
.contact-list strong {
  display: block;
  margin-bottom: 0.4rem;
  font-size: 0.68rem;
  letter-spacing: 0.35em;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--accent);
}
.contact-list a { display: block; transition: color 0.3s; }
.contact-list a:hover { color: var(--ink-fg); }
.contact-list .phone-link {
  font-family: var(--font-sans);
  font-weight: 400;
  letter-spacing: -0.02em;
  font-size: 1.65rem;
  color: var(--ink-fg);
}
.contact-list .phone-link:hover { color: var(--accent); }
.social-buttons { display: flex; gap: 0.75rem; margin-top: 2.5rem; }
.social-btn {
  display: grid;
  place-items: center;
  width: 2.75rem;
  height: 2.75rem;
  border: 1px solid var(--ink-border);
  border-radius: 9999px;
  color: var(--ink-muted);
  transition: background-color 0.3s, color 0.3s;
}
.social-btn svg { width: 1.1rem; height: 1.1rem; }
.social-btn:hover { background: var(--ink-fg); color: var(--ink); }

.contact-tabs { display: flex; flex-wrap: wrap; gap: 0.75rem 2rem; margin-bottom: 2.5rem; border-bottom: 1px solid var(--ink-border); }
.contact-tab {
  position: relative;
  padding-bottom: 1rem;
  font-size: 0.68rem;
  letter-spacing: 0.35em;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--ink-muted);
  transition: color 0.3s;
}
.contact-tab::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 1px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.5s var(--ease-io);
}
.contact-tab:hover, .contact-tab.is-active { color: var(--ink-fg); }
.contact-tab.is-active::after { transform: scaleX(1); }

.form-alert { margin-bottom: 1.5rem; padding: 1rem 1.25rem; border: 1px solid var(--accent); font-size: 0.9rem; color: var(--ink-fg); }
.form-row { margin-bottom: 1.5rem; }
.form-row-split { display: grid; gap: 1.5rem; }
@media (min-width: 640px) { .form-row-split { grid-template-columns: 1fr 1fr; } }
.form-row > label {
  display: block;
  font-size: 0.68rem;
  letter-spacing: 0.35em;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--ink-muted);
}
.contact-form input:not([type="file"]), .contact-form select, .contact-form textarea {
  display: block;
  width: 100%;
  padding: 1rem 0;
  border: 0;
  border-bottom: 1px solid var(--ink-border);
  border-radius: 0;
  background: transparent;
  color: var(--ink-fg);
  font: inherit;
  font-size: 1.125rem;
  outline: none;
  transition: border-color 0.3s;
}
.contact-form textarea { resize: vertical; min-height: 7rem; }
.contact-form input:not([type="file"]):focus, .contact-form select:focus, .contact-form textarea:focus { border-bottom-color: var(--accent); }
.contact-form ::placeholder { color: var(--ink-muted); opacity: 1; }
.contact-form select {
  -webkit-appearance: none;
  appearance: none;
  padding-right: 1.75rem;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8' fill='none' stroke='%238fa8d1' stroke-width='1.5'%3E%3Cpath d='M1 1l5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.25rem center;
}
.contact-form select option { background: var(--ink); color: var(--ink-fg); }

/* Selector de archivo CV */
.file-picker {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  border-bottom: 1px solid var(--ink-border);
  transition: border-color 0.3s;
}
.file-picker:hover,
.file-picker:focus-within { border-bottom-color: var(--accent); }
.file-picker input[type="file"] {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.file-picker-label {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex: 1;
  min-width: 0;
  padding: 1rem 0;
  cursor: pointer;
  color: var(--ink-muted);
  transition: color 0.3s;
}
.file-picker-label svg { flex-shrink: 0; color: var(--accent); }
.file-picker-label:hover { color: var(--ink-fg); }
.file-picker.has-file .file-picker-label { color: var(--ink-fg); }
.file-picker-text {
  font-size: 1rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.file-picker-clear {
  flex-shrink: 0;
  padding: 0.4rem 0.65rem;
  border: 1px solid var(--ink-border);
  color: var(--ink-muted);
  transition: color 0.3s, border-color 0.3s;
}
.file-picker-clear:hover { color: var(--ink-fg); border-color: var(--accent); }

.errorlist { margin: 0.5rem 0 0; padding: 0; list-style: none; font-size: 0.85rem; color: #e6a3a3; }
.form-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 1.5rem; padding-top: 1.5rem; }
.wa-link {
  color: var(--ink-muted);
  border-bottom: 1px solid var(--ink-border);
  padding-bottom: 0.3rem;
  transition: color 0.3s, border-color 0.3s;
}
.wa-link:hover { color: var(--ink-fg); border-color: var(--accent); }

/* ---------- Pie ---------- */
.site-footer { overflow: hidden; padding-bottom: 2.5rem; background: var(--ink); color: var(--ink-fg); }
.footer-inner {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 3rem var(--gutter) 0;
  border-top: 1px solid var(--ink-border);
}
.footer-grid { display: grid; gap: 3rem; align-items: center; }
@media (min-width: 768px) {
  .footer-grid { grid-template-columns: repeat(12, 1fr); }
  .footer-logo { grid-column: span 4; }
  .footer-tagline { grid-column: span 8; }
}
.footer-logo-img { width: 14rem; height: auto; }
@media (min-width: 768px) { .footer-logo-img { width: 18rem; } }
.footer-tagline { font-size: clamp(2.25rem, 4.5vw, 3.5rem); line-height: 1.08; }
.footer-tagline em { font-style: normal; color: var(--accent); }
.footer-bottom {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 2.5rem;
  color: var(--ink-muted);
}
@media (min-width: 768px) { .footer-bottom { flex-direction: row; } }

/* ---------- Ajustes exclusivos para teléfono móvil (< 768px) ---------- */
@media (max-width: 767px) {
  /* Ritmo vertical y tipografía móvil equilibrados */
  .section { padding: 4.25rem 0; }
  .sec-head {
    gap: 0.85rem;
    margin-bottom: 2.25rem;
  }
  .sec-title {
    font-size: clamp(2.05rem, 8.8vw, 2.75rem);
    line-height: 1.06;
  }
  .sec-lead {
    font-size: 0.9rem;
    line-height: 1.65;
  }

  /* Portada proporcionada en pantalla móvil */
  .hero { min-height: 560px; }
  .hero-content { padding: 0 var(--gutter) 2.5rem; }
  .hero-eyebrow { margin-bottom: 1.15rem; }
  .hero-title {
    font-size: clamp(2.3rem, 9.8vw, 3.25rem);
    line-height: 1.02;
  }
  .hero-bottom {
    gap: 1.35rem;
    margin-top: 1.75rem;
    padding-top: 1.35rem;
  }
  .hero-lead {
    font-size: 0.84rem;
    line-height: 1.6;
  }
  .hero .pill {
    width: 100%;
    justify-content: center;
    padding: 1.05rem 1.35rem;
    letter-spacing: 0.2em;
    font-size: 0.62rem;
  }

  /* Franja de servicios más sutil en móvil */
  .marquee { padding: 1.15rem 0; }
  .marquee-track { font-size: 1.55rem; }
  .marquee-track span { gap: 2rem; padding-right: 2rem; }
  .marquee-track i { font-size: 1rem; }

  /* NOTA: el orden de las secciones y su numeración ya NO se definen aquí.
     Los controla el panel "Orden y visibilidad de secciones" (orden del DOM
     dentro de #dynamicSectionsHost) y la numeración automática del servidor. */

  /* 01 ¿Qué quieres construir? — tarjetas compactas en móvil */
  .choose-grid { gap: 2.25rem; }
  .choose-media { aspect-ratio: 16 / 10; }
  .choose-body {
    margin-top: 1rem;
    padding-top: 0.9rem;
  }
  .choose-body h3 {
    margin-top: 0.3rem;
    font-size: 1.28rem;
  }
  .choose-desc {
    margin-top: 0.45rem;
    font-size: 0.84rem;
    line-height: 1.6;
  }

  /* Proyectos ejecutados */
  .gallery-filters {
    flex-wrap: nowrap;
    gap: 0.45rem;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    margin: 0 calc(var(--gutter) * -1) 1.75rem;
    padding: 0 var(--gutter) 0.25rem;
  }
  .gallery-filters::-webkit-scrollbar { display: none; }
  .gallery-filter {
    flex: 0 0 auto;
    white-space: nowrap;
    padding: 0.55rem 0.9rem;
    border: 1px solid var(--border);
    border-radius: 9999px;
    font-size: 0.58rem;
    letter-spacing: 0.16em;
    line-height: 1.2;
    background: var(--background);
    color: var(--muted);
    transition: background-color 0.25s, color 0.25s, border-color 0.25s;
  }
  .gallery-filter::after { display: none; }
  .gallery-filter.is-active {
    background: var(--ink);
    border-color: var(--ink);
    color: var(--ink-fg);
  }

  .gallery-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.15rem 0.75rem;
  }
  .gallery-thumb,
  .gallery-item[data-ratio="square"] .gallery-thumb,
  .gallery-item[data-ratio="wide"] .gallery-thumb {
    position: relative;
    aspect-ratio: 3 / 4;
    border-radius: 2px;
  }
  /* Si una categoría tiene un solo proyecto visible, ocupa el ancho completo sin dejar hueco */
  .gallery-item.is-solo { grid-column: 1 / -1; }
  .gallery-item.is-solo .gallery-thumb { aspect-ratio: 16 / 10; }
  .gallery-item[data-kind="video"] .gallery-thumb::after {
    content: "VIDEO";
    position: absolute;
    top: 0.55rem;
    left: 0.55rem;
    padding: 0.25rem 0.5rem;
    background: rgba(6, 6, 5, 0.75);
    border: 1px solid rgba(241, 238, 233, 0.25);
    color: var(--ink-fg);
    font-size: 0.52rem;
    font-weight: 600;
    letter-spacing: 0.18em;
    line-height: 1;
  }
  .gallery-thumb img,
  .gallery-thumb video { filter: none; }
  .gallery-meta {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.2rem;
    margin-top: 0.5rem;
  }
  .gallery-title {
    font-size: 0.9rem;
    line-height: 1.28;
  }
  .gallery-cat {
    font-size: 0.54rem;
    letter-spacing: 0.18em;
    text-align: left;
  }
  .gallery-more {
    grid-column: 1 / -1;
    flex-direction: row;
    min-height: 3.75rem;
    padding: 0.75rem 1.25rem;
    margin-top: 0.35rem;
  }
  .gallery-more-title { font-size: 1rem; }
  .gallery-footnote {
    margin-top: 1.75rem;
    font-size: 0.8rem;
  }

  /* Bloques técnicos compactos en móvil */
  .tech-grid { gap: 2rem; }
  .tech-media { aspect-ratio: 16 / 10; }
  .tech-intro {
    margin-top: 1.25rem;
    font-size: 0.9rem;
    line-height: 1.65;
  }
  .tech-step {
    display: grid;
    grid-template-columns: 2.35rem 1fr;
    column-gap: 0.85rem;
    align-items: baseline;
    padding: 1.35rem 0;
  }
  .tech-num {
    font-size: 1.35rem;
    font-weight: 400;
  }
  .tech-step h3 {
    margin-top: 0;
    font-size: 1.2rem;
  }
  .tech-text {
    grid-column: 2;
    margin-top: 0.5rem;
    font-size: 0.86rem;
    line-height: 1.65;
  }

  /* Por qué elegirnos — grilla 2x2 limpia en móvil */
  .why-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .why-card { padding: 1.25rem 1rem; }
  .why-card-in { gap: 1.75rem; }
  .why-num { font-size: 2.1rem; }
  .why-card h3 { font-size: 1.12rem; }
  .why-card p:not(.why-num) {
    margin-top: 0.45rem;
    font-size: 0.8rem;
    line-height: 1.55;
  }

  /* Nuestros servicios — acordeón con vista previa visual */
  .svc-item {
    grid-template-columns: 2.25rem 1fr;
    gap: 0.65rem;
    padding: 1.15rem 0;
  }
  .svc-num,
  .svc-main { grid-column: auto; }
  .svc-title { font-size: 1.28rem; }
  .svc-item.is-active .svc-title { transform: translateX(0.35rem); }
  .svc-desc { font-size: 0.85rem; line-height: 1.6; }
  .svc-mobile-media {
    display: block;
    margin-top: 0.95rem;
    aspect-ratio: 16 / 10;
    overflow: hidden;
    background: #111;
    border: 1px solid var(--ink-border);
  }
  .svc-mobile-media img,
  .svc-mobile-media video {
    width: 100%;
    height: 100%;
    object-fit: cover;
  }

  /* Contacto más compacto y estructurado en móvil */
  .contact-grid { gap: 2.75rem; }
  .contact-eyebrow { margin-bottom: 1.15rem; }
  .contact-title { font-size: clamp(2.15rem, 9vw, 2.85rem); }
  .contact-lead { margin-top: 1rem; font-size: 0.9rem; line-height: 1.65; }
  .contact-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.25rem 1rem;
    margin-top: 2rem;
    font-size: 0.82rem;
  }
  .contact-list li:first-child { grid-column: 1 / -1; }
  .contact-list .phone-link { font-size: 1.4rem; }
  .social-buttons { margin-top: 1.75rem; }
  .contact-tabs { gap: 0.5rem 1.25rem; margin-bottom: 1.75rem; }
  .contact-tab { letter-spacing: 0.2em; font-size: 0.62rem; }
  .form-actions { flex-direction: column; align-items: stretch; }
  .form-actions .pill { justify-content: center; }
  .wa-link { text-align: center; align-self: center; }

  /* Pie en móvil */
  .footer-grid { gap: 1.75rem; }
  .footer-logo-img { width: 11.5rem; }
  .footer-tagline { font-size: 1.95rem; }
  .footer-bottom { margin-top: 1.75rem; gap: 0.5rem; font-size: 0.6rem; }
}

/* ---------- Paletas configurables por el cliente ---------- */
main[data-theme="slate"] { --navy: #272b33; --sky: #a5b0c2; --cursor: #8e9bb0; }
main[data-theme="sand"] { --navy: #5c4631; --sky: #d6b995; --cursor: #c29e74; }
main[data-theme="emerald"] { --navy: #1b3d33; --sky: #88bfa8; --cursor: #66a38a; }

/* ---------- Carrusel de Portada (4 modos de transición) ---------- */
.hero-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none;
  z-index: 0;
}
.hero-slide.is-active {
  opacity: 1;
  z-index: 2;
}
.hero-slide.is-leaving {
  opacity: 1;
  z-index: 1;
}

/* Transición 1: Disolvencia cinematográfica + Ken Burns */
.hero[data-transition="fade"] .hero-slide {
  transition: opacity 1.3s var(--ease-io);
}
.hero[data-transition="fade"] .hero-slide img,
.hero[data-transition="fade"] .hero-slide video {
  transform: scale(1.1);
  transition: transform 6.5s ease-out;
}
.hero[data-transition="fade"] .hero-slide.is-active img,
.hero[data-transition="fade"] .hero-slide.is-active video {
  transform: scale(1);
}

/* Transición 2: Deslizamiento lateral */
.hero[data-transition="slide"] .hero-slide {
  opacity: 1;
  transform: translate3d(100%, 0, 0);
  transition: transform 1.05s var(--ease-io);
}
.hero[data-transition="slide"] .hero-slide.is-active {
  transform: translate3d(0, 0, 0);
}
.hero[data-transition="slide"] .hero-slide.is-leaving {
  transform: translate3d(-28%, 0, 0);
}

/* Transición 3: Cortina arquitectónica */
.hero[data-transition="curtain"] .hero-slide {
  opacity: 1;
  clip-path: inset(0 0 0 100%);
  transition: clip-path 1.15s var(--ease-io);
}
.hero[data-transition="curtain"] .hero-slide.is-active {
  clip-path: inset(0 0 0 0);
}
.hero[data-transition="curtain"] .hero-slide.is-leaving {
  clip-path: inset(0 0 0 0);
}

/* Transición 4: Zoom profundo */
.hero[data-transition="zoom"] .hero-slide {
  transform: scale(1.18);
  transition: opacity 1.2s var(--ease-out), transform 1.5s var(--ease-out);
}
.hero[data-transition="zoom"] .hero-slide.is-active {
  transform: scale(1);
}

/* Controles discretos del carrusel */
.hero-carousel-ui {
  position: absolute;
  top: 6.25rem;
  right: var(--gutter);
  left: var(--gutter);
  max-width: var(--wrap);
  margin: 0 auto;
  z-index: 12;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  pointer-events: none;
}
.hero-carousel-meta,
.hero-carousel-nav {
  display: flex;
  align-items: center;
  gap: 1rem;
  pointer-events: auto;
}
.hero-slide-count { color: var(--accent); }
.hero-slide-caption {
  color: var(--ink-muted);
  max-width: 18rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.hero-dots {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}
.hero-dot {
  position: relative;
  width: 2.25rem;
  height: 2px;
  background: rgba(241, 238, 233, 0.25);
  overflow: hidden;
}
.hero-dot-fill {
  position: absolute;
  inset: 0;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
}
.hero-dot.is-active .hero-dot-fill {
  animation: heroProgress var(--slide-duration, 6s) linear forwards;
}
@keyframes heroProgress { to { transform: scaleX(1); } }
.hero-arrows { display: flex; gap: 0.4rem; }
.hero-arrow {
  width: 2.25rem;
  height: 2.25rem;
  border: 1px solid var(--ink-border);
  border-radius: 9999px;
  background: rgba(6, 6, 5, 0.45);
  color: var(--ink-fg);
  font-size: 0.95rem;
  transition: background-color 0.3s, color 0.3s;
}
.hero-arrow:hover { background: var(--ink-fg); color: var(--ink); }

@media (max-width: 767px) {
  .hero-carousel-ui { top: 5.25rem; }
  .hero-slide-caption { display: none; }
  .hero-dot { width: 1.4rem; }
  .hero-arrow { width: 2rem; height: 2rem; font-size: 0.85rem; }
}

/* ---------- Movimiento reducido ---------- */
@media (prefers-reduced-motion: reduce) {
  .marquee-track, .grain::after { animation: none; }
  *, *::before, *::after { transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
}

/* ==========================================================================
   Orden de secciones: lo controla el panel del editor, NO el CSS.
   Seguro anti-regresión: aunque otra hoja (studio-overrides.css) intente
   reordenar con flex/order, el flujo vuelve a ser el del HTML.
   ========================================================================== */
main.grain,
#dynamicSectionsHost {
  display: block !important;
}
main.grain > *,
#dynamicSectionsHost > *,
#dynamicSectionsHost > * > * {
  order: 0 !important;
}
@media (max-width: 767px) {
  #portafolio { border-top: 1px solid var(--border); }
  #contacto { border-top: 1px solid var(--ink-border); }
}