:root {
  --background: #0a0a0a;
  --foreground: #f5f5f5;
  --card: #141414;
  --card-foreground: #f5f5f5;
  --muted: #1a1a1a;
  --muted-foreground: #a3a3a3;
  --border: #262626;
  --rubik-red: #dc2626;
  --rubik-blue: #2563eb;
  --rubik-yellow: #eab308;
  --rubik-green: #16a34a;
  --rubik-orange: #ea580c;
  --rubik-white: #f5f5f5;
}

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

body {
  font-family: 'Space Grotesk', sans-serif;
  background-color: var(--background);
  color: var(--foreground);
  line-height: 1.6;
}

.font-display { font-family: 'Archivo Black', sans-serif; }

.container { max-width: 1200px; margin: 0 auto; padding: 0 1.5rem; }

a { color: inherit; }

.gradient-text {
  background: linear-gradient(90deg, var(--rubik-red), var(--rubik-yellow), var(--rubik-blue));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* Header */
.header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  padding: 1.25rem 0;
  background: rgba(10,10,10,0.9);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.header-content { display: flex; justify-content: space-between; align-items: center; }
.logo { display: flex; align-items: center; gap: 0.75rem; text-decoration: none; }
.logo img { height: 48px; }
.nav { display: flex; gap: 2rem; }
.nav a { color: var(--muted-foreground); text-decoration: none; font-size: 0.9rem; }
.nav a:hover { color: var(--foreground); }

.nav-toggle {
  display: none; flex-direction: column; justify-content: center; gap: 5px;
  width: 38px; height: 38px; background: transparent; border: 1px solid var(--border);
  border-radius: 8px; cursor: pointer; padding: 0; margin-left: auto;
}
.nav-toggle span { display: block; width: 18px; height: 2px; background: var(--foreground); margin: 0 auto; transition: transform 0.2s ease, opacity 0.2s ease; }
.nav-toggle.active span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle.active span:nth-child(2) { opacity: 0; }
.nav-toggle.active span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Hero */
.hero { min-height: 90vh; display: flex; align-items: center; padding-top: 6rem; position: relative; overflow: hidden; }
.hero-bg {
  position: absolute; inset: 0; z-index: 0;
  background:
    radial-gradient(circle at 15% 20%, rgba(220,38,38,0.25), transparent 45%),
    radial-gradient(circle at 85% 15%, rgba(37,99,235,0.25), transparent 45%),
    radial-gradient(circle at 75% 85%, rgba(234,179,8,0.20), transparent 45%),
    radial-gradient(circle at 20% 80%, rgba(22,163,74,0.20), transparent 45%);
}
.hero-grid { display: grid; grid-template-columns: 1.2fr 0.8fr; gap: 3rem; align-items: center; position: relative; z-index: 1; }
.hero-label {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 0.8rem; color: var(--muted-foreground);
  border: 1px solid var(--border); padding: 6px 14px; border-radius: 999px;
  margin-bottom: 1.5rem; background: rgba(10,10,10,0.5);
}
.hero-title { font-size: clamp(2.2rem, 6vw, 4rem); line-height: 1.05; margin-bottom: 1.5rem; }
.hero-description { color: var(--muted-foreground); max-width: 620px; margin-bottom: 2rem; font-size: 1.05rem; }
.btn {
  display: inline-block; padding: 0.9rem 1.8rem; border-radius: 8px; text-decoration: none;
  font-weight: 600; font-size: 0.9rem; border: 1px solid transparent; cursor: pointer;
}
.btn-primary { background: var(--rubik-red); color: #fff; }
.btn-secondary { background: transparent; border-color: var(--border); color: var(--foreground); }
.hero-buttons { display: flex; gap: 1rem; flex-wrap: wrap; }

/* Cubo decorativo del hero */
.rubik-cube-visual { width: 100%; max-width: 380px; margin: 0 auto; aspect-ratio: 1/1; }
.rubik-cube-visual .cube-grid {
  display: grid; grid-template-columns: repeat(3,1fr); grid-template-rows: repeat(3,1fr);
  gap: 8px; width: 100%; height: 100%; transform: rotate(-8deg);
  animation: rubikFloat 6s ease-in-out infinite;
}
.rubik-cube-visual .cube-cell { border-radius: 10px; box-shadow: 0 6px 20px rgba(0,0,0,0.4); }
@keyframes rubikFloat {
  0%, 100% { transform: rotate(-8deg) translateY(0); }
  50% { transform: rotate(-4deg) translateY(-12px); }
}

/* Sections */
section { padding: 5rem 0; position: relative; }
.section-label { font-size: 0.8rem; letter-spacing: 0.1em; text-transform: uppercase; }
.section-title { font-size: clamp(1.8rem, 4vw, 2.6rem); margin: 0.5rem 0 3rem; }

/* Acentos de color por seccion, como las caras de un cubo Rubik */
.section-red { border-top: 4px solid var(--rubik-red); background: linear-gradient(180deg, rgba(220,38,38,0.06), transparent 40%); }
.section-red .section-label { color: var(--rubik-red); }
.section-blue { border-top: 4px solid var(--rubik-blue); background: linear-gradient(180deg, rgba(37,99,235,0.06), transparent 40%); }
.section-blue .section-label { color: var(--rubik-blue); }
.section-yellow { border-top: 4px solid var(--rubik-yellow); background: linear-gradient(180deg, rgba(234,179,8,0.06), transparent 40%); }
.section-yellow .section-label { color: var(--rubik-yellow); }
.section-green { border-top: 4px solid var(--rubik-green); background: linear-gradient(180deg, rgba(22,163,74,0.06), transparent 40%); }
.section-green .section-label { color: var(--rubik-green); }
.section-orange { border-top: 4px solid var(--rubik-orange); background: linear-gradient(180deg, rgba(234,88,12,0.06), transparent 40%); }
.section-orange .section-label { color: var(--rubik-orange); }
.section-white { border-top: 4px solid var(--rubik-white); background: linear-gradient(180deg, rgba(245,245,245,0.05), transparent 40%); }
.section-white .section-label { color: var(--rubik-white); }

/* Proceso */
.proceso-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2rem; }
.proceso-step { background: var(--card); border: 1px solid var(--border); border-radius: 12px; padding: 1.8rem; }
.proceso-numero {
  width: 40px; height: 40px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-family: 'Archivo Black', sans-serif; color: #0a0a0a; margin-bottom: 1rem; font-size: 1.1rem;
}
.proceso-step h3 { margin-bottom: 0.6rem; font-size: 1.15rem; }
.proceso-step p { color: var(--muted-foreground); font-size: 0.95rem; }

/* Stats */
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.5rem; }
.stat-item { text-align: center; background: var(--card); border: 1px solid var(--border); border-radius: 12px; padding: 2rem 1rem; }
.stat-number { font-size: 2.2rem; color: var(--foreground); margin-bottom: 0.4rem; }
.stat-label { color: var(--muted-foreground); font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.05em; }

/* Bitacora */
.bitacora-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 1.5rem; }
.bitacora-item {
  background: var(--card); border: 1px solid var(--border); border-radius: 12px;
  overflow: hidden; text-decoration: none; color: var(--foreground); display: block;
  transition: transform 0.2s ease, border-color 0.2s ease;
}
.bitacora-item:hover { transform: translateY(-4px); border-color: var(--rubik-blue); }
.bitacora-item img { width: 100%; aspect-ratio: 16/9; object-fit: cover; display: block; }
.bitacora-item-noimg { width: 100%; aspect-ratio: 16/9; background: var(--muted); }
.bitacora-content { padding: 1.2rem 1.3rem; }
.bitacora-fecha { font-size: 0.75rem; color: var(--muted-foreground); text-transform: uppercase; letter-spacing: 0.05em; }
.bitacora-content h3 { margin: 0.4rem 0 0.5rem; font-size: 1.15rem; }
.bitacora-content p { color: var(--muted-foreground); font-size: 0.9rem; }

/* Filtro de estado (obras.php) */
.filtro-estado { display: flex; gap: 0.75rem; flex-wrap: wrap; margin-bottom: 1rem; }
.filtro-estado a {
  padding: 0.5rem 1.1rem; border-radius: 999px; border: 1px solid var(--border);
  text-decoration: none; color: var(--muted-foreground); font-size: 0.85rem;
}
.filtro-estado a.activo { background: var(--rubik-yellow); border-color: var(--rubik-yellow); color: #0a0a0a; font-weight: 600; }

/* About */
.about-text p { color: var(--muted-foreground); margin-bottom: 1rem; max-width: 720px; }

.tecnica-grid { display: grid; grid-template-columns: 0.85fr 1.4fr; gap: 3rem; align-items: center; }
.tecnica-showcase { display: flex; align-items: center; gap: 0.8rem; }
.tecnica-panel { flex: 1; min-width: 0; text-align: center; }
.tecnica-panel img {
  width: 100%; aspect-ratio: 1/1; object-fit: cover; border-radius: 12px;
  border: 1px solid var(--border); background: var(--card);
  animation: tecnicaReveal 1.2s ease both;
}
.tecnica-panel:nth-child(3) img { animation-delay: 0.3s; }
.tecnica-panel:nth-child(5) img { animation-delay: 0.6s; }
.tecnica-label { display: block; margin-top: 0.6rem; font-size: 0.75rem; color: var(--muted-foreground); text-transform: uppercase; letter-spacing: 0.03em; }
.tecnica-arrow { display: flex; flex-direction: column; align-items: center; gap: 0.4rem; color: var(--rubik-blue); font-size: 1.2rem; flex-shrink: 0; }
.cube-grid-mini {
  display: grid; grid-template-columns: repeat(2,1fr); grid-template-rows: repeat(2,1fr);
  gap: 4px; width: 34px; height: 34px;
}
.cube-grid-mini span { border-radius: 3px; opacity: 0; animation: tecnicaPop 0.5s ease forwards; }
.cube-grid-mini span:nth-child(1){ animation-delay: 0.1s; }
.cube-grid-mini span:nth-child(2){ animation-delay: 0.3s; }
.cube-grid-mini span:nth-child(3){ animation-delay: 0.5s; }
.cube-grid-mini span:nth-child(4){ animation-delay: 0.7s; }

@keyframes tecnicaReveal {
  0% { opacity: 0; transform: scale(0.85); filter: saturate(0.3) brightness(0.7); }
  100% { opacity: 1; transform: scale(1); filter: saturate(1) brightness(1); }
}
@keyframes tecnicaPop {
  0% { opacity: 0; transform: scale(0.4); }
  100% { opacity: 1; transform: scale(1); }
}

/* Gallery */
.gallery-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1.5rem; }
.gallery-item {
  background: var(--card); border: 1px solid var(--border); border-radius: 12px;
  overflow: hidden; text-decoration: none; color: var(--foreground); display: block;
  transition: transform 0.2s ease, border-color 0.2s ease;
}
.gallery-item:hover { transform: translateY(-4px); border-color: var(--rubik-red); }
.gallery-item img { width: 100%; aspect-ratio: 1/1; object-fit: cover; display: block; background: var(--muted); }
.gallery-split { display: flex; width: 100%; aspect-ratio: 1/1; overflow: hidden; }
.gallery-split img { width: 50%; height: 100%; aspect-ratio: auto; object-fit: cover; display: block; }
.gallery-split img:only-child { width: 100%; }
.gallery-content { padding: 1.1rem 1.2rem; }
.gallery-badge {
  display: inline-block; font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.05em;
  padding: 3px 10px; border-radius: 999px; margin-bottom: 0.6rem;
}
.badge-terminada { background: rgba(22,163,74,0.15); color: var(--rubik-green); }
.badge-proceso { background: rgba(234,179,8,0.15); color: var(--rubik-yellow); }
.badge-boceto { background: rgba(38,38,38,0.6); color: var(--muted-foreground); }
.gallery-title { font-size: 1.1rem; margin-bottom: 0.3rem; }
.gallery-tema { color: var(--muted-foreground); font-size: 0.9rem; }
.empty-state { color: var(--muted-foreground); }

/* Contact */
.contact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 3rem; }
.form-group { margin-bottom: 1.2rem; }
.form-group label { display: block; margin-bottom: 0.4rem; font-size: 0.85rem; color: var(--muted-foreground); }
.form-group input, .form-group textarea {
  width: 100%; background: var(--muted); border: 1px solid var(--border); color: var(--foreground);
  padding: 0.8rem 1rem; border-radius: 8px; font-family: inherit;
}
.contact-details { margin-top: 1.5rem; color: var(--muted-foreground); }

/* Redes sociales */
.redes-section { padding: 3rem 0; text-align: center; }
.redes-label { color: var(--muted-foreground); font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 1.2rem; }
.redes-links { display: flex; justify-content: center; gap: 1.5rem; flex-wrap: wrap; }
.redes-link {
  display: inline-flex; align-items: center; gap: 0.6rem;
  border: 1px solid var(--border); padding: 0.7rem 1.4rem; border-radius: 999px;
  text-decoration: none; color: var(--foreground); font-size: 0.9rem; font-weight: 600;
  transition: border-color 0.2s ease, color 0.2s ease;
}
.redes-link:hover { border-color: var(--rubik-red); color: var(--rubik-red); }

/* Footer */
.footer { padding: 2.5rem 0; position: relative; }
.footer::before {
  content: ""; position: absolute; top: 0; left: 0; right: 0; height: 4px;
  background: linear-gradient(90deg, var(--rubik-red) 0 25%, var(--rubik-yellow) 25% 50%, var(--rubik-blue) 50% 75%, var(--rubik-green) 75% 100%);
}
.footer-content { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 1rem; }
.footer-copyright { color: var(--muted-foreground); font-size: 0.85rem; }
.footer-redes { display: flex; gap: 1rem; }
.footer-redes a { color: var(--muted-foreground); }
.footer-redes a:hover { color: var(--rubik-red); }

/* Obra detail */
.obra-header { padding-top: 8rem; padding-bottom: 2rem; }
.obra-breadcrumb { color: var(--muted-foreground); font-size: 0.85rem; margin-bottom: 1rem; }
.obra-breadcrumb a { color: var(--muted-foreground); text-decoration: none; }
.obra-hero-img { width: 100%; max-height: 520px; object-fit: cover; border-radius: 12px; border: 1px solid var(--border); margin-bottom: 2rem; }
.obra-meta { display: flex; gap: 2rem; flex-wrap: wrap; margin: 1.5rem 0 2rem; }
.obra-meta-item { }
.obra-meta-label { font-size: 0.75rem; text-transform: uppercase; color: var(--muted-foreground); letter-spacing: 0.05em; }
.obra-meta-value { font-size: 1.1rem; font-weight: 600; }
.obra-redaccion { color: var(--muted-foreground); max-width: 760px; white-space: pre-line; margin-bottom: 2.5rem; }
.progreso-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 1rem; margin-bottom: 2.5rem; }
.progreso-grid img { width: 100%; aspect-ratio: 1/1; object-fit: cover; border-radius: 8px; border: 1px solid var(--border); }
.video-wrapper { position: relative; padding-bottom: 56.25%; height: 0; margin-bottom: 2.5rem; }
.video-wrapper iframe { position: absolute; top:0; left:0; width: 100%; height: 100%; border-radius: 12px; border: 1px solid var(--border); }
.video-wrapper-vertical {
  max-width: 280px; margin-left: auto; margin-right: auto;
  height: auto; padding-bottom: 0; aspect-ratio: 9/16;
}

/* 3 imagenes principales de la obra */
.obra-principales-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.2rem; margin: 2rem 0; }
.obra-principal-panel { text-align: center; }
.obra-principal-panel img {
  width: 100%; aspect-ratio: 3/4; object-fit: cover; border-radius: 12px; border: 1px solid var(--border); background: var(--card);
}
.obra-principal-vacio {
  width: 100%; aspect-ratio: 3/4; border-radius: 12px; border: 1px dashed var(--border);
  display: flex; align-items: center; justify-content: center; color: var(--muted-foreground); font-size: 0.85rem; text-align: center; padding: 1rem;
}

/* Descripcion + media */
.obra-desc-grid { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 3rem; align-items: center; }
.obra-desc-media img, .obra-desc-media .video-wrapper { border-radius: 12px; }

/* Ficha tecnica */
.specs-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 1rem; }
.spec-item { background: var(--card); border: 1px solid var(--border); border-radius: 10px; padding: 1.2rem; }
.spec-label { font-size: 0.75rem; text-transform: uppercase; color: var(--muted-foreground); letter-spacing: 0.05em; margin-bottom: 0.3rem; }
.spec-value { font-size: 1.2rem; font-weight: 700; }

/* Slider (making of) */
.slider { max-width: 720px; margin: 0 auto; position: relative; }
.slider-viewport { overflow: hidden; border-radius: 12px; border: 1px solid var(--border); }
.slider-track { display: flex; transition: transform 0.4s ease; }
.slider-slide { flex: 0 0 100%; }
.slider-slide img { width: 100%; aspect-ratio: 4/3; object-fit: cover; display: block; background: var(--card); }
.slider-btn {
  position: absolute; top: 50%; transform: translateY(-50%); z-index: 2;
  width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--border);
  background: rgba(10,10,10,0.7); color: var(--foreground); font-size: 1.1rem; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.slider-btn:hover { border-color: var(--rubik-red); color: var(--rubik-red); }
.slider-prev { left: -22px; }
.slider-next { right: -22px; }
.slider-dots { display: flex; justify-content: center; gap: 0.5rem; margin-top: 1rem; }
.slider-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--border); cursor: pointer; }
.slider-dot.active { background: var(--rubik-red); }

/* Estatus / disponibilidad */
.estatus-grid { display: grid; grid-template-columns: 280px 1fr; gap: 2rem; align-items: center; }
.estatus-img { width: 100%; border-radius: 12px; border: 1px solid var(--border); }
.testimonio {
  border-left: 3px solid var(--rubik-green); padding-left: 1.2rem; color: var(--muted-foreground);
  font-style: italic; font-size: 1.05rem;
}

.galeria-layout { display: grid; grid-template-columns: 1fr 1fr; gap: 3rem; align-items: start; }
.galeria-layout-single { grid-template-columns: 1fr; max-width: 640px; }
.galeria-info { display: flex; gap: 1.5rem; align-items: flex-start; margin-bottom: 1.5rem; }
.galeria-logo { width: 64px; height: auto; flex-shrink: 0; }
.galeria-acciones { display: flex; gap: 0.8rem; flex-wrap: wrap; margin-bottom: 1rem; }
.galeria-redes { display: flex; gap: 1rem; }
.galeria-redes a { color: var(--muted-foreground); }
.galeria-redes a:hover { color: var(--rubik-green); }
.galeria-mapa { border-radius: 12px; overflow: hidden; border: 1px solid var(--border); }
.galeria-mapa iframe { width: 100%; height: 300px; border: 0; display: block; filter: grayscale(0.3) invert(0.92) contrast(0.9); }
.galeria-foto-col .estatus-img { aspect-ratio: 4/3; object-fit: cover; }
.galeria-foto-col .slider { max-width: 100%; }

.toast {
  position: fixed; bottom: 2rem; right: 2rem; background: var(--rubik-green); color: #fff;
  padding: 1rem 1.5rem; border-radius: 8px; font-weight: 600;
}

@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; }
  .rubik-cube-visual { max-width: 260px; order: -1; }
  .tecnica-grid { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  .contact-grid { grid-template-columns: 1fr; }
  .proceso-grid { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .tecnica-showcase { flex-direction: column; }
  .tecnica-arrow { flex-direction: row; transform: rotate(90deg); margin: 0.5rem 0; }

  .nav-toggle { display: flex; }
  .nav {
    display: none; position: fixed; top: 78px; left: 1rem; right: 1rem;
    background: var(--card); border: 1px solid var(--border); border-radius: 12px;
    flex-direction: column; gap: 0; padding: 0.5rem; z-index: 99;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
  }
  .nav.nav-open { display: flex; }
  .nav a { padding: 0.9rem 1rem; border-radius: 8px; }
  .nav a:hover, .nav a:active { background: var(--muted); color: var(--foreground); }

  .hero { min-height: auto; padding-top: 7rem; padding-bottom: 3rem; }
  section { padding: 3rem 0; }
  .redes-section { padding: 2rem 0; }
  .obra-header { padding-top: 6.5rem; }
  .footer-content { flex-direction: column; text-align: center; }
  .contact-grid { gap: 2rem; }
  .logo img { height: 38px; }

  .obra-principales-grid { grid-template-columns: 1fr; }
  .obra-desc-grid { grid-template-columns: 1fr; gap: 1.5rem; }
  .estatus-grid { grid-template-columns: 1fr; }

  .slider-btn { width: 36px; height: 36px; font-size: 0.95rem; }
  .slider-prev { left: 0.5rem; }
  .slider-next { right: 0.5rem; }

  .galeria-info { flex-direction: column; }
  .galeria-layout { grid-template-columns: 1fr; gap: 2rem; }
}

@media (max-width: 480px) {
  .hero-buttons { flex-direction: column; align-items: stretch; }
  .hero-buttons .btn { text-align: center; }
  .obra-meta { gap: 1.2rem; }
  .stats-grid { grid-template-columns: 1fr 1fr; gap: 1rem; }
  .stat-item { padding: 1.4rem 0.8rem; }
  .stat-number { font-size: 1.7rem; }
}
