/* =================================================================
   LUNARIO · Brand-Locked Stylesheet
   Paleta: Tinta #201F1F (60%) · Niebla #D8D8D6 (30%) · Lima #DFFF00 (10%)
   Tipografía: Space Grotesk (display) · Hanken Grotesk (body) · Space Mono

   Índice
     1. Variables
     2. Reset y base
     3. Layout
     4. Header
     5. Hero (intro lunar · hero · marquee)
     6. Servicios (pestañas + paneles)
     7. Proyectos (tarjeta + carrusel infinito)
     8. Hablemos (formulario de contacto)
     9. Footer
    10. Utilidades (botones, tipografía auxiliar, reveal)
    11. Responsive y accesibilidad

   Todo el sitio es HTML, CSS y JavaScript puro: no hay build, ni
   frameworks, ni hojas de estilo generadas.
   ================================================================= */

/* =================================================================
   1. VARIABLES
   ================================================================= */
:root {
  /* Colores de marca — NO modificar */
  --tinta: #201F1F;
  --lima: #DFFF00;
  --niebla: #D8D8D6;

  /* Derivados tonales (mismos pigmentos, distinta luz) */
  --tinta-90: #2b2a2a;
  --tinta-80: #3a3938;
  --niebla-soft: #ECECEA;
  --niebla-line: rgba(216, 216, 214, 0.16);
  --ink-line: rgba(32, 31, 31, 0.12);

  --text-on-light: var(--tinta);
  --text-on-dark: var(--niebla);
  --muted-on-light: #5b5a59;
  --muted-on-dark: #9a9a98;

  /* Color funcional de estado (solo errores de formulario, no decorativo) */
  --alerta: #FF8A73;

  /* Tipografía */
  --font-display: "Space Grotesk", system-ui, sans-serif;
  --font-body: "Hanken Grotesk", system-ui, sans-serif;
  --font-mono: "Space Mono", ui-monospace, monospace;

  /* Layout */
  --container: 1180px;
  --gutter: clamp(1.25rem, 5vw, 4rem);
  --radius: 14px;
  --radius-sm: 8px;

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

/* =================================================================
   2. RESET Y BASE
   ================================================================= */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--font-body);
  font-weight: 400;
  line-height: 1.6;
  color: var(--text-on-light);
  background: var(--niebla-soft);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; padding: 0; }
button { font: inherit; cursor: pointer; border: none; background: none; color: inherit; }

/* =================================================================
   3. LAYOUT
   ================================================================= */
.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.section { padding-block: clamp(3.5rem, 9vw, 7rem); }

.section__head { max-width: 640px; margin-bottom: clamp(2rem, 5vw, 3.5rem); }
.section__tag { color: var(--muted-on-light); margin-bottom: 0.9rem; display: block; }
.section__title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(1.9rem, 5vw, 3rem);
  line-height: 1.05;
  letter-spacing: -0.02em;
}
.section__lead {
  margin-top: 1rem;
  font-size: 1.1rem;
  color: var(--muted-on-light);
}


/* =================================================================
   4. HEADER
   ================================================================= */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(236, 236, 234, 0.82);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--ink-line);
}
.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
}
.brand__logo { height: 26px; width: auto; }

.nav { display: flex; align-items: center; gap: 1.8rem; }
/* El :not(.btn) evita que el CTA del menú pierda su tamaño de botón. */
.nav a:not(.btn) {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 0.95rem;
  position: relative;
}
.nav a:not(.btn)::after {
  content: "";
  position: absolute;
  left: 0; bottom: -4px;
  width: 0; height: 2px;
  background: var(--lima);
  transition: width 0.25s var(--ease);
}
.nav a:not(.btn):hover::after { width: 100%; }

.nav-toggle { display: none; flex-direction: column; gap: 5px; padding: 8px; }
.nav-toggle span {
  width: 24px; height: 2px; background: var(--tinta);
  transition: transform 0.3s var(--ease), opacity 0.2s;
}

/* =================================================================
   5. HERO · intro lunar, hero y marquee
   ================================================================= */

/* ---------- Intro · revelado lunar ---------- */
.intro {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  background: var(--tinta);
}
.intro__stage { display: grid; place-items: center; gap: 1.6rem; }
.intro__moon { width: clamp(96px, 22vw, 150px); height: auto; }
.intro__half { transform-origin: 60px 60px; }
.intro__word {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(1.4rem, 5vw, 2rem);
  color: var(--niebla);
  letter-spacing: -0.01em;
  opacity: 0;
}

.intro.is-playing .intro__half--lime {
  animation: moon-rise 1s var(--ease) 0.25s both;
}
.intro.is-playing .intro__half--mist {
  animation: moon-fade 0.8s var(--ease) 0.45s both;
}
.intro.is-playing .intro__word {
  animation: word-in 0.6s var(--ease) 1.05s both;
}
.intro.is-leaving {
  animation: intro-out 0.7s var(--ease) forwards;
}

@keyframes moon-rise {
  from { clip-path: inset(100% 0 0 0); opacity: 0.2; }
  to   { clip-path: inset(0 0 0 0); opacity: 1; }
}
@keyframes moon-fade {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes word-in {
  from { opacity: 0; transform: translateY(8px); letter-spacing: 0.12em; }
  to   { opacity: 1; transform: translateY(0); letter-spacing: -0.01em; }
}
@keyframes intro-out {
  to { opacity: 0; transform: scale(1.06); visibility: hidden; }
}

/* Sin animación intro si se reduce el movimiento */
.no-intro .intro { display: none; }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  padding-top: clamp(3rem, 8vw, 6rem);
  padding-bottom: clamp(2.5rem, 6vw, 4.5rem);
  background:
    linear-gradient(var(--niebla-soft), var(--niebla-soft)) padding-box;
  overflow: hidden;
}
.hero::before {
  /* retícula geométrica sutil */
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(var(--ink-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--ink-line) 1px, transparent 1px);
  background-size: 64px 64px;
  -webkit-mask-image: radial-gradient(ellipse 90% 70% at 70% 30%, #000 30%, transparent 80%);
          mask-image: radial-gradient(ellipse 90% 70% at 70% 30%, #000 30%, transparent 80%);
  opacity: 0.7;
  pointer-events: none;
}
.hero__grid {
  position: relative;
  display: grid;
  gap: clamp(2rem, 5vw, 3.5rem);
  align-items: center;
}
.hero__title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(2.4rem, 8vw, 4.6rem);
  line-height: 1.02;
  letter-spacing: -0.03em;
  margin-bottom: 1.4rem;
}
.hero__sub {
  font-size: clamp(1.05rem, 2.2vw, 1.25rem);
  color: var(--muted-on-light);
  max-width: 46ch;
  margin-bottom: 2rem;
}
.hero__cta { display: flex; flex-wrap: wrap; gap: 0.9rem; margin-bottom: 2.6rem; }

.hero__stats {
  display: grid;
  gap: 1.1rem;
  border-top: 1px solid var(--ink-line);
  padding-top: 1.6rem;
}
.stat dt { color: var(--tinta); margin-bottom: 0.2rem; }
.stat dd { font-size: 0.95rem; color: var(--muted-on-light); }

/* Visual lunar del hero */
.hero__visual { display: grid; place-items: center; }
.moon-card {
  position: relative;
  width: min(100%, 380px);
  aspect-ratio: 1 / 1;
  background: var(--tinta);
  border-radius: var(--radius);
  display: grid;
  place-items: center;
  padding: 2rem;
  overflow: hidden;
  box-shadow: 0 30px 60px -30px rgba(32, 31, 31, 0.4);
}
.moon-card__phase {
  width: 56%;
  filter: drop-shadow(0 0 40px rgba(223, 255, 0, 0.25));
  animation: float 6s ease-in-out infinite;
}
.moon-card__meta {
  position: absolute;
  left: 1.2rem; right: 1.2rem; bottom: 1.1rem;
  display: flex;
  justify-content: space-between;
  color: var(--muted-on-dark);
  font-size: 0.66rem;
}
.moon-card__lines {
  position: absolute;
  inset: 1.2rem auto 1.2rem 1.2rem;
  display: flex; flex-direction: column; justify-content: center; gap: 7px;
}
.moon-card__lines span { display: block; height: 1px; background: var(--niebla-line); }
.moon-card__lines span:nth-child(1) { width: 30px; }
.moon-card__lines span:nth-child(2) { width: 18px; }
.moon-card__lines span:nth-child(3) { width: 24px; background: var(--lima); opacity: 0.5; }
.moon-card__lines span:nth-child(4) { width: 14px; }

@keyframes float { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }

/* ---------- Marquee de capacidades ---------- */
.marquee {
  background: var(--tinta);
  color: var(--niebla);
  padding: 1.1rem 0;
  overflow: hidden;
  white-space: nowrap;
}
.marquee__track {
  display: inline-flex;
  align-items: center;
  gap: 2.4rem;
  animation: marquee 26s linear infinite;
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 1.1rem;
}
.marquee__dot { color: var(--lima); font-size: 0.9rem; }
@keyframes marquee { to { transform: translateX(-50%); } }

/* =================================================================
   6. SERVICIOS
   Sección OSCURA (tinta con texto niebla) para alternar con el Hero y
   Proyectos, que son claras. Cada título es un desplegable que abre su
   descripción justo debajo: antes esa información vivía en una página
   aparte (servicios/<slug>/index.html), ahora vive aquí.
   ================================================================= */
.services {
  background: var(--tinta);
  color: var(--text-on-dark);
  padding-block: clamp(3.5rem, 9vw, 7rem);
}
.services .section__tag { color: var(--lima); }
.services .section__lead { color: var(--muted-on-dark); }

.services__list { display: grid; }

/* ---------- Cabecera desplegable ---------- */
.service { border-top: 1px solid var(--niebla-line); }
.service:last-child { border-bottom: 1px solid var(--niebla-line); }

.service__heading { font: inherit; font-weight: inherit; margin: 0; }
.service__toggle {
  display: flex;
  align-items: center;
  gap: 1rem;
  width: 100%;
  text-align: left;
  padding-block: clamp(0.9rem, 2.2vw, 1.5rem);
  /* Objetivo táctil cómodo sin inflar el ritmo vertical. */
  min-height: 44px;
}
.service__num { flex: none; width: 1.75rem; color: var(--muted-on-dark); }
.service__title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(1.6rem, 4.8vw, 2.8rem);
  line-height: 1.1;
  letter-spacing: -0.02em;
  color: var(--muted-on-dark);
  transition: color 0.3s var(--ease);
}
.service__toggle:hover .service__title,
.service__toggle:focus-visible .service__title { color: var(--niebla); }

/* Signo + que se convierte en − al abrir: dice si hay algo que desplegar
   sin depender del color, que sería el único aviso para quien no lo ve. */
.service__icon {
  position: relative;
  flex: none;
  width: 16px;
  height: 16px;
  margin-left: auto;
  color: var(--muted-on-dark);
  transition: color 0.3s var(--ease), transform 0.35s var(--ease);
}
.service__icon::before,
.service__icon::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 0;
  width: 100%;
  height: 2px;
  margin-top: -1px;
  background: currentColor;
  transition: transform 0.35s var(--ease), opacity 0.35s var(--ease);
}
.service__icon::after { transform: rotate(90deg); }
.service__toggle:hover .service__icon { color: var(--niebla); }

.service.is-open .service__title { color: var(--niebla); }
.service.is-open .service__num { color: var(--lima); }
.service.is-open .service__icon { color: var(--lima); transform: rotate(180deg); }
.service.is-open .service__icon::after { transform: rotate(0deg); opacity: 0; }

/* ---------- Panel desplegable ----------
   El plegado usa una rejilla de 0fr a 1fr: es la única forma de animar
   la altura sin fijarla a mano ni recalcularla desde JavaScript.
   Por defecto está ABIERTO: así, si el JavaScript no se ejecuta, la
   información de los dos servicios se ve entera. is-enhanced la añade
   script.js y es la que activa el plegado. */
.service__panel {
  display: grid;
  grid-template-rows: 1fr;
  transition: grid-template-rows 0.45s var(--ease);
}
.service__panel-inner {
  overflow: hidden;
  display: grid;
  gap: clamp(1.5rem, 4vw, 3rem);
  align-items: center;
  padding-bottom: clamp(1.75rem, 4vw, 2.75rem);
  transition: opacity 0.35s var(--ease), visibility 0.35s var(--ease);
}

.services__list.is-enhanced .service:not(.is-open) .service__panel {
  grid-template-rows: 0fr;
}
/* visibility, además de ocultar, saca del orden de tabulación lo que está
   plegado: si no, se podría tabular hasta un enlace invisible. */
.services__list.is-enhanced .service:not(.is-open) .service__panel-inner {
  visibility: hidden;
  opacity: 0;
}

/* ---------- Contenido del servicio ---------- */
.service__lead {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(1.3rem, 3vw, 1.8rem);
  line-height: 1.15;
  letter-spacing: -0.02em;
  text-wrap: balance;
}
.service__text {
  margin-top: 1.1rem;
  color: var(--muted-on-dark);
  font-size: 1rem;
  max-width: 54ch;
}
.service__value {
  margin-top: 1.3rem;
  padding-left: 1.1rem;
  border-left: 2px solid var(--lima);
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 1.05rem;
  line-height: 1.35;
  max-width: 46ch;
}

.service__benefits { margin-top: 1.6rem; display: grid; }
.service__benefit {
  display: flex;
  align-items: baseline;
  gap: 0.8rem;
  padding-block: 0.6rem;
  border-top: 1px solid var(--niebla-line);
  font-size: 0.98rem;
  line-height: 1.45;
}
.service__benefit::before { content: "◐"; color: var(--lima); font-size: 0.8rem; flex: none; }

.service__actions {
  margin-top: 1.8rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1.3rem;
}
.service__mail {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  color: var(--muted-on-dark);
  border-bottom: 1px solid var(--niebla-line);
  transition: color 0.25s var(--ease), border-color 0.25s var(--ease);
}
.service__mail:hover { color: var(--lima); border-color: var(--lima); }

/* La proporción sale de --service-media, que declara cada <figure> con la
   medida exacta de su archivo: con cualquier otra, cover le comería los
   lados al mockup. */
.service__media {
  position: relative;
  border: 1px solid var(--niebla-line);
  border-radius: var(--radius);
  background: var(--tinta-90);
  overflow: hidden;
}
.service__media img {
  width: 100%;
  height: 100%;
  aspect-ratio: var(--service-media, 16 / 10);
  object-fit: cover;
  object-position: center;
}
.service__media figcaption {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  padding: 0.6rem 0.9rem;
  background: rgba(32, 31, 31, 0.82);
  color: var(--niebla);
}

/* =================================================================
   7. PROYECTOS
   ================================================================= */
/* La tarjeta son DOS bloques apilados e independientes: arriba el marco de
   la imagen, abajo el bloque de texto. Con flex en columna ninguno invade al
   otro y todas las tarjetas de una misma fila quedan a la misma altura. */
.project {
  display: flex;
  flex-direction: column;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--ink-line);
  background: var(--niebla-soft);
  transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease);
}
.project:hover { transform: translateY(-4px); box-shadow: 0 24px 40px -28px rgba(32,31,31,0.4); }

/* ---------- Bloque 1 · marco de la imagen ----------
   Altura fija por proporción y sin crecer (flex: none): la imagen se recorta
   dentro de este marco y nunca empuja ni se mete debajo del texto. */
.project__media {
  position: relative;
  flex: none;
  aspect-ratio: 16 / 10;
  display: grid; place-items: center;
  overflow: hidden;
  border-bottom: 1px solid var(--ink-line);
}
.project__media--ink { background: var(--tinta); }
.project__media--mist { background: var(--niebla); }
.project__media--lime { background: var(--lima); }
.project__art { width: 42%; transition: transform 0.5s var(--ease); }
.project:hover .project__art { transform: scale(1.06) rotate(-3deg); }
/* Anclada al marco: su tamaño natural deja de influir en la tarjeta. */
.project__art--cover {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  transition: transform 0.5s var(--ease);
}
.project:hover .project__art--cover { transform: scale(1.06); }

/* ---------- Bloque 2 · texto ----------
   Fondo propio y por encima del marco, así que nada de la imagen puede
   asomarse detrás. Ocupa el alto sobrante para alinear los enlaces. */
.project__info {
  position: relative;
  z-index: 1;
  flex: 1;
  display: flex;
  flex-direction: column;
  background: var(--niebla-soft);
  padding: 1.4rem 1.5rem 1.6rem;
}
.project__tag { color: var(--muted-on-light); display: block; margin-bottom: 0.5rem; }
.project__title { font-family: var(--font-display); font-weight: 600; font-size: 1.3rem; margin-bottom: 0.4rem; }
.project__info p { color: var(--muted-on-light); font-size: 0.96rem; }
.project__link {
  display: inline-flex;
  align-items: center;
  align-self: flex-start;
  gap: 0.35rem;
  /* Empuja el enlace al pie: queda a la misma altura en toda la fila. */
  margin-top: auto;
  padding-top: 0.9rem;
  color: var(--muted-on-light);
  transition: color 0.25s var(--ease), gap 0.25s var(--ease);
}
.project:hover .project__link { color: var(--tinta); gap: 0.55rem; }

/* ---------- Carrusel infinito ----------
   La tarjeta no cambia: sólo se distribuye en un carril horizontal.
   script.js clona la lista antes y después de la original, así que al
   pasar del último proyecto aparece el primero (y al revés) sin salto
   visible. Los anchos salen de --per-view, que cambia por media query. */
.projects-carousel {
  --per-view: 1;
  --carousel-gap: 1.2rem;
  position: relative;
}

/* El relleno vertical deja sitio al levantamiento y la sombra de la
   tarjeta en hover, que overflow: hidden recortaría; el margen negativo
   devuelve el espacio para no alterar el ritmo de la sección. */
.carousel__viewport {
  overflow: hidden;
  padding-block: 8px 30px;
  margin-block: -8px -30px;
}

.carousel__track {
  display: flex;
  align-items: stretch;
  gap: var(--carousel-gap);
  transition: transform 0.55s var(--ease);
  will-change: transform;
  /* Deja pasar el scroll vertical y captura sólo el arrastre horizontal. */
  touch-action: pan-y;
}
/* Reposicionamiento instantáneo al saltar de un clon al original. */
.carousel__track.is-jumping,
.carousel__track.is-dragging { transition: none; }

.carousel__slide {
  flex: 0 0 calc((100% - (var(--per-view) - 1) * var(--carousel-gap)) / var(--per-view));
  display: flex;
}
.carousel__slide > .project { flex: 1; }

/* ---------- Controles ---------- */
.carousel__nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin-top: clamp(1.6rem, 3.5vw, 2.4rem);
}
.carousel__btn {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: 1.5px solid var(--ink-line);
  color: var(--tinta);
  transition: transform 0.25s var(--ease), background 0.25s var(--ease),
    color 0.25s var(--ease), border-color 0.25s var(--ease);
}
.carousel__btn:hover {
  background: var(--tinta);
  border-color: var(--tinta);
  color: var(--niebla-soft);
  transform: translateY(-2px);
}

/* Los puntos repiten el lenguaje de fases lunares del resto del sitio. */
.carousel__dots { display: flex; align-items: center; gap: 0.5rem; }
.carousel__dot {
  width: 9px;
  height: 9px;
  padding: 0;
  border-radius: 100px;
  border: 1px solid var(--tinta);
  background: transparent;
  opacity: 0.35;
  transition: width 0.3s var(--ease), opacity 0.3s var(--ease),
    background 0.3s var(--ease), border-color 0.3s var(--ease);
}
.carousel__dot:hover { opacity: 0.7; }
.carousel__dot.is-active {
  width: 24px;
  opacity: 1;
  background: var(--lima);
  border-color: var(--lima);
}

/* =================================================================
   8. HABLEMOS · formulario de contacto
   ================================================================= */
.contact {
  background: var(--tinta);
  color: var(--niebla);
  padding-block: clamp(4rem, 10vw, 7rem);
}
.contact__inner { display: grid; gap: clamp(2.5rem, 6vw, 4rem); align-items: start; }
.contact__moon { width: 64px; margin-bottom: 1.6rem; animation: float 6s ease-in-out infinite; }
.contact .section__tag { color: var(--lima); }
.contact__title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(2.1rem, 6vw, 3.4rem);
  line-height: 1.05;
  letter-spacing: -0.02em;
  margin: 0.6rem 0 1.2rem;
}
.contact__sub { color: var(--muted-on-dark); font-size: 1.1rem; max-width: 40ch; }
.contact__alt { margin-top: 1.6rem; color: var(--muted-on-dark); }
.contact__alt a { color: var(--niebla); border-bottom: 1px solid var(--niebla-line); }
.contact__alt a:hover { color: var(--lima); border-color: var(--lima); }

/* ---------- Rejilla del formulario ---------- */
.contact-form { display: grid; gap: 1.2rem; grid-template-columns: 1fr; }
.field { display: grid; gap: 0.45rem; }
.field label {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  text-transform: lowercase;
  color: var(--muted-on-dark);
}
.field__hint { text-transform: none; }

.field input,
.field select,
.field textarea {
  width: 100%;
  font-family: var(--font-body);
  font-size: 1rem;
  color: var(--niebla);
  background: var(--tinta-90);
  border: 1px solid var(--niebla-line);
  border-radius: var(--radius-sm);
  padding: 0.8rem 0.9rem;
  transition: border-color 0.25s var(--ease), box-shadow 0.25s var(--ease);
}
.field textarea { resize: vertical; min-height: 120px; line-height: 1.5; }

/* La flecha nativa del select se pierde sobre fondo oscuro en algunos
   navegadores: se dibuja una propia y se conserva el elemento nativo. */
.field select {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%23D8D8D6' stroke-width='1.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.9rem center;
  padding-right: 2.4rem;
}
.field select option { color: var(--tinta); background: var(--niebla-soft); }

.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--lima);
  box-shadow: 0 0 0 3px rgba(223, 255, 0, 0.18);
}

/* ---------- Estados de error ---------- */
.field__error {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--alerta);
  min-height: 0;
}
.field__error:empty { display: none; }
.field input[aria-invalid="true"],
.field select[aria-invalid="true"],
.field textarea[aria-invalid="true"] { border-color: var(--alerta); }

/* ---------- Honeypot antispam (invisible para personas) ---------- */
.form-honeypot {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* ---------- Acciones y estado del envío ---------- */
.form-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem; margin-top: 0.4rem; }
.form-actions .btn[disabled] { opacity: 0.55; cursor: not-allowed; transform: none; box-shadow: none; }
.form-status { color: var(--muted-on-dark); }
.form-status:empty { display: none; }
.form-status[data-state="success"] { color: var(--lima); }
.form-status[data-state="error"] { color: var(--alerta); }

/* =================================================================
   9. FOOTER
   ================================================================= */
.site-footer { background: var(--tinta); color: var(--niebla); border-top: 1px solid var(--niebla-line); }
.site-footer__inner {
  display: grid;
  gap: 2.5rem;
  padding-block: clamp(2.5rem, 6vw, 4rem) 2rem;
}
.site-footer__logo { height: 24px; margin-bottom: 1rem; }
.site-footer__brand .mono { color: var(--muted-on-dark); }
.site-footer__nav { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.5rem; }
.site-footer__nav h4 { color: var(--muted-on-dark); font-weight: 400; margin-bottom: 0.9rem; }
.site-footer__nav a { display: block; padding: 0.3rem 0; font-size: 0.95rem; color: var(--niebla); transition: color 0.2s; }
.site-footer__nav a:hover { color: var(--lima); }
.site-footer__bottom {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  justify-content: space-between;
  padding-block: 1.4rem 2rem;
  border-top: 1px solid var(--niebla-line);
  color: var(--muted-on-dark);
}

/* =================================================================
   10. UTILIDADES
   ================================================================= */
.mono {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  text-transform: lowercase;
}

.hl {
  color: var(--tinta);
  white-space: nowrap;
  background-image: linear-gradient(
    transparent 0.58em,
    var(--lima) 0.58em,
    var(--lima) 0.92em,
    transparent 0.92em
  );
  -webkit-box-decoration-break: clone;
          box-decoration-break: clone;
  padding-inline: 0.04em;
}

/* ---------- Botones ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 1rem;
  padding: 0.85rem 1.4rem;
  border-radius: 100px;
  transition: transform 0.25s var(--ease), background 0.25s var(--ease),
    color 0.25s var(--ease), box-shadow 0.25s var(--ease);
  border: 1.5px solid transparent;
  line-height: 1;
}
.btn svg { transition: transform 0.25s var(--ease); }
.btn:hover svg { transform: translateX(4px); }

.btn--accent { background: var(--lima); color: var(--tinta); }
.btn--accent:hover { transform: translateY(-2px); box-shadow: 0 10px 30px -10px rgba(223, 255, 0, 0.6); }

.btn--ghost { border-color: var(--ink-line); color: var(--tinta); }
.btn--ghost:hover { border-color: var(--tinta); transform: translateY(-2px); }

.btn--sm { padding: 0.6rem 1.05rem; font-size: 0.9rem; }
.btn--lg { padding: 1.05rem 1.8rem; font-size: 1.05rem; }

/* ---------- Eyebrow ---------- */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  text-transform: lowercase;
  color: var(--muted-on-light);
  margin-bottom: 1.4rem;
}
.eyebrow__dot {
  width: 9px; height: 9px; border-radius: 50%;
  background: linear-gradient(90deg, var(--tinta) 50%, var(--lima) 50%);
  flex: none;
}

/* ---------- Reveal (aparición suave al hacer scroll) ---------- */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity 0.7s var(--ease), transform 0.7s var(--ease); }
.reveal.is-visible { opacity: 1; transform: none; }

/* =================================================================
   11. RESPONSIVE Y ACCESIBILIDAD
   ================================================================= */
@media (min-width: 600px) {
  .projects-carousel { --per-view: 2; }
  .hero__stats { grid-template-columns: repeat(3, 1fr); gap: 1.5rem; }
  .contact-form { grid-template-columns: repeat(2, 1fr); }
  .field--full { grid-column: 1 / -1; }
  .form-actions { grid-column: 1 / -1; }
}

@media (min-width: 900px) {
  .hero__grid { grid-template-columns: 1.15fr 0.85fr; }
  .projects-carousel { --per-view: 3; --carousel-gap: 1.5rem; }
  /* La imagen del servicio va a la derecha, como en el resto del sitio. */
  .service__panel-inner { grid-template-columns: 1.05fr 0.95fr; }
  .service__media { order: 2; }
  .contact__inner { grid-template-columns: 0.85fr 1.15fr; }
  .site-footer__inner { grid-template-columns: 1fr 1.4fr; }
}

/* ---------- Menú móvil ---------- */
@media (max-width: 860px) {
  .nav {
    position: fixed;
    inset: 68px 0 auto 0;
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    background: var(--niebla-soft);
    border-bottom: 1px solid var(--ink-line);
    padding: 0.5rem var(--gutter) 1.5rem;
    transform: translateY(-130%);
    transition: transform 0.4s var(--ease);
    box-shadow: 0 20px 40px -24px rgba(32,31,31,0.5);
  }
  .nav.is-open { transform: translateY(0); }
  .nav a { width: 100%; padding: 0.9rem 0; border-bottom: 1px solid var(--ink-line); font-size: 1.05rem; }
  .nav__cta { margin-top: 1rem; border-bottom: none !important; justify-content: center; }
  .nav-toggle { display: flex; }
  .nav-toggle.is-active span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  .nav-toggle.is-active span:nth-child(2) { opacity: 0; }
  .nav-toggle.is-active span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
}

/* ---------- Foco visible en todo el sitio ----------
   Tinta sobre los fondos claros y lima sobre los fondos tinta, para que
   el contraste del indicador de foco funcione en ambos casos.
   Los campos del formulario definen su propio foco (borde lima + halo). */
:where(a, button, input, select, textarea):focus-visible {
  outline: 2px solid var(--tinta);
  outline-offset: 3px;
}
.contact :where(a, button):focus-visible,
.site-footer :where(a, button):focus-visible {
  outline-color: var(--lima);
}

/* ---------- prefers-reduced-motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
  .reveal { opacity: 1; transform: none; }
  .intro { display: none; }
}
