/* =========================================================
   (des)corporalizar — sistema visual
   Capas translúcidas, tinta, hueso y piel.
   ========================================================= */

:root {
  --bone: hsl(38 33% 94%);
  --bone-2: hsl(36 24% 89%);
  --bone-3: hsl(35 18% 82%);
  --ink: hsl(30 8% 8%);
  --ink-2: hsl(30 7% 16%);
  --ink-soft: hsl(30 7% 24%);
  --flesh: hsl(18 38% 78%);
  --flesh-2: hsl(16 40% 68%);
  --muted: hsl(30 7% 39%);
  --muted-2: hsl(30 6% 52%);
  --line: hsl(30 10% 84%);
  --focus: hsl(14 72% 52%);
  --shadow: 0 30px 80px hsl(30 30% 10% / 0.18);
  --font-display: 'Fraunces', Georgia, 'Times New Roman', serif;
  --font-ui: 'DM Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --header-height: 76px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bone);
  color: var(--ink);
  font-family: var(--font-ui);
  font-weight: 300;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

body.no-scroll {
  overflow: hidden;
}

img {
  display: block;
  max-width: 100%;
}

button,
input {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
}

a {
  color: inherit;
}

::selection {
  background: var(--flesh);
  color: var(--ink);
}

:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 3px;
}

.skip-link {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 300;
  transform: translateY(-200%);
  background: var(--bone);
  color: var(--ink);
  padding: 10px 14px;
  font-size: 9px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  text-decoration: none;
  transition: transform 0.25s var(--ease);
}

.skip-link:focus {
  transform: none;
}

.kicker {
  margin: 0;
  font-size: 9px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.26em;
  color: var(--muted);
}

.link-button {
  appearance: none;
  border: 0;
  background: transparent;
  padding: 0;
  font-size: 9px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: inherit;
  text-decoration: none;
  position: relative;
}

.link-button::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: -4px;
  width: 100%;
  height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.35s var(--ease);
}

.link-button:hover::after,
.link-button:focus-visible::after {
  transform: scaleX(1);
  transform-origin: left;
}

.btn {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  border-radius: 999px;
  border: 1px solid transparent;
  padding: 14px 24px;
  font-size: 9px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.22em;
  transition: transform 0.35s var(--ease), background 0.35s var(--ease),
    color 0.35s var(--ease), border-color 0.35s var(--ease),
    box-shadow 0.35s var(--ease), opacity 0.35s var(--ease);
}

.btn:hover {
  transform: translateY(-2px);
}

.btn:disabled {
  opacity: 0.42;
  cursor: wait;
  transform: none;
}

.btn-primary {
  background: var(--bone);
  color: var(--ink);
  border-color: var(--bone);
  padding: 17px 30px;
  box-shadow: 0 16px 40px hsl(30 40% 4% / 0.28);
}

.btn-primary:hover {
  background: hsl(38 40% 98%);
  border-color: hsl(38 40% 98%);
  box-shadow: 0 20px 50px hsl(30 40% 4% / 0.35);
}

.btn-primary:disabled:hover {
  box-shadow: 0 16px 40px hsl(30 40% 4% / 0.28);
}

.btn-arrow {
  display: inline-block;
  transition: transform 0.35s var(--ease);
}

.btn-primary:hover .btn-arrow {
  transform: translateX(4px);
}

.btn-secondary {
  background: transparent;
  border-color: var(--ink);
  color: var(--ink);
}

.btn-secondary:hover {
  background: var(--ink);
  color: var(--bone);
}

.btn-ghost {
  background: transparent;
  border-color: hsl(0 0% 100% / 0.24);
  color: var(--bone);
}

.btn-ghost:hover {
  background: var(--bone);
  border-color: var(--bone);
  color: var(--ink);
}

.icon-button {
  appearance: none;
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--ink);
  font-size: 13px;
  line-height: 1;
  transition: background 0.25s var(--ease), color 0.25s var(--ease),
    border-color 0.25s var(--ease);
}

.icon-button:hover {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--bone);
}

/* =========================================================
   Bienvenida
   ========================================================= */

.welcome {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  grid-template-rows: auto 1fr auto;
  padding: clamp(20px, 4vw, 48px);
  background: var(--ink);
  color: var(--bone);
  overflow: hidden;
  transition: opacity 1s var(--ease), visibility 1s var(--ease);
}

.welcome.is-hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.welcome-bg {
  position: absolute;
  inset: -18%;
  z-index: 0;
  background:
    radial-gradient(42% 52% at 18% 24%, hsl(18 38% 62% / 0.42), transparent 70%),
    radial-gradient(38% 46% at 82% 18%, hsl(280 18% 58% / 0.24), transparent 72%),
    radial-gradient(54% 62% at 62% 86%, hsl(38 42% 72% / 0.2), transparent 72%),
    linear-gradient(135deg, hsl(30 8% 11%), hsl(30 10% 4%));
  filter: blur(24px) saturate(1.08);
  animation: drift 26s ease-in-out infinite alternate;
}

.welcome-grain {
  position: absolute;
  inset: 0;
  z-index: 1;
  background-image: url('./grain.svg');
  background-size: 240px 240px;
  opacity: 0.22;
  mix-blend-mode: soft-light;
  pointer-events: none;
}

.welcome::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 1;
  background: radial-gradient(ellipse at center, transparent 42%, hsl(30 8% 3% / 0.55) 100%);
  pointer-events: none;
}

.welcome-top,
.welcome-bottom,
.welcome-center {
  position: relative;
  z-index: 2;
}

.welcome-top,
.welcome-bottom {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  color: hsl(38 33% 94% / 0.62);
}

.welcome .kicker {
  color: hsl(38 33% 94% / 0.62);
}

.welcome-center {
  align-self: center;
  justify-self: center;
  width: 100%;
  max-width: 1180px;
  text-align: center;
  padding: 4vh 0;
}

.welcome-eyebrow {
  margin: 0;
  font-size: clamp(8px, 1vw, 11px);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.34em;
  color: hsl(38 33% 94% / 0.62);
}

.hero-title {
  margin: 18px 0 0;
  font-family: var(--font-display);
  font-size: clamp(2.8rem, 11vw, 10.5rem);
  font-weight: 300;
  font-variation-settings: 'opsz' 144, 'wght' 300;
  line-height: 0.86;
  letter-spacing: -0.055em;
  color: var(--bone);
  text-wrap: balance;
}

.hero-paren {
  color: hsl(18 38% 78% / 0.72);
  font-weight: 300;
}

.hero-des {
  font-style: italic;
  font-weight: 300;
}

.welcome-lede {
  max-width: 560px;
  margin: 28px auto 0;
  font-size: clamp(12px, 1.2vw, 15px);
  line-height: 1.75;
  color: hsl(38 33% 94% / 0.72);
  text-wrap: pretty;
}

.welcome-actions {
  margin-top: clamp(28px, 5vh, 52px);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}

.welcome-links {
  display: flex;
  align-items: center;
  gap: 12px;
  color: hsl(38 33% 94% / 0.58);
  font-size: 9px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.welcome-links .link-button {
  color: inherit;
}

.welcome-bottom {
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.24em;
}

.welcome-bottom p {
  margin: 0;
}

.noscript-note {
  position: absolute;
  left: 50%;
  bottom: 76px;
  transform: translateX(-50%);
  z-index: 3;
  margin: 0;
  padding: 10px 16px;
  background: var(--flesh);
  color: var(--ink);
  font-size: 11px;
  width: max-content;
  max-width: calc(100vw - 40px);
}

/* =========================================================
   Sitio y cabecera
   ========================================================= */

.site {
  opacity: 0;
  transition: opacity 1s var(--ease);
}

body.is-entered .site {
  opacity: 1;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--header-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 clamp(20px, 4vw, 48px);
  background: hsl(38 33% 94% / 0.82);
  backdrop-filter: blur(18px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.35s var(--ease), background 0.35s var(--ease);
}

.site-header.is-scrolled {
  border-bottom-color: var(--line);
  background: hsl(38 33% 94% / 0.94);
}

.wordmark {
  font-family: var(--font-display);
  font-size: clamp(17px, 2vw, 23px);
  font-weight: 300;
  letter-spacing: -0.045em;
  text-decoration: none;
  white-space: nowrap;
}

.header-right {
  display: flex;
  align-items: center;
  gap: clamp(16px, 3vw, 40px);
}

.header-nav {
  display: flex;
  align-items: center;
  gap: 18px;
}

.counter {
  margin: 0;
  font-size: 9px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.archive {
  width: 100%;
  max-width: 1600px;
  margin: 0 auto;
  padding: clamp(40px, 7vw, 92px) clamp(16px, 4vw, 48px) 170px;
  min-height: 70vh;
}

.archive-intro {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(240px, 0.8fr);
  gap: 28px;
  align-items: end;
  padding-bottom: 28px;
  border-bottom: 1px solid var(--line);
}

.archive-title {
  margin: 8px 0 0;
  font-family: var(--font-display);
  font-size: clamp(2rem, 4.2vw, 4.4rem);
  font-weight: 300;
  font-variation-settings: 'opsz' 72, 'wght' 300;
  line-height: 0.96;
  letter-spacing: -0.045em;
  text-wrap: balance;
}

.archive-note {
  justify-self: end;
  max-width: 360px;
  margin: 0;
  font-size: 12px;
  line-height: 1.75;
  color: var(--muted);
  text-wrap: pretty;
}

.filter-bar {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  padding: 18px 0;
  border-bottom: 1px solid var(--line);
}

.filter-label {
  font-size: 9px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.24em;
  color: var(--muted);
}

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip {
  appearance: none;
  border: 1px solid var(--line);
  background: transparent;
  border-radius: 999px;
  padding: 8px 14px;
  font-size: 9px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--ink-soft);
  transition: background 0.25s var(--ease), color 0.25s var(--ease),
    border-color 0.25s var(--ease);
}

.chip:hover {
  background: var(--bone-2);
}

.chip[aria-pressed='true'] {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--bone);
}

.review-prompt {
  margin: 24px 0 8px;
  padding: 20px 24px;
  border: 1px solid var(--line);
  background: linear-gradient(120deg, hsl(18 38% 78% / 0.18), hsl(38 33% 94% / 0.52));
  display: grid;
  gap: 4px;
}

.review-question {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1.15rem, 2vw, 1.6rem);
  font-weight: 300;
  line-height: 1.2;
  letter-spacing: -0.025em;
}

.review-help {
  margin: 0;
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--muted);
}

.demo-banner {
  margin: 18px 0;
  padding: 12px 16px;
  border-left: 2px solid var(--flesh-2);
  background: var(--bone-2);
  font-size: 11px;
  color: var(--ink-soft);
  display: flex;
  flex-wrap: wrap;
  gap: 6px 12px;
}

.demo-banner code,
.state-text code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.95em;
  background: hsl(30 10% 84% / 0.55);
  padding: 1px 5px;
  border-radius: 2px;
}

.state-box {
  min-height: 42vh;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 8px;
  padding: 48px 16px;
  text-align: center;
}

.state-mark {
  margin: 0 0 8px;
  font-family: var(--font-display);
  font-size: clamp(3.5rem, 9vw, 7rem);
  font-weight: 300;
  line-height: 0.8;
  letter-spacing: -0.08em;
  color: var(--flesh-2);
}

.state-kicker {
  margin: 0;
  font-size: 9px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.26em;
  color: var(--muted);
}

.state-text {
  max-width: 480px;
  margin: 0;
  font-size: 13px;
  line-height: 1.7;
  color: var(--ink-soft);
  text-wrap: pretty;
}

.state-box .btn {
  margin-top: 16px;
}

/* =========================================================
   Galería
   ========================================================= */

.gallery {
  display: grid;
  grid-template-columns: repeat(var(--cols, 4), minmax(0, 1fr));
  gap: clamp(6px, 1.4vw, 18px);
  padding-top: 20px;
}

.cols-2 { --cols: 2; }
.cols-3 { --cols: 3; }
.cols-4 { --cols: 4; }
.cols-5 { --cols: 5; }
.cols-6 { --cols: 6; }

.piece-card {
  appearance: none;
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 0;
  border: 1px solid var(--line);
  background: var(--bone-2);
  color: var(--ink);
  text-align: left;
  overflow: hidden;
  transition: transform 0.5s var(--ease), border-color 0.3s var(--ease),
    background 0.3s var(--ease);
}

.piece-card:hover {
  transform: translateY(-3px);
  border-color: var(--bone-3);
  z-index: 2;
}

.piece-frame {
  display: grid;
  place-items: center;
  position: relative;
  aspect-ratio: 4 / 5;
  overflow: hidden;
  padding: clamp(6px, 1vw, 14px);
  background:
    linear-gradient(135deg, hsl(36 24% 91%), hsl(35 18% 84%));
}

.piece-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  transition: transform 0.7s var(--ease), filter 0.5s var(--ease);
}

.piece-card:hover .piece-img {
  transform: scale(1.025);
}

.piece-caption {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  display: grid;
  gap: 2px;
  padding: 16px 14px 14px;
  background: linear-gradient(to top, hsl(30 8% 8% / 0.82), transparent);
  color: var(--bone);
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.35s var(--ease), transform 0.35s var(--ease);
  pointer-events: none;
}

.piece-card:hover .piece-caption,
.piece-card:focus-visible .piece-caption {
  opacity: 1;
  transform: none;
}

.piece-index {
  font-size: 8px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  opacity: 0.65;
  font-variant-numeric: tabular-nums;
}

.piece-title {
  font-family: var(--font-display);
  font-size: clamp(12px, 1.1vw, 16px);
  font-weight: 400;
  line-height: 1.15;
  letter-spacing: -0.01em;
}

.piece-meta {
  font-size: 8px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  opacity: 0.72;
}

.review-mode .piece-card {
  border-color: transparent;
  background: transparent;
}

.review-mode .piece-card:hover {
  transform: none;
}

.review-mode .piece-frame {
  border: 1px solid var(--line);
}

.review-mode .piece-caption {
  position: static;
  opacity: 1;
  transform: none;
  background: transparent;
  color: var(--ink);
  padding: 10px 0 4px;
  pointer-events: auto;
}

.review-mode .piece-index {
  color: var(--muted);
  opacity: 1;
}

.review-mode .piece-title {
  font-size: clamp(13px, 1.2vw, 17px);
}

.review-mode .piece-meta {
  color: var(--muted);
  opacity: 1;
}

/* =========================================================
   Pie y barra de herramientas
   ========================================================= */

.site-footer {
  border-top: 1px solid var(--line);
  padding: 28px clamp(20px, 4vw, 48px);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--muted);
}

.site-footer p {
  margin: 0;
}

.site-footer strong {
  font-weight: 500;
  color: var(--ink-soft);
}

.toolbar {
  position: fixed;
  bottom: clamp(16px, 3vh, 32px);
  left: 50%;
  transform: translateX(-50%);
  z-index: 60;
  display: flex;
  align-items: center;
  gap: clamp(10px, 2vw, 24px);
  max-width: calc(100vw - 24px);
  padding: 10px 14px;
  background: hsl(38 33% 94% / 0.86);
  border: 1px solid var(--line);
  border-radius: 999px;
  box-shadow: 0 20px 50px hsl(30 20% 10% / 0.12);
  backdrop-filter: blur(18px);
  white-space: nowrap;
}

.tool-button {
  appearance: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  padding: 8px 10px;
  font-size: 9px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--ink-soft);
  transition: background 0.25s var(--ease), color 0.25s var(--ease);
}

.tool-button:hover {
  background: var(--bone-2);
}

.tool-button[aria-pressed='true'] {
  background: var(--ink);
  color: var(--bone);
}

.tool-icon {
  font-size: 13px;
  line-height: 1;
}

.tool-divider {
  width: 1px;
  height: 16px;
  background: var(--line);
  flex: 0 0 auto;
}

.tool-scale {
  display: flex;
  align-items: center;
  gap: 8px;
}

.tool-label {
  margin-right: 4px;
  font-size: 9px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--muted);
}

.scale-mark {
  font-size: 12px;
  color: var(--muted);
}

input[type='range'] {
  width: clamp(60px, 8vw, 105px);
  height: 2px;
  appearance: none;
  -webkit-appearance: none;
  background: var(--line);
  border-radius: 2px;
  accent-color: var(--ink);
  cursor: pointer;
}

input[type='range']::-webkit-slider-thumb {
  appearance: none;
  -webkit-appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--ink);
  border: 2px solid var(--bone);
  box-shadow: 0 0 0 1px var(--ink);
}

input[type='range']::-moz-range-thumb {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--ink);
  border: 2px solid var(--bone);
  box-shadow: 0 0 0 1px var(--ink);
}

/* =========================================================
   Toast
   ========================================================= */

.toast {
  position: fixed;
  left: 50%;
  bottom: 98px;
  transform: translateX(-50%);
  z-index: 70;
  display: flex;
  align-items: center;
  gap: 16px;
  max-width: calc(100vw - 32px);
  padding: 12px 14px 12px 18px;
  background: var(--ink);
  color: var(--bone);
  border-radius: 4px;
  box-shadow: 0 20px 60px hsl(30 30% 4% / 0.35);
  font-size: 11px;
  line-height: 1.5;
  transition: opacity 0.4s var(--ease), transform 0.4s var(--ease);
}

.toast p {
  margin: 0;
}

.toast.is-hiding {
  opacity: 0;
  transform: translate(-50%, 8px);
}

.toast-close {
  appearance: none;
  border: 0;
  background: transparent;
  color: inherit;
  padding: 4px;
  font-size: 13px;
  line-height: 1;
  opacity: 0.6;
}

.toast-close:hover {
  opacity: 1;
}

/* =========================================================
   Lightbox
   ========================================================= */

.lightbox {
  width: 100vw;
  max-width: none;
  height: 100vh;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: hsl(30 8% 6% / 0.96);
  color: var(--bone);
  overflow: hidden;
}

.lightbox::backdrop {
  background: hsl(30 8% 4% / 0.75);
  backdrop-filter: blur(12px);
}

.lightbox[open] {
  display: block;
  animation: fadeIn 0.35s var(--ease);
}

.lightbox-shell {
  height: 100%;
  display: grid;
  grid-template-rows: auto 1fr;
  padding: clamp(14px, 2vw, 28px);
}

.lightbox-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 12px;
}

.lightbox-count {
  margin: 0;
  font-size: 9px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.24em;
  color: hsl(38 33% 94% / 0.72);
  font-variant-numeric: tabular-nums;
}

.lightbox .icon-button {
  border-color: hsl(0 0% 100% / 0.2);
  color: var(--bone);
}

.lightbox .icon-button:hover {
  background: var(--bone);
  border-color: var(--bone);
  color: var(--ink);
}

.lightbox-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 360px);
  gap: clamp(16px, 3vw, 40px);
  min-height: 0;
  align-items: center;
}

.lightbox-stage {
  position: relative;
  height: 100%;
  min-height: 0;
  display: grid;
  place-items: center;
  overflow: auto;
  border: 1px solid hsl(0 0% 100% / 0.1);
  background: radial-gradient(circle at 50% 40%, hsl(0 0% 100% / 0.06), transparent 70%);
  padding: clamp(12px, 3vw, 40px);
}

.lightbox-img {
  max-width: 100%;
  max-height: calc(100vh - 160px);
  width: auto;
  height: auto;
  object-fit: contain;
  box-shadow: 0 30px 80px hsl(0 0% 0% / 0.5);
  transition: transform 0.5s var(--ease);
  cursor: zoom-in;
}

.lightbox-img.is-zoomed {
  max-height: none;
  width: min(100%, 1600px);
  cursor: zoom-out;
}

.nav-button {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid hsl(0 0% 100% / 0.2);
  background: hsl(30 8% 8% / 0.45);
  color: var(--bone);
  backdrop-filter: blur(8px);
  font-size: 16px;
  transition: background 0.25s var(--ease), color 0.25s var(--ease),
    opacity 0.25s var(--ease);
}

.nav-button:hover {
  background: var(--bone);
  color: var(--ink);
}

.nav-button:disabled {
  opacity: 0.2;
  cursor: default;
}

.nav-prev { left: 12px; }
.nav-next { right: 12px; }

.lightbox-panel {
  align-self: center;
  max-height: calc(100vh - 160px);
  overflow-y: auto;
  padding: clamp(20px, 3vw, 32px);
  border: 1px solid hsl(0 0% 100% / 0.12);
  background: hsl(38 33% 94% / 0.06);
  backdrop-filter: blur(16px);
}

.lightbox .kicker {
  color: hsl(38 33% 94% / 0.68);
}

.lightbox-title {
  margin: 8px 0 24px;
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 3vw, 2.8rem);
  font-weight: 300;
  line-height: 0.98;
  letter-spacing: -0.04em;
  color: var(--bone);
  text-wrap: balance;
}

.piece-data {
  display: grid;
  gap: 14px;
  margin: 0 0 24px;
  padding: 18px 0 0;
  border-top: 1px solid hsl(0 0% 100% / 0.12);
}

.piece-data div {
  display: grid;
  gap: 2px;
}

.piece-data dt {
  font-size: 8px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.22em;
  color: hsl(38 33% 94% / 0.66);
}

.piece-data dd {
  margin: 0;
  font-size: 13px;
  line-height: 1.5;
  color: hsl(38 33% 94% / 0.86);
}

.lightbox-note {
  margin: 0 0 20px;
  font-family: var(--font-display);
  font-size: 14px;
  font-style: italic;
  color: hsl(38 33% 94% / 0.55);
}

.lightbox-actions {
  margin-bottom: 16px;
}

.lightbox-hint {
  margin: 0;
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: hsl(38 33% 94% / 0.6);
}

/* =========================================================
   Modales
   ========================================================= */

.modal {
  width: calc(100% - 32px);
  max-width: 640px;
  margin: auto;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
}

.modal::backdrop {
  background: hsl(30 8% 6% / 0.6);
  backdrop-filter: blur(12px);
}

.modal[open] {
  animation: modalIn 0.4s var(--ease);
}

.modal-shell {
  position: relative;
  max-height: 85vh;
  overflow-y: auto;
  padding: clamp(28px, 5vw, 56px);
  background: var(--bone);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 36px;
  height: 36px;
  border-color: var(--line);
  color: var(--ink);
}

.modal-title {
  margin: 8px 0 28px;
  font-family: var(--font-display);
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 300;
  line-height: 0.96;
  letter-spacing: -0.045em;
  text-wrap: balance;
}

.modal-text {
  display: grid;
  gap: 14px;
  max-width: 52ch;
  font-size: 13px;
  line-height: 1.8;
  color: var(--ink-soft);
}

.modal-text p {
  margin: 0;
}

.modal-text strong {
  font-weight: 500;
  color: var(--ink);
}

.modal-footnote {
  margin-top: 8px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--muted);
}

/* =========================================================
   Animaciones
   ========================================================= */

@keyframes drift {
  0% {
    transform: translate3d(-2%, -1%, 0) scale(1.04) rotate(-1deg);
  }
  50% {
    transform: translate3d(2%, 1.5%, 0) scale(1.1) rotate(1deg);
  }
  100% {
    transform: translate3d(-1%, 2%, 0) scale(1.06) rotate(-0.5deg);
  }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes modalIn {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* =========================================================
   Responsive
   ========================================================= */

@media (max-width: 1100px) {
  .archive-intro {
    grid-template-columns: 1fr;
  }

  .archive-note {
    justify-self: start;
    max-width: 520px;
  }
}

@media (max-width: 900px) {
  .header-nav {
    gap: 12px;
  }

  .counter {
    display: none;
  }

  .lightbox-body {
    grid-template-columns: 1fr;
    align-items: start;
    overflow-y: auto;
  }

  .lightbox-stage {
    min-height: 46vh;
  }

  .lightbox-img {
    max-height: 48vh;
  }

  .lightbox-panel {
    max-height: none;
  }
}

@media (hover: none) {
  .piece-caption {
    opacity: 1;
    transform: none;
    background: linear-gradient(to top, hsl(30 8% 8% / 0.68), transparent 58%);
  }
}

@media (max-width: 640px) {
  .welcome {
    padding: 20px;
  }

  .welcome-top,
  .welcome-bottom {
    font-size: 8px;
    letter-spacing: 0.18em;
  }

  .hero-title {
    font-size: clamp(2.55rem, 12.5vw, 4rem);
    letter-spacing: -0.06em;
  }

  .welcome-lede {
    max-width: 310px;
    font-size: 12px;
  }

  .welcome-actions {
    margin-top: 28px;
  }

  .welcome-links {
    flex-direction: column;
    gap: 8px;
    font-size: 8px;
  }

  .welcome-links span[aria-hidden='true'] {
    display: none;
  }

  .welcome-bottom p:last-child {
    display: none;
  }

  .site-header {
    height: 64px;
    padding: 0 16px;
  }

  .wordmark {
    font-size: 17px;
  }

  .header-nav {
    gap: 12px;
  }

  .header-nav .link-button {
    font-size: 8px;
    letter-spacing: 0.14em;
  }

  .archive {
    padding: 32px 12px 140px;
  }

  .archive-title {
    font-size: 2.15rem;
  }

  .archive-note {
    font-size: 11px;
  }

  .archive-intro {
    gap: 14px;
    padding-bottom: 20px;
  }

  .gallery {
    --cols: 2 !important;
    gap: 6px;
  }

  .filter-bar {
    gap: 10px;
    padding: 14px 0;
  }

  .chip {
    padding: 7px 10px;
    font-size: 8px;
  }

  .review-prompt {
    padding: 14px 16px;
  }

  .review-question {
    font-size: 1.1rem;
  }

  .tool-scale,
  .tool-divider {
    display: none;
  }

  .toolbar {
    width: calc(100vw - 24px);
    justify-content: space-around;
    gap: 4px;
    bottom: 12px;
    padding: 8px 10px;
  }

  .tool-button {
    font-size: 8px;
    padding: 8px;
  }

  .site-footer {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
    padding: 20px 16px;
    font-size: 8px;
  }

  .toast {
    bottom: 78px;
    width: calc(100vw - 24px);
    font-size: 10px;
  }

  .lightbox-shell {
    padding: 10px;
  }

  .lightbox-stage {
    min-height: 44vh;
    max-height: 52vh;
    padding: 8px;
  }

  .lightbox-img {
    max-height: 46vh;
  }

  .lightbox-panel {
    padding: 18px;
  }

  .lightbox-title {
    font-size: 1.8rem;
  }

  .lightbox-hint {
    display: none;
  }

  .nav-button {
    width: 36px;
    height: 36px;
    font-size: 13px;
  }

  .nav-prev { left: 2px; }
  .nav-next { right: 2px; }

  .modal-shell {
    max-height: 88vh;
    padding: 28px 22px;
  }

  .modal-title {
    font-size: 2rem;
  }

  .modal-close {
    top: 10px;
    right: 10px;
  }
}

/* =========================================================
   Movimiento reducido
   ========================================================= */

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
