/* ============================================
   CASTILLO & ABOGADOS ASOCIADOS
   Design System + Styles
   ============================================ */

/* --- CSS Variables --- */
:root {
  /* Colors - Evolved palette */
  --navy-deep: #0f1923;
  --navy: #1b2838;
  --navy-light: #243447;
  --gold: #b08d57;
  --gold-light: #c4a265;
  --gold-hover: #9a7a4a;
  --cream: #f5f1eb;
  --cream-dark: #e8e2d8;
  --blue-grey: #8a9bae;
  --text-dark: #1a1a1a;
  --text-body: #4a4a4a;
  --text-light: #7a7a7a;
  --white: #ffffff;
  --border: rgba(0,0,0,0.08);
  --border-light: rgba(255,255,255,0.1);

  /* Typography */
  --font-heading: 'Cormorant Garamond', Georgia, 'Times New Roman', serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'SF Mono', 'Fira Code', monospace;

  /* Spacing */
  --section-padding: 120px;
  --container-width: 1200px;
  --container-narrow: 900px;
  --gap: 24px;
  --gap-lg: 48px;

  /* Transitions */
  --ease: cubic-bezier(0.16, 1, 0.32, 1);
  --duration: 0.4s;
  --duration-fast: 0.2s;
}

/* --- Reset & Base --- */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-body);
  font-weight: 300;
  font-size: 16px;
  line-height: 1.7;
  color: var(--text-body);
  background: var(--white);
  overflow-x: hidden;
}

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

a {
  color: inherit;
  text-decoration: none;
  transition: color var(--duration-fast) ease;
}

ul, ol {
  list-style: none;
}

/* --- Typography --- */
h1, h2, h3, h4, h5 {
  font-family: var(--font-heading);
  font-weight: 500;
  line-height: 1.15;
  color: var(--text-dark);
}

h1 {
  font-size: clamp(2.5rem, 5vw, 4rem);
  letter-spacing: -0.02em;
}

h2 {
  font-size: clamp(2rem, 4vw, 3rem);
  letter-spacing: -0.01em;
}

h3 {
  font-size: clamp(1.5rem, 3vw, 2rem);
}

h4 {
  font-size: 1.25rem;
}

p {
  margin-bottom: 1em;
}

p:last-child {
  margin-bottom: 0;
}

.label {
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  gap: 16px;
}

.label::before {
  content: '';
  display: inline-block;
  width: 40px;
  height: 1px;
  background: currentColor;
}

/* --- Container --- */
.container {
  width: 100%;
  max-width: var(--container-width);
  margin: 0 auto;
  padding: 0 var(--gap);
}

.container--narrow {
  max-width: var(--container-narrow);
}

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 2px;
  text-transform: uppercase;
  padding: 16px 32px;
  border: none;
  cursor: pointer;
  transition: all var(--duration) var(--ease);
  position: relative;
  overflow: hidden;
}

.btn--primary {
  background: var(--gold);
  color: var(--navy-deep);
}

.btn--primary:hover {
  background: var(--gold-hover);
  transform: translateY(-1px);
}

.btn--outline {
  background: transparent;
  border: 1px solid currentColor;
  color: var(--cream);
}

.btn--outline:hover {
  background: rgba(255,255,255,0.05);
}

.btn--outline-dark {
  background: transparent;
  border: 1px solid var(--navy);
  color: var(--navy);
}

.btn--outline-dark:hover {
  background: var(--navy);
  color: var(--cream);
}

.btn--dark {
  background: var(--navy-deep);
  color: var(--cream);
}

.btn--dark:hover {
  background: var(--navy);
}

.btn svg,
.btn .arrow {
  transition: transform var(--duration-fast) ease;
}

.btn:hover svg,
.btn:hover .arrow {
  transform: translateX(4px);
}

/* --- Navigation --- */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1000;
  padding: 24px 0;
  transition: all var(--duration) var(--ease);
}

.nav--scrolled {
  background: rgba(15, 25, 35, 0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  padding: 16px 0;
  box-shadow: 0 1px 0 rgba(255,255,255,0.05);
}

.nav__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav__logo {
  display: flex;
  align-items: center;
  gap: 12px;
}

.nav__logo img {
  height: 44px;
  width: auto;
}

.nav__logo-text {
  font-family: var(--font-body);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--cream);
  line-height: 1.4;
}

.nav__links {
  display: flex;
  align-items: center;
  gap: 40px;
}

.nav__link {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--blue-grey);
  transition: color var(--duration-fast) ease;
  position: relative;
}

.nav__link::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 1px;
  background: var(--gold);
  transition: width var(--duration) var(--ease);
}

.nav__link:hover,
.nav__link--active {
  color: var(--cream);
}

.nav__link:hover::after,
.nav__link--active::after {
  width: 100%;
}

.nav__link--active {
  color: var(--gold);
}

/* Mobile menu */
.nav__toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
}

.nav__toggle span {
  display: block;
  width: 24px;
  height: 1.5px;
  background: var(--cream);
  transition: all var(--duration-fast) ease;
}

.nav__toggle.active span:nth-child(1) {
  transform: rotate(45deg) translate(4px, 4px);
}

.nav__toggle.active span:nth-child(2) {
  opacity: 0;
}

.nav__toggle.active span:nth-child(3) {
  transform: rotate(-45deg) translate(5px, -5px);
}

/* --- Hero --- */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  background: var(--navy-deep);
  overflow: hidden;
}

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

.hero__bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 10% 70%;
}

.hero__bg::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to right, rgba(15,25,35,0.95) 0%, rgba(15,25,35,0.85) 45%, rgba(27,40,56,0.4) 75%, rgba(27,40,56,0.20) 100%);
}

.hero__content {
  position: relative;
  z-index: 1;
  max-width: 680px;
  padding-top: 120px;
}

.hero__label {
  color: var(--gold);
  margin-bottom: 32px;
}

.hero__title {
  color: var(--cream);
  margin-bottom: 24px;
}

.hero__title .accent {
  color: var(--gold-light);
}

.hero__subtitle {
  font-size: 18px;
  font-weight: 300;
  color: var(--blue-grey);
  line-height: 1.7;
  margin-bottom: 40px;
  max-width: 520px;
}

.hero__actions {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

/* --- Stats --- */
.stats {
  padding: 80px 0;
  border-bottom: 1px solid var(--border);
}

.stats__grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
}

.stats__item {
  text-align: center;
  padding: 24px;
  position: relative;
}

.stats__item:not(:last-child)::after {
  content: '';
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  height: 60px;
  width: 1px;
  background: var(--border);
}

.stats__number {
  font-family: var(--font-heading);
  font-size: clamp(2.5rem, 4vw, 3.5rem);
  font-weight: 400;
  color: var(--text-dark);
  line-height: 1;
  margin-bottom: 8px;
}

.stats__text {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--text-light);
}

/* --- Section (generic) --- */
.section {
  padding: var(--section-padding) 0;
}

.section--dark {
  background: var(--navy-deep);
  color: var(--cream);
}

.section--dark h2,
.section--dark h3 {
  color: var(--cream);
}

.section--cream {
  background: var(--cream);
}

.section__header {
  margin-bottom: var(--gap-lg);
}

.section__label {
  color: var(--gold);
  margin-bottom: 24px;
}

.section--dark .section__label {
  color: var(--gold-light);
}

/* --- About (La Firma) --- */
.about__grid {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 80px;
  align-items: start;
}

.about__text p {
  font-size: 17px;
  line-height: 1.8;
  color: var(--text-body);
}

.about__text p + p {
  margin-top: 16px;
}

/* --- Team Photo --- */
.team-photo {
  padding: 0;
  overflow: hidden;
}

.team-photo__img {
  width: 100%;
  max-height: 600px;
  object-fit: cover;
}

.team-photo__caption {
  padding: 24px 0;
  background: var(--cream);
}

.team-photo__caption .label {
  color: var(--text-light);
  justify-content: center;
}

/* --- Practice Areas --- */
.areas__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
}

.area-card {
  background: var(--white);
  padding: 40px 32px;
  transition: all var(--duration) var(--ease);
  position: relative;
  cursor: pointer;
}

.area-card::before {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--gold);
  transition: width var(--duration) var(--ease);
}

.area-card:hover {
  background: var(--cream);
}

.area-card:hover::before {
  width: 100%;
}

.area-card__number {
  font-family: var(--font-heading);
  font-size: 14px;
  color: var(--gold);
  margin-bottom: 16px;
  font-weight: 400;
}

.area-card__title {
  font-family: var(--font-heading);
  font-size: 1.35rem;
  font-weight: 500;
  color: var(--text-dark);
  margin-bottom: 12px;
}

.area-card__desc {
  font-size: 14px;
  color: var(--text-light);
  line-height: 1.6;
  margin-bottom: 20px;
}

.area-card__link {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--gold);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: gap var(--duration-fast) ease;
}

.area-card:hover .area-card__link {
  gap: 12px;
}

/* --- Quote / Commitment --- */
.quote {
  padding: 100px 0;
  background: var(--navy-deep);
  text-align: center;
}

.quote__text {
  font-family: var(--font-heading);
  font-size: clamp(1.5rem, 3vw, 2.2rem);
  font-weight: 400;
  color: var(--cream);
  line-height: 1.5;
  max-width: 800px;
  margin: 0 auto 32px;
  font-style: italic;
}

.quote__author {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--blue-grey);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
}

.quote__author::before {
  content: '';
  width: 40px;
  height: 1px;
  background: var(--blue-grey);
}

/* --- CTA Section --- */
.cta {
  padding: var(--section-padding) 0;
}

.cta__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 80px;
  align-items: center;
}

.cta__title {
  margin-bottom: 16px;
}

.cta__text {
  font-size: 17px;
  color: var(--text-light);
}

.cta__actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.cta__email {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  background: var(--navy-deep);
  color: var(--cream);
  padding: 18px 32px;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  transition: background var(--duration-fast) ease;
}

.cta__email:hover {
  background: var(--navy);
}

/* --- Footer --- */
.footer {
  background: var(--navy-deep);
  color: var(--blue-grey);
  padding: 80px 0 32px;
}

.footer__grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1.2fr;
  gap: 60px;
  margin-bottom: 60px;
}

.footer__logo {
  margin-bottom: 24px;
}

.footer__logo img {
  height: 44px;
}

.footer__desc {
  font-size: 14px;
  line-height: 1.7;
  max-width: 320px;
}

.footer__heading {
  font-family: var(--font-body);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 24px;
}

.footer__links {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.footer__link {
  font-size: 14px;
  color: var(--blue-grey);
  transition: color var(--duration-fast) ease;
}

.footer__link:hover {
  color: var(--cream);
}

.footer__contact-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 16px;
  font-size: 14px;
  line-height: 1.6;
}

.footer__contact-item svg {
  flex-shrink: 0;
  margin-top: 3px;
  color: var(--gold);
}

.footer__bottom {
  padding-top: 32px;
  border-top: 1px solid var(--border-light);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
}

.footer__legal {
  display: flex;
  gap: 24px;
}

.footer__legal a:hover {
  color: var(--cream);
}

/* --- WhatsApp Button --- */
.whatsapp {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 999;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: #25d366;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 16px rgba(37, 211, 102, 0.3);
  transition: transform var(--duration-fast) ease, box-shadow var(--duration-fast) ease;
}

.whatsapp:hover {
  transform: scale(1.08);
  box-shadow: 0 6px 24px rgba(37, 211, 102, 0.4);
}

.whatsapp svg {
  width: 28px;
  height: 28px;
  fill: white;
}

/* --- Animations (scroll reveal) --- */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.8s var(--ease), transform 0.8s var(--ease);
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

.reveal-delay-1 { transition-delay: 0.1s; }
.reveal-delay-2 { transition-delay: 0.2s; }
.reveal-delay-3 { transition-delay: 0.3s; }

/* --- Mobile Navigation Overlay --- */
.nav__menu-mobile {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 25, 35, 0.98);
  z-index: 999;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 32px;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--duration) ease;
}

.nav__menu-mobile.active {
  opacity: 1;
  pointer-events: all;
}

.nav__menu-mobile .nav__link {
  font-size: 16px;
  letter-spacing: 3px;
}

/* --- Page Header (for internal pages) --- */
.page-header {
  background: var(--navy-deep);
  padding: 160px 0 80px;
  position: relative;
  overflow: hidden;
}

.page-header--hero {
  min-height: 93vh;
  display: flex;
  align-items: flex-end;
}

.page-header__bg {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.page-header__bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 100% 50%;
}

.page-header__bg::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to right, rgba(15,25,35,0.92) 0%, rgba(15,25,35,0.8) 50%, rgba(27,40,56,0.6) 80%, rgba(27,40,56,0.4) 100%);
}

.page-header--hero .container {
  position: relative;
  z-index: 1;
}

.page-header::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: var(--border-light);
}

.page-header__label {
  color: var(--gold);
  margin-bottom: 24px;
}

.page-header__title {
  color: var(--cream);
  max-width: 600px;
}

.page-header__subtitle {
  font-size: 18px;
  color: var(--blue-grey);
  margin-top: 16px;
  max-width: 500px;
  font-weight: 300;
}

/* --- Blog cards --- */
.blog__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--gap);
}

.blog-card {
  border: 1px solid var(--border);
  transition: all var(--duration) var(--ease);
}

.blog-card:hover {
  border-color: var(--gold);
  transform: translateY(-4px);
  box-shadow: 0 12px 40px rgba(0,0,0,0.06);
}

.blog-card__img {
  aspect-ratio: 16/9;
  overflow: hidden;
}

.blog-card__img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--duration) var(--ease);
}

.blog-card:hover .blog-card__img img {
  transform: scale(1.05);
}

.blog-card__body {
  padding: 24px;
}

.blog-card__date {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 12px;
}

.blog-card__title {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 500;
  color: var(--text-dark);
  margin-bottom: 12px;
  line-height: 1.3;
}

.blog-card__excerpt {
  font-size: 14px;
  color: var(--text-light);
  line-height: 1.6;
}

/* --- Contact Form --- */
.form__group {
  margin-bottom: 24px;
}

.form__label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--text-dark);
  margin-bottom: 8px;
}

.form__input,
.form__textarea,
.form__select {
  width: 100%;
  padding: 14px 16px;
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 300;
  color: var(--text-dark);
  background: var(--white);
  border: 1px solid var(--cream-dark);
  transition: border-color var(--duration-fast) ease;
  outline: none;
}

.form__input:focus,
.form__textarea:focus,
.form__select:focus {
  border-color: var(--gold);
}

.form__textarea {
  resize: vertical;
  min-height: 140px;
}

/* --- Alianzas --- */
.alianzas__grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--gap);
}

.alianza-card {
  border: 1px solid var(--border);
  padding: 40px 24px;
  text-align: center;
  transition: all var(--duration) var(--ease);
}

.alianza-card:hover {
  border-color: var(--gold);
  background: var(--cream);
}

/* --- Responsive --- */
@media (max-width: 1024px) {
  :root {
    --section-padding: 80px;
  }

  .about__grid {
    grid-template-columns: 1fr;
    gap: 40px;
  }

  .areas__grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .cta__grid {
    grid-template-columns: 1fr;
    gap: 40px;
  }

  .footer__grid {
    grid-template-columns: 1fr 1fr;
    gap: 40px;
  }

  .blog__grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .alianzas__grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 768px) {
  :root {
    --section-padding: 64px;
  }

  .nav__links {
    display: none;
  }

  .nav__toggle {
    display: flex;
  }

  .nav__menu-mobile {
    display: flex;
  }

  .stats__grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .stats__item:nth-child(2)::after {
    display: none;
  }

  .stats__item:nth-child(1)::after,
  .stats__item:nth-child(3)::after {
    height: 40px;
  }

  .areas__grid {
    grid-template-columns: 1fr;
  }

  .hero__content {
    padding-top: 100px;
  }

  .hero__actions {
    flex-direction: column;
  }

  .hero__actions .btn {
    text-align: center;
    justify-content: center;
  }

  .footer__grid {
    grid-template-columns: 1fr;
    gap: 32px;
  }

  .footer__bottom {
    flex-direction: column;
    gap: 16px;
    text-align: center;
  }

  .blog__grid {
    grid-template-columns: 1fr;
  }

  .cta__actions {
    max-width: 100%;
  }

  .page-header {
    padding: 120px 0 60px;
  }

  .alianzas__grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 480px) {
  .stats__grid {
    grid-template-columns: 1fr 1fr;
  }

  .stats__item::after {
    display: none !important;
  }

  .alianzas__grid {
    grid-template-columns: 1fr;
  }
}
/* ===== MODALS ÁREAS DE PRÁCTICA ===== */
.modal-area { display:none; position:fixed; top:0; left:0; width:100%; height:100%; z-index:9999; align-items:center; justify-content:center; }
.modal-area--open { display:flex; }
.modal-area__backdrop { position:absolute; top:0; left:0; width:100%; height:100%; background:rgba(0,0,0,0.7); backdrop-filter:blur(4px); }
.modal-area__content { position:relative; background:#1b2838; border:1px solid rgba(255,255,255,0.08); border-radius:12px; padding:48px; max-width:560px; width:90%; max-height:85vh; overflow-y:auto; color:#e8e0d4; }
.modal-area__close { position:absolute; top:16px; right:16px; background:none; border:none; color:#8a9bae; cursor:pointer; }
.modal-area__close:hover { color:#e8e0d4; }
.modal-area__number { font-family:var(--font-heading); font-size:14px; color:var(--gold); margin-bottom:12px; }
.modal-area__title { font-family:var(--font-heading); font-size:1.5rem; font-weight:500; color:#e8e0d4; margin-bottom:16px; }
.modal-area__text { font-size:15px; line-height:1.7; color:#8a9bae; margin-bottom:20px; }
.modal-area__subtitle { font-size:14px; font-weight:500; color:#e8e0d4; margin-bottom:12px; }
.modal-area__list { list-style:none; padding:0; margin:0; }
.modal-area__list li { font-size:14px; color:#8a9bae; padding:8px 0; border-bottom:1px solid rgba(255,255,255,0.05); padding-left:16px; position:relative; }
.modal-area__list li::before { content:""; position:absolute; left:0; top:50%; width:6px; height:6px; border-radius:50%; background:var(--gold); transform:translateY(-50%); }