﻿:root {
  --bg: #f4f1eb;
  --paper: #ffffff;
  --text: #171717;
  --muted: #77716a;
  --line: #ded8cf;
  --dark: #111111;
  --max: 1220px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  color: var(--text);
  background: var(--bg);
}
img { display: block; max-width: 100%; }
a { color: inherit; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  min-height: 82px;
  padding: 18px 34px;
  background: rgba(244, 241, 235, 0.94);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(12px);
}

.brand {
  width: 150px;
  display: grid;
  gap: 4px;
  text-decoration: none;
}

.brand img {
  width: 100%;
  height: auto;
}

.brand span {
  display: block;
  width: 100%;
  color: var(--muted);
  font-size: 8.6px;
  line-height: 1.1;
  letter-spacing: .02em;
  white-space: nowrap;
  text-align: center;
  text-transform: uppercase;
}
.main-menu { display: flex; gap: 26px; align-items: center; }
.main-menu a {
  color: var(--muted);
  font-size: 14px;
  letter-spacing: .08em;
  text-decoration: none;
  text-transform: uppercase;
}
.main-menu a:hover { color: var(--text); }
.menu-button {
  display: none;
  width: 44px;
  height: 38px;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 5px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--paper);
  padding: 0;
  cursor: pointer;
}

.menu-button span {
  display: block;
  width: 18px;
  height: 2px;
  background: var(--text);
  border-radius: 999px;
}


.landing {
  position: relative;
  min-height: calc(100vh - 82px);
  display: grid;
  align-items: end;
  overflow: hidden;
  background: #111;
}

.landing-image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: .78;
}

.landing-content {
  position: relative;
  z-index: 1;
  max-width: 900px;
  padding: 80px 34px;
  color: #fff;
}

.landing-content .small-title {
  color: rgba(255,255,255,.78);
}


.about-section {
  max-width: var(--max);
  margin: 0 auto;
  padding: 74px 34px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  border-top: 1px solid var(--line);
}

.about-text p {
  margin-top: 0;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.7;
}
.home-hero {
  max-width: var(--max);
  margin: 0 auto;
  padding: 86px 34px 46px;
}
.home-copy { max-width: 760px; }
.small-title {
  margin: 0 0 14px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .16em;
  text-transform: uppercase;
}
h1 {
  margin: 0;
  font-size: clamp(54px, 10vw, 132px);
  line-height: .88;
  letter-spacing: -.08em;
}
h2 {
  margin: 0 0 16px;
  font-size: clamp(32px, 5vw, 64px);
  letter-spacing: -.05em;
}
.home-copy p:not(.small-title), .project-intro p:not(.small-title), .contact p {
  max-width: 620px;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.65;
}

.portfolio-list {
  max-width: var(--max);
  margin: 0 auto;
  padding: 20px 34px 92px;
  display: grid;
  gap: 24px;
}
.project-card {
  margin: 0;
  background: var(--dark);
  overflow: hidden;
}
.project-card a {
  position: relative;
  display: grid;
  min-height: 68vh;
  text-decoration: none;
  color: #fff;
}
.project-card img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: .84;
  transition: transform .5s ease, opacity .5s ease;
}
.project-card a:hover img { transform: scale(1.035); opacity: .66; }
.project-info {
  position: relative;
  z-index: 1;
  align-self: end;
  display: grid;
  gap: 8px;
  padding: 32px;
  background: linear-gradient(transparent, rgba(0,0,0,.72));
}
.project-number { font-size: 13px; letter-spacing: .18em; text-transform: uppercase; opacity: .75; }
.project-title { font-size: clamp(34px, 6vw, 72px); line-height: .95; letter-spacing: -.06em; }
.project-link { font-size: 14px; letter-spacing: .12em; text-transform: uppercase; }

.contact {
  max-width: var(--max);
  margin: 0 auto 70px;
  padding: 60px 34px;
  border-top: 1px solid var(--line);
}
.contact a { font-weight: 700; text-decoration-thickness: 1px; text-underline-offset: 5px; }
.site-footer {
  padding: 28px 34px;
  color: var(--muted);
  border-top: 1px solid var(--line);
}

.project-intro {
  max-width: var(--max);
  margin: 0 auto;
  padding: 48px 34px 28px;
}
.back-link {
  display: inline-block;
  margin-bottom: 28px;
  color: var(--muted);
  text-decoration: none;
}
.back-link:hover { color: var(--text); }
.project-intro h1 { font-size: clamp(48px, 8vw, 104px); }

.horizontal-gallery {
  display: flex;
  gap: 18px;
  overflow-x: auto;
  padding: 22px 34px 54px;
  scroll-snap-type: x proximity;
}
.shot {
  flex: 0 0 auto;
  width: auto;
  max-width: 88vw;
  height: 68vh;
  min-height: 440px;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: zoom-in;
  scroll-snap-align: center;
}
.shot img {
  width: auto;
  max-width: 88vw;
  height: 100%;
  object-fit: contain;
}

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 28px;
  background: rgba(0,0,0,.92);
}
.lightbox.is-open { display: flex; }
.lightbox img { max-width: 96vw; max-height: 90vh; object-fit: contain; }
.lightbox-close {
  position: absolute;
  top: 18px;
  right: 18px;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 50%;
  background: #fff;
  font-size: 28px;
  cursor: pointer;
}

@media (max-width: 760px) {
  .site-header { padding: 16px 20px; min-height: 74px; }
  .brand { width: 128px; }
  .menu-button { display: inline-flex; }
  .main-menu:not(.is-desktop) {
    position: absolute;
    left: 20px;
    right: 20px;
    top: 72px;
    display: none;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 10px;
    background: var(--paper);
    border: 1px solid var(--line);
  }
  .main-menu.is-open { display: flex !important; }
  .main-menu a { padding: 13px; }
  .is-desktop { display: flex; gap: 14px; }
  .is-desktop a { font-size: 12px; }
  .home-hero, .portfolio-list, .project-intro, .contact, .about-section, .landing-content { padding-left: 20px; padding-right: 20px; }
  .home-hero { padding-top: 58px; }
  .landing { min-height: calc(100vh - 74px); }
  .landing-content { padding-top: 70px; padding-bottom: 70px; }
  .about-section { grid-template-columns: 1fr; gap: 24px; }
  .project-card a { min-height: 58vh; }
  .project-info { padding: 22px; }
  .horizontal-gallery {
    display: grid;
    overflow: visible;
    padding: 16px 20px 42px;
  }
  .shot {
    width: 100%;
    height: auto;
    min-height: 0;
  }
  .shot img { width: 100%; height: auto; max-width: 100%; object-fit: contain; }
}

/* Galerías cuadradas: usado en el portfolio "Entre nubes". */
.square-gallery .shot {
  width: min(78vh, 78vw, 760px);
  height: min(78vh, 78vw, 760px);
  min-height: 0;
  aspect-ratio: 1 / 1;
}

.square-gallery .shot img {
  width: 100%;
  height: 100%;
  max-width: none;
  aspect-ratio: 1 / 1;
  object-fit: cover;
}

@media (max-width: 760px) {
  .square-gallery .shot {
    width: 100%;
    height: auto;
    aspect-ratio: 1 / 1;
  }

  .square-gallery .shot img {
    width: 100%;
    height: 100%;
    max-width: none;
    aspect-ratio: 1 / 1;
    object-fit: cover;
  }
}

.shot:focus {
  outline: none;
}

.project-link {
  margin-left: 18px;
}

.contact-line {
  display: flex;
  align-items: center;
  gap: 10px;
}

.contact-icon {
  width: 22px;
  display: inline-flex;
  justify-content: center;
  color: var(--muted);
}

/* Evita que la cabecera tape las secciones al usar enlaces del menú. */
#portfolio,
#portfolio-intro,
#sobre-mi,
#contacto {
  scroll-margin-top: 140px;
}

@media (max-width: 760px) {
  #portfolio,
  #portfolio-intro,
  #sobre-mi,
  #contacto {
    scroll-margin-top: 124px;
  }
}

