/* =============================================================
   1. Tokens
   ============================================================= */
:root {
  --bg: #ffffff;
  --bg-soft: #f5f8fb;
  --bg-deep: #eef2f7;
  --ink: #10202f;
  --ink-soft: #3d4f5f;
  --ink-mute: #6b7a87;
  --line: rgba(16, 32, 47, 0.1);
  --line-soft: rgba(16, 32, 47, 0.06);

  --blue: #0b5ea8;
  --blue-dark: #073f74;
  --blue-soft: #e8f1fa;
  --yellow: #f0ad0e;
  --yellow-dark: #a97600;
  --yellow-soft: #fdf3dd;
  --red: #d5302c;
  --red-dark: #a3211e;
  --red-soft: #fbe7e6;

  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  --display: "Space Grotesk", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;

  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-soft: cubic-bezier(0.25, 0.46, 0.45, 0.94);
  --ease-bounce: cubic-bezier(0.34, 1.56, 0.64, 1);

  --radius: 16px;
  --radius-sm: 10px;
  --shadow-sm: 0 1px 3px rgba(16, 32, 47, 0.08), 0 1px 2px rgba(16, 32, 47, 0.06);
  --shadow-md: 0 12px 30px -8px rgba(16, 32, 47, 0.18);
  --shadow-lg: 0 30px 60px -20px rgba(16, 32, 47, 0.28);
  --container: 1180px;
}

/* =============================================================
   2. Reset & base
   ============================================================= */
*, *::before, *::after { box-sizing: border-box; margin: 0; }
html { -webkit-text-size-adjust: 100%; tab-size: 2; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  color: var(--ink-soft);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
  overscroll-behavior-y: none;
}

img, svg, video { display: block; max-width: 100%; }
img { height: auto; }
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; }
a { color: inherit; text-decoration: none; }
p { text-wrap: pretty; }
ul { list-style: none; padding: 0; }
h1, h2, h3, h4 {
  font-family: var(--display);
  color: var(--ink);
  text-wrap: balance;
  line-height: 1.08;
  letter-spacing: -0.01em;
  font-weight: 600;
}
h2 { font-size: clamp(1.7rem, 3.4vw, 2.5rem); }
h3 { font-size: 1.2rem; }
::selection { background: var(--blue); color: #fff; }

:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 3px;
  border-radius: 4px;
}

/* =============================================================
   3. Utilities
   ============================================================= */
.container { max-width: var(--container); margin-inline: auto; padding-inline: 1.25rem; }
@media (min-width: 720px) { .container { padding-inline: 2rem; } }

.skip-link {
  position: fixed; top: -100px; left: 1rem;
  padding: 0.6rem 1rem; background: var(--ink); color: #fff;
  z-index: 9999; border-radius: 8px; font-weight: 500;
  transition: top 0.3s var(--ease-out);
}
.skip-link:focus { top: 1rem; }

.kicker {
  display: inline-flex; align-items: center; gap: 0.5rem;
  font-family: var(--display);
  font-size: 0.78rem; font-weight: 600;
  letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--blue);
  margin-bottom: 0.9rem;
}
.kicker::before {
  content: ""; width: 18px; height: 2px; background: var(--red); border-radius: 2px;
}

.section-head { max-width: 640px; margin-bottom: 3rem; }
.section-sub { color: var(--ink-mute); font-size: 1.02rem; max-width: 56ch; }

/* =============================================================
   4. Reveal on scroll (universal, defensive)
   ============================================================= */
[data-reveal] {
  opacity: 0; transform: translateY(28px);
  transition: opacity 0.8s var(--ease-soft), transform 0.8s var(--ease-soft);
}
[data-reveal].is-revealed { opacity: 1; transform: none; }

/* =============================================================
   5. Buttons
   ============================================================= */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.55rem;
  padding: 0.85rem 1.5rem;
  font-family: var(--display);
  font-weight: 600; font-size: 0.96rem;
  border-radius: 100px;
  box-shadow: var(--shadow-sm);
  transition: transform 0.45s var(--ease-soft), box-shadow 0.45s var(--ease-soft), background-color 0.3s, color 0.3s;
  white-space: nowrap;
}
.btn:hover { transform: translateY(-3px); }
.btn:active { transform: translateY(-1px); transition-duration: 0.12s; }

.btn-primary { background: var(--blue); color: #fff; }
.btn-primary:hover { box-shadow: 0 20px 40px -12px rgba(11, 94, 168, 0.45); background: var(--blue-dark); }

.btn-outline { background: #fff; color: var(--ink); border: 1.5px solid var(--line); }
.btn-outline:hover { border-color: var(--blue); color: var(--blue); box-shadow: 0 20px 40px -16px rgba(16, 32, 47, 0.2); }

.btn-whatsapp { background: var(--blue); color: #fff; }
.btn-whatsapp .icon { width: 18px; height: 18px; }
.btn-whatsapp:hover { background: var(--blue-dark); box-shadow: 0 20px 40px -12px rgba(11, 94, 168, 0.45); }

.btn-block { width: 100%; }

.icon { width: 20px; height: 20px; flex-shrink: 0; }

/* magnetic wrapper (JS injects .magnetic-inner) */
.has-magnetic { display: inline-flex; position: relative; isolation: isolate; }
.magnetic-inner { display: inline-flex; align-items: center; justify-content: center; gap: inherit; will-change: transform; transition: transform 0.8s var(--ease-soft); }

/* =============================================================
   6. Nav
   ============================================================= */
.nav {
  position: fixed; top: 0; inset-inline: 0; z-index: 100;
  padding-block: 1.1rem;
  transition: background-color 0.4s var(--ease-out), box-shadow 0.4s var(--ease-out), padding 0.4s var(--ease-out);
}
.nav.is-scrolled {
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 1px 0 rgba(16, 32, 47, 0.08), 0 12px 24px -18px rgba(16, 32, 47, 0.25);
  padding-block: 0.75rem;
}
.nav-inner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }

.brand { display: flex; align-items: center; gap: 0.65rem; }
.brand-mark { width: 40px; height: 40px; flex-shrink: 0; }
.brand-word { display: flex; flex-direction: column; line-height: 1.15; }
.brand-word strong { font-family: var(--display); font-weight: 700; font-size: 1.05rem; color: var(--ink); letter-spacing: -0.01em; }
.brand-word em { font-style: normal; font-size: 0.65rem; color: var(--ink-mute); letter-spacing: 0.04em; }

.nav-links { display: none; align-items: center; gap: 2rem; }
@media (min-width: 960px) { .nav-links { display: flex; } }
.nav-link {
  position: relative; padding: 0.25rem 0;
  font-weight: 500; font-size: 0.95rem; color: var(--ink-soft);
}
.nav-link::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -3px;
  height: 2px; background: var(--red);
  transform: scaleX(0); transform-origin: right;
  transition: transform 0.4s var(--ease-out);
}
.nav-link:hover { color: var(--ink); }
.nav-link:hover::after { transform: scaleX(1); transform-origin: left; }

.nav-actions { display: flex; align-items: center; gap: 0.75rem; }
.nav-actions .btn-whatsapp { display: none; padding: 0.65rem 1.15rem; font-size: 0.88rem; }
@media (min-width: 640px) { .nav-actions .btn-whatsapp { display: inline-flex; } }

.hamburger {
  display: flex; flex-direction: column; justify-content: center; gap: 5px;
  width: 42px; height: 42px; border-radius: 10px;
  background: var(--bg-soft);
}
@media (min-width: 960px) { .hamburger { display: none; } }
.hamburger span { display: block; width: 18px; height: 2px; background: var(--ink); margin-inline: auto; transition: transform 0.35s var(--ease-out), opacity 0.35s var(--ease-out); }
.hamburger[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.hamburger[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.mobile-menu {
  position: fixed; inset: 0; top: 0; z-index: 90;
  background: #fff;
  padding: 6.5rem 1.5rem 2rem;
  clip-path: inset(0 0 100% 0);
  transition: clip-path 0.6s var(--ease-soft);
}
.mobile-menu[data-open="true"] { clip-path: inset(0 0 0 0); }
.mobile-menu nav { display: flex; flex-direction: column; gap: 0.4rem; }
.mobile-link { padding: 0.9rem 0.25rem; font-family: var(--display); font-weight: 600; font-size: 1.3rem; border-bottom: 1px solid var(--line-soft); color: var(--ink); }
.mobile-menu .btn { margin-top: 1.5rem; }

/* =============================================================
   7. Hero
   ============================================================= */
.hero {
  position: relative;
  padding-block: clamp(6.5rem, 14vw, 9.5rem) 4rem;
  overflow: clip;
}
.hero-texture {
  position: absolute; inset: 0; z-index: -1;
  background-image:
    radial-gradient(circle at 8% 10%, rgba(11, 94, 168, 0.07), transparent 45%),
    radial-gradient(circle at 96% 4%, rgba(240, 173, 14, 0.1), transparent 40%),
    radial-gradient(circle at 100% 90%, rgba(213, 48, 44, 0.06), transparent 40%);
}
.hero-grid { display: grid; gap: 2.5rem; align-items: center; }
@media (min-width: 960px) { .hero-grid { grid-template-columns: 1.05fr 0.95fr; gap: 3.5rem; } }

.hero-title { font-size: clamp(2.1rem, 4.6vw, 3.4rem); max-width: 16ch; margin-bottom: 1.15rem; }
.hero-sub { font-size: 1.08rem; max-width: 46ch; margin-bottom: 2rem; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 0.9rem; margin-bottom: 1.4rem; }
.hero-trust { font-size: 0.85rem; color: var(--ink-mute); letter-spacing: 0.02em; }

.hero-media { position: relative; }
.hero-frame {
  position: relative; border-radius: var(--radius); overflow: hidden;
  box-shadow: var(--shadow-lg);
  aspect-ratio: 4 / 5;
}
@media (min-width: 640px) { .hero-frame { aspect-ratio: 5 / 4; } }
.hero-frame img { width: 100%; height: 100%; object-fit: cover; }
.hero-frame-glow {
  position: absolute; inset: 0;
  background: linear-gradient(190deg, rgba(11,94,168,0) 40%, rgba(7,20,31,0.55) 100%);
}
.hero-dots { position: absolute; display: flex; gap: 8px; bottom: -16px; left: 22px; }
.dot { width: 14px; height: 14px; border-radius: 50%; box-shadow: var(--shadow-sm); }
.dot-blue { background: var(--blue); }
.dot-yellow { background: var(--yellow); }
.dot-red { background: var(--red); }

/* =============================================================
   8. Stats bar
   ============================================================= */
.stats { padding-block: 2.6rem; background: var(--ink); }
.stats-grid {
  display: grid; gap: 1.6rem;
  grid-template-columns: repeat(2, 1fr);
}
@media (min-width: 720px) { .stats-grid { grid-template-columns: repeat(4, 1fr); } }
.stat-item { display: flex; align-items: center; gap: 0.7rem; color: #eef2f7; font-size: 0.92rem; font-weight: 500; }
.stat-item .icon { color: var(--yellow); width: 26px; height: 26px; flex-shrink: 0; }
.stat-item:nth-child(3) .icon { color: var(--red); }
.stat-item:nth-child(2) .icon { color: #fff; }

/* =============================================================
   9. Services
   ============================================================= */
.services { padding-block: clamp(4.5rem, 9vw, 7rem); }
.card-grid { display: grid; gap: 1.5rem; grid-template-columns: 1fr; }
@media (min-width: 640px) { .card-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1280px) { .card-grid { grid-template-columns: repeat(4, 1fr); } }

.card {
  --rx: 0deg; --ry: 0deg;
  background: #fff; border: 1px solid var(--line-soft); border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transform: perspective(900px) rotateX(var(--rx)) rotateY(var(--ry));
  transform-style: preserve-3d;
  transition: transform 0.55s var(--ease-soft), box-shadow 0.45s var(--ease-soft);
}
.card:hover { transition-duration: 0.15s; box-shadow: var(--shadow-md); }
.card-media { aspect-ratio: 16 / 10; overflow: hidden; }
.card-media img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.8s var(--ease-soft); }
.card:hover .card-media img { transform: scale(1.08); }
.card-body { padding: 1.5rem 1.4rem 1.7rem; transform: translateZ(30px); }
.card-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 44px; height: 44px; border-radius: 12px;
  margin-bottom: 1rem;
}
.card-icon svg { width: 22px; height: 22px; }
.icon-blue { background: var(--blue-soft); color: var(--blue); }
.icon-yellow { background: var(--yellow-soft); color: var(--yellow-dark); }
.icon-red { background: var(--red-soft); color: var(--red); }
.card h3 { margin-bottom: 0.5rem; font-size: 1.1rem; }
.card p { color: var(--ink-mute); font-size: 0.94rem; }

/* =============================================================
   10. About / Nosotros
   ============================================================= */
.about { padding-block: clamp(4.5rem, 9vw, 7rem); background: var(--bg-soft); }
.about-grid { display: grid; gap: 3rem; align-items: center; }
@media (min-width: 960px) { .about-grid { grid-template-columns: 0.85fr 1.15fr; gap: 4rem; } }
.about-media { border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-md); aspect-ratio: 4/5; }
@media (min-width: 960px) { .about-media { aspect-ratio: 3/4; } }
.about-media img { width: 100%; height: 100%; object-fit: cover; }

.pillars { display: grid; gap: 1.4rem; margin-top: 2rem; }
@media (min-width: 640px) { .pillars { grid-template-columns: repeat(2, 1fr); } }
.pillars li { padding-left: 1.1rem; border-left: 3px solid var(--yellow); }
.pillars li:nth-child(2) { border-color: var(--blue); }
.pillars li:nth-child(3) { border-color: var(--red); }
.pillars li:nth-child(4) { border-color: var(--yellow); }
.pillars strong { display: block; font-family: var(--display); color: var(--ink); margin-bottom: 0.3rem; font-size: 1.02rem; }
.pillars span { color: var(--ink-mute); font-size: 0.92rem; }

/* =============================================================
   12. Contact
   ============================================================= */
.contact { padding-block: clamp(4.5rem, 9vw, 7rem); }
.contact-grid { display: grid; gap: 2.5rem; }
@media (min-width: 960px) { .contact-grid { grid-template-columns: 1.1fr 0.9fr; gap: 3.5rem; } }

.contact-form {
  position: relative;
  background: #fff; border: 1px solid var(--line-soft); border-radius: var(--radius);
  padding: clamp(1.5rem, 4vw, 2.5rem);
  box-shadow: var(--shadow-sm);
  display: flex; flex-direction: column; gap: 1.1rem;
  transition: opacity 0.55s var(--ease-out), transform 0.55s var(--ease-soft);
}
.contact-form.is-sent { opacity: 0; transform: translateY(-12px); pointer-events: none; position: absolute; inset: 0; }

.field { position: relative; }
.field-row { display: grid; gap: 1.1rem; }
@media (min-width: 560px) { .field-row { grid-template-columns: 1fr 1fr; } }

.field input, .field select, .field textarea {
  width: 100%; padding: 1.35rem 1rem 0.55rem; border: 1.5px solid var(--line);
  border-radius: var(--radius-sm); background: var(--bg-soft); color: var(--ink);
  font-family: var(--sans); font-size: 0.98rem;
  transition: border-color 0.3s;
  resize: vertical;
}
.field select { appearance: none; background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path fill='%236b7a87' d='M6 9l6 6 6-6'/></svg>"); background-repeat: no-repeat; background-position: right 1rem center; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--blue); outline: none; }
.field label {
  position: absolute; left: 1rem; top: 1rem;
  pointer-events: none; transition: all 0.2s var(--ease-out);
  color: var(--ink-mute); font-size: 0.98rem;
}
.field input:focus + label, .field input:not(:placeholder-shown) + label,
.field textarea:focus + label, .field textarea:not(:placeholder-shown) + label,
.field select:focus + label, .field select:valid + label {
  top: 0.45rem; font-size: 0.68rem; letter-spacing: 0.06em; text-transform: uppercase; font-weight: 600; color: var(--blue);
}

.cta-submit { position: relative; margin-top: 0.4rem; }
.cta-form-spinner {
  position: absolute; inset: 0; display: none; place-items: center;
}
.cta-submit.is-sending .cta-form-label { opacity: 0; }
.cta-submit.is-sending .cta-form-spinner { display: grid; }
.cta-form-spinner::after {
  content: ""; width: 18px; height: 18px;
  border: 2px solid rgba(255, 255, 255, 0.4); border-top-color: #fff;
  border-radius: 50%; animation: spin 0.9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.form-note { font-size: 0.8rem; color: var(--ink-mute); }

.cta-success {
  position: absolute; inset: 0; z-index: 2;
  background: #fff; border-radius: var(--radius);
  display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 0.6rem;
  padding: 2rem;
  opacity: 0; pointer-events: none;
  transition: opacity 0.6s var(--ease-out);
}
.cta-success.is-visible { opacity: 1; pointer-events: auto; }
.icon-check { width: 46px; height: 46px; color: var(--blue); }
.cta-success p { color: var(--ink-mute); max-width: 34ch; }

.contact-info { display: flex; flex-direction: column; gap: 1.5rem; }
.info-card {
  background: var(--bg-soft); border-radius: var(--radius);
  padding: clamp(1.5rem, 4vw, 2rem);
  display: flex; flex-direction: column; gap: 1.4rem;
}
.info-list { display: flex; flex-direction: column; gap: 0.95rem; }
.info-list li { display: flex; align-items: center; gap: 0.8rem; font-size: 0.98rem; color: var(--ink-soft); }
.info-icon { display: flex; align-items: center; justify-content: center; width: 38px; height: 38px; border-radius: 10px; background: #fff; color: var(--blue); flex-shrink: 0; box-shadow: var(--shadow-sm); }
.info-icon svg { width: 19px; height: 19px; }
.info-list li:hover a { color: var(--blue); }

.map-frame { border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-sm); aspect-ratio: 16/11; }
.map-frame iframe { width: 100%; height: 100%; border: 0; }

/* =============================================================
   13. Footer
   ============================================================= */
.site-footer { background: var(--ink); color: rgba(238, 242, 247, 0.75); padding-block: 3.5rem 1.75rem; }
.footer-grid { display: grid; gap: 2.5rem; margin-bottom: 2.5rem; }
@media (min-width: 720px) { .footer-grid { grid-template-columns: 1.4fr 1fr 1fr 1fr; } }
.footer-brand p { margin-top: 1rem; font-size: 0.9rem; max-width: 32ch; }
.footer-brand .brand-word strong { color: #fff; }
.footer-brand .brand-word em { color: rgba(238, 242, 247, 0.5); }
.footer-col { display: flex; flex-direction: column; gap: 0.75rem; font-size: 0.92rem; }
.footer-col h4 { color: #fff; font-size: 0.82rem; letter-spacing: 0.06em; text-transform: uppercase; margin-bottom: 0.3rem; }
.footer-col a:hover { color: var(--yellow); }
.social-row { display: flex; gap: 0.75rem; }
.social-row a {
  display: flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  transition: background 0.3s, color 0.3s;
}
.social-row a svg { width: 19px; height: 19px; }
.social-row a:hover { background: var(--blue); color: #fff; }
.footer-bottom {
  border-top: 1px solid rgba(238, 242, 247, 0.12);
  padding-top: 1.75rem;
  display: flex; flex-wrap: wrap; gap: 0.75rem 1.5rem; justify-content: space-between;
  font-size: 0.82rem;
}
.footer-bottom a:hover { color: var(--yellow); }

/* =============================================================
   14. WhatsApp floating button
   ============================================================= */
.whatsapp-float {
  position: fixed; right: 1.4rem; bottom: 1.4rem; z-index: 150;
  width: 58px; height: 58px; border-radius: 50%;
  background: var(--blue); color: #fff;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 14px 34px -8px rgba(11, 94, 168, 0.55);
  transition: transform 0.4s var(--ease-bounce);
}
.whatsapp-float svg { width: 28px; height: 28px; }
.whatsapp-float:hover { transform: scale(1.08); }
.whatsapp-float-ring {
  position: absolute; inset: -6px; border-radius: 50%;
  border: 2px solid var(--blue);
  animation: wa-pulse 2.4s ease-out infinite;
}
@keyframes wa-pulse {
  0% { transform: scale(0.85); opacity: 0.6; }
  100% { transform: scale(1.35); opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .whatsapp-float-ring { animation: none; }
}

/* =============================================================
   15. Credits page
   ============================================================= */
.credits-main { padding-block: clamp(6.5rem, 12vw, 8rem) 5rem; }
.back-link { display: inline-block; margin-bottom: 1.5rem; color: var(--blue); font-weight: 500; }
.credits-main h1 { font-size: clamp(1.8rem, 4vw, 2.4rem); margin-bottom: 0.8rem; }
.credits-list { margin-top: 2rem; display: flex; flex-direction: column; gap: 0.9rem; }
.credits-list li { padding: 1rem 1.2rem; background: var(--bg-soft); border-radius: var(--radius-sm); font-size: 0.92rem; color: var(--ink-mute); }
.credits-list a { color: var(--blue); }

/* =============================================================
   16. Reduced-motion — only genuinely intrusive effects
   ============================================================= */
@media (prefers-reduced-motion: reduce) {
  [data-reveal] { transition-duration: 0.25s; }
}
