/* ==========================================================================
   GRACIA ESTUDIO CREATIVO — hoja de estilos global
   ========================================================================== */

:root {
  --black: #0a0a0a;
  --white: #ffffff;
  --magenta: #d247b6;
  --grey: #9a9a9a;
  --grey-light: #e5e5e2;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --nav-h: 88px;
  /* Cuántas miniaturas se ven por stripe a la vez. Subir este número a
     medida que haya más proyectos, hasta que los stripes lleguen borde
     a borde de la pantalla. */
  --stripe-visible: 2;
  --stripe-gap: clamp(10px, 2.4vw, 20px);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  overflow-x: hidden;
}

body {
  background: var(--white);
  color: var(--black);
  font-family: -apple-system, BlinkMacSystemFont, "Helvetica Neue", Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  cursor: url("../assets/cursor/cursor-g.png") 7 7, auto;
}
a, button, [role="button"], input, textarea, select, label {
  cursor: url("../assets/cursor/cursor-g.png") 7 7, pointer;
}

a { color: inherit; text-decoration: none; }
img, svg, video { display: block; max-width: 100%; }
button { font-family: inherit; }

/* Page fade transition wrapper */
body.is-transitioning::after {
  content: "";
  position: fixed;
  inset: 0;
  background: var(--white);
  z-index: 9999;
  animation: fadeInWhite 0.5s var(--ease) forwards;
  pointer-events: none;
}
body.page-enter::before {
  content: "";
  position: fixed;
  inset: 0;
  background: var(--white);
  z-index: 9998;
  animation: fadeOutWhite 0.6s var(--ease) forwards;
  pointer-events: none;
}
@keyframes fadeInWhite { from { opacity: 0; } to { opacity: 1; } }
@keyframes fadeOutWhite { from { opacity: 1; } to { opacity: 0; } }

/* ==========================================================================
   Navegación mínima compartida
   ========================================================================== */

.site-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 clamp(20px, 4vw, 48px);
  z-index: 500;
  mix-blend-mode: difference;
}
.site-nav--end { justify-content: flex-end; }
.site-nav__links { display: flex; gap: clamp(16px, 2vw, 32px); }
.site-nav__links a {
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--white);
  opacity: 0.8;
  transition: opacity 0.25s var(--ease);
}
.site-nav__links a:hover { opacity: 1; }

/* ==========================================================================
   INTRO / index.html
   ========================================================================== */

.intro {
  height: 100dvh;
  width: 100%;
  background: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.intro__stage {
  width: min(46vw, 620px);
  position: relative;
  opacity: 0;
  transform: scale(0.94);
  transition: opacity 1.1s var(--ease), transform 1.1s var(--ease);
}
.intro__stage.is-visible { opacity: 1; transform: scale(1); }

.intro__video,
.intro__poster {
  width: 100%;
  height: auto;
  display: block;
}
.intro__poster {
  opacity: 1;
  transition: opacity 0.4s ease;
}
.intro__stage.has-video .intro__poster {
  opacity: 0;
}
.intro__video {
  position: absolute;
  inset: 0;
  height: 100%;
  opacity: 0;
}
.intro__video.is-active {
  opacity: 1;
}

.intro__hint {
  position: absolute;
  bottom: clamp(28px, 6vh, 64px);
  left: 50%;
  transform: translateX(-50%);
  max-width: min(90vw, 520px);
  padding: 0 20px;
  text-align: center;
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--black);
  opacity: 0;
  animation: introHint 2.4s var(--ease) 1.6s forwards;
}
@keyframes introHint { to { opacity: 0.55; } }

/* ==========================================================================
   WORK / work.html — stripes horizontales
   ========================================================================== */

.work {
  height: 100dvh;
  width: 100%;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  gap: 0;
  overflow: hidden;
  position: relative;
  background: var(--white);
  padding-top: var(--nav-h);
  padding-bottom: 0;
  /* Peso visual: los thumbnails deben pesar más que el texto (60% / 40%). */
  --content-h: calc(100dvh - var(--nav-h));
  --stripes-row-gap: clamp(10px, 1.8vh, 22px);
  --stripe-item-h-by-height: calc((var(--content-h) * 0.6 - var(--stripes-row-gap)) / 2);
  /* en pantallas angostas y altas, el 16:9 derivado del alto se saldría de
     lado a lado: se limita también por ancho para que sigan cabiendo
     exactamente --stripe-visible miniaturas sin desbordar. */
  --stripe-max-item-w: calc((100vw - 32px - var(--stripe-gap) * (var(--stripe-visible) - 1)) / var(--stripe-visible));
  --stripe-item-w: min(calc(var(--stripe-item-h-by-height) * 16 / 9), var(--stripe-max-item-w));
  --stripe-item-h: calc(var(--stripe-item-w) * 9 / 16);
}

.stripes {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--stripes-row-gap);
  height: calc(var(--content-h) * 0.6);
  flex: 0 0 auto;
  touch-action: pan-y;
}

.stripe {
  overflow: hidden;
  width: calc(var(--stripe-item-w) * var(--stripe-visible) + var(--stripe-gap) * (var(--stripe-visible) - 1));
  height: var(--stripe-item-h);
  margin: 0 auto;
}

.stripe__track {
  display: flex;
  height: 100%;
  gap: var(--stripe-gap);
  will-change: transform;
  width: max-content;
}

.stripe__item {
  position: relative;
  flex: 0 0 auto;
  width: var(--stripe-item-w);
  height: 100%;
  overflow: hidden;
  background: var(--grey-light);
}
.stripe__item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s var(--ease);
}
.stripe__item:hover img { transform: scale(1.045); }

.stripe__item-label {
  position: absolute;
  left: 14px;
  bottom: 12px;
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--white);
  mix-blend-mode: difference;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.3s var(--ease), transform 0.3s var(--ease);
}
.stripe__item:hover .stripe__item-label { opacity: 1; transform: translateY(0); }

.work__brand {
  flex: 0 0 auto;
  height: calc(var(--content-h) * 0.4);
  display: flex;
  align-items: flex-end;
  min-height: 0;
  padding: 0;
  overflow: visible;
}

.work__brand-btn {
  display: block;
  width: 100%;
  border: 0;
  background: none;
  padding: 0;
  text-align: left;
}

.work__brand-text {
  display: inline-block;
  width: max-content;
  max-width: none;
  white-space: nowrap;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 0.82;
  color: var(--black);
  transform-origin: left bottom;
}

.work__scroll-note {
  display: none;
}

/* ==========================================================================
   PROJECT / project.html
   ========================================================================== */

.project {
  min-height: 100dvh;
  padding-top: var(--nav-h);
  background: var(--white);
}

.project__back {
  position: fixed;
  left: clamp(20px, 4vw, 48px);
  top: 0;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  z-index: 600;
  color: var(--black);
  mix-blend-mode: normal;
}

.project__header {
  padding: clamp(16px, 3vh, 32px) clamp(20px, 5vw, 64px) clamp(24px, 4vh, 40px);
  max-width: 760px;
  margin: 0 auto;
}
.project__eyebrow {
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--magenta);
  margin: 0 0 12px;
}
.project__title {
  font-size: clamp(1.6rem, 4vw, 2.6rem);
  font-weight: 800;
  line-height: 1.05;
  margin: 0 0 14px;
  letter-spacing: -0.01em;
}
.project__summary {
  font-size: clamp(0.9rem, 1.1vw, 1rem);
  line-height: 1.55;
  max-width: 560px;
  color: #333;
}

.project__video-wrap {
  width: 100%;
  max-width: 640px;
  margin: 0 auto;
  padding: 0 clamp(20px, 5vw, 64px);
  position: relative;
}
.project__video {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #111;
  overflow: hidden;
}
.project__video iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}
.project__video-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 10px;
  color: var(--white);
  background: #161616;
}
.project__video-placeholder span {
  font-size: 12px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  opacity: 0.75;
}

.project__expand-btn {
  position: absolute;
  top: 10px;
  right: calc(clamp(20px, 5vw, 64px) + 10px);
  z-index: 20;
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.55);
  color: var(--white);
  font-size: 14px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.8;
  transition: opacity 0.2s ease, transform 0.2s ease;
}
.project__expand-btn:hover { opacity: 1; transform: scale(1.08); }

.project__video-wrap.is-expanded {
  position: fixed;
  inset: 0;
  max-width: none;
  z-index: 3000;
  padding: clamp(16px, 5vw, 64px);
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(8, 8, 8, 0.94);
}
.project__video-wrap.is-expanded .project__video {
  width: min(1200px, 100%);
  max-height: 88vh;
}
.project__video-wrap.is-expanded .project__expand-btn {
  top: clamp(16px, 5vw, 64px);
  right: clamp(16px, 5vw, 64px);
}

.project__body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) clamp(130px, 16vw, 170px);
  gap: clamp(16px, 3vw, 32px);
  max-width: 760px;
  margin: 0 auto;
  padding: clamp(32px, 6vh, 64px) clamp(20px, 5vw, 64px) clamp(60px, 10vh, 120px);
  align-items: start;
}

.project__mosaic {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(6px, 1vw, 12px);
  list-style: none;
  margin: 0;
  padding: 0;
}
.project__mosaic li {
  aspect-ratio: 16 / 9;
  overflow: hidden;
  cursor: url("../assets/cursor/cursor-g.png") 7 7, zoom-in;
}
.project__mosaic img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s var(--ease);
}
.project__mosaic li:hover img { transform: scale(1.06); }
.project__mosaic:empty { display: none; }
.project__body:has(.project__mosaic:empty) { grid-template-columns: 1fr; }

.project__credits {
  padding-top: 4px;
  min-width: 0;
}
.project__credits h2 {
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  margin: 0 0 14px;
  color: var(--grey);
}
.project__credits-col {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.project__credits-col dl {
  margin: 0;
  font-size: 11.5px;
  line-height: 1.35;
  letter-spacing: 0.01em;
}
.project__credits-col dt {
  color: var(--grey);
  font-weight: 400;
  margin: 0;
  text-transform: uppercase;
  font-size: 10px;
  letter-spacing: 0.06em;
}
.project__credits-col dd { margin: 2px 0 0; font-weight: 600; }

@media (max-width: 720px) {
  .project__body { grid-template-columns: 1fr; }
  .project__mosaic { grid-template-columns: repeat(3, 1fr); }
}

/* ---- Lightbox (stills) ---- */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 4000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 5vw;
  background: rgba(8, 8, 8, 0.94);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}
.lightbox.is-visible { opacity: 1; pointer-events: auto; }
.lightbox img {
  max-width: 100%;
  max-height: 90vh;
  width: auto;
  height: auto;
  object-fit: contain;
}
.lightbox__close {
  position: absolute;
  top: clamp(16px, 4vw, 40px);
  right: clamp(16px, 4vw, 40px);
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  color: var(--white);
  font-size: 15px;
}

/* ==========================================================================
   INFO / info.html
   ========================================================================== */

.info {
  height: 100dvh;
  width: 100%;
  background: var(--white);
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(24px, 6vw, 80px);
}

.info__content {
  position: relative;
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(20px, 4vh, 40px);
}

.info__text {
  max-width: 15ch;
  font-size: clamp(2rem, 5.4vw, 4.6rem);
  font-weight: 500;
  line-height: 1.08;
  letter-spacing: -0.01em;
  text-align: center;
  color: var(--black);
  margin: 0;
}
.info__text em { font-style: italic; font-weight: 400; }

.info__scramble {
  margin: 0;
  min-width: 14ch;
  font-family: "SF Mono", "JetBrains Mono", ui-monospace, Menlo, Consolas, monospace;
  font-size: clamp(0.85rem, 1.6vw, 1.1rem);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-align: center;
  color: var(--magenta);
}
.info__scramble .scramble-char { opacity: 0.65; }

.info__floaters {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
}

.info__floater {
  position: absolute;
  width: clamp(140px, 16vw, 230px);
  aspect-ratio: 1 / 1;
  opacity: 0;
  transform: scale(0.85);
  transition: opacity 0.45s var(--ease), transform 0.45s var(--ease);
}
.info__floater.is-visible { opacity: 1; transform: scale(1); }
.info__floater video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: transparent;
}

.info__back {
  position: fixed;
  left: clamp(20px, 4vw, 48px);
  top: clamp(20px, 4vh, 32px);
  z-index: 20;
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.info__contact {
  position: fixed;
  right: clamp(20px, 4vw, 48px);
  bottom: clamp(20px, 4vh, 32px);
  z-index: 20;
  margin: 0;
  font-size: 12px;
  letter-spacing: 0.08em;
  display: flex;
  align-items: center;
  height: 18px;
}
.info__contact a { color: var(--magenta); opacity: 0.85; transition: opacity 0.25s ease; }
.info__contact a:hover { opacity: 1; }

.info__social {
  position: fixed;
  left: clamp(20px, 4vw, 48px);
  bottom: clamp(20px, 4vh, 32px);
  z-index: 20;
  display: flex;
  align-items: center;
  height: 18px;
  gap: 16px;
}
.info__social a {
  color: var(--magenta);
  opacity: 0.85;
  transition: opacity 0.25s ease, transform 0.25s var(--ease);
  display: block;
}
.info__social a:hover { opacity: 1; transform: translateY(-2px); }
.info__social svg { width: 18px; height: 18px; }
