:root {
  --bg: #faf8f3;
  --surface: #ffffff;
  --surface-2: #edf3f5;
  --text: #183b56;
  --muted: #5e7180;
  --line: #d7e1e5;
  --sage: #a8c3a0;
  --sage-dark: #52715d;
  --coral: #f28c70;
  --coral-dark: #dc7258;
  --dark: #183b56;
  --shadow: 0 24px 70px rgba(24, 59, 86, 0.14);
}

body { background: var(--bg); }
.site-header { transition: background-color .35s ease, border-color .35s ease, box-shadow .35s ease; }
.site-header.is-scrolled { box-shadow: 0 10px 30px rgba(24, 59, 86, .09); }
.nav-wrap { transition: min-height .3s ease; }
.site-header.is-scrolled .nav-wrap { min-height: 68px; }
.brand-mark { background: linear-gradient(145deg, var(--sage), var(--sage-dark)); box-shadow: 0 7px 18px color-mix(in srgb, var(--sage-dark) 24%, transparent); transition: transform .3s cubic-bezier(.2,.8,.2,1), box-shadow .3s ease; }
.brand:hover .brand-mark { transform: rotate(-6deg) scale(1.07); box-shadow: 0 10px 22px color-mix(in srgb, var(--sage-dark) 34%, transparent); }
.main-nav > a:not(.nav-cta) { position: relative; }
.main-nav > a:not(.nav-cta)::after { content: ''; position: absolute; left: 0; right: 100%; bottom: -7px; height: 2px; border-radius: 999px; background: var(--coral); transition: right .25s ease; }
.main-nav > a:not(.nav-cta):hover::after { right: 0; }
.nav-cta { box-shadow: 0 8px 20px rgba(24, 59, 86, .16); transition: transform .25s ease, box-shadow .25s ease, background-color .35s ease, color .35s ease; }
.nav-cta:hover { transform: translateY(-2px); box-shadow: 0 12px 25px rgba(24, 59, 86, .22); }
.theme-toggle { transition: color .4s ease, background-color .4s ease, border-color .4s ease, transform .25s ease, box-shadow .25s ease; }
.theme-toggle:hover { transform: rotate(8deg) scale(1.06); box-shadow: 0 8px 20px rgba(24, 59, 86, .12); }
.theme-toggle.theme-spinning { animation: theme-spin .55s cubic-bezier(.2,.8,.2,1); }
.hero { padding-top: 72px; }
.hero h1 .hero-accent { color: var(--coral-dark); }
.hero h1 .hero-contact { color: #3f8a62; position: relative; display: inline-block; text-shadow: 0 8px 24px rgba(63, 138, 98, .12); }
.hero h1 .hero-contact::after { content: ''; position: absolute; left: 2px; right: 2px; bottom: -3px; height: 5px; border-radius: 999px; background: color-mix(in srgb, #3f8a62 32%, transparent); transform: scaleX(.7); transform-origin: left; }
.hero-visual { min-height: 520px; height: auto; display: grid; place-items: center; }
.hero-device-stage { position: relative; width: 100%; max-width: 660px; min-height: 520px; margin: 0 auto; }
.hero-asset { display: block; width: 100%; height: auto; max-width: 660px; margin: 0 auto; object-fit: contain; filter: drop-shadow(0 22px 22px rgba(24, 59, 86, .16)); }
.reveal { opacity: 0; transform: translateY(24px); transition: opacity .65s ease var(--reveal-delay, 0ms), transform .65s cubic-bezier(.2,.7,.2,1) var(--reveal-delay, 0ms); }
.reveal.is-visible { opacity: 1; transform: translateY(0); }
.is-pressed { transform: scale(.96) !important; }
.button, .nav-cta, .floating-whatsapp { will-change: transform; }
.button-primary, .nav-cta, .footer-whatsapp, .floating-whatsapp { position: relative; isolation: isolate; }
.button-primary::after, .nav-cta::after, .footer-whatsapp::after, .floating-whatsapp::after { content: ''; position: absolute; inset: -6px; z-index: -1; border: 2px solid currentColor; border-radius: inherit; opacity: 0; transform: scale(.82); pointer-events: none; }
.cta-activated { animation: cta-click .58s cubic-bezier(.2,.8,.2,1) !important; }
.cta-activated::after { animation: cta-ring .58s ease-out; }
.device { position: absolute; display: block; height: auto; object-fit: contain; filter: drop-shadow(0 22px 22px rgba(24, 59, 86, .18)); }
.device-laptop { width: 94%; left: -2%; top: 11%; z-index: 1; }
.device-tablet { width: 96%; height: auto; left: -3%; top: 7%; z-index: 2; }
.device-phone { width: auto; height: 76%; right: 0; bottom: 0; z-index: 3; }
.hero-visual > .visual-glow,
.hero-visual > .tablet-frame,
.hero-visual > .phone-frame,
.hero-visual > .visual-note { display: none; }
.proof-strip { background: #f1f5f2; }
.service-card { box-shadow: 0 10px 30px rgba(24, 59, 86, 0.04); }
.card-icon svg { width: 29px; height: 29px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.service-card.featured { background: var(--dark); }
.card-icon { color: var(--coral-dark); }
.dark-band { background: var(--dark); }
.button-primary, .contact-box { background: var(--coral); }
.button-primary:hover { background: var(--coral-dark); }
.button-light { color: var(--dark); }
.contact-box h2 { max-width: 650px; }
.floating-whatsapp { position: fixed; right: 22px; bottom: 22px; z-index: 30; width: 54px; height: 54px; border-radius: 50%; display: grid; place-items: center; background: #4e8a67; color: #fff; box-shadow: 0 12px 28px rgba(24, 59, 86, .24); transition: transform .2s ease, box-shadow .2s ease; animation: whatsapp-float 3.2s ease-in-out infinite; }
.floating-whatsapp::before { content: ''; position: absolute; inset: -1px; z-index: -1; border-radius: 50%; background: rgba(78, 138, 103, .32); animation: whatsapp-pulse 2.6s ease-out infinite; }
.floating-whatsapp:hover { animation-play-state: paused; transform: translateY(-5px) scale(1.05); box-shadow: 0 17px 35px rgba(24, 59, 86, .3); }
.floating-whatsapp svg { width: 27px; height: 27px; fill: none; stroke: currentColor; stroke-width: 1.65; stroke-linecap: round; stroke-linejoin: round; }

[data-theme="dark"] {
  --bg: #102635;
  --surface: #183b56;
  --surface-2: #1d465e;
  --text: #f1f6f7;
  --muted: #c0d0d8;
  --line: #3d6074;
  --sage: #a8c3a0;
  --sage-dark: #c1d8b9;
  --coral: #f28c70;
  --coral-dark: #ffab91;
  --dark: #0b1d29;
}
[data-theme="dark"] .proof-strip { background: #153247; }
[data-theme="dark"] .device { filter: drop-shadow(0 22px 22px rgba(0, 0, 0, .34)); }
[data-theme="dark"] .hero-asset { filter: drop-shadow(0 22px 22px rgba(0, 0, 0, .34)); }
[data-theme="dark"] .hero h1 .hero-contact { color: #8bcda5; text-shadow: 0 8px 28px rgba(139, 205, 165, .15); }
[data-theme="dark"] .hero h1 .hero-contact::after { background: rgba(139, 205, 165, .27); }

html.theme-transitioning body,
html.theme-transitioning .site-header,
html.theme-transitioning .service-card,
html.theme-transitioning .proof-strip,
html.theme-transitioning .faq-section,
html.theme-transitioning .whatsapp-form,
html.theme-transitioning input,
html.theme-transitioning select,
html.theme-transitioning textarea,
html.theme-transitioning .theme-toggle,
html.theme-transitioning .main-nav,
html.theme-transitioning .site-footer {
  transition: background-color .48s ease, color .48s ease, border-color .48s ease, box-shadow .48s ease;
}

.site-footer { margin-top: 18px; padding: 0; border-top: 0; background: linear-gradient(135deg, var(--dark), color-mix(in srgb, var(--dark) 82%, var(--sage-dark))); color: #f3f7f5; }
.footer-main { display: grid; grid-template-columns: 1.25fr .7fr 1fr; gap: 70px; padding-block: 58px 46px; }
.site-footer .brand { color: #fff; }
.site-footer .brand strong { color: #bcd6c3; }
.site-footer .brand-mark { color: #fff; }
.footer-about > p { max-width: 390px; margin: 20px 0 0; color: rgba(241, 246, 247, .7); font-size: 14px; }
.footer-nav, .footer-cta { display: flex; flex-direction: column; align-items: flex-start; gap: 11px; }
.footer-nav strong, .footer-cta strong { margin-bottom: 5px; color: #fff; font-family: 'Space Grotesk', sans-serif; font-size: 15px; }
.footer-nav a { color: rgba(241, 246, 247, .72); font-size: 14px; transition: color .2s ease, transform .2s ease; }
.footer-nav a:hover { color: #fff; transform: translateX(4px); }
.footer-cta p { margin: 0 0 7px; color: rgba(241, 246, 247, .7); font-size: 14px; }
.footer-whatsapp { display: inline-flex; align-items: center; gap: 10px; padding: 12px 16px; border-radius: 999px; background: var(--coral); color: #fff; font-size: 13px; font-weight: 700; box-shadow: 0 10px 25px rgba(0, 0, 0, .16); transition: transform .2s ease, background-color .2s ease, box-shadow .2s ease; }
.footer-whatsapp:hover { transform: translateY(-2px); background: var(--coral-dark); box-shadow: 0 14px 30px rgba(0, 0, 0, .22); }
.footer-bottom { min-height: 66px; display: flex; align-items: center; justify-content: space-between; gap: 20px; border-top: 1px solid rgba(255,255,255,.13); color: rgba(241, 246, 247, .58); font-size: 12px; }
.footer-bottom p { margin: 0; }
.footer-bottom a { color: rgba(241, 246, 247, .78); font-weight: 700; transition: color .2s ease, transform .2s ease; }
.footer-bottom a:hover { color: #fff; transform: translateY(-2px); }

.form-section { padding-top: 30px; }
.form-layout { display: grid; grid-template-columns: .8fr 1.2fr; gap: 80px; align-items: start; }
.form-layout h2 { font-size: clamp(38px, 4vw, 58px); }
.form-layout > div > p:last-child { color: var(--muted); max-width: 340px; margin-top: 22px; }
.whatsapp-form { display: grid; grid-template-columns: 1fr 1fr; gap: 17px; padding: 30px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 14px 35px rgba(24, 59, 86, .06); }
.whatsapp-form label { display: grid; gap: 7px; color: var(--text); font-size: 13px; font-weight: 700; }
.whatsapp-form label:nth-of-type(3), .whatsapp-form label:nth-of-type(4), .whatsapp-form button, .form-note { grid-column: 1 / -1; }
.whatsapp-form input, .whatsapp-form select, .whatsapp-form textarea { width: 100%; border: 1px solid var(--line); background: var(--bg); color: var(--text); padding: 13px 14px; border-radius: 12px; font: inherit; font-size: 14px; outline: none; }
.whatsapp-form textarea { resize: vertical; min-height: 90px; }
.whatsapp-form input:focus, .whatsapp-form select:focus, .whatsapp-form textarea:focus { border-color: var(--coral); box-shadow: 0 0 0 3px color-mix(in srgb, var(--coral) 22%, transparent); }
.whatsapp-form button { justify-self: start; border: 0; cursor: pointer; }
.form-note { margin: -4px 0 0; color: var(--muted); font-size: 12px; }

@media (max-width: 650px) {
  .hero { padding-top: 52px; }
  .hero-visual { min-height: 290px; margin-top: 28px; }
  .hero-device-stage { min-height: 290px; }
  .device-laptop { width: 96%; left: -3%; top: 8%; }
  .device-tablet { width: 96%; height: auto; left: -3%; top: 6%; }
  .device-phone { width: auto; height: 74%; right: -2%; bottom: 0; }
  .form-layout { grid-template-columns: 1fr; gap: 28px; }
  .whatsapp-form { grid-template-columns: 1fr; padding: 21px; }
  .whatsapp-form label:nth-of-type(3), .whatsapp-form label:nth-of-type(4), .whatsapp-form button, .form-note { grid-column: auto; }
  .floating-whatsapp { right: 14px; bottom: 14px; width: 50px; height: 50px; }
  .site-header.is-scrolled .nav-wrap { min-height: 62px; }
  .footer-main { grid-template-columns: 1fr; gap: 34px; padding-block: 44px 36px; }
  .footer-bottom { align-items: flex-start; flex-direction: column; justify-content: center; gap: 7px; padding-block: 18px; }
}

@media (min-width: 651px) and (max-width: 900px) {
  .footer-main { grid-template-columns: 1.2fr .8fr; gap: 42px; }
  .footer-cta { grid-column: 1 / -1; }
}

@keyframes cta-click {
  0% { transform: scale(1); }
  35% { transform: scale(.92); }
  68% { transform: scale(1.06); }
  100% { transform: scale(1); }
}

@keyframes cta-ring {
  0% { opacity: .55; transform: scale(.82); }
  100% { opacity: 0; transform: scale(1.28); }
}

@keyframes theme-spin {
  0% { transform: rotate(0) scale(1); }
  45% { transform: rotate(150deg) scale(.82); }
  100% { transform: rotate(360deg) scale(1); }
}

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

@keyframes whatsapp-pulse {
  0% { opacity: .55; transform: scale(1); }
  75%, 100% { opacity: 0; transform: scale(1.42); }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* Movimiento sutil para los mockups originales, sin alterar su recorte ni composición. */
.hero-device-stage .device-tablet {
  will-change: transform;
  animation: device-tablet-float 7s ease-in-out infinite;
}
.hero-device-stage .device-phone {
  will-change: transform;
  animation: device-phone-float 6.2s ease-in-out .25s infinite;
}
.contact-source {
  display: block;
  margin-top: 18px;
  color: rgba(255, 255, 255, .72);
  font-size: 11px;
  letter-spacing: .01em;
}

/* CTA de contacto con mayor contraste y una vista previa de WhatsApp. */
.contact-box {
  background: linear-gradient(135deg, #f28c70 0%, #e8755e 58%, #d95d4c 100%);
  align-items: stretch;
  box-shadow: 0 20px 45px rgba(196, 78, 58, .18);
}
.contact-copy { flex: 1 1 0; min-width: 0; }
.contact-demo {
  width: min(100%, 306px);
  flex: 0 0 306px;
  padding: 17px;
  border: 1px solid rgba(255, 255, 255, .32);
  border-radius: 20px;
  background: rgba(24, 59, 86, .9);
  box-shadow: 0 16px 30px rgba(24, 42, 54, .18);
}
.wa-demo-head { display: flex; align-items: center; gap: 9px; color: #fff; }
.wa-demo-icon { display: grid; place-items: center; width: 29px; height: 29px; border-radius: 50%; background: #4e9a70; color: #fff; font-size: 20px; font-weight: 700; }
.wa-demo-head span:nth-child(2) { display: grid; gap: 1px; line-height: 1.1; }
.wa-demo-head b { font-size: 12px; }
.wa-demo-head small { color: rgba(255,255,255,.62); font-size: 9px; }
.wa-demo-head i { width: 7px; height: 7px; margin-left: auto; border-radius: 50%; background: #8bd6a7; box-shadow: 0 0 0 4px rgba(139,214,167,.12); }
.wa-message { max-width: 88%; margin-top: 12px; padding: 9px 11px; border-radius: 12px; font-size: 11px; line-height: 1.35; animation: wa-message-in .7s both; }
.wa-message-in { color: #27465a; background: #f9f5ec; border-top-left-radius: 4px; }
.wa-message-out { margin-left: auto; color: #16422e; background: #ccebd1; border-top-right-radius: 4px; animation-delay: .18s; }
.wa-message-short { animation-delay: .36s; }
.contact-demo .button-light { display: flex; width: 100%; margin-top: 16px; white-space: nowrap; justify-content: center; padding: 12px 13px; color: #183b56; font-size: 13px; }
.wa-demo-note { display: block; margin-top: 9px; color: rgba(255,255,255,.48); text-align: center; font-size: 9px; }

@keyframes wa-message-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 900px) {
  .contact-box { align-items: flex-start; flex-wrap: wrap; }
  .contact-demo { flex: 1 1 280px; width: min(100%, 330px); }
}

@media (max-width: 650px) {
  .contact-box { padding: 30px 22px; }
  .contact-demo { width: 100%; flex-basis: 100%; }
  .contact-demo .button-light { margin-top: 15px; }
}

@keyframes device-tablet-float {
  0%, 100% { transform: translate3d(0, 0, 0) rotate(0deg); }
  50% { transform: translate3d(0, -7px, 0) rotate(-.35deg); }
}

@keyframes device-phone-float {
  0%, 100% { transform: translate3d(0, 0, 0) rotate(0deg); }
  50% { transform: translate3d(0, -10px, 0) rotate(.55deg); }
}

/* Ajuste fino para pantallas pequeñas: el texto respira y los dos mockups caben completos. */
@media (max-width: 650px) {
  .hero h1 {
    font-size: clamp(40px, 11vw, 46px);
    line-height: 1.01;
    letter-spacing: -.06em;
  }
  .hero-lead { max-width: 35ch; margin-top: 22px; font-size: 15px; line-height: 1.55; }
  .hero-actions { gap: 14px; }
  .trust-row { margin-top: 27px; font-size: 11px; }
  .hero-visual { min-height: 270px; margin-top: 24px; }
  .hero-device-stage { min-height: 270px; }
  .device-tablet { width: 97%; left: -2%; top: 5%; }
  .device-phone { height: 75%; right: -1%; }
}

@media (max-width: 380px) {
  .hero { padding-top: 40px; }
  .hero h1 { font-size: 39px; }
  .hero-lead { font-size: 14px; margin-bottom: 24px; }
  .hero-visual, .hero-device-stage { min-height: 250px; }
  .device-tablet { width: 99%; left: -3%; }
  .device-phone { height: 73%; right: -1%; }
}
