/* ================================================================
   TARABA BizComm — Work (screening room, case studies, clients)
   css/pages/work.css | Loaded by work.html only, after base.css,
   layout.css, showroom.css, showroom-motion.css, modal.css.

   Rebuilt for the showroom restructure (Phase 7). The films are the
   exhibit; case studies read as one left-to-right path with the
   result lit up. The pre-rebuild version is kept in
   _archive/pre-showroom/work.css.
================================================================ */

html {
  scroll-padding-top: 70px;
}

/* ── Hero — compact; guide bubble sits on the right ── */
.work-hero {
  padding: calc(70px + var(--s-8)) 0 var(--s-8);
}
.work-hero .wrap {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: end;
  gap: var(--s-7);
}
.work-hero h1 {
  font-family: var(--f-display);
  font-size: var(--fs-display);
  font-weight: 800;
  line-height: 1.02;
  letter-spacing: -0.025em;
  color: var(--white);
}
.work-hero h1 em {
  font-style: normal;
  color: var(--orange);
}
.work-hero .lead {
  color: rgba(255, 255, 255, 0.78);
}

.room-head {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: end;
  gap: var(--s-6);
}

/* ── 01 Screening room ── */
/* Industry cards: pick one, its films show below */
.ind-cards {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--s-3);
  margin-top: var(--s-6);
}
.ind-card {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  aspect-ratio: 16 / 10;
  padding: var(--s-4);
  border: 2px solid transparent;
  border-radius: var(--r-lg);
  overflow: hidden;
  background: var(--navy);
  text-align: left;
  cursor: pointer;
  isolation: isolate;
  transition:
    border-color var(--dur-micro) var(--ease-out),
    transform var(--dur-micro) var(--ease-out),
    box-shadow var(--dur-micro) var(--ease-out);
}
.ind-card img {
  position: absolute;
  inset: 0;
  z-index: -2;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.5;
  transition:
    opacity var(--dur-micro) var(--ease-out),
    transform 400ms var(--ease-out);
}
/* bottom fade so the name reads on any thumbnail */
.ind-card::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(180deg, rgba(13, 27, 62, 0) 30%, rgba(13, 27, 62, 0.92));
}
.ind-card__name {
  font-family: var(--f-display);
  font-size: 18px;
  font-weight: 700;
  line-height: 1.2;
  color: var(--white);
}
.ind-card__count {
  margin-top: 2px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--slate-light);
}
.ind-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}
.ind-card:hover img {
  opacity: 0.7;
  transform: scale(1.05);
}
.ind-card[aria-pressed="true"] {
  border-color: var(--orange);
  box-shadow: 0 10px 28px -12px rgba(234, 162, 33, 0.7);
}
.ind-card[aria-pressed="true"] img {
  opacity: 0.8;
}
.ind-card[aria-pressed="true"] .ind-card__count {
  color: var(--amber);
}
.ind-card:focus-visible {
  outline: 2px solid var(--amber);
  outline-offset: 3px;
}
.films__now {
  margin-top: var(--s-7);
  font-family: var(--f-display);
  font-size: var(--fs-h3);
  font-weight: 700;
  color: var(--navy);
}
.films__now {
  scroll-margin-top: 90px; /* clear the fixed nav when cards scroll here */
}
.films__now:empty {
  display: none;
}
.films__now span {
  color: var(--orange-ink);
}
.films__now + .films {
  margin-top: var(--s-4);
}

.films {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--s-5);
  margin-top: var(--s-6);
  list-style: none;
}
.film[hidden] {
  display: none;
}
.film__link {
  display: block;
  border-radius: var(--r-lg);
  background: var(--white);
  border: 1px solid var(--border);
  overflow: hidden;
  transition:
    transform var(--dur-micro) var(--ease-out),
    box-shadow var(--dur-micro) var(--ease-out);
}
.film__link:hover,
.film__link:focus-visible {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}
.film__link:focus-visible {
  outline: 2px solid var(--amber);
  outline-offset: 3px;
}
.film__thumb {
  position: relative;
  display: block;
  aspect-ratio: 16 / 9;
  background: var(--navy);
  overflow: hidden;
}
.film__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  /* hqdefault thumbnails are 4:3 with letterbox bars; crop them off */
  transform: scale(1.02);
  transition: transform 400ms var(--ease-out);
}
.film__link:hover .film__thumb img {
  transform: scale(1.07);
}
.film__play {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 56px;
  height: 56px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--orange);
  color: var(--navy);
  transform: translate(-50%, -50%);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  transition: transform var(--dur-micro) var(--ease-out);
}
.film__link:hover .film__play {
  transform: translate(-50%, -50%) scale(1.08);
}
.film__play .icon {
  width: 22px;
  height: 22px;
  margin-left: 3px;
}
.film__meta {
  display: block;
  padding: var(--s-4) var(--s-5);
}
.film__title {
  display: block;
  font-family: var(--f-display);
  font-size: 17px;
  font-weight: 700;
  color: var(--navy);
}
.film__client {
  display: block;
  margin-top: 2px;
  font-size: var(--fs-small);
  color: var(--text-soft);
}

/* ── 02 Case studies — one path per case ── */
.cases {
  display: grid;
  gap: var(--s-8);
  margin-top: var(--s-7);
}
.case__head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s-3) var(--s-5);
  margin-bottom: var(--s-5);
}
.case__num {
  flex-basis: 100%;
  font-family: var(--f-display);
  font-size: var(--fs-label);
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--orange-ink);
}
.case__head h3 {
  font-family: var(--f-display);
  font-size: var(--fs-h3);
  font-weight: 700;
  color: var(--text-soft);
}
.case__head h3 span {
  color: var(--navy);
}
.case__head .chips {
  list-style: none;
}
.case__head .btn-link {
  margin-left: auto;
}
.case__steps {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--s-3);
  list-style: none;
}
.case__step {
  position: relative;
  padding: var(--s-5);
  border-radius: var(--r-lg);
  background: var(--paper);
}
/* Arrow from each step to the next (the flight line, shortened) */
.case__step:not(:last-child)::after {
  content: "";
  position: absolute;
  top: 50%;
  right: -14px;
  z-index: 1;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--white)
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M9 6l6 6-6 6' fill='none' stroke='%23b8480f' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E")
    center / 12px no-repeat;
  box-shadow: var(--shadow-xs);
  transform: translateY(-50%);
}
.case__step-name {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: var(--s-3);
  font-family: var(--f-display);
  font-size: 13px;
  font-weight: 700;
  color: var(--navy);
}
.case__step-name b {
  display: inline-block;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.1em;
  color: var(--orange-ink);
}
.case__step p {
  font-size: var(--fs-small);
  line-height: 1.55;
  color: var(--text-body);
}
.case__step--result {
  background: var(--navy);
}
.case__step--result .case__step-name {
  color: var(--white);
}
.case__step--result .case__step-name b {
  color: var(--amber);
}
.case__step--result p {
  color: rgba(255, 255, 255, 0.88);
  font-weight: 500;
}

/* Case path lights up step by step once it's on screen (approved
   2026-10-29): each step's number and border go orange in turn, the
   arrow between steps pops, then the Result card glows and a sheen
   crosses it. Final state = the static design above. */
.js-motion .case__step.is-in {
  animation: case-lit 700ms var(--ease-out) calc(500ms + var(--i, 0) * 500ms) backwards;
}
.js-motion .case__step.is-in .case__step-name b {
  animation: case-num 700ms var(--ease-out) calc(500ms + var(--i, 0) * 500ms) backwards;
}
.js-motion .case__step.is-in:not(:last-child)::after {
  animation: case-hop 400ms cubic-bezier(0.3, 1.5, 0.5, 1) calc(850ms + var(--i, 0) * 500ms)
    backwards;
}
.js-motion .case__step--result.is-in {
  overflow: hidden;
  animation: case-glow 1100ms var(--ease-out) calc(500ms + var(--i, 0) * 500ms) backwards;
}
.js-motion .case__step--result.is-in::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    105deg,
    transparent 30%,
    rgba(244, 180, 0, 0.28) 50%,
    transparent 70%
  );
  transform: translateX(-110%);
  animation: case-sheen 900ms ease-in-out calc(750ms + var(--i, 0) * 500ms) forwards;
  pointer-events: none;
}
@keyframes case-lit {
  from {
    box-shadow: inset 0 0 0 2px transparent;
  }
  35% {
    box-shadow: inset 0 0 0 2px var(--orange);
  }
}
@keyframes case-num {
  from {
    color: var(--slate-light);
  }
  35% {
    color: var(--orange-ink);
    transform: scale(1.25);
  }
}
@keyframes case-hop {
  from {
    transform: translateY(-50%) scale(0.4);
    opacity: 0;
  }
}
@keyframes case-glow {
  from {
    box-shadow: 0 0 0 0 rgba(234, 162, 33, 0);
  }
  35% {
    box-shadow:
      0 0 0 3px var(--amber),
      0 14px 36px -10px rgba(234, 162, 33, 0.75);
    transform: scale(1.03);
  }
}
@keyframes case-sheen {
  to {
    transform: translateX(110%);
  }
}

/* ── Film popup ── */
.vmodal {
  position: fixed;
  inset: 0;
  z-index: 2100;
  display: grid;
  place-items: center;
  padding: var(--s-5);
  background: rgba(10, 22, 40, 0.86);
  opacity: 0;
  transition: opacity 200ms var(--ease-out);
}
.vmodal.open {
  opacity: 1;
}
.vmodal[hidden] {
  display: none;
}
.vmodal__box {
  position: relative;
  width: min(960px, 100%);
}
.vmodal__frame {
  aspect-ratio: 16 / 9;
  border-radius: var(--r-lg);
  overflow: hidden;
  background: #000;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5);
}
.vmodal__frame iframe {
  width: 100%;
  height: 100%;
  border: 0;
}
.vmodal__close {
  position: absolute;
  top: -52px;
  right: 0;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.3);
  background: transparent;
  color: var(--white);
  font-size: 18px;
  cursor: pointer;
}
.vmodal__close:focus-visible {
  outline: 2px solid var(--amber);
  outline-offset: 3px;
}
.vmodal__yt {
  margin-top: var(--s-4);
  color: var(--slate-light);
}

/* ─────────────────────────────────────────────
       RESPONSIVE
    ───────────────────────────────────────────── */
@media (max-width: 1023px) {
  .films {
    grid-template-columns: repeat(2, 1fr);
  }
  .case__steps {
    grid-template-columns: repeat(2, 1fr);
  }
  .case__step:nth-child(2)::after {
    display: none;
  }
}
@media (max-width: 639px) {
  .work-hero .wrap,
  .room-head {
    grid-template-columns: 1fr;
    gap: var(--s-5);
  }
  .ind-cards {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--s-2);
  }
  .ind-card {
    padding: var(--s-3);
  }
  .ind-card__name {
    font-size: 15px;
  }
  .ind-card__count {
    font-size: 11px;
  }
  /* Two compact columns keep all 10 films within ~3 phone screens */
  .films {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--s-3);
  }
  .film__meta {
    padding: var(--s-3);
  }
  .film__title {
    font-size: 15px;
  }
  .film__client {
    font-size: 12px;
  }
  .film__play {
    width: 40px;
    height: 40px;
  }
  .film__play .icon {
    width: 16px;
    height: 16px;
  }
  .case__steps {
    grid-template-columns: 1fr;
  }
  .case__step::after {
    display: none;
  }
  /* stacked: each step lights as it scrolls in, no queue */
  .case__steps .case__step {
    --i: 0 !important;
  }
  .case__head .btn-link {
    margin-left: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .film__link,
  .film__thumb img,
  .film__play,
  .ind-card,
  .ind-card img,
  .vmodal {
    transition: none;
  }
  .case__step,
  .case__step::after,
  .case__step-name b {
    animation: none !important;
  }
  .film__link:hover,
  .film__link:hover .film__thumb img,
  .ind-card:hover,
  .ind-card:hover img {
    transform: none;
  }
}
