@font-face {
  font-family: "Fraunces";
  src: url("../fonts/Fraunces.ttf") format("truetype");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Fraunces";
  src: url("../fonts/Fraunces-Italic.ttf") format("truetype");
  font-weight: 100 900;
  font-style: italic;
  font-display: swap;
}

:root {
  --bg: #0E0E0E;
  --text: #EDE6D6;
  --muted: #B4AEA6;
  --header-h: 72px;
  --cover-bottom-gap: clamp(16px, 2.4vh, 28px);
  --font: "Fraunces", "Times New Roman", serif;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; background: var(--bg); color: var(--text); }
html { height: 100%; }
body {
  font-family: var(--font);
  font-weight: 350;
  font-size: 18px;
  line-height: 1.6;
  min-height: 100%;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; border: 0; display: block; }
a { color: var(--text); text-decoration: none; }
a:hover { text-decoration: none; opacity: 0.75; }

.skip-link {
  position: absolute;
  left: 16px;
  top: 0;
  z-index: 100;
  padding: 10px 16px;
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--text);
  font-size: 13px;
  letter-spacing: 0.08em;
  transform: translateY(-150%);
  transition: transform 0.15s ease;
}
.skip-link:focus {
  transform: translateY(10px);
}
:focus { outline: none; }
:focus-visible {
  outline: 1px solid var(--text);
  outline-offset: 3px;
}
button:focus-visible,
a:focus-visible,
.menu-toggle:focus-visible {
  outline: 1px solid var(--text);
  outline-offset: 3px;
}

.site-header {
  height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  background: var(--bg);
}
.site-brand {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 1px;
  line-height: 1.15;
}
.site-name {
  font-family: var(--font);
  font-style: italic;
  font-weight: 400;
  font-size: 16px;
  letter-spacing: 0.04em;
  color: var(--text);
}
.site-tag {
  font-style: normal;
  font-weight: 350;
  font-size: 12px;
  letter-spacing: 0.20em;
  text-transform: uppercase;
  color: #D8D3CA;
}

.nav {
  display: none;
  position: absolute;
  top: var(--header-h);
  right: 0;
  min-width: 16em;
  background: var(--bg);
  flex-direction: column;
  align-items: flex-end;
  padding: 12px 28px 36px;
  gap: 18px;
  z-index: 20;
}
body.menu-open { overflow: hidden; }
body.menu-open .nav { display: flex; }
.site-header { position: relative; z-index: 30; }
body.menu-open .menu-toggle span { background: transparent; }
body.menu-open .menu-toggle span::before { top: 0; transform: rotate(45deg); }
body.menu-open .menu-toggle span::after { top: 0; transform: rotate(-45deg); }
.menu-toggle span,
.menu-toggle span::before,
.menu-toggle span::after { transition: transform 0.15s ease, background 0.15s ease, top 0.15s ease; }
.nav a {
  font-size: 12px;
  font-weight: 350;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text);
}
.nav a[aria-current="page"] { opacity: 0.55; }
.menu-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  z-index: 40;
  min-width: 44px;
  min-height: 44px;
  margin-right: -6px;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
  color: var(--text);
}
.menu-toggle span,
.menu-toggle span::before,
.menu-toggle span::after {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text);
  position: relative;
}
.menu-toggle span::before,
.menu-toggle span::after {
  content: "";
  position: absolute;
  left: 0;
}
.menu-toggle span::before { top: -7px; }
.menu-toggle span::after { top: 7px; }

/* Home cover: hide the top-left name and tag; keep the menu (right / hamburger) */
body.home .site-brand { display: none; }
body.home .site-header { justify-content: flex-end; }

/* Inner pages: pin the footer to the bottom when the content is shorter than the viewport */
body:not(.home) {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}
body:not(.home) main { flex: 1 1 auto; }

/* Home: foto, texto, contactos y copyright caben en la primera pantalla, sin scroll */
html:has(body.home) {
  height: 100%;
  height: 100dvh;
  overflow: hidden;
}
body.home {
  display: grid;
  grid-template-rows: var(--header-h) minmax(0, 1fr) auto;
  height: 100%;
  height: 100vh;
  height: 100dvh;
  max-height: 100vh;
  max-height: 100dvh;
  min-height: 0;
  overflow: hidden;
}
body.home main {
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
body.home .cover {
  flex: 1 1 auto;
  height: auto;
  min-height: 0;
  margin-bottom: 0;
  container-type: size;
  container-name: portada;
}
body.home .cover-text {
  --cover-h: 100cqh;
}
body.home .site-footer {
  padding: clamp(10px, 1.6vh, 20px) 28px clamp(12px, 1.8vh, 22px);
}
body.home .footer-contacts {
  margin: 0 0 clamp(8px, 1.2vh, 14px);
  gap: 8px 22px;
}

/* Home cover: 3:4 photo left, typography right — matches the PDF/Canva portada */
.cover {
  width: 100%;
  height: calc(100vh - var(--header-h) - var(--cover-bottom-gap));
  margin-bottom: var(--cover-bottom-gap);
  display: flex;
  flex-direction: row;
  align-items: stretch;
  overflow: hidden;
  background: var(--bg);
}
.cover-photo {
  flex: 0 0 auto;
  height: 100%;
  width: auto;
  max-width: 72%;
  overflow: visible;
  display: flex;
  align-items: flex-start;
  justify-content: flex-start;
}
.cover-photo img {
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  object-position: left top;
}
.cover-text {
  --cover-h: calc(100vh - var(--header-h) - var(--cover-bottom-gap));
  min-width: 0;
  min-height: 100%;
  align-self: stretch;
  container-type: inline-size;
  /* 195px on the 2160-tall PDF composition; also cap so the tracked title fits the column */
  --title-size: min(
    calc(var(--cover-h) * 195 / 2160),
    calc((100vw - var(--cover-h) * 0.75 - 64px) / 10)
  );
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 0 clamp(28px, 9%, 64px);
  /* Slight optical lift, as in the PDF */
  transform: translateY(calc(var(--cover-h) * -18 / 2160));
}
.cover-title {
  margin: 0;
  margin-inline-end: -0.3325em;
  padding: 0;
  max-width: 100%;
  color: #F7F1E8;
  font-family: var(--font);
  font-style: normal;
  font-weight: 300;
  font-size: min(var(--title-size), calc(100cqi / 10));
  letter-spacing: 0.3325em;
  line-height: 1;
  white-space: nowrap;
  font-variation-settings: "opsz" 9, "SOFT" 0, "WONK" 0;
}
.cover-name {
  margin: 0;
  color: #F7F1E8;
  font-family: var(--font);
  font-style: italic;
  font-weight: 400;
  font-size: calc(var(--title-size) * 148 / 312);
  letter-spacing: 0;
  line-height: 1;
  font-variation-settings: "opsz" 9, "SOFT" 0, "WONK" 0;
  margin-top: calc(var(--title-size) * 223 / 312);
}

.page {
  max-width: 820px;
  margin: 0 auto;
  padding: 96px 28px 120px;
}
.page-wide {
  max-width: 1200px;
  margin: 0 auto;
  padding: 80px 28px 120px;
}
.page h1,
.page-wide h1 {
  margin: 0 0 56px;
  font-size: 13px;
  font-weight: 350;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  text-align: center;
}
.page p { margin: 0 0 1.35em; }
.page p:last-child { margin-bottom: 0; }

.sobre {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 56px;
  align-items: start;
}
.sobre img { width: 100%; height: auto; }
.sobre .texto { padding-top: 0; }
.sobre .texto p { margin: 0 0 1.15em; }
.sobre .texto p:last-child { margin-bottom: 0; }

.servicios-lista {
  list-style: none;
  margin: 0 0 64px;
  padding: 0;
  text-align: center;
}
.servicios-lista li {
  font-size: 22px;
  font-weight: 350;
  letter-spacing: 0.02em;
  margin: 0 0 18px;
  line-height: 1.3;
}
.page p.servicios-nota,
.servicios-nota {
  text-align: center;
  max-width: 34em;
  margin: 0 auto 0.7em;
  color: var(--text);
}
.servicios-nota + .btn-wrap {
  margin-top: 36px;
}
.btn {
  display: inline-block;
  border: 1px solid var(--text);
  color: var(--text);
  padding: 12px 28px;
  font-family: var(--font);
  font-size: 12px;
  font-weight: 350;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  background: transparent;
  border-radius: 0;
}
.btn:hover { background: var(--text); color: var(--bg); opacity: 1; }
.btn-wrap { text-align: center; }

.gallery {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}
.gallery a {
  display: block;
  aspect-ratio: 3 / 4;
  overflow: hidden;
  background: var(--bg);
}
.gallery img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}

.contacto-lista {
  list-style: none;
  margin: 0 auto 48px;
  padding: 0;
  max-width: 28em;
}
.contacto-lista li {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 0 0 20px;
  font-size: 18px;
}
.contacto-lista img { width: 28px; height: 28px; flex: 0 0 28px; }
.lugar {
  text-align: center;
  color: var(--muted);
  margin: 8px 0 0;
  letter-spacing: 0.04em;
}

.site-footer {
  padding: 48px 28px 56px;
  text-align: center;
}
.footer-contacts {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 28px;
  margin: 0 0 28px;
}
.footer-contacts a,
.footer-contacts span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 350;
  letter-spacing: 0.08em;
  color: #D8D3CA;
}
.footer-contacts img { width: 14px; height: 14px; }
.copy {
  margin: 0;
  font-size: 12px;
  letter-spacing: 0.08em;
  color: #D8D3CA;
}
.footer-copy-only {
  padding-top: 32px;
}

/* Lightbox: full-resolution image, no crop */
.lightbox {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(14, 14, 14, 0.97);
  z-index: 500;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.lightbox.is-open { display: flex; }
.lightbox img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
}
.lightbox button {
  position: absolute;
  background: none;
  border: 0;
  color: var(--text);
  font-family: var(--font);
  font-size: 22px;
  letter-spacing: 0.08em;
  cursor: pointer;
  padding: 12px;
  line-height: 1;
}
.lightbox .lb-close { top: 12px; right: 16px; }
.lightbox .lb-prev { left: 8px; top: 50%; transform: translateY(-50%); }
.lightbox .lb-next { right: 8px; top: 50%; transform: translateY(-50%); }

@media (max-width: 860px) {
  .sobre { grid-template-columns: 1fr; gap: 28px; max-width: 420px; margin: 0 auto; }
  .sobre img {
    width: 58%;
    max-width: 220px;
    margin: 0 auto;
    display: block;
  }
  .gallery { grid-template-columns: repeat(3, 1fr); gap: 10px; }
}
@media (max-width: 700px) {
  .page { padding: 64px 20px 96px; }
  .cover {
    height: auto;
    min-height: 0;
    margin-bottom: 0;
    flex-direction: column;
  }
  .cover-photo {
    width: 100%;
    max-width: 100%;
    height: auto;
    aspect-ratio: auto;
  }
  .cover-photo img {
    width: 100%;
    height: auto;
    max-width: 100%;
    max-height: none;
    object-fit: contain;
  }
  .cover-text {
    --title-size: calc((100vw - 44px) / 9.8);
    transform: none;
    padding: 56px 22px 72px;
  }
  .servicios-lista li { font-size: 20px; }
  .footer-contacts { flex-direction: column; align-items: center; gap: 12px; }

  body.home .cover {
    height: auto;
    min-height: 0;
    margin-bottom: 0;
    flex-direction: column;
  }
  body.home .cover-photo {
    flex: 1 1 auto;
    width: 100%;
    max-width: 100%;
    height: auto;
    min-height: 0;
    aspect-ratio: auto;
    justify-content: center;
    align-items: center;
  }
  body.home .cover-photo img {
    width: auto;
    height: auto;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    object-position: center top;
  }
  body.home .cover-text {
    flex: 0 0 auto;
    min-height: 0;
    --title-size: min(calc((100vw - 44px) / 9.8), calc(100cqi / 10), 40px);
    transform: none;
    padding: clamp(16px, 3.5vh, 28px) 22px clamp(12px, 2.5vh, 20px);
  }
  body.home .footer-contacts {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 8px 16px;
  }
}
