/* ========================================
   RG Arquitectura - Styles
   Inspired by parq.com.ar
   ======================================== */

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

:root {
  --color-black: #1a1a1a;
  --color-dark: #2d2d2d;
  --color-gray: #6b6b6b;
  --color-light-gray: #e8e8e8;
  --color-off-white: #f5f5f3;
  --color-white: #ffffff;
  --color-accent: #8a7d6b;

  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-serif: 'Playfair Display', Georgia, serif;

  --nav-height: 80px;
  --container-max: 1200px;
  --container-padding: 24px;
}

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

body {
  font-family: var(--font-sans);
  font-weight: 300;
  color: var(--color-black);
  background-color: var(--color-white);
  line-height: 1.6;
  overflow-x: hidden;
}

a {
  text-decoration: none;
  color: inherit;
}

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

.container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--container-padding);
}

/* --- Navigation --- */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: var(--nav-height);
  z-index: 1000;
  transition: background-color 0.4s ease, box-shadow 0.4s ease;
}

.navbar.scrolled {
  background-color: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.06);
}

.nav-container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--container-padding);
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo {
  display: flex;
  align-items: center;
}

.nav-logo-img {
  height: 44px;
  width: 44px;
  max-width: none;
  object-fit: cover;
  border-radius: 50%;
  transition: opacity 0.4s ease;
}

.nav-links {
  display: flex;
  list-style: none;
  gap: 40px;
}

.nav-links a {
  font-size: 13px;
  font-weight: 400;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--color-white);
  transition: color 0.3s ease, opacity 0.3s ease;
  position: relative;
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 1px;
  background-color: currentColor;
  transition: width 0.3s ease;
}

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

.navbar.scrolled .nav-links a {
  color: var(--color-black);
}

.nav-links a:hover {
  opacity: 0.7;
}

/* Mobile Toggle */
.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  z-index: 1001;
}

.nav-toggle span {
  display: block;
  width: 24px;
  height: 1.5px;
  background-color: var(--color-white);
  transition: all 0.3s ease;
}

.navbar.scrolled .nav-toggle span {
  background-color: var(--color-black);
}

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

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

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

/* --- Hero --- */
.hero {
  position: relative;
  height: 100vh;
  min-height: 600px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.hero-image {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

.hero-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    to bottom,
    rgba(0, 0, 0, 0.3) 0%,
    rgba(0, 0, 0, 0.5) 100%
  );
}

.hero-content {
  position: relative;
  z-index: 1;
  text-align: center;
  color: var(--color-white);
  padding: 0 var(--container-padding);
}

.hero-title {
  font-family: var(--font-sans);
  font-weight: 300;
  font-size: clamp(24px, 4vw, 48px);
  letter-spacing: 6px;
  line-height: 1.8;
  margin-bottom: 24px;
}

.hero-line {
  display: block;
  opacity: 0;
  transform: translateY(20px);
  animation: fadeInUp 0.8s ease forwards;
}

.hero-line:nth-child(1) { animation-delay: 0.3s; }
.hero-line:nth-child(2) { animation-delay: 0.6s; }
.hero-line:nth-child(3) { animation-delay: 0.9s; }

.hero-subtitle {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: clamp(16px, 2vw, 20px);
  font-weight: 400;
  letter-spacing: 1px;
  margin-bottom: 40px;
  opacity: 0;
  animation: fadeIn 1s ease 1.3s forwards;
}

.hero-cta {
  display: inline-block;
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--color-white);
  border: 1px solid rgba(255, 255, 255, 0.6);
  padding: 14px 36px;
  transition: all 0.3s ease;
  opacity: 0;
  animation: fadeIn 1s ease 1.6s forwards;
}

.hero-cta:hover {
  background-color: var(--color-white);
  color: var(--color-black);
}

/* --- Sections --- */
.section {
  padding: 120px 0;
}

.section-header {
  text-align: center;
  margin-bottom: 80px;
}

.section-tag {
  display: inline-block;
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--color-gray);
  margin-bottom: 16px;
}

.section-title {
  font-family: var(--font-sans);
  font-size: clamp(28px, 3.5vw, 42px);
  font-weight: 300;
  letter-spacing: 8px;
  margin-bottom: 24px;
}

.section-description {
  max-width: 560px;
  margin: 0 auto;
  font-size: 15px;
  color: var(--color-gray);
  line-height: 1.8;
}

/* --- Projects Grid --- */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
}

.project-card {
  display: block;
  position: relative;
  overflow: hidden;
  cursor: pointer;
}

.project-image {
  position: relative;
  overflow: hidden;
  aspect-ratio: 4 / 3;
}

.project-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s ease;
}

.project-card:hover .project-image img {
  transform: scale(1.05);
}

.project-info {
  padding: 20px 0 8px;
}

.project-info h3 {
  font-family: var(--font-sans);
  font-size: 16px;
  font-weight: 400;
  letter-spacing: 1px;
  margin-bottom: 4px;
}

.project-type {
  font-size: 12px;
  color: var(--color-gray);
  letter-spacing: 1px;
  text-transform: uppercase;
}

/* Hidden projects */
.project-hidden {
  display: none;
}

.projects-grid.expanded .project-hidden {
  display: block;
}

/* Show More Button */
.show-more-wrapper {
  text-align: center;
  margin-top: 48px;
}

.btn-show-more {
  display: inline-block;
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--color-black);
  background: transparent;
  border: 1px solid var(--color-black);
  padding: 14px 40px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.btn-show-more:hover {
  background-color: var(--color-black);
  color: var(--color-white);
}

.btn-show-more.hidden {
  display: none;
}

/* --- El Proceso Section --- */
.proceso {
  background-color: var(--color-off-white);
}

.proceso-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.proceso-hidden {
  display: none;
}

.proceso-grid.expanded .proceso-hidden {
  display: block;
}

.proceso-item {
  overflow: hidden;
}

.proceso-item img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.proceso-item:hover img {
  transform: scale(1.04);
}

/* --- Antes y Después Section --- */
.antes-despues .section-header {
  margin-bottom: 16px;
}

.antes-despues .container {
  padding-left: calc(var(--container-padding) * 1.25);
  padding-right: calc(var(--container-padding) * 1.25);
}

.antes-despues-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
}

.ad-hidden {
  display: none;
}

.antes-despues-grid.expanded .ad-hidden {
  display: block;
}

.ad-item {
  overflow: hidden;
}

.ad-item img {
  width: 100%;
  height: auto;
  display: block;
  transition: transform 0.5s ease;
}

.ad-item:hover img {
  transform: scale(1.02);
}

/* --- About Section --- */
.about {
  background-color: var(--color-off-white);
}

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

.about-image {
  position: relative;
  overflow: hidden;
}

.about-image img {
  width: 100%;
  height: auto;
  object-fit: cover;
}

.about-content .section-tag {
  display: block;
  margin-bottom: 16px;
}

.about-content .section-title {
  margin-bottom: 32px;
}

.about-text {
  font-size: 15px;
  line-height: 1.9;
  color: var(--color-dark);
  margin-bottom: 20px;
}

.about-services {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 32px;
  padding-top: 28px;
  border-top: 1px solid var(--color-light-gray);
}

.service-tag {
  font-size: 11px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--color-dark);
  padding: 8px 16px;
  border: 1px solid var(--color-light-gray);
}

.about-text strong {
  font-weight: 500;
}

/* --- Contact Section --- */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 80px;
}

.contact-info .section-tag {
  display: block;
  margin-bottom: 16px;
}

.contact-info .section-title {
  margin-bottom: 24px;
}

.contact-text {
  font-size: 15px;
  line-height: 1.8;
  color: var(--color-dark);
  margin-bottom: 40px;
}

.contact-details {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.contact-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.contact-label {
  font-size: 12px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--color-gray);
}

.contact-item a,
.contact-item span {
  font-size: 15px;
  color: var(--color-dark);
  transition: opacity 0.3s ease;
}

.contact-item a:hover {
  opacity: 0.6;
}

/* Form */
.contact-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding-top: 8px;
}

.form-group input,
.form-group textarea {
  width: 100%;
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 300;
  padding: 16px 0;
  border: none;
  border-bottom: 1px solid var(--color-light-gray);
  background: transparent;
  color: var(--color-black);
  transition: border-color 0.3s ease;
  outline: none;
}

.form-group input::placeholder,
.form-group textarea::placeholder {
  color: var(--color-gray);
  font-weight: 300;
  letter-spacing: 0.5px;
}

.form-group input:focus,
.form-group textarea:focus {
  border-bottom-color: var(--color-black);
}

.form-group textarea {
  resize: vertical;
  min-height: 100px;
}

.btn-submit {
  align-self: flex-start;
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--color-white);
  background-color: var(--color-black);
  border: 1px solid var(--color-black);
  padding: 16px 40px;
  cursor: pointer;
  transition: all 0.3s ease;
  margin-top: 8px;
}

.btn-submit:hover {
  background-color: transparent;
  color: var(--color-black);
}

/* --- Footer --- */
.footer {
  padding: 60px 0;
  border-top: 1px solid var(--color-light-gray);
}

.footer-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
}

.footer-logo {
  font-family: var(--font-serif);
  font-size: 18px;
  font-weight: 400;
  letter-spacing: 2px;
}

.footer-links {
  display: flex;
  gap: 32px;
}

.footer-links a {
  font-size: 12px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--color-gray);
  transition: color 0.3s ease;
}

.footer-links a:hover {
  color: var(--color-black);
}

.footer-copy {
  font-size: 12px;
  color: var(--color-gray);
  letter-spacing: 0.5px;
}

/* --- Animations --- */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* Reveal on Scroll */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}

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

/* Staggered children */
.projects-grid .reveal:nth-child(1) { transition-delay: 0s; }
.projects-grid .reveal:nth-child(2) { transition-delay: 0.1s; }
.projects-grid .reveal:nth-child(3) { transition-delay: 0.2s; }
.projects-grid .reveal:nth-child(4) { transition-delay: 0.3s; }
.projects-grid .reveal:nth-child(5) { transition-delay: 0.4s; }
.projects-grid .reveal:nth-child(6) { transition-delay: 0.5s; }
.projects-grid .reveal:nth-child(7) { transition-delay: 0.6s; }
.projects-grid .reveal:nth-child(8) { transition-delay: 0.7s; }

/* ========================================
   Project Detail Page
   ======================================== */

/* Project Hero */
.project-hero {
  position: relative;
  height: 70vh;
  min-height: 400px;
  display: flex;
  align-items: flex-end;
  overflow: hidden;
}

.project-hero-image {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

.project-hero-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.project-hero-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    to bottom,
    rgba(0, 0, 0, 0.1) 0%,
    rgba(0, 0, 0, 0.5) 100%
  );
}

.project-hero-content {
  position: relative;
  z-index: 1;
  color: var(--color-white);
  padding: 0 var(--container-padding) 60px;
  max-width: var(--container-max);
  margin: 0 auto;
  width: 100%;
}

.back-link {
  display: inline-block;
  font-size: 12px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.8);
  margin-bottom: 16px;
  transition: color 0.3s ease;
}

.back-link:hover {
  color: var(--color-white);
}

.project-hero-title {
  font-family: var(--font-sans);
  font-weight: 300;
  font-size: clamp(32px, 5vw, 56px);
  letter-spacing: 8px;
}

/* Gallery Grid */
.project-gallery {
  padding: 80px 0;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.gallery-item {
  overflow: hidden;
  cursor: pointer;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.gallery-item.visible {
  opacity: 1;
  transform: translateY(0);
}

.gallery-item img {
  width: 100%;
  height: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.gallery-item:hover img {
  transform: scale(1.04);
}

/* Lightbox */
.lightbox {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.95);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

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

.lightbox-content {
  max-width: 90vw;
  max-height: 85vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lightbox-content img {
  max-width: 100%;
  max-height: 85vh;
  object-fit: contain;
}

.lightbox-close {
  position: absolute;
  top: 24px;
  right: 32px;
  font-size: 32px;
  color: var(--color-white);
  background: none;
  border: none;
  cursor: pointer;
  z-index: 2001;
  opacity: 0.7;
  transition: opacity 0.3s ease;
  line-height: 1;
}

.lightbox-close:hover {
  opacity: 1;
}

.lightbox-prev,
.lightbox-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  font-size: 48px;
  color: var(--color-white);
  background: none;
  border: none;
  cursor: pointer;
  z-index: 2001;
  opacity: 0.5;
  transition: opacity 0.3s ease;
  padding: 16px;
  line-height: 1;
}

.lightbox-prev { left: 16px; }
.lightbox-next { right: 16px; }

.lightbox-prev:hover,
.lightbox-next:hover {
  opacity: 1;
}

.lightbox-counter {
  position: absolute;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  color: rgba(255, 255, 255, 0.6);
  font-size: 13px;
  letter-spacing: 2px;
}

/* --- Responsive --- */
@media (max-width: 900px) {
  .projects-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
  }

  .about-grid {
    grid-template-columns: 1fr;
    gap: 48px;
  }

  .contact-grid {
    grid-template-columns: 1fr;
    gap: 48px;
  }

  .section {
    padding: 80px 0;
  }

  .section-header {
    margin-bottom: 48px;
  }

  .gallery-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }

  .proceso-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }

  .antes-despues-grid {
    grid-template-columns: 1fr;
    gap: 4px;
  }
}

@media (max-width: 640px) {
  :root {
    --nav-height: 64px;
    --container-padding: 20px;
  }

  .nav-toggle {
    display: flex;
  }

  .nav-links {
    position: fixed;
    top: 0;
    right: -100%;
    width: 100%;
    height: 100vh;
    background-color: var(--color-white);
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 32px;
    transition: right 0.4s ease;
  }

  .nav-links.open {
    right: 0;
  }

  .nav-links a {
    color: var(--color-black) !important;
    font-size: 16px;
    letter-spacing: 3px;
  }

  .hero-title {
    letter-spacing: 3px;
    line-height: 2;
  }

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

  .about-services {
    gap: 8px;
  }

  .section {
    padding: 64px 0;
  }

  .gallery-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .proceso-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .project-hero {
    height: 50vh;
    min-height: 300px;
  }

  .project-hero-content {
    padding-bottom: 40px;
  }

  .lightbox-prev,
  .lightbox-next {
    font-size: 32px;
    padding: 8px;
  }

  .footer-links {
    flex-wrap: wrap;
    justify-content: center;
    gap: 20px;
  }
}
