:root {
  /* Official Corporate Palette */
  --color-bg: #F5F2EE; /* Crema suave */
  --color-text: #1C1C1C; /* Negro suave */
  --color-accent: #8A817C; /* Gris topo */
  --color-primary: #B5A48C; /* Dorado apagado */
  --color-secondary: #A1866F; /* Madera natural */
  --color-stone: #CFC7BD; /* Piedra clara */
  --color-sand: #D8D2CB; /* Arena cálida */
  --color-beige: #EAE6E1; /* Beige base */
  
  --color-glass: rgba(245, 242, 238, 0.6);
  --color-glass-solid: rgba(245, 242, 238, 0.95);
  
  /* Typography */
  --font-serif: 'Playfair Display', 'DM Serif Display', serif;
  --font-sans: 'Inter', 'DM Sans', sans-serif;
  
  /* Spacing */
  --space-sm: 1rem;
  --space-md: 2.5rem;
  --space-lg: 5rem;
  --space-xl: 10rem;
}

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

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

/* Typography Elements */
h1, h2, h3, h4 {
  font-family: var(--font-serif);
  font-weight: 400;
  line-height: 1.1;
}

/* --- Loader --- */
.preloader {
  position: fixed;
  top: 0; left: 0; width: 100vw; height: 100vh;
  background: var(--color-bg);
  z-index: 9999;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
}

/* --- Header / Navigation --- */
header {
  position: fixed;
  top: 0; left: 0; width: 100%;
  padding: var(--space-md) var(--space-lg);
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 1000;
  transition: padding 0.5s ease, background 0.5s ease, backdrop-filter 0.5s ease;
}

header.scrolled {
  padding: 1.5rem var(--space-lg);
  background: var(--color-glass);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(0,0,0,0.05);
}

.logo {
  font-family: var(--font-serif);
  font-size: 1.8rem;
  font-weight: 400;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--color-text);
  transition: opacity 0.3s ease;
}

.logo:hover {
  opacity: 0.7;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

.nav-links a:not(.btn-contact) {
  text-decoration: none;
  color: var(--color-text);
  font-size: 0.9rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  position: relative;
}

.nav-links a:not(.btn-contact)::after {
  content: '';
  position: absolute;
  width: 0%;
  height: 1px;
  bottom: -4px;
  left: 0;
  background-color: var(--color-text);
  transition: width 0.3s ease;
}

.nav-links a:not(.btn-contact):hover::after {
  width: 100%;
}

.btn-contact {
  display: inline-block;
  text-decoration: none;
  padding: 0.8rem 1.5rem;
  background: var(--color-text);
  color: var(--color-bg);
  border: 1px solid var(--color-text);
  border-radius: 50px;
  text-transform: uppercase;
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.05em;
  transition: all 0.3s ease;
}

.btn-contact:hover {
  background: transparent;
  color: var(--color-text);
}

/* --- Hero Section --- */
.hero {
  height: 100vh;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  padding: 0 var(--space-xl);
}

.hero-bg {
  position: absolute;
  top: 0; left: 0; width: 100%; height: 100%;
  z-index: -1;
}

.hero-bg::after {
  content: '';
  position: absolute;
  top: 0; left: 0; width: 100%; height: 100%;
  background: linear-gradient(to right, rgba(234, 230, 223, 0.95) 0%, rgba(234, 230, 223, 0.75) 40%, rgba(234, 230, 223, 0.1) 100%);
  z-index: 1;
}

.hero-bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.1); /* starting scale for ken burns */
}

.hero-content {
  position: relative;
  z-index: 2;
  max-width: 800px;
}

.hero h1 {
  font-size: 6rem;
  margin-bottom: var(--space-sm);
  clip-path: polygon(0 0, 100% 0, 100% 100%, 0% 100%);
}

.hero p {
  font-size: 1.2rem;
  margin-bottom: var(--space-md);
  opacity: 0; /* for animation */
  max-width: 400px;
}

/* --- Estudio Section --- */
.estudio {
  padding: var(--space-xl) var(--space-lg);
  background: var(--color-bg);
}

.estudio-container {
  max-width: 800px;
  margin: 0 auto;
  text-align: center;
}

.estudio h2 {
  font-size: 3rem;
  margin-bottom: var(--space-md);
}

.estudio p {
  font-size: 1.1rem;
  line-height: 1.8;
  margin-bottom: var(--space-md);
  color: var(--color-accent);
}

.estudio p.lead {
  font-size: 1.3rem;
  font-weight: 500;
}

/* --- Portfolio Grid --- */
.portfolio {
  padding: var(--space-xl) var(--space-lg);
}

.section-title {
  font-size: 4rem;
  margin-bottom: var(--space-xl);
  text-align: center;
}

.grid-wrapper {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-lg);
}

.grid-item {
  position: relative;
  overflow: hidden;
  border-radius: 4px;
}

/* Stagger effect */
.grid-wrapper .grid-item:nth-child(even) {
  margin-top: 8rem;
}
.grid-wrapper .grid-item:nth-child(odd) {
  margin-bottom: 8rem;
}

.grid-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.grid-item:hover img {
  transform: scale(1.05);
}
/* --- Custom Cursor --- */
.custom-cursor {
  position: fixed;
  top: 0; left: 0;
  width: 15px; height: 15px;
  background-color: var(--color-text);
  border-radius: 50%;
  pointer-events: none;
  z-index: 10001; /* Above everything */
  transform: translate(-50%, -50%);
  display: flex;
  justify-content: center;
  align-items: center;
  mix-blend-mode: difference; /* Highly stylized */
  transition: width 0.3s, height 0.3s;
}

.cursor-text {
  font-family: var(--font-sans);
  font-size: 5px; /* Tiny because cursor scales */
  color: var(--color-text);
  opacity: 0;
  text-transform: uppercase;
  font-weight: 500;
  letter-spacing: 1px;
}

/* Hide default cursor only on large screens, fallback on mobile */
@media (min-width: 1024px) {
  body, a, button { cursor: none !important; }
}
@media (max-width: 1023px) {
  .custom-cursor { display: none; }
}



/* --- Servicios y Servicios-List --- */
.servicios {
  padding: var(--space-xl) var(--space-lg);
}

.servicios-container {
  max-width: 1200px;
  margin: 0 auto;
}
.grid-item-info {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -40%);
  text-align: center;
  color: #fff;
  opacity: 0;
  transition: all 0.5s ease;
  z-index: 2;
  width: 90%;
  pointer-events: none;
}

.grid-item:hover .grid-item-info {
  opacity: 1;
  transform: translate(-50%, -50%);
}

.grid-item-info h3 {
  font-family: var(--font-serif);
  font-size: 2.5rem;
  margin-bottom: 0.5rem;
  letter-spacing: normal;
}

.grid-item-info p {
  font-family: var(--font-sans);
  font-size: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.grid-item::after {
  content: '';
  position: absolute;
  top: 0; left: 0; width: 100%; height: 100%;
  background: rgba(0,0,0,0.4);
  opacity: 0;
  transition: opacity 0.5s ease;
  pointer-events: none;
}
.grid-item:hover::after {
  opacity: 1;
}

/* Clean Classes */
.item-1 { aspect-ratio: 4/5; }
.item-2 { aspect-ratio: 3/4; }
.item-3 { aspect-ratio: 1/1; }
.item-4 { aspect-ratio: 4/5; }
.item-5 { grid-column: 1 / -1; aspect-ratio: 21/9; margin-top: 0 !important; margin-bottom: 0 !important; }
.item-6 { aspect-ratio: 3/4; }
.item-7 { aspect-ratio: 4/5; }
.item-8 { aspect-ratio: 1/1; }
.item-9 { aspect-ratio: 4/5; }
.item-10 { grid-column: 1 / -1; aspect-ratio: 21/9; margin-top: 0 !important; margin-bottom: 0 !important; }

/* --- WhatsApp FAB --- */
.fab-whatsapp {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  background-color: #25D366;
  color: #fff;
  border-radius: 50%;
  width: 60px;
  height: 60px;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 2rem;
  text-decoration: none;
  box-shadow: 0 4px 15px rgba(37, 211, 102, 0.4);
  z-index: 1000;
  animation: pulse-whatsapp 2s infinite;
  transition: transform 0.3s ease;
}

.fab-whatsapp:hover {
  transform: scale(1.1);
}

@keyframes pulse-whatsapp {
  0% { box-shadow: 0 0 0 0 rgba(37, 211, 102, 0.7); }
  70% { box-shadow: 0 0 0 15px rgba(37, 211, 102, 0); }
  100% { box-shadow: 0 0 0 0 rgba(37, 211, 102, 0); }
}

/* --- Footer --- */
footer {
  padding: var(--space-lg) var(--space-xl);
  text-align: center;
  border-top: 1px solid rgba(0,0,0,0.1);
}

footer p {
  font-size: 0.9rem;
  opacity: 0.6;
}

/* --- Legal Pages --- */
.legal-page {
  padding: var(--space-xl) var(--space-lg);
  background: var(--color-bg);
}

.legal-container {
  max-width: 800px;
  margin: 0 auto;
}

.legal-container h1 {
  font-size: 3.5rem;
  margin-bottom: var(--space-md);
  color: var(--color-text);
}

.legal-container h2 {
  font-size: 1.8rem;
  margin: 2.5rem 0 1rem;
  color: var(--color-text);
}

.legal-container p, .legal-container ul {
  font-size: 1.1rem;
  line-height: 1.8;
  margin-bottom: 1.5rem;
  color: var(--color-accent);
}

.legal-container ul {
  padding-left: 1.5rem;
}

.legal-container li {
  margin-bottom: 0.5rem;
}

/* --- Media Queries --- */
@media (max-width: 1024px) {
  .hero h1 { font-size: 4.5rem; }
  .grid-wrapper { grid-template-columns: 1fr; gap: var(--space-md); }
  .grid-wrapper .grid-item { margin: 0 !important; aspect-ratio: 4/3 !important; }
}
@media (max-width: 768px) {
  :root { --space-xl: 4rem; --space-lg: 2rem; }
  .hero h1 { font-size: 3rem; }
  header { padding: var(--space-sm) var(--space-md); }
  .nav-links { display: none; /* simple hidden on mobile for brevity */ }
}
