:root {
  --bg: #F8F7F4;
  --white: #FFFFFF;
  --ink: #191919;
  --stone: #D8D6D1;
  --muted: #777777;
  --gold: #A68A5B;
  --gold-soft: rgba(166, 138, 91, 0.14);
  --max: 1280px;
  --header-h: 4.5rem;
  --ease: cubic-bezier(.22, 1, .36, 1);
  --font-display: "Cormorant Garamond", "Playfair Display", Georgia, serif;
  --font-body: "Manrope", system-ui, sans-serif;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --touch: 44px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--ink);
  background:
    radial-gradient(1200px 600px at 10% -10%, rgba(166,138,91,.08), transparent 60%),
    radial-gradient(900px 500px at 100% 0%, rgba(25,25,25,.04), transparent 50%),
    var(--bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  min-height: 100dvh;
  padding-bottom: var(--safe-bottom);
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }

.container { width: min(100% - 2rem, var(--max)); margin-inline: auto; }
.site-main { min-height: 70vh; }

.site-header {
  position: fixed; inset: 0 0 auto 0; z-index: 50;
  height: calc(var(--header-h) + var(--safe-top));
  padding-top: var(--safe-top);
  display: flex; align-items: center;
  background: #F8F7F4;
  border-bottom: 1px solid var(--stone);
}
.header-inner {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  width: min(100% - 2rem, var(--max)); margin-inline: auto;
}
.brand { font-family: var(--font-display); font-size: 1.65rem; letter-spacing: .04em; font-weight: 500; line-height: 1; }
.nav { display: flex; gap: 1.75rem; align-items: center; margin-left: auto; }
.nav a { font-size: .85rem; letter-spacing: .08em; text-transform: uppercase; opacity: .9; position: relative; }
.nav a::after {
  content: ""; position: absolute; left: 0; bottom: -.35rem; width: 0; height: 1px;
  background: currentColor; transition: width .35s var(--ease);
}
.nav a:hover::after, .nav a[aria-current="page"]::after { width: 100%; }
.nav-toggle {
  display: none; background: none; border: 0;
  width: var(--touch); height: var(--touch);
  padding: 0; cursor: pointer; touch-action: manipulation;
  flex-shrink: 0;
}
.nav-toggle span {
  display: block; height: 2px; background: currentColor;
  margin: 5px auto; width: 1.35rem; border-radius: 1px;
}

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  min-height: var(--touch); padding: .75rem 1.5rem;
  border: 1px solid var(--ink); background: var(--ink); color: var(--white);
  letter-spacing: .08em; text-transform: uppercase; font-size: .75rem;
  cursor: pointer; transition: transform .25s var(--ease), background .25s, color .25s, border-color .25s;
  touch-action: manipulation;
}
.btn:hover { transform: translateY(-1px); }
.btn-ghost { background: transparent; color: inherit; border-color: currentColor; }
.btn-gold { background: var(--gold); border-color: var(--gold); color: var(--white); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .45; cursor: not-allowed; transform: none; }

.hero {
  position: relative; min-height: 100vh; display: grid; align-items: end;
  color: var(--white); overflow: hidden;
}
.hero-media { position: absolute; inset: 0; }
.hero-media img, .hero-media .hero-fallback {
  width: 100%; height: 100%; object-fit: cover;
}
.hero-fallback {
  background:
    linear-gradient(140deg, #2a241c 0%, #6b5740 40%, #a68a5b 70%, #d8c3a0 100%);
}
.hero::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(25,25,25,.78) 0%, rgba(25,25,25,.25) 45%, rgba(25,25,25,.2) 100%);
}
.hero-content { position: relative; z-index: 1; padding: 0 0 5.5rem; width: min(100% - 2rem, var(--max)); margin-inline: auto; max-width: 40rem; }
.hero h1 {
  font-family: var(--font-display); font-weight: 500; font-size: clamp(2.8rem, 7vw, 5.2rem);
  line-height: 1.05; margin: 0 0 1rem; letter-spacing: .01em;
  animation: rise .9s var(--ease) both;
}
.hero p { margin: 0 0 2rem; max-width: 32rem; color: rgba(248,247,244,.88); animation: rise .9s .12s var(--ease) both; }
.hero .btn { animation: rise .9s .22s var(--ease) both; }

@keyframes rise {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: none; }
}

.section { padding: 5.5rem 0; }
.section-head { display: flex; justify-content: space-between; align-items: end; gap: 1rem; margin-bottom: 2.5rem; }
.section-head h2, .page-title, .editorial h1 {
  font-family: var(--font-display); font-weight: 500; font-size: clamp(2rem, 4vw, 3rem); margin: 0; line-height: 1.15;
}
.eyebrow { font-size: .72rem; letter-spacing: .18em; text-transform: uppercase; color: var(--gold); margin: 0 0 .75rem; }
.muted { color: var(--muted); }
.lead { font-size: 1.05rem; color: var(--muted); max-width: 40rem; }

.grid-artworks {
  display: grid; gap: 2rem 1.5rem;
  grid-template-columns: repeat(3, 1fr);
}
.artwork-card { display: block; group: true; }
.artwork-card .thumb {
  aspect-ratio: 4/5; overflow: hidden; background: var(--stone); position: relative;
}
.artwork-card img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform 1s var(--ease); filter: saturate(.96);
}
.artwork-card:hover img { transform: scale(1.035); }
.artwork-card .meta { padding-top: 1rem; }
.artwork-card h3 {
  font-family: var(--font-display); font-size: 1.45rem; font-weight: 500; margin: 0 0 .25rem;
}
.artwork-card .artist { color: var(--muted); font-size: .92rem; margin: 0 0 .5rem; }
.badge {
  display: inline-flex; align-items: center; min-height: 1.5rem; padding: 0 .55rem;
  font-size: .68rem; letter-spacing: .1em; text-transform: uppercase;
  border: 1px solid var(--stone); color: var(--muted); background: var(--white);
}
.badge-available { color: var(--ink); border-color: var(--ink); }
.badge-reserved { color: var(--gold); border-color: var(--gold); background: var(--gold-soft); }
.badge-sold { opacity: .7; }

.steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.5rem; }
.step { padding: 1.5rem 0; border-top: 1px solid var(--stone); }
.step-num { color: var(--gold); font-size: .75rem; letter-spacing: .16em; text-transform: uppercase; margin-bottom: .75rem; }
.step h3 { font-family: var(--font-display); font-size: 1.4rem; font-weight: 500; margin: 0 0 .5rem; }
.step p { margin: 0; color: var(--muted); font-size: .95rem; }

.contact-simple {
  margin-top: 2.5rem;
  max-width: 28rem;
  display: grid;
  gap: 1.5rem;
}
.contact-item { display: grid; gap: .35rem; }
.contact-label {
  font-size: .72rem;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--muted);
}
.contact-item a { font-size: 1.15rem; }
.contact-actions { margin-top: .5rem; }
.btn-whatsapp {
  background: #25D366;
  border-color: #25D366;
  color: #fff;
}
.btn-whatsapp:hover { filter: brightness(.95); }

.site-footer {
  border-top: 1px solid var(--stone); padding: 3.5rem 0 2rem; margin-top: 2rem;
}
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 2rem; }
.footer-grid h4 { font-size: .72rem; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); margin: 0 0 1rem; }
.footer-grid a { display: block; margin-bottom: .5rem; color: var(--muted); }
.footer-grid a:hover { color: var(--ink); }
.footer-bottom { margin-top: 2.5rem; padding-top: 1.25rem; border-top: 1px solid var(--stone); color: var(--muted); font-size: .85rem; display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }

.filters {
  display: flex; flex-wrap: wrap; gap: .75rem; margin-bottom: 2rem; align-items: end;
}
.filters label { display: grid; gap: .35rem; font-size: .72rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); flex: 1 1 9rem; }
.filters select, .filters input, .form-control {
  min-height: var(--touch); padding: .65rem .8rem; border: 1px solid var(--stone); background: var(--white); color: var(--ink); width: 100%;
}
.form-control:focus, .filters select:focus, .filters input:focus {
  outline: 2px solid var(--gold-soft); border-color: var(--gold);
}

.artwork-detail { display: grid; grid-template-columns: 1.15fr .85fr; gap: 3rem; padding-top: calc(var(--header-h) + 2.5rem); padding-bottom: 4rem; }
.gallery-main { background: var(--stone); aspect-ratio: 4/5; overflow: hidden; cursor: zoom-in; }
.gallery-main img { width: 100%; height: 100%; object-fit: cover; }
.thumbs { display: flex; gap: .5rem; margin-top: .75rem; flex-wrap: wrap; }
.thumbs button { border: 1px solid transparent; padding: 0; width: 4.5rem; aspect-ratio: 1; overflow: hidden; background: none; cursor: pointer; }
.thumbs button[aria-pressed="true"] { border-color: var(--ink); }
.thumbs img { width: 100%; height: 100%; object-fit: cover; }
.detail-panel h1 { font-family: var(--font-display); font-size: clamp(2.2rem, 4vw, 3.4rem); margin: .5rem 0; font-weight: 500; }
.price { font-size: 1.35rem; margin: 1rem 0; }
.specs { list-style: none; padding: 0; margin: 1.5rem 0; border-top: 1px solid var(--stone); }
.specs li { display: flex; justify-content: space-between; gap: 1rem; padding: .85rem 0; border-bottom: 1px solid var(--stone); font-size: .95rem; }
.specs span { color: var(--muted); }
.reserve-note { color: var(--muted); font-size: .9rem; margin: 1rem 0 0; }

.lightbox {
  position: fixed; inset: 0; background: rgba(25,25,25,.92); z-index: 100;
  display: none; align-items: center; justify-content: center; padding: 2rem;
}
.lightbox.is-open { display: flex; }
.lightbox img { max-height: 90vh; max-width: 90vw; object-fit: contain; }
.lightbox-close { position: absolute; top: 1rem; right: 1rem; color: #fff; background: none; border: 0; font-size: 1.5rem; cursor: pointer; }

.modal {
  position: fixed; inset: 0; z-index: 90; display: none; align-items: center; justify-content: center;
  background: rgba(25,25,25,.55); padding: 1rem;
}
.modal.is-open { display: flex; }
.modal-dialog {
  width: min(100%, 34rem); background: var(--bg); max-height: 92vh; overflow: auto;
  padding: 1.75rem; border: 1px solid var(--stone);
  animation: rise .35s var(--ease);
}
.modal-head { display: flex; justify-content: space-between; gap: 1rem; align-items: start; margin-bottom: 1.25rem; }
.modal-head h2 { font-family: var(--font-display); font-size: 1.8rem; margin: 0; font-weight: 500; }
.modal-close { background: none; border: 0; font-size: 1.4rem; cursor: pointer; }
.modal-artwork { display: flex; gap: 1rem; margin-bottom: 1.25rem; align-items: center; }
.modal-artwork img { width: 4.5rem; height: 5.5rem; object-fit: cover; background: var(--stone); }
.form-grid { display: grid; gap: .9rem; }
.form-grid.two { grid-template-columns: 1fr 1fr; gap: .9rem; }
.form-group { display: grid; gap: .35rem; }
.form-group label { font-size: .78rem; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.checkbox { display: flex; gap: .65rem; align-items: start; font-size: .9rem; color: var(--muted); }
.hp { position: absolute; left: -9999px; opacity: 0; height: 0; width: 0; overflow: hidden; }
.alert { padding: .9rem 1rem; margin-bottom: 1rem; border: 1px solid var(--stone); }
.alert-success { background: #eef6ef; border-color: #b7d7bc; }
.alert-error { background: #f8eeee; border-color: #e0b4b4; }
.confirm-card { max-width: 40rem; margin: calc(var(--header-h) + 3rem) auto 4rem; padding: 2rem; border: 1px solid var(--stone); background: var(--white); }
.confirm-card h1 { font-family: var(--font-display); font-weight: 500; }

.page-pad { padding-top: calc(var(--header-h) + var(--safe-top) + 2rem); padding-bottom: 3rem; }
.prose { max-width: 46rem; }
.prose p { color: #444; }
.home-intro { padding-bottom: 2.5rem; }
.home-intro .page-title { font-size: clamp(2.2rem, 8vw, 3.6rem); margin-bottom: .75rem; }
.home-intro .lead { margin: 0 0 1.5rem; }
.home-intro .btn { margin-bottom: .25rem; }
.section-featured { padding-top: 1.5rem; }

@media (max-width: 980px) {
  .grid-artworks { grid-template-columns: repeat(2, 1fr); gap: 1.35rem 1rem; }
  .steps { grid-template-columns: 1fr 1fr; }
  .artwork-detail, .footer-grid { grid-template-columns: 1fr; }
  .artwork-detail { gap: 1.75rem; padding-top: calc(var(--header-h) + var(--safe-top) + 1.5rem); }
  .section { padding: 3rem 0; }
}
@media (max-width: 720px) {
  :root { --header-h: 3.75rem; }
  .container { width: min(100% - 1.5rem, var(--max)); }
  .nav-toggle { display: inline-flex; flex-direction: column; align-items: center; justify-content: center; order: 2; }
  .brand { order: 1; }
  .nav {
    position: fixed;
    top: calc(var(--header-h) + var(--safe-top));
    left: 0;
    right: 0;
    margin: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: .75rem 1.25rem 1.25rem;
    background: #F8F7F4;
    border-bottom: 1px solid var(--stone);
    box-shadow: 0 12px 30px rgba(25,25,25,.08);
    max-height: min(70dvh, calc(100dvh - var(--header-h) - var(--safe-top)));
    overflow-y: auto;
    display: none;
    z-index: 50;
  }
  .nav.is-open { display: flex; }
  .nav a {
    min-height: var(--touch);
    display: flex;
    align-items: center;
    padding: .5rem 0;
    font-size: .95rem;
    border-bottom: 1px solid var(--stone);
  }
  .nav a:last-child { border-bottom: 0; }
  .brand { font-size: 1.35rem; }
  .grid-artworks { grid-template-columns: 1fr; gap: 2rem; }
  .steps { grid-template-columns: 1fr; }
  .form-grid.two { grid-template-columns: 1fr; }
  .section-head {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1.5rem;
  }
  .section-featured { padding-top: 0.5rem; }
  .home-intro { padding-bottom: 2rem; }
  .filters { flex-direction: column; align-items: stretch; }
  .filters label { flex: 1 1 auto; }
  .filters .btn, .detail-panel .btn, .contact-actions .btn, .home-intro .btn, .section-head .btn { width: 100%; }
  .modal { align-items: flex-end; padding: 0; }
  .modal-dialog {
    width: 100%;
    max-height: min(92dvh, 100%);
    border-left: 0;
    border-right: 0;
    border-bottom: 0;
    padding: 1.25rem 1.25rem calc(1.25rem + var(--safe-bottom));
    border-radius: 1rem 1rem 0 0;
  }
  .confirm-card { margin-left: 1rem; margin-right: 1rem; padding: 1.35rem; }
  .gallery-main { aspect-ratio: 3/4; }
  .thumbs button { width: 3.75rem; min-height: var(--touch); }
  .footer-grid { gap: 1.5rem; }
  .site-footer { padding: 2.5rem 0 calc(1.5rem + var(--safe-bottom)); }
  .lightbox { padding: .75rem; }
  .lightbox-close { top: calc(.75rem + var(--safe-top)); min-width: var(--touch); min-height: var(--touch); }
}
