:root {
  /* Identidad Policarpa */
  --bg: #D4E140;         /* amarillo lime/chartreuse de la marca */
  --fg: #111111;         /* negro profundo */
  --muted: rgba(17,17,17,0.55);
  --line: rgba(17,17,17,0.25);
  --accent: #111111;
}

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

html, body {
  background: var(--bg);
  color: var(--fg);
  font-family: 'Fraunces', Georgia, serif;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
  height: 100vh;
  width: 100vw;
  cursor: none;
}
a, button { cursor: none; }

/* Custom cursor — cruz Policarpa */
.cursor {
  position: fixed;
  top: 0; left: 0;
  pointer-events: none;
  z-index: 9999;
  font-family: 'Fraunces', serif;
  font-size: 18px;
  color: var(--fg);
  transform: translate(-50%, -50%);
  transition: font-size 0.25s, opacity 0.25s;
  mix-blend-mode: difference;
  color: white;
}
.cursor.hover { font-size: 36px; }

/* Hero intro */
.hero-intro {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 32px;
  transition: opacity 0.7s ease, visibility 0.7s ease;
}
body.intro-done .hero-intro {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

/* Stage donde cambian las figuritas */
.hero-stage {
  position: relative;
  width: min(60vw, 760px);
  height: min(60vw, 760px);
  display: flex;
  align-items: center;
  justify-content: center;
}
.hero-card {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
}
.hero-card.show { opacity: 1; }
.hero-card img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}
.hero-card .glyph {
  font-family: 'Fraunces', serif;
  font-weight: 700;
  font-style: italic;
  font-size: clamp(120px, 28vw, 380px);
  line-height: 1;
  letter-spacing: -0.05em;
  color: var(--fg);
}
.hero-card.inv {
  background: var(--fg);
  color: var(--bg);
}
.hero-card.inv .glyph { color: var(--bg); }
.hero-card .mono {
  font-family: 'JetBrains Mono', monospace;
  font-size: clamp(36px, 6vw, 88px);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 500;
}
.hero-card .iso-frame {
  width: min(45vw, 560px);
  aspect-ratio: 1/1;
}

.hero-bar {
  width: min(60vw, 600px);
  height: 1px;
  background: rgba(17,17,17,0.18);
  overflow: hidden;
}
.hero-bar-fill {
  height: 100%;
  background: var(--fg);
  width: 0%;
  transition: width 0.15s linear;
}
.hero-bottom {
  display: flex;
  justify-content: space-between;
  width: min(60vw, 600px);
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.18em;
}

a { color: inherit; text-decoration: none; }
.link { text-decoration: underline; text-underline-offset: 2px; }

/* Nav */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  display: grid;
  grid-template-columns: 1.5fr 3fr 2.5fr 1.5fr 1fr;
  gap: 24px;
  padding: 22px 28px;
  z-index: 50;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  line-height: 1.4;
  color: var(--fg);
}
.logo {
  display: inline-block;
  align-self: center;
}
.logo-word {
  display: block;
  height: 28px;
  width: auto;
}
.cross {
  display: inline-block;
  transform: translateY(-1px);
  font-size: 0.85em;
}
.nav-col { display: flex; flex-direction: column; gap: 2px; }
.nav-col.right { align-items: flex-end; }
.socials { display: flex; gap: 6px; }
.link-arrow:hover { text-decoration: underline; text-underline-offset: 3px; }

.line {
  position: fixed;
  left: 0; right: 0;
  top: 50%;
  height: 1px;
  background: var(--line);
  z-index: 1;
}

.stage {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
}

/* Thumb wrap */
.thumb-wrap {
  position: relative;
  width: 560px;
  height: 800px;
  margin-right: 28px;
  z-index: 3;
  overflow: hidden;
  -webkit-mask-image: linear-gradient(to bottom, transparent 0%, black 32%, black 68%, transparent 100%);
          mask-image: linear-gradient(to bottom, transparent 0%, black 32%, black 68%, transparent 100%);
}
body.intro-done .thumb-wrap {
  transition: width 0.9s cubic-bezier(0.45, 0, 0.18, 1),
              height 0.9s cubic-bezier(0.45, 0, 0.18, 1);
}

.thumb-col {
  position: absolute;
  left: 0; top: 0;
  width: 100%;
}
.thumb {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background-size: cover;
  background-position: center;
  margin-bottom: 24px;
}

/* Counter — Fraunces serif para que respire la marca */
.counter {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  font-family: 'Fraunces', serif;
  font-weight: 700;
  font-style: italic;
  font-size: clamp(64px, 9vw, 140px);
  line-height: 0.85;
  letter-spacing: -0.04em;
  z-index: 4;
  font-variation-settings: "opsz" 144;
}
.cell {
  position: relative;
  overflow: hidden;
  display: block;
  height: 0.85em;
  width: 3.4em;
}
.digit {
  display: block;
  transition: transform 0.7s cubic-bezier(0.65, 0, 0.35, 1);
}
.digit.exit-up { transform: translateY(-100%); }
.digit.enter-down { transform: translateY(100%); }
.digit.enter-down.in { transform: translateY(0); }
.digit.exit-down { transform: translateY(100%); }
.digit.enter-up { transform: translateY(-100%); }
.digit.enter-up.in { transform: translateY(0); }

.slash {
  margin-top: 4px;
  font-size: 0.55em;
  font-style: normal;
  font-weight: 400;
  opacity: 0.6;
}

.project-name {
  position: absolute;
  left: 50%;
  top: calc(50% + 240px);
  transform: translateX(40px);
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  max-width: 240px;
  transition: opacity 0.4s;
}

/* Footer */
.foot {
  position: fixed;
  bottom: 22px; left: 0; right: 0;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  padding: 0 28px;
  z-index: 50;
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  line-height: 1.4;
}
.foot-left {
  display: flex;
  align-items: center;
  gap: 12px;
}
.foot-iso {
  height: 38px;
  width: 38px;
  object-fit: contain;
}
.foot-right { text-align: right; }

/* Intro */
body.intro .nav,
body.intro .foot,
body.intro .line,
body.intro .project-name { opacity: 0; pointer-events: none; }
.nav, .foot, .line, .project-name { transition: opacity 0.8s ease; }
body.intro .digit { transition: none !important; }

/* Case study modal */
.project-modal {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: none;
}
.project-modal.open { display: block; }
.modal-bg {
  position: absolute;
  inset: 0;
  background: var(--fg);
  opacity: 0;
  transition: opacity 0.5s ease;
}
.project-modal.open .modal-bg { opacity: 1; }
.modal-close {
  position: fixed;
  top: 22px;
  right: 28px;
  background: none;
  border: 0;
  color: var(--bg);
  font-family: 'Fraunces', serif;
  font-size: 32px;
  z-index: 50;
  padding: 12px;
}
.modal-close:hover { opacity: 0.6; }

.modal-scroll {
  position: absolute;
  inset: 0;
  overflow-y: auto;
  overflow-x: hidden;
  z-index: 2;
  scrollbar-width: thin;
}
.modal-inner {
  width: min(92vw, 1280px);
  margin: 0 auto;
  color: var(--bg);
  padding: 60px 0 80px;
  transform: translateY(20px);
  opacity: 0;
  transition: transform 0.6s cubic-bezier(0.2, 0.8, 0.2, 1) 0.15s, opacity 0.5s ease 0.15s;
}
.project-modal.open .modal-inner { transform: translateY(0); opacity: 1; }

/* Hero */
.case-hero { margin-bottom: 80px; }
.case-meta {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 16px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  border-top: 1px solid rgba(212,225,64,0.3);
  border-bottom: 1px solid rgba(212,225,64,0.3);
  padding: 14px 0;
}
.case-meta-row { display: flex; flex-direction: column; gap: 4px; }
.case-meta-label { color: rgba(212,225,64,0.5); }
.case-title {
  font-family: 'Fraunces', serif;
  font-style: italic;
  font-weight: 700;
  font-size: clamp(56px, 10vw, 160px);
  line-height: 0.92;
  letter-spacing: -0.04em;
  color: var(--bg);
  margin: 28px 0 36px;
}
.case-video {
  position: relative;
  width: 100%;
  aspect-ratio: 16/9;
  background: #000;
  overflow: hidden;
}
.case-video video {
  width: 100%; height: 100%;
  object-fit: contain;
  display: block;
}

/* Botón unmute común para hero y cuts */
.video-unmute {
  position: absolute;
  bottom: 16px;
  left: 16px;
  z-index: 5;
  background: var(--bg);
  color: var(--fg);
  border: 0;
  padding: 10px 16px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  transition: opacity 0.25s, transform 0.25s;
}
.video-unmute:hover { transform: translateY(-2px); }
.video-unmute .muted-icon {
  font-size: 16px;
  line-height: 1;
}

.cuts-video-wrap {
  position: relative;
  overflow: hidden;
}

/* Secciones */
.case-section { margin-bottom: 80px; }
.case-section-head {
  display: flex;
  align-items: baseline;
  gap: 16px;
  margin-bottom: 24px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(212,225,64,0.2);
}
.case-section-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.1em;
  color: rgba(212,225,64,0.5);
}
.case-section-title {
  font-family: 'Fraunces', serif;
  font-style: italic;
  font-weight: 500;
  font-size: clamp(28px, 4vw, 48px);
  color: var(--bg);
}
.case-section.empty { display: none; }

/* Galería de fotos */
.case-gallery {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}
.case-gallery .gallery-item {
  aspect-ratio: 1/1;
  background-size: cover;
  background-position: center;
  background-color: #222;
  cursor: pointer;
  transition: transform 0.4s;
}
.case-gallery .gallery-item.wide { grid-column: span 2; aspect-ratio: 2/1; }
.case-gallery .gallery-item.tall { grid-row: span 2; aspect-ratio: 1/2; }
.case-gallery .gallery-item:hover { transform: scale(0.98); }

/* Cuts adicionales */
.case-cuts {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
}
.cuts-item {
  position: relative;
}
.cuts-item video {
  width: 100%;
  aspect-ratio: 16/9;
  object-fit: cover;
  background: #000;
  display: block;
}
.cuts-item-label {
  margin-top: 8px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: rgba(212,225,64,0.7);
}

/* Credits */
.case-credits-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px 32px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.case-credit-row { display: flex; flex-direction: column; gap: 4px; padding: 8px 0; border-top: 1px solid rgba(212,225,64,0.15); }
.case-credit-role { color: rgba(212,225,64,0.5); font-size: 10px; }

/* Footer */
.case-foot {
  display: flex;
  justify-content: space-between;
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: rgba(212,225,64,0.5);
  padding-top: 24px;
  border-top: 1px solid rgba(212,225,64,0.15);
}

/* ================= TABLET ≤ 1100px ================= */
@media (max-width: 1100px) {
  .nav {
    grid-template-columns: 1fr 2fr 1.5fr 1fr;
    gap: 16px; padding: 18px 22px;
    font-size: 10px;
  }
  .nav-col:nth-child(4) { display: none; }
  .logo-word { height: 24px; }
  .thumb-wrap { width: 440px; }
  .thumb { height: 290px; }
  .counter { font-size: 80px; }
  .cell { width: 3.4em; }
  .project-name { top: calc(50% + 175px); }
  .foot { padding: 0 22px; font-size: 9px; }
  .foot-iso { height: 32px; width: 32px; }
  .case-gallery { grid-template-columns: repeat(2, 1fr); }
  .case-meta { grid-template-columns: repeat(3, 1fr); }
}

/* ================= MOBILE ≤ 720px — lista de proyectos ================= */
@media (max-width: 720px) {
  html, body { cursor: auto; overflow: auto; height: auto; min-height: 100vh; }
  .cursor { display: none !important; }
  a, button { cursor: auto; }

  /* Nav fijo */
  .nav {
    position: fixed;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    padding: 14px 16px;
    font-size: 9px;
    background: var(--bg);
    border-bottom: 1px solid rgba(17,17,17,0.08);
  }
  .nav-col:nth-child(2),
  .nav-col:nth-child(3),
  .nav-col:nth-child(4) { display: none; }
  .nav-col.right { align-items: flex-end; }
  .logo-word { height: 20px; }

  /* Oculto ruleta, contador grande y nombre flotante */
  .line { display: none; }
  .stage { display: none; }

  /* Lista de proyectos */
  .mobile-list {
    display: block !important;
    padding: 70px 16px 80px;
    min-height: 100vh;
  }
  .mobile-intro {
    padding: 8px 0 28px;
    border-bottom: 1px solid rgba(17,17,17,0.12);
    margin-bottom: 20px;
  }
  .mobile-intro-title {
    font-family: 'Fraunces', serif;
    font-style: italic;
    font-weight: 700;
    font-size: clamp(48px, 14vw, 88px);
    line-height: 0.95;
    letter-spacing: -0.03em;
  }
  .mobile-intro-sub {
    font-family: 'JetBrains Mono', monospace;
    font-size: 10px;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    margin-top: 10px;
  }
  .mobile-card {
    display: block;
    margin-bottom: 14px;
    cursor: pointer;
    text-decoration: none;
    color: inherit;
  }
  .mobile-card-img {
    width: 100%;
    aspect-ratio: 16/9;
    background-size: cover;
    background-position: center;
    background-color: #222;
  }
  .mobile-card-meta {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-top: 8px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
  }
  .mobile-card-name {
    font-family: 'Fraunces', serif;
    font-style: italic;
    font-size: 26px;
    line-height: 1;
    letter-spacing: -0.02em;
    margin-top: 4px;
  }

  /* Footer compacto */
  .foot {
    flex-direction: column;
    gap: 14px;
    padding: 0 16px 20px;
    font-size: 9px;
    align-items: flex-start;
  }
  .foot-right { text-align: left; }
  .foot-iso { height: 26px; width: 26px; }

  /* Hero intro */
  .hero-stage { width: 80vw; height: 80vw; }
  .hero-bar { width: 80vw; }
  .hero-bottom { width: 80vw; font-size: 10px; }

  /* Modal case study */
  .modal-inner { width: 92vw; padding: 50px 0 60px; }
  .modal-close { top: 12px; right: 12px; font-size: 26px; padding: 8px; }
  .case-meta { grid-template-columns: 1fr 1fr; gap: 10px; font-size: 9px; padding: 10px 0; }
  .case-title { font-size: clamp(40px, 13vw, 80px); margin: 20px 0 22px; }
  .case-section { margin-bottom: 56px; }
  .case-section-title { font-size: 28px; }
  .case-gallery { grid-template-columns: 1fr; gap: 8px; }
  .case-gallery .gallery-item.wide { grid-column: span 1; aspect-ratio: 1/1; }
  .case-cuts { grid-template-columns: 1fr; gap: 16px; }
  .case-credits-grid { grid-template-columns: 1fr; gap: 0; }
  .video-unmute { font-size: 9px; padding: 8px 12px; bottom: 10px; left: 10px; }
}

/* Mobile list — oculta en desktop */
.mobile-list { display: none; }

/* ================= TOUCH (desactivar hover effects) ================= */
@media (hover: none) {
  .cursor { display: none !important; }
  html, body, a, button { cursor: auto; }
  .thumb-wrap:hover .thumb-col,
  .case-gallery .gallery-item:hover { transform: none; }
}
