/* ============================================================
   estudio29 — hoja de estilos
   Temable (oscuro / claro) mediante variables CSS.
   3 diseños: computadora (>1024px), tablet (640–1024px), celular (<640px)
   ============================================================ */

/* ---- Tema oscuro (por defecto) ---- */
:root,
[data-theme="dark"] {
  --bg: #0d0d0f;
  --bg-soft: #17171b;
  --fg: #f4f4f2;
  --muted: #8f8f96;
  --line: #2a2a30;
  --accent: #f4f4f2;
  --shadow: rgba(0,0,0,0.5);
}

/* ---- Tema claro ---- */
[data-theme="light"] {
  --bg: #ffffff;
  --bg-soft: #f5f5f3;
  --fg: #111111;
  --muted: #8a8a8a;
  --line: #e6e6e6;
  --accent: #111111;
  --shadow: rgba(0,0,0,0.12);
}

:root {
  --maxw: 1760px;                     /* más ancho = imágenes más grandes */
  --gap: clamp(16px, 2.4vw, 34px);    /* margen lateral pequeño */
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  font-family: "Helvetica Neue", "Inter", Helvetica, Arial, sans-serif;
  color: var(--fg);
  background: var(--bg);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  transition: background 0.4s var(--ease), color 0.4s var(--ease);
}

img { display: block; width: 100%; height: auto; }
a { color: inherit; text-decoration: none; transition: opacity 0.2s ease; }
a:hover { opacity: 0.62; }

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

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 60;
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px var(--gap);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.site-header .logo { font-weight: 600; letter-spacing: 0.01em; font-size: 18px; white-space: nowrap; }
.site-header .header-right { display: flex; align-items: center; gap: 20px; }
.site-header .descriptor {
  font-size: 11px; text-transform: uppercase; letter-spacing: 0.09em;
  color: var(--muted); line-height: 1.35; max-width: 340px; text-align: right;
}
.site-header .header-email { font-size: 12px; letter-spacing: 0.02em; white-space: nowrap; }

/* Botones de tema / idioma */
.pill-btn {
  font: inherit; cursor: pointer;
  font-size: 12px; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--fg); background: transparent;
  border: 1px solid var(--line); border-radius: 100px;
  padding: 7px 13px; line-height: 1;
  display: inline-flex; align-items: center; gap: 6px;
  transition: border-color 0.2s ease, background 0.2s ease, color 0.2s ease;
}
.pill-btn:hover { border-color: var(--fg); }
.pill-btn .ico { width: 15px; height: 15px; display: inline-block; }

/* ---------- Hero ---------- */
/* Solo padding vertical: el horizontal lo pone .container para que todo quede al mismo ancho */
.hero { padding-top: clamp(56px, 11vh, 130px); padding-bottom: 40px; }
.hero h1 {
  font-size: clamp(52px, 13vw, 180px);
  font-weight: 600; letter-spacing: -0.035em; line-height: 0.92;
}
.hero .lede {
  margin-top: 34px; max-width: 780px;
  font-size: clamp(20px, 2.7vw, 32px); font-weight: 400; letter-spacing: -0.01em;
}
.hero .sub { margin-top: 16px; max-width: 640px; color: var(--muted); font-size: clamp(15px, 1.8vw, 18px); }
.hero-media { margin-top: clamp(32px, 6vw, 68px); overflow: hidden; aspect-ratio: 16 / 9; }
.hero-media img { width: 100%; height: 120%; object-fit: cover; will-change: transform; }

/* ---------- Secciones ---------- */
/* Solo padding vertical: el horizontal lo hereda de .container para alinear con la imagen */
.section { padding-top: clamp(52px, 8vw, 104px); padding-bottom: clamp(52px, 8vw, 104px); }
.section-head {
  display: flex; align-items: baseline; justify-content: space-between; gap: 16px;
  border-top: 1px solid var(--fg); padding-top: 16px; margin-bottom: 44px;
}
.section-head h2 { font-size: clamp(22px, 3vw, 36px); font-weight: 600; letter-spacing: -0.01em; }
.section-head .years { color: var(--muted); font-size: 14px; letter-spacing: 0.05em; white-space: nowrap; }

/* ---------- Grilla de trabajos ---------- */
.works { display: grid; grid-template-columns: repeat(2, 1fr); gap: calc(var(--gap) * 1.2) var(--gap); }
.work .thumb { overflow: hidden; background: var(--bg-soft); border-radius: 2px; }
.work .thumb img { aspect-ratio: 4 / 3; object-fit: cover; transition: transform 0.6s var(--ease); }
.work:hover { opacity: 1; }
.work:hover .thumb img { transform: scale(1.04); }
.work .meta { display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; margin-top: 15px; align-items: baseline; }
.work .meta .name { font-size: clamp(18px, 2.2vw, 25px); font-weight: 500; grid-row: 1; }
.work .meta .year { color: var(--muted); font-size: 13px; grid-row: 1; text-align: right; }
.work .meta .cat { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: 0.07em; grid-row: 2; }

/* ---------- CTA / Playground ---------- */
.cta { border-top: 1px solid var(--fg); padding-top: 44px; }
.cta h2 { font-size: clamp(30px, 5vw, 60px); font-weight: 600; letter-spacing: -0.02em; }
.cta p { max-width: 580px; margin-top: 20px; color: var(--muted); font-size: 17px; }
.btn {
  display: inline-block; margin-top: 30px; font-size: 14px; text-transform: uppercase; letter-spacing: 0.08em;
  border: 1px solid var(--fg); padding: 15px 30px; border-radius: 100px;
  transition: background 0.25s var(--ease), color 0.25s var(--ease);
}
.btn:hover { background: var(--fg); color: var(--bg); opacity: 1; }

/* Casas a la venta: miniaturas circulares (se agregan más al lado) */
.sale-circles { display: flex; flex-wrap: wrap; gap: 26px; margin-top: 34px; }
.sale-circle-item { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.sale-circle { display: block; width: clamp(105px, 10vw, 145px); aspect-ratio: 1 / 1; border-radius: 50%; overflow: hidden; border: 1px solid var(--line); }
.sale-circle img { width: 100%; height: 100%; object-fit: cover; }
.sale-name { font-size: 14px; letter-spacing: 0.02em; color: var(--fg); }
.sale-circle-item:hover { opacity: 1; }
.sale-circle-item:hover .sale-circle { transform: scale(1.05); transition: transform 0.25s var(--ease); }

/* ---------- Página de proyecto ---------- */
.breadcrumb { display: flex; gap: 10px; font-size: 12px; text-transform: uppercase; letter-spacing: 0.07em; color: var(--muted); padding-top: 34px; }
.project-title { font-size: clamp(42px, 8vw, 104px); font-weight: 600; letter-spacing: -0.035em; line-height: 1; margin: 22px 0 40px; }
.overview { max-width: 780px; font-size: clamp(17px, 2vw, 22px); margin-bottom: 50px; }
.overview .label, .about h3, .facts .label, .site-footer .label {
  font-size: 12px; text-transform: uppercase; letter-spacing: 0.1em; color: var(--muted);
}
.overview .label { display: block; margin-bottom: 16px; }
.feature-img { overflow: hidden; }
.feature-img img { aspect-ratio: 3 / 2; object-fit: cover; }

.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: var(--gap); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 30px 0; margin: 50px 0; }
.facts .label { margin-bottom: 8px; }
.facts .value { font-size: clamp(18px, 2.4vw, 25px); font-weight: 500; }

/* Imágenes que deben verse completas (afiches / láminas): sin recorte */
.feature-img.fit-contain { text-align: center; }
.feature-img.fit-contain img { width: auto; max-width: 100%; height: auto; max-height: 90vh; margin: 0 auto; aspect-ratio: auto; object-fit: contain; }

.about { max-width: 780px; margin-bottom: 58px; }
.about h3 { margin-bottom: 20px; }
.about p { font-size: clamp(16px, 1.8vw, 18px); }

/* Entradas adicionales dentro de una misma página (ej. 2º concurso) */
.entry { margin-top: clamp(48px, 7vw, 88px); }
.entry-title { font-size: clamp(24px, 3vw, 34px); font-weight: 600; letter-spacing: -0.01em; margin-bottom: 24px; }
.gallery.fit-contain figure { text-align: center; }
.gallery.fit-contain img { width: auto; max-width: 100%; height: auto; max-height: 90vh; margin: 0 auto; aspect-ratio: auto; object-fit: contain; }

.gallery { display: grid; grid-template-columns: 1fr; gap: var(--gap); }
.gallery.two { grid-template-columns: repeat(2, 1fr); }
.gallery + .gallery { margin-top: var(--gap); }
/* Bloque 2x2 con fotos cuadradas */
.gallery.grid-2x2.sq figure { aspect-ratio: 1 / 1; overflow: hidden; margin: 0; }
.gallery.grid-2x2.sq img { width: 100%; height: 100%; object-fit: cover; }
.gallery figure { overflow: hidden; margin: 0; }

/* ---------- Casas en venta: foto izquierda + texto, y carrusel ---------- */
.pg-top { display: grid; grid-template-columns: 0.7fr 1.3fr; gap: var(--gap); align-items: end; margin-top: 8px; margin-bottom: clamp(8px, 2vw, 20px); }
.pg-photo img { width: 100%; height: auto; }
.pg-text { max-width: 46ch; margin-left: auto; }   /* bloque angosto, pegado al sangrado derecho */
.pg-text p { font-size: clamp(15px, 1.6vw, 18px); }
.pg-text p + p { margin-top: 0.9em; }

/* Fotos 2..5 en fila uniforme a todo el ancho */
.pg-grid4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--gap); margin-top: clamp(24px, 4vw, 44px); }
.pg-grid4 figure { margin: 0; }
.pg-grid4 img { width: 100%; height: auto; }
@media (max-width: 900px) { .pg-grid4 { grid-template-columns: repeat(2, 1fr); } }

/* Carrusel: ancho completo, alineado a la izquierda, imágenes grandes */
.carousel { position: relative; margin-top: clamp(28px, 4vw, 48px); }
.car-track {
  display: flex; gap: 18px; overflow-x: auto; scroll-snap-type: x mandatory;
  scroll-behavior: smooth; padding-bottom: 14px; scrollbar-width: thin;
}
.car-track figure { flex: 0 0 auto; margin: 0; scroll-snap-align: start; border-radius: 6px; overflow: hidden; background: var(--bg-soft); }
/* misma altura, ancho natural = sin recorte (fotos verticales y plantas horizontales conviven) */
.car-track img { width: auto; height: clamp(320px, 44vw, 560px); object-fit: contain; }
.car-btn {
  position: absolute; top: 50%; transform: translateY(-50%); z-index: 5;
  width: 48px; height: 48px; border-radius: 50%; cursor: pointer;
  border: 1px solid var(--line); color: var(--fg); font-size: 22px; line-height: 1;
  background: var(--bg); box-shadow: 0 6px 22px var(--shadow);
  display: flex; align-items: center; justify-content: center;
  transition: border-color 0.2s ease, transform 0.15s ease;
}
.car-btn:hover { border-color: var(--fg); }
.car-btn:active { transform: translateY(-50%) scale(0.92); }
.car-btn.prev { left: 10px; }
.car-btn.next { right: 10px; }

/* Carrusel de plantas: una lámina por vista; imagen centrada y 30% más pequeña */
.plan-track figure { flex: 0 0 100%; background: transparent; }
.plan-track img { width: 70%; height: auto; margin: 0 auto; }

@media (max-width: 720px) {
  .pg-top { grid-template-columns: 1fr; }
  .car-btn { width: 38px; height: 38px; font-size: 19px; }
}

.project-nav { display: flex; justify-content: space-between; border-top: 1px solid var(--fg); margin-top: 76px; padding-top: 24px; }
.project-nav a { font-size: 13px; text-transform: uppercase; letter-spacing: 0.06em; font-weight: 500; }

/* Menos espacio entre los círculos de "Casas a la venta" y el contacto */
.section-cta { padding-bottom: clamp(20px, 3vw, 36px); }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--line); margin-top: clamp(40px, 6vw, 64px); padding: 56px 0 72px; }
.site-footer .label { margin-bottom: 24px; }
.site-footer .contacts { display: flex; flex-wrap: wrap; gap: 12px 40px; font-size: clamp(18px, 2.4vw, 27px); font-weight: 500; }

/* ---------- Animaciones al hacer scroll ---------- */
.reveal { opacity: 0; transform: translateY(26px); transition: opacity 0.8s var(--ease), transform 0.8s var(--ease); }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  html { scroll-behavior: auto; }
}

/* ============================================================
   DISEÑO RESPONSIVE
   ============================================================ */

/* ---- Descriptor del header: se oculta cuando no cabe ---- */
@media (max-width: 900px) {
  .site-header .descriptor { display: none; }
}

/* ---- Tablet / iPad (640px – 1024px) ---- */
@media (max-width: 1024px) {
  .hero h1 { font-size: clamp(48px, 14vw, 120px); }
  .works { gap: var(--gap); }
}

/* ---- Celular (< 640px) ---- */
@media (max-width: 640px) {
  .works, .gallery.two, .facts { grid-template-columns: 1fr; }
  .site-header { padding: 14px var(--gap); }
  .site-header .header-email { display: none; }   /* en móvil el mail queda en el pie */
  .site-header .header-right { gap: 8px; }
  .pill-btn { padding: 8px 11px; }
  .hero { padding-top: 44px; }
  .project-nav { flex-direction: row; gap: 16px; font-size: 12px; }
  .site-footer .contacts { flex-direction: column; gap: 10px; }
}
