/* =============================================================
   CPAL Asesores — styles.css (v2)
   1. Tokens
   ============================================================= */
:root {
  --brand:    #2657A4;   /* azul del logo */
  --brand-d:  #1d4585;
  --ink:      #14315C;   /* navy titulares/texto */
  --ink-soft: #2b4a72;
  --ink-95:   #102848;
  --accent:   #E1A73E;   /* dorado cálido (detalle) */
  --accent-d: #C6902B;
  --wpp:      #25A366;
  --wpp-d:    #1e8a54;

  --paper:    #FBF9F5;
  --cream:    #FFFFFF;
  --sand:     #F2ECE1;
  --tint:     #EEF3FA;   /* azul muy claro */

  --text:     #1e2b40;
  --muted:    #5b6a83;
  --line:     #E7E0D4;
  --line-2:   #d8e0ec;

  --sans: "Inter", system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
  --serif: "Fraunces", Georgia, "Times New Roman", serif;

  --container: 1180px;
  --gutter: clamp(1.1rem, 4vw, 2.4rem);
  --radius: 20px;
  --radius-sm: 13px;

  --shadow-sm: 0 2px 10px rgba(20,49,92,.06);
  --shadow: 0 18px 44px -20px rgba(20,49,92,.30);
  --shadow-lg: 0 32px 74px -28px rgba(20,49,92,.45);

  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

/* =============================================================
   2. Reset & base
   ============================================================= */
*, *::before, *::after { box-sizing: border-box; margin: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  font-family: var(--sans); font-size: 16px; line-height: 1.6; color: var(--text);
  background: var(--paper); -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
  overflow-x: clip;
}
img, svg, video { display: block; max-width: 100%; }
img { height: auto; }
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; }
a { color: inherit; text-decoration: none; }
p { text-wrap: pretty; }
h1, h2, h3 { text-wrap: balance; line-height: 1.08; letter-spacing: -0.015em; font-family: var(--serif); font-weight: 600; color: var(--ink); }
::selection { background: var(--ink); color: #fff; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 3px; border-radius: 6px; }

.skip-link { position: fixed; top: -100px; left: 1rem; z-index: 9999; padding: .6rem 1rem; background: var(--ink); color: #fff; border-radius: 8px; font-weight: 600; }
.skip-link:focus { top: 1rem; }

/* =============================================================
   3. Utilities
   ============================================================= */
.container { width: 100%; max-width: var(--container); margin-inline: auto; padding-inline: var(--gutter); }

.eyebrow { display: inline-flex; align-items: center; gap: .55rem; font-size: .78rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--brand); margin-bottom: 1.05rem; }
.eyebrow::before { content: ""; width: 26px; height: 2px; background: var(--accent); border-radius: 2px; }
.eyebrow--light { color: var(--accent); }
.eyebrow--onphoto { color: #ffd98a; }
.eyebrow--onphoto::before { background: #ffd98a; }

.section-head { max-width: 640px; margin-inline: auto; text-align: center; margin-bottom: clamp(2rem, 5vw, 3.2rem); }
.section-head--left { margin-inline: 0; text-align: left; margin-bottom: 1.6rem; }
.section-head h2 { font-size: clamp(1.75rem, 3.8vw, 2.55rem); }
h2 em, .hero-title em, h3 em { font-style: italic; color: var(--brand); }
.section-lead { color: var(--muted); margin-top: .85rem; font-size: 1.03rem; }

/* =============================================================
   4. Buttons
   ============================================================= */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .55rem; padding: .95rem 1.6rem; border-radius: 999px; font-weight: 600; font-size: .98rem; line-height: 1; transition: transform .3s var(--ease-out), box-shadow .3s var(--ease-out), background .25s; white-space: nowrap; }
.btn-sm { padding: .68rem 1.15rem; font-size: .9rem; }
.btn-lg { padding: 1.05rem 1.9rem; font-size: 1.02rem; }
.btn-block { width: 100%; }
.btn-primary { background: var(--brand); color: #fff; box-shadow: 0 14px 26px -12px rgba(38,87,164,.6); }
.btn-primary:hover { background: var(--brand-d); transform: translateY(-2px); }
.btn-wpp { background: var(--wpp); color: #fff; box-shadow: 0 14px 26px -12px rgba(37,163,102,.55); }
.btn-wpp:hover { background: var(--wpp-d); transform: translateY(-2px); }
.btn-ghost { background: #fff; color: var(--ink); border: 1px solid var(--line-2); }
.btn-ghost:hover { border-color: var(--brand); color: var(--brand); }
.btn-ghost-light { background: transparent; color: var(--ink); border: 1.5px solid var(--line-2); }
.btn-ghost-light:hover { border-color: var(--brand); color: var(--brand); transform: translateY(-2px); }

/* Floating WhatsApp (fijo en toda la web) */
.wpp-float { position: fixed; right: clamp(1rem, 3vw, 1.6rem); bottom: clamp(1rem, 3vw, 1.6rem); z-index: 200; display: inline-grid; place-items: center; width: 58px; height: 58px; border-radius: 50%; background: var(--wpp); color: #fff; box-shadow: 0 12px 28px -8px rgba(37,163,102,.7); transition: transform .3s var(--ease-out), background .25s; }
.wpp-float:hover { background: var(--wpp-d); transform: translateY(-3px) scale(1.05); }
.wpp-float svg { width: 30px; height: 30px; }

/* =============================================================
   5. Brand lockup
   ============================================================= */
.brand { display: inline-flex; align-items: center; gap: .7rem; }
.brand-mark { height: 44px; width: 44px; border-radius: 11px; box-shadow: 0 6px 16px -8px rgba(20,49,92,.5); }
.brand-text { display: flex; flex-direction: column; line-height: 1.05; }
.brand-name { font-family: var(--serif); font-weight: 600; font-size: 1.28rem; color: var(--ink); letter-spacing: .01em; }
.brand-name em { font-style: italic; font-weight: 500; color: var(--brand); }
.brand-sub { font-size: .64rem; font-weight: 700; letter-spacing: .19em; text-transform: uppercase; color: var(--muted); }

/* =============================================================
   6. Header
   ============================================================= */
.site-header { position: sticky; top: 0; z-index: 100; background: rgba(20,49,92,.9); backdrop-filter: saturate(160%) blur(12px); border-bottom: 1px solid rgba(255,255,255,.08); transition: border-color .3s, background .3s, box-shadow .3s; }
.site-header[data-scrolled] { border-color: rgba(255,255,255,.14); background: rgba(16,40,72,.96); box-shadow: 0 8px 24px -14px rgba(0,0,0,.65); }
/* Encabezado oscuro: textos y logo legibles */
.site-header .brand-name { color: #fff; }
.site-header .brand-name em { color: #9db8e6; }
.site-header .brand-sub { color: #b9c9e2; }
.site-header .brand-mark { box-shadow: 0 6px 16px -8px rgba(0,0,0,.6); }
.header-inner { display: flex; align-items: center; justify-content: space-between; min-height: 76px; gap: 1rem; }
.nav { display: flex; align-items: center; gap: 1.6rem; }
.nav > a:not(.btn) { position: relative; font-weight: 600; font-size: .95rem; color: #d6e2f4; transition: color .2s; display: none; }
.nav > a:not(.btn)::after { content: ""; position: absolute; left: 0; right: 0; bottom: -7px; height: 3px; border-radius: 3px; background: #6f9ae0; transform: scaleX(0); transform-origin: left; transition: transform .3s var(--ease-out); }
.nav > a:not(.btn):hover { color: #fff; }
.nav > a:not(.btn).is-active { color: #fff; }
.nav > a:not(.btn).is-active::after { transform: scaleX(1); }
@media (min-width: 900px) { .nav > a:not(.btn) { display: inline; } }
@media (max-width: 480px) { .brand-sub { display: none; } .brand-name { font-size: 1.15rem; } }

/* =============================================================
   7. HERO (full-bleed)
   ============================================================= */
.hero { position: relative; display: flex; align-items: center; min-height: clamp(560px, 86vh, 820px); overflow: hidden; isolation: isolate; }
.hero-bg { position: absolute; inset: 0; z-index: -2; }
.hero-bg img { width: 100%; height: 100%; object-fit: cover; object-position: 68% center; }
.hero-scrim {
  position: absolute; inset: 0; z-index: -1;
  background:
    linear-gradient(90deg, rgba(12,30,58,.94) 0%, rgba(14,34,66,.82) 38%, rgba(14,34,66,.32) 70%, rgba(14,34,66,.12) 100%),
    linear-gradient(0deg, rgba(10,26,52,.55), rgba(10,26,52,.15) 45%);
}
.hero-inner { padding: clamp(3rem, 8vw, 5.5rem) 0; width: 100%; }
.hero-copy { max-width: 640px; color: #eef4ff; }
.hero-title {
  color: #fff; font-size: clamp(2.15rem, 5.6vw, 3.75rem); line-height: 1.05; letter-spacing: -0.02em;
  text-shadow: 0 2px 24px rgba(6,18,40,.35);
}
.hero-title em { color: #fff; font-style: italic; }
.hero-sub { margin-top: 1.35rem; font-size: clamp(1.04rem, 1.9vw, 1.2rem); color: #d6e2f4; max-width: 52ch; }
.hero-actions { margin-top: 2.1rem; display: flex; flex-wrap: wrap; gap: .9rem; }
.hero-stats {
  margin-top: 2.4rem; padding-top: 1.6rem; border-top: 1px solid rgba(255,255,255,.18);
  list-style: none; display: flex; flex-wrap: wrap; gap: 1.4rem 2.4rem;
}
.hero-stats li { display: flex; flex-direction: column; line-height: 1.1; }
.hero-stats strong { font-family: var(--serif); font-size: 1.7rem; color: #fff; font-weight: 600; }
.hero-stats span { font-size: .84rem; color: #b9c9e2; font-weight: 500; }

/* =============================================================
   8. Valores (por qué CPAL)
   ============================================================= */
.valores { padding: clamp(3.4rem, 7vw, 5.5rem) 0 clamp(2.6rem, 5vw, 3.5rem); }
.val-grid { list-style: none; display: grid; grid-template-columns: 1fr; gap: 1.1rem; }
.val-card { background: var(--cream); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 1.8rem 1.7rem; transition: transform .35s var(--ease-out), box-shadow .35s var(--ease-out); }
.val-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.val-ic { display: inline-grid; place-items: center; width: 54px; height: 54px; border-radius: 14px; background: var(--tint); color: var(--brand); margin-bottom: 1rem; }
.val-card h3 { font-size: 1.24rem; margin-bottom: .5rem; }
.val-card p { color: var(--muted); font-size: .97rem; }
@media (min-width: 800px) { .val-grid { grid-template-columns: repeat(3, 1fr); gap: 1.3rem; } }

/* =============================================================
   9. Segmentos
   ============================================================= */
.segmentos { padding: clamp(2.6rem, 6vw, 4rem) 0 clamp(3.2rem, 7vw, 5rem); background: linear-gradient(180deg, var(--paper), #f5efe6); }
.seg-grid { list-style: none; display: grid; grid-template-columns: 1fr; gap: 1rem; }
.seg-card { position: relative; display: flex; flex-direction: column; background: var(--cream); border: 1px solid var(--line); border-radius: var(--radius-sm); transition: transform .35s var(--ease-out), box-shadow .35s var(--ease-out), border-color .35s; overflow: hidden; }
.seg-card::before { content: ""; position: absolute; z-index: 2; inset: 0 auto 0 0; width: 4px; background: linear-gradient(var(--brand), var(--brand-d)); transform: scaleY(0); transform-origin: top; transition: transform .4s var(--ease-out); }
.seg-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); border-color: transparent; }
.seg-card:hover::before { transform: scaleY(1); }
.seg-media { position: relative; aspect-ratio: 16 / 9; overflow: hidden; background: var(--tint); }
.seg-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s var(--ease-out); }
.seg-card:hover .seg-media img { transform: scale(1.04); }
.seg-body { display: flex; flex-direction: column; flex: 1; padding: 1.25rem 1.35rem 1.45rem; }
.seg-card h3 { font-size: 1.14rem; margin-bottom: .5rem; }
.seg-card p { color: var(--muted); font-size: .94rem; }
@media (min-width: 600px) { .seg-grid { grid-template-columns: 1fr 1fr; } }
@media (min-width: 1000px) { .seg-grid { grid-template-columns: repeat(3, 1fr); gap: 1.1rem; } }

/* =============================================================
   12. Contacto
   ============================================================= */
.contacto { position: relative; isolation: isolate; overflow: hidden; padding: clamp(3.2rem, 7vw, 5rem) 0; background: var(--ink); color: #eaf0f8; }
.contacto::before { content: ""; position: absolute; inset: 0; z-index: -2; background: url("assets/img/contacto-bg.webp") center/cover no-repeat; filter: blur(3px) saturate(.8); transform: scale(1.08); opacity: .6; }
.contacto::after { content: ""; position: absolute; inset: 0; z-index: -1; background: radial-gradient(900px 420px at 88% 0%, rgba(38,87,164,.38), transparent 60%), linear-gradient(90deg, rgba(16,40,72,.9) 0%, rgba(16,40,72,.6) 50%, rgba(16,40,72,.4) 100%); }
.contacto-grid { display: grid; grid-template-columns: 1fr; gap: clamp(1.8rem, 4vw, 3rem); align-items: start; }
.contacto h2 { color: #fff; font-size: clamp(1.6rem, 3.4vw, 2.3rem); }
.contacto-lead { color: #c3d1e6; margin-top: .7rem; max-width: 42ch; }
.contacto-list { list-style: none; margin-top: 1.6rem; display: grid; gap: .85rem; }
.contacto-list li { display: flex; align-items: center; gap: .9rem; }
.ci-ic { flex: 0 0 auto; width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; color: var(--accent); background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.12); }
.ci-label { display: block; font-size: .72rem; text-transform: uppercase; letter-spacing: .1em; color: #93a7c6; font-weight: 700; }
.contacto-list a, .ci-plain { color: #eaf0f8; font-weight: 600; }
.contacto-list a:hover { color: var(--accent); }
.contacto-form { background: #fff; border-radius: var(--radius); padding: clamp(1.4rem, 3vw, 2rem); box-shadow: var(--shadow-lg); display: grid; gap: .9rem; }
.field { display: grid; gap: .35rem; }
.field-row { display: grid; grid-template-columns: 1fr; gap: .9rem; }
.field-set { border: 0; padding: 0; margin: 0; min-inline-size: 0; display: grid; gap: .55rem; }
.field-set > legend { padding: 0; font-size: .82rem; font-weight: 700; color: var(--ink); }
.field label { font-size: .82rem; font-weight: 700; color: var(--ink); }
.field .opt { color: var(--muted); font-weight: 500; }
.field input, .field select, .field textarea { width: 100%; padding: .8rem .9rem; border: 1px solid var(--line-2); border-radius: 10px; font: inherit; color: var(--text); background: #fdfdfd; transition: border-color .2s, box-shadow .2s; }
.field textarea { resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(38,87,164,.15); }
.form-note { font-size: .8rem; color: var(--muted); text-align: center; }
@media (min-width: 620px) { .field-row { grid-template-columns: 1fr 1fr; } }
@media (min-width: 900px) { .contacto-grid { grid-template-columns: .9fr 1.1fr; } }

/* =============================================================
   13. Footer
   ============================================================= */
.site-footer { background: var(--ink-95); color: #c3d1e6; padding-top: clamp(2.6rem, 5vw, 3.4rem); }
.footer-top { display: grid; grid-template-columns: 1fr; gap: 2rem; padding-bottom: 2rem; border-bottom: 1px solid rgba(255,255,255,.1); }
.brand--footer { margin-bottom: .9rem; }
.brand--footer .brand-name { color: #fff; }
.brand--footer .brand-name em { color: #9db8e6; }
.brand--footer .brand-sub { color: #8ba0c2; }
.footer-brand p { color: #9fb2d0; font-size: .95rem; max-width: 42ch; margin-bottom: 1.1rem; }
.footer-more { display: grid; gap: .5rem; align-content: start; align-items: start; }
.acc-link { display: flex; align-items: center; justify-content: space-between; gap: .75rem; padding: .95rem 1.1rem; border: 1px solid rgba(255,255,255,.12); border-radius: 10px; background: rgba(255,255,255,.03); font-weight: 600; color: #eaf0f8; transition: border-color .25s, background .25s, transform .25s; }
.acc-link span { color: var(--accent); font-size: 1.15rem; line-height: 1; transition: transform .25s; }
.acc-link:hover { border-color: rgba(255,255,255,.3); background: rgba(255,255,255,.07); }
.acc-link:hover span { transform: translateX(4px); }
.footer-bottom { padding: 1.4rem 0 2rem; display: grid; gap: .4rem; }
.footer-bottom p { font-size: .82rem; color: #8296b6; }
.footer-legal { max-width: 72ch; }
@media (min-width: 860px) { .footer-top { grid-template-columns: 1fr 1.15fr; gap: 3rem; } .footer-more { grid-template-columns: 1fr 1fr; } }

/* =============================================================
   13b. Subpáginas (Quiénes somos, Misión, Trayectoria, Por qué)
   ============================================================= */
.subpage { padding: clamp(2rem, 5vw, 3.4rem) 0 clamp(3rem, 7vw, 4.5rem); }
.back-link { display: inline-flex; align-items: center; gap: .45rem; margin-bottom: 1.3rem; font-weight: 600; color: var(--brand); }
.back-link:hover { text-decoration: underline; }
.subpage-banner { border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); margin-bottom: clamp(1.6rem, 4vw, 2.4rem); }
.subpage-banner img { width: 100%; height: clamp(200px, 34vw, 380px); object-fit: cover; }
.subpage-body { max-width: 720px; margin-inline: auto; text-align: center; }
.subpage-body .eyebrow { justify-content: center; }
.subpage-body h1 { font-size: clamp(2rem, 4.6vw, 3rem); }
.subpage-body h2 { font-size: 1.3rem; margin-top: 1.9rem; }
.subpage-body p { color: var(--ink-soft); margin-top: 1.1rem; font-size: 1.08rem; }
.subpage-body p + p { margin-top: .8rem; }
.subpage-body strong { color: var(--ink); }
.subpage-cta { margin-top: 2rem; display: flex; flex-wrap: wrap; gap: .8rem; }

/* =============================================================
   14. Reveals (visible sin JS)
   ============================================================= */
html.js .reveal { opacity: 0; transform: translateY(22px); transition: opacity .7s var(--ease-out), transform .7s var(--ease-out); }
html.js .reveal.is-visible { opacity: 1; transform: none; }
html.js .reveal:nth-child(2) { transition-delay: .06s; }
html.js .reveal:nth-child(3) { transition-delay: .12s; }
html.js .reveal:nth-child(4) { transition-delay: .18s; }

/* =============================================================
   15. Reduced motion
   ============================================================= */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  html.js .reveal { transform: none; transition: opacity .4s ease; }
  .btn:hover, .val-card:hover, .seg-card:hover { transform: none; }
}
