/* components.css — botones, enlaces, header, footer, menú, tarjetas, formularios */

/* Glifo de marca: sistema direccional -------------------------------- */

.glifo {
  display: inline-block;
  width: 0.72em;
  height: 0.7em;
  flex: none;
  background: var(--accent) no-repeat center / contain;
  -webkit-mask: url('/assets/img/glifo.svg') no-repeat center / contain;
  mask: url('/assets/img/glifo.svg') no-repeat center / contain;
  transition: transform 200ms ease-out;
}

.section--ink .glifo,
.btn--primary .glifo {
  background-color: var(--accent-soft);
}

.btn--primary .glifo {
  background-color: #fff;
}

/* Iconos de línea animados --------------------------------------------
   Se dibujan al entrar en viewport (pathLength=1) y reaccionan al hover. */

.icon {
  width: 30px;
  height: 30px;
  flex: none;
  color: var(--accent);
  transition: transform 250ms cubic-bezier(0.16, 1, 0.3, 1);
}

/* dibujo del trazo al revelarse el contenedor con stagger */
[data-stagger] .icon > * {
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
}

[data-stagger].is-visible .icon > * {
  animation: icon-draw 900ms cubic-bezier(0.16, 1, 0.3, 1) forwards;
  animation-delay: calc(var(--reveal-i, 0) * 90ms + 250ms);
}

@keyframes icon-draw {
  to {
    stroke-dashoffset: 0;
  }
}

/* micro-animación al hover del contenedor */
.tile:hover .icon,
.card:hover .icon,
.mini-steps li:hover .icon {
  transform: scale(1.12) rotate(-6deg);
}

a:hover > .icon,
.contact-aside a:hover .icon {
  transform: translateX(2px) scale(1.08);
}

/* variantes de color según fondo */
.card--featured .icon,
.section--ink .icon:not(.icon--keep),
.contact-aside .icon {
  color: var(--accent-soft);
}

.icon--inline {
  width: 20px;
  height: 20px;
  vertical-align: -4px;
}

@media (prefers-reduced-motion: reduce) {
  .icon,
  .tile:hover .icon,
  .card:hover .icon {
    transition: none;
    transform: none;
  }

  [data-stagger] .icon > * {
    stroke-dashoffset: 0;
    animation: none;
  }
}

.no-js [data-stagger] .icon > * {
  stroke-dashoffset: 0;
}

/* Botones -------------------------------------------------------------
   Marcador de glifo a la izquierda; al hover se desplaza 4px a la derecha. */

.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  min-height: 44px;
  padding: 10px var(--space-4);
  border: 1px solid var(--ink);
  border-radius: var(--radius);
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}

.btn {
  transition: transform 180ms ease-out, background 180ms ease-out, border-color 180ms ease-out,
    color 180ms ease-out, box-shadow 180ms ease-out;
}

.btn:hover .glifo,
.btn:active .glifo {
  transform: translateX(4px);
}

.btn--primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 24px -12px color-mix(in srgb, var(--accent) 60%, transparent);
}

.btn:active {
  transform: scale(0.98);
}

@media (prefers-reduced-motion: reduce) {
  .btn,
  .btn:hover,
  .btn:active {
    transform: none;
    transition: none;
    box-shadow: none;
  }
}

.btn--primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.btn--primary:hover {
  background: var(--accent-soft);
  border-color: var(--accent-soft);
}

.btn--inverse {
  border-color: #fff;
  color: #fff;
}

.btn--inverse:hover {
  border-color: var(--accent-soft);
  color: var(--accent-soft);
}

@media (prefers-reduced-motion: reduce) {
  .glifo,
  .btn:hover .glifo {
    transition: none;
    transform: none;
  }
}

/* Enlaces de texto: subrayado que se dibuja al hover ------------------ */

.link {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  color: var(--ink);
  font-weight: 600;
  text-decoration: none;
  background: linear-gradient(currentColor, currentColor) no-repeat left bottom / 0 1px;
  transition: background-size 200ms ease-out;
  padding-bottom: 2px;
}

.link:hover,
.link:focus-visible {
  background-size: 100% 1px;
}

.section--ink .link {
  color: #fff;
}

p a,
.prose a {
  /* accent oscurecido un 12%: garantiza ≥4.5:1 también sobre --surface-tint */
  color: color-mix(in srgb, var(--accent) 88%, #000);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

p a:hover,
.prose a:hover {
  color: var(--accent-soft);
}

@media (prefers-reduced-motion: reduce) {
  .link {
    transition: none;
  }
}

/* Header ---------------------------------------------------------------
   Transparente sobre el hero; con scroll gana fondo y filo (header.js). */

.header {
  position: fixed;
  inset: 0 0 auto;
  z-index: 50;
  background: transparent;
  border-bottom: 1px solid transparent;
  transition: background 200ms ease-out, border-color 200ms ease-out;
}

.header.is-solid,
.header.is-open {
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom-color: var(--line);
}

/* Sobre hero oscuro: texto claro mientras el header es transparente */
.hero-dark .header:not(.is-solid):not(.is-open) .nav__link,
.hero-dark .header:not(.is-solid):not(.is-open) .nav__whatsapp {
  color: #fff;
}

.hero-dark .header:not(.is-solid):not(.is-open) .nav__toggle span {
  background: #fff;
}

.hero-dark .header:not(.is-solid):not(.is-open) .header__logo img {
  filter: brightness(0) invert(1);
}

.header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  min-height: 72px;
}

.header__logo {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
}

.header__logo img {
  width: 132px;
  height: 63px;
}

.nav {
  display: flex;
  align-items: center;
  gap: var(--space-4);
}

.nav__list {
  display: flex;
  gap: var(--space-4);
  list-style: none;
  padding: 0;
}

.nav__link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--ink);
  font-weight: 500;
  text-decoration: none;
  background: linear-gradient(var(--accent), var(--accent)) no-repeat left bottom / 0 2px;
  transition: background-size 200ms ease-out;
}

.nav__link:hover,
.nav__link:focus-visible,
.nav__link[aria-current='page'] {
  background-size: 100% 2px;
}

.nav__whatsapp {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
  color: var(--ink);
}

.nav__whatsapp:hover {
  color: var(--accent);
}

/* Hamburguesa (<1024px) */

.nav__toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  padding: 10px;
  border: 0;
  background: none;
  cursor: pointer;
}

.nav__toggle span {
  display: block;
  height: 2px;
  background: var(--ink);
  transition: transform 200ms ease-out, opacity 200ms ease-out;
}

.nav__toggle[aria-expanded='true'] span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.nav__toggle[aria-expanded='true'] span:nth-child(2) {
  opacity: 0;
}

.nav__toggle[aria-expanded='true'] span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* Menú móvil: overlay a pantalla completa ----------------------------- */

@media (max-width: 1023px) {
  .nav__toggle {
    display: flex;
    position: relative;
    z-index: 60; /* por encima del overlay del panel */
  }

  .header__logo {
    position: relative;
    z-index: 60;
  }

  .nav__panel {
    position: fixed;
    inset: 0;
    height: 100dvh;
    padding: calc(72px + env(safe-area-inset-top)) var(--space-4) env(safe-area-inset-bottom);
    background: var(--surface);
    display: none;
    flex-direction: column;
    overscroll-behavior: contain;
    overflow-y: auto;
  }

  .nav__panel.is-open {
    display: flex;
  }

  .nav__list {
    flex-direction: column;
    gap: 0;
    border-top: 1px solid var(--line);
  }

  .nav__list li {
    border-bottom: 1px solid var(--line);
  }

  .nav__link {
    width: 100%;
    min-height: 56px;
    font-size: 1.35rem;
    font-weight: 600;
  }

  .nav__panel .btn {
    margin-top: var(--space-5);
    justify-content: center;
  }

  body.menu-open {
    overflow: hidden;
  }
}

@media (min-width: 1024px) {
  .nav__panel {
    display: flex;
    align-items: center;
    gap: var(--space-4);
  }
}

/* Footer --------------------------------------------------------------- */

.footer {
  border-top: 1px solid var(--line);
  padding-block: var(--space-6) var(--space-5);
  font-size: 0.95rem;
}

.footer__grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: var(--space-5) var(--space-4);
}

.footer__brand img {
  width: 118px;
  height: 56px;
  margin-bottom: var(--space-3);
}

.footer__claim {
  color: var(--text-muted);
  max-width: 30ch;
}

.footer address {
  font-style: normal;
  color: var(--text-muted);
  margin-top: var(--space-3);
  line-height: 1.8;
  display: grid;
  gap: var(--space-2);
}

.footer__napline {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
}

.footer__napline .icon {
  width: 18px;
  height: 18px;
}

.footer h2 {
  font-size: 0.82rem;
  font-variation-settings: 'wdth' 80;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: var(--space-3);
  font-weight: 600;
}

.footer ul {
  list-style: none;
  padding: 0;
  display: grid;
  gap: var(--space-2);
}

.footer a {
  color: var(--ink-soft);
  text-decoration: none;
}

.footer a:hover {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.footer__legalline {
  margin-top: var(--space-4);
  padding-top: var(--space-4);
  border-top: 1px solid var(--line);
  color: var(--text-muted);
  font-size: 0.88rem;
}

/* wordmark gigante de cierre (gesto de marca, decorativo; texto en pseudo-elemento) */
.footer__wordmark::before {
  content: attr(data-text);
}

.footer__wordmark {
  margin-top: var(--space-6);
  font-size: clamp(3.2rem, 11.5vw, 10rem);
  font-weight: 650;
  letter-spacing: -0.04em;
  line-height: 0.95;
  color: color-mix(in srgb, var(--ink-soft) 9%, transparent);
  white-space: nowrap;
  overflow: hidden;
  user-select: none;
}

@media (max-width: 767px) {
  .footer__grid {
    grid-template-columns: 1fr 1fr;
  }

  .footer__brand {
    grid-column: 1 / -1;
  }
}

/* Tarjetas -------------------------------------------------------------- */

.card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: var(--space-5) var(--space-4);
  background: var(--surface);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  transition: transform 250ms cubic-bezier(0.16, 1, 0.3, 1), border-color 250ms ease-out,
    box-shadow 250ms ease-out;
}

.card:hover {
  transform: translateY(-4px);
  border-color: var(--accent);
  box-shadow: 0 12px 32px -16px color-mix(in srgb, var(--accent) 35%, transparent);
}

@media (prefers-reduced-motion: reduce) {
  .card,
  .card:hover {
    transform: none;
    transition: none;
  }
}

.card > p {
  flex: 1;
}

.card__price {
  color: var(--ink);
  font-weight: 650;
}

/* Lista con bullets de glifo */

.list-glifo {
  list-style: none;
  padding: 0;
  display: grid;
  gap: var(--space-2);
}

.list-glifo li {
  display: flex;
  gap: var(--space-2);
  align-items: baseline;
}

.list-glifo .glifo {
  transform: translateY(0.05em);
}

/* Tarjeta de proyecto: máscara con esquina en cuarto de círculo ---------- */

.project-card {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  text-decoration: none;
  color: inherit;
}

.project-card__media {
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border-radius: var(--radius);
  background: var(--surface-tint);
  border: 1px solid var(--line);
}

.project-card--featured .project-card__media {
  border-radius: var(--radius) var(--radius) 40% var(--radius) / var(--radius) var(--radius) 28% var(--radius);
}

.project-card__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 500ms cubic-bezier(0.16, 1, 0.3, 1);
}

.project-card:hover .project-card__media img {
  transform: scale(1.04);
}

@media (prefers-reduced-motion: reduce) {
  .project-card:hover .project-card__media img {
    transform: none;
  }
}

.project-card__title {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  color: var(--ink);
  font-weight: 600;
}

.project-card:hover .project-card__title {
  color: var(--accent);
}

.project-card:hover .glifo {
  transform: translateX(4px);
}

.project-card__meta {
  color: var(--text-muted);
  font-size: 0.92rem;
}

/* Tabla / tarjetas de precios ------------------------------------------- */

.pricing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: var(--space-4);
  align-items: stretch;
}

.plan {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: var(--space-5) var(--space-4);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  background: var(--surface);
  transition: transform 250ms cubic-bezier(0.16, 1, 0.3, 1), box-shadow 250ms ease-out;
}

.plan:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 32px -16px color-mix(in srgb, var(--accent) 35%, transparent);
}

@media (prefers-reduced-motion: reduce) {
  .plan,
  .plan:hover {
    transform: none;
    transition: none;
  }
}

.plan--featured {
  border-color: var(--accent);
  border-width: 2px;
}

.plan__name {
  font-size: 1.1rem;
}

.plan__price {
  font-size: 2rem;
  font-weight: 650;
  color: var(--ink);
  letter-spacing: -0.02em;
}

.plan__price small {
  font-size: 0.9rem;
  font-weight: 400;
  color: var(--text-muted);
  letter-spacing: 0;
}

.plan .list-glifo {
  flex: 1;
  font-size: 0.97rem;
}

/* Formularios ------------------------------------------------------------ */

.field {
  display: grid;
  gap: var(--space-1);
}

.field label {
  font-weight: 600;
  color: var(--ink);
  font-size: 0.97rem;
}

.field input,
.field select,
.field textarea {
  font: inherit;
  color: var(--text);
  padding: 12px var(--space-3);
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--surface);
  min-height: 44px;
  width: 100%;
}

.field textarea {
  min-height: 9rem;
  resize: vertical;
}

.field input:focus-visible,
.field select:focus-visible,
.field textarea:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 0;
  border-color: var(--accent);
}

.field--error input,
.field--error textarea {
  border-color: var(--warn);
}

.field__hint {
  font-size: 0.88rem;
  color: var(--text-muted);
}

.field--check {
  grid-template-columns: auto 1fr;
  align-items: start;
  gap: var(--space-2);
}

.field--check input {
  width: 20px;
  height: 20px;
  min-height: 0;
  margin-top: 4px;
  accent-color: var(--accent);
}

.field--check label {
  font-weight: 400;
  color: var(--text);
}

.form-status {
  padding: var(--space-3);
  border-radius: var(--radius);
  border: 1px solid;
  font-weight: 500;
}

.form-status--ok {
  border-color: var(--ok);
  color: #1D7A4F;
  background: #F1FBF6;
}

.form-status--error {
  border-color: var(--warn);
  color: #A34710;
  background: #FDF4EE;
}

/* honeypot fuera de vista para humanos, invisible también para lectores */
.hp-field {
  position: absolute !important;
  left: -9999px !important;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* FAQ (details/summary accesible) ----------------------------------------- */

.faq {
  border-top: 1px solid var(--line);
}

.faq details {
  border-bottom: 1px solid var(--line);
}

.faq summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding: var(--space-4) 0;
  font-weight: 600;
  color: var(--ink);
  cursor: pointer;
  list-style: none;
  min-height: 44px;
}

.faq summary::-webkit-details-marker {
  display: none;
}

.faq summary::after {
  content: '+';
  font-size: 1.4rem;
  font-weight: 400;
  color: var(--accent);
  flex: none;
  line-height: 1;
}

.faq details[open] summary::after {
  content: '−';
}

.faq .faq__body {
  padding-bottom: var(--space-4);
  max-width: 68ch;
}

/* Testimonio -------------------------------------------------------------- */

.testimonial {
  max-width: 46ch;
}

.testimonial blockquote {
  font-size: clamp(1.3rem, 2.4vw, 1.7rem);
  line-height: 1.45;
  color: var(--ink);
  font-weight: 500;
  text-wrap: balance;
}

.testimonial figcaption {
  margin-top: var(--space-4);
  color: var(--text-muted);
}

.testimonial figcaption strong {
  color: var(--ink);
  display: block;
  font-weight: 600;
}

/* Fila de logos de confianza: marquee infinito (texto hasta tener logos) --- */

.trust {
  overflow: hidden;
  -webkit-mask: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
  mask: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
}

.trust__track {
  display: flex;
  gap: var(--space-6);
  width: max-content;
  align-items: center;
  animation: trust-marquee 32s linear infinite;
}

.trust:hover .trust__track {
  animation-play-state: paused;
}

@keyframes trust-marquee {
  to {
    transform: translateX(-50%);
  }
}

.trust span {
  font-variation-settings: 'wdth' 85;
  font-weight: 600;
  color: var(--text-muted);
  font-size: 1.05rem;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.trust img {
  height: 28px;
  width: auto;
  filter: grayscale(1);
  opacity: 0.75;
}

@media (prefers-reduced-motion: reduce) {
  .trust__track {
    animation: none;
    flex-wrap: wrap;
    width: auto;
    gap: var(--space-3) var(--space-5);
  }

  .trust {
    -webkit-mask: none;
    mask: none;
  }
}

/* Cifras con contador ------------------------------------------------------- */

.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: var(--space-4);
}

.stat__number {
  font-size: clamp(2.4rem, 5vw, 3.6rem);
  font-weight: 650;
  color: var(--ink);
  letter-spacing: -0.02em;
  display: block;
}

.stat__label {
  color: var(--text-muted);
}

.section--ink .stat__number {
  color: #fff;
}

.section--ink .stat__number::first-letter {
  color: var(--accent-soft);
}

.section--ink .stat__label {
  color: #B9C3CF;
}

/* Botones sobre fondos oscuros o de acento: máximo contraste */
.section--hero-dark .btn:not(.btn--primary),
.section--accent .btn:not(.btn--primary) {
  border-color: #fff;
  color: #fff;
}

.section--hero-dark .btn:not(.btn--primary) .glifo,
.section--accent .btn:not(.btn--primary) .glifo {
  background-color: #fff;
}

.section--hero-dark .btn:not(.btn--primary):hover,
.section--accent .btn:not(.btn--primary):hover {
  background: rgba(255, 255, 255, 0.12);
}



/* CTA final (sección en tinta con glifo watermark) ---------------------------- */

.cta-final {
  position: relative;
  overflow: hidden;
}

.cta-final::before {
  content: '';
  position: absolute;
  right: -80px;
  top: 50%;
  width: 380px;
  height: 370px;
  transform: translateY(-50%) rotate(-8deg);
  background: var(--accent);
  opacity: 0.16;
  -webkit-mask: url('/assets/img/glifo.svg') no-repeat center / contain;
  mask: url('/assets/img/glifo.svg') no-repeat center / contain;
  pointer-events: none;
}

.cta-final .container {
  position: relative;
  display: grid;
  gap: var(--space-4);
  justify-items: start;
}

.cta-final p {
  color: #C4CCD6;
  max-width: 52ch;
}

.cta-final__actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
}

/* Breadcrumb ------------------------------------------------------------------ */

.breadcrumb {
  padding-top: calc(72px + var(--space-4));
  font-size: 0.9rem;
}

.breadcrumb ol {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  padding: 0;
}

.breadcrumb li + li::before {
  content: '/';
  margin-right: var(--space-2);
  color: var(--line);
}

.breadcrumb a {
  color: var(--text-muted);
  text-decoration: none;
}

.breadcrumb a:hover {
  color: var(--accent);
  text-decoration: underline;
}

/* Filtros de proyectos ---------------------------------------------------------- */

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  list-style: none;
  padding: 0;
}

.filters a,
.filters button {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 6px var(--space-3);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: none;
  font: inherit;
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--ink-soft);
  text-decoration: none;
  cursor: pointer;
}

.filters [aria-pressed='true'],
.filters a:hover,
.filters button:hover {
  border-color: var(--accent);
  color: var(--accent);
}
