/* VelGuard landing. Tokens first; components use tokens only. */

@font-face {
  font-family: "Manrope";
  src: url("/assets/fonts/manrope-latin-wght.woff2") format("woff2");
  font-weight: 200 800;
  font-style: normal;
  font-display: swap;
}

:root {
  /* Colour (approved palette) */
  --ink: #1c1a4a;
  --ink-2: #2a2670;
  --primary: #4042a1;
  --primary-hover: #31338e;
  --accent: #14c8b4;
  --accent-ink: #0e7c80;
  --violet: #6759b2;
  --ok: #1e7a33;
  --ok-dot: #35ae49;
  --ok-bg: #eaf6ec;
  --bg: #ffffff;
  --surface: #f6f6fa;
  --line: #e3e3ee;
  --muted: #5a5a78;
  --on-dark: #ffffff;
  --on-dark-muted: #c9c8e6;

  /* Type */
  --font: "Manrope", system-ui, -apple-system, "Segoe UI", sans-serif;
  --step--1: 0.875rem;
  --step-0: 1.0625rem;
  --step-1: 1.25rem;
  --step-2: clamp(1.375rem, 1.2rem + 0.8vw, 1.75rem);
  --step-3: clamp(1.875rem, 1.35rem + 2.2vw, 3rem);
  --step-4: clamp(2.375rem, 1.7rem + 2.9vw, 4rem);
  --track-tight: -0.035em;
  --track-head: -0.025em;
  --measure: 65ch;

  /* Space (4px base) */
  --s1: 0.25rem;
  --s2: 0.5rem;
  --s3: 0.75rem;
  --s4: 1rem;
  --s5: 1.5rem;
  --s6: 2rem;
  --s7: 3rem;
  --s8: 4.5rem;
  --s9: 7rem;
  --gutter: 1rem;
  --section: var(--s8);

  /* Shape and motion */
  --radius: 10px;
  --radius-lg: 16px;
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  --dur: 600ms;
  --dur-fast: 200ms;
}

@media (min-width: 640px) {
  :root { --gutter: 1.5rem; }
}
@media (min-width: 1024px) {
  :root { --gutter: 2.5rem; --section: var(--s9); }
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 5rem; }
body {
  font-family: var(--font);
  font-size: var(--step-0);
  line-height: 1.6;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img, svg { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
h1, h2, h3 { line-height: 1.08; letter-spacing: var(--track-head); font-weight: 700; text-wrap: balance; }
h1 { font-size: var(--step-4); letter-spacing: var(--track-tight); }
h2 { font-size: var(--step-3); }
h3 { font-size: var(--step-2); }
p { max-width: var(--measure); text-wrap: pretty; }
ul { padding: 0; list-style: none; }
address { font-style: normal; }

:focus-visible { outline: 2px solid var(--primary); outline-offset: 3px; border-radius: 4px; }
.section--dark :focus-visible { outline-color: var(--accent); }

.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;
}
.skip {
  position: absolute; left: var(--s4); top: -100px; z-index: 100;
  background: var(--ink); color: var(--on-dark); padding: var(--s3) var(--s4);
  border-radius: var(--radius); text-decoration: none; font-weight: 600;
}
.skip:focus { top: var(--s4); }

.container { width: 100%; max-width: 1200px; margin-inline: auto; padding-inline: var(--gutter); }
.section { padding-block: var(--section); }
.section--dark { background: var(--ink); color: var(--on-dark); }

.eyebrow {
  font-size: var(--step--1); font-weight: 700; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--accent-ink); margin-bottom: var(--s4);
}
.section--dark .eyebrow { color: var(--accent); }
.lead { font-size: var(--step-1); line-height: 1.55; color: var(--muted); }
.sub { color: var(--muted); margin-top: var(--s4); }

/* ---------- Links and buttons ---------- */
.link { position: relative; display: inline-block; text-decoration: none; font-weight: 600; }
.link::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -2px; height: 1px;
  background: currentColor; transform: scaleX(0); transform-origin: left;
  transition: transform 300ms var(--ease);
}
.link:hover::after, .link:focus-visible::after { transform: scaleX(1); }
.link--strong { color: var(--primary); }
.arrow { display: inline-block; margin-left: 0.3em; transition: transform var(--dur-fast) var(--ease); }
a:hover .arrow, a:focus-visible .arrow { transform: translateX(3px); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5em;
  min-height: 48px; padding: 0.8rem 1.5rem; border-radius: var(--radius);
  background: var(--primary); color: #fff; font-weight: 700; font-size: var(--step-0);
  text-decoration: none; transition: background-color var(--dur-fast) var(--ease);
}
.btn:hover { background: var(--primary-hover); }
.btn .arrow { margin-left: 0; }
.btn--invert { background: #fff; color: var(--ink); }
.btn--invert:hover { background: var(--on-dark-muted); }

.badge {
  display: inline-flex; align-items: center; gap: 0.45em; font-size: 0.8125rem; font-weight: 700;
  padding: 0.2rem 0.65rem; border-radius: 999px; background: var(--line); color: var(--muted);
}
.badge--ok { background: var(--ok-bg); color: var(--ok); }
.dot { width: 6px; height: 6px; border-radius: 50%; background: var(--ok-dot); }

/* ---------- Navigation ---------- */
.nav { position: sticky; top: 0; z-index: 50; }
/* Solid layer fades in on scroll (opacity only). */
.nav::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: var(--bg); border-bottom: 1px solid var(--line);
  opacity: 0; transition: opacity 300ms var(--ease);
}
.nav.is-solid::before { opacity: 1; }
@supports (animation-timeline: scroll()) {
  .nav::before { transition: none; animation: nav-solid linear both; animation-timeline: scroll(root); animation-range: 0 64px; }
}
@keyframes nav-solid { from { opacity: 0; } to { opacity: 1; } }
.nav-sentinel { position: absolute; top: 64px; height: 1px; width: 1px; }

.nav__inner { display: flex; align-items: center; justify-content: space-between; min-height: 4.25rem; }
.brand { display: inline-flex; align-items: center; gap: 0.6rem; text-decoration: none; font-weight: 700; font-size: 1.25rem; letter-spacing: -0.02em; }
.brand img { width: 34px; height: auto; }
.nav__links { display: none; gap: var(--s6); font-size: 0.9375rem; }
.nav__links .link { font-weight: 600; color: var(--ink); }
/* Existing customers: a plain link, set apart from the section anchors */
.nav__links .nav__login { padding-left: var(--s6); border-left: 1px solid var(--line); }
.nav__links .nav__login::after { left: var(--s6); }

.nav__menu { position: relative; }
.nav__menu summary {
  list-style: none; cursor: pointer; font-weight: 700; font-size: 0.9375rem;
  padding: 0.6rem 0.9rem; border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg);
}
.nav__menu summary::-webkit-details-marker { display: none; }
.nav__menu nav {
  position: absolute; right: 0; top: calc(100% + 8px); min-width: 14rem;
  background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius-lg);
  padding: var(--s2); display: grid;
}
.nav__menu nav a { padding: 0.75rem 0.9rem; border-radius: 8px; text-decoration: none; font-weight: 600; }
.nav__menu nav a:hover { background: var(--surface); }
.nav__menu nav .nav__menu-login { margin-top: var(--s2); border-top: 1px solid var(--line); border-radius: 0 0 8px 8px; }

@media (min-width: 900px) {
  .nav__links { display: flex; }
  .nav__menu { display: none; }
}

/* ---------- Hero ---------- */
.hero { padding-block: var(--s6) var(--section); }
.hero__grid { display: grid; gap: var(--s7); align-items: center; }
.hero h1 { max-width: 15ch; }
.hero .lead { margin-top: var(--s5); max-width: 46ch; }
.hero__cta { margin-top: var(--s6); }
/* Secondary contact under each demo button: mailto link + "Copiar correo" */
.alt-contact { margin-top: var(--s3); font-size: var(--step--1); color: var(--muted); line-height: 1.7; }
.alt-contact .link { color: var(--ink); }
.copy-btn {
  font: inherit; font-weight: 700; color: var(--primary); background: none; border: 0;
  padding: 0.25rem 0.1rem; cursor: pointer;
  text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px;
}
.copy-btn:hover { color: var(--primary-hover); }
.copy-status { margin-left: 0.35rem; font-weight: 700; color: var(--ok); }

@media (max-width: 639px) {
  .hero__cta .btn { display: flex; width: 100%; }
}
@media (min-width: 1024px) {
  .hero { padding-top: var(--s8); }
  .hero__grid { grid-template-columns: 6fr 5fr; gap: var(--s8); }
}

/* Screenshot frame */
.shot { border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); overflow: hidden; }
.shot__bar {
  display: flex; align-items: center; height: 2.25rem; padding-inline: var(--s4);
  border-bottom: 1px solid var(--line); background: var(--bg); font-size: 0.75rem; color: var(--muted);
}
.shot__body { aspect-ratio: 16 / 10; display: grid; place-items: center; padding: var(--s5); }
.shot__body--img { padding: 0; display: block; }
.shot__body--img img { width: 100%; height: 100%; object-fit: cover; object-position: top left; }
.shot__todo {
  text-align: center; font-weight: 600; color: var(--muted); font-size: var(--step--1);
  border: 1px dashed #c9c8dc; border-radius: var(--radius); padding: var(--s5);
}
.shot__todo small { font-weight: 500; }

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

/* ---------- Problem and solution: editorial pairs ---------- */
.split { display: grid; gap: var(--s7); }
.split__head h2 { max-width: 16ch; }
.pairs { list-style: none; padding: 0; counter-reset: pair; display: grid; }
.pair {
  counter-increment: pair; display: grid; grid-template-columns: 2.5rem 1fr; column-gap: var(--s4);
  padding-block: var(--s5); border-top: 1px solid var(--line);
}
.pair:last-child { border-bottom: 1px solid var(--line); }
.pair::before {
  content: counter(pair, decimal-leading-zero); grid-row: span 2;
  font-weight: 700; font-size: var(--step--1); color: var(--accent-ink); padding-top: 0.2rem;
}
.pair__problem { font-weight: 700; font-size: var(--step-1); line-height: 1.35; letter-spacing: -0.01em; }
.pair__solution { color: var(--muted); margin-top: var(--s2); }
@media (min-width: 1024px) {
  .split { grid-template-columns: 5fr 7fr; gap: var(--s8); align-items: start; }
}

/* ---------- How it works: steps light up in sequence ---------- */
.steps__head { max-width: 40rem; }
.steps { list-style: none; padding: 0; display: grid; gap: var(--s6); margin-top: var(--s7); }
.step { display: grid; gap: var(--s3); align-content: start; }
.step__bar { position: relative; display: block; height: 2px; background: var(--line); margin-bottom: var(--s3); overflow: hidden; }
.step__bar::after {
  content: ""; position: absolute; inset: 0; background: var(--violet);
  transform-origin: left;
}
.step__n { font-size: var(--step--1); font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--violet); }
.step h3 { font-size: var(--step-1); letter-spacing: -0.015em; line-height: 1.25; }
.step p { color: var(--muted); }
.steps__note { margin-top: var(--s7); color: var(--muted); font-size: 0.9375rem; padding-left: var(--s4); border-left: 2px solid var(--line); }
@media (min-width: 768px) {
  .steps { grid-template-columns: repeat(3, 1fr); gap: var(--s6); }
}

/* ---------- Audience blocks (schools, families) ---------- */
.audience { display: grid; gap: var(--s7); align-items: center; }
.audience h2 { max-width: 18ch; }
.ticks { margin-block: var(--s6); display: grid; gap: var(--s3); }
.ticks li { position: relative; padding-left: 1.75rem; max-width: 52ch; }
.ticks li::before {
  content: ""; position: absolute; left: 0.1rem; top: 0.55em; width: 0.75rem; height: 0.375rem;
  border-left: 2px solid var(--accent-ink); border-bottom: 2px solid var(--accent-ink); transform: rotate(-45deg);
}
.audience__shot { background: var(--bg); }
.section--surface .audience__shot .shot__body { background: var(--surface); }
@media (min-width: 1024px) {
  .audience { grid-template-columns: 5fr 6fr; gap: var(--s8); }
  .audience--flip .audience__copy { order: 2; }
  .audience--flip { grid-template-columns: 6fr 5fr; }
}

/* ---------- Final CTA ---------- */
.final { border-top: 1px solid var(--line); }
.final__inner { display: grid; justify-items: start; gap: var(--s5); }
.final h2 { max-width: 18ch; }
.final .sub { margin-top: 0; }
.final__cta { display: grid; justify-items: start; }
@media (max-width: 639px) {
  .final .btn { display: flex; width: 100%; }
  .final__inner, .final__cta { justify-items: stretch; }
}
@media (min-width: 1024px) {
  .final__inner { grid-template-columns: 1fr auto; align-items: end; column-gap: var(--s8); }
  .final h2, .final .sub { grid-column: 1; }
  .final__cta { grid-column: 2; grid-row: 1 / span 2; align-self: center; }
}

/* ---------- Privacy (dark) ---------- */
.privacy { display: grid; gap: var(--s7); }
.privacy__head h2 { max-width: 12ch; }
.checks { display: grid; gap: var(--s5); }
.checks li {
  padding-left: 1.75rem; position: relative; color: var(--on-dark-muted); max-width: 58ch;
}
.checks li::before {
  content: ""; position: absolute; left: 0; top: 0.55em; width: 0.75rem; height: 0.375rem;
  border-left: 2px solid var(--accent); border-bottom: 2px solid var(--accent); transform: rotate(-45deg);
}
.checks a { color: var(--on-dark); }
.doclinks { display: flex; flex-wrap: wrap; gap: var(--s3) var(--s6); margin-top: var(--s7); padding-top: var(--s5); border-top: 1px solid var(--ink-2); }
.doclinks a { color: var(--on-dark); }

@media (min-width: 1024px) {
  .privacy { grid-template-columns: 5fr 6fr; gap: var(--s8); }
}

/* ---------- Products ---------- */
.products { display: grid; gap: var(--s5); }
.products__head { margin-bottom: var(--s5); }
.product { border-top: 1px solid var(--line); padding-top: var(--s5); }
.product h3 { margin-top: var(--s3); }
.product p { color: var(--muted); margin-top: var(--s2); }
.product > .link { margin-top: var(--s4); }
.product--main {
  border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface);
  padding: var(--s6); display: grid; gap: var(--s5); align-items: end;
}
.product--main h3 { font-size: var(--step-3); }
.product--main p { color: var(--ink); font-size: var(--step-1); }
.product-soon { display: grid; gap: var(--s5); margin-top: var(--s4); }

@media (min-width: 768px) {
  .product--main { grid-template-columns: 1fr auto; padding: var(--s7); }
  .product-soon { grid-template-columns: 1fr 1fr; gap: var(--s6); }
}
@media (min-width: 1024px) {
  .products { grid-template-columns: 4fr 8fr; column-gap: var(--s8); }
  .products__head { grid-row: span 2; }
}

/* ---------- Footer ---------- */
.footer { border-top: 1px solid var(--line); background: var(--surface); padding-top: var(--s7); font-size: 0.9375rem; }
.footer__grid { display: grid; gap: var(--s6); }
.footer__company { color: var(--muted); line-height: 1.8; }
.footer__company strong { color: var(--ink); }
.footer__company a { color: var(--ink); }
.footer__legal { display: grid; gap: var(--s3); align-content: start; }
.footer__base { padding-bottom: var(--s6); margin-top: var(--s7); color: var(--muted); font-size: var(--step--1); }
.footer__base p { max-width: none; padding-top: var(--s6); border-top: 1px solid var(--line); }
@media (min-width: 768px) {
  .footer__grid { grid-template-columns: 1fr 1.4fr 1fr; }
}

/* ---------- Motion (transform and opacity only) ---------- */
@media (prefers-reduced-motion: no-preference) {
  /* Hero: staggered entrance on load */
  .enter { animation: enter var(--dur) var(--ease) both; }
  .e1 { animation-delay: 60ms; }
  .e2 { animation-delay: 140ms; }
  .e3 { animation-delay: 220ms; }
  .e4 { animation-delay: 300ms; }

  /* Scroll reveal: hidden only when JS is running; once per element */
  .js [data-reveal] { opacity: 0; transform: translateY(16px); transition: opacity var(--dur) var(--ease), transform var(--dur) var(--ease); }
  .js [data-reveal].is-in { opacity: 1; transform: none; }
  .js [data-reveal].d1 { transition-delay: 90ms; }
  .js [data-reveal].d2 { transition-delay: 180ms; }
  .js [data-reveal].d3 { transition-delay: 270ms; }

  /* Steps: bars fill and labels light up one after another (once) */
  .js [data-steps] .step__bar::after { transform: scaleX(0); }
  .js [data-steps] .step__n { opacity: 0.4; }
  .js [data-steps].is-playing .step__bar::after { animation: fill 600ms var(--ease) forwards; }
  .js [data-steps].is-playing .step__n { animation: light 400ms var(--ease) forwards; }
  .js [data-steps].is-playing .step:nth-child(2) .step__bar::after,
  .js [data-steps].is-playing .step:nth-child(2) .step__n { animation-delay: 550ms; }
  .js [data-steps].is-playing .step:nth-child(3) .step__bar::after,
  .js [data-steps].is-playing .step:nth-child(3) .step__n { animation-delay: 1100ms; }

  /* Very light parallax on the hero screenshot, only with native scroll timelines */
  @supports (animation-timeline: view()) {
    /* The whole frame drifts (translate property), so the screenshot is never cropped;
       it composes with the entrance animation, which uses transform. */
    .hero__shot {
      animation: enter var(--dur) var(--ease) 220ms both, drift linear both;
      animation-timeline: auto, view();
      animation-range: normal, cover 0% cover 100%;
    }
  }
}
@keyframes enter { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
@keyframes fill { to { transform: scaleX(1); } }
@keyframes light { to { opacity: 1; } }
@keyframes drift { from { translate: 0 -8px; } to { translate: 0 8px; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .nav::before { opacity: 1; }
}
