/* ============================================
   Homepage-specific styles
   ============================================ */

/* Hero */
.hero {
  padding: clamp(48px, 8vw, 96px) 0 clamp(40px, 6vw, 72px);
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: "";
  position: absolute;
  top: -10%; right: -10%;
  width: 60%; height: 70%;
  background: radial-gradient(ellipse at center, color-mix(in oklab, var(--primary) 8%, transparent), transparent 70%);
  pointer-events: none;
  z-index: 0;
}
.hero__inner {
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  gap: clamp(32px, 6vw, 80px);
  align-items: center;
  position: relative;
  z-index: 1;
}
.hero__inner--centered {
  display: flex;
  justify-content: center;
  position: relative;
  z-index: 1;
}
.hero__content--centered {
  text-align: center;
  max-width: 800px;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.hero__content--centered .hero__lede {
  max-width: 600px;
}
.hero__content--centered .hero__cta {
  justify-content: center;
}
.hero__content--centered .hero__stats {
  justify-content: center;
}
.hero__title {
  font-size: clamp(60px, 9vw, 120px);
  margin-top: 24px;
  letter-spacing: -0.04em;
  line-height: 0.95;
  position: relative;
}
/* The ghost holds the title's final size; the typed copy paints on top of it,
   so the CTA and stats below never shift while the effect runs */
.hero__title-ghost {
  display: block;
  visibility: hidden;
}
.hero__title-typed {
  position: absolute;
  inset: 0;
}
.hero__title-accent { color: var(--primary); font-style: italic; font-family: "Instrument Serif", Georgia, serif; font-weight: 400; }
.typewriter-cursor {
  display: inline-block;
  font-weight: 300;
  color: var(--primary);
  animation: blink 0.6s step-end infinite;
  margin-left: 2px;
}
@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}
.hero__lede {
  margin-top: 24px;
  max-width: 520px;
  color: var(--text-muted);
  font-size: 17px;
  line-height: 1.55;
}
.hero__cta {
  display: flex; gap: 12px; flex-wrap: wrap;
  margin-top: 32px;
}
.hero__stats {
  display: flex; gap: clamp(24px, 5vw, 56px);
  margin-top: 48px;
  padding-top: 32px;
  border-top: 1px solid var(--border);
}
.hero__stats > div {
  display: flex; flex-direction: column; gap: 2px;
}
.hero__stats strong {
  font-family: var(--font-display);
  font-size: 36px;
  font-weight: 600;
  letter-spacing: -0.03em;
  color: var(--primary);
  font-variant-numeric: tabular-nums;
}
.hero__stats span {
  font-size: 13px;
  color: var(--text-muted);
}

/* Hero visual collage */
.hero__visual {
  position: relative;
  aspect-ratio: 1 / 0.8;
  --ill-bg: var(--primary-soft-2);
  --ill-accent: var(--primary);
}
.hero__card {
  position: absolute;
  border-radius: var(--r-lg);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border);
  background: var(--surface);
  transition: transform 0.4s var(--ease);
}
.hero__card:hover { transform: translateY(-6px) rotate(0deg) !important; }
.hero__card--1 {
  width: 90%; aspect-ratio: 16/9;
  top: 4%; left: 0;
  transform: rotate(-3deg);
  z-index: 2;
}
.hero__card--2 {
  width: 88%; aspect-ratio: 16/9;
  bottom: 4%; right: 0;
  transform: rotate(4deg);
  z-index: 1;
}
.hero__floating {
  position: absolute;
  bottom: 14%; right: 6%;
  display: flex; align-items: center; gap: 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-pill);
  padding: 10px 16px 10px 12px;
  box-shadow: var(--shadow-md);
  font-size: 13px;
  font-weight: 500;
  z-index: 4;
}
.hero__floating-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--whatsapp);
  box-shadow: 0 0 0 4px color-mix(in oklab, var(--whatsapp) 30%, transparent);
}

@media (max-width: 880px) {
  .hero__inner { grid-template-columns: 1fr; }
  .hero__visual { aspect-ratio: 1/0.85; max-width: 520px; margin: 0 auto; width: 100%; }
}

/* Services pills */
.services {
  padding: 32px 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  background: var(--bg-soft);
}
.services__grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
}
.service-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 16px;
  border-radius: var(--r-pill);
  background: var(--surface);
  border: 1px solid var(--border);
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text);
  transition: background 0.2s var(--ease), border-color 0.2s var(--ease), color 0.2s var(--ease), transform 0.16s var(--ease-out);
}
@media (hover: hover) and (pointer: fine) {
  .service-pill:hover {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
    transform: translateY(-2px);
  }
  .service-pill:hover .service-pill__icon { color: white; }
}
.service-pill:active { transform: scale(0.97); }
.service-pill__icon {
  display: inline-flex;
  color: var(--primary);
  transition: color 0.2s;
}

/* Section heads */
.section-head {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 32px;
  align-items: end;
  margin-bottom: 48px;
}
.section-title {
  font-size: clamp(40px, 5vw, 64px);
  margin-top: 12px;
  letter-spacing: -0.035em;
}
.section-lede {
  margin-top: 14px;
  max-width: 520px;
  color: var(--text-muted);
  font-size: 16px;
}
.section-head__actions { display: flex; gap: 10px; flex-wrap: wrap; }
@media (max-width: 768px) {
  .section-head { grid-template-columns: 1fr; }
}

/* Featured catalog */
.featured-catalog { padding: clamp(64px, 8vw, 112px) 0; }
.featured-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}
@media (max-width: 920px) { .featured-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .featured-grid { grid-template-columns: 1fr; } }

/* Product card */
.product-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  overflow: hidden;
  transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease), border-color 0.2s;
  display: flex;
  flex-direction: column;
  --ill-bg: var(--primary-soft-2);
  --ill-accent: var(--primary);
}
[data-theme="dark"] .product-card { --ill-bg: #2A1F1A; }
@media (hover: hover) and (pointer: fine) {
  .product-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
    border-color: var(--border-strong);
  }
}
.product-card__image {
  position: relative;
  aspect-ratio: 4/3;
  overflow: hidden;
  background: var(--bg-muted);
}
.product-card__image > img,
.product-card__image > svg { transition: transform 0.4s var(--ease); }
@media (hover: hover) and (pointer: fine) {
  .product-card:hover .product-card__image > img,
  .product-card:hover .product-card__image > svg { transform: scale(1.04); }
}
.product-card__body {
  padding: 18px 20px 20px;
  display: flex;
  flex-direction: column;
  flex: 1;
}
.product-card__title {
  font-family: var(--font-body);
  font-size: 16.5px;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin-bottom: 6px;
}
.product-card__desc {
  color: var(--text-muted);
  font-size: 13.5px;
  line-height: 1.5;
  margin-bottom: 12px;
  flex: 1;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.product-card__chips {
  display: flex; flex-wrap: wrap; gap: 6px;
  min-height: 24px;
}

/* Service mini card (home featured services) — clickable card */
.service-mini-card { color: inherit; text-decoration: none; }
.service-mini-card .product-card__title { color: var(--text); }
.service-mini-card .product-card__image { background: var(--bg-muted); }
.service-mini-card .product-card__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* About section */
.about {
  padding: clamp(64px, 8vw, 112px) 0;
  scroll-margin-top: 96px;
  background: var(--bg-soft);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.about__inner { display: grid; gap: 48px; }
.about__head { max-width: 720px; }
.about__em {
  font-style: italic;
  font-family: "Instrument Serif", Georgia, serif;
  font-weight: 400;
  color: var(--primary);
}
.about__body {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
  max-width: 1040px;
}
.about__lede { color: var(--text-muted); font-size: 16px; line-height: 1.65; }
.about__lede strong { color: var(--text); }
.about__features {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin-top: 16px;
}
/* Colores invertidos respecto al resto de la página: la tarjeta va en rojo de
   marca y todo su contenido en blanco. Centrada, ícono incluido. */
.about-feature {
  background: var(--primary);
  border: 1px solid var(--primary);
  border-radius: var(--r-md);
  padding: 28px 24px;
  text-align: center;
  color: #fff;
}
.about-feature__icon {
  display: inline-grid;
  place-items: center;
  width: 44px; height: 44px;
  border-radius: 12px;
  /* Blanco translúcido: el chip se sigue leyendo sobre el rojo sin
     introducir un tercer color */
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
  font-size: 22px;
  margin-bottom: 14px;
}
.about-feature h4 {
  font-family: var(--font-body);
  font-size: 15.5px;
  font-weight: 600;
  margin-bottom: 6px;
  color: #fff;
}
.about-feature p {
  color: rgba(255, 255, 255, 0.88);
  font-size: 13.5px;
  line-height: 1.5;
}
@media (max-width: 880px) {
  .about__body { grid-template-columns: 1fr; }
  .about__features { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 480px) {
  .about__features { grid-template-columns: 1fr; }
}

/* Contact section */
.contact { padding: clamp(64px, 8vw, 112px) 0; scroll-margin-top: 96px; }
.contact__inner {
  display: grid;
  grid-template-columns: 1fr 1.1fr;
  gap: clamp(40px, 6vw, 80px);
  align-items: start;
}
.contact__lede {
  margin-top: 16px;
  color: var(--text-muted);
  font-size: 16px;
  line-height: 1.6;
}
.contact__list {
  list-style: none;
  padding: 0;
  margin: 32px 0 0;
  display: grid;
  gap: 18px;
}
.contact__list li {
  display: grid;
  grid-template-columns: 140px 1fr;
  align-items: baseline;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}
.contact__list strong {
  font-size: 11.5px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-subtle);
  font-weight: 600;
}
.contact__list span, .contact__list a { font-size: 16px; }
.contact__list a:hover { color: var(--primary); }

.contact__form {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: clamp(28px, 4vw, 40px);
  box-shadow: var(--shadow-sm);
}
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.form-field label {
  font-size: 11.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-subtle);
  font-weight: 600;
}
.form-field input,
.form-field select,
.form-field textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--border-strong);
  border-radius: var(--r-sm);
  background: var(--bg);
  color: var(--text);
  font-size: 14.5px;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.form-field input:focus,
.form-field select:focus,
.form-field textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 4px color-mix(in oklab, var(--primary) 15%, transparent);
}
.form-field textarea { resize: vertical; min-height: 100px; font-family: inherit; }

.form-note {
  font-size: 12.5px;
  color: var(--text-subtle);
  text-align: center;
  margin-top: 12px;
  line-height: 1.5;
}
.form-note a { color: var(--primary); font-weight: 500; }
.form-note a:hover { text-decoration: underline; }

.quote-preview {
  margin-top: 16px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  background: var(--bg-soft);
  opacity: 1;
  transform: none;
  transition: opacity 0.3s var(--ease-out), transform 0.3s var(--ease-out);
}
/* Aparece al enviar la cotización: un solo evento, sin teletransporte */
@starting-style {
  .quote-preview { opacity: 0; transform: translateY(8px); }
}
.quote-preview__head {
  font-size: 13px;
  line-height: 1.55;
  color: var(--text-muted);
  margin: 0 0 12px;
}
.quote-preview__body {
  margin: 0;
  padding: 12px;
  max-height: 220px;
  overflow-y: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12.5px;
  line-height: 1.6;
  color: var(--text);
  white-space: pre-wrap;
  word-break: break-word;
}
.quote-preview__actions {
  display: flex;
  gap: 10px;
  margin-top: 12px;
}
.quote-preview__actions .btn { flex: 1; justify-content: center; }
.quote-preview .form-note { margin-top: 10px; }

@media (max-width: 520px) {
  .quote-preview__actions { flex-direction: column; }
}

@media (max-width: 880px) {
  .contact__inner { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; }
  .contact__list li { grid-template-columns: 1fr; gap: 4px; }
}

/* ============================================
   Scroll reveal — una sola vez, solo en la landing
   ============================================
   El atributo [data-reveal] se elimina en cuanto la animación termina, para que
   estas reglas no le sigan compitiendo al hover de las tarjetas después. */
[data-reveal] {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.5s var(--ease), transform 0.5s var(--ease);
}
[data-reveal].is-in {
  opacity: 1;
  transform: none;
}

/* El padre se encarga del fade; las tarjetas solo aterrizan escalonadas, para
   que las opacidades no se multipliquen entre sí */
[data-reveal] .featured-grid > *,
[data-reveal] .about__features > * {
  transform: translateY(14px);
  transition: transform 0.5s var(--ease);
}
[data-reveal].is-in .featured-grid > *,
[data-reveal].is-in .about__features > * { transform: none; }

[data-reveal].is-in .featured-grid > :nth-child(2),
[data-reveal].is-in .about__features > :nth-child(2) { transition-delay: 0.06s; }
[data-reveal].is-in .featured-grid > :nth-child(3),
[data-reveal].is-in .about__features > :nth-child(3) { transition-delay: 0.12s; }
[data-reveal].is-in .featured-grid > :nth-child(4),
[data-reveal].is-in .about__features > :nth-child(4) { transition-delay: 0.18s; }
[data-reveal].is-in .featured-grid > :nth-child(5) { transition-delay: 0.24s; }
[data-reveal].is-in .featured-grid > :nth-child(6) { transition-delay: 0.3s; }
