/* =============================================================
   1. Tokens
   ============================================================= */
:root {
  --bg:        #f6f4ee;
  --bg-2:      #eee8dc;
  --paper:     #ffffff;
  --ink:       #1f2430;
  --ink-soft:  #3b4152;
  --ink-mute:  #6b7280;

  --accent:    #5b7fdb;   /* soft trust blue */
  --accent-2:  #2fb39e;   /* soft growth teal */
  --accent-3:  #e7ac4f;   /* warm highlight, used sparingly */

  --glass:        rgba(255, 255, 255, 0.55);
  --glass-solid:  rgba(255, 255, 255, 0.86);
  --glass-border: rgba(255, 255, 255, 0.7);
  --line:      rgba(31, 36, 48, 0.1);

  --font-display: "Manrope", "Inter", system-ui, sans-serif;
  --font-body:    "Inter", system-ui, sans-serif;
  --font-mono:    "JetBrains Mono", "SFMono-Regular", Menlo, monospace;

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

  --radius-lg: 28px;
  --radius-md: 18px;
  --radius-sm: 12px;

  --nav-h: 76px;
}

/* =============================================================
   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(--font-body);
  font-size: 16px;
  line-height: 1.6;
  color: var(--ink-soft);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
  overscroll-behavior-y: none;
}
body.nav-lock { overflow: hidden; }

img, svg, video { display: block; max-width: 100%; }
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(--font-display);
  color: var(--ink);
  text-wrap: balance;
  line-height: 1.08;
  letter-spacing: -0.02em;
  font-weight: 700;
}
em { font-style: normal; color: var(--accent); }
ul { list-style: none; padding: 0; }

::selection { background: var(--accent); color: #fff; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }

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

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

/* =============================================================
   3. Utilities
   ============================================================= */
.container { max-width: 1240px; margin-inline: auto; padding-inline: 1.25rem; }
.container-narrow { max-width: 760px; }

.eyebrow {
  font-family: var(--font-mono);
  font-size: .78rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: .6rem;
  font-weight: 500;
}

.section { padding-block: clamp(4rem, 8vw, 7rem); }
.section-alt { background: var(--bg-2); }
.section-title { font-size: clamp(1.9rem, 3.6vw, 2.8rem); max-width: 20ch; }
.section-sub { color: var(--ink-mute); font-size: 1.05rem; max-width: 56ch; margin-top: .9rem; }

.section-head-row {
  display: flex; flex-wrap: wrap; gap: 1rem 2rem;
  align-items: flex-end; justify-content: space-between;
}
.link-arrow {
  font-weight: 600; color: var(--accent);
  white-space: nowrap;
  border-bottom: 1px solid transparent;
  transition: border-color .3s var(--ease-out);
}
.link-arrow:hover { border-color: currentColor; }

/* Reveal on scroll — progressive enhancement, see html.no-js / html.js below */
.reveal {
  transition: opacity .8s var(--ease-out), transform .8s var(--ease-out);
  transition-delay: calc(var(--stagger, 0) * 90ms);
}
.no-js .reveal, .reveal { opacity: 1; transform: none; }
.js .reveal { opacity: 0; transform: translateY(26px); }
.js .reveal.is-visible { opacity: 1; transform: none; }

/* Glass card — solid fallback first, blur as enhancement */
.glass-card {
  background: var(--glass-solid);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: 0 20px 60px -30px rgba(31, 36, 48, .35);
}
@supports (backdrop-filter: blur(20px)) or (-webkit-backdrop-filter: blur(20px)) {
  .glass-card {
    background: var(--glass);
    border-color: var(--glass-border);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
  }
}

/* =============================================================
   4. Buttons
   ============================================================= */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: .5rem;
  padding: .85rem 1.5rem;
  border-radius: 999px;
  font-weight: 600;
  font-size: .95rem;
  transition: transform .3s var(--ease-out), box-shadow .3s var(--ease-out), background .3s var(--ease-out);
  white-space: nowrap;
}
.btn-sm { padding: .6rem 1.15rem; font-size: .88rem; }
.btn-lg { padding: 1rem 1.9rem; font-size: 1rem; }

.btn-primary {
  color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 14px 30px -12px rgba(91, 127, 219, .55);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 18px 36px -12px rgba(91, 127, 219, .65); }

.btn-ghost {
  color: var(--ink);
  background: rgba(31, 36, 48, .06);
}
.btn-ghost:hover { background: rgba(31, 36, 48, .1); transform: translateY(-2px); }

/* =============================================================
   5. Nav
   ============================================================= */
.site-nav {
  position: fixed; inset: 0 0 auto 0; z-index: 100;
  height: var(--nav-h);
  display: flex; align-items: center;
  transition: background .35s var(--ease-out), box-shadow .35s var(--ease-out), height .35s var(--ease-out);
}
.site-nav.is-scrolled {
  background: rgba(246, 244, 238, .78);
  backdrop-filter: blur(16px) saturate(160%);
  -webkit-backdrop-filter: blur(16px) saturate(160%);
  box-shadow: 0 8px 30px -18px rgba(31, 36, 48, .4);
  height: 66px;
}
.nav-inner {
  width: 100%;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
}
.brand { display: flex; align-items: center; gap: .55rem; font-family: var(--font-display); font-weight: 800; font-size: 1.15rem; color: var(--ink); }
.brand-mark {
  display: grid; place-items: center;
  width: 34px; height: 34px; border-radius: 10px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff; font-weight: 800;
}
.nav-links { display: none; align-items: center; gap: 1.9rem; }
.nav-link {
  position: relative; font-weight: 500; color: var(--ink-soft); font-size: .95rem;
}
.nav-link::after {
  content: ""; position: absolute; left: 0; right: 100%; bottom: -6px; height: 2px;
  background: var(--accent); transition: right .3s var(--ease-out);
}
.nav-link:hover::after { right: 0; }
.nav-cta { display: none; }

.nav-toggle {
  display: grid; gap: 5px; padding: .5rem; margin-left: auto;
}
.nav-toggle span { width: 22px; height: 2px; background: var(--ink); border-radius: 2px; transition: transform .3s var(--ease-out), opacity .3s var(--ease-out); }
.nav-mobile {
  position: fixed; inset: var(--nav-h) 0 auto 0; z-index: 99;
  display: flex; flex-direction: column; gap: .25rem; padding: 1rem 1.25rem 1.5rem;
  background: rgba(246, 244, 238, .98);
  border-bottom: 1px solid var(--line);
  transform: translateY(-8px); opacity: 0; pointer-events: none;
  transition: transform .3s var(--ease-out), opacity .3s var(--ease-out);
}
.nav-mobile.is-open { transform: translateY(0); opacity: 1; pointer-events: auto; }
.nav-mobile a { padding: .8rem .2rem; font-weight: 600; border-bottom: 1px solid var(--line); }
.nav-mobile .btn { margin-top: .75rem; align-self: flex-start; }

@media (min-width: 960px) {
  .nav-links { display: flex; }
  .nav-cta { display: inline-flex; }
  .nav-toggle { display: none; }
}

/* =============================================================
   6. Hero
   ============================================================= */
.hero {
  position: relative;
  padding-top: calc(var(--nav-h) + clamp(2.5rem, 6vw, 4.5rem));
  padding-bottom: clamp(3rem, 7vw, 5rem);
  overflow: clip;
}
.hero-mesh {
  position: absolute; inset: -10% -10% -20% -10%; z-index: -1;
  background:
    radial-gradient(38% 32% at var(--mx, 22%) var(--my, 28%), rgba(91, 127, 219, .32) 0%, transparent 70%),
    radial-gradient(34% 30% at 82% 18%, rgba(47, 179, 158, .28) 0%, transparent 70%),
    radial-gradient(30% 26% at 70% 78%, rgba(231, 172, 79, .18) 0%, transparent 70%),
    var(--bg);
  filter: blur(50px) saturate(140%);
  transition: background-position 1.2s var(--ease-soft);
  animation: meshDrift 26s ease-in-out infinite;
}
@keyframes meshDrift {
  0%, 100% { transform: scale(1) rotate(0deg); }
  50%      { transform: scale(1.15) rotate(6deg); }
}

.hero-grid {
  display: grid; gap: 3rem;
  align-items: center;
}
.kicker {
  font-family: var(--font-mono); font-size: .82rem; letter-spacing: .12em;
  text-transform: uppercase; color: var(--accent-2); font-weight: 500; margin-bottom: 1rem;
}
.hero-title {
  font-size: clamp(2.5rem, 6.4vw, 4.4rem);
  max-width: 13ch;
}
.hero-title .reveal-line { display: block; }
.hero-sub { font-size: 1.15rem; color: var(--ink-mute); max-width: 46ch; margin-top: 1.4rem; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 1rem; margin-top: 2rem; }
.hero-trust { margin-top: 1.4rem; font-size: .85rem; color: var(--ink-mute); }

.hero-visual { position: relative; perspective: 1200px; }
.hero-card {
  padding: 1.4rem; max-width: 420px; margin-inline: auto;
  transform-style: preserve-3d;
  transition: transform .4s var(--ease-out);
  will-change: transform;
}
.hc-browser { display: flex; align-items: center; gap: .4rem; margin-bottom: 1rem; }
.hc-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--line); }
.hc-url {
  margin-left: .6rem; font-family: var(--font-mono); font-size: .72rem; color: var(--ink-mute);
  background: rgba(31, 36, 48, .06); padding: .25rem .6rem; border-radius: 999px;
}
.hc-serp {
  position: relative; background: var(--paper); border: 1px solid var(--line);
  border-radius: var(--radius-sm); padding: 1rem 1.1rem; margin-bottom: 1rem;
}
.hc-badge {
  position: absolute; top: -10px; right: 12px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff; font-size: .68rem; font-weight: 700; letter-spacing: .02em;
  padding: .3rem .6rem; border-radius: 999px;
}
.hc-serp-url { font-size: .74rem; color: var(--accent-2); margin-bottom: .3rem; }
.hc-serp-title { font-size: .95rem; font-weight: 700; color: var(--ink); margin-bottom: .3rem; }
.hc-serp-desc { font-size: .8rem; color: var(--ink-mute); }
.hc-chart { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 1rem 1.1rem 1.2rem; }
.hc-chart-label { font-size: .72rem; color: var(--ink-mute); margin-bottom: .5rem; }
.hc-chart-svg { width: 100%; height: 70px; }
.hc-growth { margin-top: .6rem; font-size: .9rem; color: var(--ink-mute); }
.hc-growth span { font-family: var(--font-mono); font-weight: 700; color: var(--accent-2); font-size: 1rem; }

.hc-caption {
  margin-top: .7rem; font-size: .72rem; color: var(--ink-mute); line-height: 1.4;
}

@media (min-width: 960px) {
  .hero-grid { grid-template-columns: 1.05fr .95fr; }
  .hero-copy { text-align: left; }
}

/* =============================================================
   7. Transparency strip
   ============================================================= */
.trust-strip { padding-block: clamp(2rem, 4vw, 2.75rem); border-block: 1px solid var(--line); background: var(--bg-2); }
.trust-grid {
  display: grid; gap: 1.5rem 1.5rem;
  grid-template-columns: 1fr;
}
.trust-item { display: flex; align-items: center; gap: .75rem; }
.trust-icon {
  display: grid; place-items: center; flex-shrink: 0;
  width: 36px; height: 36px; border-radius: 10px;
  background: rgba(47, 179, 158, .14); color: var(--accent-2);
}
.trust-item p { font-size: .88rem; color: var(--ink-soft); font-weight: 500; }
@media (min-width: 720px) { .trust-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1280px) { .trust-grid { grid-template-columns: repeat(4, 1fr); } }

/* =============================================================
   8. Services
   ============================================================= */
.services-grid {
  display: grid; gap: 1.25rem; margin-top: 2.75rem;
  grid-template-columns: 1fr;
}
.service-card { padding: 2rem 1.75rem; transition: transform .35s var(--ease-out); }
.service-card:hover { transform: translateY(-6px); }
.service-icon {
  display: grid; place-items: center; width: 52px; height: 52px; border-radius: 14px;
  background: linear-gradient(135deg, rgba(91,127,219,.16), rgba(47,179,158,.16));
  color: var(--accent); margin-bottom: 1.25rem;
}
.service-card h3 { font-size: 1.2rem; margin-bottom: .5rem; }
.service-card p { color: var(--ink-mute); font-size: .95rem; }

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

/* =============================================================
   9. Methodology
   ============================================================= */
.method-grid {
  display: grid; gap: 1.75rem; margin-top: 2.75rem;
  grid-template-columns: 1fr;
}
.method-step { position: relative; padding-left: 1.5rem; border-left: 2px solid var(--line); }
.method-n {
  display: block; font-family: var(--font-mono); font-weight: 700; font-size: .95rem;
  color: var(--accent-2); margin-bottom: .5rem;
}
.method-step h3 { font-size: 1.1rem; margin-bottom: .4rem; }
.method-step p { color: var(--ink-mute); font-size: .92rem; }

@media (min-width: 960px) { .method-grid { grid-template-columns: repeat(4, 1fr); } }

/* =============================================================
   10. Articles / resources
   ============================================================= */
.articles-grid {
  display: grid; gap: 1.25rem; margin-top: 2.75rem;
  grid-template-columns: 1fr;
}
.article-card { padding: 1.4rem; transition: transform .35s var(--ease-out); }
.article-card:hover { transform: translateY(-6px); }
.article-thumb {
  aspect-ratio: 16 / 9; border-radius: var(--radius-sm); margin-bottom: 1rem;
  display: grid; place-items: center; color: #fff;
}
.article-thumb svg { width: 34%; height: 34%; opacity: .9; }
.thumb-a { background: linear-gradient(135deg, #5b7fdb, #8aa6ea); }
.thumb-b { background: linear-gradient(135deg, #2fb39e, #7fd6c6); }
.thumb-c { background: linear-gradient(135deg, #e7ac4f, #f0cd94); }

.tag {
  display: inline-block; font-size: .72rem; font-weight: 700; letter-spacing: .02em;
  padding: .3rem .65rem; border-radius: 999px; margin-bottom: .7rem;
}
.tag-a { background: rgba(91,127,219,.14); color: #3f5db3; }
.tag-b { background: rgba(47,179,158,.14); color: #1f8574; }
.tag-c { background: rgba(231,172,79,.18); color: #a5761d; }

.article-card h3 { font-size: 1.05rem; margin-bottom: .5rem; }
.article-meta { font-size: .8rem; color: var(--ink-mute); }

@media (min-width: 720px) { .articles-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 960px) { .articles-grid { grid-template-columns: repeat(3, 1fr); } }

/* =============================================================
   11. About / transparency copy
   ============================================================= */
.about-copy { margin-top: 2rem; display: flex; flex-direction: column; gap: 1.1rem; }
.about-copy p { color: var(--ink-soft); font-size: 1rem; max-width: 68ch; }
.about-copy a { color: var(--accent); font-weight: 600; }

/* =============================================================
   12. FAQ
   ============================================================= */
.faq-list { margin-top: 2.5rem; border-top: 1px solid var(--line); }
.faq-item { border-bottom: 1px solid var(--line); }
.faq-q {
  width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: 1.4rem 0; text-align: left; font-weight: 600; font-size: 1.02rem; color: var(--ink);
}
.faq-plus {
  position: relative; width: 18px; height: 18px; flex-shrink: 0;
}
.faq-plus::before, .faq-plus::after {
  content: ""; position: absolute; background: var(--accent); border-radius: 2px;
  transition: transform .3s var(--ease-out);
}
.faq-plus::before { top: 50%; left: 0; width: 100%; height: 2px; transform: translateY(-50%); }
.faq-plus::after { left: 50%; top: 0; height: 100%; width: 2px; transform: translateX(-50%); }
.faq-item.is-open .faq-plus::after { transform: translateX(-50%) rotate(90deg); opacity: 0; }

.faq-a {
  display: grid; grid-template-rows: 0fr; overflow: hidden;
  transition: grid-template-rows .35s var(--ease-out);
}
.faq-a p { min-height: 0; padding-bottom: 1.4rem; color: var(--ink-mute); font-size: .95rem; max-width: 62ch; }
.faq-a > p { overflow: hidden; }
.faq-item.is-open .faq-a { grid-template-rows: 1fr; }
/* fallback for browsers without subgrid rows animation support: keep content reachable */
.no-js .faq-a { display: block; }

/* =============================================================
   13. CTA / form
   ============================================================= */
.cta-section { padding-block: clamp(3.5rem, 8vw, 6rem); }
.cta-card { padding: clamp(2rem, 5vw, 3.25rem); text-align: center; }
.cta-card .section-title { margin-inline: auto; }
.cta-card .section-sub { margin-inline: auto; }

.audit-form { margin-top: 2rem; display: flex; flex-direction: column; gap: 1rem; text-align: left; }
.form-row { display: grid; gap: 1rem; grid-template-columns: 1fr; }
.field { display: flex; flex-direction: column; gap: .4rem; font-size: .85rem; font-weight: 600; color: var(--ink-soft); }
.field input {
  font: inherit; padding: .8rem .95rem; border-radius: var(--radius-sm);
  border: 1px solid var(--line); background: var(--paper); color: var(--ink);
}
.field input:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.audit-form .btn { align-self: center; margin-top: .5rem; }
.form-success { display: none; text-align: center; color: var(--accent-2); font-weight: 600; margin-top: .5rem; }
.audit-form.is-sent .form-success { display: block; }
.audit-form.is-sent input { opacity: .6; }

.field-inline { max-width: 360px; margin-inline: auto; width: 100%; }

@media (min-width: 640px) { .form-row { grid-template-columns: 1fr 1fr; } }

/* =============================================================
   14. Footer
   ============================================================= */
.site-footer { padding-block: 3.5rem 2rem; border-top: 1px solid var(--line); }
.footer-grid {
  display: grid; gap: 2.25rem; padding-bottom: 2.5rem;
  grid-template-columns: 1fr;
}
.footer-brand p { margin-top: .6rem; color: var(--ink-mute); font-size: .9rem; }
.footer-nav { display: flex; flex-wrap: wrap; gap: 1rem 1.5rem; }
.footer-nav a { color: var(--ink-mute); font-size: .92rem; }
.footer-nav a:hover { color: var(--ink); }
.footer-contact { display: flex; flex-direction: column; gap: .6rem; font-size: .92rem; }
.footer-contact a { color: var(--accent); font-weight: 600; }
.footer-legal-links a { color: var(--ink-mute); }
.footer-disclaimer { padding-block: 1.5rem; border-top: 1px solid var(--line); }
.footer-disclaimer p { font-size: .78rem; color: var(--ink-mute); max-width: 70ch; line-height: 1.6; }
.footer-bottom { border-top: 1px solid var(--line); padding-top: 1.5rem; font-size: .82rem; color: var(--ink-mute); }

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

/* =============================================================
   15. Cookie banner
   ============================================================= */
.cookie-banner {
  position: fixed; left: 1rem; right: 1rem; bottom: 1rem; z-index: 200;
  max-width: 640px; margin-inline: auto;
  background: var(--glass-solid);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  box-shadow: 0 20px 50px -20px rgba(31, 36, 48, .45);
  padding: 1.1rem 1.25rem;
  transform: translateY(140%);
  transition: transform .4s var(--ease-out);
}
@supports (backdrop-filter: blur(20px)) or (-webkit-backdrop-filter: blur(20px)) {
  .cookie-banner { background: var(--glass); backdrop-filter: blur(20px) saturate(180%); -webkit-backdrop-filter: blur(20px) saturate(180%); }
}
.cookie-banner.is-visible { transform: translateY(0); }
.cookie-banner[hidden] { display: block; } /* JS controls visibility via .is-visible, not [hidden], once boot runs */
.cookie-banner-inner { display: flex; flex-wrap: wrap; gap: 1rem; align-items: center; justify-content: space-between; }
.cookie-banner p { font-size: .85rem; color: var(--ink-soft); max-width: 44ch; }
.cookie-banner a { color: var(--accent); font-weight: 600; }
.cookie-banner-actions { display: flex; gap: .6rem; flex-shrink: 0; }

/* =============================================================
   15b. Legal pages (aviso legal, privacidad, cookies)
   ============================================================= */
.legal-header { padding-block: 2.5rem 1rem; }
.legal-back { display: inline-flex; align-items: center; gap: .4rem; color: var(--ink-mute); font-weight: 600; font-size: .9rem; }
.legal-main { padding-block: 1rem clamp(3rem, 6vw, 5rem); }
.legal-content { margin-top: 1.75rem; display: flex; flex-direction: column; gap: 1.4rem; }
.legal-content h2 { font-size: 1.35rem; margin-top: .5rem; }
.legal-content p { color: var(--ink-soft); }
.legal-content ul { list-style: disc; padding-left: 1.3rem; display: flex; flex-direction: column; gap: .4rem; }
.legal-content li { color: var(--ink-soft); }
.legal-content a { color: var(--accent); font-weight: 600; }
.legal-updated { color: var(--ink-mute); font-size: .85rem; }
.legal-placeholder {
  background: rgba(231, 172, 79, .16); border: 1px solid rgba(231, 172, 79, .4);
  border-radius: var(--radius-sm); padding: .9rem 1.1rem; font-size: .88rem; color: #7a5518;
}

/* =============================================================
   16. Breakpoints reference (mobile-first; used throughout above)
   540 / 720 / 960 / 1280 / 1600
   ============================================================= */

/* =============================================================
   17. Reduced motion — only the truly intrusive
   ============================================================= */
@media (prefers-reduced-motion: reduce) {
  .hero-mesh { animation: none; }
  /* Do NOT disable: reveal fades, hover tilts, magnetic buttons, count-up, faq accordion */
}
