:root {
  --bg: #0d0d0d;
  --accent: #fff;
  --muted: #b3b3b3;
  --h: 80px;
}

*,
*:before,
*:after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html,
body {
  height: 100%;
}

html {
  scroll-behavior: smooth;
  scroll-snap-type: y mandatory;
  overflow-y: scroll;
}

body {
  font-family: 'Poppins', sans-serif;
  background: var(--bg);
  color: var(--accent);
  line-height: 1.6;
}

/* HEADER */
header {
  position: fixed;
  inset: 0 0 auto 0;
  height: var(--h);
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 2rem;
  z-index: 100;
  transition: background 0.3s;
}

header.scrolled {
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(6px);
}

.logo {
  font-weight: 600;
  letter-spacing: 2px;
  color: var(--accent);
  text-decoration: none;
}

nav a {
  margin-left: 1.5rem;
  color: var(--accent);
  text-decoration: none;
  font-weight: 300;
  position: relative;
}

nav a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -4px;
  width: 0;
  height: 2px;
  background: var(--accent);
  transition: width 0.3s;
}

nav a:hover::after {
  width: 100%;
}

/* SECTION BASE */
section {
  width: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  position: relative;
  scroll-snap-align: start;
  scroll-snap-stop: always;
}

/* FULL-HEIGHT */
#hero,
.showcase,
#projects,
#services,
#about-full,
#collaborate {
  height: 100vh;
}

/* HERO */
#hero {
  overflow: hidden;
}

#hero video,
.showcase video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

#hero .overlay {
  position: relative;
  z-index: 2;
  text-align: center;
  padding: 0 1rem;
}

#hero h1 {
  font-size: clamp(2rem, 6vw, 5rem);
  line-height: 1.1;

}

.showcase-link {
  position: relative;
  z-index: 2;
  font-size: clamp(1.75rem, 4vw, 4rem);
  font-weight: 600;
  color: var(--accent);
  text-decoration: none;
  border-bottom: 3px solid transparent;
  padding-left: 5vw;
  transition: border-color 0.3s;
}

#hero p {
  margin-top: 1rem;
  font-size: clamp(1rem, 2vw, 1.25rem);
  color: var(--accent);
}


/* SHOWCASE */
.showcase {
  overflow: hidden;
  justify-content: center;
  align-items: flex-start;
}

.showcase::before {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  z-index: 1;
}

.showcase-link {
  position: relative;
  z-index: 2;
  font-size: clamp(1.75rem, 4vw, 4rem);
  font-weight: 600;
  color: var(--accent);
  text-decoration: none;
  border-bottom: 3px solid transparent;
  padding-left: 5vw;
  transition: border-color 0.3s;
}

.showcase-link:hover {
  border-color: var(--accent);
}

/* PROJECTS */
#projects,
#services {
  padding: 6rem 5vw 2rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

#projects h2,
#services h2 {
  text-align: center;
  margin-bottom: 1.5rem;
  font-size: 1.35rem;
}

.projects-grid {
  display: grid;
  width: 100%;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
}

.project-item {
  position: relative;            /* 🗝 para posicionar el texto */
  background: transparent;
  padding: 0;
  border-radius: 8px;
  cursor: pointer;               /* opcional */
  overflow: hidden;           /* recorta la imagen al borde redondeado */
  transition: transform .35s;
}

.project-item:hover {
  transform: translateY(-4px);     /* zoom suave al hacer hover */
}

.project-placeholder {
  height: 140px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1rem;
}

.project-item h3 {
  margin-top: .75rem;
  font-size: 1rem;
  font-weight: 600;
  text-align: left;
}

/* Imagen dentro de cada cuadrado de “Featured Projects” */
.project-item img{
 width: 100%;
  aspect-ratio: 4 / 3;        /* adapta a render horizontal, cámbialo si prefieres */
  object-fit: cover;          /* rellena sin deformar */
  display: block;             /* quita espacio extra abajo */
  transition: transform .35s;
}

.project-item:hover img{
  transform: scale(1.08);        /* zoom suave */
}

/* —— degradado para mejor lectura —— */
.project-item::after{
  content: "";
  position: absolute;
  inset: 0;                      /* cubre toda la tarjeta */
  background: linear-gradient(to top, rgba(0,0,0,.55) 0%, rgba(0,0,0,0) 60%);
  pointer-events: none;          /* no bloquea clics */
  opacity: 0;                    /* visible sólo al pasar el cursor (opcional) */
  transition: opacity .35s;
}
.project-item:hover::after{ opacity: 1; }

/* —— titulo sobre la imagen —— */
.project-item h3{
  position: absolute;
  left: 1rem;
  bottom: 1rem;
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  z-index: 1;                    /* por encima del degradado */
}

/* Si añadiste subtítulo: */
.project-item .subtitle{
  position: absolute;
  left: 1rem;
  bottom: .25rem;                /* un poquito más abajo que el h3 */
  margin: 0;
  font-size: .85rem;
  color: var(--muted);
  z-index: 1;
}

/* SERVICES GRID */
.services-grid {
  display: grid;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem;
}

.service-item {
  border-radius: 10px;
  padding: 1rem;
  transition: transform 0.3s;
}

.service-item:hover {
  transform: scale(1.03);
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.service-item h3 {
  font-size: 1.125rem;
  margin-bottom: 0.5rem;
}

.service-item p {
  color: var(--muted);
  font-size: 0.95rem;
}

/* Service item animations */
.service-item h3,
.service-item p {
  animation: fadeInUp 1s ease-out forwards;
  opacity: 0;
}

/* Specific animations for requested text */
.service-item:nth-child(1) h3,
.service-item:nth-child(1) p,
.service-item:nth-child(2) h3,
.service-item:nth-child(2) p,
.service-item:nth-child(3) h3,
.service-item:nth-child(3) p,
.service-item:nth-child(4) h3,
.service-item:nth-child(4) p,
.service-item:nth-child(5) h3,
.service-item:nth-child(5) p {
  animation: fadeInUp 1s ease-out forwards;
  opacity: 0;
}

/* Animation delays for service items */
.service-item:nth-child(1) h3,
.service-item:nth-child(1) p {
  animation-delay: 0.2s;
}

.service-item:nth-child(2) h3,
.service-item:nth-child(2) p {
  animation-delay: 0.4s;
}

.service-item:nth-child(3) h3,
.service-item:nth-child(3) p {
  animation-delay: 0.6s;
}

.service-item:nth-child(4) h3,
.service-item:nth-child(4) p {
  animation-delay: 0.8s;
}

.service-item:nth-child(5) h3,
.service-item:nth-child(5) p {
  animation-delay: 1.0s;
}

.service-item:nth-child(6) h3,
.service-item:nth-child(6) p {
  animation-delay: 1.2s;
}

.service-item:nth-child(7) h3,
.service-item:nth-child(7) p {
  animation-delay: 1.4s;
}

.service-item:nth-child(8) h3,
.service-item:nth-child(8) p {
  animation-delay: 1.6s;
}

/* ABOUT-FULL */
#about-full {
  padding: 0 5vw;
  text-align: center;
}

#about-full .about-container {
  max-width: 900px;
}

/* COLLABORATE */
#collaborate {
  padding: 0 5vw;
  text-align: center;
  background: var(--bg);
}

#collaborate .collab-inner {
  position: relative;
  z-index: 2;
}

/* CONTACT */
#contact {
  padding: 5rem 5vw;
  text-align: center;
  height: auto;
}

/* BUTTON */
.btn {
  display: inline-block;
  margin-top: 1rem;
  padding: 0.75rem 2rem;
  border: 2px solid var(--accent);
  border-radius: 40px;
  color: var(--accent);
  text-decoration: none;
  transition: background 0.3s;
}

.btn:hover {
  background: var(--accent);
  color: var(--bg);
}

/* ——— Our Services  con imagen + overlay oscuro ——— */
.service-item{
  position: relative;                 /* necesario para el ::before */
  background-size: cover;             /* ajusta la foto al cuadro   */
  background-position: center;        /* centrar la imagen          */
  border-radius: 10px;
  padding: 1.5rem;                    /* respira un poco más        */
  overflow: hidden;                   /* recorta la foto            */
  color: var(--accent);               /* el texto sigue blanco      */
}

.service-item::before{                /* velo negro */
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,.55);        /* 55 % de opacidad */
  transition: background .3s;
  z-index: 0;                         /* debajo del texto */
}

/* que el texto quede por encima del velo */
.service-item > *{ position: relative; z-index: 1; }

/* efecto sutil al pasar el cursor (opcional) */
.service-item:hover::before{ background: rgba(0,0,0,.40); }
.service-item:hover{ transform: scale(1.03); }   /* ya existía */

/* RESPONSIVE */
@media (max-width: 768px) {
  header {
    height: 64px;
    padding: 0 1.2rem;
  }

  nav a {
    margin-left: 1rem;
  }

  .showcase-link {
    font-size: 2rem;
    padding-left: 1.2rem;
  }

  #projects h2,
  #services h2,
  #about-full h2 {
    font-size: 1.75rem;
  }

  .project-placeholder {
    height: 330px;
  }

  .services-grid {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: repeat(2, 1fr);
  }
}

/* ——— Flecha del hero ——— */
.hero-arrow{
  position: absolute;          /* solo dentro del hero */
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%);
  background: transparent;
  border: 0;
  color: var(--accent);
  cursor: pointer;
  opacity: .85;
  z-index: 2;                  /* por encima del vídeo */
  animation: arrowBounce 2s infinite;
  transition: opacity .3s;
}
.hero-arrow:hover{ opacity: 1; }

@keyframes arrowBounce{
  0%,20%,50%,80%,100%{ transform: translate(-50%,0); }
  40%{ transform: translate(-50%,-8px); }
  60%{ transform: translate(-50%,-4px); }
}

/* ——— Flecha “volver arriba” ——— */
.back-arrow{
  position: fixed;
  bottom: 32px;
  right: 32px;
  width: 48px;                 /* tamaño del círculo */
  height: 48px;
  border-radius: 50%;
  border: 2px solid var(--accent);
  background: transparent;

  /* centramos el SVG dentro del círculo */
  display: none;               /* ⬅️  ahora sí: oculta totalmente */
  align-items: center;
  justify-content: center;

  color: var(--accent);
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transition: opacity .3s;
  animation: backBounce 2s infinite;
  z-index: 50;
}

.back-arrow.visible{           /* la añade JS cuando #contact entra */
  display: flex;               /* ← se vuelve a pintar */
  opacity: .85;
  pointer-events: auto;
}

.back-arrow:hover{ opacity: 1; }

.back-arrow svg{ transform: rotate(180deg); }

@keyframes backBounce{
  0%,20%,50%,80%,100% { transform: translateY(0); }
  40% { transform: translateY(-8px); }
  60% { transform: translateY(-4px); }
}

/* === Botones de redes sociales (#contact) ======================= */
.social-links{
  display: flex;
  gap: 1.25rem;           /* separación entre botones */
  justify-content: center;
  align-items: center;
}

.social-btn{
  width: 56px;
  height: 56px;
  border: 2px solid var(--accent);
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  color: var(--accent);
  font-size: 1.4rem;      /* tamaño del icono */
  transition: background .3s, color .3s, transform .2s;
}

.social-btn:hover{
  background: var(--accent);
  color: var(--bg);
  transform: translateY(-4px);   /* pequeño “lift” al pasar el cursor */
}

@media (max-width: 480px){
  .social-btn{
    width: 48px;
    height: 48px;
    font-size: 1.2rem;
  }
}

/* centra los iconos aunque #contact tenga poco contenido */
#contact{
  padding: 2rem 5rem 5vw;
  display: flex;
  flex-direction: column;
  gap: 3rem;                 /* espacio entre fila e ícono */
  align-items: center;
  justify-content: center;
  text-align: center;
}

.contact-tagline{
  font-size: .9rem;
  color: var(--muted);       /* gris claro */
  margin: 0;
}

/* quita el subrayado azul típico de los <a> */
.social-btn{
  text-decoration: none;
}

/* ============================================================= */
/*  Ajustes móvil  (≤768 px)                                      */
/* ============================================================= */
@media (max-width: 768px){
  /* — sección Projects & Services — */
  #projects,
  #services{
    min-height: 100vh;
    height: auto;
    scroll-snap-align: start;
    scroll-snap-stop: always;
    padding-top: 4rem;
    padding-bottom: 3rem;
    justify-content: flex-start;
  }


 /* ─── Featured Projects  —  carrusel horizontal ─── */
#projects .projects-grid{
  /* pista del carrusel */
  display: flex;                /* ← de grid a flex-row */
  flex-wrap: nowrap;
  gap: 1rem;                    /* separación entre tarjetas */

  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-padding-inline: 1.2rem;     /* “acolcha” el primer snap */

  padding-inline: 1.2rem;       /* igual que el resto del diseño */
  -webkit-overflow-scrolling: touch; /* inercia iOS */
}

#projects .projects-grid::-webkit-scrollbar{ display:none; }

/* cada tarjeta = 90 % del viewport, nunca se rompe */
#projects .project-item{
  flex: 0 0 90%;                /* ancho fijo relativo */
  scroll-snap-align: center;
}

  /* Services en una sola columna */
  .services-grid{
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  /* Imagen dentro de cada cuadrado de “Featured Projects” */
.project-item img{
 width: 100%;
  aspect-ratio: 2 / 3;        /* adapta a render horizontal, cámbialo si prefieres */
  object-fit: cover;          /* rellena sin deformar */
  display: block;             /* quita espacio extra abajo */
  transition: transform .35s;
}
}  /* ←——  ESTA LLAVE cierra el ÚNICO @media */

/* ——————————————————————————————————— */
/*   NAV responsive (hamburger)         */
/* ——————————————————————————————————— */
.hamburger{
  display: none;                /* visible solo en móvil      */
  flex-direction: column;
  justify-content: space-between;
  width: 24px;
  height: 18px;
  background: none;
  border: 0;
  cursor: pointer;
  z-index: 120;                 /* por encima del panel        */
}

.hamburger span{
  width: 100%;
  height: 2px;
  background: var(--accent);
  transition: transform .3s, opacity .3s;
}

/* panel oculto por defecto */
#nav-menu{
  display:flex;
  gap:1.5rem;
  white-space:nowrap;      /* ← evita salto de línea */
}

/* enlaces — elimina margen duplicado */
#nav-menu a{ margin-left:0; }

/* ------------------  Desktop only  ------------------ */
@media (min-width:769px){
  /* oculta por completo el botón en desktop */
  .hamburger{ display:none !important; }
   #nav-menu{         /* ← el que está dentro del header */
    display:flex;
    gap:1.5rem;
  }
  #nav-menu-panel{ display:none; }
}

/* ======== NAV — SOLO MÓVIL (≤768 px) ========= */
@media (max-width: 768px){

  /* variables + botón hamburguesa */
  :root{ --h: 64px; }          /* misma altura que el <header> */
  .hamburger{ display:flex; }

  /* ---------- Panel deslizable ---------- */
  #nav-menu{
    display:none; }

  #nav-menu-panel{  
    position: fixed;
    top: var(--h);             /* empieza justo bajo el header */
    right: 0;
    width: 240px;

    /* alto = lo que ocupen los links  */
    height: auto;
    max-height: calc(100% - var(--h));
    overflow-y: auto;

    background: rgba(0,0,0,.45);   /* negro translúcido 45 %   */
    backdrop-filter: blur(6px);

    display: flex;
    flex-direction: column;
    align-items: flex-end;     /* texto pegado a la derecha   */
    gap: 1.2rem;
    padding: 2rem 1.5rem;

    transform: translateX(100%);
    transition: transform .35s ease;
    z-index: 200;              /* por encima del header (100) */
  }
  #nav-menu-panel.open {
  transform: translateX(0);
}

  /* ---------- Enlaces ---------- */
  #nav-menu a{
    width: 100%;               /* franja táctil completa      */
    display: block;
    font-size: 1.1rem;
    text-align: right;         /* texto justificado a la der. */
    margin: 0;
  }

  /* ---------- Icono “X” ---------- */
  .hamburger.open span:nth-child(1){ transform:translateY(8px)  rotate(45deg); }
  .hamburger.open span:nth-child(2){ opacity:0; }
  .hamburger.open span:nth-child(3){ transform:translateY(-8px) rotate(-45deg); }

  /* ---------- Secciones a 100 svh ---------- */
  @supports (height: 100svh){
    #hero, .showcase, #projects, #services, #about-full, #collaborate{
      height: 100svh;
    }
  }
}

/* ============================================================= */
/*  Ajuste de altura para laptops / desktop (≥1024 px)            */
/* ============================================================= */

@media (min-width: 1024px){

  /* — Featured Projects — imágenes más altas — */
  #projects .project-item img{
    aspect-ratio: 3 / 3;   /* ancho : alto  → +33 % de altura */
    /* Si prefieres fijo: height: 360px; y quitas aspect-ratio */
  }
}

@media (min-width:1024px){
  #projects,
  #services{
    height:auto;
    min-height:100vh;
  }
}

@media (max-width: 768px) {
  .service-item {
    padding: 0.5rem 1rem;    /* menos espacio arriba/abajo */
    height: 120px;           /* altura fija para que no crezca */
    min-height: unset;       /* elimina el min-height anterior */
    max-height: 50px;       /* opcional: previene que crezca demasiado */
    overflow: hidden;        /* si hay desborde de texto lo recorta */
  }

  .service-item h3 {
    font-size: 0.95rem;      /* texto más pequeño */
    margin-bottom: 0.3rem;
  }

  .service-item p {
    font-size: 0.75rem;      /* párrafo más compacto */
  }
}

@media (max-width: 768px) {
  .about-text.collapsed {
    display: -webkit-box;
    -webkit-line-clamp: 5;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  .toggle-about {
    background: none;
    border: none;
    color: var(--accent);
    font-size: 1.2rem;
    margin-top: 0.5rem;
    cursor: pointer;
  }
}

/* Mostrar la flecha solo en móviles */
.toggle-about {
  display: none;
}

@media (max-width: 768px) {
  .toggle-about {
    display: inline-block;
  }
}

/* Lightbox Modal */
.lightbox {
  position: fixed;
  z-index: 9999;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.9);
  display: flex;
  justify-content: center;
  align-items: center;
  flex-direction: column;
}

.lightbox img.lightbox-image {
  max-width: 90%;
  max-height: 80vh;
  object-fit: contain;
  border-radius: 10px;
  transition: all 0.3s ease;
}

.lightbox .close,
.lightbox .prev,
.lightbox .next {
  position: absolute;
  color: #fff;
  font-size: 2rem;
  background: none;
  border: none;
  cursor: pointer;
  padding: 1rem;
  z-index: 10000;
}

.lightbox .close { top: 20px; right: 30px; }
.lightbox .prev { left: 20px; top: 50%; transform: translateY(-50%); }
.lightbox .next { right: 20px; top: 50%; transform: translateY(-50%); }

.lightbox.hidden {
  display: none;
}

/* fuerza el texto blanco en cualquier estado del enlace */
.tour-card span,
.tour-card:visited span,
.tour-card:hover span {
  color:#fff !important;
}
