:root {
  --ivory: #fbf8f1;
  --paper: #f3eee3;
  --ink: #2b2a9e;
  --ink-deep: #1f1e78;
  --text: #2a2838;
  --muted: #6d6a7c;
  --line: rgba(43, 42, 158, 0.18);
  --serif: "Cormorant Garamond", Georgia, serif;
  --sans: "Montserrat", system-ui, sans-serif;
  --script: "Pinyon Script", cursive;
  --gutter: clamp(16px, 5vw, 72px);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 72px; }
body {
  margin: 0;
  background: var(--ivory);
  color: var(--text);
  font: 300 16px/1.75 var(--sans);
  -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; }
a { color: inherit; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }

/* Tipografía compartida */
.eyebrow {
  margin: 0 0 0.75rem;
  font: 400 0.7rem/1.4 var(--sans);
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--ink);
}
.script { font-family: var(--script); color: var(--ink); line-height: 1.1; }
.section__title, .hero__title {
  margin: 0;
  font: 300 clamp(2.6rem, 6vw, 4.5rem)/1 var(--serif);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink);
}
.section__script { margin: 0.5rem 0 0; font-size: clamp(1.5rem, 3vw, 2rem); }

.btn {
  display: inline-block;
  padding: 0.95rem 1.8rem;
  border: 1px solid var(--ink);
  color: var(--ink);
  font: 400 0.72rem/1 var(--sans);
  letter-spacing: 0.24em;
  text-transform: uppercase;
  text-decoration: none;
  transition: background 0.25s, color 0.25s;
}
.btn:hover { background: var(--ink); color: var(--ivory); }
.btn--solid { background: var(--ink); color: var(--ivory); }
.btn--solid:hover { background: var(--ink-deep); }
.center { text-align: center; }

/* Navegación */
.nav {
  position: fixed;
  inset: 0 0 auto;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem var(--gutter);
  transition: background 0.3s, padding 0.3s, box-shadow 0.3s;
}
.nav.is-scrolled {
  background: rgba(251, 248, 241, 0.94);
  backdrop-filter: blur(8px);
  padding-block: 0.8rem;
  box-shadow: 0 1px 0 var(--line);
}
.nav__brand {
  font: 400 0.72rem/1 var(--sans);
  letter-spacing: 0.34em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--ink);
}
.nav__links { display: flex; gap: 2.2rem; }
.nav__links a {
  font: 400 0.7rem/1 var(--sans);
  letter-spacing: 0.24em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--ink);
  padding-bottom: 4px;
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s;
}
.nav__links a:hover { border-color: var(--ink); }
.nav__toggle { display: none; width: 32px; height: 32px; position: relative; }
.nav__toggle span {
  position: absolute; left: 4px; right: 4px; height: 1px; background: var(--ink);
  transition: transform 0.3s, top 0.3s;
}
.nav__toggle span:first-child { top: 12px; }
.nav__toggle span:last-child { top: 20px; }
.nav.is-open .nav__toggle span:first-child { top: 16px; transform: rotate(45deg); }
.nav.is-open .nav__toggle span:last-child { top: 16px; transform: rotate(-45deg); }

/* Portada */
.hero {
  min-height: min(100svh, 920px);
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  align-items: center;
  gap: clamp(2rem, 5vw, 5rem);
  padding: 7rem var(--gutter) 4rem;
}
.hero__title { font-size: clamp(3rem, 7.5vw, 6.2rem); line-height: 0.95; }
.hero__script { margin: 0.6rem 0 1.6rem; font-size: clamp(2rem, 4vw, 3.2rem); padding-left: 0.2em; }
.hero__lead { max-width: 30rem; margin: 0 0 2.2rem; color: var(--muted); }
.hero__actions { display: flex; flex-wrap: wrap; gap: 1rem; }
.hero__art { position: relative; margin: 0; justify-self: center; width: min(100%, 460px); }
.hero__main {
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  border-radius: 999px 999px 0 0;
}
.hero__accent {
  position: absolute;
  width: 38%;
  left: -14%;
  bottom: -6%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  border: 10px solid var(--ivory);
  box-shadow: 0 18px 40px rgba(31, 30, 120, 0.12);
}

/* Secciones */
.section { padding: clamp(5rem, 10vw, 8rem) var(--gutter); }
.section--paper { background: var(--paper); }
.section__head { text-align: center; margin-bottom: clamp(2.5rem, 5vw, 4rem); }

/* Filtros */
.filters {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem 1.8rem;
  margin-bottom: 3rem;
}
.filters__btn {
  font: 400 0.7rem/1 var(--sans);
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 0.6rem 0;
  border-bottom: 1px solid transparent;
  transition: color 0.2s, border-color 0.2s;
}
.filters__btn:hover { color: var(--ink); }
.filters__btn[aria-selected="true"] { color: var(--ink); border-color: var(--ink); }

/* Galería tipo mosaico */
.gallery { display: flex; align-items: flex-start; gap: clamp(1rem, 3vw, 2.5rem); max-width: 1240px; margin: 0 auto; }
.gallery__col { flex: 1; min-width: 0; }
.card {
  display: block;
  width: 100%;
  margin-bottom: clamp(1.75rem, 3vw, 2.75rem);
  text-align: left;
  animation: fade-up 0.5s ease both;
}
.card__frame { display: block; position: relative; overflow: hidden; }
.card__frame img { width: 100%; height: auto; max-height: 34rem; object-fit: cover; transition: transform 0.7s ease; }
.card:hover .card__frame img { transform: scale(1.04); }
.card:focus-visible { outline: 1px solid var(--ink); outline-offset: 6px; }
.card__count {
  position: absolute; right: 0.75rem; bottom: 0.75rem;
  padding: 0.3rem 0.6rem;
  background: rgba(251, 248, 241, 0.9);
  color: var(--ink);
  font: 400 0.68rem/1 var(--sans);
  letter-spacing: 0.1em;
}
.card__title { display: block; margin-top: 0.9rem; font: 400 1.35rem/1.2 var(--serif); color: var(--ink); }
.card__meta { display: block; margin-top: 0.2rem; font-size: 0.78rem; color: var(--muted); }

/* Encargos */
.offer {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  max-width: 1040px;
  margin: 0 auto 4.5rem;
  padding: 0;
  border-block: 1px solid var(--line);
}
.offer li { padding: 1.6rem 1rem; text-align: center; font-size: 0.85rem; color: var(--muted); }
.offer li + li { border-left: 1px solid var(--line); }
.offer span { display: block; font: 400 1.5rem/1.3 var(--serif); color: var(--ink); }
.steps {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(2rem, 4vw, 4rem);
  max-width: 1040px;
  margin: 0 auto 4rem;
  padding: 0;
}
.steps__num { font: 300 3rem/1 var(--serif); color: var(--ink); opacity: 0.45; }
.steps h3 {
  margin: 0.8rem 0 0.6rem;
  font: 400 0.78rem/1.4 var(--sans);
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink);
}
.steps p { margin: 0; font-size: 0.93rem; color: var(--muted); }

/* Sobre mí */
.about {
  display: grid;
  grid-template-columns: minmax(0, 0.85fr) minmax(0, 1fr);
  align-items: center;
  gap: clamp(2.5rem, 6vw, 6rem);
  max-width: 1160px;
  margin: 0 auto;
}
.about__photo { margin: 0; justify-self: center; width: min(100%, 420px); }
.about__photo img {
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  object-position: 50% 30%;
  border-radius: 999px 999px 0 0;
}
.about__text .section__title { margin-bottom: 1.8rem; }
.about__text p { max-width: 34rem; }
.about__note {
  margin-top: 2rem;
  padding-top: 1.2rem;
  border-top: 1px solid var(--line);
  font: italic 400 1.15rem/1.5 var(--serif);
  color: var(--ink);
}

/* Contacto */
.section--ink { background: var(--ink); color: var(--ivory); }
.section--ink .eyebrow, .section--ink .section__title, .section--ink .script { color: var(--ivory); }
.contact {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  max-width: 1040px;
  margin: 0 auto;
}
.contact__item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  padding: 2.2rem 1rem;
  text-decoration: none;
  transition: background 0.25s;
  min-width: 0;
}
.contact__item + .contact__item { border-left: 1px solid rgba(251, 248, 241, 0.25); }
.contact__item:hover { background: rgba(251, 248, 241, 0.07); }
.contact__item svg { width: 28px; height: 28px; fill: currentColor; margin-bottom: 0.4rem; }
.contact__item svg[fill="none"] { fill: none; }
.contact__label { font: 400 0.68rem/1 var(--sans); letter-spacing: 0.3em; text-transform: uppercase; opacity: 0.75; }
.contact__value { font: 400 1.3rem/1.3 var(--serif); overflow-wrap: anywhere; text-align: center; }

.footer {
  padding: 2rem var(--gutter);
  text-align: center;
  font-size: 0.7rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}
.footer p { margin: 0; }

/* Página 404 */
.notfound { min-height: 100svh; display: flex; flex-direction: column; justify-content: center; align-items: center; margin: 0; }
.notfound__script { margin-bottom: 2.5rem; }

/* Botón flotante de WhatsApp */
.wa-float {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 15;
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--ink);
  color: var(--ivory);
  box-shadow: 0 10px 28px rgba(31, 30, 120, 0.3);
  transition: transform 0.25s;
}
.wa-float:hover { transform: translateY(-3px); }
.wa-float svg { width: 26px; height: 26px; fill: currentColor; }

/* Lightbox */
.lightbox {
  width: 100vw;
  height: 100dvh;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: var(--ivory);
  color: var(--text);
  outline: none;
}
.lightbox::backdrop { background: rgba(31, 30, 120, 0.25); }
.lightbox[open] { display: flex; align-items: center; justify-content: center; animation: fade 0.25s ease; }
.lightbox__body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 3rem;
  align-items: center;
  width: min(1200px, 100% - 9rem);
  height: 100%;
  padding: 4rem 0;
}
.lightbox__stage { height: 100%; min-height: 0; display: flex; align-items: center; justify-content: center; }
.lightbox__stage img { max-width: 100%; max-height: 100%; object-fit: contain; }
.lightbox__title { margin: 0 0 0.5rem; font: 400 2.2rem/1.1 var(--serif); color: var(--ink); }
.lightbox__meta { margin: 0; color: var(--muted); font-size: 0.9rem; }
.lightbox__note { margin: 0.8rem 0 0; font: italic 400 1.1rem/1.45 var(--serif); color: var(--ink); }
.lightbox__note:empty { display: none; }
.lightbox__thumbs { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 1.5rem 0 0; }
.lightbox__thumbs:empty { display: none; }
.lightbox__thumbs button { width: 58px; height: 58px; padding: 0; opacity: 0.5; outline: 1px solid transparent; outline-offset: 2px; transition: opacity 0.2s; }
.lightbox__thumbs button[aria-current="true"] { opacity: 1; outline-color: var(--ink); }
.lightbox__thumbs img { width: 100%; height: 100%; object-fit: cover; }
.lightbox__cta { margin-top: 2rem; }
.lightbox__close, .lightbox__nav {
  position: absolute;
  color: var(--ink);
  font: 300 2.6rem/1 var(--serif);
  width: 3rem;
  height: 3rem;
  z-index: 2;
}
.lightbox__close { top: 1rem; right: 1.25rem; }
.lightbox__nav { top: 50%; transform: translateY(-50%); }
.lightbox__nav--prev { left: 1rem; }
.lightbox__nav--next { right: 1rem; }

/* Animaciones */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity 0.8s ease, transform 0.8s ease; }
.reveal.is-visible { opacity: 1; transform: none; }
@keyframes fade-up { from { opacity: 0; transform: translateY(14px); } }
@keyframes fade { from { opacity: 0; } }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .reveal { opacity: 1; transform: none; }
}

/* Tablet */
@media (max-width: 900px) {
  .offer { grid-template-columns: repeat(2, 1fr); }
  .offer li:nth-child(3) { border-left: 0; }
  .offer li:nth-child(n + 3) { border-top: 1px solid var(--line); }
  .lightbox__body { grid-template-columns: 1fr; grid-template-rows: minmax(0, 1fr) auto; gap: 1.25rem; width: calc(100% - 2rem); padding: 4rem 0 1.5rem; }
  .lightbox__info { text-align: center; }
  .lightbox__thumbs { justify-content: center; margin-top: 1rem; }
  .lightbox__title { font-size: 1.7rem; }
  .lightbox__cta { margin-top: 1.2rem; }
  .lightbox__nav { top: auto; bottom: 1rem; transform: none; }
}

/* Móvil */
@media (max-width: 720px) {
  .nav__toggle { display: block; }
  .nav__links {
    position: fixed;
    inset: 0;
    z-index: -1;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2.4rem;
    background: var(--ivory);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
  }
  .nav__links a { font-size: 0.85rem; }
  .nav.is-open .nav__links { opacity: 1; pointer-events: auto; }
  .hero { grid-template-columns: 1fr; text-align: center; padding-top: 6.5rem; min-height: auto; }
  .hero__lead { margin-inline: auto; }
  .hero__actions { justify-content: center; }
  .hero__art { width: min(78%, 360px); order: -1; }
  .hero__accent { left: -10%; }
  .about { grid-template-columns: 1fr; text-align: center; }
  .about__text p { margin-inline: auto; }
  .steps { grid-template-columns: 1fr; text-align: center; }
  .contact { grid-template-columns: 1fr; }
  .contact__item + .contact__item { border-left: 0; border-top: 1px solid rgba(251, 248, 241, 0.25); }
  .card__title { font-size: 1.1rem; }
  .card__meta { font-size: 0.72rem; }
}
