/* =============================================
   CAÑATE asociados — Inteligencia Jurídica
   Brand Design System — Neo-Caribe
   HTML + CSS + JS (Vanilla)
   ============================================= */

:root {
  --azul-precedente: #1A3B60;
  --azul-precedente-light: #2a5a8a;
  --azul-precedente-dark: #0f2640;
  --oro-ocre: #C5A059;
  --oro-ocre-light: #d4b878;
  --oro-ocre-glow: rgba(197, 160, 89, 0.3);
  --cian-generativo: #00E5FF;
  --cian-generativo-dim: rgba(0, 229, 255, 0.15);
  --cian-generativo-glow: rgba(0, 229, 255, 0.4);
  --blanco-arena: #F5F0E8;
  --blanco-puro: #FFFFFF;
  --gris-suave: #E8E4DC;
  --gris-texto: #6B7280;
  --texto-oscuro: #1F2937;

  --font-sans: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-light: 300;
  --font-regular: 400;
  --font-medium: 500;
  --font-semibold: 600;
  --font-bold: 700;
  --font-extrabold: 800;

  --max-width: 1200px;
  --header-height: 80px;
  --section-padding: 100px 24px;
  --radius-sm: 8px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-xl: 32px;

  --transition-fast: 0.2s ease;
  --transition-base: 0.3s ease;
  --transition-slow: 0.5s ease;

  --glass-bg: rgba(255, 255, 255, 0.08);
  --glass-border: rgba(255, 255, 255, 0.12);
  --glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
  --glass-blur: blur(12px);
}

/* Reset */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; font-size: 16px; }

body {
  font-family: var(--font-sans);
  font-weight: var(--font-regular);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--texto-oscuro);
  background-color: var(--blanco-arena);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

img { max-width: 100%; height: auto; display: block; }
a { text-decoration: none; color: inherit; }
ul { list-style: none; }
button { cursor: pointer; border: none; background: none; font-family: inherit; }

h1, h2, h3, h4, h5, h6 {
  font-weight: var(--font-bold);
  line-height: 1.2;
  color: var(--azul-precedente);
}

/* Scrollbar */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--blanco-arena); }
::-webkit-scrollbar-thumb { background: var(--azul-precedente); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--azul-precedente-light); }

/* ========== UTILIDADES ========== */
.container { max-width: var(--max-width); margin: 0 auto; padding: 0 24px; }

.section-title {
  font-size: 2.25rem;
  font-weight: var(--font-bold);
  margin-bottom: 0.5rem;
  color: var(--azul-precedente);
}

.section-subtitle {
  font-size: 1.125rem;
  color: var(--gris-texto);
  max-width: 600px;
  margin-bottom: 3rem;
  font-weight: var(--font-light);
}

.glass-card {
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--glass-shadow);
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 32px;
  background: linear-gradient(135deg, var(--azul-precedente), var(--azul-precedente-light));
  color: var(--blanco-puro);
  font-weight: var(--font-semibold);
  font-size: 1rem;
  border-radius: var(--radius-sm);
  transition: all var(--transition-base);
  border: 1px solid transparent;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(26, 59, 96, 0.3);
  border-color: var(--cian-generativo);
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 32px;
  background: transparent;
  color: var(--azul-precedente);
  font-weight: var(--font-semibold);
  font-size: 1rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--azul-precedente);
  transition: all var(--transition-base);
}

.btn-secondary:hover {
  background: var(--azul-precedente);
  color: var(--blanco-puro);
  transform: translateY(-2px);
}

/* ========== HEADER ========== */
.header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 1000;
  height: var(--header-height);
  display: flex;
  align-items: center;
  transition: all var(--transition-base);
  background: transparent;
}

.header--scrolled {
  background: rgba(245, 240, 232, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(197, 160, 89, 0.15);
  box-shadow: 0 1px 20px rgba(26, 59, 96, 0.06);
}

.header__inner {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* Logo */
.header__logo {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.header__logo-icon {
  width: 40px; height: 40px;
  color: var(--azul-precedente);
  flex-shrink: 0;
}

.header__logo-icon svg { width: 100%; height: 100%; }

.header__logo-text {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}

.header__logo-line1 {
  font-size: 1.1rem;
  font-weight: var(--font-extrabold);
  color: var(--azul-precedente);
  letter-spacing: -0.3px;
  text-transform: uppercase;
}

.header__logo-amper {
  font-weight: var(--font-light);
  font-size: 0.75rem;
  text-transform: lowercase;
  letter-spacing: 0.3px;
  color: var(--gris-texto);
}

.header__logo-line2 {
  font-size: 0.75rem;
  font-weight: var(--font-medium);
  color: var(--azul-precedente);
  letter-spacing: 0.5px;
}

.header__logo-ia {
  color: var(--oro-ocre);
  font-weight: var(--font-bold);
  position: relative;
}

.header__logo-ia::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0; right: 0;
  height: 1.5px;
  background: var(--oro-ocre);
  opacity: 0.5;
}

/* Navegación desktop */
.header__nav {
  display: flex;
  align-items: center;
  gap: 32px;
}

.header__nav-link {
  font-size: 0.875rem;
  font-weight: var(--font-medium);
  color: var(--azul-precedente);
  position: relative;
  padding: 4px 0;
  transition: color var(--transition-fast);
}

.header__nav-link::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--cian-generativo);
  transition: width var(--transition-base);
}

.header__nav-link:hover { color: var(--azul-precedente-light); }
.header__nav-link:hover::after { width: 100%; }

.header__cta { padding: 10px 24px; font-size: 0.875rem; }

/* Hamburger */
.header__hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  width: 36px; height: 36px;
  gap: 5px;
  z-index: 1001;
}

.header__hamburger span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--azul-precedente);
  border-radius: 2px;
  transition: all var(--transition-fast);
  transform-origin: center;
}

.header__hamburger.is-active span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.header__hamburger.is-active span:nth-child(2) { opacity: 0; }
.header__hamburger.is-active span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Menú mobile */
.header__mobile {
  position: fixed;
  top: 0;
  right: -100%;
  width: 280px;
  height: 100vh;
  background: var(--blanco-puro);
  box-shadow: -8px 0 32px rgba(0, 0, 0, 0.1);
  padding: calc(var(--header-height) + 24px) 32px 32px;
  transition: right var(--transition-base);
  z-index: 999;
}

.header__mobile--open { right: 0; }

.header__mobile-nav {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.header__mobile-link {
  font-size: 1.125rem;
  font-weight: var(--font-medium);
  color: var(--azul-precedente);
  padding: 8px 0;
  border-bottom: 1px solid var(--gris-suave);
  transition: color var(--transition-fast);
}

.header__mobile-link:hover { color: var(--oro-ocre); }
.header__cta-mobile { margin-top: 16px; justify-content: center; text-align: center; }

/* ========== HERO ========== */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  overflow: hidden;
  padding-top: var(--header-height);
}

.hero__canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  pointer-events: auto;
}

.hero__gradient {
  position: absolute;
  inset: 0;
  z-index: 0;
  background:
    radial-gradient(ellipse 80% 60% at 50% 40%, rgba(0, 229, 255, 0.05) 0%, transparent 70%),
    radial-gradient(ellipse 60% 50% at 80% 80%, rgba(197, 160, 89, 0.06) 0%, transparent 60%),
    radial-gradient(ellipse 50% 50% at 20% 20%, rgba(26, 59, 96, 0.04) 0%, transparent 60%);
}

.hero__content {
  position: relative;
  z-index: 2;
  max-width: 720px;
}

.hero__badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 16px;
  background: var(--cian-generativo-dim);
  border: 1px solid rgba(0, 229, 255, 0.2);
  border-radius: 100px;
  font-size: 0.8125rem;
  font-weight: var(--font-medium);
  color: var(--azul-precedente);
  margin-bottom: 28px;
  animation: fadeSlideUp 0.6s ease both;
}

.hero__badge-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--cian-generativo);
  animation: pulse-dot 2s ease-in-out infinite;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(1.4); }
}

@keyframes fadeSlideUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.hero__title {
  font-size: 3.25rem;
  font-weight: var(--font-extrabold);
  line-height: 1.1;
  color: var(--azul-precedente);
  margin-bottom: 20px;
  animation: fadeSlideUp 0.6s ease 0.1s both;
}

.hero__title-accent {
  background: linear-gradient(135deg, var(--azul-precedente) 40%, var(--cian-generativo));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero__description {
  font-size: 1.125rem;
  color: var(--gris-texto);
  line-height: 1.7;
  max-width: 560px;
  margin-bottom: 36px;
  font-weight: var(--font-light);
  animation: fadeSlideUp 0.6s ease 0.2s both;
}

.hero__actions {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  animation: fadeSlideUp 0.6s ease 0.3s both;
}

.hero__stats {
  display: flex;
  align-items: center;
  gap: 24px;
  margin-top: 56px;
  padding-top: 32px;
  border-top: 1px solid var(--gris-suave);
  animation: fadeSlideUp 0.6s ease 0.4s both;
}

.hero__stat { display: flex; flex-direction: column; gap: 2px; }

.hero__stat-number {
  font-size: 1.5rem;
  font-weight: var(--font-bold);
  color: var(--azul-precedente);
}

.hero__stat-label {
  font-size: 0.8125rem;
  color: var(--gris-texto);
  font-weight: var(--font-light);
}

.hero__stat-divider {
  width: 1px;
  height: 36px;
  background: var(--gris-suave);
}

/* ========== SERVICIOS ========== */
.services {
  background: var(--blanco-puro);
  padding: var(--section-padding);
}

.services__header { text-align: center; margin-bottom: 16px; }
.services__header .section-subtitle { margin-left: auto; margin-right: auto; }

.services__title-highlight {
  color: var(--oro-ocre);
  position: relative;
}

.services__title-highlight::after {
  content: '';
  position: absolute;
  bottom: 2px;
  left: 0; right: 0;
  height: 3px;
  background: var(--oro-ocre);
  opacity: 0.4;
  border-radius: 2px;
}

.services__grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
}

.services__card {
  position: relative;
  padding: 32px;
  border-radius: var(--radius-md);
  background: var(--blanco-arena);
  border: 1px solid var(--gris-suave);
  overflow: hidden;
  transition: all var(--transition-base);
}

.services__card:hover {
  transform: translateY(-4px);
  border-color: var(--cian-generativo);
  box-shadow: 0 12px 40px rgba(0, 229, 255, 0.08);
}

.services__card-glow {
  position: absolute;
  top: -50%;
  right: -50%;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle at top right, rgba(0, 229, 255, 0.04), transparent 70%);
  pointer-events: none;
  transition: opacity var(--transition-base);
  opacity: 0;
}

.services__card:hover .services__card-glow { opacity: 1; }

.services__card-icon {
  width: 44px; height: 44px;
  color: var(--oro-ocre);
  margin-bottom: 20px;
}

.services__card-icon svg { width: 100%; height: 100%; }

.services__card-title {
  font-size: 1.25rem;
  font-weight: var(--font-semibold);
  color: var(--azul-precedente);
  margin-bottom: 10px;
}

.services__card-desc {
  font-size: 0.9375rem;
  color: var(--gris-texto);
  line-height: 1.7;
  font-weight: var(--font-light);
}

/* ========== DASHBOARD ========== */
.dashboard {
  background: var(--azul-precedente);
  padding: var(--section-padding);
  position: relative;
  overflow: hidden;
}

.dashboard::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 60% 50% at 20% 30%, rgba(0, 229, 255, 0.06) 0%, transparent 60%),
    radial-gradient(ellipse 50% 50% at 80% 70%, rgba(197, 160, 89, 0.05) 0%, transparent 60%);
  pointer-events: none;
}

.dashboard__header { text-align: center; margin-bottom: 16px; position: relative; }
.dashboard__header .section-title { color: var(--blanco-puro); }
.dashboard__header .section-subtitle { color: rgba(255, 255, 255, 0.6); margin-left: auto; margin-right: auto; }

.dashboard__title-highlight {
  color: var(--cian-generativo);
  text-shadow: 0 0 30px var(--cian-generativo-glow);
}

.dashboard__metrics {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 32px;
  position: relative;
}

.dashboard__metric {
  position: relative;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  overflow: hidden;
  transition: transform var(--transition-base);
}

.dashboard__metric:hover { transform: translateY(-2px); }

.dashboard__metric-bar {
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  opacity: 0.6;
}

.dashboard__metric-value {
  font-size: 1.75rem;
  font-weight: var(--font-bold);
  line-height: 1;
}

.dashboard__metric-label {
  font-size: 0.8125rem;
  color: rgba(255, 255, 255, 0.7);
  font-weight: var(--font-light);
}

.dashboard__metric-trend {
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.5);
  font-weight: var(--font-light);
}

.dashboard__panel {
  position: relative;
  padding: 32px;
  margin-top: 48px;
}

.dashboard__panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 28px;
}

.dashboard__panel-title {
  font-size: 1.125rem;
  font-weight: var(--font-semibold);
  color: var(--blanco-puro);
}

.dashboard__panel-badge {
  padding: 4px 12px;
  border-radius: 100px;
  background: var(--cian-generativo-dim);
  border: 1px solid rgba(0, 229, 255, 0.2);
  font-size: 0.75rem;
  color: var(--cian-generativo);
  font-weight: var(--font-medium);
}

.dashboard__panel-body {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
}

.dashboard__network {
  background: rgba(0, 0, 0, 0.15);
  border-radius: var(--radius-md);
  padding: 16px;
  min-height: 260px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.dashboard__network-svg {
  width: 100%;
  height: auto;
  max-height: 240px;
}

.dashboard__predictions-title {
  font-size: 0.9375rem;
  font-weight: var(--font-semibold);
  color: var(--blanco-puro);
  margin-bottom: 16px;
}

.dashboard__prediction-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.dashboard__prediction-info {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 120px;
}

.dashboard__prediction-court {
  font-size: 0.8125rem;
  color: rgba(255, 255, 255, 0.8);
  font-weight: var(--font-medium);
}

.dashboard__prediction-outcome {
  font-size: 0.7rem;
  font-weight: var(--font-light);
}

.dashboard__prediction-bar-wrap {
  flex: 1;
  height: 6px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 3px;
  overflow: hidden;
}

.dashboard__prediction-bar {
  height: 100%;
  border-radius: 3px;
  transition: width 1s ease;
}

.dashboard__prediction-pct {
  font-size: 0.8125rem;
  font-weight: var(--font-semibold);
  color: rgba(255, 255, 255, 0.7);
  min-width: 36px;
  text-align: right;
}

/* ========== CONTACTO ========== */
.contacto {
  padding: var(--section-padding);
  background: var(--blanco-puro);
  text-align: center;
}

.contacto__content {
  max-width: 640px;
  margin: 0 auto;
}

.contacto__content .section-subtitle {
  margin-left: auto;
  margin-right: auto;
}

.contacto__btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 16px 36px;
  font-size: 1.0625rem;
}

/* ========== FOOTER ========== */
.footer {
  background: var(--azul-precedente-dark);
  color: rgba(255, 255, 255, 0.8);
  padding: var(--section-padding);
  padding-bottom: 32px;
}

.footer__grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1fr;
  gap: 48px;
  padding-bottom: 48px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.footer__logo {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.footer__logo .header__logo-icon { color: var(--blanco-puro); }
.footer__logo .header__logo-line1 { color: var(--blanco-puro); }
.footer__logo .header__logo-line2 { color: rgba(255, 255, 255, 0.7); }

.footer__brand-desc {
  font-size: 0.875rem;
  color: rgba(255, 255, 255, 0.55);
  line-height: 1.7;
  font-weight: var(--font-light);
  max-width: 320px;
}

.footer__col-title {
  font-size: 0.8125rem;
  font-weight: var(--font-semibold);
  color: var(--blanco-puro);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 20px;
}

.footer__links {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.footer__link {
  font-size: 0.875rem;
  color: rgba(255, 255, 255, 0.6);
  transition: color var(--transition-fast);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.footer__link:hover { color: var(--cian-generativo); }

.footer__link-social svg { opacity: 0.6; }
.footer__link-social:hover svg { opacity: 1; }

.footer__bottom {
  padding-top: 24px;
  text-align: center;
  font-size: 0.8125rem;
  color: rgba(255, 255, 255, 0.35);
}

/* ========== RESPONSIVE ========== */
@media (max-width: 1024px) {
  .dashboard__metrics { grid-template-columns: repeat(2, 1fr); }
  .dashboard__panel-body { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  :root {
    --section-padding: 60px 20px;
    --header-height: 64px;
  }

  .container { padding: 0 16px; }

  .section-title { font-size: 1.75rem; }
  .section-subtitle { font-size: 1rem; }

  /* Header */
  .header__nav { display: none; }
  .header__hamburger { display: flex; }
  .header__logo-line1 { font-size: 0.95rem; }
  .header__logo-line2 { font-size: 0.65rem; }
  .header__logo-icon { width: 32px; height: 32px; }

  /* Hero */
  .hero__title { font-size: 2rem; }
  .hero__description { font-size: 1rem; }
  .hero__stats { flex-direction: column; align-items: flex-start; gap: 16px; margin-top: 40px; padding-top: 24px; }
  .hero__stat-divider { display: none; }
  .hero__actions { flex-direction: column; }
  .hero__actions .btn-primary,
  .hero__actions .btn-secondary { width: 100%; justify-content: center; }

  /* Services */
  .services__grid { grid-template-columns: 1fr; }
  .services__card { padding: 24px; }

  /* Dashboard */
  .dashboard__metrics { grid-template-columns: 1fr 1fr; gap: 10px; }
  .dashboard__metric { padding: 16px; }
  .dashboard__metric-value { font-size: 1.35rem; }
  .dashboard__panel { padding: 20px; }
  .dashboard__panel-header { flex-direction: column; align-items: flex-start; gap: 8px; }
  .dashboard__prediction-info { min-width: 90px; }

  /* Footer */
  .footer__grid { grid-template-columns: 1fr; gap: 32px; }
}
