@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@400;500;600&display=swap');
:root {
  /* Cinematic V2.1 Color Palette - No Red */
  --primary-color: #1a1e26;
  /* Deep Midnight */
  --secondary-color: #c5a059;
  /* Champagne Gold */
  --accent-color: #2a313d;
  /* Muted Slate */
  --text-dark: #0f1115;
  /* Richer Black */
  --text-muted: #8a919b;
  /* Adjusted for better contrast on dark */
  --text-light: #ffffff;
  --bg-light: #fdfdfd;
  --bg-white: #ffffff;
  --bg-dark: #0f1115;
  /* Deep Noir Background */
  --brand-gradient: linear-gradient(135deg, #1a1e26 0%, #0a0c10 100%);

  /* Cinematic Typography */
  --font-heading: 'Montserrat', serif;
  --font-body: 'Inter', sans-serif;

  /* Spacing & Layout */
  --max-width: 1600px;
  --container-padding: 3rem;
  --spacing-section: 12rem;
  /* More air between sections */

  /* Animations & Dynamics */
  --transition-cinematic: 1.2s cubic-bezier(0.16, 1, 0.3, 1);
  --transition-smooth: 0.6s cubic-bezier(0.16, 1, 0.3, 1);
  --transition-fast: 0.3s ease;
  --shadow-premium: 0 30px 60px -15px rgba(0, 0, 0, 0.1);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: var(--font-body);
  color: var(--text-dark);
  background-color: var(--bg-white);
  line-height: 1.8;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: var(--font-heading);
  font-weight: 700;
  color: var(--text-dark);
  margin-bottom: 1.5rem;
  line-height: 1.2;
}

p {
  margin-bottom: 1.5rem;
  color: var(--text-muted);
}

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

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

ul {
  list-style: none;
}

/* Base Layout & Utilities */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--container-padding);
}

.section {
  padding: var(--spacing-section) 0;
}

.section-title {
  font-size: clamp(2rem, 5vw, 3.5rem);
  text-align: center;
  margin-bottom: 4rem;
  font-weight: 400;
}

.section-title span {
  display: block;
  font-family: var(--font-body);
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 4px;
  color: var(--primary-color);
  margin-bottom: 1rem;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 1.2rem 2.8rem;
  font-family: var(--font-body);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 2px;
  font-size: 0.8rem;
  border-radius: 0;
  cursor: pointer;
  transition: var(--transition-smooth);
  border: 1px solid transparent;
  position: relative;
  overflow: hidden;
}

.btn-primary {
  background-color: var(--primary-color);
  color: var(--text-light);
}

.btn-primary:hover {
  background-color: var(--text-dark);
  transform: translateY(-2px);
}

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

.btn-outline:hover {
  background-color: var(--primary-color);
  color: var(--text-light);
  transform: translateY(-2px);
}

/* Animations */
.fade-up {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 1.2s var(--transition-smooth), transform 1.2s var(--transition-smooth);
}

.fade-up.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Header & Smart Navigation */
header {
  background-color: transparent;
  position: fixed;
  width: 100%;
  top: 0;
  z-index: 1000;
  transition: transform var(--transition-smooth), background var(--transition-smooth), padding var(--transition-smooth);
  padding: 4rem 0;
}

header.header-hidden {
  transform: translateY(-100%);
}

header.scrolled {
  background-color: rgba(15, 17, 21, 0.95);
  backdrop-filter: blur(20px);
  padding: 1.5rem 0;
}

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

.logo img {
  height: 120px;
  width: auto;
  transition: var(--transition-smooth);
  filter: brightness(0) invert(1);
}

header.scrolled .logo img {
  height: 85px;
}

/* Hamburger & Nav Overlay */
.hamburger-wrapper {
  cursor: pointer;
  z-index: 2001;
  width: 40px;
  height: 40px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
  transition: transform 0.3s var(--transition-smooth);
}

.hamburger-line {
  width: 100%;
  height: 1px;
  background-color: var(--text-light);
  transition: all 0.3s var(--transition-smooth);
}

.nav-active .hamburger-line:nth-child(1) {
  transform: translateY(3.5px) rotate(45deg);
}

.nav-active .hamburger-line:nth-child(2) {
  width: 0;
  opacity: 0;
}

.nav-active .hamburger-line:nth-child(3) {
  transform: translateY(-3.5px) rotate(-45deg);
}

.nav-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  background: var(--bg-dark);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: all 0.6s cubic-bezier(0.85, 0, 0.15, 1);
  padding: 5rem;
  overflow: hidden;
}

.nav-overlay::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: url('assets/1964_PALACIO_DE_JUSTICIA_JUAN_SORDO_MADALENO_PRINT_B_W_PHOTO_by_Guillermo_Zamora_02.jpg');
  background-size: cover;
  background-position: center;
  opacity: 0.1;
  filter: grayscale(100%);
  z-index: -1;
  transition: transform 10s linear;
}

.nav-overlay.active::before {
  transform: scale(1.1);
}

.nav-overlay.active {
  opacity: 1;
  visibility: visible;
}

.overlay-content {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 10rem;
  width: 100%;
  max-width: 1400px;
}

.overlay-links {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.overlay-links a {
  font-family: var(--font-heading);
  font-size: clamp(1.5rem, 4vw, 3rem);
  color: var(--text-light);
  text-decoration: none;
  opacity: 0.2;
  transition: all 0.5s var(--transition-smooth);
  line-height: 1;
}

.overlay-links a:hover {
  opacity: 1;
  padding-left: 2rem;
  color: var(--secondary-color);
}

.overlay-links a.active {
  opacity: 1;
  color: var(--secondary-color);
}

.overlay-info {
  display: flex;
  flex-direction: column;
  justify-content: center;
  border-left: 1px solid rgba(255, 255, 255, 0.05);
  padding-left: 5rem;
}

.overlay-info h4 {
  text-transform: uppercase;
  letter-spacing: 5px;
  font-size: 0.8rem;
  color: var(--secondary-color);
  margin-bottom: 2rem;
}

.overlay-info p {
  font-size: 1.1rem;
  opacity: 0.6;
  margin-bottom: 3rem;
  line-height: 1.6;
}

.overlay-expertise {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}

.overlay-expertise a {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--text-light);
  opacity: 0.4;
  text-decoration: none;
}

.overlay-expertise a:hover {
  opacity: 1;
  color: var(--secondary-color);
}

@media (max-width: 992px) {
  .overlay-content {
    grid-template-columns: 1fr;
    gap: 4rem;
  }

  .overlay-info {
    border-left: none;
    padding-left: 0;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    padding-top: 4rem;
  }
}

.nav-links a:hover::after,
.nav-links a.active::after {
  width: 100%;
}

/* Cinematic Hero */
.hero-v2 {
  height: 100vh;
  width: 100%;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: var(--bg-dark);
  background-size: cover;
  background-position: center;
}

.hero-video {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.5;
  filter: grayscale(100%) contrast(120%);
}

.hero-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(to bottom, rgba(15, 17, 21, 0.4) 0%, rgba(15, 17, 21, 0.8) 100%);
}

.hero-v2 .container {
  position: relative;
  z-index: 2;
  text-align: center;
}

.hero-v2 h1 {
  font-size: clamp(3rem, 10vw, 7rem);
  font-weight: 300;
  color: var(--text-light);
  line-height: 1;
  margin-bottom: 3rem;
  letter-spacing: -2px;
}

/* Statement Section */
.statement {
  background-color: var(--bg-dark);
  color: var(--text-light);
  padding: 15rem 0;
  text-align: center;
}

.statement h2 {
  font-size: clamp(2rem, 5vw, 4rem);
  font-weight: 300;
  max-width: 1000px;
  margin: 0 auto;
  line-height: 1.4;
  color: var(--text-light);
}

/* Cinematic Matrix */
.matrix-container {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  width: 100%;
}

.matrix-item {
  height: 50vh;
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.matrix-bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-size: cover;
  background-position: center;
  transition: transform 2s var(--transition-cinematic);
  filter: brightness(0.4) grayscale(100%);
}

.matrix-item:hover .matrix-bg {
  transform: scale(1.1);
  filter: brightness(0.6);
}

.matrix-content {
  position: relative;
  z-index: 2;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 3rem;
  color: var(--text-light);
  transition: var(--transition-smooth);
}

.matrix-item:hover .matrix-content {
  padding-bottom: 4rem;
}

.matrix-content h3 {
  font-size: 1.5rem;
  color: var(--text-light);
  margin-bottom: 1rem;
  font-weight: 400;
}

.matrix-content span {
  font-family: var(--font-body);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 3px;
  opacity: 0.6;
}

/* Mobile Menu Toggle */
.mobile-menu-btn {
  display: none;
  font-size: 1.2rem;
  cursor: pointer;
  color: var(--text-light);
}

header.scrolled .mobile-menu-btn {
  color: var(--text-dark);
}

/* Practice Area Grid / Capability Cards */
.practice-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background-color: var(--border-light);
  border: 1px solid var(--border-light);
}

.practice-card {
  background-color: var(--bg-white);
  padding: 4rem 3rem;
  transition: var(--transition-smooth);
  position: relative;
  overflow: hidden;
}

.practice-card:hover {
  background-color: var(--bg-light);
}

.practice-card h3 {
  font-size: 1.2rem;
  margin-bottom: 3rem;
  font-weight: 400;
}

.practice-card .icon {
  font-size: 2rem;
  color: var(--primary-color);
  margin-bottom: 2rem;
  display: block;
}

/* Footer Refinement */
footer {
  background-color: var(--bg-dark);
  color: var(--text-light);
  padding: 1rem 0 0.5rem; /* Ultra compact */
}

.footer-content {
  display: grid;
  grid-template-columns: 2fr 1fr 1.5fr;
  gap: 2rem;
  margin-bottom: 1rem;
}

.footer-col h4 {
  color: var(--text-light);
  text-transform: uppercase;
  letter-spacing: 2px;
  font-size: 0.7rem;
  margin-bottom: 1rem; /* Reduced */
  font-family: var(--font-body);
  font-weight: 400; /* Not bold */
}

.footer-col ul li {
  margin-bottom: 1.2rem;
  font-size: 0.72rem;
  opacity: 0.7;
}

.footer-content p {
  font-size: 0.72rem;
  opacity: 0.5;
}

.footer-col a:hover {
  color: var(--secondary-color);
  opacity: 1;
}

.footer-bottom {
  text-align: center;
  padding-top: 1rem; /* Reduced */
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  font-size: 0.6rem;
  opacity: 0.4;
  letter-spacing: 1px;
}

/* Statement & Typography Refinements */
.statement-section {
  padding: 10rem 2rem;
  text-align: center;
  background: var(--bg-dark);
}

.statement-h2 {
  font-family: var(--font-heading);
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  font-weight: 300;
  max-width: 1000px;
  margin: 0 auto;
  line-height: 1.5;
  color: #fff;
  opacity: 0.9;
  font-style: italic;
  letter-spacing: 0.5px;
}

.hero-v2 {
  background-size: cover;
  background-position: center;
}

.hero-v2 h1 {
  text-shadow: 0 10px 40px rgba(0, 0, 0, 0.6);
}

/* Responsive */
/* Responsive Matrix */
@media (max-width: 1024px) {
  .matrix-container {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  header {
    padding: 2rem 0;
  }

  .nav-links {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background-color: var(--bg-dark);
    flex-direction: column;
    padding: 3rem;
    gap: 2rem;
  }

  .nav-links.active {
    display: flex;
  }

  .mobile-menu-btn {
    display: block;
  }

  .matrix-container {
    grid-template-columns: 1fr;
  }

  .matrix-item {
    height: 40vh;
  }

  .hero-v2 h1 {
    font-size: 3.5rem;
  }

  .section {
    padding: 8rem 0;
  }

  .footer-content {
    grid-template-columns: 1fr;
    gap: 4rem;
  }
}

/* Text Logo Styles */
.text-logo {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  text-decoration: none;
  z-index: 1001; /* Above overlay */
}

.logo-main {
  font-family: var(--font-heading);
  font-size: clamp(0.9rem, 1.5vw, 1.15rem);
  font-weight: 400; /* Regular weight as requested */
  line-height: 1.1;
  color: var(--text-light); /* Base color for main text */
  letter-spacing: 2px;
  position: relative;
  display: inline-block;
  transition: color var(--transition-smooth);
}

.logo-dot {
  color: rgb(183, 30, 38);
  margin: 0 4px;
}

.logo-sub {
  font-family: 'Montserrat', sans-serif;
  font-size: clamp(0.5rem, 0.8vw, 0.65rem);
  font-weight: 400; /* Regular weight as requested */
  text-transform: uppercase;
  letter-spacing: 5px; /* Increased spacing */
  color: rgb(183, 30, 38);
  margin-top: 5px;
  opacity: 1; /* Full opacity */
}

.logo-sub .amp {
  font-family: 'Baskerville', 'Georgia', serif;
  font-style: italic;
  font-size: 1.6em; /* Slightly larger for emphasis */
  font-weight: 400;
  color: rgb(183, 30, 38);
}

/* Scrolled header adjustments */
header.scrolled .logo-main {
  color: var(--text-light); /* Keeping white on dark scrolled bg */
}

/* Footer variant */
.footer-text-logo .logo-main {
  font-size: 0.65rem;
  font-weight: 400;
}

.footer-text-logo .logo-sub {
  font-size: 0.4rem;
  letter-spacing: 3px;
  font-weight: 400;
  color: rgb(183, 30, 38);
}

/* Intro/Light Background Overrides */
/* When logo is over light bg, .logo-main should be dark */
/* Assuming hero is dark, footer is dark, scrolled header is dark. */
/* If header is ever on white bg, it needs var(--text-dark) */

/* Logo Animations */
.logo-main {
  animation: logoSlideDown 1.2s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  opacity: 0;
  transform: translateY(-20px);
}

.logo-sub {
  animation: logoSlideRight 1.2s cubic-bezier(0.16, 1, 0.3, 1) 0.6s forwards;
  opacity: 0;
  transform: translateX(-20px);
}

@keyframes logoSlideDown {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes logoSlideRight {
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* New Hero Layout & Animation Refinements */
.hero-v2 .container {
  padding-top: 150px; /* Closer to initial 80px/100px but with some air */
  display: flex;
  flex-direction: column;
}

.hero-v2 .container > div {
  width: 100%;
}

.right-aligned-slogan {
  margin-left: auto;
  margin-right: 40px;
  text-align: right;
  max-width: 600px;
}

.delayed-entrance {
  opacity: 0;
  animation: fadeUpEntrance 1.2s var(--transition-smooth) 3s forwards;
}

@keyframes fadeUpEntrance {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Areas Grid v3 */
.areas-grid-v3 .grid-item-amb {
    background: var(--bg-dark);
    padding: 4rem 3rem;
    text-decoration: none;
    transition: all 0.4s ease;
    display: flex;
    flex-direction: column;
    border: 0.5px solid rgba(255, 255, 255, 0.02);
    color: var(--text-light);
}

.areas-grid-v3 .grid-item-amb:hover {
    background: #ffffff !important;
    transform: scale(0.99);
    border-color: rgba(0, 0, 0, 0.05);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
}

.areas-grid-v3 .grid-item-amb:hover h3 {
    color: #111111 !important;
}

.areas-grid-v3 .grid-item-amb:hover p {
    color: #555555 !important;
    opacity: 1 !important;
}

.areas-grid-v3 .grid-num {
    color: rgba(255, 255, 255, 0.1);
    font-size: 0.8rem;
    margin-bottom: 2rem;
    font-family: var(--font-body);
}

.areas-grid-v3 .grid-tag {
    color: var(--secondary-color);
    font-size: 0.65rem;
    letter-spacing: 3px;
    text-transform: uppercase;
    margin-bottom: 1.5rem;
    display: block;
}

.areas-grid-v3 .grid-item-amb h3 {
    font-size: 1.8rem;
    color: var(--text-light);
    font-family: var(--font-heading);
    font-weight: 400;
    line-height: 1.2;
    margin-bottom: 1.5rem;
    transition: color 0.4s ease;
}

.areas-grid-v3 .grid-item-amb p {
    font-size: 0.9rem;
    color: var(--text-light);
    opacity: 0.5;
    line-height: 1.6;
    margin-top: auto;
    transition: color 0.4s ease, opacity 0.4s ease;
}

@media (max-width: 1024px) {
    .areas-grid-v3 {
        grid-template-columns: repeat(2, 1fr);
    }
    .empty-slot {
        display: none;
    }
}

@media (max-width: 768px) {
    .areas-grid-v3 {
        grid-template-columns: 1fr;
    }
    .areas-grid-v3 .grid-item-amb {
        padding: 3rem 2rem;
    }
}