:root {
  --paper: #F3F5F6;
  --paper-2: #E3E9EC;
  --ink: #14181B;
  --ink-2: #232A2F;
  --muted: #566069;
  --muted-on-dark: #B7C2CA;
  --accent: #38B6FF;
  --accent-deep: #0B6FB0;
  --wa: #25D366;
  --line: rgba(20, 24, 27, 0.16);
  --font-display: "Bricolage Grotesque", "Segoe UI", system-ui, sans-serif;
  --font-body: "Instrument Sans", "Segoe UI", system-ui, sans-serif;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --header-h: 72px;
}

*, *::before, *::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 12px);
  scrollbar-color: var(--ink) var(--paper);
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.6;
  caret-color: var(--accent);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

::selection { background: var(--accent); color: var(--ink); }

img { display: block; max-width: 100%; height: auto; }

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 800;
  line-height: 1.02;
  letter-spacing: -0.03em;
  margin: 0;
  text-wrap: balance;
}

p { margin: 0; text-wrap: pretty; }

a { color: inherit; }

:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

.wrap { width: min(100% - 2rem, 1240px); margin-inline: auto; }

.skip-link {
  position: absolute; left: 1rem; top: -4rem; z-index: 100;
  background: var(--ink); color: var(--paper);
  padding: 0.75rem 1rem; border-radius: 8px; text-decoration: none;
}
.skip-link:focus { top: 1rem; }

/* ---------- Header ---------- */
.site-header {
  position: fixed; inset: 0 0 auto 0; z-index: 50;
  height: var(--header-h);
  background: var(--paper);
  border-bottom: 1px solid var(--line);
}
.header-inner { height: 100%; display: flex; align-items: center; justify-content: space-between; gap: 1rem; }

.brand { display: inline-flex; align-items: center; min-height: 44px; }
.brand img { height: 34px; width: auto; }

.nav { display: flex; align-items: center; gap: 0.25rem; }
.nav a:not(.btn) {
  text-decoration: none; font-weight: 500; font-size: 0.97rem;
  padding: 0.7rem 0.9rem; min-height: 44px; display: inline-flex; align-items: center;
  border-radius: 8px;
}
.nav a:not(.btn):hover { background: var(--paper-2); }

.nav-toggle {
  display: none; width: 48px; height: 48px; border: 1px solid var(--line);
  background: transparent; border-radius: 10px; cursor: pointer; position: relative;
}
.nav-toggle-bars, .nav-toggle-bars::before, .nav-toggle-bars::after {
  content: ""; position: absolute; left: 13px; right: 13px; height: 2px; background: var(--ink);
  transition: transform 0.3s var(--ease), opacity 0.2s;
}
.nav-toggle-bars { top: 23px; }
.nav-toggle-bars::before { left: 0; right: 0; top: -7px; }
.nav-toggle-bars::after { left: 0; right: 0; top: 7px; }
.nav-toggle[aria-expanded="true"] .nav-toggle-bars { background: transparent; }
.nav-toggle[aria-expanded="true"] .nav-toggle-bars::before { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle-bars::after { transform: translateY(-7px) rotate(-45deg); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 52px; padding: 0.85rem 1.7rem;
  background: var(--accent); color: var(--ink);
  font: 700 1rem/1 var(--font-body); text-decoration: none;
  border: 2px solid var(--ink); border-radius: 999px; cursor: pointer;
  box-shadow: 0 6px 0 -2px var(--ink);
  transition: transform 0.2s var(--ease), box-shadow 0.2s var(--ease), background-color 0.2s;
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 8px 0 -2px var(--ink); }
.btn:active { transform: translateY(2px); box-shadow: 0 2px 0 -2px var(--ink); }
.btn-small { min-height: 44px; padding: 0.6rem 1.2rem; font-size: 0.95rem; box-shadow: none; margin-left: 0.5rem; }
.btn-small:hover { box-shadow: none; transform: translateY(-1px); }
.btn-ghost { background: transparent; }
.btn-ghost:hover { background: var(--ink); color: var(--paper); }
.btn-wa { background: var(--wa); width: 100%; }

/* ---------- Hero ---------- */
.hero { padding: calc(var(--header-h) + clamp(2rem, 6vw, 5rem)) 0 clamp(2rem, 5vw, 4rem); position: relative; }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 3rem; align-items: center; }
.hero h1 { font-size: clamp(2.6rem, 7.4vw, 5.75rem); }
.lede { margin-top: 1.5rem; max-width: 36rem; font-size: clamp(1.1rem, 1.6vw, 1.3rem); color: var(--muted); }
.hero-actions { margin-top: 2.25rem; display: flex; flex-wrap: wrap; gap: 1rem; }

.hero-stage { position: relative; aspect-ratio: 1 / 0.86; width: 100%; }
.hero-frame { position: absolute; margin: 0; }
.hero-frame-a { width: 88%; left: 0; top: 0; z-index: 1; }
.hero-frame-b { width: 62%; right: 0; bottom: 0; z-index: 2; }
.hero-phone { position: absolute; margin: 0; width: 22%; left: 7%; bottom: -4%; z-index: 3; }

.hero-points {
  list-style: none; margin: clamp(2.5rem, 5vw, 4rem) 0 0; padding: 1.25rem 0 0;
  border-top: 2px solid var(--ink);
  display: flex; flex-wrap: wrap; gap: 0.75rem 2.5rem;
  font-weight: 600;
}
.hero-points li { display: flex; align-items: center; gap: 0.6rem; }
.hero-points li::before { content: ""; width: 0.6rem; height: 0.6rem; background: var(--accent); border-radius: 50%; }

/* ---------- Browser frame ---------- */
.frame {
  background: var(--ink); border-radius: 14px; overflow: hidden;
  border: 2px solid var(--ink);
  box-shadow: 0 24px 40px -18px rgba(20, 24, 27, 0.45), 0 4px 10px rgba(20, 24, 27, 0.12);
}
.frame-bar { display: flex; align-items: center; gap: 6px; padding: 9px 12px; background: var(--ink-2); }
.frame-bar i { width: 9px; height: 9px; border-radius: 50%; background: #56626b; flex: none; }
.frame-bar i:first-child { background: var(--accent); }
.frame-bar span {
  margin-left: 8px; padding: 2px 12px; background: var(--ink); color: var(--muted-on-dark);
  border-radius: 999px; font-size: 0.72rem; letter-spacing: 0.02em;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0;
}
.frame img { width: 100%; background: var(--paper-2); }

.phone {
  background: var(--ink); border-radius: 22px; padding: 5px;
  box-shadow: 0 24px 40px -18px rgba(20, 24, 27, 0.55);
  aspect-ratio: 390 / 844;
}
.phone img { width: 100%; height: 100%; object-fit: cover; object-position: top; border-radius: 17px; }

/* ---------- Sections ---------- */
.section { padding: clamp(4rem, 9vw, 8rem) 0; }
.section-alt { background: var(--paper-2); }
.section-dark { background: var(--ink); color: var(--paper); }
.section-title { font-size: clamp(2.1rem, 5vw, 4rem); max-width: 18ch; }
.section-lede { margin-top: 1.25rem; max-width: 34rem; color: var(--muted); font-size: 1.15rem; }

/* Servicios: editorial rows */
.services { list-style: none; margin: clamp(2.5rem, 5vw, 4rem) 0 0; padding: 0; counter-reset: none; }
.services li {
  display: grid; grid-template-columns: minmax(0, 1fr); gap: 0.6rem 3rem;
  padding: 1.75rem 0; border-top: 1px solid var(--ink);
  transition: background-color 0.3s, padding 0.3s var(--ease);
}
.services li:last-child { border-bottom: 1px solid var(--ink); }
.services h3 { font-size: clamp(1.5rem, 2.6vw, 2.2rem); letter-spacing: -0.025em; }
.services p { color: var(--muted); max-width: 38rem; }
.services li:hover h3 { color: var(--accent-deep); }

/* Capturas */
.shots { margin-top: clamp(2.5rem, 5vw, 4rem); display: grid; grid-template-columns: minmax(0, 1fr); gap: 2.75rem 2rem; }
.shot { margin: 0; }
.shot figcaption { margin-top: 1rem; display: flex; flex-direction: column; gap: 0.1rem; }
.shot figcaption strong { font-family: var(--font-display); font-size: 1.3rem; letter-spacing: -0.02em; }
.shot figcaption span { color: var(--muted); font-size: 0.97rem; }
.shot .frame { transition: transform 0.4s var(--ease), box-shadow 0.4s var(--ease); }
.shot:hover .frame { transform: translateY(-6px); box-shadow: 0 32px 48px -20px rgba(20, 24, 27, 0.5), 0 4px 10px rgba(20, 24, 27, 0.12); }

/* Incluido */
.included { list-style: none; margin: clamp(2.5rem, 5vw, 4rem) 0 0; padding: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 0; }
.included li {
  padding: 1.15rem 0 1.15rem 2rem; border-top: 1px solid rgba(243, 245, 246, 0.22);
  position: relative; font-size: 1.15rem; color: var(--paper);
}
.included li::before {
  content: ""; position: absolute; left: 0; top: 1.55rem; width: 0.9rem; height: 0.5rem;
  border-left: 3px solid var(--accent); border-bottom: 3px solid var(--accent); transform: rotate(-45deg);
}

/* Proceso */
.steps { list-style: none; margin: clamp(2.5rem, 5vw, 4rem) 0 0; padding: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 2rem; counter-reset: paso; }
.steps li { counter-increment: paso; padding-top: 1.25rem; border-top: 4px solid var(--ink); }
.steps li:first-child { border-top-color: var(--accent); }
.steps h3 { font-size: 1.7rem; margin-bottom: 0.6rem; }
.steps p { color: var(--muted); }

/* Cotizador */
.quote-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 2.5rem; align-items: start; }
.quote-form { background: var(--paper); border: 2px solid var(--ink); border-radius: 18px; padding: clamp(1.25rem, 3vw, 2rem); display: grid; gap: 1.1rem; box-shadow: 0 10px 0 -2px var(--ink); }
.field { display: grid; gap: 0.4rem; min-width: 0; }
.field-row { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1.1rem; }
label { font-weight: 600; font-size: 0.95rem; }
.opt { font-weight: 400; color: var(--muted); }
input, select, textarea {
  font: inherit; color: var(--ink); background: #fff;
  border: 2px solid var(--ink); border-radius: 10px; padding: 0.75rem 0.9rem;
  min-height: 48px; width: 100%;
}
textarea { resize: vertical; }
input::placeholder, textarea::placeholder { color: #5f6a73; }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.form-error { color: #B3261E; font-weight: 600; }

/* Footer */
.site-footer { background: var(--ink); color: var(--muted-on-dark); padding: 3rem 0 4.5rem; }
.footer-inner { display: grid; gap: 0.75rem; justify-items: start; }
.site-footer .copy { font-size: 0.9rem; }
.site-footer a:not(.brand) { color: var(--paper); text-underline-offset: 3px; }
.site-footer a:not(.brand):hover { color: var(--accent); }
.footer-inner .brand img { height: 38px; }

/* WhatsApp flotante */
.wa-float {
  position: fixed; right: 1rem; bottom: 1rem; z-index: 60;
  width: 58px; height: 58px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--wa); color: var(--ink); border: 2px solid var(--ink);
  box-shadow: 0 6px 0 -2px var(--ink);
  transition: transform 0.2s var(--ease);
}
.wa-float:hover { transform: translateY(-3px); }

/* ---------- Responsive ---------- */
@media (min-width: 700px) {
  .field-row { grid-template-columns: 1fr 1fr; }
  .included { grid-template-columns: 1fr 1fr; column-gap: 3rem; }
  .steps { grid-template-columns: 1fr 1fr; }
  .services li { grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); align-items: baseline; }
}

@media (min-width: 900px) {
  .hero-grid { grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 3rem; }
  .shots { grid-template-columns: 1fr 1fr; }
  .shot:nth-child(even) { margin-top: 4.5rem; }
  .steps { grid-template-columns: repeat(4, 1fr); }
  .quote-grid { grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: 4rem; position: relative; }
  .quote-intro { position: sticky; top: calc(var(--header-h) + 2rem); }
}

@media (max-width: 760px) {
  .nav-toggle { display: block; }
  .nav {
    position: absolute; top: var(--header-h); left: 0; right: 0;
    background: var(--paper); border-bottom: 1px solid var(--line);
    flex-direction: column; align-items: stretch; padding: 0.75rem 1rem 1.25rem; gap: 0;
    display: none;
  }
  .nav.is-open { display: flex; }
  .nav a:not(.btn) { padding: 0.9rem 0.5rem; border-bottom: 1px solid var(--line); border-radius: 0; }
  .nav .btn-small { margin: 1rem 0 0; min-height: 52px; }
  .hero-stage { aspect-ratio: 1 / 0.95; }
  .hero-phone { width: 26%; }
}

/* ---------- Movimiento ---------- */
@media (prefers-reduced-motion: no-preference) {
  @keyframes rise {
    from { opacity: 0; transform: translateY(32px) rotate(var(--r, 0deg)); filter: blur(6px); }
    to { opacity: 1; transform: translateY(0) rotate(var(--r, 0deg)); filter: blur(0); }
  }
  .hero h1, .hero .lede, .hero-actions { animation: rise 0.9s var(--ease) backwards; }
  .hero .lede { animation-delay: 0.1s; }
  .hero-actions { animation-delay: 0.2s; }
  .hero-frame-a { --r: -1.5deg; transform: rotate(-1.5deg); animation: rise 1.1s var(--ease) 0.15s backwards; }
  .hero-frame-b { --r: 2deg; transform: rotate(2deg); animation: rise 1.1s var(--ease) 0.3s backwards; }
  .hero-phone { --r: -4deg; transform: rotate(-4deg); animation: rise 1.1s var(--ease) 0.45s backwards; }

  @supports (animation-timeline: view()) {
    @keyframes reveal {
      from { opacity: 0; transform: translateY(60px); }
      to { opacity: 1; transform: translateY(0); }
    }
    .shot, .steps li, .services li, .included li {
      animation: reveal linear both;
      animation-timeline: view();
      animation-range: entry 0% entry 45%;
    }
  }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition-duration: 0.01ms !important; }
}
