/* ============================================
   ESTUDIO — Portfolio de interiorismo
   ============================================ */

:root {
  --bg: #faf8f5;
  --ink: #1c1a17;
  --ink-soft: #57524b;
  --line: #e3ded6;
  --accent: #8a7d6a;
  --serif: "Cormorant Garamond", "Times New Roman", serif;
  --sans: "Jost", "Helvetica Neue", Arial, sans-serif;
}

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

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-weight: 300;
  font-size: 16px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

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

/* Las imágenes optimizadas llegan envueltas en <picture> */
picture { display: contents; }

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

.wrap {
  width: min(1280px, 92vw);
  margin: 0 auto;
}

/* ---------- Header ---------- */

.site-header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 50;
  padding: 28px 4vw;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: background .4s ease, padding .4s ease, box-shadow .4s ease;
}

.site-header.scrolled {
  background: rgba(250, 248, 245, .92);
  backdrop-filter: blur(12px);
  padding: 16px 4vw;
  box-shadow: 0 1px 0 var(--line);
}

.brand {
  font-family: var(--sans);
  font-size: 15px;
  font-weight: 400;
  letter-spacing: .18em;
  text-transform: lowercase;
}

.site-header.on-hero:not(.scrolled) { color: #f5f2ec; }

.main-nav {
  display: flex;
  gap: 36px;
  font-size: 12px;
  letter-spacing: .24em;
  text-transform: uppercase;
}

.main-nav a {
  position: relative;
  padding-bottom: 4px;
}

.main-nav a::after {
  content: "";
  position: absolute;
  left: 0; bottom: 0;
  width: 0; height: 1px;
  background: currentColor;
  transition: width .35s ease;
}

.main-nav a:hover::after,
.main-nav a.active::after { width: 100%; }

.lang-switch {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-left: 14px;
  padding-left: 24px;
  border-left: 1px solid currentColor;
}

.lang-switch a {
  letter-spacing: .2em;
  padding: 0 0 4px;
  opacity: .5;
  border-bottom: 1px solid transparent;
  transition: opacity .3s ease, border-color .3s ease;
}

.lang-switch a::after { display: none; }

.lang-switch a:hover { opacity: 1; }

.lang-switch a.active {
  opacity: 1;
  border-bottom-color: currentColor;
}

.kicker--flush { margin: 0; }

/* ---------- Hero ---------- */

.hero {
  position: relative;
  height: 100vh;
  min-height: 560px;
  overflow: hidden;
}

.hero img {
  width: 100%; height: 100%;
  object-fit: cover;
  animation: heroZoom 14s ease-out both;
}

@keyframes heroZoom {
  from { transform: scale(1.08); }
  to   { transform: scale(1); }
}

.hero::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(to bottom, rgba(15,13,11,.35), rgba(15,13,11,.15) 45%, rgba(15,13,11,.45));
}

.hero-text {
  position: absolute;
  inset: auto 0 12vh 0;
  z-index: 2;
  text-align: center;
  color: #f5f2ec;
  padding: 0 6vw;
}

.hero-text .kicker { color: rgba(245,242,236,.85); }

.hero-text h1 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(34px, 5.4vw, 78px);
  line-height: 1.14;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.project-hero .hero-text h1 { text-transform: none; letter-spacing: .02em; }

.hero-scroll {
  position: absolute;
  bottom: 32px; left: 50%;
  transform: translateX(-50%);
  z-index: 2;
  color: rgba(245,242,236,.8);
  font-size: 10px;
  letter-spacing: .3em;
  text-transform: uppercase;
}

.hero-scroll::after {
  content: "";
  display: block;
  width: 1px; height: 42px;
  margin: 10px auto 0;
  background: rgba(245,242,236,.6);
  animation: drop 2.2s ease-in-out infinite;
}

@keyframes drop {
  0%   { transform: scaleY(0); transform-origin: top; }
  50%  { transform: scaleY(1); transform-origin: top; }
  51%  { transform-origin: bottom; }
  100% { transform: scaleY(0); transform-origin: bottom; }
}

/* ---------- Typographic bits ---------- */

.kicker {
  font-size: 11px;
  letter-spacing: .34em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 22px;
}

.section-title {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(30px, 3.6vw, 52px);
  line-height: 1.15;
}

/* ---------- Intro ---------- */

.intro {
  padding: 140px 0 120px;
  text-align: center;
}

.intro p.lead {
  font-family: var(--serif);
  font-size: clamp(24px, 2.6vw, 38px);
  line-height: 1.45;
  font-weight: 400;
  max-width: 21em;
  margin: 0 auto;
}

.intro .sub {
  max-width: 40em;
  margin: 28px auto 0;
  color: var(--ink-soft);
  font-size: 15px;
}

/* ---------- Projects grid ---------- */

.projects {
  padding: 40px 0 140px;
}

.projects-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 56px;
}

.projects-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 60px 44px;
}

.project-card { display: block; }

.project-card .frame {
  overflow: hidden;
  aspect-ratio: 4 / 3;
  background: var(--line);
}

.project-card img {
  width: 100%; height: 100%;
  object-fit: cover;
  transform: scale(1.01);
  transition: transform 1.1s cubic-bezier(.2,.6,.2,1), filter .6s ease;
}

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

.project-card .meta {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-top: 20px;
}

.project-card h3 {
  font-family: var(--serif);
  font-size: 27px;
  font-weight: 500;
  letter-spacing: .02em;
}

.project-card .tag {
  font-size: 11px;
  letter-spacing: .26em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.project-card .count {
  font-size: 12px;
  letter-spacing: .2em;
  color: var(--accent);
}

/* ---------- Editorial banner ---------- */

.banner {
  position: relative;
  height: 78vh;
  min-height: 460px;
  overflow: hidden;
}

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

.banner::after {
  content: "";
  position: absolute; inset: 0;
  background: rgba(15,13,11,.38);
}

.banner .banner-text {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: #f5f2ec;
  padding: 0 8vw;
}

.banner blockquote {
  font-family: var(--serif);
  font-size: clamp(26px, 3.4vw, 46px);
  font-weight: 400;
  font-style: italic;
  line-height: 1.35;
  max-width: 22em;
}

.banner cite {
  display: block;
  margin-top: 26px;
  font-family: var(--sans);
  font-style: normal;
  font-size: 11px;
  letter-spacing: .3em;
  text-transform: uppercase;
  color: rgba(245,242,236,.75);
}

/* ---------- Mosaic (fotos sueltas) ---------- */

.mosaic {
  padding: 140px 0;
}

.mosaic-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 44px;
  margin-top: 64px;
}

.mosaic-grid .m-item { overflow: hidden; }

.mosaic-grid img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform 1.1s cubic-bezier(.2,.6,.2,1);
}

.mosaic-grid .m-item:hover img { transform: scale(1.05); }

.m-a { grid-column: 1 / 8;  aspect-ratio: 16/10; }
.m-b { grid-column: 8 / 13; aspect-ratio: 4/5; margin-top: 90px; }
.m-c { grid-column: 1 / 6;  aspect-ratio: 4/5; margin-top: -50px; }
.m-d { grid-column: 6 / 13; aspect-ratio: 16/10; margin-top: 60px; }

/* ---------- Contact / footer ---------- */

.contact {
  border-top: 1px solid var(--line);
  padding: 130px 0 110px;
  text-align: center;
}

.contact .section-title { max-width: 16em; margin: 0 auto; }

.contact .mail {
  display: inline-block;
  margin-top: 36px;
  font-size: 13px;
  letter-spacing: .28em;
  text-transform: uppercase;
  border-bottom: 1px solid var(--ink);
  padding-bottom: 6px;
  transition: color .3s ease, border-color .3s ease;
}

.contact .mail:hover { color: var(--accent); border-color: var(--accent); }

.contact div + div .mail { margin-top: 14px; }

.site-footer {
  border-top: 1px solid var(--line);
  padding: 34px 4vw;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11px;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.site-footer .footer-right {
  display: flex;
  align-items: center;
  gap: 18px;
}

.site-footer .footer-link {
  border-bottom: 1px solid var(--line);
  padding-bottom: 3px;
  transition: color .3s ease, border-color .3s ease;
}

.site-footer .footer-link:hover {
  color: var(--ink);
  border-color: var(--ink);
}

/* ---------- Project page ---------- */

.project-hero {
  position: relative;
  height: 82vh;
  min-height: 480px;
  overflow: hidden;
}

.project-hero img {
  width: 100%; height: 100%;
  object-fit: cover;
  animation: heroZoom 12s ease-out both;
}

.project-hero::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(to bottom, rgba(15,13,11,.4), rgba(15,13,11,.1) 50%, rgba(15,13,11,.35));
}

.project-hero .hero-text { inset: auto 0 10vh 0; }

.project-intro {
  padding: 110px 0 90px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
  align-items: start;
}

.project-intro .lead {
  font-family: var(--serif);
  font-size: clamp(22px, 2.2vw, 32px);
  line-height: 1.45;
  font-weight: 400;
}

.project-intro .facts {
  font-size: 13px;
  color: var(--ink-soft);
  align-self: end;
}

.project-intro .facts div {
  display: flex;
  justify-content: space-between;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}

.project-intro .facts span:first-child {
  letter-spacing: .24em;
  text-transform: uppercase;
  font-size: 10px;
  color: var(--accent);
}

/* Texto ampliado opcional del proyecto */

.project-about {
  max-width: 42em;
  padding-bottom: 70px;
  color: var(--ink-soft);
  font-size: 16.5px;
}

.project-about p + p { margin-top: 1.2em; }

/* Gallery — editorial rhythm */

.gallery {
  padding-bottom: 60px;
}

.g-row {
  display: grid;
  gap: 44px;
  margin-bottom: 44px;
}

.g-full { grid-template-columns: 1fr; }
.g-half { grid-template-columns: 1fr 1fr; }
.g-asym { grid-template-columns: 3fr 2fr; }

.g-item {
  overflow: hidden;
  cursor: zoom-in;
  background: var(--line);
}

.g-item img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform 1.1s cubic-bezier(.2,.6,.2,1);
}

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

.g-full .g-item { aspect-ratio: 16/9; }
.g-half .g-item { aspect-ratio: 4/3; }
.g-asym .g-item { aspect-ratio: 4/3; }

/* Prev / next project */

.project-nav {
  border-top: 1px solid var(--line);
  display: grid;
  grid-template-columns: 1fr 1fr;
}

.project-nav a {
  padding: 70px 6vw;
  transition: background .4s ease;
}

.project-nav a:hover { background: #f1ede6; }

.project-nav a + a {
  border-left: 1px solid var(--line);
  text-align: right;
}

.project-nav .label {
  font-size: 10px;
  letter-spacing: .3em;
  text-transform: uppercase;
  color: var(--accent);
}

.project-nav .name {
  font-family: var(--serif);
  font-size: 30px;
  margin-top: 10px;
}

/* ---------- Lightbox ---------- */

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(14,12,10,.96);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity .35s ease;
}

.lightbox.open { opacity: 1; pointer-events: auto; }

.lightbox img {
  max-width: 90vw;
  max-height: 86vh;
  object-fit: contain;
}

.lightbox button {
  position: absolute;
  background: none;
  border: none;
  color: #f5f2ec;
  font-family: var(--sans);
  font-size: 12px;
  letter-spacing: .28em;
  text-transform: uppercase;
  cursor: pointer;
  padding: 18px;
  opacity: .75;
  transition: opacity .3s ease;
}

.lightbox button:hover { opacity: 1; }

.lb-close { top: 20px; right: 24px; }
.lb-prev  { left: 16px; top: 50%; transform: translateY(-50%); }
.lb-next  { right: 16px; top: 50%; transform: translateY(-50%); }

.lb-counter {
  position: absolute;
  bottom: 26px; left: 50%;
  transform: translateX(-50%);
  color: rgba(245,242,236,.7);
  font-size: 11px;
  letter-spacing: .3em;
}

/* ---------- Reveal on scroll ---------- */

.reveal {
  opacity: 0;
  transform: translateY(34px);
  transition: opacity 1s ease, transform 1s cubic-bezier(.2,.6,.2,1);
}

.reveal.visible {
  opacity: 1;
  transform: none;
}

/* ---------- Responsive ---------- */

@media (max-width: 860px) {
  .site-header {
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 18px 4vw;
    text-align: center;
  }
  .site-header.scrolled { padding: 12px 4vw; }
  .brand { font-size: 13px; letter-spacing: .16em; }
  .main-nav {
    gap: 18px;
    font-size: 10px;
    justify-content: center;
    flex-wrap: wrap;
  }
  .lang-switch { margin-left: 4px; padding-left: 14px; gap: 10px; }

  .projects-grid { grid-template-columns: 1fr; gap: 56px; }
  .projects-head { flex-direction: column; gap: 12px; }

  .mosaic-grid { gap: 24px; }
  .m-a, .m-b, .m-c, .m-d {
    grid-column: 1 / 13;
    margin-top: 0;
    aspect-ratio: 16/10;
  }

  .project-intro { grid-template-columns: 1fr; padding: 80px 0 60px; }

  .g-row { gap: 24px; margin-bottom: 24px; }
  .g-half, .g-asym { grid-template-columns: 1fr; }

  .project-nav { grid-template-columns: 1fr; }
  .project-nav a + a { border-left: none; border-top: 1px solid var(--line); }

  .intro { padding: 100px 0 80px; }
  .mosaic { padding: 100px 0; }
  .contact { padding: 90px 0 80px; }

  .site-footer { flex-direction: column; gap: 10px; }
}
