/* Layout: muro de galería claro — encabezado ligero, imagen héroe, obras en rejilla con fichas tipo lámina científica */
:root {
  --paper: #F3F5F1;
  --surface: #FFFFFF;
  --ink: #17262A;
  --muted: #5B6A6C;
  --line: #D6DCD5;
  --accent: #6A4F9C;
  --accent-soft: #E8E2F1;

  --f-display: 'Young Serif', Georgia, 'Times New Roman', serif;
  --f-body: 'Instrument Sans', 'Helvetica Neue', Arial, sans-serif;
  --f-mono: 'IBM Plex Mono', 'Courier New', monospace;

  --gutter: clamp(16px, 4vw, 48px);
  --max: 1280px;
  --text: 64ch;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--f-body);
  font-size: 17px;
  line-height: 1.6;
  padding-inline: var(--gutter);
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

.wrap { max-width: var(--max); margin-inline: auto; }

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: env(safe-area-inset-top, 0px);
  z-index: 20;
  background: var(--paper);
  border-bottom: 1px solid var(--line);
  margin-inline: calc(var(--gutter) * -1);
  padding-inline: var(--gutter);
}
.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding-block: 18px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  font-family: var(--f-display);
  font-size: 22px;
  letter-spacing: .02em;
}
.brand svg { width: 28px; height: 28px; color: var(--accent); flex: none; }

.nav { display: flex; align-items: center; gap: 28px; }
.nav a, .nav summary {
  font-size: 14px;
  letter-spacing: .14em;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
}
.nav a[aria-current="page"], .nav .is-current > summary { color: var(--accent); }
.nav a:hover, .nav summary:hover { color: var(--accent); }

.dropdown { position: relative; }
.dropdown summary { list-style: none; display: flex; align-items: center; gap: 6px; }
.dropdown summary::-webkit-details-marker { display: none; }
.dropdown summary::after { content: ""; width: 7px; height: 7px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(45deg) translateY(-3px); }
.dropdown[open] summary::after { transform: rotate(-135deg) translateY(-1px); }
.dropdown-menu {
  position: absolute;
  top: calc(100% + 14px);
  left: -16px;
  min-width: 220px;
  background: var(--surface);
  border: 1px solid var(--line);
  padding: 8px;
  display: grid;
  gap: 2px;
}
.dropdown-menu a { display: block; padding: 10px 12px; letter-spacing: .08em; }
.dropdown-menu a:hover { background: var(--accent-soft); }


.menu-toggle {
  display: none;
  background: none;
  border: 1px solid var(--line);
  color: var(--ink);
  font: 500 13px var(--f-body);
  letter-spacing: .14em;
  text-transform: uppercase;
  padding: 10px 14px;
  cursor: pointer;
}

/* ---------- Home ---------- */
.hero { padding-block: clamp(20px, 4vw, 40px) 0; }
.hero figure { margin: 0; }
.hero img { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; background: #EEEEEC; }

.intro {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr);
  gap: clamp(24px, 5vw, 80px);
  align-items: end;
  padding-block: clamp(40px, 7vw, 96px);
  border-bottom: 1px solid var(--line);
}
.intro h1 {
  font-family: var(--f-display);
  font-weight: 400;
  font-size: clamp(44px, 8vw, 112px);
  line-height: .98;
  letter-spacing: -.02em;
  margin: 0;
  text-wrap: balance;
}
.intro h1 span { display: block; color: var(--accent); font-size: .42em; letter-spacing: .02em; margin-top: 14px; }
.intro p { margin: 0; color: var(--muted); max-width: 42ch; }
.disciplines { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px !important; }
.disciplines li { list-style: none; font-family: var(--f-mono); font-size: 13px; border: 1px solid var(--line); padding: 4px 10px; color: var(--ink); }
.disciplines { padding: 0; }

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding-block: clamp(32px, 5vw, 56px) 24px;
}
.section-head h2 { font-family: var(--f-display); font-weight: 400; font-size: clamp(28px, 4vw, 40px); margin: 0; }
.eyebrow { font-family: var(--f-mono); font-size: 13px; letter-spacing: .08em; color: var(--muted); text-transform: uppercase; margin: 0; }

/* ---------- Gallery ---------- */
[hidden] { display: none !important; }
.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr));
  gap: clamp(28px, 3vw, 40px) clamp(16px, 2.5vw, 32px);
  align-items: start;
  padding-bottom: clamp(48px, 7vw, 96px);
}
.work { margin: 0; min-width: 0; }
.work a, .work button { display: block; width: 100%; padding: 0; border: 0; background: none; cursor: zoom-in; text-align: left; color: inherit; text-decoration: none; font: inherit; }
.work img { width: 100%; transition: opacity .3s ease; background: var(--line); }
.work a:hover img, .work button:hover img { opacity: .86; }
.work figcaption { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 4px 14px; padding-top: 12px; font-size: 14px; }
.work .fig { font-family: var(--f-mono); color: var(--accent); font-size: 13px; padding-top: 2px; }
.work .title { font-weight: 600; }
.work .meta { grid-column: 2; color: var(--muted); font-size: 13px; font-family: var(--f-mono); }
.work img { background: #FFFFFF; }
.work .download { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; justify-self: start; padding-top: 4px; }
.gallery.pairs { grid-template-columns: repeat(auto-fill, minmax(min(100%, 420px), 1fr)); }
.gallery.sheets { grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); }
.gallery.sheets img { box-shadow: 0 1px 0 var(--line), 0 12px 32px rgba(23, 38, 42, .08); }
.project-head .subtitle { font-family: var(--f-display); font-size: clamp(20px, 2.4vw, 28px); line-height: 1.25; color: var(--accent); margin: 14px 0 0; text-wrap: balance; }
a.eyebrow { text-decoration: none; }
a.eyebrow:hover { color: var(--accent); }

/* ---------- Project page ---------- */
.project-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
  gap: clamp(24px, 5vw, 80px);
  padding-block: clamp(40px, 7vw, 96px) clamp(32px, 5vw, 64px);
  border-bottom: 1px solid var(--line);
}
.project-head h1 { font-family: var(--f-display); font-weight: 400; font-size: clamp(38px, 4.8vw, 72px); line-height: 1; margin: 8px 0 0; letter-spacing: -.01em; overflow-wrap: anywhere; }
.statement p { margin: 0 0 1em; max-width: var(--text); }

/* ---------- About ---------- */
.about {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
  gap: clamp(28px, 6vw, 96px);
  padding-block: clamp(40px, 7vw, 96px);
  align-items: start;
}
.about-text section + section { margin-top: clamp(40px, 6vw, 72px); padding-top: clamp(32px, 5vw, 56px); border-top: 1px solid var(--line); }
.about-text h2 { font-family: var(--f-display); font-weight: 400; font-size: clamp(30px, 4vw, 44px); margin: 0 0 20px; }
.about-text p { max-width: var(--text); margin: 0 0 1em; }
.about-text em { font-style: italic; }

.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); margin: 28px 0 0; }
.facts div { background: var(--paper); padding: 16px 18px; }
.facts dt { font-family: var(--f-mono); font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.facts dd { margin: 4px 0 0; font-size: 15px; }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--line); margin-inline: calc(var(--gutter) * -1); padding-inline: var(--gutter); }
.site-footer .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 16px; padding-block: 28px; font-size: 14px; color: var(--muted); }

/* ---------- Lightbox ---------- */
.lightbox { position: fixed; inset: 0; z-index: 50; background: rgba(23, 38, 42, .94); display: grid; grid-template-rows: 1fr auto; padding: max(20px, env(safe-area-inset-top, 0px)) 16px max(20px, env(safe-area-inset-bottom, 0px)); color: #F3F5F1; }
.lightbox img { max-height: 100%; max-width: 100%; margin: auto; object-fit: contain; min-height: 0; }
.lightbox-bar { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding-top: 14px; font-size: 14px; }
.lightbox-bar p { margin: 0; min-width: 0; }
.lightbox-controls { display: flex; gap: 8px; }
.lightbox button { background: none; border: 1px solid rgba(243, 245, 241, .4); color: #F3F5F1; width: 44px; height: 44px; font-size: 18px; cursor: pointer; }
.lightbox button:hover { border-color: #F3F5F1; }

/* ---------- Mobile ---------- */
@media (max-width: 860px) {
  .menu-toggle { display: inline-block; min-width: 84px; flex: none; }
  .brand { font-size: 17px; white-space: nowrap; min-width: 0; }
  .brand svg { width: 24px; height: 24px; }
  .nav-panel {
    display: none;
    position: absolute;
    left: 0; right: 0; top: 100%;
    background: var(--paper);
    border-bottom: 1px solid var(--line);
    padding: 8px var(--gutter) 24px;
  }
  .nav-panel.open { display: block; }
  .nav { flex-direction: column; align-items: stretch; gap: 0; }
  .nav > a, .nav > .dropdown > summary { padding: 16px 0; border-bottom: 1px solid var(--line); font-size: 15px; }
  .dropdown-menu { position: static; border: 0; padding: 0 0 8px 12px; background: none; min-width: 0; }
    .site-header .wrap { position: static; }
  .site-header { position: sticky; }
  .intro, .project-head, .about { grid-template-columns: minmax(0, 1fr); }
  .hero img { aspect-ratio: 4 / 5; }
}
@media (min-width: 861px) {
  .nav-panel { display: flex; align-items: center; gap: 32px; }
}


/* About sin retrato: cada sección con su título a la izquierda */
.about { display: block; }
.about-text section { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: clamp(24px, 5vw, 80px); }
.about-text section > div { min-width: 0; }
@media (max-width: 860px) {
  .about-text section { grid-template-columns: minmax(0, 1fr); gap: 0; }
}
.facts { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 24px; background: none; border: 0; border-top: 1px solid var(--line); }
.facts div { background: none; padding: 14px 0; border-bottom: 1px solid var(--line); }

.project-head.no-statement { grid-template-columns: minmax(0, 1fr); }

/* ---------- 404 ---------- */
.not-found { padding-block: clamp(64px, 12vw, 160px); max-width: 44ch; }
.not-found h1 { font-family: var(--f-display); font-weight: 400; font-size: clamp(36px, 6vw, 72px); line-height: 1.05; margin: 8px 0 16px; text-wrap: balance; }
.not-found a { color: var(--accent); }

/* ---------- Motion ---------- */
@keyframes rise { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes settle { from { opacity: 0; transform: scale(1.03); } to { opacity: 1; transform: none; } }
@keyframes drop { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }

/* entrada de la página */
.site-header { animation: fade .6s ease both; }
.hero img { animation: settle 1.1s cubic-bezier(.2, .7, .2, 1) both; }
.intro h1, .project-head > div:first-child, .about-text section:first-child > h2, .not-found { animation: rise .8s cubic-bezier(.2, .7, .2, 1) .1s both; }
.intro > div, .project-head .statement, .about-text section:first-child > div { animation: rise .8s cubic-bezier(.2, .7, .2, 1) .25s both; }

/* obras que aparecen al hacer scroll (la clase la pone main.js) */
.reveal { opacity: 0; transform: translateY(22px); transition: opacity .7s ease, transform .7s cubic-bezier(.2, .7, .2, 1); }
.reveal.is-in { opacity: 1; transform: none; }

/* hover en obras */
.work a, .work button { overflow: hidden; }
.work img { transition: transform .8s cubic-bezier(.2, .7, .2, 1), opacity .3s ease; }
.work a:hover img, .work button:hover img { opacity: 1; transform: scale(1.025); }

/* menús y visor */
.dropdown[open] .dropdown-menu { animation: drop .22s ease both; }
.nav-panel.open { animation: drop .25s ease both; }
.lightbox:not([hidden]) { animation: fade .25s ease both; }
.lightbox img.swap { animation: fade .35s ease both; }

@media (min-width: 861px) {
  .nav > a, .nav summary { background: linear-gradient(currentColor, currentColor) 0 100% / 0 1px no-repeat; padding-bottom: 3px; transition: background-size .3s ease, color .2s ease; }
  .nav > a:hover, .nav summary:hover, .nav > a[aria-current="page"], .nav .is-current > summary { background-size: 100% 1px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
  .reveal { opacity: 1; transform: none; }
}
