/* =============================================================
   1. Tokens
   ============================================================= */
:root {
  --bg:        #f6f4ef;
  --bg-2:      #ece7db;
  --paper:     #ffffff;
  --ink:       #201d1a;
  --ink-soft:  #3d3833;
  --ink-mute:  #7a736a;
  --accent:    #a9812e;
  --accent-dark: #8a6a22;
  --accent-2:  #7c2d12;
  --line:      rgba(32,29,26,.16);
  --shadow-soft: 0 30px 60px -30px rgba(32,29,26,.35);

  --serif-display: "Playfair Display", Georgia, serif;
  --serif-body: "Lora", Georgia, serif;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;

  --ease-out:  cubic-bezier(0.16, 1, 0.3, 1);
  --ease-soft: cubic-bezier(0.25, 0.46, 0.45, 0.94);

  --nav-h: 78px;
}

/* =============================================================
   2. Reset & base
   ============================================================= */
*, *::before, *::after { box-sizing: border-box; margin: 0; }
html {
  -webkit-text-size-adjust: 100%;
  tab-size: 2;
  overflow-x: clip;
  scroll-behavior: smooth;
  scroll-padding-top: var(--nav-h);
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  font-family: var(--serif-body);
  font-size: 17px;
  line-height: 1.68;
  color: var(--ink-soft);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
  overscroll-behavior-y: none;
}
img, svg, video { display: block; max-width: 100%; }
img { height: auto; }
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; }
a { color: inherit; text-decoration: none; }
p { text-wrap: pretty; }
h1, h2, h3, h4 { text-wrap: balance; line-height: 1.08; letter-spacing: -0.01em; color: var(--ink); font-family: var(--serif-display); font-weight: 600; }
ul, ol { list-style: none; padding: 0; }
::selection { background: var(--accent); color: var(--paper); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 2px; }

/* =============================================================
   3. Utilities
   ============================================================= */
.container { width: 100%; max-width: 1140px; margin-inline: auto; padding-inline: 1.5rem; }
.skip-link {
  position: fixed; top: -100px; left: 1rem;
  padding: .6rem 1rem; background: var(--ink); color: var(--bg);
  z-index: 9999; border-radius: 4px; font-family: var(--sans); font-weight: 600;
  transition: top .3s var(--ease-out);
}
.skip-link:focus { top: 1rem; }
.eyebrow {
  font-family: var(--sans);
  font-size: .76rem; font-weight: 600; letter-spacing: .14em; text-transform: uppercase;
  color: var(--accent); margin-bottom: .9rem;
}
.section { padding-block: clamp(3.5rem, 8vw, 7rem); position: relative; }
.section-lede { max-width: 58ch; color: var(--ink-mute); font-size: 1.08rem; margin-top: .9rem; }
.reveal { opacity: 0; transform: translateY(24px); transition: opacity .9s var(--ease-out), transform .9s var(--ease-out); }
.reveal.is-visible { opacity: 1; transform: none; }
.reveal[data-split] { opacity: 1; transform: none; }
.split-word { display: inline-block; }

/* =============================================================
   4. Buttons
   ============================================================= */
.btn {
  display: inline-flex; align-items: center; gap: .5rem;
  padding: .85rem 1.7rem; border-radius: 2px;
  font-family: var(--sans); font-weight: 600; font-size: .88rem;
  letter-spacing: .03em;
  transition: transform .4s var(--ease-out), box-shadow .4s var(--ease-out), background .3s var(--ease-out), color .3s var(--ease-out), border-color .3s var(--ease-out);
}
.btn-primary { background: var(--ink); color: var(--bg); }
.btn-primary:hover { background: var(--accent); color: var(--ink); }
.btn-outline { border: 1px solid var(--line); color: var(--ink); }
.btn-outline:hover { border-color: var(--accent); color: var(--accent); }
.hero .btn-outline { color: #fff; border-color: rgba(255,255,255,.4); }
.hero .btn-outline:hover { border-color: #fff; color: #fff; background: rgba(255,255,255,.1); }

/* =============================================================
   5. Nav
   ============================================================= */
.nav {
  position: fixed; inset: 0 0 auto 0; z-index: 500;
  height: var(--nav-h); display: flex; align-items: center;
  background: transparent;
  transition: background .4s var(--ease-out), box-shadow .4s var(--ease-out), backdrop-filter .4s var(--ease-out);
}
.nav.is-solid {
  background: rgba(246,244,239,.9);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  backdrop-filter: blur(14px) saturate(140%);
  box-shadow: 0 1px 0 var(--line);
}
.nav-inner { display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; width: 100%; }
.nav-brand { display: flex; align-items: center; }
.nav-word { font-family: var(--serif-display); font-size: 1.2rem; color: #fff; transition: color .4s var(--ease-out); }
.nav.is-solid .nav-word { color: var(--ink); }
.nav-word em { font-style: italic; color: var(--accent); }
.nav-links { display: none; align-items: center; gap: 2rem; }
.nav-links a { font-family: var(--sans); font-size: .85rem; font-weight: 500; letter-spacing: .02em; position: relative; color: inherit; }
.nav:not(.is-solid) .nav-links a { color: #fff; }
.nav.is-solid .nav-links a { color: var(--ink); }
.nav-links a::after {
  content: ""; position: absolute; left: 0; right: 100%; bottom: -6px; height: 1px;
  background: var(--accent); transition: right .35s var(--ease-out);
}
.nav-links a:hover::after { right: 0; }
.nav-burger { display: flex; flex-direction: column; justify-content: center; gap: 5px; width: 40px; height: 40px; }
.nav-burger span { display: block; height: 1.5px; width: 22px; background: currentColor; transition: transform .3s var(--ease-out), opacity .3s var(--ease-out); }
.nav:not(.is-solid) .nav-burger { color: #fff; }
.nav.is-solid .nav-burger { color: var(--ink); }
.nav.is-open .nav-burger span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
.nav.is-open .nav-burger span:nth-child(2) { opacity: 0; }
.nav.is-open .nav-burger span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }

@media (min-width: 860px) {
  .nav-links { display: flex; }
  .nav-burger { display: none; }
}
@media (max-width: 859px) {
  .nav-links {
    position: fixed; inset: var(--nav-h) 0 auto 0; background: var(--paper);
    flex-direction: column; align-items: flex-start; padding: 1.5rem 1.5rem 2rem; gap: 1.1rem;
    border-bottom: 1px solid var(--line);
    transform: translateY(-8px); opacity: 0; pointer-events: none;
    transition: opacity .3s var(--ease-out), transform .3s var(--ease-out);
  }
  .nav.is-open .nav-links { opacity: 1; transform: none; pointer-events: auto; }
  .nav.is-open .nav-links a { color: var(--ink) !important; font-size: 1.05rem; }
}

/* =============================================================
   6. Hero
   ============================================================= */
.hero { position: relative; min-height: 100vh; min-height: 100svh; display: flex; align-items: flex-end; overflow: clip; color: #fff; }
.hero-bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center 20%; }
.hero-overlay {
  position: absolute; inset: 0;
  background:
    linear-gradient(0deg, rgba(20,17,14,.9) 0%, rgba(20,17,14,.4) 50%, rgba(20,17,14,.32) 100%),
    linear-gradient(100deg, rgba(124,45,18,.28), transparent 55%);
}
.hero-content { position: relative; padding-block: 7rem 5rem; max-width: 640px; }
.hero-content .kicker {
  font-family: var(--sans); font-size: .78rem; font-weight: 600; letter-spacing: .16em; text-transform: uppercase;
  color: var(--accent); margin-bottom: 1.3rem;
}
.hero-title { font-family: var(--serif-display); font-size: clamp(2.6rem, 6.6vw, 4.6rem); color: #fff; max-width: 14ch; margin-bottom: 1.4rem; }
.hero-title em { font-style: italic; font-weight: 500; }
.hero-sub { font-family: var(--serif-body); font-style: italic; font-size: 1.15rem; color: rgba(255,255,255,.86); max-width: 44ch; margin-bottom: 2.2rem; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 1rem; }

/* =============================================================
   7. Bio
   ============================================================= */
.bio-grid { display: grid; gap: 2.6rem; }
.formacion-list { display: flex; flex-direction: column; gap: 1rem; margin-bottom: 2rem; }
.formacion-list li { padding-left: 1rem; border-left: 2px solid var(--accent); }
.formacion-list .periodo { display: block; font-family: var(--sans); font-size: .78rem; font-weight: 600; letter-spacing: .04em; color: var(--accent-dark); text-transform: uppercase; margin-bottom: .2rem; }
.formacion-list .detalle { font-size: .95rem; color: var(--ink-mute); }
.bio-stats { display: flex; flex-wrap: wrap; gap: 1.8rem; padding-top: 1.6rem; border-top: 1px solid var(--line); }
.stat { display: flex; flex-direction: column; }
.stat-num { font-family: var(--serif-display); font-size: 2rem; color: var(--ink); font-style: italic; }
.stat-label { font-family: var(--sans); color: var(--ink-mute); font-size: .78rem; max-width: 14ch; }

.bio-copy .lede { font-size: 1.3rem; color: var(--ink); }
.bio-copy .lede::first-letter {
  font-family: var(--serif-display); font-style: italic; font-size: 3.6rem; font-weight: 600;
  float: left; line-height: .78; padding: .06em .1em 0 0; color: var(--accent);
}
.bio-copy p + p { margin-top: 1.3rem; font-size: 1.05rem; }

@media (min-width: 860px) { .bio-grid { grid-template-columns: .8fr 1.4fr; gap: 4rem; } }

/* =============================================================
   8. Current exhibition banner
   ============================================================= */
.current { padding-block: 1.6rem; background: var(--ink); color: var(--bg); }
.current-inner { display: flex; align-items: center; gap: .8rem; font-family: var(--sans); font-size: .92rem; }
.current-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); flex-shrink: 0; animation: pulseDot 2.4s ease-in-out infinite; }
@keyframes pulseDot { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }
@media (prefers-reduced-motion: reduce) { .current-dot { animation: none; } }
.current-inner strong { color: var(--accent); font-weight: 600; }

/* =============================================================
   9. Gallery
   ============================================================= */
.gallery-head h2 { font-size: clamp(1.9rem, 3.6vw, 2.8rem); margin-top: .2rem; }

.gallery-grid { display: grid; gap: 1.6rem; margin-top: 2.8rem; grid-template-columns: 1fr; }
.artwork-card { cursor: pointer; }
.artwork-figure { position: relative; overflow: hidden; background: var(--paper); border-radius: 4px; box-shadow: var(--shadow-soft); }
.artwork-figure img { width: 100%; aspect-ratio: 5/4; object-fit: cover; transition: transform .7s var(--ease-out); }
.artwork-card:hover .artwork-figure img { transform: scale(1.05); }
.artwork-frame-line {
  position: absolute; inset: 10px; border: 1px solid rgba(255,255,255,.55); pointer-events: none;
  opacity: 0; transition: opacity .4s var(--ease-out);
}
.artwork-card:hover .artwork-frame-line { opacity: 1; }
.artwork-label {
  position: absolute; left: 14px; bottom: 14px;
  background: rgba(246,244,239,.94); color: var(--ink);
  padding: .5rem .8rem; font-family: var(--sans); font-size: .74rem;
  border-left: 2px solid var(--accent);
  transform: translateY(8px); opacity: 0;
  transition: transform .4s var(--ease-out), opacity .4s var(--ease-out);
}
.artwork-card:hover .artwork-label { transform: translateY(0); opacity: 1; }
.artwork-meta { padding-top: .9rem; display: flex; justify-content: space-between; align-items: baseline; }
.artwork-meta .aw-title { font-family: var(--serif-display); font-style: italic; font-size: 1.15rem; color: var(--ink); }
.artwork-meta .aw-place { font-family: var(--sans); font-size: .74rem; letter-spacing: .06em; text-transform: uppercase; color: var(--accent-dark); }

@media (min-width: 720px) { .gallery-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1180px) { .gallery-grid { grid-template-columns: repeat(3, 1fr); } }

/* =============================================================
   10. Timeline
   ============================================================= */
.timeline-list { display: flex; flex-direction: column; margin-top: 2.4rem; }
.timeline-item { display: grid; grid-template-columns: 8rem 1fr; gap: 1.2rem; padding-block: 1.4rem; border-top: 1px solid var(--line); }
.timeline-list li:last-child { border-bottom: 1px solid var(--line); }
.timeline-year { font-family: var(--sans); font-size: .82rem; font-weight: 600; color: var(--accent-dark); letter-spacing: .02em; }
.timeline-title { font-family: var(--serif-display); font-size: 1.2rem; color: var(--ink); margin-bottom: .2rem; }
.timeline-place { font-family: var(--sans); color: var(--ink-mute); font-size: .88rem; }
.timeline-item.is-current .timeline-year { color: var(--accent); }
.timeline-item.is-current .timeline-title::after {
  content: "En curso"; margin-left: .7rem; font-family: var(--sans); font-size: .68rem; font-weight: 600;
  letter-spacing: .05em; text-transform: uppercase; color: var(--accent); border: 1px solid var(--accent); border-radius: 999px; padding: .15rem .6rem; vertical-align: middle;
}

@media (max-width: 539px) { .timeline-item { grid-template-columns: 1fr; gap: .3rem; } }

/* =============================================================
   11. Contact
   ============================================================= */
.contact-inner { text-align: center; max-width: 640px; margin-inline: auto; }
.contact-inner h2 { font-size: clamp(1.7rem, 3.2vw, 2.3rem); }
.contact-inner .section-lede { margin-inline: auto; margin-bottom: 1.8rem; }

/* =============================================================
   12. Footer
   ============================================================= */
.footer { background: var(--ink); color: var(--bg); padding-block: 2.4rem; }
.footer-inner { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 1rem; }
.footer .nav-word { color: var(--bg); }
.footer .nav-word em { color: var(--accent); }
.footer p { font-family: var(--sans); font-size: .8rem; color: rgba(246,244,239,.6); }

/* =============================================================
   13. Lightbox
   ============================================================= */
.lightbox {
  position: fixed; inset: 0; z-index: 1000;
  display: flex; align-items: center; justify-content: center;
  background: rgba(20,17,14,.96);
  opacity: 0; pointer-events: none;
  transition: opacity .35s var(--ease-out);
  padding: 2rem;
}
.lightbox.is-open { opacity: 1; pointer-events: auto; }
.lightbox-figure { max-width: 1000px; width: 100%; display: flex; flex-direction: column; align-items: center; gap: 1.2rem; }
.lightbox-figure img { max-height: 68vh; width: auto; max-width: 100%; object-fit: contain; box-shadow: 0 40px 80px -20px rgba(0,0,0,.6); }
.lightbox-figure figcaption { text-align: center; color: var(--bg); max-width: 60ch; }
.lightbox-place { display: block; font-family: var(--sans); font-size: .74rem; letter-spacing: .1em; text-transform: uppercase; color: var(--accent); margin-bottom: .4rem; }
.lightbox-title { display: block; font-family: var(--serif-display); font-style: italic; font-size: 1.5rem; margin-bottom: .6rem; }
.lightbox-figure p { font-family: var(--serif-body); color: rgba(246,244,239,.78); font-size: 1rem; }
.lightbox-close { position: absolute; top: 1.6rem; right: 1.6rem; width: 44px; height: 44px; color: var(--bg); font-size: 1.2rem; border: 1px solid rgba(246,244,239,.3); border-radius: 50%; transition: border-color .3s var(--ease-out), color .3s var(--ease-out); }
.lightbox-close:hover { border-color: var(--accent); color: var(--accent); }
.lightbox-nav { position: absolute; top: 50%; transform: translateY(-50%); width: 52px; height: 52px; color: var(--bg); font-size: 2rem; border: 1px solid rgba(246,244,239,.3); border-radius: 50%; transition: border-color .3s var(--ease-out), color .3s var(--ease-out); }
.lightbox-nav:hover { border-color: var(--accent); color: var(--accent); }
.lightbox-prev { left: 1rem; }
.lightbox-next { right: 1rem; }
@media (max-width: 720px) {
  .lightbox-nav { width: 42px; height: 42px; font-size: 1.5rem; }
  .lightbox-prev { left: .3rem; } .lightbox-next { right: .3rem; }
}

/* =============================================================
   14. Responsive base
   ============================================================= */
@media (min-width: 1600px) { .container { max-width: 1280px; } }

/* =============================================================
   15. Reduced motion (only intrusive effects)
   ============================================================= */
@media (prefers-reduced-motion: reduce) {
  .current-dot { animation: none; }
}
