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

:root {
  --verde: #0e5f50;
  --amarillo: #c8a020;
  --blanco: #ffffff;
  --fondo: #f9f9f7;
  --texto: #1a1a1a;
  --gris: #888;
  --borde: #e0e0d8;
}

html { scroll-behavior: smooth; }

body {
  font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
  background: var(--blanco);
  color: var(--texto);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ── CABECERA ─────────────────────────────────────────── */
header {
  background: var(--blanco);
  border-bottom: 2px solid var(--verde);
  position: sticky;
  top: 0;
  z-index: 100;
}

.logo-wrap {
  border-bottom: 1px solid var(--borde);
  line-height: 0;
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 1rem;
}

.logo-wrap a { display: inline-block; }

/* Logo más pequeño */
.logo {
  display: block;
  height: 36px;
  width: auto;
}

/* ── MENÚ DESLIZANTE ──────────────────────────────────── */
.menu-scroll {
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: var(--verde) transparent;
  position: relative;
  background: var(--blanco);
  max-width: 1400px;
  margin: 0 auto;
}

.menu-scroll::-webkit-scrollbar { height: 3px; }
.menu-scroll::-webkit-scrollbar-thumb {
  background: var(--verde);
  border-radius: 2px;
}

/* degradado indicador de scroll derecha */
.menu-wrap::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 32px; height: 100%;
  background: linear-gradient(to left, transparent, rgba(255,255,255,0.85));
  pointer-events: none;
}
.menu-wrap::after {
  content: '';
  position: absolute;
  top: 0; right: 0;
  width: 32px; height: 100%;
  background: linear-gradient(to right, transparent, rgba(255,255,255,0.85));
  pointer-events: none;
}

.menu-wrap {
  position: relative;
  display: inline-block;
  line-height: 0;
}

/* Imagen del menú reducida a 1300 px */
.menu-img {
  display: block;
  width: 1300px;
  height: auto;
}

/* Zonas clicables superpuestas al menú — top/height/left/width se fijan inline */
.menu-link {
  position: absolute;
  display: block;
  cursor: pointer;
  /* background: rgba(14, 95, 80, 0.35); */
  /* outline: 1px solid rgba(14, 95, 80, 0.35); */
}

/* ── CONTENIDO PRINCIPAL ──────────────────────────────── */
main {
  flex: 1;
  max-width: 1400px;
  width: 100%;
  margin: 0 auto;
  padding: 2rem 1rem 3rem;
}

/* ── SECCIÓN SOBRE EL ESTUDIO ────────────────────────── */
.about {
  display: grid;
  gap: 2.5rem;
  margin-bottom: 3rem;
  padding-bottom: 2.5rem;
  border-bottom: 1px solid var(--borde);
}

.about-studio,
.about-bio {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.about-studio p,
.about-bio p {
  font-size: 0.82rem;
  line-height: 1.75;
  color: var(--verde);
  text-align: justify;
}

.about-bio p {
  font-style: italic;
}

.about-name {
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--verde);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.about-name span {
  font-weight: 300;
  color: var(--gris);
}

@media (min-width: 720px) {
  .about {
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
  }
}

/* ── TÍTULO DE PÁGINA ─────────────────────────────────── */
.page-title {
  font-size: clamp(0.9rem, 2vw, 1.3rem);
  font-weight: 300;
  color: var(--verde);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--verde);
  margin-bottom: 2.5rem;
}

/* ── ÍNDICE: CUADRÍCULA DE CATEGORÍAS ────────────────── */
.cat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 280px));
  justify-content: center;
  gap: 1rem;
}

.cat-card {
  display: block;
  text-decoration: none;
  border: 1px solid var(--borde);
  overflow: hidden;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.cat-card:hover {
  border-color: var(--verde);
  box-shadow: 0 2px 14px rgba(14,95,80,0.12);
}

.cat-card:hover .cat-label {
  background: var(--verde);
  color: var(--blanco);
}

.cat-thumb {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  display: block;
}

.cat-thumb-empty {
  width: 100%;
  aspect-ratio: 4 / 3;
  background: var(--fondo);
  display: flex;
  align-items: center;
  justify-content: center;
}

.cat-thumb-empty span {
  color: var(--gris);
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.cat-label {
  padding: 0.6rem 0.9rem;
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--verde);
  background: var(--blanco);
  border-top: 2px solid var(--verde);
  transition: background 0.2s, color 0.2s;
}

/* ── SUBTÍTULO DE SECCIÓN ─────────────────────────────── */
.section-title {
  font-size: clamp(0.8rem, 1.8vw, 1.1rem);
  font-weight: 300;
  color: var(--verde);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid var(--borde);
  margin: 2.5rem 0 1.5rem;
}

/* ── PROYECTOS ────────────────────────────────────────── */
.project { margin-bottom: 3.5rem; }

.project-title {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--verde);
  letter-spacing: 0.09em;
  text-transform: uppercase;
  margin-bottom: 0.3rem;
}

.project-desc {
  font-size: 0.8rem;
  color: var(--gris);
  line-height: 1.65;
  margin-bottom: 1rem;
}

/* ── GALERÍAS ─────────────────────────────────────────── */
.project-gallery,
.flat-gallery {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem;
}

.project-gallery img,
.flat-gallery img {
  flex: 0 0 200px;
  width: 200px;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  display: block;
  cursor: zoom-in;
  transition: opacity 0.15s;
}

.project-gallery img:hover,
.flat-gallery img:hover { opacity: 0.82; }

/* ── PÁGINA VACÍA ─────────────────────────────────────── */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 7rem 2rem;
  gap: 1.2rem;
}

.empty-state .linea {
  width: 36px;
  height: 1px;
  background: var(--amarillo);
}

.empty-state p {
  font-size: 0.78rem;
  color: var(--gris);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

/* ── LIGHTBOX ─────────────────────────────────────────── */
.lightbox {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(8, 8, 8, 0.94);
  z-index: 999;
  align-items: center;
  justify-content: center;
  cursor: zoom-out;
}

.lightbox.activo { display: flex; }

.lightbox img {
  max-width: 95vw;
  max-height: 95vh;
  object-fit: contain;
  display: block;
  cursor: default;
}

.lb-cerrar {
  position: fixed;
  top: 1rem; right: 1.25rem;
  color: var(--blanco);
  font-size: 1.8rem;
  line-height: 1;
  cursor: pointer;
  background: none;
  border: none;
  opacity: 0.65;
  transition: opacity 0.15s;
  z-index: 1001;
}

.lb-cerrar:hover { opacity: 1; }

.lb-nav {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  color: var(--blanco);
  -webkit-text-stroke: 2px var(--verde);
  font-size: 3.5rem;
  line-height: 1;
  cursor: pointer;
  background: none;
  border: none;
  opacity: 0.8;
  transition: opacity 0.15s;
  padding: 0.5rem 1.2rem;
  z-index: 1001;
  user-select: none;
}

.lb-nav:hover { opacity: 1; }
.lb-prev { left: 0; }
.lb-next { right: 0; }

/* ── PIE ──────────────────────────────────────────────── */
footer {
  border-top: 1px solid var(--borde);
  text-align: center;
  padding: 1.1rem 1rem;
  font-size: 0.7rem;
  color: var(--gris);
  letter-spacing: 0.09em;
}

.footer-link {
  color: var(--gris);
  text-decoration: none;
  letter-spacing: 0.09em;
}

.footer-link:hover {
  color: var(--verde);
}

/* ── CTA ──────────────────────────────────────────────── */
.cta {
  text-align: center;
  padding: 3rem 1rem 2.5rem;
  border-top: 1px solid var(--borde);
  margin-top: 3rem;
}

.cta-frase {
  font-size: 1rem;
  color: var(--gris);
  letter-spacing: 0.04em;
  margin-bottom: 1.2rem;
}

.cta-btn {
  display: inline-block;
  padding: 0.7rem 2.4rem;
  border: 2px solid var(--verde);
  color: var(--verde);
  text-decoration: none;
  font-size: 0.85rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  transition: background 0.2s, color 0.2s;
}

.cta-btn:hover {
  background: var(--verde);
  color: var(--blanco);
}

/* ── AVISO LEGAL ──────────────────────────────────────── */
.legal-body {
  max-width: 760px;
  margin: 2.5rem auto;
  padding: 0 1.2rem;
  line-height: 1.75;
}

.legal-body h1 {
  font-size: 1.5rem;
  font-weight: 400;
  letter-spacing: 0.06em;
  color: var(--verde);
  margin-bottom: 2rem;
  padding-bottom: 0.6rem;
  border-bottom: 1px solid var(--borde);
}

.legal-body h2 {
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--texto);
  margin-top: 2rem;
  margin-bottom: 0.7rem;
}

.legal-body p,
.legal-body ul {
  font-size: 0.9rem;
  color: #444;
  margin-bottom: 0.8rem;
}

.legal-body ul {
  padding-left: 1.4rem;
}

.legal-body a {
  color: var(--verde);
  text-decoration: none;
}

.legal-body a:hover {
  text-decoration: underline;
}

/* ── MODAL CONTACTO ───────────────────────────────────── */
.modal-contacto {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  z-index: 200;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.modal-contacto.activo {
  display: flex;
}

.modal-caja {
  background: var(--blanco);
  border-top: 3px solid var(--verde);
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
  padding: 2rem 1.6rem 2rem;
  position: relative;
}

.modal-cerrar {
  position: absolute;
  top: 0.8rem;
  right: 1rem;
  background: none;
  border: none;
  font-size: 1.6rem;
  line-height: 1;
  color: var(--gris);
  cursor: pointer;
}

.modal-cerrar:hover { color: var(--texto); }

.modal-titulo {
  font-size: 1rem;
  font-weight: 400;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--verde);
  margin-bottom: 1.6rem;
}

.campo {
  display: flex;
  flex-direction: column;
  margin-bottom: 1.1rem;
}

.campo label {
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--gris);
  margin-bottom: 0.35rem;
}

.campo input,
.campo textarea {
  border: 1px solid var(--borde);
  padding: 0.55rem 0.7rem;
  font-size: 0.9rem;
  font-family: inherit;
  color: var(--texto);
  background: var(--fondo);
  outline: none;
  transition: border-color 0.15s;
}

.campo input:focus,
.campo textarea:focus {
  border-color: var(--verde);
}

.campo textarea { resize: vertical; }

.modal-aviso {
  font-size: 0.82rem;
  color: #b94040;
  min-height: 1.2em;
  margin-bottom: 0.8rem;
}

.modal-enviar {
  width: 100%;
  padding: 0.75rem;
  border: 2px solid var(--verde);
  background: none;
  color: var(--verde);
  font-size: 0.82rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}

.modal-enviar:hover:not(:disabled) {
  background: var(--verde);
  color: var(--blanco);
}

.modal-enviar:disabled {
  opacity: 0.5;
  cursor: default;
}

.modal-ok {
  text-align: center;
  padding: 2rem 0 1rem;
  font-size: 0.95rem;
  color: var(--verde);
  line-height: 1.7;
}

/* ── RESPONSIVE ───────────────────────────────────────── */
@media (min-width: 600px) {
  .logo { height: 44px; }
  .project-gallery img, .flat-gallery img { flex-basis: 240px; width: 240px; }
}

@media (min-width: 960px) {
  main { padding: 3rem 2.5rem 4rem; }
  .logo { height: 52px; }
  .project-gallery img, .flat-gallery img { flex-basis: 280px; width: 280px; }
}
