/* =============================================================
   1. Tokens
   ============================================================= */
:root {
  --navy:        #0F172A;
  --navy-2:      #1E293B;
  --navy-3:      #263449;
  --copper:      #B45309;
  --copper-2:    #92400E;
  --copper-soft: #D97706;
  --white:       #FFFFFF;
  --pearl:       #F8FAFC;
  --pearl-2:     #EEF2F7;
  --ink:         #334155;
  --ink-soft:    #64748B;
  --line:        rgba(15, 23, 42, 0.10);
  --line-on-dark: rgba(248, 250, 252, 0.14);
  --cream-on-dark: #E2E8F0;

  --display: "Manrope", "Inter", sans-serif;
  --sans: "Inter", "Manrope", 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);

  --container: 1240px;
  --radius: 14px;
  --radius-sm: 8px;
}

/* =============================================================
   2. Reset & base
   ============================================================= */
*, *::before, *::after { box-sizing: border-box; margin: 0; }
html {
  -webkit-text-size-adjust: 100%;
  tab-size: 2;
  scroll-behavior: smooth;
  scroll-padding-top: 104px;
}
body {
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--white);
  -webkit-font-smoothing: antialiased;
  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; }
h1, h2, h3, h4 {
  font-family: var(--display);
  color: var(--navy);
  text-wrap: balance;
  line-height: 1.08;
  letter-spacing: -0.02em;
  font-weight: 700;
}
ul { list-style: none; padding: 0; }
::selection { background: var(--copper); color: var(--white); }

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

.skip-link {
  position: fixed; top: -100px; left: 1rem;
  padding: .7rem 1.1rem; background: var(--navy); color: var(--white);
  z-index: 9999; border-radius: 8px; font-weight: 600;
}
.skip-link:focus { top: 1rem; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

/* =============================================================
   3. Utilities
   ============================================================= */
.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: 1.25rem;
}

.kicker {
  font-family: var(--sans);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--copper);
  margin-bottom: 0.9rem;
}
.kicker-on-dark { color: var(--copper-soft); }

.section-title {
  font-size: clamp(1.8rem, 3.6vw, 2.6rem);
  max-width: 22ch;
  margin-bottom: 1rem;
}
.section-title-on-dark { color: var(--white); }

/* Reveal-on-scroll (functional micro-animation — never gated by reduced-motion).
   Scoped under html.js so content stays fully visible if JS never runs. */
.js .reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s var(--ease-out), transform 0.7s var(--ease-out);
}
.js .reveal.is-visible {
  opacity: 1;
  transform: none;
}

/* =============================================================
   4. Buttons
   ============================================================= */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.85rem 1.6rem;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.95rem;
  transition: transform 0.35s var(--ease-out), box-shadow 0.35s var(--ease-out), background 0.25s var(--ease-out);
  text-align: center;
}
.btn-primary {
  background: var(--copper);
  color: var(--white);
  box-shadow: 0 8px 20px -8px rgba(180, 83, 9, 0.55);
}
.btn-primary:hover {
  background: var(--copper-soft);
  transform: translateY(-2px);
  box-shadow: 0 14px 28px -10px rgba(180, 83, 9, 0.6);
}
.btn-primary:active { transform: translateY(0); }
.btn-lg { padding: 1.05rem 2.1rem; font-size: 1rem; }

/* =============================================================
   5. Header
   ============================================================= */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(14px) saturate(160%);
  -webkit-backdrop-filter: blur(14px) saturate(160%);
  border-bottom: 1px solid var(--line);
}
@supports not (backdrop-filter: blur(1px)) {
  .site-header { background: rgba(255, 255, 255, 0.98); }
}
.site-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  height: 88px;
}
.brand { display: flex; align-items: center; }
.brand-logo { height: 48px; width: auto; }
@media (min-width: 720px) {
  .brand-logo { height: 56px; }
}

.nav-desktop { display: none; }
.nav-list {
  display: flex;
  align-items: center;
  gap: 2rem;
}
.nav-list a {
  font-size: 0.94rem;
  font-weight: 500;
  color: var(--ink);
  position: relative;
  padding-block: 0.3rem;
}
.nav-list a::after {
  content: "";
  position: absolute;
  left: 0; right: 100%;
  bottom: -2px;
  height: 2px;
  background: var(--copper);
  transition: right 0.35s var(--ease-out);
}
.nav-list a:hover { color: var(--navy); }
.nav-list a:hover::after { right: 0; }

.btn-header-cta { display: none; }

.nav-mobile { position: relative; }
.nav-mobile-toggle {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 5px;
  width: 40px; height: 40px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 10px;
  cursor: pointer;
}
.nav-mobile-toggle::-webkit-details-marker { display: none; }
.nav-mobile-toggle span {
  width: 18px; height: 2px;
  background: var(--navy);
  border-radius: 2px;
}
.nav-mobile-panel {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: min(280px, 80vw);
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.25rem;
  box-shadow: 0 20px 40px -16px rgba(15, 23, 42, 0.25);
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}
.nav-mobile-panel .nav-list { flex-direction: column; align-items: flex-start; gap: 0.9rem; }
.nav-mobile-panel .btn { width: 100%; }

@media (min-width: 960px) {
  .nav-desktop { display: block; }
  .btn-header-cta { display: inline-flex; }
  .nav-mobile { display: none; }
}

/* =============================================================
   6. Sections — shared
   ============================================================= */
section { padding-block: clamp(4rem, 8vw, 7rem); }

/* ---------- Hero ---------- */
.hero { background: var(--white); padding-top: clamp(3.5rem, 8vw, 6rem); }
.hero-brandmark-wrap {
  text-align: center;
  margin-bottom: clamp(2.2rem, 5vw, 3.5rem);
}
.hero-brandmark {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 0.9rem;
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(2.4rem, 7vw, 4.2rem);
  letter-spacing: -0.01em;
  line-height: 1;
  color: var(--navy);
}
.hero-brandmark::after {
  content: "";
  width: 64px;
  height: 4px;
  border-radius: 999px;
  background: var(--copper);
}
.hero-brandmark-tagline {
  margin-top: 0.9rem;
  font-size: clamp(0.95rem, 1.6vw, 1.1rem);
  font-weight: 600;
  letter-spacing: 0.01em;
  color: var(--ink-soft);
}
.hero-grid {
  display: grid;
  gap: 3rem;
  align-items: center;
}
.hero-grid > * { min-width: 0; }
.hero-title {
  font-size: clamp(2.4rem, 5.6vw, 3.8rem);
  max-width: 16ch;
  margin-bottom: 1.4rem;
}
.hero-title em {
  font-style: normal;
  color: var(--copper);
}
.hero-sub {
  font-size: 1.1rem;
  color: var(--ink-soft);
  max-width: 46ch;
  margin-bottom: 2rem;
}
.hero-actions { margin-bottom: 2.2rem; }
.hero-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 1.4rem 2rem;
}
.hero-stats li {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--navy);
}
.hero-stat-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--copper);
  flex-shrink: 0;
}

.hero-visual { display: flex; justify-content: center; }
.hero-panel {
  position: relative;
  width: 100%;
  max-width: 520px;
  aspect-ratio: 5 / 4.3;
  border-radius: 24px;
  background: var(--navy);
  overflow: hidden;
  box-shadow: 0 40px 80px -30px rgba(15, 23, 42, 0.45);
}
.hero-panel img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 22% 38%;
}
.hero-panel::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 45%, rgba(15, 23, 42, 0.82) 100%);
  pointer-events: none;
}
.hero-panel-card {
  position: absolute;
  left: 6%; right: 6%; bottom: 6%;
  border-radius: 18px;
  background: rgba(248, 250, 252, 0.08);
  border: 1px solid rgba(248, 250, 252, 0.16);
  backdrop-filter: blur(6px);
  padding: 1.1rem 1.4rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  color: var(--white);
}
.hero-panel-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.hero-panel-label { font-size: 0.8rem; color: var(--cream-on-dark); }
.hero-panel-badge {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.3rem 0.7rem;
  border-radius: 999px;
  background: rgba(52, 211, 153, 0.18);
  color: #6ee7b7;
}
.hero-panel-value {
  font-family: var(--display);
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--white);
}

@media (min-width: 960px) {
  .hero-grid { grid-template-columns: 1.1fr 0.9fr; }
}

/* ---------- Propósito ---------- */
.purpose { background: var(--pearl); }
.purpose-grid {
  display: grid;
  gap: 1.5rem;
  margin-top: 2.5rem;
}
.purpose-card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 2.2rem;
  transition: transform 0.4s var(--ease-out), box-shadow 0.4s var(--ease-out);
}
.purpose-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 24px 48px -24px rgba(15, 23, 42, 0.22);
}
.purpose-icon {
  display: inline-flex;
  width: 52px; height: 52px;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
  background: rgba(180, 83, 9, 0.1);
  color: var(--copper);
  margin-bottom: 1.4rem;
}
.purpose-icon svg { width: 26px; height: 26px; }
.purpose-card h3 {
  font-size: 1.25rem;
  margin-bottom: 0.7rem;
}
.purpose-card p { color: var(--ink); }

@media (min-width: 720px) {
  .purpose-grid { grid-template-columns: 1fr 1fr; }
}

/* ---------- Tecnología ---------- */
.tech { background: var(--navy); }
.tech-disclaimer {
  max-width: 62ch;
  margin: 1.4rem 0 3rem;
  padding: 1rem 1.3rem;
  border-radius: var(--radius-sm);
  background: rgba(217, 119, 6, 0.12);
  border: 1px solid rgba(217, 119, 6, 0.3);
  color: var(--cream-on-dark);
  font-size: 0.92rem;
}
.tech-disclaimer strong { color: var(--copper-soft); }

.tech-grid {
  display: grid;
  gap: 1.5rem;
}
.tech-card {
  background: var(--navy-2);
  border: 1px solid var(--line-on-dark);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform 0.4s var(--ease-out), box-shadow 0.4s var(--ease-out), border-color 0.4s var(--ease-out);
}
.tech-card:hover {
  transform: translateY(-6px);
  border-color: rgba(217, 119, 6, 0.5);
  box-shadow: 0 24px 48px -20px rgba(0, 0, 0, 0.55);
}
.tech-card-media {
  aspect-ratio: 4 / 5;
  overflow: hidden;
  background: var(--navy-3);
}
.tech-card-media img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform 0.6s var(--ease-out);
}
.tech-card:hover .tech-card-media img { transform: scale(1.06); }
.tech-card-body { padding: 1.3rem 1.4rem 1.6rem; }
.tech-card-body h3 {
  color: var(--white);
  font-size: 1.05rem;
  margin-bottom: 0.35rem;
}
.tech-card-body p {
  color: var(--cream-on-dark);
  font-size: 0.9rem;
}

@media (min-width: 720px) {
  .tech-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 1280px) {
  .tech-grid { grid-template-columns: repeat(4, 1fr); }
}

/* ---------- Entornos ---------- */
.environments { background: var(--white); }

.env-tablist {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin: 2rem 0 2.4rem;
}
.env-tab {
  padding: 0.6rem 1.2rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--ink);
  transition: background 0.3s var(--ease-out), color 0.3s var(--ease-out), border-color 0.3s var(--ease-out);
}
.env-tab:hover { border-color: var(--copper); color: var(--navy); }
.env-tab.is-active {
  background: var(--navy);
  border-color: var(--navy);
  color: var(--white);
}

/* Default (no-JS) fallback: full gallery grid, everything visible */
.env-panels {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1.2rem;
}
.env-panel {
  border-radius: var(--radius);
  overflow: hidden;
  position: relative;
  background: var(--pearl-2);
  border: 1px solid var(--line);
}
.env-panel img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  transition: transform 0.6s var(--ease-out);
}
.env-panel:hover img { transform: scale(1.05); }
.env-panel figcaption {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  padding: 0.9rem 1.1rem;
  font-family: var(--display);
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--white);
  background: linear-gradient(180deg, transparent, rgba(15, 23, 42, 0.75));
}

/* Enhanced (JS): single-panel tab view */
.env-tabs.is-tabs .env-panels { grid-template-columns: 1fr; }
.env-tabs.is-tabs .env-panel {
  display: none;
  max-width: 780px;
  margin-inline: auto;
}
.env-tabs.is-tabs .env-panel.is-active {
  display: block;
  animation: envPanelIn 0.5s var(--ease-out);
}
.env-tabs.is-tabs .env-panel img { aspect-ratio: 1 / 1; }
@keyframes envPanelIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}

/* ---------- Lead magnet ---------- */
.lead-magnet { background: var(--pearl); }
.lead-magnet-grid {
  display: grid;
  gap: 2.5rem;
}
.lead-magnet-grid > * { min-width: 0; }
.lead-form-row { min-width: 0; }
.lead-form-row input { width: 100%; min-width: 0; }
.lead-magnet-text {
  color: var(--ink);
  max-width: 48ch;
  font-size: 1.02rem;
}

.lead-form {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 2rem;
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
  box-shadow: 0 30px 60px -32px rgba(15, 23, 42, 0.25);
}
.lead-form-row {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}
.lead-form-row label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--navy);
}
.lead-form-row input {
  font: inherit;
  padding: 0.75rem 0.9rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: var(--pearl);
  color: var(--ink);
  transition: border-color 0.25s var(--ease-out), background 0.25s var(--ease-out);
}
.lead-form-row input:focus {
  border-color: var(--copper);
  background: var(--white);
  outline: none;
}
.lead-form-row input[type="file"] { padding: 0.55rem 0.6rem; }

.lead-form-submit { margin-top: 0.4rem; width: 100%; }
.lead-form-success {
  font-size: 0.9rem;
  font-weight: 600;
  color: #15803d;
  background: rgba(21, 128, 61, 0.1);
  border: 1px solid rgba(21, 128, 61, 0.25);
  padding: 0.8rem 1rem;
  border-radius: var(--radius-sm);
}
.lead-form-error {
  font-size: 0.9rem;
  font-weight: 600;
  color: #b91c1c;
  background: rgba(185, 28, 28, 0.08);
  border: 1px solid rgba(185, 28, 28, 0.25);
  padding: 0.8rem 1rem;
  border-radius: var(--radius-sm);
}
.lead-form-error a { text-decoration: underline; }

@media (min-width: 960px) {
  .lead-magnet-grid { grid-template-columns: 1fr 1fr; align-items: start; }
}

/* =============================================================
   7. Footer
   ============================================================= */
.site-footer { background: var(--navy); color: var(--cream-on-dark); }
.footer-grid {
  display: grid;
  gap: 2.4rem;
  padding-block: clamp(3rem, 6vw, 4.5rem) 2.5rem;
}
.footer-logo { height: 44px; width: auto; filter: brightness(0) invert(1); margin-bottom: 1.1rem; }
.footer-brand p { max-width: 32ch; color: rgba(226, 232, 240, 0.75); font-size: 0.92rem; }

.footer-links h3, .footer-contact h3 {
  color: var(--white);
  font-size: 0.85rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 1.1rem;
}
.footer-links ul, .footer-contact ul { display: flex; flex-direction: column; gap: 0.7rem; }
.footer-links a, .footer-contact a {
  font-size: 0.92rem;
  color: rgba(226, 232, 240, 0.8);
  transition: color 0.25s var(--ease-out);
}
.footer-links a:hover, .footer-contact a:hover { color: var(--copper-soft); }

.footer-bottom {
  border-top: 1px solid var(--line-on-dark);
  padding-block: 1.4rem;
}
.footer-bottom p { font-size: 0.82rem; color: rgba(226, 232, 240, 0.6); }

@media (min-width: 720px) {
  .footer-grid { grid-template-columns: 1.4fr 1fr 1fr; }
}

/* ---------- WhatsApp floating button ---------- */
.whatsapp-float {
  position: fixed;
  bottom: 30px;
  right: 30px;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 60px;
  height: 60px;
  border-radius: 50px;
  background: #25d366;
  color: #fff;
  box-shadow: 0 8px 24px -6px rgba(0, 0, 0, 0.4);
  transition: transform 0.3s var(--ease-out), box-shadow 0.3s var(--ease-out);
}
.whatsapp-float svg { width: 30px; height: 30px; }
.whatsapp-float:hover {
  transform: scale(1.1);
  box-shadow: 0 10px 28px -6px rgba(0, 0, 0, 0.48);
}

@media (max-width: 768px) {
  .whatsapp-float {
    bottom: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
  }
  .whatsapp-float svg { width: 26px; height: 26px; }
}

/* =============================================================
   8. Responsive tweaks
   ============================================================= */
@media (min-width: 540px) {
  .container { padding-inline: 2rem; }
}

/* =============================================================
   9. Reduced-motion (only INTRUSIVE effects)
   ============================================================= */
@media (prefers-reduced-motion: reduce) {
  .hero-panel-glow { animation: none; }
}
