@import url('https://fonts.googleapis.com/css2?family=Cinzel+Decorative:wght@400;700&family=Cinzel:wght@400;600;700&family=Montserrat:wght@300;400;500&display=swap');

/* =========================================
   VARIABLES Y MODO CLARO/OSCURO
   ========================================= */
:root {
  --bg-color: #111111;
  --text-color: #d1d1d1;
  --title-color: #ffffff;
  --glass-bg: rgba(30, 30, 30, 0.4);
  --glass-border: rgba(255, 255, 255, 0.08);
  --card-bg: rgba(255, 255, 255, 0.02);
  --accent: #c9a45c;
  --filter-art: grayscale(20%) sepia(15%) contrast(110%);
}

.light-mode {
  --bg-color: #e8e8e8;
  --text-color: #333333;
  --title-color: #111111;
  --glass-bg: rgba(255, 255, 255, 0.5);
  --glass-border: rgba(0, 0, 0, 0.1);
  --card-bg: rgba(0, 0, 0, 0.03);
  --accent: #b08230;
  --filter-art: grayscale(0%) contrast(100%);
}

/* =========================================
   ESTILOS BASE Y RESET
   ========================================= */
* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  background-color: var(--bg-color); 
  background-image: 
    linear-gradient(to bottom, rgba(17, 17, 17, 0.2) 0%, rgba(17, 17, 17, 1) 100%), 
    url('../img/fondo-elegante.jpg');
  background-size: cover;
  background-position: top center;
  background-repeat: no-repeat;
  background-attachment: fixed;
  
  font-family: 'Montserrat', sans-serif;
  color: var(--text-color);
  line-height: 1.6;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 100vh;
  padding: 0 20px 40px 20px;
  overflow-x: hidden; 

  transition: background-color 0.5s ease, color 0.5s ease;
  animation: fadeInPage 0.6s ease-in-out forwards;
  opacity: 0; 
}

h1, h2, h3 { 
  color: var(--title-color); 
  transition: color 0.5s ease; 
}

/* =========================================
   CONTENEDOR PREMIUM (GLASSMORPHISM REAL)
   ========================================= */
.glass-container {
  width: 100%;
  max-width: 1200px;
  background: var(--glass-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-radius: 40px;
  padding: 50px 60px;
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.5);
  border: 1px solid var(--glass-border);
  position: relative;
  z-index: 1; 
  transition: background 0.5s ease, border 0.5s ease;
}

/* =========================================
   NAVEGACIÓN STICKY Y BOTÓN TEMA
   ========================================= */
.premium-nav { 
  display: flex; 
  justify-content: center; 
  align-items: center;
  position: sticky;
  top: 0; 
  z-index: 100; 
  background: var(--glass-bg);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  padding: 15px 30px;
  border-radius: 0 0 20px 20px;
  margin-bottom: 50px;
  border: 1px solid var(--glass-border);
  border-top: none;
  transition: background 0.5s ease, border 0.5s ease;
}

.premium-nav ul { display: flex; list-style: none; gap: 40px; margin-right: 30px; }
.premium-nav a { text-decoration: none; color: var(--text-color); font-size: 0.85rem; text-transform: lowercase; letter-spacing: 1.5px; transition: all 0.3s ease; padding-bottom: 4px; }
.premium-nav a:hover, .premium-nav a.active { color: var(--accent); border-bottom: 1px solid var(--accent); }

.theme-toggle {
  background: none;
  border: 1px solid var(--accent);
  color: var(--accent);
  cursor: pointer;
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 0.8rem;
  transition: all 0.3s ease;
}
.theme-toggle:hover { background: var(--accent); color: var(--bg-color); }

/* =========================================
   CABECERA (HERO)
   ========================================= */
.hero-section { display: flex; align-items: center; justify-content: space-between; margin-bottom: 80px; gap: 40px; }
.hero-text { flex: 1; max-width: 600px; }
.hero-text .subtitle { font-size: 0.85rem; text-transform: lowercase; letter-spacing: 2px; color: #888; margin-bottom: 10px; }
.hero-text h1 { font-family: 'Playfair Display', serif; font-size: 5rem; font-weight: 400; line-height: 1.1; margin-bottom: 30px; letter-spacing: 1px; }
.hero-text .description { font-size: 0.95rem; color: var(--text-color); margin-bottom: 40px; max-width: 480px; text-align: justify; transition: color 0.5s ease;}

.btn-gold { display: inline-block; text-decoration: none; background-color: var(--accent); color: #161616; padding: 12px 35px; border-radius: 30px; font-size: 0.85rem; font-weight: 500; letter-spacing: 1px; transition: all 0.3s ease; }
.btn-gold:hover { transform: translateY(-2px); box-shadow: 0 10px 20px rgba(201, 164, 92, 0.2); filter: brightness(1.2); }

.hero-image-placeholder { 
  width: 350px; 
  height: 350px; 
  background: radial-gradient(circle, #2d2d2d 0%, #1c1c1c 100%); 
  border-radius: 50%; 
  border: 1px solid rgba(201, 164, 92, 0.4); 
  box-shadow: 0 0 40px rgba(0, 0, 0, 0.5); 
  overflow: hidden; 
  flex-shrink: 0;
}
.hero-image-placeholder img { 
  width: 100%; 
  height: 100%; 
  object-fit: cover; 
  object-position: center top; 
  transition: transform 0.5s ease; 
}
.hero-image-placeholder:hover img { transform: scale(1.05); }

/* =========================================
   TARJETAS Y GRID
   ========================================= */
.section-title { font-family: 'Playfair Display', serif; font-size: 2.3rem; font-weight: 400; margin-bottom: 40px; border-left: 3px solid var(--accent); padding-left: 15px; }
.skills-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 30px; }

.skill-card { 
  background: var(--card-bg); 
  border: 1px solid var(--glass-border); 
  padding: 35px 30px; 
  border-radius: 24px; 
  transition: transform 0.4s ease-out, box-shadow 0.4s ease-out, border-color 0.4s ease, background 0.5s ease; 
}
.skill-card:hover { 
  transform: translateY(-5px); 
  border-color: rgba(201, 164, 92, 0.4); 
  box-shadow: 0 20px 40px rgba(0,0,0,0.3); 
}
.skill-card h3 { font-family: 'Playfair Display', serif; color: var(--accent); font-size: 1.35rem; margin-bottom: 15px; font-weight: 400; transition: color 0.5s ease;}
.skill-card p { font-size: 0.9rem; text-align: justify; transition: color 0.5s ease;}

/* =========================================
   PIE DE PÁGINA
   ========================================= */
.premium-footer { margin-top: 40px; text-align: center; padding: 20px; z-index: 1;}
.premium-footer p { font-size: 0.85rem; color: var(--accent); letter-spacing: 2px; text-transform: uppercase; opacity: 0.8; }

/* =========================================
   EFECTOS AMBIENTALES
   ========================================= */
body::before, body::after {
  content: ''; position: fixed; border-radius: 50%; filter: blur(120px); z-index: -1;
  animation: flotar 20s infinite alternate ease-in-out; pointer-events: none;
}
body::before { width: 500px; height: 500px; background: rgba(201, 164, 92, 0.12); top: -10%; left: -10%; }
body::after { width: 600px; height: 600px; background: rgba(255, 255, 255, 0.05); bottom: -20%; right: -10%; animation-duration: 25s; }
@keyframes flotar { 0% { transform: translate(0, 0) scale(1); } 50% { transform: translate(50px, 30px) scale(1.1); } 100% { transform: translate(-30px, 80px) scale(0.9); } }

/* =========================================
   TRANSICIONES DE PÁGINA (PAGE FADE)
   ========================================= */
@keyframes fadeInPage { 0% { opacity: 0; transform: translateY(10px); } 100% { opacity: 1; transform: translateY(0); } }
.fade-out { opacity: 0 !important; transform: translateY(-10px) !important; transition: opacity 0.4s ease-out, transform 0.4s ease-out; }

/* =========================================
   ARTE FLOTANTE EXCLUSIVO POR PÁGINA
   ========================================= */
.floating-art-background {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: -2; 
  pointer-events: none; 
  overflow: hidden;
}

.art-float {
  position: absolute;
  width: 700px;
  opacity: 0.75;
  border-radius: 25px;
  box-shadow: 0 40px 80px rgba(0, 0, 0, 0.8);
  filter: contrast(110%) brightness(100%); 
  top: 50%; 
  left: 50%;
  transform: translate(-50%, -50%); 
  animation: floatArtIndividual 25s infinite alternate ease-in-out;
  transition: filter 0.5s ease, opacity 0.5s ease;
}

.art-right { margin-left: 250px; }

@keyframes floatArtIndividual {
  0% { transform: translate(-50%, -50%) rotate(0deg) scale(1); }
  50% { transform: translate(-45%, -53%) rotate(3deg) scale(1.02); }
  100% { transform: translate(-55%, -47%) rotate(-2deg) scale(0.98); }
}

/* =========================================
   FASE 2: LAYOUT BENTO BOX (APPLE STYLE)
   ========================================= */
.bento-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-auto-rows: 280px; 
  gap: 20px;
  max-width: 1200px;
  margin: 0 auto;
}

.bento-card {
  background: rgba(20, 20, 20, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 24px;
  padding: 30px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  position: relative;
  overflow: hidden;
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), border-color 0.4s ease, box-shadow 0.4s ease;
}

.bento-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle at 50% 50%, rgba(201, 164, 92, 0.8), transparent 70%);
  opacity: 0;
  z-index: 0;
  transition: opacity 0.6s ease;
  pointer-events: none;
}

.bento-card:hover {
  transform: translateY(-8px) scale(1.02);
  border-color: var(--accent, #c9a45c);
  box-shadow: 
    0 20px 40px rgba(0,0,0,0.8), 
    0 0 40px rgba(201, 164, 92, 0.4), 
    0 0 80px rgba(201, 164, 92, 0.2),
    inset 0 0 20px rgba(201, 164, 92, 0.15);
}

.bento-card:hover::before { opacity: 0.15; }

.bento-bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.3;
  z-index: 1; 
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.bento-card:hover .bento-bg {
  opacity: 0.5;
  transform: scale(1.05); 
}

.bento-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 80%;
  background: linear-gradient(to top, rgba(10,10,10, 0.95) 15%, transparent);
  z-index: 2; 
}

.bento-content { position: relative; z-index: 3; }
.bento-tag { color: var(--accent, #c9a45c); font-size: 0.75rem; text-transform: uppercase; letter-spacing: 3px; display: block; margin-bottom: 8px; font-weight: 600; }
.bento-title { color: #ffffff; font-size: 1.5rem; margin: 0 0 10px 0; font-family: 'Playfair Display', serif; }
.bento-desc { color: #a0a0a0; font-size: 0.9rem; line-height: 1.5; margin: 0; display: -webkit-box; -webkit-line-clamp: 3; line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }

/* === CLASES ASIMÉTRICAS === */
.bento-large    { grid-column: span 2; grid-row: span 2; }
.bento-wide     { grid-column: span 2; grid-row: span 1; }
.bento-tall     { grid-column: span 1; grid-row: span 2; }
.bento-standard { grid-column: span 1; grid-row: span 1; }

/* =========================================
   TIPOGRAFÍA DE IMPACTO
   ========================================= */
.hero-text h1, .projects-header h1, .practices-header h1 { 
  font-family: 'Cinzel Decorative', serif; 
  font-weight: 700;
  letter-spacing: 3px; 
  text-shadow: 2px 4px 10px rgba(0,0,0,0.5);
}

.section-title { 
  font-family: 'Cinzel', serif; 
  font-weight: 600;
  letter-spacing: 2px;
}

.bento-title, .skill-card h3 { 
  font-family: 'Cinzel', serif; 
  font-weight: 600;
  letter-spacing: 1px;
}

.bento-tag, .project-tag, .phase-number { 
  font-family: 'Montserrat', sans-serif; 
  font-weight: 500;
  letter-spacing: 4px;
}

/* =========================================
   FASE 3: ANIMACIONES SCROLL REVEAL
   ========================================= */
.reveal {
  opacity: 0;
  transform: translateY(80px);
  transition: opacity 0.8s ease-out, transform 0.8s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.reveal.active {
  opacity: 1;
  transform: translateY(0); 
}

.bento-card:nth-child(1), .skill-card:nth-child(1), .gallery-item-box:nth-child(1) { transition-delay: 0.1s; }
.bento-card:nth-child(2), .skill-card:nth-child(2), .gallery-item-box:nth-child(2) { transition-delay: 0.2s; }
.bento-card:nth-child(3), .skill-card:nth-child(3), .gallery-item-box:nth-child(3) { transition-delay: 0.3s; }
.bento-card:nth-child(4), .skill-card:nth-child(4), .gallery-item-box:nth-child(4) { transition-delay: 0.4s; }
.bento-card:nth-child(5), .skill-card:nth-child(5), .gallery-item-box:nth-child(5) { transition-delay: 0.5s; }
.bento-card:nth-child(6), .skill-card:nth-child(6), .gallery-item-box:nth-child(6) { transition-delay: 0.6s; }

/* =========================================
   FASE 3: CARGA INICIAL ANIMADA
   ========================================= */
@keyframes entradaCinematica {
  0% { opacity: 0; transform: translateY(40px) scale(0.95); filter: blur(10px); }
  100% { opacity: 1; transform: translateY(0) scale(1); filter: blur(0); }
}

.hero-text .subtitle { animation: entradaCinematica 1s cubic-bezier(0.2, 0.8, 0.2, 1) 0.2s forwards; opacity: 0; }
.hero-text h1 { animation: entradaCinematica 1.2s cubic-bezier(0.2, 0.8, 0.2, 1) 0.4s forwards; opacity: 0; }
.hero-text .description { animation: entradaCinematica 1s cubic-bezier(0.2, 0.8, 0.2, 1) 0.6s forwards; opacity: 0; }
.btn-gold { animation: entradaCinematica 1s cubic-bezier(0.2, 0.8, 0.2, 1) 0.8s forwards; opacity: 0; }
.hero-image-placeholder { animation: entradaCinematica 1.5s cubic-bezier(0.2, 0.8, 0.2, 1) 0.5s forwards; opacity: 0; }

/* =========================================
   FASE 4: PARCHE DE CONTRASTE (MODO CLARO)
   ========================================= */
.light-mode .bento-card {
  background: rgba(255, 255, 255, 0.6);
  border-color: rgba(0, 0, 0, 0.1);
}

.light-mode .bento-overlay {
  background: linear-gradient(to top, rgba(255, 255, 255, 0.95) 15%, transparent);
}

.light-mode .bento-title { color: #111111; text-shadow: none; }
.light-mode .bento-desc { color: #444444; }
.light-mode .skill-card h3, .light-mode .bento-tag, .light-mode .project-tag { color: #9e7529; }

/* =========================================
   FASE 5: RESPONSIVE PREMIUM (TABLETS Y CELULARES)
   ========================================= */
/* ---> AJUSTES PARA TABLETS (IPADS, GALAXY TABS) <--- */
@media (max-width: 1024px) {
  .hero-text h1 { font-size: 4rem; } 
  .hero-image-placeholder { width: 300px; height: 300px; }
  
  .bento-grid { grid-template-columns: repeat(2, 1fr); }
  
  .bento-large { grid-column: span 2; grid-row: span 2; } 
  .bento-wide { grid-column: span 2; grid-row: span 1; } 
  .bento-tall { grid-column: span 1; grid-row: span 2; }
}

/* ---> AJUSTES EXCLUSIVOS PARA CELULARES <--- */
@media (max-width: 768px) {
  .hero-section { flex-direction: column-reverse; text-align: center; }
  .hero-text h1 { font-size: 3rem; }
  .hero-text .description { margin: 0 auto 30px auto; }
  
  .glass-container { padding: 35px 20px; border-radius: 25px; }
  
  .premium-nav ul { margin-right: 0; gap: 15px; flex-wrap: wrap; justify-content: center; padding-left: 0; }
  
  .bento-grid { grid-template-columns: 1fr; grid-auto-rows: minmax(280px, auto); }
  .bento-large, .bento-wide, .bento-tall, .bento-standard { grid-column: span 1; grid-row: span 1; }
}