/* ============================================================
   TOKENS DE DISEÑO
   Cambia los colores aquí si en algún momento quieres ajustar
   la paleta — se aplicará en toda la web automáticamente.
   ============================================================ */

:root {
  /* --- Modo claro (por defecto) --- */
  --bg: #fafaf9;
  --surface: #ffffff;
  --texto: #161614;
  --texto-tenue: #6f6f69;
  --borde: #e3e2dd;
  --acento: #c8312a;
  --acento-suave: #c8312a14;
  --sombra: 0 1px 2px rgba(20, 20, 18, 0.04);

  /* --- Tipografía --- */
  --fuente-display: 'Space Grotesk', sans-serif;
  --fuente-texto: 'Inter', sans-serif;
  --fuente-mono: 'IBM Plex Mono', monospace;

  --radio: 2px;
}

[data-theme='dark'] {
  --bg: #131312;
  --surface: #1b1b19;
  --texto: #f1f0ec;
  --texto-tenue: #9d9c95;
  --borde: #2d2c29;
  --acento: #ff5b4d;
  --acento-suave: #ff5b4d1f;
  --sombra: 0 1px 2px rgba(0, 0, 0, 0.3);
}

/* ============================================================
   BASE
   ============================================================ */

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--texto);
  font-family: var(--fuente-texto);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  transition: background-color 0.25s ease, color 0.25s ease;
}

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

a { color: inherit; }

h1, h2, h3 {
  font-family: var(--fuente-display);
  font-weight: 600;
  letter-spacing: -0.01em;
  margin: 0;
}

button {
  font-family: inherit;
  cursor: pointer;
}

::selection { background: var(--acento-suave); color: var(--texto); }

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

.envoltura {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 28px;
}

/* ============================================================
   MARCA DE REGISTRO (elemento de firma visual)
   Inspirada en las crucetas de registro de imprenta.
   ============================================================ */

.marca-registro {
  width: 1em;
  height: 1em;
  flex-shrink: 0;
}
.marca-registro circle,
.marca-registro line {
  stroke: currentColor;
  stroke-width: 1.4;
  fill: none;
}

/* ============================================================
   CABECERA
   ============================================================ */

.cabecera {
  position: sticky;
  top: 0;
  z-index: 40;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--borde);
}

.cabecera .envoltura {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
}

.marca {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--fuente-display);
  font-size: 1.05rem;
  font-weight: 600;
  text-decoration: none;
}
.marca .marca-registro { width: 22px; height: 22px; color: var(--acento); }

.nav-principal {
  display: flex;
  align-items: center;
  gap: 28px;
}
.nav-principal a {
  text-decoration: none;
  font-size: 0.92rem;
  color: var(--texto-tenue);
}
.nav-principal a:hover { color: var(--texto); }

.boton-tema {
  background: none;
  border: 1px solid var(--borde);
  border-radius: 999px;
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  color: var(--texto);
}
.boton-tema svg { width: 17px; height: 17px; stroke: currentColor; stroke-width: 1.6; fill: none; }
.boton-tema .icono-luna { display: none; }
[data-theme='dark'] .boton-tema .icono-sol { display: none; }
[data-theme='dark'] .boton-tema .icono-luna { display: block; }

/* ============================================================
   HERO
   ============================================================ */

.hero {
  padding: 84px 0 56px;
  border-bottom: 1px solid var(--borde);
}
.hero .eyebrow {
  font-family: var(--fuente-mono);
  font-size: 0.74rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--acento);
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 18px;
}
.hero h1 {
  font-size: clamp(2.1rem, 4.5vw, 3.4rem);
  max-width: 16ch;
  line-height: 1.08;
}
.hero p {
  margin-top: 18px;
  max-width: 46ch;
  color: var(--texto-tenue);
  font-size: 1.05rem;
}

/* ============================================================
   FILTROS
   ============================================================ */

.filtros {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  padding: 28px 0;
}
.filtro {
  font-family: var(--fuente-mono);
  font-size: 0.78rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  background: var(--surface);
  border: 1px solid var(--borde);
  color: var(--texto-tenue);
  padding: 7px 14px;
  border-radius: 999px;
}
.filtro:hover { color: var(--texto); }
.filtro.activo {
  background: var(--texto);
  color: var(--bg);
  border-color: var(--texto);
}

/* ============================================================
   GALERÍA
   ============================================================ */

.galeria {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
  padding: 8px 0 80px;
}
@media (max-width: 900px) {
  .galeria { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 600px) {
  .galeria { grid-template-columns: 1fr; }
}

.tarjeta {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--borde);
  border-radius: var(--radio);
  overflow: hidden;
  cursor: pointer;
  text-align: left;
  padding: 0;
  width: 100%;
  display: block;
  box-shadow: var(--sombra);
  transition: transform 0.18s ease, border-color 0.18s ease;
}
.tarjeta:hover { transform: translateY(-3px); border-color: var(--acento); }

.tarjeta .marco-imagen {
  aspect-ratio: 4 / 3.1;
  overflow: hidden;
  background: var(--bg);
}
.tarjeta .marco-imagen img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.35s ease;
}
.tarjeta:hover .marco-imagen img { transform: scale(1.04); }

.tarjeta .esquina-marca {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 16px;
  height: 16px;
  color: #fff;
  opacity: 0;
  transition: opacity 0.18s ease;
  filter: drop-shadow(0 1px 2px rgba(0,0,0,0.5));
}
.tarjeta:hover .esquina-marca { opacity: 0.85; }

.tarjeta .info {
  padding: 16px 18px 18px;
}
.tarjeta .categoria {
  font-family: var(--fuente-mono);
  font-size: 0.7rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--acento);
}
.tarjeta h3 {
  font-size: 1.05rem;
  margin-top: 6px;
}

.estado-vacio {
  border: 1px dashed var(--borde);
  border-radius: var(--radio);
  padding: 60px 30px;
  text-align: center;
  color: var(--texto-tenue);
  font-family: var(--fuente-mono);
  font-size: 0.85rem;
}

/* ============================================================
   LIGHTBOX
   ============================================================ */

.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(10, 10, 9, 0.85);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 24px;
}
.lightbox.abierto { display: flex; }

.lightbox-contenido {
  background: var(--surface);
  max-width: 920px;
  width: 100%;
  max-height: 88vh;
  overflow: auto;
  border-radius: var(--radio);
  position: relative;
}
.lightbox-contenido img {
  width: 100%;
  display: block;
}
.lightbox-texto { padding: 22px 26px 28px; }
.lightbox-texto .categoria {
  font-family: var(--fuente-mono);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--acento);
}
.lightbox-texto h3 { font-size: 1.3rem; margin-top: 8px; }
.lightbox-texto p { color: var(--texto-tenue); margin-top: 10px; }

.lightbox-cerrar {
  position: absolute;
  top: 14px;
  right: 14px;
  background: var(--bg);
  border: 1px solid var(--borde);
  border-radius: 999px;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  color: var(--texto);
  font-size: 1.1rem;
  line-height: 1;
}

/* ============================================================
   PIE DE PÁGINA
   ============================================================ */

.pie {
  border-top: 1px solid var(--borde);
  padding: 36px 0 46px;
}
.pie .envoltura {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: center;
  justify-content: space-between;
}
.pie-contacto {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
}
.pie-contacto a { text-decoration: none; font-size: 0.9rem; color: var(--texto-tenue); }
.pie-contacto a:hover { color: var(--texto); }
.pie-firma {
  font-family: var(--fuente-mono);
  font-size: 0.74rem;
  color: var(--texto-tenue);
  display: flex;
  align-items: center;
  gap: 7px;
}
.pie-firma .marca-registro { width: 13px; height: 13px; }

@media (max-width: 640px) {
  .nav-principal a:not(.boton-tema-envoltura) { display: none; }
  .hero { padding: 56px 0 36px; }
}
