/* ==========================================================================
   Make Algo, S.L. — hoja de estilos del sitio corporativo
   Paleta y tipografía según brand/README.md
   ========================================================================== */

@font-face {
  font-family: 'Montserrat';
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url('../fonts/montserrat-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
    U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193,
    U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: 'Montserrat';
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url('../fonts/montserrat-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF,
    U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020,
    U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  --navy: #12446e;
  --navy-deep: #0a2947;
  --navy-ink: #061a2e;
  --blue: #1e77c4;
  --teal: #2aa6a6;
  --green: #43c08a;
  --grey: #565c63;

  --ink: #0f1b26;
  --ink-soft: #4a5763;
  --line: #e3e9ef;
  --mist: #f4f7fa;
  --paper: #ffffff;

  --gradient: linear-gradient(120deg, var(--blue) 0%, var(--teal) 55%, var(--green) 100%);
  --radius: 18px;
  --radius-lg: 28px;
  --shadow-sm: 0 1px 2px rgba(10, 41, 71, 0.06), 0 4px 12px rgba(10, 41, 71, 0.05);
  --shadow-md: 0 2px 4px rgba(10, 41, 71, 0.06), 0 18px 40px rgba(10, 41, 71, 0.1);
  --shadow-lg: 0 30px 70px rgba(10, 41, 71, 0.16);
  --wrap: 1140px;
  --nav-h: 74px;
}

/* ---------- Reset ---------- */
*,
*::before,
*::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--nav-h) + 16px);
}

body {
  margin: 0;
  font-family: 'Montserrat', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
  font-weight: 400;
  font-size: 17px;
  line-height: 1.65;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

img, svg { max-width: 100%; display: block; }
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3, h4 {
  font-weight: 800;
  line-height: 1.12;
  letter-spacing: -0.025em;
  margin: 0 0 0.5em;
  color: var(--navy);
}

h1 { font-size: clamp(2.4rem, 6.2vw, 4.05rem); }
h2 { font-size: clamp(1.85rem, 4vw, 2.75rem); }
h3 { font-size: 1.2rem; letter-spacing: -0.015em; }
p { margin: 0 0 1.15em; }
p:last-child { margin-bottom: 0; }

:focus-visible {
  outline: 3px solid var(--teal);
  outline-offset: 3px;
  border-radius: 6px;
}

/* ---------- Layout ---------- */
.wrap {
  width: min(100% - 2.5rem, var(--wrap));
  margin-inline: auto;
}

section { position: relative; }

.section {
  padding: clamp(4.5rem, 9vw, 7.5rem) 0;
}

.section--mist { background: var(--mist); }

.skip {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--navy);
  color: #fff;
  padding: 0.8rem 1.2rem;
  z-index: 999;
  border-radius: 0 0 10px 0;
}
.skip:focus { left: 0; }

/* ---------- Section headers ---------- */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-size: 0.735rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--teal);
  margin-bottom: 1.1rem;
}

.eyebrow::before {
  content: '';
  width: 26px;
  height: 2px;
  border-radius: 2px;
  background: var(--gradient);
}

.section-head {
  max-width: 46rem;
  margin-bottom: clamp(2.5rem, 5vw, 3.75rem);
}

.section-head p {
  font-size: 1.09rem;
  color: var(--ink-soft);
}

.grad-text {
  background: var(--gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* ---------- Navigation ---------- */
.nav {
  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: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

.nav.is-stuck {
  border-bottom-color: var(--line);
  box-shadow: 0 6px 24px rgba(10, 41, 71, 0.06);
}

.nav__inner {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  width: min(100% - 2.5rem, var(--wrap));
  margin-inline: auto;
}

.nav__brand { display: flex; align-items: center; margin-right: auto; }
.nav__brand:hover { text-decoration: none; }
.nav__brand img { height: 34px; width: auto; }

.nav__links {
  display: flex;
  align-items: center;
  gap: 1.9rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav__links a {
  font-size: 0.93rem;
  font-weight: 600;
  color: var(--navy);
  position: relative;
  padding: 0.3rem 0;
}
.nav__links a:hover { text-decoration: none; color: var(--blue); }

.nav__links a::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: 0;
  width: 0;
  height: 2px;
  border-radius: 2px;
  background: var(--gradient);
  transition: width 0.28s ease;
}
.nav__links a:hover::after { width: 100%; }

.lang {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 3px;
  background: #fff;
  gap: 2px;
}

.lang a {
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: var(--ink-soft);
  padding: 0.28rem 0.62rem;
  border-radius: 999px;
  line-height: 1;
}
.lang a:hover { text-decoration: none; color: var(--navy); }

.lang a[aria-current='true'] {
  background: var(--navy);
  color: #fff;
}

.nav__toggle {
  display: none;
  background: none;
  border: 1px solid var(--line);
  border-radius: 10px;
  width: 42px;
  height: 38px;
  cursor: pointer;
  padding: 0;
  align-items: center;
  justify-content: center;
}
.nav__toggle span {
  display: block;
  width: 18px;
  height: 2px;
  background: var(--navy);
  border-radius: 2px;
  position: relative;
}
.nav__toggle span::before,
.nav__toggle span::after {
  content: '';
  position: absolute;
  left: 0;
  width: 18px;
  height: 2px;
  background: var(--navy);
  border-radius: 2px;
}
.nav__toggle span::before { top: -6px; }
.nav__toggle span::after { top: 6px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: -0.005em;
  padding: 0.92rem 1.7rem;
  border-radius: 999px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease, color 0.2s ease;
  white-space: nowrap;
}
.btn:hover { text-decoration: none; transform: translateY(-2px); }

.btn--primary {
  background: var(--gradient);
  color: #fff;
  box-shadow: 0 10px 28px rgba(30, 119, 196, 0.32);
}
.btn--primary:hover { box-shadow: 0 16px 36px rgba(30, 119, 196, 0.4); }

.btn--ghost {
  background: rgba(255, 255, 255, 0.7);
  border-color: var(--line);
  color: var(--navy);
}
.btn--ghost:hover { border-color: var(--teal); color: var(--blue); }

.btn--light {
  background: #fff;
  color: var(--navy);
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  padding: clamp(3.5rem, 8vw, 6.5rem) 0 clamp(4rem, 8vw, 6rem);
  overflow: hidden;
  background: linear-gradient(180deg, #fbfdfe 0%, var(--mist) 100%);
}

.hero__glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.42;
  pointer-events: none;
  will-change: transform;
}
.hero__glow--a {
  width: 46vw; height: 46vw;
  max-width: 620px; max-height: 620px;
  top: -14%; right: -8%;
  background: radial-gradient(circle, var(--teal) 0%, rgba(42, 166, 166, 0) 68%);
  animation: drift 22s ease-in-out infinite alternate;
}
.hero__glow--b {
  width: 38vw; height: 38vw;
  max-width: 500px; max-height: 500px;
  bottom: -18%; left: -10%;
  background: radial-gradient(circle, var(--blue) 0%, rgba(30, 119, 196, 0) 68%);
  animation: drift 26s ease-in-out infinite alternate-reverse;
}
.hero__glow--c {
  width: 26vw; height: 26vw;
  max-width: 340px; max-height: 340px;
  top: 42%; left: 46%;
  background: radial-gradient(circle, var(--green) 0%, rgba(67, 192, 138, 0) 70%);
  opacity: 0.3;
  animation: drift 30s ease-in-out infinite alternate;
}

@keyframes drift {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to   { transform: translate3d(-40px, 34px, 0) scale(1.14); }
}

.hero__inner { position: relative; z-index: 1; }

.hero__badge {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.42rem 1rem 0.42rem 0.5rem;
  font-size: 0.79rem;
  font-weight: 600;
  color: var(--ink-soft);
  box-shadow: var(--shadow-sm);
  margin-bottom: 1.8rem;
}

.hero__badge b {
  background: var(--gradient);
  color: #fff;
  font-weight: 700;
  font-size: 0.7rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.22rem 0.62rem;
  border-radius: 999px;
}

.hero h1 { max-width: 15ch; margin-bottom: 0.55em; }

.hero__lead {
  font-size: clamp(1.06rem, 2vw, 1.28rem);
  color: var(--ink-soft);
  max-width: 40rem;
  margin-bottom: 2.3rem;
}

.hero__cta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
}

/* ---------- Cards ---------- */
.grid {
  display: grid;
  gap: 1.4rem;
}
.grid--3 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }

.card {
  position: relative;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 2.1rem 1.9rem;
  transition: transform 0.28s ease, box-shadow 0.28s ease, border-color 0.28s ease;
  overflow: hidden;
}

.card::before {
  content: '';
  position: absolute;
  inset: 0 0 auto 0;
  height: 3px;
  background: var(--gradient);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.35s ease;
}

.card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-md);
  border-color: transparent;
}
.card:hover::before { transform: scaleX(1); }

.card__icon {
  width: 50px;
  height: 50px;
  border-radius: 14px;
  background: var(--gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.4rem;
  box-shadow: 0 8px 20px rgba(42, 166, 166, 0.28);
}
.card__icon svg { width: 24px; height: 24px; stroke: #fff; fill: none; stroke-width: 2; }

.card p {
  color: var(--ink-soft);
  font-size: 0.97rem;
  margin-bottom: 1.1rem;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.tags li {
  font-size: 0.755rem;
  font-weight: 600;
  color: var(--navy);
  background: var(--mist);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.25rem 0.7rem;
}

/* ---------- Proceso ---------- */
.steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 1.6rem;
  counter-reset: step;
}

.step { position: relative; padding-top: 2.9rem; }

.step::before {
  counter-increment: step;
  content: '0' counter(step);
  position: absolute;
  top: 0;
  left: 0;
  font-size: 1.55rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  background: var(--gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.step::after {
  content: '';
  position: absolute;
  top: 1.05rem;
  left: 3.1rem;
  right: -0.8rem;
  height: 1px;
  background: linear-gradient(90deg, rgba(42, 166, 166, 0.45), rgba(42, 166, 166, 0));
}
.step:last-child::after { display: none; }

.step h3 { font-size: 1.06rem; margin-bottom: 0.4rem; }
.step p { font-size: 0.93rem; color: var(--ink-soft); margin: 0; }

/* ---------- Contacto ---------- */
.contact {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: clamp(2rem, 5vw, 4rem);
  align-items: center;
}

.contact__box {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 2.2rem;
  box-shadow: var(--shadow-md);
}

.contact__row {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  padding: 1rem 0;
  border-bottom: 1px solid var(--line);
}
.contact__row:last-child { border-bottom: 0; padding-bottom: 0; }
.contact__row:first-child { padding-top: 0; }

.contact__ico {
  flex: 0 0 38px;
  width: 38px; height: 38px;
  border-radius: 11px;
  background: var(--mist);
  display: flex;
  align-items: center;
  justify-content: center;
}
.contact__ico svg { width: 17px; height: 17px; stroke: var(--blue); fill: none; stroke-width: 2; }

.contact__k {
  font-size: 0.73rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
.contact__v { font-weight: 600; color: var(--navy); font-size: 0.99rem; }
.contact__v a { color: var(--navy); }

/* ---------- Footer ---------- */
.footer {
  background: var(--navy-ink);
  color: #8ba4bb;
  padding: 4rem 0 2rem;
  font-size: 0.9rem;
}

.footer__top {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 2.5rem;
  padding-bottom: 2.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.footer__logo { height: 40px; width: auto; margin-bottom: 1.1rem; }
.footer__blurb { max-width: 30ch; line-height: 1.6; }

.footer h4 {
  color: #fff;
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  margin: 0 0 1rem;
}

.footer ul { list-style: none; margin: 0; padding: 0; }
.footer li { margin-bottom: 0.6rem; }
.footer a { color: #8ba4bb; }
.footer a:hover { color: #fff; }

.footer__bottom {
  padding-top: 1.8rem;
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: space-between;
  font-size: 0.82rem;
}

/* ---------- Páginas legales ---------- */
.legal {
  padding: clamp(3rem, 6vw, 5rem) 0 clamp(4rem, 8vw, 6rem);
}

.legal__body {
  max-width: 46rem;
}

.legal__body h2 {
  font-size: 1.42rem;
  margin-top: 2.6rem;
}
.legal__body h3 { font-size: 1.05rem; margin-top: 1.8rem; }

.legal__body p,
.legal__body li { color: var(--ink-soft); font-size: 0.98rem; }

.legal__body ul { padding-left: 1.2rem; }
.legal__body li { margin-bottom: 0.5rem; }

.legal__table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
  font-size: 0.94rem;
}
.legal__table th,
.legal__table td {
  text-align: left;
  padding: 0.75rem 0.9rem;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}
.legal__table th {
  width: 32%;
  color: var(--navy);
  font-weight: 700;
}
.legal__table td { color: var(--ink-soft); }

.legal__updated {
  margin-top: 2.8rem;
  font-size: 0.85rem;
  color: var(--ink-soft);
  padding-top: 1.2rem;
  border-top: 1px solid var(--line);
}

.table-scroll { overflow-x: auto; }

/* ---------- Reveal on scroll ---------- */
.reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.65s cubic-bezier(0.2, 0.7, 0.3, 1),
              transform 0.65s cubic-bezier(0.2, 0.7, 0.3, 1);
}
.reveal.is-visible { opacity: 1; transform: none; }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .contact { grid-template-columns: 1fr; }
  .footer__top { grid-template-columns: 1fr 1fr; }
  .footer__brand { grid-column: 1 / -1; }
}

@media (max-width: 760px) {
  body { font-size: 16px; }

  .nav__toggle { display: flex; }

  .nav__links {
    position: fixed;
    inset: var(--nav-h) 0 auto 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    background: rgba(255, 255, 255, 0.97);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--line);
    padding: 0.5rem 1.25rem 1.25rem;
    box-shadow: var(--shadow-md);
    display: none;
  }
  .nav__links.is-open { display: flex; }
  .nav__links a { padding: 0.85rem 0; border-bottom: 1px solid var(--line); }
  .nav__links li:last-child a { border-bottom: 0; }
  .nav__links a::after { display: none; }

  .hero__cta .btn { flex: 1 1 100%; }
  .step::after { display: none; }
  .footer__top { grid-template-columns: 1fr; gap: 2rem; }

  .card { padding: 1.75rem 1.5rem; }
  .contact__box { padding: 1.6rem; }
}

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

@media print {
  .nav, .footer, .hero__glow { display: none; }
  body { font-size: 12pt; color: #000; }
}
