/* =============================================================================
   Mauricio Carballo — Coaching de tenis + asesoría en inversiones
   CSS fluido: Grid + Flexbox sobre tags semánticos, custom properties,
   clamp() para tipografía fluida, variables de modo oscuro. Sin frameworks,
   sin reset pesado. Arquitectura reusada del framework de Local Webs
   (probado en templo-cafe): reveal on scroll con stagger, CTA con shine,
   nav con glass al scrollear — sin scroll-snap (se probó ahí y se sacó
   porque se sentía como un salto brusco; no se repite acá).
   ============================================================================= */

:root {
  /* Paleta ejecutiva/premium: navy + bronce cálido (no los tostados de café) */
  --color-bg: #f6f7f9;
  --color-bg-alt: #eceff3;
  --color-surface: #ffffff;
  --color-text: #10151d;
  --color-text-muted: #57626f;
  --color-brand: #123a63;
  --color-brand-dark: #081a30;
  --color-accent: #b8863c;
  --color-border: #dfe3e9;

  --font-serif: "Playfair Display", Georgia, serif;
  --font-sans: "Inter", system-ui, sans-serif;

  --space-s: clamp(0.75rem, 0.6rem + 0.7vw, 1.25rem);
  --space-m: clamp(1.5rem, 1.1rem + 1.8vw, 2.75rem);
  --space-l: clamp(3.25rem, 2.2rem + 5vw, 7rem);

  --radius: 14px;
  --max-width: 68rem;

  --gradient-accent: linear-gradient(135deg, var(--color-accent), var(--color-brand));
  --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
  --nav-height: 68px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --color-bg: #0b1017;
    --color-bg-alt: #121926;
    --color-surface: #161f2c;
    --color-text: #eef1f5;
    --color-text-muted: #aab4c0;
    --color-border: #263141;
  }
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

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

body {
  margin: 0;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-sans);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

img {
  max-width: 100%;
  display: block;
}

a {
  color: inherit;
}

h1, h2, h3 {
  font-family: var(--font-serif);
  font-weight: 700;
  line-height: 1.08;
  letter-spacing: -0.015em;
  margin: 0 0 var(--space-s);
  color: var(--color-brand-dark);
}

@media (prefers-color-scheme: dark) {
  h1, h2, h3 {
    color: var(--color-text);
  }
}

h1 {
  font-size: clamp(2.6rem, 1.6rem + 4.8vw, 5.25rem);
}

h2 {
  font-size: clamp(2rem, 1.55rem + 2.2vw, 3.25rem);
}

h3 {
  font-size: clamp(1.15rem, 1.05rem + 0.5vw, 1.45rem);
  letter-spacing: -0.005em;
}

p {
  margin: 0 0 var(--space-s);
  color: var(--color-text-muted);
}

.container {
  max-width: var(--max-width);
  margin-inline: auto;
  padding-inline: var(--space-s);
}

/* ---------------------------------------------------------------------------
   Header / Nav
   ------------------------------------------------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--color-bg) 70%, transparent);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid transparent;
  transition: background 0.3s ease, backdrop-filter 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

.site-header.scrolled {
  background: color-mix(in srgb, var(--color-bg) 88%, transparent);
  backdrop-filter: blur(14px) saturate(1.4);
  border-bottom-color: var(--color-border);
  box-shadow: 0 8px 30px -20px rgba(0, 0, 0, 0.35);
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-s);
  padding-block: 0.75rem;
  min-height: var(--nav-height);
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: clamp(1rem, 0.9rem + 0.4vw, 1.25rem);
  color: var(--color-brand-dark);
}

@media (prefers-color-scheme: dark) {
  .brand { color: var(--color-text); }
}

.site-nav ul {
  display: none;
  list-style: none;
  margin: 0;
  padding: 0;
  gap: var(--space-s);
}

.site-nav a {
  position: relative;
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--color-text-muted);
  padding-bottom: 0.3rem;
  transition: color 0.15s;
}

.site-nav a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2px;
  border-radius: 2px;
  background: var(--gradient-accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.35s var(--ease-out-expo);
}

.site-nav a:hover {
  color: var(--color-accent);
}

.site-nav a:hover::after,
.site-nav a.active::after {
  transform: scaleX(1);
}

.site-nav a.active {
  color: var(--color-brand-dark);
  font-weight: 600;
}

@media (prefers-color-scheme: dark) {
  .site-nav a.active { color: var(--color-text); }
}

@media (min-width: 720px) {
  .site-nav ul {
    display: flex;
  }
}

.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 600;
  font-size: 0.9rem;
  padding: 0.7rem 1.4rem;
  border-radius: 999px;
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
  overflow: hidden;
  isolation: isolate;
  transition: transform 0.25s var(--ease-out-expo), box-shadow 0.25s var(--ease-out-expo);
}

.btn::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(115deg, transparent 30%, rgba(255, 255, 255, 0.4) 50%, transparent 70%);
  transform: translateX(-130%);
  transition: transform 0.65s ease;
}

.btn:hover::after {
  transform: translateX(130%);
}

.btn:hover {
  transform: translateY(-3px);
}

.btn:active {
  transform: scale(0.97);
}

.btn-primary {
  background: var(--gradient-accent);
  color: #fff;
  box-shadow: 0 8px 20px -8px color-mix(in srgb, var(--color-accent) 70%, transparent);
}

.btn-primary:hover {
  box-shadow: 0 14px 32px -10px color-mix(in srgb, var(--color-accent) 80%, transparent);
}

.btn-outline {
  background: transparent;
  border-color: var(--color-brand);
  color: var(--color-brand);
}

.btn-outline:hover {
  box-shadow: 0 10px 24px -14px color-mix(in srgb, var(--color-brand) 60%, transparent);
}

@media (prefers-color-scheme: dark) {
  .btn-outline { border-color: var(--color-text); color: var(--color-text); }
}

/* ---------------------------------------------------------------------------
   Hero
   ------------------------------------------------------------------------- */
.hero {
  position: relative;
  overflow: hidden;
  min-height: 100svh;
  min-height: 100vh;
  display: flex;
  align-items: center;
}

.hero-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.hero-bg img,
.hero-bg-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.08);
  will-change: transform;
}

.hero-bg-video {
  position: absolute;
  inset: 0;
  z-index: 1;
  opacity: 0;
  transition: opacity 0.8s ease;
}

.hero-bg.is-ready .hero-bg-video {
  opacity: 1;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(180deg, rgba(6, 14, 26, 0.6), rgba(6, 14, 26, 0.82) 65%, var(--color-bg) 100%);
}

.hero-content {
  position: relative;
  z-index: 2;
  padding-block: var(--space-l);
  max-width: 42rem;
}

.hero-content > * {
  opacity: 0;
  transform: translateY(28px);
  animation: hero-in 1s var(--ease-out-expo) forwards;
}

.hero-content .eyebrow { animation-delay: 0.1s; }
.hero-content h1 { animation-delay: 0.24s; }
.hero-content p { animation-delay: 0.4s; }
.hero-content .hero-actions { animation-delay: 0.56s; }

@keyframes hero-in {
  to {
    opacity: 1;
    transform: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .hero-content > * {
    animation: none;
    opacity: 1;
    transform: none;
  }
}

.hero-content .eyebrow {
  color: #e7c98f;
}

.hero-content h1 {
  color: #fff;
}

.hero-content p {
  color: rgba(255, 255, 255, 0.9);
  font-size: clamp(1rem, 0.94rem + 0.3vw, 1.2rem);
}

.eyebrow {
  display: inline-block;
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-accent);
  margin-bottom: var(--space-s);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: var(--space-m);
}

.hero-scroll-cue {
  position: absolute;
  left: 50%;
  bottom: clamp(1.25rem, 1rem + 1.5vw, 2.5rem);
  z-index: 2;
  width: 26px;
  height: 42px;
  border: 2px solid rgba(255, 255, 255, 0.55);
  border-radius: 999px;
  transform: translateX(-50%);
  opacity: 0;
  animation: hero-in 1s var(--ease-out-expo) forwards;
  animation-delay: 0.8s;
}

.hero-scroll-cue span {
  position: absolute;
  top: 8px;
  left: 50%;
  width: 4px;
  height: 8px;
  border-radius: 999px;
  background: #fff;
  transform: translateX(-50%);
  animation: scroll-cue-move 1.8s ease-in-out infinite;
}

@keyframes scroll-cue-move {
  0% { transform: translate(-50%, 0); opacity: 1; }
  70% { transform: translate(-50%, 14px); opacity: 0; }
  71% { transform: translate(-50%, 0); opacity: 0; }
  100% { transform: translate(-50%, 0); opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  .hero-scroll-cue { animation: none; opacity: 1; }
  .hero-scroll-cue span { animation: none; }
}

@media (max-width: 640px) {
  .hero-scroll-cue { display: none; }
}

/* ---------------------------------------------------------------------------
   Sections generales
   ------------------------------------------------------------------------- */
section {
  padding-block: var(--space-l);
  scroll-margin-top: var(--nav-height);
}

.section-intro {
  max-width: 40rem;
  margin-bottom: var(--space-m);
}

.section-alt {
  background: var(--color-bg-alt);
}

/* ---------------------------------------------------------------------------
   Reveal on scroll (IntersectionObserver toggles .is-visible, ver main.js)
   Movimiento marcado: slide + fade + escala sutil, con easing "expo out".
   Para grupos (grillas de cards/galeria/etc): el contenedor lleva
   .reveal-group y se observa a si mismo; los hijos .reveal-item heredan
   la animacion con un stagger via transition-delay por nth-child.
   ------------------------------------------------------------------------- */
.reveal {
  opacity: 0;
  transform: translateY(46px) scale(0.97);
  transition: opacity 0.9s var(--ease-out-expo), transform 0.9s var(--ease-out-expo);
  will-change: transform, opacity;
}

.reveal.is-visible {
  opacity: 1;
  transform: none;
}

.reveal-group .reveal-item {
  opacity: 0;
  transform: translateY(46px) scale(0.96);
  transition: opacity 0.8s var(--ease-out-expo), transform 0.8s var(--ease-out-expo);
  will-change: transform, opacity;
}

.reveal-group.is-visible .reveal-item {
  opacity: 1;
  transform: none;
}

.reveal-group.is-visible .reveal-item:nth-child(1) { transition-delay: 0.02s; }
.reveal-group.is-visible .reveal-item:nth-child(2) { transition-delay: 0.1s; }
.reveal-group.is-visible .reveal-item:nth-child(3) { transition-delay: 0.18s; }
.reveal-group.is-visible .reveal-item:nth-child(4) { transition-delay: 0.26s; }
.reveal-group.is-visible .reveal-item:nth-child(5) { transition-delay: 0.34s; }
.reveal-group.is-visible .reveal-item:nth-child(6) { transition-delay: 0.42s; }

@media (prefers-reduced-motion: reduce) {
  .reveal,
  .reveal-item {
    transition: none;
    opacity: 1;
    transform: none;
  }
}

/* ---------------------------------------------------------------------------
   Concepto (de la cancha a la cartera) — dos etapas
   ------------------------------------------------------------------------- */
.concepto-grid {
  display: grid;
  gap: var(--space-m);
}

@media (min-width: 780px) {
  .concepto-grid {
    grid-template-columns: 1fr 1fr;
  }
}

.etapa-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: var(--space-m);
  position: relative;
}

.etapa-card .etapa-num {
  font-family: var(--font-serif);
  font-size: clamp(2.5rem, 2rem + 2vw, 3.5rem);
  font-weight: 700;
  line-height: 1;
  margin-bottom: 0.5rem;
}

.etapa-arrow {
  display: none;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  color: var(--color-accent);
}

@media (min-width: 780px) {
  .concepto-grid {
    grid-template-columns: 1fr auto 1fr;
  }
  .etapa-arrow {
    display: flex;
  }
}

/* ---------------------------------------------------------------------------
   Servicios
   ------------------------------------------------------------------------- */
.catalog-grid {
  display: grid;
  gap: var(--space-s);
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
}

article.card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: var(--space-s);
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

article.card:hover {
  transform: translateY(-6px);
  box-shadow: 0 18px 30px -18px color-mix(in srgb, var(--color-brand-dark) 65%, transparent);
}

article.card.card-featured {
  border-color: var(--color-accent);
  background: linear-gradient(180deg, color-mix(in srgb, var(--color-accent) 8%, var(--color-surface)), var(--color-surface));
}

.card .tag {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--color-accent);
}

/* ---------------------------------------------------------------------------
   Trayectoria / credenciales (prueba social real)
   ------------------------------------------------------------------------- */
.trust-badges {
  display: grid;
  gap: var(--space-s);
  grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr));
  margin-bottom: var(--space-m);
}

.trust-badge {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 1rem 1.1rem;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.trust-badge:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 24px -16px color-mix(in srgb, var(--color-brand-dark) 60%, transparent);
}

.trust-badge-icon {
  font-size: 1.6rem;
  line-height: 1;
  flex-shrink: 0;
}

.trust-badge strong {
  display: block;
  font-size: 1rem;
  color: var(--color-brand-dark);
}

@media (prefers-color-scheme: dark) {
  .trust-badge strong { color: var(--color-text); }
}

.trust-badge span {
  font-size: 0.78rem;
  color: var(--color-text-muted);
}

/* ---------------------------------------------------------------------------
   Widget "hoy en la cancha / hoy en la cartera" (JS interactivo, datos reales)
   ------------------------------------------------------------------------- */
.credential-widget {
  background: var(--color-brand-dark);
  color: #fff;
  border-radius: var(--radius);
  padding: var(--space-m);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-s);
}

.credential-widget p {
  color: #cdd8e6;
  margin: 0;
}

.credential-widget strong {
  font-family: var(--font-serif);
  font-size: 1.3rem;
  display: block;
  transition: opacity 0.22s ease, transform 0.22s ease;
}

.credential-widget strong.origin-fade {
  opacity: 0;
  transform: translateY(4px);
}

.origin-dots {
  display: flex;
  gap: 0.4rem;
}

.origin-dots button {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.35);
  cursor: pointer;
  padding: 0;
}

.origin-dots button[aria-current="true"] {
  background: #fff;
}

/* ---------------------------------------------------------------------------
   Galería real (fotos de stock, tono premium)
   ------------------------------------------------------------------------- */
.gallery-grid {
  display: grid;
  gap: var(--space-s);
  grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr));
}

.gallery-grid figure {
  margin: 0;
  border-radius: var(--radius);
  overflow: hidden;
  aspect-ratio: 4 / 5;
  border: 1px solid var(--color-border);
}

.gallery-grid img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.35s ease;
}

.gallery-grid figure:hover img {
  transform: scale(1.06);
}

/* ---------------------------------------------------------------------------
   Funnel de contacto (2 pasos)
   ------------------------------------------------------------------------- */
.funnel-grid {
  display: grid;
  gap: var(--space-m);
}

@media (min-width: 760px) {
  .funnel-grid {
    grid-template-columns: 1fr 1fr;
  }
}

.funnel-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: var(--space-m);
}

.funnel-card .step {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--color-accent);
  letter-spacing: 0.05em;
}

/* ---------------------------------------------------------------------------
   FAQ
   ------------------------------------------------------------------------- */
details.faq-item {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 1rem 1.2rem;
  margin-bottom: 0.6rem;
}

details.faq-item summary {
  cursor: pointer;
  font-weight: 600;
  list-style: none;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
}

details.faq-item summary::-webkit-details-marker {
  display: none;
}

details.faq-item summary::after {
  content: "+";
  color: var(--color-accent);
  font-size: 1.3rem;
  line-height: 1;
}

details.faq-item[open] summary::after {
  content: "–";
}

details.faq-item p {
  margin-top: 0.7rem;
  margin-bottom: 0;
}

/* ---------------------------------------------------------------------------
   Contacto / footer
   ------------------------------------------------------------------------- */
.contact-grid {
  display: grid;
  gap: var(--space-s);
  grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
}

.contact-item strong {
  display: block;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-accent);
  margin-bottom: 0.25rem;
}

.disclaimer {
  font-size: 0.82rem;
  color: var(--color-text-muted);
  border-left: 3px solid var(--color-border);
  padding-left: 0.9rem;
  max-width: 40rem;
}

.site-footer {
  background: var(--color-brand-dark);
  color: #cdd8e6;
  padding-block: var(--space-m);
}

.site-footer a {
  color: #fff;
}

.site-footer .container {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: var(--space-s);
  font-size: 0.82rem;
}

/* ---------------------------------------------------------------------------
   Sticky CTA mobile
   ------------------------------------------------------------------------- */
.sticky-cta {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 60;
  padding: 0.75rem;
  background: linear-gradient(to top, var(--color-bg) 60%, transparent);
}

.sticky-cta .btn {
  width: 100%;
  justify-content: center;
  padding-block: 0.9rem;
}

@media (min-width: 720px) {
  .sticky-cta {
    display: none;
  }
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}
