/* ════════════════════════════════════════════════
   EVARIS.ES — Stylesheet
   Pure CSS, no framework, no build step
   ════════════════════════════════════════════════ */

/* ── Design tokens ─────────────────────────────── */
:root {
  --bg:          #ffffff;
  --bg-alt:      #F7F7FB;
  --ink:         #09090F;
  --ink-2:       #6B7280;
  --accent:      #4361EE;
  --accent-2:    #7048E8;
  --border:      rgba(9, 9, 15, 0.07);
  --white:       #ffffff;

  --f-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;

  --hero-fs:   clamp(3rem, 7.5vw, 5.75rem);
  --h2-fs:     clamp(2rem, 4.5vw, 3rem);
  --h3-fs:     clamp(1.35rem, 2.5vw, 1.65rem);
  --body-lg:   clamp(1rem, 1.5vw, 1.175rem);

  --r-sm:   0.5rem;
  --r-md:   1rem;
  --r-lg:   1.5rem;
  --r-xl:   2rem;
  --r-pill: 100vw;

  --shadow-card: 0 2px 8px rgba(0,0,0,0.04), 0 8px 32px rgba(0,0,0,0.06);
  --shadow-hover: 0 8px 16px rgba(0,0,0,0.05), 0 24px 48px rgba(0,0,0,0.1);

  --nav-h:    4.25rem;
  --max-w:    72rem;
  --pad-x:    clamp(1.25rem, 5vw, 3.5rem);
  --ease:     0.22s cubic-bezier(0.4, 0, 0.2, 1);
  --ease-out: 0.45s cubic-bezier(0, 0, 0.2, 1);
}

/* ── Reset ──────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body {
  font-family: var(--f-sans);
  background: var(--bg);
  color: var(--ink);
  line-height: 1.65;
  overflow-x: hidden;
}

img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; }

section[id] { scroll-margin-top: var(--nav-h); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

/* ── Layout helpers ─────────────────────────────── */
.container {
  width: 100%;
  max-width: var(--max-w);
  margin-inline: auto;
  padding-inline: var(--pad-x);
}

.gradient-text {
  background: linear-gradient(128deg, var(--accent) 0%, var(--accent-2) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.label {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.875rem;
}

/* ── Scroll animations ──────────────────────────── */
.animate-in {
  opacity: 0;
  transform: translateY(1.75rem);
  transition:
    opacity   0.55s var(--ease-out),
    transform 0.55s var(--ease-out);
  transition-delay: var(--delay, 0s);
}
.animate-in.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ════════════════════════════════════════════════
   NAVBAR
   ════════════════════════════════════════════════ */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  background: rgba(255,255,255,0.82);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid transparent;
  transition: border-color var(--ease), box-shadow var(--ease);
}

.navbar.scrolled {
  border-bottom-color: var(--border);
  box-shadow: 0 1px 12px rgba(0,0,0,0.05);
}

.nav-container {
  width: 100%;
  max-width: var(--max-w);
  margin-inline: auto;
  padding-inline: var(--pad-x);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo {
  font-size: 1.45rem;
  font-weight: 900;
  letter-spacing: -0.05em;
  line-height: 1;
  transition: opacity var(--ease);
}
.nav-logo:hover { opacity: 0.65; }
.logo-accent { color: var(--accent); }

.nav-links {
  display: flex;
  align-items: center;
  gap: 0.125rem;
}

.nav-link {
  padding: 0.45rem 0.85rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--ink-2);
  border-radius: var(--r-sm);
  transition: color var(--ease), background var(--ease);
}
.nav-link:hover {
  color: var(--ink);
  background: rgba(9,9,15,0.04);
}

.nav-cta {
  background: var(--ink);
  color: var(--white) !important;
  border-radius: var(--r-pill);
  padding: 0.45rem 1.2rem;
  font-weight: 600;
  margin-left: 0.5rem;
}
.nav-cta:hover {
  background: #1a1a2e !important;
  color: var(--white) !important;
}

/* Hamburger */
.menu-btn {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
  border-radius: var(--r-sm);
  transition: background var(--ease);
}
.menu-btn:hover { background: rgba(9,9,15,0.04); }
.menu-btn span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--ink);
  border-radius: 2px;
  transition: transform var(--ease), opacity var(--ease);
  transform-origin: center;
}
.menu-btn.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.menu-btn.open span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.menu-btn.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ════════════════════════════════════════════════
   HERO
   ════════════════════════════════════════════════ */
.hero {
  position: relative;
  min-height: calc(100svh - var(--nav-h));
  display: flex;
  align-items: center;
  padding-block: clamp(5rem, 12vw, 9rem);
  overflow: hidden;
}

/* Mesh gradient blobs */
.hero-bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}
.blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(72px);
  will-change: transform;
  animation: float 9s ease-in-out infinite;
}
.blob-1 {
  width: 55vw; height: 55vw; max-width: 680px; max-height: 680px;
  background: radial-gradient(circle, rgba(67,97,238,0.14) 0%, transparent 70%);
  top: -20%; right: -8%;
  animation-delay: 0s;
}
.blob-2 {
  width: 40vw; height: 40vw; max-width: 500px; max-height: 500px;
  background: radial-gradient(circle, rgba(112,72,232,0.11) 0%, transparent 70%);
  bottom: 5%; left: -8%;
  animation-delay: 3s;
}
.blob-3 {
  width: 30vw; height: 30vw; max-width: 360px; max-height: 360px;
  background: radial-gradient(circle, rgba(67,97,238,0.08) 0%, transparent 70%);
  top: 35%; right: 28%;
  animation-delay: 5.5s;
}

@keyframes float {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33%       { transform: translate(18px, -14px) scale(1.04); }
  66%       { transform: translate(-12px, 18px) scale(0.96); }
}

.hero .container { position: relative; z-index: 1; }

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.375rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--r-pill);
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--ink-2);
  background: rgba(255,255,255,0.75);
  backdrop-filter: blur(8px);
  margin-bottom: 2.25rem;
  width: fit-content;
}
.hero-badge .sep { opacity: 0.3; }

.hero-title {
  font-size: var(--hero-fs);
  font-weight: 900;
  letter-spacing: -0.04em;
  line-height: 1.04;
  margin-bottom: 1.5rem;
  max-width: 16ch;
}

.hero-subtitle {
  font-size: var(--body-lg);
  color: var(--ink-2);
  line-height: 1.72;
  margin-bottom: 2.75rem;
  max-width: 50ch;
  font-weight: 400;
}

.br-desktop { display: block; }

/* ── Buttons ─────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.875rem 1.75rem;
  border-radius: var(--r-pill);
  font-size: 0.9375rem;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: transform var(--ease), box-shadow var(--ease), background var(--ease), opacity var(--ease);
  line-height: 1;
}

.btn-primary {
  background: var(--ink);
  color: var(--white);
}
.btn-primary:hover {
  background: #1a1a2e;
  transform: translateY(-2px);
  box-shadow: 0 10px 28px rgba(9,9,15,0.22);
}
.btn-primary:active { transform: translateY(0); }
.btn-primary svg { transition: transform var(--ease); }
.btn-primary:hover svg { transform: translateX(3px); }

/* Submit-specific */
.btn-submit {
  width: 100%;
  justify-content: center;
  position: relative;
  margin-top: 0.25rem;
}
.btn-submit.loading .btn-label,
.btn-submit.loading .btn-arrow { visibility: hidden; }
.btn-submit.loading .spinner { display: block; }
.btn-submit:disabled { opacity: 0.7; cursor: not-allowed; transform: none !important; }

.spinner {
  display: none;
  position: absolute;
  width: 20px; height: 20px;
  border: 2.5px solid rgba(255,255,255,0.25);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.65s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ════════════════════════════════════════════════
   SERVICES
   ════════════════════════════════════════════════ */
.services {
  padding-block: clamp(5rem, 10vw, 8rem);
  background: var(--bg-alt);
}

.section-header {
  text-align: center;
  margin-bottom: clamp(2.5rem, 5vw, 4rem);
}
.section-header h2 {
  font-size: var(--h2-fs);
  font-weight: 800;
  letter-spacing: -0.035em;
  line-height: 1.15;
  margin-bottom: 0.875rem;
}
.section-header p {
  font-size: var(--body-lg);
  color: var(--ink-2);
  max-width: 52ch;
  margin-inline: auto;
}

/* Bento grid */
.bento-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.25rem;
}

.card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  padding: clamp(1.75rem, 3vw, 2.75rem);
  position: relative;
  overflow: hidden;
  transition: transform var(--ease-out), box-shadow var(--ease-out);
}
.card::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(140deg, rgba(67,97,238,0.035) 0%, rgba(112,72,232,0.035) 100%);
  opacity: 0;
  transition: opacity var(--ease-out);
  pointer-events: none;
}
.card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-hover);
}
.card:hover::after { opacity: 1; }

.card-icon {
  color: var(--accent);
  margin-bottom: 1.5rem;
  width: 28px;
  height: 28px;
}

.card h3 {
  font-size: var(--h3-fs);
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.2;
  margin-bottom: 0.875rem;
}

.card p {
  color: var(--ink-2);
  line-height: 1.72;
  margin-bottom: 1.5rem;
  font-size: 0.9375rem;
}

.tags {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}
.tags li {
  padding: 0.25rem 0.75rem;
  border-radius: var(--r-pill);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--accent);
  background: rgba(67,97,238,0.07);
  border: 1px solid rgba(67,97,238,0.14);
}

/* ════════════════════════════════════════════════
   CONTACT
   ════════════════════════════════════════════════ */
.contact {
  padding-block: clamp(5rem, 10vw, 8rem);
  background: var(--bg);
}

.contact-layout {
  display: grid;
  grid-template-columns: 1fr 1.6fr;
  gap: clamp(3rem, 6vw, 6rem);
  align-items: start;
}

.contact-info .label { margin-bottom: 0.875rem; }
.contact-info h2 {
  font-size: var(--h2-fs);
  font-weight: 800;
  letter-spacing: -0.035em;
  line-height: 1.15;
  margin-bottom: 0.875rem;
}
.contact-info > p {
  font-size: var(--body-lg);
  color: var(--ink-2);
  margin-bottom: 2rem;
  max-width: 34ch;
}

.contact-email {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--ink);
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.125rem;
  transition: color var(--ease), border-color var(--ease);
}
.contact-email:hover {
  color: var(--accent);
  border-color: var(--accent);
}

/* Form */
.contact-form {
  display: flex;
  flex-direction: column;
  gap: 1.125rem;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 0.425rem;
}
.field label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--ink);
}
.field input,
.field textarea {
  width: 100%;
  padding: 0.8125rem 1rem;
  border: 1.5px solid var(--border);
  border-radius: var(--r-md);
  background: var(--bg);
  font-family: var(--f-sans);
  font-size: 0.9375rem;
  color: var(--ink);
  outline: none;
  resize: vertical;
  transition: border-color var(--ease), box-shadow var(--ease);
  -webkit-appearance: none;
}
.field input::placeholder,
.field textarea::placeholder { color: #B4BAC5; }
.field input:focus,
.field textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(67,97,238,0.1);
}
.field input.invalid,
.field textarea.invalid {
  border-color: #EF4444;
}

.form-msg {
  font-size: 0.85rem;
  font-weight: 500;
  min-height: 1.2em;
}
.form-msg.ok  { color: #10B981; }
.form-msg.err { color: #EF4444; }

/* ════════════════════════════════════════════════
   FOOTER
   ════════════════════════════════════════════════ */
.footer {
  border-top: 1px solid var(--border);
  padding-block: 2rem;
}
.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}
.footer-logo {
  font-size: 1.2rem;
  font-weight: 900;
  letter-spacing: -0.05em;
}
.footer > .container > .footer-inner > p,
.footer-inner > p {
  font-size: 0.8125rem;
  color: var(--ink-2);
}
.footer-nav {
  display: flex;
  gap: 1.25rem;
}
.footer-nav a {
  font-size: 0.8125rem;
  color: var(--ink-2);
  transition: color var(--ease);
}
.footer-nav a:hover { color: var(--ink); }

/* ════════════════════════════════════════════════
   RESPONSIVE
   ════════════════════════════════════════════════ */
@media (max-width: 860px) {
  .contact-layout {
    grid-template-columns: 1fr;
    gap: 3rem;
  }
  .contact-info > p { max-width: unset; }
}

@media (max-width: 768px) {
  .menu-btn { display: flex; }

  .nav-links {
    display: none;
    position: fixed;
    inset: var(--nav-h) 0 0;
    background: rgba(255,255,255,0.97);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    z-index: 99;
  }
  .nav-links.open { display: flex; }
  .nav-link {
    font-size: 1.375rem;
    padding: 0.875rem 2.5rem;
    border-radius: var(--r-md);
  }
  .nav-cta { margin-left: 0; margin-top: 0.5rem; }

  .hero { padding-block: clamp(4rem, 10vw, 6rem); min-height: unset; }
  .br-desktop { display: none; }

  .bento-grid { grid-template-columns: 1fr; }

  .footer-inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
  }
}

@media (max-width: 420px) {
  .hero-badge { font-size: 0.7rem; gap: 0.375rem; padding: 0.3rem 0.8rem; }
}

/* ── Focus-visible (accessibility) ──────────────── */
:focus-visible {
  outline: 2.5px solid var(--accent);
  outline-offset: 3px;
  border-radius: 3px;
}

/* ════════════════════════════════════════════════
   SUBPAGES — shared components
   ════════════════════════════════════════════════ */

/* Card with flex column so CTA sticks to bottom */
.card-link-wrap {
  display: flex;
  flex-direction: column;
}
.card-link-wrap p { flex: 1; }

/* "Ver más" link inside cards */
.card-cta {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--accent);
  margin-top: 1.25rem;
  transition: gap var(--ease), opacity var(--ease);
  width: fit-content;
}
.card-cta:hover { gap: 0.625rem; }

/* ── Breadcrumb / back link ─────────────────────── */
.breadcrumb {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--ink-2);
  margin-bottom: 2rem;
  transition: color var(--ease);
}
.breadcrumb:hover { color: var(--ink); }

/* ── 3-column service grid ──────────────────────── */
.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
}

/* ── Methodology steps ──────────────────────────── */
.steps {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 2.5rem;
  position: relative;
}
.steps::before {
  content: '';
  position: absolute;
  top: 1.625rem;
  left: calc(1.625rem + 2.5rem);
  right: calc(1.625rem + 2.5rem);
  height: 1px;
  background: linear-gradient(90deg, rgba(67,97,238,0.35) 0%, rgba(67,97,238,0.08) 100%);
  pointer-events: none;
}
.step-num {
  width: 3.25rem; height: 3.25rem;
  border-radius: 50%;
  border: 2px solid rgba(67,97,238,0.25);
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8125rem;
  font-weight: 800;
  color: var(--accent);
  margin-bottom: 1.25rem;
  position: relative;
  z-index: 1;
}
.step-title {
  font-size: 0.9375rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  letter-spacing: -0.01em;
}
.step-desc {
  font-size: 0.875rem;
  color: var(--ink-2);
  line-height: 1.6;
}

/* ── Stats / highlights row ─────────────────────── */
.highlights {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  margin-top: 4rem;
}
.highlight-box {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 2rem 1.75rem;
  text-align: center;
}
.highlight-val {
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 900;
  letter-spacing: -0.04em;
  line-height: 1;
  margin-bottom: 0.5rem;
}
.highlight-label {
  font-size: 0.875rem;
  color: var(--ink-2);
  font-weight: 500;
  line-height: 1.4;
}

/* ── Active nav link ────────────────────────────── */
.nav-link[aria-current="page"] {
  color: var(--ink);
  background: rgba(9,9,15,0.05);
}

/* ── Language switcher ──────────────────────────── */
.lang-switcher {
  display: flex;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: var(--r-pill);
  overflow: hidden;
  flex-shrink: 0;
}
.lang-btn {
  background: none;
  border: none;
  padding: 0.3rem 0.6rem;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--ink-2);
  cursor: pointer;
  transition: color var(--ease), background var(--ease);
  line-height: 1;
  font-family: var(--f-sans);
}
.lang-btn:hover {
  color: var(--ink);
  background: rgba(9,9,15,0.04);
}
.lang-btn.active {
  background: var(--ink);
  color: var(--white);
}
.lang-btn + .lang-btn {
  border-left: 1px solid var(--border);
}

/* ── Responsive for subpage grids ──────────────── */
@media (max-width: 960px) {
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .steps  { grid-template-columns: repeat(2, 1fr); }
  .steps::before { display: none; }
  .highlights { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 640px) {
  .grid-3  { grid-template-columns: 1fr; }
  .steps   { grid-template-columns: 1fr; }
  .highlights { grid-template-columns: 1fr; }
}
