/* ==========================================================================
   FINHUB — V3 (dirección basada en obsidiangrid.com.ar, branding Finhub)
   Paleta institucional: petróleo #1b3a49 · gris #d0d1d3 · celeste #00c4bf
   ========================================================================== */

/* ---------- 1. Tokens ------------------------------------------------------ */
:root {
  /* Colores institucionales (Pantone 309C / 427C / 3252C) — NO modificar */
  --petrol:  #1b3a49;
  --gris:    #d0d1d3;
  --celeste: #00c4bf;

  /* Derivados funcionales (fondos/superficies; el logo usa los exactos) */
  --bg:       #08141b;     /* petróleo casi negro (rol del negro de OG) */
  --surface:  #0e2029;     /* cards / nav */
  --surface2: #122835;
  --ink:      #eef0f1;
  --muted:    #8da3ad;
  --line:     color-mix(in srgb, var(--gris) 12%, transparent);

  /* gradiente protagonista: celeste → gris institucionales */
  --grad: linear-gradient(94deg, var(--celeste) 8%, #7fd8d5 52%, var(--gris) 100%);

  --font-display: "Playfair Display", "Didot", serif;
  --font-body: "Roboto", system-ui, sans-serif;

  --pad: clamp(1.25rem, 5vw, 5rem);
  --radius: 18px;
  --ease: cubic-bezier(.22, .9, .28, 1);
}

/* ---------- 2. Base --------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; overflow-x: clip; }
html.lenis { scroll-behavior: auto; }

body {
  font-family: var(--font-body);
  font-weight: 300;
  font-size: 1rem;
  line-height: 1.65;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}
body.loading { overflow: hidden; }
body.menu-open { overflow: hidden; }

img, svg, canvas { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }

:focus-visible { outline: 2px solid var(--celeste); outline-offset: 3px; border-radius: 4px; }
.sr-only { position: absolute; width: 1px; height: 1px; clip-path: inset(50%); overflow: hidden; white-space: nowrap; }
::selection { background: var(--celeste); color: var(--bg); }

main { position: relative; z-index: 2; }

/* texto con gradiente institucional */
.grad-text {
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
/* SplitText divide en .char y el clip no se hereda: cada char
   recibe su propio gradiente (válido para chars sueltos como el ".") */
.grad-text .char {
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* ---------- 3. Marca / utilitarios ------------------------------------------ */
.brand-logo {
  display: inline-block;
  height: 34px;
  aspect-ratio: 400.45 / 118.38;
  -webkit-mask: url("../public/brand/finhub-logo.svg") no-repeat center / contain;
  mask: url("../public/brand/finhub-logo.svg") no-repeat center / contain;
  background-color: var(--gris);
}
.brand-logo--footer { height: 46px; }
.brand-iso {
  display: inline-block;
  aspect-ratio: 103.05 / 118.38;
  -webkit-mask: url("../public/brand/finhub-iso.svg") no-repeat center / contain;
  mask: url("../public/brand/finhub-iso.svg") no-repeat center / contain;
  background-color: var(--gris);
}
.grain {
  position: fixed; inset: 0; z-index: 90; pointer-events: none; opacity: .04;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 220px;
}

/* ---------- 4. Preloader ------------------------------------------------------ */
.loader {
  position: fixed; inset: 0; z-index: 300;
  background: var(--bg);
  display: grid; place-items: center;
  animation: loader-hide .5s ease 1.8s forwards; /* fallback sin JS */
}
.loader.is-js { animation: none; }
.loader__iso { width: 64px; animation: loader-pulse 1.2s ease-in-out infinite; }
@keyframes loader-hide { to { opacity: 0; visibility: hidden; } }
@keyframes loader-pulse { 50% { opacity: .4; } }

/* ---------- 5. Gráfico vivo de mercado --------------------------------------------- */
.market {
  position: fixed; inset: 0;
  width: 100%; height: 100%;
  z-index: 1;               /* detrás del contenido (main z-2), sobre el fondo */
  pointer-events: none;
}

/* ---------- 6. Nav píldora flotante ---------------------------------------------- */
.navwrap {
  position: fixed; inset: 0 0 auto 0; z-index: 100;
  padding: 1rem var(--pad) 0;
  display: flex; justify-content: center;
}
.nav {
  width: min(1180px, 100%);
  display: flex; align-items: center; justify-content: space-between;
  gap: 1.5rem;
  background: color-mix(in srgb, var(--surface) 78%, transparent);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: .65rem 1.4rem .65rem 1.6rem;
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
}
.nav__links { display: flex; gap: clamp(1.2rem, 2.5vw, 2.2rem); }
.nav__link {
  position: relative;
  font-size: .9rem; font-weight: 400;
  color: var(--muted);
  padding: .35rem 0;
  transition: color .3s var(--ease);
}
.nav__link:hover, .nav__link.is-active { color: var(--ink); }
.nav__link.is-active::after {
  content: "";
  position: absolute; left: 0; bottom: 0;
  width: 100%; height: 2px; border-radius: 2px;
  background: var(--grad);
}
.nav__right { display: flex; align-items: center; gap: 1rem; }
.nav__cta { padding: .62rem 1.4rem; font-size: .85rem; }
.nav__toggle {
  display: none;
  flex-direction: column; gap: 6px;
  background: none; border: 0; padding: .5rem; cursor: pointer;
}
.nav__toggle span { width: 24px; height: 1.6px; background: var(--ink); transition: transform .35s var(--ease); }
.nav__toggle[aria-expanded="true"] span:first-child { transform: translateY(3.8px) rotate(45deg); }
.nav__toggle[aria-expanded="true"] span:last-child { transform: translateY(-3.8px) rotate(-45deg); }

/* ---------- 7. Botones -------------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  font: 500 .92rem/1 var(--font-body);
  letter-spacing: .02em;
  padding: .95rem 1.9rem;
  border: 0; border-radius: 999px;
  cursor: pointer;
  transition: transform .3s var(--ease), box-shadow .3s var(--ease), filter .3s var(--ease);
}
.btn--grad {
  background: var(--grad);
  color: var(--bg);
  font-weight: 700;
}
.btn--grad:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 34px -10px color-mix(in srgb, var(--celeste) 65%, transparent);
  filter: brightness(1.06);
}
.btn--block { width: 100%; }

/* ---------- 8. Hero ------------------------------------------------------------------- */
.hero {
  position: relative;
  min-height: 100svh;
  display: flex; flex-direction: column; justify-content: center;
  padding: 7rem var(--pad) 4rem;
}
.hero__inner {
  display: grid;
  grid-template-columns: 1fr;
  gap: 3rem;
  align-items: end;
  max-width: 1340px;
  margin-inline: auto;
  width: 100%;
}
.hero__title {
  font-weight: 500;
  line-height: 1.02;
  color: #fff;
}
.hero__word-wrap { display: block; overflow: hidden; }
.hero__word {
  display: block;
  font-family: var(--font-display);
  font-size: clamp(3.4rem, 11vw, 9.8rem);
  font-weight: 600;
  padding-bottom: .08em; /* descendentes de la didona */
}
.hero__rest {
  display: block;
  font-family: var(--font-display);
  font-size: clamp(2.6rem, 7.6vw, 6.6rem);
  font-weight: 400;
  overflow: hidden;
  white-space: nowrap;
}
.hero__rest i { font-style: normal; }
.hero__aside {
  justify-self: end;
  max-width: 25rem;
  display: grid; gap: 1.6rem;
  text-align: right; justify-items: end;
}
.hero__sub { color: var(--muted); font-size: 1.02rem; }

/* indicador de scroll tipo mouse (como OG) */
.scroll-pill {
  position: absolute; left: 50%; bottom: 2.4rem;
  transform: translateX(-50%);
  width: 26px; height: 42px;
  border: 1.5px solid color-mix(in srgb, var(--celeste) 70%, transparent);
  border-radius: 999px;
  display: flex; justify-content: center;
}
.scroll-pill i {
  width: 4px; height: 8px; border-radius: 4px;
  background: var(--celeste);
  margin-top: 7px;
  animation: scroll-dot 1.6s ease-in-out infinite;
}
@keyframes scroll-dot { 50% { transform: translateY(12px); opacity: .35; } }

/* ---------- 9. Secciones / títulos ------------------------------------------------------ */
section { padding: clamp(5rem, 12vh, 8.5rem) var(--pad); }
.section-head { max-width: 1340px; margin-inline: auto; }
.section-eyebrow {
  font-size: .8rem; font-weight: 500;
  letter-spacing: .24em; text-transform: uppercase;
  color: var(--celeste);
  margin-bottom: 1.1rem;
}
.section-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(2.3rem, 5.6vw, 4.4rem);
  line-height: 1.08;
  text-align: center;
  color: #fff;
  max-width: 24ch;
  margin: 0 auto clamp(3rem, 8vh, 5rem);
}
/* variante editorial: título a la izquierda (secciones de contenido) */
.section-title--left {
  text-align: left;
  margin-inline: 0;
  max-width: 18ch;
}

/* ---------- 10. Cards --------------------------------------------------------------------- */
.cards {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.3rem;
  max-width: 1340px;
  margin-inline: auto;
}
.card {
  position: relative;
  /* glassmorphism: cuerpo petróleo translúcido + leve brillo diagonal */
  background:
    linear-gradient(135deg,
      color-mix(in srgb, #fff 7%, transparent) 0%,
      color-mix(in srgb, #fff 1%, transparent) 38%,
      transparent 70%),
    color-mix(in srgb, var(--surface) 42%, transparent);
  border: 1px solid color-mix(in srgb, var(--gris) 16%, transparent);
  border-radius: var(--radius);
  padding: 1.9rem 1.7rem;
  -webkit-backdrop-filter: blur(16px) saturate(1.4);
  backdrop-filter: blur(16px) saturate(1.4);
  /* sombra de profundidad + brillo interno en el borde superior (vidrio) */
  box-shadow:
    0 14px 36px -18px rgba(0, 0, 0, .55),
    inset 0 1px 0 color-mix(in srgb, #fff 10%, transparent);
  transition: transform .4s var(--ease), border-color .4s var(--ease),
              background .4s var(--ease), box-shadow .4s var(--ease);
}
.card:hover {
  transform: translateY(-6px);
  border-color: color-mix(in srgb, var(--celeste) 50%, transparent);
  background:
    linear-gradient(135deg,
      color-mix(in srgb, var(--celeste) 10%, transparent) 0%,
      color-mix(in srgb, #fff 2%, transparent) 42%,
      transparent 72%),
    color-mix(in srgb, var(--surface2) 52%, transparent);
  box-shadow:
    0 22px 48px -20px rgba(0, 0, 0, .6),
    0 0 26px -6px color-mix(in srgb, var(--celeste) 30%, transparent),
    inset 0 1px 0 color-mix(in srgb, #fff 14%, transparent);
}

/* en mobile bajamos el blur (costo de repintado sobre el gráfico animado) */
@media (max-width: 768px) {
  .card {
    -webkit-backdrop-filter: blur(10px) saturate(1.3);
    backdrop-filter: blur(10px) saturate(1.3);
  }
}
.card h3 {
  font-family: var(--font-body);
  font-weight: 700; font-size: 1.06rem;
  color: #fff;
  margin-bottom: .6rem;
}
.card p { color: var(--muted); font-size: .92rem; }
.card__icon {
  display: inline-grid; place-items: center;
  width: 46px; height: 46px;
  border-radius: 12px;
  background: color-mix(in srgb, var(--celeste) 10%, transparent);
  border: 1px solid color-mix(in srgb, var(--celeste) 30%, transparent);
  color: var(--celeste);
  margin-bottom: 1.2rem;
}
.card__icon svg { width: 24px; height: 24px; }
.card__link {
  display: inline-block;
  margin-top: 1.1rem;
  font-size: .88rem; font-weight: 500;
  color: var(--celeste);
  transition: letter-spacing .3s var(--ease);
}
.card__link:hover { letter-spacing: .04em; }

.card--quote { padding-top: 2.4rem; }
.card__quotemark {
  position: absolute; top: 1.1rem; left: 1.5rem;
  font-family: var(--font-display);
  font-size: 2.6rem; line-height: 1;
  color: var(--celeste);
}
.card--quote p { font-style: italic; color: var(--ink); font-size: .95rem; }
.card--quote footer { margin-top: 1.4rem; display: grid; gap: .15rem; }
.card--quote b { font-weight: 700; font-size: .92rem; color: #fff; }
.card--quote footer span { font-size: .82rem; color: var(--celeste); }

/* ---------- 11. Stats strip ------------------------------------------------------------------ */
.stats {
  display: grid; grid-template-columns: repeat(2, 1fr);
  gap: 1.3rem;
  max-width: 1340px;
  margin: clamp(3rem, 7vh, 4.5rem) auto 0;
}
.stats li {
  text-align: center;
  padding: 1.6rem 1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--surface) 55%, transparent);
}
.stats b {
  display: block;
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(2.2rem, 4.5vw, 3.4rem);
  line-height: 1;
  color: #fff;
  font-variant-numeric: tabular-nums;
  margin-bottom: .45rem;
}
.stats b i { font-style: normal; color: var(--celeste); font-size: .7em; vertical-align: .12em; }
.stats li > span { font-size: .8rem; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }

/* ---------- 12. Steps (cómo trabajamos) -------------------------------------------------------- */
.steps {
  display: grid; grid-template-columns: 1fr;
  gap: 3rem;
  max-width: 1180px;
  margin-inline: auto;
  text-align: center;
}
.step { position: relative; display: grid; justify-items: center; gap: .4rem; }
.step__ball {
  display: grid; place-items: center;
  width: 84px; height: 84px;
  border-radius: 50%;
  background: var(--grad);
  color: var(--bg);
  font: 700 1.35rem/1 var(--font-body);
  margin-bottom: 1.2rem;
  box-shadow: 0 14px 40px -14px color-mix(in srgb, var(--celeste) 55%, transparent);
}
.step h3 { font-weight: 700; font-size: 1.12rem; color: #fff; margin-bottom: .35rem; }
.step p { color: var(--muted); font-size: .92rem; max-width: 22rem; }
.step__dots { display: none; }

/* ---------- 13. CTA + contacto ------------------------------------------------------------------ */
.cta__sub {
  text-align: center;
  color: var(--muted);
  max-width: 34rem;
  margin: -2rem auto clamp(3rem, 7vh, 4.5rem);
}
.contact {
  display: grid; grid-template-columns: 1fr; gap: 2.5rem;
  max-width: 1000px; margin-inline: auto;
  align-items: start;
}
.contact__form { display: grid; gap: 1.3rem; padding: 2.2rem; }
.contact__form:hover { transform: none; }
.field { display: grid; gap: .45rem; }
.field-row { display: grid; gap: 1.3rem; }
.field label {
  font-size: .78rem; font-weight: 500;
  letter-spacing: .14em; text-transform: uppercase;
  color: var(--muted);
}
.field input, .field textarea, .field select {
  font: inherit; color: var(--ink);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: .85rem 1rem;
  width: 100%;
  transition: border-color .3s var(--ease);
}
.field input::placeholder, .field textarea::placeholder { color: color-mix(in srgb, var(--muted) 55%, transparent); }
.field input:focus, .field textarea:focus, .field select:focus { outline: none; border-color: var(--celeste); }
.field textarea { resize: vertical; min-height: 6rem; }
/* select con flecha custom (las opciones nativas las dibuja el SO) */
.field select {
  -webkit-appearance: none; appearance: none;
  cursor: pointer;
  padding-right: 2.5rem;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%238da3ad' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  background-size: 14px;
}
.form-msg { font-size: .9rem; min-height: 1.3em; color: var(--celeste); }
.form-msg.is-error { color: #e07b6a; }
.contact__data { display: grid; gap: 1rem; align-content: center; color: var(--muted); font-size: .96rem; }
.contact__data a {
  color: var(--ink);
  border-bottom: 1px solid color-mix(in srgb, var(--celeste) 45%, transparent);
  transition: color .3s var(--ease);
}
.contact__data a:hover { color: var(--celeste); }
/* variante sin aside: el formulario ocupa todo el ancho (página Sé Partner) */
.contact.contact--wide { grid-template-columns: 1fr; max-width: 900px; }

/* ---------- 13b. Sé Partner: bloque "qué es" ------------------------------------------------------ */
/* es la primera sección de la página (sin hero): despeja la nav flotante */
.partner-intro { padding-top: clamp(8.5rem, 18vh, 12rem); }
.partner-intro__grid {
  max-width: 1340px; margin-inline: auto;
  display: grid; grid-template-columns: 1fr; gap: 2rem;
}
.partner-intro__head .section-title { margin-bottom: 0; }
.partner-intro__body { display: grid; gap: 1.3rem; }
.partner-intro__body p { color: var(--muted); }
.partner-intro__body p.partner-intro__lead {
  font-size: clamp(1.12rem, 1.7vw, 1.42rem);
  line-height: 1.5;
  color: var(--ink);
}
@media (min-width: 900px) {
  .partner-intro__grid {
    grid-template-columns: 1fr 1fr;
    gap: clamp(2.5rem, 5vw, 5rem);
    align-items: start;
  }
}

/* ---------- 14. Footer ---------------------------------------------------------------------------- */
.footer {
  position: relative; z-index: 2;
  background: color-mix(in srgb, var(--surface) 55%, var(--bg));
  border-top: 1px solid var(--line);
  padding: clamp(3rem, 7vh, 4.5rem) var(--pad) 1.6rem;
}
.footer__grid {
  display: grid; grid-template-columns: 1fr;
  gap: 2.4rem;
  max-width: 1340px; margin-inline: auto;
}
.footer__brandcol { display: grid; gap: 1rem; justify-items: start; }
.footer__brandcol p { color: var(--muted); font-size: .94rem; }
.footer__alliance { font-size: .85rem !important; }
.footer__col h3 {
  font-family: var(--font-body); font-weight: 700;
  font-size: .95rem; color: #fff;
  margin-bottom: 1rem;
}
.footer__col ul { display: grid; gap: .6rem; }
.footer__col li, .footer__col a { font-size: .92rem; color: var(--muted); }
.footer__col a { transition: color .3s var(--ease); }
.footer__col a:hover { color: var(--celeste); }
.footer__col sup { color: var(--celeste); font-size: .68em; }
.footer__cardlet { display: grid; gap: 1rem; justify-items: start; padding: 1.4rem; }
.footer__cardlet p { color: var(--ink); font-size: .94rem; }
.footer__legal {
  display: flex; flex-wrap: wrap; gap: .6rem 2rem; justify-content: space-between;
  max-width: 1340px; margin: 2.6rem auto 0;
  padding-top: 1.4rem;
  border-top: 1px solid var(--line);
  font-size: .8rem; color: var(--muted);
}

/* ---------- 15. Responsive --------------------------------------------------------------------------- */
@media (min-width: 700px) {
  .field-row { grid-template-columns: 1fr 1fr; }
  .cards--3 { grid-template-columns: repeat(3, 1fr); }
  .cards--4 { grid-template-columns: repeat(2, 1fr); }
  .stats { grid-template-columns: repeat(4, 1fr); }
  .contact { grid-template-columns: 7fr 5fr; }
  .footer__grid { grid-template-columns: 1.3fr 1fr 1fr 1.1fr; }
  .hero__inner { grid-template-columns: minmax(0, 1.6fr) minmax(260px, 1fr); }

  /* conectores de puntos entre pasos */
  .steps { grid-template-columns: repeat(3, 1fr); gap: 2rem; }
  .step__dots {
    display: flex; gap: 7px;
    position: absolute; top: 38px; left: calc(100% - 1.4rem);
    transform: translateX(-50%);
  }
  .step__dots i {
    width: 7px; height: 7px; border-radius: 50%;
    background: var(--celeste);
    opacity: .8;
  }
  .step__dots i:nth-child(2) { opacity: .5; }
  .step__dots i:nth-child(3) { opacity: .25; }
}
@media (min-width: 1080px) {
  .cards--4 { grid-template-columns: repeat(4, 1fr); }
}

@media (max-width: 699.98px) {
  .nav__links {
    position: fixed; inset: 0; z-index: -1;
    flex-direction: column; align-items: center; justify-content: center;
    gap: 2rem;
    background: color-mix(in srgb, var(--bg) 96%, transparent);
    -webkit-backdrop-filter: blur(18px);
    backdrop-filter: blur(18px);
    opacity: 0; visibility: hidden;
    transition: opacity .4s var(--ease), visibility 0s .4s;
  }
  .nav__links.is-open { opacity: 1; visibility: visible; transition: opacity .4s var(--ease); z-index: -1; }
  .nav__link { font-size: 1.5rem; font-family: var(--font-display); }
  .nav__toggle { display: flex; }
  .nav__cta { display: none; }
  .hero__aside { text-align: left; justify-items: start; justify-self: start; }
  .hero__rest { white-space: normal; }
}

/* enlace a Nasini en la línea de alianza del footer */
.footer__alliance a {
  color: var(--ink);
  border-bottom: 1px solid color-mix(in srgb, var(--celeste) 45%, transparent);
  transition: color .3s var(--ease);
}
.footer__alliance a:hover { color: var(--celeste); }

/* ==========================================================================
   FIX descendentes recortados (g, q, p, y, j) en los títulos
   Los contenedores que enmascaran el reveal usan overflow (hero) / clip
   (SplitText .line-mask) ajustado a la caja de texto, lo que corta la cola
   de las letras. Les damos aire abajo y lo compensamos con margen negativo
   para conservar el interlineado original.
   ========================================================================== */
.hero__word-wrap,
.hero__rest {
  padding-bottom: .16em;
  margin-bottom: -.16em;
}
[data-split-lines] .line-mask {
  padding-bottom: .18em;
  margin-bottom: -.18em;
}

/* ---------- 16. Reduced motion -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-delay: 0ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
  .loader { display: none; }
  .market { display: none; }
  .scroll-pill i { animation: none; }
}
