:root {
  --color-bg: #f2f0ec;
  --color-bg-alt: #ffffff;
  --color-text: #2f2b25;
  --color-text-muted: #8a8377;
  --color-line: #d8d4cb;
  --font-serif-display: "Cormorant Garamond", "Playfair Display", Georgia, serif;
  --font-serif-body: "PT Serif", Georgia, "Times New Roman", serif;
  --container-width: 1440px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-serif-body);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

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

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

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

/* Header */
.site-header {
  background: var(--color-bg);
  padding: 28px 0;
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 20px;
}

.site-logo {
  font-family: var(--font-serif-display);
  font-size: 30px;
  letter-spacing: 0.06em;
  color: var(--color-text);
  font-weight: 500;
}

.site-nav {
  display: flex;
  gap: 40px;
  font-family: var(--font-serif-body);
  font-size: 19px;
}

.site-nav a {
  color: var(--color-text-muted);
  text-decoration: underline;
  text-underline-offset: 6px;
  text-decoration-thickness: 1px;
  transition: color 0.2s ease;
}

.site-nav a:hover,
.site-nav a.is-active {
  color: var(--color-text);
}

/* Hero */
.hero {
  width: 100%;
  overflow: hidden;
}

.hero img {
  width: 100%;
  height: auto;
  object-fit: cover;
  max-height: 82vh;
}

/* Sections */
.section {
  padding: 90px 0;
}

.section--tight {
  padding: 60px 0;
}

.eyebrow {
  font-size: 18px;
  color: var(--color-text-muted);
  margin-bottom: 12px;
  font-style: italic;
}

.headline {
  font-family: var(--font-serif-display);
  font-size: clamp(34px, 5vw, 54px);
  letter-spacing: 0.02em;
  text-transform: uppercase;
  margin: 0 0 40px;
  font-weight: 500;
}

.section-title {
  font-family: var(--font-serif-body);
  font-size: 24px;
  color: var(--color-text-muted);
  margin: 0 0 36px;
  font-weight: 400;
}

/* Project grids */
.project-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
}

.project-grid--six {
  grid-template-columns: repeat(3, 1fr);
  row-gap: 60px;
}

.project-card {
  display: block;
  position: relative;
  overflow: hidden;
}

.project-card__image-wrap {
  overflow: hidden;
  aspect-ratio: 4 / 3;
}

.project-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

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

.project-card__meta {
  margin-top: 14px;
}

.project-card__title {
  font-family: var(--font-serif-display);
  font-size: 22px;
}

.project-card__category {
  font-size: 15px;
  color: var(--color-text-muted);
  font-style: italic;
}

/* CTA row */
.cta-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: flex-end;
  gap: 24px;
  margin-top: 70px;
  font-size: 22px;
}

.cta-row__label {
  text-decoration: underline;
  text-underline-offset: 6px;
}

.cta-row__arrow {
  font-size: 22px;
}

.cta-row__text {
  text-decoration: underline;
  text-underline-offset: 6px;
  max-width: 420px;
  text-align: left;
}

/* Footer */
.site-footer {
  padding: 60px 0 70px;
  border-top: 1px solid var(--color-line);
}

.site-footer__inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 40px;
}

.site-footer nav {
  display: flex;
  flex-direction: column;
  gap: 10px;
  font-size: 19px;
}

.site-footer nav a {
  text-decoration: underline;
  text-underline-offset: 6px;
  color: var(--color-text);
}

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

.site-footer__contact a {
  text-decoration: underline;
  text-underline-offset: 6px;
}

.site-footer__contact span {
  color: var(--color-text-muted);
}

.site-footer__legal {
  margin-top: 40px;
  padding-top: 24px;
  border-top: 1px solid var(--color-line);
}

.site-footer__legal-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  font-size: 14px;
}

.site-footer__legal-nav a {
  color: var(--color-text-muted);
  text-decoration: underline;
  text-underline-offset: 4px;
}

.site-footer__legal-nav a:hover {
  color: var(--color-text);
}

/* Legal pages (Aviso legal, Privacidad, Cookies) */
.legal-page {
  max-width: 820px;
}

.legal-page__content {
  font-size: 17px;
  line-height: 1.75;
}

.legal-page__content p {
  margin: 0 0 20px;
}

.legal-page__content ul {
  margin: 0 0 20px;
  padding-left: 24px;
}

.legal-page__content li {
  margin-bottom: 10px;
}

.legal-page__content strong {
  color: var(--color-text);
}

.legal-page__content em {
  color: var(--color-text-muted);
}

.legal-page__content a {
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* Servicios */
.service-block {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
  align-items: center;
  margin-bottom: 90px;
}

.service-block:nth-child(even) .service-block__text {
  order: 2;
}

.service-block__title {
  font-family: var(--font-serif-body);
  font-size: 26px;
  text-decoration: underline;
  text-underline-offset: 8px;
  margin: 0 0 22px;
}

.service-block__text p {
  margin: 0;
  text-align: justify;
}

.service-block__image img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

/* Conóceme / about */
.about-block {
  max-width: 760px;
}

.about-name {
  font-size: 22px;
  margin-bottom: 34px;
}

.about-subtitle {
  text-decoration: underline;
  text-underline-offset: 6px;
  font-size: 21px;
  margin: 0 0 18px;
}

.about-education {
  text-decoration: underline;
  text-underline-offset: 6px;
  margin: 0 0 34px;
  display: block;
  font-size: 19px;
}

.about-bio {
  text-align: justify;
  font-size: 19px;
}

/* Project detail */
.project-hero {
  margin-bottom: 40px;
}

.project-detail__header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 20px;
  margin-bottom: 50px;
}

.project-detail__title {
  font-family: var(--font-serif-display);
  font-size: clamp(32px, 5vw, 48px);
  margin: 0;
}

.project-detail__meta {
  color: var(--color-text-muted);
  font-style: italic;
  font-size: 18px;
}

.project-detail__summary {
  max-width: 720px;
  margin-bottom: 50px;
  text-align: justify;
}

.gallery {
  column-count: 2;
  column-gap: 24px;
}

.gallery img {
  width: 100%;
  cursor: zoom-in;
  transition: opacity 0.2s ease;
  margin-bottom: 24px;
  break-inside: avoid;
  -webkit-column-break-inside: avoid;
}

.gallery img:hover {
  opacity: 0.88;
}

.back-link {
  display: inline-block;
  margin-bottom: 40px;
  text-decoration: underline;
  text-underline-offset: 6px;
  color: var(--color-text-muted);
}

/* Lightbox */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(20, 18, 15, 0.92);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 999;
  padding: 40px;
}

.lightbox.is-open {
  display: flex;
}

.lightbox img {
  max-width: 100%;
  max-height: 90vh;
  width: auto;
}

.lightbox__close {
  position: absolute;
  top: 30px;
  right: 40px;
  color: #fff;
  font-size: 32px;
  cursor: pointer;
  line-height: 1;
}

/* Responsive */
@media (max-width: 900px) {
  .container {
    padding: 0 24px;
  }

  .project-grid,
  .project-grid--six {
    grid-template-columns: repeat(2, 1fr);
  }

  .service-block {
    grid-template-columns: 1fr;
  }

  .service-block:nth-child(even) .service-block__text {
    order: 0;
  }

  .cta-row {
    justify-content: flex-start;
  }
}

@media (max-width: 600px) {
  .project-grid,
  .project-grid--six {
    grid-template-columns: 1fr;
  }

  .site-nav {
    gap: 20px;
    font-size: 16px;
  }

  .gallery {
    column-count: 1;
  }
}
