/* Leonardo Dawson — estilos del sitio */
@font-face { font-family: "Cormorant"; src: url("/assets/fonts/cormorant-garamond-latin-300-normal.woff2") format("woff2"); font-weight: 300; font-display: swap; }
@font-face { font-family: "Cormorant"; src: url("/assets/fonts/cormorant-garamond-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Cormorant"; src: url("/assets/fonts/cormorant-garamond-latin-400-italic.woff2") format("woff2"); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: "Cormorant"; src: url("/assets/fonts/cormorant-garamond-latin-500-normal.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Jost"; src: url("/assets/fonts/jost-latin-300-normal.woff2") format("woff2"); font-weight: 300; font-display: swap; }
@font-face { font-family: "Jost"; src: url("/assets/fonts/jost-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Jost"; src: url("/assets/fonts/jost-latin-500-normal.woff2") format("woff2"); font-weight: 500; font-display: swap; }

:root {
  --bg: #f6f3ee;
  --surface: #efebe4;
  --ink: #1a1714;
  --muted: #6f675e;
  --line: #ddd6cc;
  --accent: #8c7650;
  --serif: "Cormorant", "Cormorant Garamond", Georgia, "Times New Roman", serif;
  --sans: "Jost", "Helvetica Neue", Arial, sans-serif;
  --gutter: clamp(16px, 4vw, 56px);
  --max: 1320px;
  --ease: cubic-bezier(.2, .7, .2, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 300 17px/1.7 var(--sans);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
h1, h2, h3 { font-family: var(--serif); font-weight: 400; line-height: 1.1; margin: 0 0 .5em; letter-spacing: .005em; }
h1 { font-size: clamp(2.6rem, 6vw, 5rem); font-weight: 300; }
h2 { font-size: clamp(2rem, 3.6vw, 3rem); font-weight: 300; }
h3 { font-size: 1.75rem; }
p { margin: 0 0 1.1em; }
:focus-visible { outline: 1px solid var(--ink); outline-offset: 4px; }

.wrap { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -9999px; top: 0; background: var(--ink); color: var(--bg); padding: 8px 16px; z-index: 100; }
.skip:focus { left: 16px; }
.center { text-align: center; }
.center .actions { justify-content: center; }

.eyebrow {
  font: 400 .72rem/1.4 var(--sans);
  letter-spacing: .28em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 1.4em;
}
.lead { font-family: var(--serif); font-size: clamp(1.25rem, 2vw, 1.5rem); line-height: 1.5; color: var(--muted); text-wrap: balance; }
.meta { font-size: .85rem; color: var(--muted); letter-spacing: .02em; }
.fine { font-size: .78rem; color: var(--muted); letter-spacing: .04em; }
.tagline { font-family: var(--serif); font-style: italic; font-size: 1.35rem; color: var(--muted); }

/* Botones y enlaces */
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 2rem; }
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 48px; padding: 0 30px;
  border: 1px solid var(--ink); background: var(--ink); color: var(--bg);
  font: 400 .74rem/1 var(--sans); letter-spacing: .24em; text-transform: uppercase;
  transition: background .3s var(--ease), color .3s var(--ease);
  cursor: pointer;
}
.btn:hover { background: transparent; color: var(--ink); }
.btn-ghost { background: transparent; color: var(--ink); }
.btn-ghost:hover { background: var(--ink); color: var(--bg); }
.link {
  display: inline-block;
  font: 400 .74rem/1 var(--sans); letter-spacing: .24em; text-transform: uppercase;
  padding-bottom: 6px; border-bottom: 1px solid var(--ink);
  transition: color .3s, border-color .3s;
}
.link:hover { color: var(--accent); border-color: var(--accent); }

/* Cabecera */
.site-header {
  position: sticky; top: 0; z-index: 50;
  border-bottom: 1px solid transparent;
  transition: border-color .3s;
}
/* El desenfoque va en una capa aparte: en la cabecera misma encerraría al menú móvil (position: fixed) */
.site-header::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: rgba(246, 243, 238, .92);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}
.site-header.scrolled { border-bottom-color: var(--line); }
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 84px; }
.logo img { width: 170px; height: auto; }
.site-nav ul { display: flex; gap: clamp(20px, 3vw, 44px); list-style: none; margin: 0; padding: 0; }
.site-nav a {
  font: 400 .74rem/1 var(--sans); letter-spacing: .24em; text-transform: uppercase;
  padding: 8px 0; border-bottom: 1px solid transparent; transition: border-color .3s;
}
.site-nav a:hover, .site-nav a[aria-current="page"] { border-bottom-color: var(--ink); }
.menu-toggle { display: none; }

@media (max-width: 760px) {
  .header-inner { height: 68px; }
  .logo img { width: 140px; }
  .menu-toggle {
    display: block; position: relative; z-index: 60;
    width: 44px; height: 44px; margin-right: -10px;
    background: none; border: 0; cursor: pointer;
  }
  .bars, .bars::before, .bars::after {
    position: absolute; left: 11px; width: 22px; height: 1px; background: var(--ink);
    transition: transform .3s var(--ease), opacity .3s;
  }
  .bars { top: 22px; }
  .bars::before, .bars::after { content: ""; left: 0; }
  .bars::before { top: -7px; }
  .bars::after { top: 7px; }
  .menu-open .bars { background: transparent; }
  .menu-open .bars::before { transform: translateY(7px) rotate(45deg); }
  .menu-open .bars::after { transform: translateY(-7px) rotate(-45deg); }
  .site-nav {
    position: fixed; inset: 0; z-index: 55;
    background: var(--bg);
    display: flex; align-items: center; justify-content: center;
    opacity: 0; visibility: hidden; transition: opacity .35s var(--ease), visibility .35s;
  }
  .menu-open .site-nav { opacity: 1; visibility: visible; }
  .menu-open { overflow: hidden; }
  .site-nav ul { flex-direction: column; align-items: center; gap: 28px; }
  .site-nav a { font: 300 2.2rem/1 var(--serif); letter-spacing: .02em; text-transform: none; }
}

/* Home: portada */
.hero {
  display: grid; grid-template-columns: 1fr 1fr; gap: clamp(32px, 6vw, 96px);
  align-items: center; min-height: calc(100vh - 84px); min-height: calc(100svh - 84px);
  padding-top: 32px; padding-bottom: 64px;
}
.hero-media { margin: 0; }
.hero-media img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; }
.motto { font: italic 400 clamp(1.4rem, 2.4vw, 1.9rem)/1.4 var(--serif); margin: 0; color: var(--muted); max-width: 26ch; }

@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; min-height: 0; padding-top: 24px; }
  .hero-media { order: -1; }
  .hero-media img { aspect-ratio: 4 / 4.4; }
}

/* Secciones */
.section { padding-top: clamp(72px, 10vw, 140px); padding-bottom: clamp(72px, 10vw, 140px); }
.section + .section { padding-top: 0; }
.section-head { max-width: 760px; margin-bottom: clamp(40px, 5vw, 72px); }
.page-head { padding-top: clamp(48px, 8vw, 110px); padding-bottom: clamp(40px, 6vw, 80px); }
.page-head.center .lead { margin-left: auto; margin-right: auto; }

/* Tarjetas de obras */
/* Marco fijo: la foto se posiciona dentro (desde build.py) para que la obra quede entera,
   del mismo tamaño y a la misma altura en todas las tarjetas de un grupo */
.frame { position: relative; overflow: hidden; aspect-ratio: 2 / 3; background: var(--surface); }
.frame img { position: absolute; max-width: none; height: auto; transition: transform 1.2s var(--ease); }

/* Cada tarjeta comparte las filas de la grilla (subgrid): títulos, textos y enlaces alineados */
.cards { display: grid; grid-template-columns: repeat(3, 1fr); column-gap: clamp(24px, 3vw, 48px); row-gap: 0; }
.cards-2 { grid-template-columns: repeat(2, 1fr); }
.card { display: grid; grid-row: span 4; grid-template-rows: subgrid; align-content: start; }
.card-link { display: block; }
.cards-2 .card-link { display: flex; flex-direction: column; justify-content: flex-end; }  /* fotos completas de distinto alto: títulos alineados */
.card-media { margin-bottom: 1.4rem; overflow: hidden; }
.card-link:hover .card-media img { transform: scale(1.035); }
.card h3 { margin-bottom: .35em; }
.card-text { color: var(--muted); max-width: 36ch; }
.card .meta { margin-bottom: 1.4rem; }
.card .link { justify-self: start; align-self: start; }
@media (max-width: 900px) {
  .cards, .cards-2 { grid-template-columns: 1fr; }
  .card:not(:last-child) { margin-bottom: 56px; }
}

/* Bloques de dos columnas */
.split { display: grid; grid-template-columns: 5fr 6fr; gap: clamp(32px, 7vw, 120px); align-items: center; }
.split-rev { grid-template-columns: 6fr 5fr; }
.split-media { margin: 0; }
.split-media img { width: 100%; }
.split-media.sticky { align-self: start; position: sticky; top: 110px; }
.split-text { max-width: 600px; }
.prose p { color: #3b352f; }
@media (max-width: 900px) {
  .split, .split-rev { grid-template-columns: 1fr; }
  .split-rev .split-media { order: -1; }
  .split-media.sticky { position: static; }
}

/* Franja Instagram */
.band { background: var(--surface); }
.section.band { padding-top: clamp(72px, 10vw, 140px); }
.band-inner { text-align: center; }
.band-inner p { color: var(--muted); }
.band .btn { margin-top: 1rem; }

/* Galería */
.series { padding-bottom: clamp(72px, 9vw, 130px); }
.series-head { display: grid; grid-template-columns: 1fr 1fr; column-gap: 48px; align-items: end; margin-bottom: 32px; border-top: 1px solid var(--line); padding-top: 40px; }
.series-head h2 { grid-row: span 2; margin: 0; }
.series-head .tagline { margin: 0; }
.series-head p:not(.tagline) { color: var(--muted); margin: .3em 0 1em; }
.series-head .link { justify-self: start; grid-column: 2; }
/* Galería y miniaturas: fotos completas, sin recorte, en filas justificadas (cada una con su proporción --r) */
.thumbs { --row: clamp(200px, 24vw, 360px); display: flex; flex-wrap: wrap; gap: 16px; }
.thumbs::after { content: ""; flex: 100000 1 0; }
.thumb { flex: calc(var(--r) * 100) 1 calc(var(--r) * var(--row)); max-width: calc(var(--r) * var(--row) * 1.6); background: var(--surface); cursor: zoom-in; overflow: hidden; }
.thumb img { width: 100%; height: auto; aspect-ratio: var(--r); object-fit: cover; transition: opacity .3s; }
.thumb:hover img { opacity: .85; }
/* Galería: filas justificadas. Cada foto crece según su ancho/alto (--r) desde 0, así todas
   quedan a la misma altura y la fila llena exacto el ancho, sin recortar ninguna imagen. */
.g-grid { display: flex; gap: 16px; }
.g-pair { display: contents; }
.g-item { flex: var(--r) 1 0; min-width: 0; cursor: zoom-in; }
.g-item img { width: 100%; height: auto; transition: opacity .3s; }
.g-item:hover img { opacity: .85; }
@media (max-width: 900px) {
  .series-head { grid-template-columns: 1fr; }
  .series-head h2 { grid-row: auto; margin-bottom: .2em; }
  .series-head .link { grid-column: 1; }
  .g-grid { flex-direction: column; gap: 10px; }
  .g-pair { display: flex; gap: 10px; }
}

/* Tienda */
.shop-grid { display: grid; grid-template-columns: repeat(3, 1fr); column-gap: clamp(24px, 3vw, 48px); row-gap: 0; padding-bottom: clamp(72px, 10vw, 140px); }
.shop-item { display: grid; grid-row: span 6; grid-template-rows: subgrid; align-content: start; }
.shop-body { display: grid; grid-row: span 5; grid-template-rows: subgrid; }
.shop-media { display: block; margin-bottom: 1.4rem; }
.shop-media:hover .frame img { transform: scale(1.035); }
.shop-body h2 { font-size: 1.9rem; margin-bottom: .3em; }
.price { font-family: var(--serif); font-size: 1.5rem; margin: .6em 0 0; }
.shop-body .actions { margin-top: 1.2rem; align-self: start; }
@media (max-width: 900px) {
  .shop-grid { grid-template-columns: 1fr; }
  .shop-item:not(:last-child) { margin-bottom: 64px; }
}

/* Ficha de obra */
.work { display: grid; grid-template-columns: 7fr 5fr; gap: clamp(32px, 6vw, 96px); padding-top: clamp(32px, 5vw, 64px); align-items: start; }
.work-main { display: block; background: var(--surface); cursor: zoom-in; }
.work-main img { width: 100%; }
.thumbs { --row: 110px; gap: 10px; margin-top: 10px; }
.work-info { position: sticky; top: 110px; }
.work-info .eyebrow a:hover { color: var(--ink); }
.specs { margin: 2rem 0; border-top: 1px solid var(--line); }
.specs div { display: flex; justify-content: space-between; gap: 24px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.specs dt { font: 400 .72rem/1.8 var(--sans); letter-spacing: .22em; text-transform: uppercase; color: var(--muted); }
.specs dd { margin: 0; text-align: right; }
.specs a:hover { color: var(--accent); }
.work-info .btn { width: 100%; margin-bottom: 2.5rem; }
@media (max-width: 900px) {
  .work { grid-template-columns: 1fr; }
  .work-info { position: static; }
  .thumbs { --row: 90px; gap: 8px; }
}

/* Contacto */
.contact { padding-top: clamp(48px, 8vw, 110px); padding-bottom: clamp(72px, 10vw, 140px); grid-template-columns: 6fr 5fr; }
.contact .split-media { order: 2; }
.contact .btn { margin-top: .5rem; }
@media (max-width: 900px) { .contact { grid-template-columns: 1fr; } }

/* Pie y newsletter */
.site-footer { border-top: 1px solid var(--line); padding-top: clamp(56px, 7vw, 96px); }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr; gap: 56px; }
.nl-lead { font-family: var(--serif); font-size: 1.4rem; line-height: 1.4; max-width: 30ch; }
.nl-form { display: flex; flex-wrap: wrap; max-width: 520px; margin-top: 1.5rem; }
.nl-form input[type="email"] {
  flex: 1 1 240px; min-width: 0; height: 52px; padding: 0 2px;
  border: 0; border-bottom: 1px solid var(--ink); border-radius: 0; background: transparent;
  font: 300 1rem var(--sans); color: var(--ink);
}
.nl-form input::placeholder { color: var(--muted); }
.nl-form input:focus { outline: none; border-bottom-width: 2px; }
.nl-form button {
  height: 52px; padding: 0 0 0 24px; background: none; border: 0; border-bottom: 1px solid var(--ink);
  font: 400 .74rem/1 var(--sans); letter-spacing: .24em; text-transform: uppercase; color: var(--ink); cursor: pointer;
}
.nl-form button:hover { color: var(--accent); }
.nl-form button[disabled] { opacity: .5; cursor: wait; }
.nl-status { flex-basis: 100%; min-height: 1.6em; margin: .8em 0 0; font-size: .9rem; }
.nl-status.error { color: #9a3b2e; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.plain { list-style: none; margin: 0; padding: 0; }
.plain li { margin-bottom: .6em; }
.plain a { border-bottom: 1px solid transparent; transition: border-color .3s; }
.plain a:hover { border-bottom-color: var(--ink); }
.footer-base { margin-top: clamp(48px, 6vw, 80px); padding-top: 24px; padding-bottom: 32px; border-top: 1px solid var(--line); }
.footer-base p { margin: 0; font-size: .78rem; color: var(--muted); letter-spacing: .04em; }
@media (max-width: 760px) { .footer-grid { grid-template-columns: 1fr; gap: 40px; } }

/* Visor de imágenes */
.lightbox {
  position: fixed; inset: 0; z-index: 200;
  display: flex; align-items: center; justify-content: center;
  background: rgba(20, 18, 16, .96);
}
.lightbox[hidden] { display: none; }
.lightbox img { max-width: calc(100vw - 32px); max-height: calc(100vh - 120px); width: auto; height: auto; object-fit: contain; }
.lightbox button {
  position: absolute; background: none; border: 0; color: #f6f3ee; cursor: pointer;
  font: 300 2.6rem/1 var(--serif); width: 56px; height: 56px;
}
.lb-close { top: 12px; right: 12px; }
.lb-prev { left: 8px; top: 50%; transform: translateY(-50%); }
.lb-next { right: 8px; top: 50%; transform: translateY(-50%); }
@media (max-width: 760px) {
  .lb-prev, .lb-next { top: auto; bottom: 16px; transform: none; }
  .lb-prev { left: calc(50% - 64px); }
  .lb-next { right: calc(50% - 64px); }
}

/* Entrada suave al hacer scroll */
.js .reveal { opacity: 0; transform: translateY(18px); transition: opacity 1s var(--ease), transform 1s var(--ease); }
.js .reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
  html { scroll-behavior: auto; }
  .js .reveal { opacity: 1; transform: none; }
}
