/* ============================================================
   JIA LATAM · Work Index + Case Study Styles
   ============================================================ */

/* ── PAGE HERO VARIANT ────────────────────────────────────── */
.page-hero--work {
  padding-bottom: clamp(40px, 5vw, 64px);
}

.page-hero__inner--work {
  grid-template-columns: 1fr 1fr;
  align-items: end;
}

/* ── FILTER BAR ───────────────────────────────────────────── */
.work-filters {
  padding: 0 var(--section-px);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: var(--nav-h);
  z-index: 80;
  background: rgba(10, 10, 10, 0.92);
  backdrop-filter: blur(16px) saturate(160%);
  -webkit-backdrop-filter: blur(16px) saturate(160%);
}

.work-filters__inner {
  max-width: var(--max-w);
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 0;
  overflow-x: auto;
  scrollbar-width: none;
}

.work-filters__inner::-webkit-scrollbar { display: none; }

.filter-btn {
  flex-shrink: 0;
  background: none;
  border: none;
  cursor: pointer;
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--dim);
  padding: 18px 20px;
  position: relative;
  transition: color 0.2s;
  white-space: nowrap;
}

.filter-btn::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0;
  width: 100%;
  height: 2px;
  background: var(--gold);
  transform: scaleX(0);
  transition: transform 0.3s var(--ease-out);
}

.filter-btn:hover {
  color: var(--white);
}

.filter-btn.is-active {
  color: var(--white);
}

.filter-btn.is-active::after {
  transform: scaleX(1);
}

.filter-count {
  display: inline-block;
  margin-left: 5px;
  font-size: 9px;
  font-weight: 700;
  color: var(--gold);
  background: rgba(201,169,110,0.1);
  border: 1px solid rgba(201,169,110,0.2);
  border-radius: 10px;
  padding: 1px 6px;
  line-height: 1.6;
  vertical-align: middle;
  transition: all 0.2s;
}

.filter-btn.is-active .filter-count {
  background: rgba(201,169,110,0.2);
}

/* ── WORK GRID ────────────────────────────────────────────── */
.work-index {
  padding: var(--section-py) 0;
}

.work-index__inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 var(--section-px);
}

.work-index__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2px;
  background: var(--border);
  border: 1px solid var(--border);
}

/* ── PROJECT TILE ─────────────────────────────────────────── */
.project-tile {
  position: relative;
  overflow: hidden;
  background: var(--surface);
  aspect-ratio: 4/3;
  text-decoration: none;
  color: inherit;
  display: block;
  transition: opacity 0.35s var(--ease-out), transform 0.35s var(--ease-out);
}

.project-tile--wide {
  grid-column: span 2;
  aspect-ratio: 16/9;
}

.project-tile--tall {
  grid-row: span 2;
  aspect-ratio: auto;
}

/* Hidden state when filter active */
.project-tile.is-hidden {
  display: none;
}

.project-tile__bg {
  position: absolute;
  inset: 0;
  transition: transform 0.7s var(--ease-out);
}

.project-tile:hover .project-tile__bg {
  transform: scale(1.04);
}

/* Unique gradients per project */
.project-tile[data-project="guatemala"]    .project-tile__bg { background: linear-gradient(145deg, #1a1208 0%, #0e0804 50%, #1a1610 100%); }
.project-tile[data-project="malaga"]       .project-tile__bg { background: linear-gradient(145deg, #120a14 0%, #0c0810 50%, #160e1a 100%); }
.project-tile[data-project="expo-japan"]   .project-tile__bg { background: linear-gradient(145deg, #081012 0%, #040c0e 50%, #0c161a 100%); }
.project-tile[data-project="casa-de-mar"]  .project-tile__bg { background: linear-gradient(145deg, #140e08 0%, #0e0a04 50%, #181208 100%); }
.project-tile[data-project="isa-surf"]     .project-tile__bg { background: linear-gradient(145deg, #081014 0%, #040c10 50%, #0a1018 100%); }
.project-tile[data-project="expo-milano"]  .project-tile__bg { background: linear-gradient(145deg, #100a06 0%, #0c0804 50%, #140e08 100%); }
.project-tile[data-project="todos-nacemos"].project-tile__bg { background: linear-gradient(145deg, #0a100e 0%, #060c0a 50%, #0e1410 100%); }
.project-tile[data-project="expo-dubai"]   .project-tile__bg { background: linear-gradient(145deg, #100c06 0%, #0c0a04 50%, #161008 100%); }
.project-tile[data-project="anato"]        .project-tile__bg { background: linear-gradient(145deg, #0e0810 0%, #0a0610 50%, #120c14 100%); }
.project-tile[data-project="surf-city"]    .project-tile__bg { background: linear-gradient(145deg, #060e14 0%, #040a10 50%, #081018 100%); }

/* SVG art layer */
.project-tile__art {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.2;
  transition: opacity 0.5s var(--ease-out);
}

.project-tile:hover .project-tile__art {
  opacity: 0.38;
}

/* Overlay gradient */
.project-tile__overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top,
    rgba(0,0,0,0.9) 0%,
    rgba(0,0,0,0.3) 45%,
    transparent 75%);
  transition: opacity 0.4s;
}

.project-tile:hover .project-tile__overlay {
  opacity: 1;
  background: linear-gradient(to top,
    rgba(0,0,0,0.95) 0%,
    rgba(0,0,0,0.4) 50%,
    rgba(0,0,0,0.1) 100%);
}

/* Category badge top-left */
.project-tile__category {
  position: absolute;
  top: clamp(14px, 2.5vw, 22px);
  left: clamp(14px, 2.5vw, 22px);
  z-index: 2;
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--off-white);
  background: rgba(10,10,10,0.6);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,0.08);
  padding: 5px 10px;
}

/* Year badge top-right */
.project-tile__year {
  position: absolute;
  top: clamp(14px, 2.5vw, 22px);
  right: clamp(14px, 2.5vw, 22px);
  z-index: 2;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.1em;
  color: var(--gold);
  opacity: 0;
  transform: translateY(-4px);
  transition: all 0.35s var(--ease-out);
}

.project-tile:hover .project-tile__year {
  opacity: 1;
  transform: translateY(0);
}

/* Content at bottom */
.project-tile__content {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  padding: clamp(16px, 3vw, 28px);
  z-index: 2;
  transform: translateY(6px);
  transition: transform 0.4s var(--ease-out);
}

.project-tile:hover .project-tile__content {
  transform: translateY(0);
}

.project-tile__title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(15px, 1.8vw, 21px);
  color: var(--white);
  line-height: 1.2;
  letter-spacing: -0.01em;
}

.project-tile--wide .project-tile__title {
  font-size: clamp(18px, 2.4vw, 28px);
}

.project-tile__sub {
  font-size: 12px;
  color: var(--muted);
  margin-top: 5px;
  display: block;
  opacity: 0;
  transform: translateY(4px);
  transition: all 0.35s var(--ease-out) 0.05s;
}

.project-tile:hover .project-tile__sub {
  opacity: 1;
  transform: translateY(0);
}

/* Arrow reveal on hover */
.project-tile__arrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 10px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gold);
  opacity: 0;
  transform: translateX(-6px);
  transition: all 0.35s var(--ease-out) 0.1s;
}

.project-tile:hover .project-tile__arrow {
  opacity: 1;
  transform: translateX(0);
}

/* Empty state when all filtered out */
.work-index__empty {
  display: none;
  grid-column: 1 / -1;
  padding: 80px 40px;
  text-align: center;
  background: var(--dark);
  color: var(--muted);
  font-size: 14px;
  font-weight: 300;
}

.work-index__empty.visible {
  display: block;
}

/* ── CASE STUDY ───────────────────────────────────────────── */

/* Hero */
.case-hero {
  position: relative;
  padding: calc(var(--nav-h) + clamp(60px, 10vw, 140px))
           var(--section-px)
           clamp(60px, 8vw, 100px);
  border-bottom: 1px solid var(--border);
  overflow: hidden;
}

.case-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 60% at 25% 15%, rgba(201,169,110,0.08), transparent 60%),
    linear-gradient(180deg, var(--dark) 0%, var(--black) 100%);
  z-index: 0;
}

.case-hero__inner {
  max-width: var(--max-w);
  margin: 0 auto;
  position: relative;
  z-index: 1;
}

.case-hero__back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--dim);
  text-decoration: none;
  margin-bottom: 40px;
  transition: color 0.2s;
}

.case-hero__back:hover { color: var(--gold); }

.case-hero__back svg { transition: transform 0.2s; }
.case-hero__back:hover svg { transform: translateX(-4px); }

.case-hero__category {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.case-hero__category::before {
  content: '';
  display: block;
  width: 28px;
  height: 1px;
  background: var(--gold);
}

.case-hero__title {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(40px, 6.5vw, 88px);
  line-height: 0.95;
  letter-spacing: -0.03em;
  color: var(--white);
  max-width: 18ch;
}

.case-hero__title em {
  font-style: italic;
  color: var(--gold);
  font-weight: 400;
}

.case-hero__meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 32px;
  margin-top: 40px;
  padding-top: 32px;
  border-top: 1px solid var(--border);
}

.case-meta-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.case-meta-item__label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--gold);
}

.case-meta-item__val {
  font-size: 14px;
  font-weight: 400;
  color: var(--off-white);
}

/* Case study image band */
.case-image-band {
  width: 100%;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  overflow: hidden;
}

.case-image-band__img {
  width: 100%;
  aspect-ratio: 21/9;
  /* PRODUCTION: background-image: url('/assets/projects/guatemala-hero.jpg'); background-size: cover; background-position: center; */
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Case study body */
.case-body {
  padding: var(--section-py) 0;
}

.case-body__inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 var(--section-px);
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: clamp(40px, 6vw, 100px);
  align-items: start;
}

.case-body__nav {
  position: sticky;
  top: calc(var(--nav-h) + 60px);
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.case-nav-link {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--dim);
  text-decoration: none;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  transition: color 0.2s;
  display: flex;
  align-items: center;
  gap: 12px;
}

.case-nav-link::before {
  content: '';
  display: block;
  width: 0;
  height: 1px;
  background: var(--gold);
  transition: width 0.3s var(--ease-out);
  flex-shrink: 0;
}

.case-nav-link:hover,
.case-nav-link.is-active {
  color: var(--white);
}

.case-nav-link:hover::before,
.case-nav-link.is-active::before {
  width: 16px;
}

.case-body__content {
  display: flex;
  flex-direction: column;
  gap: clamp(56px, 8vw, 100px);
}

.case-section {}

.case-section__label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.case-section__label::before {
  content: '';
  display: block;
  width: 16px;
  height: 1px;
  background: var(--gold);
}

.case-section__title {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(22px, 3vw, 36px);
  line-height: 1.05;
  letter-spacing: -0.025em;
  color: var(--white);
  margin-bottom: 20px;
}

.case-section__title em {
  font-style: italic;
  color: var(--gold);
  font-weight: 400;
}

.case-section__body {
  font-size: 15px;
  font-weight: 300;
  color: var(--muted);
  line-height: 1.9;
  max-width: 68ch;
}

.case-section__body p + p {
  margin-top: 16px;
}

.case-section__body strong {
  color: var(--off-white);
  font-weight: 400;
}

/* Numbers / outcomes grid */
.case-numbers {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 2px;
  background: var(--border);
  border: 1px solid var(--border);
  margin-top: 36px;
}

.case-number {
  background: var(--dark);
  padding: 28px 24px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  transition: background 0.3s;
}

.case-number:hover { background: var(--surface); }

.case-number__val {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(28px, 3.5vw, 42px);
  line-height: 1;
  letter-spacing: -0.03em;
  color: var(--white);
}

.case-number__val span { color: var(--gold); }

.case-number__label {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--dim);
}

/* Gallery strip */
.case-gallery {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2px;
  background: var(--border);
  border: 1px solid var(--border);
  margin-top: 32px;
}

.case-gallery__item {
  aspect-ratio: 4/3;
  background: var(--surface);
  overflow: hidden;
  position: relative;
}

.case-gallery__item--wide {
  grid-column: span 2;
  aspect-ratio: 16/9;
}

.case-gallery__placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.case-gallery__placeholder-icon {
  width: 28px;
  height: 28px;
  color: var(--border-light);
}

.case-gallery__placeholder-label {
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--dim);
  text-align: center;
  padding: 0 16px;
}

/* Quote pullout */
.case-quote {
  border-left: 2px solid var(--gold);
  padding: 20px 28px;
  margin: 32px 0;
  background: rgba(201,169,110,0.03);
}

.case-quote__text {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 400;
  font-size: clamp(18px, 2.2vw, 24px);
  line-height: 1.45;
  color: var(--off-white);
  letter-spacing: -0.01em;
}

.case-quote__attribution {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold);
  margin-top: 14px;
}

/* Next project */
.case-next {
  padding: var(--section-py) var(--section-px);
  border-top: 1px solid var(--border);
  background: var(--dark);
}

.case-next__inner {
  max-width: var(--max-w);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
}

.case-next__label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 10px;
}

.case-next__title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(20px, 2.5vw, 30px);
  color: var(--white);
  letter-spacing: -0.02em;
  text-decoration: none;
  transition: color 0.2s;
}

.case-next__title:hover { color: var(--gold); }

/* ── RESPONSIVE ───────────────────────────────────────────── */
@media (max-width: 1024px) {
  .page-hero__inner--work {
    grid-template-columns: 1fr;
    gap: 32px;
  }

  .work-index__grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .project-tile--wide {
    grid-column: span 2;
  }

  .case-body__inner {
    grid-template-columns: 1fr;
  }

  .case-body__nav {
    position: static;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 0;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--border);
  }

  .case-nav-link {
    border-bottom: none;
    border-right: 1px solid var(--border);
    padding: 8px 16px;
  }

  .case-numbers {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 640px) {
  .work-index__grid {
    grid-template-columns: 1fr;
  }

  .project-tile--wide {
    grid-column: span 1;
    aspect-ratio: 4/3;
  }

  .case-gallery {
    grid-template-columns: 1fr;
  }

  .case-gallery__item--wide {
    grid-column: span 1;
    aspect-ratio: 4/3;
  }

  .case-numbers {
    grid-template-columns: 1fr 1fr;
  }

  .case-next__inner {
    flex-direction: column;
    align-items: flex-start;
  }
}
