/* ============================================================
   GANBOA JEWELLERY — Boceto A · "El Taller" (columna: vero)
   Paleta: crema #f3f0ed · negro cálido #181615 · blanco #f8f8f8
   Tipografía: Newsreader (display) + Work Sans (cuerpo)
   ============================================================ */

:root {
  --crema: #f3f0ed;
  --negro: #181615;
  --blanco: #f8f8f8;
  --texto: #181615;
  --texto-secundario: #979696; /* uso SOLO sobre --negro (AA verificado) */
  --texto-sobre-negro: #f8f8f8;

  --font-display: "Newsreader", serif;
  --font-body: "Work Sans", sans-serif;

  --container: 1180px;
  --gap: clamp(1.25rem, 3vw, 2.5rem);
  --radius: 2px;
}

/* ---------- Reset base ---------- */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: auto; /* Lenis gestiona el scroll suave, nunca CSS smooth */
  -webkit-text-size-adjust: 100%;
}

body {
  background: var(--crema);
  color: var(--texto);
  font-family: var(--font-body);
  font-weight: 400;
  line-height: 1.5;
  overflow-x: hidden;
  min-width: 320px;
}

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

a {
  color: inherit;
}

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

ul {
  list-style: none;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* ---------- Tipografía general ---------- */
.eyebrow {
  display: block;
  font-family: var(--font-body);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  margin-bottom: 0.75rem;
}

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 500;
  line-height: 1.1;
}

.section-inner {
  max-width: var(--container);
  margin: 0 auto;
  padding: clamp(3.5rem, 9vw, 7rem) 1.25rem;
}

/* ============================================================
   NAV
   ============================================================ */
.site-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: rgba(24, 22, 21, 0.78);
  color: var(--texto-sobre-negro);
  /* Sin backdrop-filter a propósito: en un ancestro de un position:fixed (.nav-menu,
     el overlay del menú móvil) crea un containing block nuevo y el overlay se
     colapsa a la altura del propio header en vez de ocupar el viewport. */
}

/* Costura 3→4 (quienes→capítulo): inversión de tema abrupta.
   body.sobre-tema-oscuro la añade script.js vía ScrollTrigger toggleClass
   mientras se cruzan las secciones "capitulo" (fondo negro cálido). */
body.sobre-tema-oscuro .site-nav {
  background: rgba(248, 248, 248, 0.1);
}

.nav-inner {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0.9rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-mark {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1.15rem;
  letter-spacing: 0.02em;
}

.nav-toggle {
  background: none;
  border: 1px solid rgba(248, 248, 248, 0.4);
  color: var(--texto-sobre-negro);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.45rem 0.9rem;
  border-radius: 999px;
  min-height: 44px;
}

.nav-menu {
  position: fixed;
  inset: 0;
  top: 0;
  background: var(--negro);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.75rem;
  transform: translateY(-100%);
  transition: transform 0.45s cubic-bezier(0.65, 0, 0.35, 1);
  z-index: 99;
}

.nav-menu.is-open {
  transform: translateY(0);
}

.nav-menu a {
  font-family: var(--font-display);
  font-style: italic;
  font-size: clamp(1.5rem, 5vw, 2.25rem);
  color: var(--texto-sobre-negro);
  text-decoration: none;
}

.nav-close {
  position: absolute;
  top: 1.1rem;
  right: 1.25rem;
  background: none;
  border: none;
  color: var(--texto-sobre-negro);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

@media (min-width: 860px) {
  .nav-toggle,
  .nav-close {
    display: none;
  }

  .nav-menu {
    position: static;
    inset: auto;
    background: none;
    flex-direction: row;
    transform: none;
    transition: none;
    gap: clamp(1.25rem, 2.5vw, 2.25rem);
  }

  .nav-menu a {
    font-family: var(--font-body);
    font-style: normal;
    font-size: 0.85rem;
    letter-spacing: 0.03em;
  }
}

/* ============================================================
   1 · HERO — data-rol="hero"
   ============================================================ */
.section-hero {
  position: relative;
  min-height: 100svh;
  display: flex;
  align-items: flex-end;
  overflow: hidden;
  background: var(--negro);
}

.hero-media {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 62% 35%;
  filter: grayscale(0.15) contrast(1.05);
}

.hero-scrim {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(24,22,21,0.35) 0%, rgba(24,22,21,0.15) 30%, rgba(24,22,21,0.55) 78%, rgba(24,22,21,0.92) 100%);
}

.hero-content {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 6rem 1.25rem 3.5rem;
  text-align: center;
  color: var(--texto-sobre-negro);
}

.hero-title {
  font-size: clamp(3.6rem, 17vw, 11rem);
  font-style: italic;
  font-weight: 500;
  letter-spacing: -0.01em;
  line-height: 0.95;
  text-shadow: 0 6px 40px rgba(0,0,0,0.35);
}

.hero-tagline {
  margin-top: 1.1rem;
  font-family: var(--font-display);
  font-style: italic;
  font-size: clamp(1rem, 2.4vw, 1.35rem);
  color: var(--texto-sobre-negro);
  opacity: 0.92;
}

.hero-scrolldown {
  position: absolute;
  z-index: 2;
  left: 50%;
  bottom: 1.5rem;
  transform: translateX(-50%);
  color: var(--texto-sobre-negro);
  font-size: 0.68rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  opacity: 0.75;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}

.hero-scrolldown span {
  width: 1px;
  height: 34px;
  background: currentColor;
  opacity: 0.6;
}

/* ============================================================
   2 · OFERTA — data-rol="oferta" (canvas-secuencia, pieza insignia)
   ============================================================ */
.section-oferta {
  background: var(--crema);
  position: relative;
}

.oferta-intro {
  max-width: 640px;
  margin: 0 auto;
  padding: clamp(3.5rem, 9vw, 6rem) 1.25rem 2rem;
  text-align: center;
}

.oferta-intro .manifesto-quote {
  font-family: var(--font-display);
  font-style: italic;
  font-size: clamp(1.35rem, 3.6vw, 2.1rem);
  line-height: 1.35;
  color: var(--texto);
}

.canvas-secuencia {
  position: relative;
  height: 320vh;
}

.canvas-pin {
  position: sticky;
  top: 0;
  height: 100svh;
  overflow: hidden;
}

.cs-img {
  /* opacidad inicial 0 la fija SOLO script.js (gsap.set) — si el CDN de
     GSAP fallase, estas imágenes deben seguir visibles por defecto */
  position: absolute;
  width: 40%;
  max-width: 460px;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: var(--radius);
  box-shadow: 0 30px 70px rgba(24, 22, 21, 0.25);
  will-change: transform, opacity;
}

@media (max-width: 640px) {
  .cs-img {
    width: 58%;
    max-width: 300px;
  }
}

/* ============================================================
   3 · QUIENES — data-rol="quienes"
   ============================================================ */
.section-quienes {
  background: var(--crema);
}

.quienes-ventana {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2.25rem;
  align-items: center;
  padding-bottom: clamp(3rem, 7vw, 5rem);
}

.ventana-media-frame {
  /* visible por defecto (sin JS); script.js añade .is-hidden-init al
     cargar y lo retira al entrar en viewport para animar el reveal */
  overflow: hidden;
  border-radius: var(--radius);
  aspect-ratio: 4 / 5;
  clip-path: circle(75% at 50% 50%);
  transition: clip-path 1.1s cubic-bezier(0.16, 1, 0.3, 1);
}

.ventana-media-frame.is-hidden-init {
  clip-path: circle(0% at 50% 50%);
}

.ventana-media-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.quienes-text h2 {
  font-size: clamp(1.75rem, 4vw, 2.4rem);
  font-style: italic;
  margin-bottom: 1rem;
}

.quienes-text p {
  max-width: 46ch;
  font-size: 1.02rem;
  color: var(--texto);
}

@media (min-width: 760px) {
  .quienes-ventana {
    grid-template-columns: 0.9fr 1.1fr;
    gap: 3.5rem;
  }

  .ventana-media-frame {
    max-width: 420px;
  }
}

/* Carrusel horizontal — firma compositiva */
.carrusel-horizontal {
  border-top: 1px solid rgba(24, 22, 21, 0.12);
  padding-top: clamp(2rem, 5vw, 3rem);
}

.carrusel-eyebrow {
  padding: 0 1.25rem;
  max-width: var(--container);
  margin: 0 auto 1.25rem;
}

.carrusel-track {
  display: flex;
  gap: 1.1rem;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding: 0 1.25rem clamp(1.5rem, 4vw, 2.5rem);
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}

.carrusel-track::-webkit-scrollbar {
  height: 6px;
}

.carrusel-track::-webkit-scrollbar-thumb {
  background: rgba(24, 22, 21, 0.25);
  border-radius: 999px;
}

.carrusel-item {
  /* estado oculto inicial lo fija script.js; visible por defecto sin JS */
  flex: 0 0 auto;
  width: min(62vw, 260px);
  scroll-snap-align: start;
}

.carrusel-item img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: var(--radius);
  background: var(--blanco);
}

.carrusel-item figcaption {
  margin-top: 0.6rem;
  font-size: 0.78rem;
  letter-spacing: 0.02em;
  color: var(--texto);
}

/* ============================================================
   CAPITULO — data-rol="capitulo" (manifiestos, tema oscuro)
   ============================================================ */
.section-capitulo {
  background: var(--negro);
  color: var(--texto-sobre-negro);
  min-height: 62vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: clamp(3rem, 8vw, 5rem) 1.25rem;
}

.manifesto-reveal {
  max-width: 20ch;
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 400;
  font-size: clamp(1.7rem, 5.2vw, 3.1rem);
  line-height: 1.25;
}

.manifesto-reveal .word {
  display: inline-block;
  color: var(--texto-secundario); /* AA sobre negro: 6:1 */
}

.capitulo-cita {
  display: block;
  margin-top: 1.5rem;
  font-family: var(--font-body);
  font-size: 0.78rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--texto-secundario);
}

.section-capitulo.cierre {
  flex-direction: column;
  gap: 2.25rem;
  padding-top: clamp(4rem, 10vw, 6rem);
}

.cierre-ventana .medallon {
  width: clamp(160px, 32vw, 240px);
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 50%;
  box-shadow: 0 20px 60px rgba(0,0,0,0.4);
}

/* ============================================================
   5 · PROCESO — data-rol="proceso" (bento)
   ============================================================ */
.section-proceso {
  background: var(--crema);
}

.bento-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
}

@media (min-width: 780px) {
  .bento-grid {
    grid-template-columns: 1fr 1.2fr;
    gap: 1.75rem;
  }
}

.bento-card {
  background: var(--blanco);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.bento-card img {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
}

.bento-content {
  padding: clamp(1.5rem, 3.2vw, 2.25rem);
}

.bento-content h2 {
  font-size: clamp(1.4rem, 3vw, 1.85rem);
  font-style: italic;
  margin-bottom: 0.85rem;
}

.bento-content p {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1.02rem;
  line-height: 1.5;
}

.bitxiando-facts {
  display: grid;
  gap: 0.5rem;
  margin: 1rem 0 1.4rem;
  font-size: 0.92rem;
}

.bitxiando-facts li {
  padding-left: 1rem;
  position: relative;
}

.bitxiando-facts li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.55em;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--texto);
}

.bento-bitxiando blockquote {
  border-left: 2px solid rgba(24,22,21,0.18);
  padding-left: 1rem;
  font-family: var(--font-display);
  font-style: italic;
  font-size: 0.98rem;
  line-height: 1.5;
}

.bento-bitxiando cite {
  display: block;
  margin-top: 0.5rem;
  font-family: var(--font-body);
  font-style: normal;
  font-size: 0.76rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

/* ============================================================
   7 · OBRA — data-rol="obra" (parrilla)
   ============================================================ */
.section-obra {
  background: var(--blanco);
}

.obra-intro {
  text-align: center;
  max-width: 620px;
  margin: 0 auto;
  padding-bottom: clamp(2.5rem, 6vw, 4rem);
}

.obra-intro h2 {
  font-size: clamp(1.9rem, 4.4vw, 2.75rem);
  font-style: italic;
}

.obra-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: clamp(0.75rem, 2vw, 1.5rem);
}

.obra-grid figure {
  overflow: hidden;
  border-radius: var(--radius);
}

.obra-grid img {
  width: 100%;
  height: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  transition: transform 0.6s cubic-bezier(0.16,1,0.3,1);
}

.obra-grid a:hover img,
.obra-grid figure:hover img {
  transform: scale(1.04);
}

@media (min-width: 620px) {
  .obra-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (min-width: 980px) {
  .obra-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* ============================================================
   FOOTER — data-rol="footer" (wordmark monumental)
   ============================================================ */
.site-footer {
  background: var(--negro);
  color: var(--texto-sobre-negro);
  overflow: hidden;
}

.footer-wordmark-wrap {
  padding: clamp(2rem, 6vw, 4rem) 1.25rem 0;
  text-align: center;
  overflow: hidden;
}

.footer-wordmark {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 400;
  font-size: clamp(3.4rem, 17vw, 12rem);
  line-height: 0.9;
  letter-spacing: 0;
  color: var(--texto-sobre-negro);
  white-space: nowrap;
}

.footer-grid {
  max-width: var(--container);
  margin: 0 auto;
  padding: clamp(2.5rem, 6vw, 4rem) 1.25rem;
  display: grid;
  grid-template-columns: 1fr;
  gap: 2.5rem;
  border-top: 1px solid rgba(248,248,248,0.14);
}

@media (min-width: 760px) {
  .footer-grid {
    grid-template-columns: 1.2fr 1fr;
  }
}

.footer-probador h2,
.footer-contacto h2 {
  font-size: clamp(1.35rem, 2.8vw, 1.75rem);
  font-style: italic;
  margin-bottom: 0.85rem;
}

.footer-probador p {
  color: var(--texto-secundario);
  max-width: 46ch;
  margin-bottom: 1.25rem;
}

.btn-probador {
  background: var(--texto-sobre-negro);
  color: var(--negro);
  border: none;
  padding: 0.85rem 1.5rem;
  border-radius: 999px;
  font-size: 0.85rem;
  letter-spacing: 0.03em;
  font-weight: 600;
}

.btn-probador:hover {
  background: var(--crema);
}

.btn-probador--principal {
  background: var(--terracota-probador, var(--texto-sobre-negro));
}

.btn-probador:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.probador-tool {
  display: grid;
  gap: 1.5rem;
  max-width: 30rem;
}

.probador-lienzo-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  background: rgba(248, 248, 248, 0.06);
  border: 1px solid rgba(248, 248, 248, 0.18);
  border-radius: 4px;
  overflow: hidden;
  touch-action: none;
}

#probadorCanvas {
  width: 100%;
  height: 100%;
  display: block;
  cursor: grab;
}

#probadorCanvas:active {
  cursor: grabbing;
}

.probador-vacio {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 2rem;
  font-size: 0.85rem;
  color: var(--texto-secundario);
  pointer-events: none;
  margin: 0;
}

.probador-vacio[hidden] {
  display: none;
}

.probador-subir {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.25rem;
  border: 1px solid rgba(248, 248, 248, 0.4);
  border-radius: 999px;
  font-size: 0.8rem;
  letter-spacing: 0.03em;
  cursor: pointer;
  width: fit-content;
  min-height: 44px;
}

.probador-subir input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

.probador-piezas {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin: 1rem 0;
}

.pieza-btn {
  width: 3.25rem;
  height: 3.25rem;
  border-radius: 50%;
  overflow: hidden;
  border: 2px solid transparent;
  padding: 0;
  opacity: 0.7;
  transition: opacity 0.2s ease, border-color 0.2s ease;
}

.pieza-btn img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.pieza-btn:hover {
  opacity: 1;
}

.pieza-btn.is-activa {
  opacity: 1;
  border-color: var(--texto-sobre-negro);
}

.probador-ayuda {
  font-size: 0.78rem;
  color: var(--texto-secundario);
  max-width: 34ch;
  margin-bottom: 1.25rem;
}

.probador-acciones {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.footer-contacto a {
  display: block;
  text-decoration: none;
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1.35rem;
  margin-bottom: 0.5rem;
}

.footer-contacto a:hover {
  color: var(--texto-secundario);
}

.footer-contacto p {
  color: var(--texto-secundario);
  font-size: 0.92rem;
  margin-top: 0.75rem;
}

.footer-bottom {
  border-top: 1px solid rgba(248,248,248,0.14);
  padding: 1.25rem;
  text-align: center;
}

.footer-legal {
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  color: var(--texto-secundario);
}

/* ============================================================
   Utilidades de motion (estado inicial via JS, fallback visible)
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}
