/* Xapiar Home landing — código propio. */
:root {
  --bg: #f9f7f1;
  --surface: #f6f6f3;
  --surface-2: #f2efea;
  --border: #dfdad4;
  --ink: #191919;
  --muted: #615f5a;
  --accent: #eb6f49;
  --white: #fff;
  --r-sm: 12px;
  --r-md: 16px;
  --r-pill: 100px;
  --container: 1205px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 16px/1.7 "Switzer", system-ui, -apple-system, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }

h1, h2, h3, h4 { margin: 0; font-weight: 500; }
h1 { font-size: clamp(34px, 5.6vw, 56px); line-height: 1.1; letter-spacing: -1.8px; }
h2 { font-size: clamp(28px, 4.2vw, 42px); line-height: 1.15; letter-spacing: -1.5px; }
h3 { font-size: clamp(22px, 2.6vw, 26px); line-height: 1.4; letter-spacing: -.6px; }
h4 { font-size: clamp(18px, 2.2vw, 22px); line-height: 1.4; }
p { margin: 0; }

.muted { color: var(--muted); }
.small { font-size: 14px; }

.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
}

section { padding: 80px 30px 70px; }

.section-head {
  display: flex;
  flex-direction: column;
  gap: 14px;
  align-items: center;
  text-align: center;
  max-width: 620px;
  margin: 0 auto 48px;
}

.eyebrow {
  display: inline-block;
  padding: 6px 14px;
  border-radius: var(--r-pill);
  background: var(--surface-2);
  color: var(--accent);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: .02em;
}

/* ---------- botones ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 13px 22px;
  border: 0;
  border-radius: var(--r-sm);
  font: 500 14px/1.7 inherit;
  cursor: pointer;
  transition: transform .15s ease, opacity .15s ease, background .15s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn-dark { background: var(--ink); color: var(--white); }
.btn-dark:hover { background: #2b2b2b; }
.btn-soft { background: var(--surface-2); color: var(--ink); }
.btn-soft:hover { background: var(--border); }
.btn-light { background: var(--white); color: var(--ink); }

/* ---------- header ---------- */
.header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 30px;
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  backdrop-filter: blur(10px);
}
.logo img { height: 30px; width: auto; }

.nav {
  display: flex;
  gap: 8px;
  padding: 10px 14px;
  border-radius: var(--r-pill);
  background: var(--surface);
}
.nav a {
  padding: 4px 12px;
  border-radius: var(--r-pill);
  color: var(--muted);
  font-size: 14px;
}
.nav a:hover { color: var(--ink); background: var(--surface-2); }

.header-actions { display: flex; align-items: center; gap: 6px; }
.menu-toggle {
  display: none;
  width: 42px;
  height: 42px;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: var(--r-sm);
  background: var(--surface);
  cursor: pointer;
}
.menu-toggle span {
  display: block;
  width: 18px;
  height: 1.5px;
  background: var(--ink);
  box-shadow: 0 -5px 0 var(--ink), 0 5px 0 var(--ink);
}

/* ---------- hero ---------- */
.hero { padding-top: 70px; text-align: center; }
.hero-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 22px;
  max-width: 680px;
  margin: 0 auto;
}
.hero h1 .dim { color: var(--muted); }
.hero-sub { max-width: 560px; }
.hero-cta { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }

.rating { display: flex; align-items: center; gap: 12px; }
.avatars { display: flex; }
.avatars img {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid var(--bg);
  margin-left: -8px;
}
.avatars img:first-child { margin-left: 0; }

/* franja de capturas de la app */
.showcase { margin-top: 64px; overflow: hidden; mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent); }
.showcase-track {
  display: flex;
  gap: 20px;
  width: max-content;
  animation: marquee 42s linear infinite;
}
.shot {
  position: relative;
  flex: 0 0 auto;
  height: 356px;
  border-radius: var(--r-md);
  overflow: hidden;
}
.shot-bg { width: 100%; height: 100%; object-fit: cover; }
.shot-chip {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  height: auto;
  filter: drop-shadow(0 8px 24px rgb(25 25 25 / .12));
}
@keyframes marquee { to { transform: translateX(-50%); } }
.showcase:hover .showcase-track { animation-play-state: paused; }

/* ---------- stats ---------- */
.stats { display: flex; flex-direction: column; align-items: center; gap: 40px; text-align: center; }
.stats h4 { max-width: 460px; }
.stat-grid { display: flex; gap: 80px; flex-wrap: wrap; justify-content: center; }
.stat-num { font-size: clamp(40px, 6vw, 64px); line-height: 1.1; letter-spacing: -2px; font-weight: 500; }

/* ---------- grillas de cards ---------- */
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }

.card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 20px;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--surface);
}
.card > img { border-radius: var(--r-sm); background: var(--surface-2); }
.card-body { display: flex; flex-direction: column; gap: 6px; }

.panel {
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding: 20px;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--surface);
}
.panel-media {
  border-radius: var(--r-sm);
  background: var(--surface-2);
  overflow: hidden;
}
.panel-media img { width: 100%; height: auto; }

/* fondo + chips de UI encima, como en los mockups del hero */
.stack { position: relative; }
.stack-chip {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  width: auto;
  filter: drop-shadow(0 8px 24px rgb(25 25 25 / .12));
}

/* ---------- feature split ---------- */
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: stretch; }
.split-copy { display: flex; flex-direction: column; gap: 18px; justify-content: center; padding: 40px; }
.bullets { display: flex; flex-direction: column; gap: 12px; margin: 0; padding: 0; list-style: none; }
.bullets li { display: flex; gap: 10px; color: var(--muted); font-size: 14px; }
.bullets li::before {
  content: "";
  flex: 0 0 6px;
  height: 6px;
  margin-top: 9px;
  border-radius: 50%;
  background: var(--accent);
}

/* ---------- pasos ---------- */
.steps { counter-reset: step; }
.step { display: flex; flex-direction: column; gap: 8px; padding: 24px; border: 1px solid var(--border); border-radius: var(--r-md); background: var(--surface); }
.step-num { font-size: 14px; font-weight: 500; color: var(--accent); }

/* ---------- soporte ---------- */
.support {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--surface);
}
.support img { width: 48px; height: 48px; border-radius: 50%; }
.support .btn { margin-left: auto; }

/* ---------- testimonios ---------- */
.marquee { overflow: hidden; mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent); }
.marquee + .marquee { margin-top: 16px; }
.marquee-track { display: flex; gap: 16px; width: max-content; animation: marquee 60s linear infinite; }
.marquee-reverse .marquee-track { animation-direction: reverse; }
.marquee:hover .marquee-track { animation-play-state: paused; }
.quote {
  display: flex;
  flex-direction: column;
  gap: 16px;
  justify-content: space-between;
  width: 380px;
  padding: 24px;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--surface);
}
.quote-author { display: flex; align-items: center; gap: 10px; }
.quote-author img { width: 30px; height: 30px; border-radius: 50%; }

/* ---------- faq ---------- */
.faq { max-width: 760px; margin: 0 auto; display: flex; flex-direction: column; gap: 10px; }
.faq details {
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--surface);
  padding: 18px 20px;
}
.faq summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  cursor: pointer;
  font-weight: 500;
  list-style: none;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+";
  font-size: 20px;
  line-height: 1;
  color: var(--muted);
}
.faq details[open] summary::after { content: "–"; }
.faq details p { margin-top: 12px; color: var(--muted); font-size: 14px; }

/* ---------- cta ---------- */
.cta {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  padding: 64px 30px;
  border-radius: var(--r-md);
  background: var(--surface-2) center/cover no-repeat;
  text-align: center;
}

/* ---------- footer ---------- */
.footer { padding: 60px 30px 30px; border-top: 1px solid var(--border); }
.footer-grid { display: grid; grid-template-columns: 1.4fr repeat(4, 1fr); gap: 32px; }
.footer-col { display: flex; flex-direction: column; gap: 10px; }
.footer-col h5 { margin: 0 0 4px; font-size: 14px; font-weight: 500; }
.footer-col a { font-size: 14px; color: var(--muted); }
.footer-col a:hover { color: var(--ink); }

.newsletter { display: flex; gap: 8px; }
.newsletter input {
  flex: 1;
  min-width: 0;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  background: var(--white);
  font: inherit;
  font-size: 14px;
}
.newsletter input:focus { outline: 2px solid var(--ink); outline-offset: -1px; }

.footer-legal {
  margin-top: 48px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 12px;
  color: var(--muted);
  font-size: 12px;
}

/* ---------- logo ----------
   El PNG viene en crema (para fondo oscuro). Sobre papel lo pasamos a negro,
   igual que el portal en HostyWordmark. */
.logo img { filter: brightness(0) saturate(100%); }

/* ---------- franja de comandos del hero ---------- */
.showcase-cmd .showcase-track { animation-duration: 52s; }
.cmd {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
  padding: 16px 22px;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--surface);
  font-size: 15px;
  white-space: nowrap;
}
.cmd-you { background: var(--ink); border-color: var(--ink); color: var(--white); }

/* ---------- chips de dispositivo ---------- */
.chips { display: flex; flex-direction: column; gap: 8px; width: 100%; }
.chip {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  background: var(--white);
  font-size: 14px;
}
.chip strong { min-width: 0; margin-right: auto; font-weight: 500; }
.chip-state { flex: 0 0 auto; font-size: 12px; color: var(--muted); }

.led { flex: 0 0 auto; width: 10px; height: 10px; border-radius: 50%; background: var(--accent); }
.led-on { background: #4a9c6d; }
.led-off { background: var(--border); }

/* superficies que antes llevaban mockup: degradado de fondo + chips encima.
   El degradado se elige por card con .g1….g5 para que no se repitan. */
.card-media,
.panel-media.is-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  border-radius: var(--r-sm);
  background: var(--surface-2) center/cover no-repeat;
}

/* doble clase: la regla base usa .panel-media.is-empty y con una sola
   clase el atajo `background` le ganaba y borraba la imagen. */
.card-media.g1, .panel-media.g1 { background-image: url('img/grad-1.avif'); }
.card-media.g2, .panel-media.g2 { background-image: url('img/grad-2.avif'); }
.card-media.g3, .panel-media.g3 { background-image: url('img/grad-3.avif'); }
.card-media.g4, .panel-media.g4 { background-image: url('img/grad-4.avif'); }
.card-media.g5, .panel-media.g5 { background-image: url('img/grad-5.avif'); }
/* ocupan todo el alto libre de la card, así las de una misma fila igualan */
.card-media,
.panel-media.is-empty { flex: 1 1 auto; }
.card-media { min-height: 150px; }
.panel-media.is-empty { min-height: 230px; }

/* ---------- swatches de tira LED ---------- */
.swatches { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.swatches span {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 1px solid rgb(25 25 25 / .12);
}

/* ---------- chat ---------- */
.chat { display: flex; flex-direction: column; gap: 8px; width: 100%; }
.bubble {
  max-width: 88%;
  padding: 10px 14px;
  border-radius: var(--r-md);
  font-size: 14px;
  line-height: 1.4;
}
.bubble .small { display: block; margin-top: 2px; }
.bubble-out {
  align-self: flex-end;
  background: var(--ink);
  color: var(--white);
  border-bottom-right-radius: 6px;
}
.bubble-out .muted { color: #a8a49c; }
.bubble-in {
  align-self: flex-start;
  background: var(--white);
  border: 1px solid var(--border);
  border-bottom-left-radius: 6px;
}

/* ---------- reveal on scroll ---------- */
.reveal { opacity: 0; transform: translateY(16px); transition: opacity .6s ease, transform .6s ease; }
.reveal.is-in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  .showcase-track, .marquee-track { animation: none; }
  html { scroll-behavior: auto; }
}

/* ---------- responsive ---------- */
@media (max-width: 1000px) {
  .grid-3, .split, .footer-grid { grid-template-columns: 1fr 1fr; }
  .footer-grid { gap: 24px; }
  .split-copy { padding: 24px; }
}

@media (max-width: 700px) {
  section { padding: 56px 20px 48px; }
  .header { padding: 14px 20px; }
  .nav { display: none; }
  .nav.is-open {
    display: flex;
    position: absolute;
    top: 72px;
    left: 20px;
    right: 20px;
    flex-direction: column;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    background: var(--bg);
  }
  .menu-toggle { display: flex; }
  .grid-3, .grid-2, .split, .footer-grid { grid-template-columns: 1fr; }
  .stat-grid { gap: 40px; }
  .shot { height: 240px; }
  .shot-chip { display: none; }
  .quote { width: 300px; }
  .support { flex-wrap: wrap; }
  .support .btn { margin-left: 0; width: 100%; justify-content: center; }
}
