/* ============================================================
   Traser Subvenciones — Design tokens
   ============================================================ */
:root {
  --navy: #1B3A8A;
  --navy-deep: #12285E;
  --navy-2: #2F55C4;
  --navy-bright: #4C7BFF;
  --gold: #C89B3C;
  --gold-ink: #8C6A1D;
  --gold-light: #E4C878;
  --paper: #F7F8FA;
  --paper-alt: #EEF1F5;
  --white: #FFFFFF;
  --ink: #12203A;
  --slate: #3C4658;
  --muted: #6B7686;
  --line: #E2E6EC;
  --line-dark: rgba(255,255,255,.16);

  --font-display: 'Space Grotesk', ui-sans-serif, system-ui, sans-serif;
  --font-body: 'Inter', ui-sans-serif, system-ui, sans-serif;
  --font-mono: 'IBM Plex Mono', ui-monospace, 'SFMono-Regular', monospace;

  --radius-sm: 6px;
  --radius-md: 12px;
  --shadow-card: 0 24px 48px -28px rgba(27,58,138,.28), 0 2px 10px -4px rgba(27,58,138,.10);
  --shadow-card-hover: 0 30px 60px -24px rgba(27,58,138,.32), 0 4px 14px -4px rgba(27,58,138,.14);

  --ease: cubic-bezier(.16,1,.3,1);
  --ease-spring: cubic-bezier(.34,1.56,.64,1);
  --dur-md: .7s;
  --dur-lg: 1s;

  --wrap: 1180px;
}

/* ============================================================
   Reset
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}
body, h1, h2, h3, p, figure, blockquote, ul, ol, dl { margin: 0; }
ul { padding: 0; list-style: none; }
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
input, textarea { font: inherit; color: inherit; }

body {
  font-family: var(--font-body);
  color: var(--slate);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  line-height: 1.6;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--navy);
  color: var(--white);
  padding: .75rem 1.25rem;
  z-index: 200;
  border-radius: 0 0 var(--radius-sm) 0;
}
.skip-link:focus {
  left: 0;
}

:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
}

.wrap {
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: 1.5rem;
}
.wrap-narrow { max-width: 760px; }
.center { text-align: center; }

h1, h2, h3 {
  font-family: var(--font-display);
  color: var(--navy);
  letter-spacing: -0.01em;
  line-height: 1.08;
}

.section { padding-block: clamp(4.5rem, 8vw, 7.5rem); }

.section-index {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.1rem;
  height: 2.1rem;
  padding-inline: .35rem;
  border: 1.5px solid var(--gold-ink);
  border-radius: 4px;
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: .85rem;
  letter-spacing: .02em;
  color: var(--gold-ink);
  margin-bottom: 1.25rem;
}
/* Dark-background sections (KPI band) need the lighter gold for contrast */
.kpis .section-index {
  color: var(--gold-light);
  border-color: var(--gold-light);
}

.section-head { max-width: 640px; margin-bottom: clamp(2.5rem, 5vw, 4rem); }
.section-head h2 { font-size: clamp(1.9rem, 3.4vw, 2.75rem); font-weight: 600; }
.section-sub { margin-top: .9rem; font-size: 1.05rem; color: var(--muted); max-width: 46ch; }

/* ============================================================
   Buttons
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  padding: .9rem 1.7rem;
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-weight: 600;
  font-size: .95rem;
  transition: transform .25s var(--ease), box-shadow .25s var(--ease), background .25s var(--ease), color .25s var(--ease);
  white-space: nowrap;
}
.btn-solid {
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-2) 100%);
  color: var(--white);
  box-shadow: 0 12px 24px -12px rgba(27,58,138,.5);
}
.btn-solid:hover {
  transform: scale(1.03);
  box-shadow: 0 16px 30px -12px rgba(27,58,138,.55);
  background: linear-gradient(135deg, var(--navy-2) 0%, var(--navy-bright) 100%);
}
.btn-ghost {
  background: transparent;
  color: var(--navy);
  border: 1.5px solid var(--line);
}
.btn-ghost:hover { border-color: var(--navy); transform: scale(1.03); }
.btn-sm { padding: .6rem 1.25rem; font-size: .85rem; }
.btn-full { width: 100%; }

/* ============================================================
   Header
   ============================================================ */
.site-header {
  position: fixed;
  inset-inline: 0;
  top: 0;
  z-index: 100;
  background: transparent;
  transition: background .4s var(--ease), box-shadow .4s var(--ease), border-color .4s var(--ease);
  border-bottom: 1px solid transparent;
}
.site-header.is-scrolled {
  background: rgba(247,248,250,.92);
  backdrop-filter: blur(10px);
  border-bottom-color: var(--line);
  box-shadow: 0 6px 24px -18px rgba(27,58,138,.3);
}
.header-inner {
  display: flex;
  align-items: center;
  gap: 2rem;
  height: 76px;
}
.logo {
  display: inline-flex;
  align-items: center;
  margin-right: auto;
}
.logo-img { height: 51px; width: auto; display: block; }

.main-nav { display: flex; gap: 1.9rem; }
.main-nav a {
  font-size: .92rem;
  font-weight: 500;
  color: var(--slate);
  position: relative;
  padding-block: .3rem;
  transition: color .3s var(--ease);
}

.main-nav a::after {
  content: "";
  position: absolute;
  left: 0; right: 100%;
  bottom: 0;
  height: 1.5px;
  background: var(--gold-ink);
  transition: right .3s var(--ease);
}
.main-nav a:hover { color: var(--gold-ink); }
.main-nav a:hover::after { right: 0; }

.header-cta { flex-shrink: 0; }

.nav-toggle { display: none; flex-direction: column; gap: 5px; width: 28px; padding: .5rem 0; }
.nav-toggle span { display: block; height: 2px; width: 100%; background: var(--navy); transition: transform .3s var(--ease), opacity .3s var(--ease); }
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.mobile-nav {
  display: none;
  flex-direction: column;
  gap: .25rem;
  background: var(--white);
  border-top: 1px solid var(--line);
  padding: 1rem 1.5rem 1.5rem;
}
.mobile-nav a:not(.btn) { padding: .7rem 0; font-weight: 500; color: var(--slate); border-bottom: 1px solid var(--line); }
.mobile-nav .btn { margin-top: .9rem; }
.mobile-nav.is-open { display: flex; }

/* ============================================================
   Hero
   ============================================================ */
.hero {
  position: relative;
  min-height: 100svh;
  display: flex;
  align-items: center;
  padding-top: 76px;
  background: var(--white);
  overflow: clip;
}
.hero-particles {
  position: absolute;
  inset: 0;
  z-index: 0;
}
.hero-particles canvas { display: block; }
.hero-inner {
  max-width: 46rem;
  align-items: center;
  padding-block: 3rem 5rem;
  position: relative;
  z-index: 1;
  pointer-events: none;
}
.hero-inner a, .hero-inner button { pointer-events: auto; }
.eyebrow {
  font-family: var(--font-mono);
  font-size: .78rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--gold-ink);
  margin-bottom: 1.5rem;
}
.hero h1 {
  font-size: clamp(2.75rem, 6vw, 5rem);
  font-weight: 700;
  color: var(--navy);
  display: flex;
  flex-direction: column;
}
.hero-sub {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(1.25rem, 2vw, 1.6rem);
  color: var(--gold-ink);
  margin-top: 1.3rem;
}
.hero-desc {
  color: var(--slate);
  font-size: 1.08rem;
  max-width: 46ch;
  margin-top: 1.1rem;
}
.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 2.4rem;
}

/* ============================================================
   Scroll reveal utilities
   ============================================================ */
[data-reveal], [data-reveal-stagger], [data-reveal-zoom], [data-reveal-words],
[data-reveal-slide-left], [data-reveal-slide-right], [data-reveal-spring] {
  opacity: 0;
}
.is-visible[data-reveal] {
  animation: reveal-up var(--dur-md) var(--ease) forwards;
}
.is-visible[data-reveal-stagger] {
  animation: reveal-up var(--dur-md) var(--ease) forwards;
  animation-delay: var(--stagger-delay, 0ms);
}
.is-visible[data-reveal-zoom] {
  animation: reveal-zoom 1.1s var(--ease) forwards;
}
.is-visible[data-reveal-spring] {
  animation: reveal-spring .9s var(--ease-spring) forwards;
}
.is-visible[data-reveal-slide-left] {
  animation: reveal-slide-left var(--dur-lg) var(--ease) forwards;
}
.is-visible[data-reveal-slide-right] {
  animation: reveal-slide-right var(--dur-lg) var(--ease) forwards;
}
.is-visible[data-reveal-words] {
  opacity: 1;
}

@keyframes reveal-up {
  from { opacity: 0; transform: translateY(28px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes reveal-zoom {
  from { opacity: 0; transform: scale(.98); }
  to   { opacity: 1; transform: scale(1); }
}
@keyframes reveal-spring {
  from { opacity: 0; transform: translateY(18px) scale(.96); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes reveal-slide-left {
  from { opacity: 0; transform: translateX(-40px); }
  to   { opacity: 1; transform: translateX(0); }
}
@keyframes reveal-slide-right {
  from { opacity: 0; transform: translateX(40px); }
  to   { opacity: 1; transform: translateX(0); }
}

.word-wrap span {
  display: inline-block;
  opacity: 0;
  filter: blur(4px);
  transform: translateY(10px);
}
.is-visible .word-wrap span {
  animation: word-reveal .7s var(--ease) forwards;
  animation-delay: calc(var(--i) * 55ms);
}
@keyframes word-reveal {
  to { opacity: 1; filter: blur(0); transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
  [data-reveal], [data-reveal-stagger], [data-reveal-zoom], [data-reveal-words],
  [data-reveal-slide-left], [data-reveal-slide-right], [data-reveal-spring],
  .word-wrap span {
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
    filter: none !important;
  }
}

/* ============================================================
   Misión
   ============================================================ */
.mision { background: var(--paper); }
.statement {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(1.5rem, 3vw, 2rem);
  line-height: 1.42;
  color: var(--navy);
  max-width: 42ch;
  margin-inline: auto;
}
.statement-lg { font-size: clamp(1.9rem, 3.6vw, 2.75rem); font-weight: 600; max-width: 20ch; }

/* ============================================================
   KPIs
   ============================================================ */
.kpis {
  background: linear-gradient(150deg, var(--navy-2) 0%, var(--navy) 55%, var(--navy-deep) 100%);
  color: var(--white);
}
.kpi-head { max-width: 640px; margin-bottom: 3.5rem; }
.kpi-head h2 { color: var(--white); font-size: clamp(1.9rem, 3.4vw, 2.75rem); font-weight: 600; }
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: var(--line-dark);
  border: 1px solid var(--line-dark);
  border-radius: var(--radius-md);
  overflow: hidden;
}
.kpi-card {
  background: var(--navy-2);
  padding: 2.5rem 1.75rem;
  display: flex;
  flex-direction: column;
  gap: .9rem;
}
.kpi-icon { width: 26px; height: 26px; color: var(--gold); }
.kpi-number {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(2.1rem, 4vw, 3rem);
  color: var(--white);
  font-variant-numeric: tabular-nums;
}
.kpi-label { font-size: .9rem; color: rgba(255,255,255,.65); }

/* ============================================================
   Servicios
   ============================================================ */
.service-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.75rem;
}
.service-card {
  background: var(--white);
  border-radius: var(--radius-md);
  padding: 2.75rem;
  box-shadow: var(--shadow-card);
  transition: box-shadow .35s var(--ease), transform .35s var(--ease);
}
.service-card:hover { box-shadow: var(--shadow-card-hover); transform: translateY(-3px); }
.service-icon { width: 30px; height: 30px; color: var(--gold-ink); margin-bottom: 1.5rem; }
.service-card h3 { font-size: 1.4rem; font-weight: 600; margin-bottom: 1.2rem; }
.service-card ul { display: flex; flex-direction: column; gap: .65rem; margin-bottom: 1.4rem; }
.service-card li {
  padding-left: 1.2rem;
  position: relative;
  font-size: .96rem;
  color: var(--slate);
}
.service-card li::before {
  content: "";
  position: absolute; left: 0; top: .6em;
  width: 6px; height: 1px;
  background: var(--gold);
}
.service-lines {
  font-family: var(--font-mono);
  font-size: .74rem;
  letter-spacing: .04em;
  color: var(--muted);
  padding-top: 1.1rem;
  border-top: 1px solid var(--line);
  margin-bottom: 1.4rem;
}
.link-cta { font-weight: 600; color: var(--navy); font-size: .92rem; transition: gap .25s var(--ease), color .25s; display: inline-block; }
.link-cta:hover { color: var(--gold-ink); }

/* ============================================================
   Objetivo
   ============================================================ */
.objetivo { background: var(--paper-alt); }

/* ============================================================
   Método / timeline
   ============================================================ */
.timeline {
  position: relative;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2.5rem;
  padding-top: 2.5rem;
}
.timeline-line {
  position: absolute;
  top: 0;
  left: 0; right: 0;
  height: 4px;
  width: 100%;
  overflow: visible;
}
.timeline-line path {
  stroke: var(--gold);
  stroke-width: 2;
  fill: none;
  stroke-dasharray: 100;
  stroke-dashoffset: 100;
  transition: stroke-dashoffset 1.4s var(--ease);
}
.timeline.is-drawn .timeline-line path { stroke-dashoffset: 0; }
@media (prefers-reduced-motion: reduce) {
  .timeline-line path { transition: none; stroke-dashoffset: 0; }
}
.timeline-step { position: relative; padding-top: 1.5rem; }
.timeline-dot {
  position: absolute;
  top: -.55rem; left: 0;
  width: 12px; height: 12px;
  border-radius: 50%;
  background: var(--gold);
  border: 3px solid var(--paper);
}
.timeline-index {
  display: block;
  font-family: var(--font-mono);
  font-size: .72rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: .6rem;
}
.timeline-step h3 { font-size: 1.3rem; font-weight: 600; margin-bottom: .9rem; }
.timeline-step ul { display: flex; flex-direction: column; gap: .55rem; }
.timeline-step li {
  padding-left: 1.1rem;
  position: relative;
  font-size: .95rem;
}
.timeline-step li::before {
  content: "";
  position: absolute; left: 0; top: .6em;
  width: 6px; height: 1px;
  background: var(--navy);
  opacity: .4;
}

/* ============================================================
   Confianza
   ============================================================ */
.confianza { background: var(--paper-alt); }
.trust-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.75rem;
}
.trust-card {
  background: var(--white);
  border-radius: var(--radius-md);
  padding: 2.5rem;
  box-shadow: var(--shadow-card);
}
.trust-icon { width: 28px; height: 28px; color: var(--gold-ink); margin-bottom: 1.4rem; }
.trust-card h3 { font-size: 1.15rem; font-weight: 600; margin-bottom: .8rem; }
.trust-card p { font-size: .95rem; color: var(--muted); }

/* ============================================================
   Diferencial
   ============================================================ */
.diferencial { background: var(--paper); }
.diff-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2.5rem;
}
.diff-card { text-align: left; }
.diff-icon {
  width: 46px; height: 46px;
  color: var(--navy);
  padding: 12px;
  background: var(--paper-alt);
  border-radius: var(--radius-sm);
  margin-bottom: 1.4rem;
}
.diff-card h3 { font-size: 1.15rem; font-weight: 600; margin-bottom: .7rem; }
.diff-card p { font-size: .95rem; color: var(--muted); }

/* ============================================================
   Contacto
   ============================================================ */
.contacto { background: var(--paper-alt); }
.contact-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 2.5rem;
  align-items: start;
}
.contact-form {
  background: var(--white);
  border-radius: var(--radius-md);
  padding: 2.5rem;
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}
.hp-field {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem; }
.field { display: flex; flex-direction: column; gap: .5rem; }
.field label { font-size: .82rem; font-weight: 600; color: var(--navy); }
.field input, .field textarea {
  border: 1.5px solid var(--line);
  border-radius: var(--radius-sm);
  padding: .8rem .9rem;
  background: var(--paper);
  transition: border-color .25s var(--ease), background .25s var(--ease);
  resize: vertical;
}
.field input:focus, .field textarea:focus {
  border-color: var(--gold);
  background: var(--white);
  outline: none;
}
.form-status { font-size: .88rem; min-height: 1.2em; color: var(--navy); font-weight: 500; }
.form-status[data-state="error"] { color: #B3261E; }

.contact-info { display: flex; flex-direction: column; gap: 1.6rem; }
.info-block { padding-bottom: 1.4rem; border-bottom: 1px solid var(--line); display: flex; flex-direction: column; gap: .3rem; }
.info-block:last-of-type { border-bottom: none; padding-bottom: 0; }
.info-label { font-weight: 700; color: var(--navy); }
.info-detail, .info-block p { color: var(--muted); font-size: .92rem; }
.info-block a { font-weight: 500; color: var(--navy); transition: color .25s; }
.info-block a:hover { color: var(--gold); }
.map-embed {
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-card);
  aspect-ratio: 4/3;
}
.map-embed iframe { width: 100%; height: 100%; border: 0; filter: grayscale(.15); }

/* ============================================================
   Footer
   ============================================================ */
.site-footer { background: var(--navy-deep); color: rgba(255,255,255,.7); }
.footer-inner {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 1.75rem;
  padding-block: 2.5rem;
}
.logo-footer .logo-img { height: 51px; }
.footer-links { display: flex; gap: 1.5rem; margin-left: auto; }
.footer-links a { font-size: .88rem; transition: color .25s; }
.footer-links a:hover { color: var(--gold-light); }
.footer-copy { width: 100%; font-size: .8rem; padding-top: 1.75rem; border-top: 1px solid var(--line-dark); }

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 980px) {
  .service-grid, .trust-grid, .diff-grid, .timeline { grid-template-columns: 1fr; }
  .timeline-line { display: none; }
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .contact-grid { grid-template-columns: 1fr; }
  .main-nav { display: none; }
}

@media (max-width: 640px) {
  .header-cta { display: none; }
  .nav-toggle { display: flex; }
  .kpi-grid { grid-template-columns: 1fr; }
  .field-row { grid-template-columns: 1fr; }
  .footer-links { margin-left: 0; }
  .logo-img { height: 50px; }
  .logo-footer .logo-img { height: 50px; }
}
