/* Portfolio page — Amexhe Flooring */
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: 'Montserrat', Arial, sans-serif;
  background: var(--black);
  color: var(--text-on-dark);
  line-height: 1.6;
}

.topbar {
  background: linear-gradient(90deg, #0d0d0d, #1b1b1b, #0d0d0d);
  border-bottom: 1px solid rgba(255,255,255,.08);
  font-size: 14px;
  color: #f2f2f2;
}

.topbar-inner,
.container {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
}

.topbar-inner {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 0;
  flex-wrap: wrap;
}

.hero {
  position: relative;
  background:
    linear-gradient(rgba(0,0,0,.58), rgba(0,0,0,.72)),
    url('../img/hero-portfolio.jpg') center/cover no-repeat;
  min-height: 620px;
}

.hero-content {
  width: min(980px, calc(100% - 32px));
  margin: 56px auto 0;
  text-align: center;
}

.eyebrow {
  color: #f0f0f0;
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 18px;
}

h1 {
  margin: 0;
  font-size: clamp(34px, 6vw, 72px);
  line-height: 1.05;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.gold { color: var(--gold); }

.hero-line,
.section-line {
  width: 160px;
  height: 3px;
  background: var(--gold);
  margin: 22px auto;
  box-shadow: 0 0 18px rgba(202,162,77,.45);
}

.hero-subtext {
  max-width: 860px;
  margin: 0 auto 34px;
  font-size: 19px;
  color: #f1f1f1;
}

.cta-row {
  display: flex;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 28px;
}

.btn {
  display: inline-block;
  padding: 16px 34px;
  min-width: 220px;
  font-size: 16px;
  font-weight: 700;
  border-radius: 4px;
  text-decoration: none;
  box-shadow: var(--shadow-lg);
}

.btn-primary {
  background: linear-gradient(180deg, #dfbb68, var(--gold));
  color: #111;
}

.btn-secondary {
  color: white;
  border: 1px solid rgba(255,255,255,.18);
  background: rgba(20,20,20,.78);
}

.section-dark {
  padding: 82px 0;
  background:
    radial-gradient(circle at top, rgba(255,255,255,.04), transparent 40%),
    linear-gradient(180deg, #171717 0%, #101010 100%);
  border-top: 1px solid rgba(255,255,255,.06);
  border-bottom: 1px solid rgba(255,255,255,.06);
}

.section-title {
  text-align: center;
  font-size: clamp(28px, 4vw, 42px);
  margin: 0 0 14px;
  font-weight: 800;
}

.section-intro {
  max-width: 900px;
  margin: 0 auto 44px;
  text-align: center;
  font-size: 18px;
  color: var(--muted);
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 30px 24px;
  list-style: none;
  margin: 0;
  padding: 0;
  align-items: start;
}

/* Galería — imagen sola, scroll + stagger (is-visible añadido en animations.js) */
#portfolio-gallery .fade-in-up {
  opacity: 0;
  transform: translateY(40px);
  will-change: opacity, transform;
  transition:
    opacity 0.72s cubic-bezier(0.22, 1, 0.36, 1),
    transform 0.72s cubic-bezier(0.22, 1, 0.36, 1);
  transition-delay: calc(0.04s + (var(--reveal-index, 0) * 0.08s));
}

#portfolio-gallery .fade-in-up.is-visible {
  opacity: 1;
  transform: translateY(0);
  transition-delay: calc(0.04s + (var(--reveal-index, 0) * 0.08s));
}

.portfolio-tile {
  margin: 0;
  cursor: pointer;
}

.portfolio-tile__card {
  height: 100%;
  display: flex;
  flex-direction: column;
  border-radius: 14px;
  background: linear-gradient(180deg, #1e1e1e 0%, #181818 100%);
  box-shadow: 0 20px 48px rgba(0, 0, 0, 0.42);
  border: 1px solid rgba(255, 255, 255, 0.07);
  overflow: hidden;
  transition: box-shadow 0.4s ease, border-color 0.4s ease, transform 0.4s ease;
}

@media (hover: hover) and (pointer: fine) {
  .portfolio-tile:hover .portfolio-tile__card {
    border-color: rgba(202, 162, 77, 0.2);
    box-shadow: 0 28px 60px rgba(0, 0, 0, 0.55);
    transform: translateY(-2px);
  }
}

/* Image — overflow hidden, premium zoom (scale 1.1) */
.portfolio-tile__media {
  position: relative;
  aspect-ratio: 3 / 2.15;
  overflow: hidden;
  background: linear-gradient(145deg, #2a2a2a, #121212);
}

.portfolio-tile__parallax {
  width: 100%;
  height: 100%;
  transform: translate3d(0, var(--py, 0), 0);
  will-change: transform;
}

.portfolio-tile__parallax img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transform: scale(1);
  transition: transform 0.55s cubic-bezier(0.22, 1, 0.36, 1);
  will-change: transform;
}

.portfolio-tile:hover .portfolio-tile__parallax img,
.portfolio-tile:focus-within .portfolio-tile__parallax img {
  transform: scale(1.1);
}

@media (prefers-reduced-motion: reduce) {
  #portfolio-gallery .fade-in-up {
    transition-duration: 0.01ms;
    transition-delay: 0s !important;
  }

  .portfolio-tile__parallax {
    transform: none !important;
  }

  .portfolio-tile__parallax img {
    transition: none;
  }

  .portfolio-tile:hover .portfolio-tile__parallax img,
  .portfolio-tile:focus-within .portfolio-tile__parallax img {
    transform: none;
  }

  .portfolio-tile:hover .portfolio-tile__card {
    transform: none;
  }
}

/* ——— Lightbox (ampliar imagen) ——— */
body.body--lightbox-open {
  overflow: hidden;
}

.portfolio-lightbox {
  position: fixed;
  inset: 0;
  z-index: 10050;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4vh 4vw;
  background: rgba(0, 0, 0, 0.88);
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transition:
    opacity 0.32s ease,
    visibility 0.32s ease;
}

.portfolio-lightbox--open {
  opacity: 1;
  visibility: visible;
}

.portfolio-lightbox__img {
  max-width: 90vh;
  max-height: 90vh;
  width: auto;
  height: auto;
  object-fit: contain;
  display: block;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.6);
  border-radius: 4px;
  cursor: pointer;
}

@media (prefers-reduced-motion: reduce) {
  .portfolio-lightbox {
    transition-duration: 0.01ms;
  }
}

.bottom-copy {
  margin-top: 48px;
  padding: clamp(40px, 7vh, 72px) 0 clamp(48px, 9vh, 96px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.bottom-copy .card {
  width: 100%;
  max-width: min(900px, 100%);
  margin: 0 auto;
  text-align: left;
}

.bottom-copy .card h3 {
  text-align: center;
}

.card {
  background: var(--panel);
  border: 1px solid rgba(255,255,255,.08);
  box-shadow: var(--shadow-lg);
  padding: 34px;
}

.card h3 {
  margin-top: 0;
  margin-bottom: 14px;
  font-size: 26px;
  font-weight: 800;
}

.card p { color: #e7e7e7; }

.cta-section {
  text-align: center;
  padding: 80px 0;
  background:
    linear-gradient(rgba(0,0,0,.72), rgba(0,0,0,.78)),
    url('../img/cta-footer.jpg') center/cover no-repeat;
}

.cta-section p {
  max-width: 760px;
  margin: 0 auto 26px;
  color: #ededed;
  font-size: 18px;
}

footer {
  background: #0b0b0b;
  color: #cfcfcf;
  text-align: center;
  padding: 24px 16px;
  font-size: 14px;
  border-top: 1px solid rgba(255,255,255,.06);
}

/* Tablet: 2 columnas */
@media (max-width: 991px) {
  .gallery-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 24px 20px;
  }
}

@media (max-width: 700px) {
  .topbar-inner {
    flex-direction: column;
    align-items: flex-start;
  }

  .hero {
    min-height: auto;
    padding-bottom: 60px;
  }

  .hero-content {
    margin-top: 60px;
  }

  .card { padding: 24px; }
}

/* Móvil: 1 columna */
@media (max-width: 575px) {
  .gallery-grid {
    grid-template-columns: 1fr;
    gap: 22px;
  }
}
