/* RehabilitArte — overrides + utilities propias.
   Tailwind via CDN cubre la mayoría. Aquí lo que la CDN no resuelve: tipografía display, components reutilizables,
   animaciones custom y micro-interacciones. */

:root {
  --brand-bg: #ccd6d7;
  --brand-fg: #3a464f;
  --brand-accent-1: #a0a0a0;
  --brand-accent-2: #7e8285;
  --brand-accent-3: #5c646a;
  --pastel-cream: #f7f3ec;
  --pastel-mist: #e2ebec;
  --pastel-blush: #f5e6e0;
  --pastel-sand: #efe7dd;
  --pastel-sage: #dbe5dc;
  --pastel-lilac: #e4dfee;
}

* { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }

/* Lenis maneja el smooth-scroll globalmente — disable nativo para evitar fight */
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
.lenis.lenis-smooth [data-lenis-prevent] { overscroll-behavior: contain; }
.lenis.lenis-stopped { overflow: clip; }
.lenis.lenis-scrolling iframe { pointer-events: none; }
html { scroll-behavior: smooth; }
html, body { background: var(--pastel-cream); color: var(--brand-fg); font-family: 'Numans', system-ui, sans-serif; }

::selection { background: var(--brand-fg); color: var(--pastel-cream); }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(58,70,79,0.22); border-radius: 999px; }
::-webkit-scrollbar-thumb:hover { background: rgba(58,70,79,0.4); }

.font-display { font-family: 'Montserrat', system-ui, sans-serif; font-weight: 300; letter-spacing: -0.01em; }

.container-pro { margin-left: auto; margin-right: auto; max-width: 80rem; padding-left: 1.5rem; padding-right: 1.5rem; }
@media (min-width: 768px) { .container-pro { padding-left: 2.5rem; padding-right: 2.5rem; } }
@media (min-width: 1024px) { .container-pro { padding-left: 4rem; padding-right: 4rem; } }

.eyebrow { font-family: 'Montserrat', sans-serif; font-size: 11px; font-weight: 400; text-transform: uppercase; letter-spacing: 0.28em; color: var(--brand-accent-2); }
.hairline { display: inline-block; vertical-align: middle; width: 3rem; height: 1px; background: #cfd4d8; margin-right: 0.75rem; }

.display-1 { font-family: 'Montserrat', sans-serif; font-weight: 200; font-size: clamp(2.25rem, 5vw, 4.5rem); line-height: 1.05; letter-spacing: -0.015em; color: #2a333a; }
.display-2 { font-family: 'Montserrat', sans-serif; font-weight: 200; font-size: clamp(1.75rem, 3.4vw, 3rem); line-height: 1.1; letter-spacing: -0.01em; color: #2a333a; }
.display-3 { font-family: 'Montserrat', sans-serif; font-weight: 300; font-size: clamp(1.5rem, 2.4vw, 2.25rem); line-height: 1.15; color: #2a333a; }
.lead { font-size: clamp(1rem, 1.1vw, 1.125rem); line-height: 1.7; color: #454d54; }

.btn-primary {
  display: inline-flex; align-items: center; gap: 0.5rem;
  border-radius: 9999px; background: #2a333a; color: var(--pastel-cream);
  padding: 0.85rem 1.6rem; font-size: 0.875rem; font-weight: 500; letter-spacing: 0.02em;
  transition: background 220ms, transform 180ms, box-shadow 240ms; cursor: pointer; border: none;
}
.btn-primary:hover { background: var(--brand-fg); box-shadow: 0 0 0 1px rgba(58,70,79,0.06), 0 24px 60px -24px rgba(58,70,79,0.25); }
.btn-primary:active { transform: scale(0.98); }

.btn-ghost {
  display: inline-flex; align-items: center; gap: 0.5rem;
  border-radius: 9999px; background: rgba(255,255,255,0.45); color: var(--brand-fg);
  padding: 0.85rem 1.6rem; font-size: 0.875rem; font-weight: 500; letter-spacing: 0.02em;
  border: 1px solid rgba(207,212,216,0.85); backdrop-filter: blur(12px); transition: all 220ms;
}
.btn-ghost:hover { background: rgba(255,255,255,0.8); border-color: #a9b0b8; }
.btn-ghost:active { transform: scale(0.98); }

.section-pad { padding-top: 6rem; padding-bottom: 6rem; }
@media (min-width: 768px) { .section-pad { padding-top: 8rem; padding-bottom: 8rem; } }

.card-soft {
  border-radius: 1.75rem; background: rgba(255,255,255,0.62);
  backdrop-filter: blur(20px); border: 1px solid rgba(255,255,255,0.75);
  box-shadow: 0 12px 40px -16px rgba(58,70,79,0.18);
}

.badge-soft {
  display: inline-flex; align-items: center;
  border-radius: 9999px; background: rgba(255,255,255,0.7);
  border: 1px solid rgba(207,212,216,0.7); padding: 6px 12px;
  font-size: 11px; letter-spacing: 0.02em; color: var(--brand-fg);
}

/* Navbar — scrolled state aplicado via JS */
#navbar.scrolled {
  backdrop-filter: blur(20px);
  background-color: rgba(247,243,236,0.75);
  border-bottom: 1px solid rgba(207,212,216,0.5);
  box-shadow: 0 1px 0 rgba(58,70,79,0.04);
}

.nav-link {
  position: relative; font-family: 'Montserrat', sans-serif; font-size: 0.875rem;
  letter-spacing: 0.02em; color: #5c646a; transition: color 250ms;
  text-decoration: none;
}
.nav-link:hover { color: #2a333a; }
.nav-link::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: -6px;
  height: 1px; background: currentColor; transform: scaleX(0); transform-origin: left;
  transition: transform 350ms ease;
}
.nav-link:hover::after, .nav-link.active::after { transform: scaleX(1); }
.nav-link.active { color: #2a333a; }

.mobile-link {
  display: block; padding: 12px 14px; border-radius: 12px;
  font-family: 'Montserrat', sans-serif; color: #454d54;
  transition: background 220ms;
  text-decoration: none;
}
.mobile-link:hover { background: rgba(255,255,255,0.7); }

/* Form fields */
.field { display: flex; flex-direction: column; gap: 0.5rem; }
.field > span { font-family: 'Montserrat', sans-serif; font-size: 11px; text-transform: uppercase; letter-spacing: 0.22em; color: #7e8285; }
.field input, .field select, .field textarea {
  border: 1px solid rgba(207,212,216,0.7);
  border-radius: 14px;
  padding: 12px 14px;
  background: rgba(255,255,255,0.7);
  font-family: 'Numans', sans-serif;
  color: var(--brand-fg);
  font-size: 14px;
  transition: border-color 200ms, box-shadow 200ms, background 200ms;
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none; border-color: var(--brand-fg);
  box-shadow: 0 0 0 3px rgba(58,70,79,0.10);
  background: white;
}
.field textarea { resize: vertical; min-height: 80px; }

/* Animaciones */
@keyframes breathe {
  0%, 100% { transform: scale(1); opacity: 0.92; }
  50% { transform: scale(1.04); opacity: 1; }
}
.animate-breathe { animation: breathe 7s ease-in-out infinite; }

@keyframes floaty {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}
.animate-floaty { animation: floaty 6s ease-in-out infinite; }

/* Pulse-rotate suave (para sellos como el sparkles del cierre) */
@keyframes pulse-rotate {
  0%   { transform: rotate(0deg) scale(1); opacity: 0.85; }
  50%  { transform: rotate(180deg) scale(1.04); opacity: 1; }
  100% { transform: rotate(360deg) scale(1); opacity: 0.85; }
}
.animate-pulse-rotate { animation: pulse-rotate 16s linear infinite; }

/* ========================================================
   Reveal utilities (GSAP las activa cuando entran al viewport)
   - .reveal-up: traslada 40px y aparece
   - .reveal-mask: clip-path reveal — perfecto para títulos display
   - .reveal-stagger > * : cascade automático con offset
   Estado inicial vía CSS para evitar flash; GSAP lo limpia al revelar.
   ======================================================== */
.reveal-up { opacity: 0; transform: translateY(40px); will-change: transform, opacity; }
.reveal-mask {
  display: inline-block;
  clip-path: inset(0 100% 0 0);
  -webkit-clip-path: inset(0 100% 0 0);
  will-change: clip-path;
}
.reveal-stagger > * { opacity: 0; transform: translateY(28px); }

/* Card hover unificado — aplicar como .card-lift */
.card-lift { transition: transform 400ms cubic-bezier(0.22, 1, 0.36, 1), box-shadow 400ms cubic-bezier(0.22, 1, 0.36, 1); }
.card-lift:hover { transform: translateY(-6px); box-shadow: 0 24px 60px -24px rgba(58,70,79,0.32); }

/* Botón sheen sweep — barre en hover */
.btn-primary { position: relative; overflow: hidden; isolation: isolate; }
.btn-primary::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(120deg, transparent 0%, transparent 35%, rgba(247,243,236,0.18) 50%, transparent 65%, transparent 100%);
  background-size: 250% 100%; background-position: 200% 0;
  transition: background-position 900ms cubic-bezier(0.22, 1, 0.36, 1);
}
.btn-primary:hover::before { background-position: -50% 0; }

/* Navbar adaptativo en scroll: ya tenemos #navbar.scrolled — sumamos reducción de altura */
#navbar { transition: padding 300ms ease, background-color 300ms ease, backdrop-filter 300ms ease, border-color 300ms ease, box-shadow 300ms ease; }
#navbar.scrolled > div:first-child { padding-top: 0.65rem; padding-bottom: 0.65rem; }

/* Parallax wrapper — imagen leve drift en scroll. Lenis + GSAP la mueve. */
.parallax-img { will-change: transform; }

/* ========================================================
   Partículas decorativas de fondo (CSS-only).
   Solo se intuyen donde el fondo de la sección es translúcido.
   ======================================================== */
.particle {
  position: absolute;
  border-radius: 50%;
  filter: blur(48px);
  opacity: 0.42;
  will-change: transform;
  animation: particle-float 24s ease-in-out infinite;
}

@keyframes particle-float {
  0%, 100% { transform: translate(0, 0) scale(1); }
  25%      { transform: translate(20px, -28px) scale(1.05); }
  50%      { transform: translate(-18px, 22px) scale(0.97); }
  75%      { transform: translate(24px, 18px) scale(1.03); }
}

@media (prefers-reduced-motion: reduce) {
  .particle { animation: none; }
}

@media (max-width: 768px) {
  /* Reducir cantidad en mobile para no saturar */
  #bg-particles .particle:nth-child(n+7) { display: none; }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}
