/* Black Oxen Motion — Home / Work
   Scroll-driven. js/home.js writes inline transforms on the elements marked
   with data-bx while scrolling; the values here are the resting state that
   applies before (and without) JavaScript. */

/* ---------- intro reveal ---------- */
/* A full-bleed ink panel with a logo-shaped hole punched through it. The
   hole scales up from ~340px to several screens wide, which reads as the
   mark opening onto the reel. */
.intro {
  position: fixed;
  inset: 0;
  z-index: 90;
  overflow: hidden;
  pointer-events: none;
}

.intro__panel {
  position: absolute;
  inset: 0;
  background: var(--dark-bg);
  opacity: 1;
  -webkit-mask-image: linear-gradient(#fff, #fff), url('../assets/logo-mark.png');
          mask-image: linear-gradient(#fff, #fff), url('../assets/logo-mark.png');
  -webkit-mask-repeat: no-repeat, no-repeat;
          mask-repeat: no-repeat, no-repeat;
  -webkit-mask-position: 0px 0px, 50% 42%;
          mask-position: 0px 0px, 50% 42%;
  -webkit-mask-composite: xor;
          mask-composite: exclude;
  transition: -webkit-mask-size 1.5s cubic-bezier(.72, 0, .18, 1),
              mask-size 1.5s cubic-bezier(.72, 0, .18, 1),
              -webkit-mask-position 1.5s cubic-bezier(.72, 0, .18, 1),
              mask-position 1.5s cubic-bezier(.72, 0, .18, 1),
              opacity .9s ease;
}

.intro__text {
  position: absolute;
  left: 0;
  right: 0;
  top: 66%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  opacity: 1;
  transition: opacity .5s ease;
  pointer-events: none;
}

.intro__name {
  font-family: var(--display);
  font-weight: 500;
  font-size: 11.5px;
  letter-spacing: 0.34em;
  color: var(--dark-body);
}

.intro__rule {
  width: 130px;
  height: 1px;
  background: rgba(255, 255, 255, 0.15);
}

.intro__rule i {
  display: block;
  height: 1px;
  background: var(--red);
  animation: bxLine 2.1s linear both;
}

.intro__caption {
  position: absolute;
  left: var(--gutter);
  bottom: 34px;
  font-family: var(--display);
  font-weight: 500;
  font-size: 10.5px;
  letter-spacing: 0.2em;
  color: var(--dark-body);
  opacity: 0;
  transition: opacity .8s ease .6s;
  pointer-events: none;
}

.intro__skip {
  position: absolute;
  right: var(--gutter);
  bottom: 28px;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: #FFFFFF;
  border-radius: 999px;
  padding: 10px 20px;
  font-family: var(--display);
  font-weight: 500;
  font-size: 10.5px;
  letter-spacing: 0.2em;
  cursor: pointer;
  transition: all .3s;
  pointer-events: auto;
  opacity: 1;
}

.intro__skip:hover {
  background: #FFFFFF;
  color: var(--ink);
  border-color: #FFFFFF;
}

/* phase: hole expanded */
.intro[data-phase="full"] .intro__panel,
.intro[data-phase="fade"] .intro__panel { /* size/position set inline by JS */ }

.intro[data-phase="full"] .intro__text,
.intro[data-phase="fade"] .intro__text { opacity: 0; }

.intro[data-phase="full"] .intro__skip,
.intro[data-phase="fade"] .intro__skip { opacity: 0; }

.intro[data-phase="full"] .intro__caption,
.intro[data-phase="fade"] .intro__caption { opacity: 1; }

.intro[data-phase="fade"] .intro__panel { opacity: 0; }

@keyframes bxLine  { from { width: 0; }   to { width: 100%; } }
@keyframes bxFadeIn { from { opacity: 0; } to { opacity: 1; } }

/* ---------- hero ---------- */
/* 190vh tall with a sticky 100vh viewport inside, so the reel holds still
   for ~90vh of scroll while the copy rises into it. */
.hero {
  position: relative;
  background: var(--dark-bg);
  height: 190vh;
}

.hero__stick {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: hidden;
}

.hero__video {
  position: absolute;
  inset: 0;
  background: var(--dark-bg);
}

/* cover-fit a 16:9 iframe in any viewport */
.bx-cover {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: max(100vw, 177.78vh);
  height: max(100vh, 56.25vw);
  border: 0;
  pointer-events: none;
}

.hero__scrim {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg,
    rgba(25, 24, 32, 0.3),
    rgba(25, 24, 32, 0) 28%,
    rgba(25, 24, 32, 0) 68%,
    rgba(25, 24, 32, 0.5));
}

.hero__copy {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 140px var(--gutter) 58px;
  box-sizing: border-box;
  opacity: 0;
  transform: translateY(70px);
  will-change: opacity, transform;
  pointer-events: none;
}

.hero__eyebrow {
  font-family: var(--display);
  font-weight: 500;
  font-size: 11.5px;
  letter-spacing: 0.24em;
  color: var(--dark-muted);
}

.hero__title {
  font-family: var(--display);
  font-weight: 500;
  font-size: clamp(64px, 8.4vw, 122px);
  line-height: 1.02;
  letter-spacing: -0.015em;
  color: #FFFFFF;
  margin: 20px 0 30px;
}

.hero__row {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 40px;
  flex-wrap: wrap;
}

.hero__lede {
  max-width: 530px;
  margin: 0;
  font-size: 17px;
  line-height: 1.65;
  color: var(--dark-body);
  text-wrap: pretty;
}

.hero__cue {
  position: absolute;
  left: 50%;
  bottom: 30px;
  transform: translateX(-50%);
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  color: #FFFFFF;
  pointer-events: none;
}

.hero__cue span:first-child {
  font-family: var(--display);
  font-weight: 500;
  font-size: 10px;
  letter-spacing: 0.3em;
  opacity: 0.75;
}

.hero__cue i {
  width: 1px;
  height: 34px;
  background: rgba(255, 255, 255, 0.55);
  display: block;
  animation: bxCue 2.2s ease-in-out infinite;
}

@keyframes bxCue {
  0%, 100% { transform: translateY(0);   opacity: .6; }
  50%      { transform: translateY(7px); opacity: 1; }
}

/* ---------- pill buttons ---------- */
.pill {
  display: flex;
  align-items: center;
  gap: 14px;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.28);
  color: #FFFFFF;
  border-radius: 999px;
  padding: 15px 26px;
  font-family: var(--display);
  font-weight: 500;
  font-size: 12px;
  letter-spacing: 0.18em;
  cursor: pointer;
  transition: all .3s ease;
  pointer-events: auto;
}

.pill:hover {
  background: var(--red);
  border-color: var(--red);
}

.pill--sm {
  gap: 12px;
  padding: 13px 24px;
  font-size: 11px;
  border-color: rgba(255, 255, 255, 0.3);
}

/* CSS triangle play glyph */
.pill i {
  display: inline-block;
  width: 0;
  height: 0;
  border-top: 5px solid transparent;
  border-bottom: 5px solid transparent;
  border-left: 8px solid currentColor;
}

.pill--sm i {
  border-top-width: 4px;
  border-bottom-width: 4px;
  border-left-width: 7px;
}

/* ---------- selected work ---------- */
.work { background: var(--bg); }

.work__head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 100px var(--gutter) 54px;
}

.work__head h2 {
  font-family: var(--display);
  font-weight: 500;
  font-size: 36px;
  letter-spacing: -0.01em;
  margin: 0;
}

.work__count {
  font-family: var(--display);
  font-weight: 500;
  font-size: 11px;
  letter-spacing: 0.18em;
  color: var(--muted);
}

.work__item {
  position: relative;
  height: 175vh;
}

.work__scene {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: hidden;
}

.work__media {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  cursor: pointer;
  background: var(--rule);
  clip-path: inset(16% 9%);
  will-change: transform, clip-path;
}

.work__img {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  transform: scale(1.08);
  will-change: transform;
}

.work__vid {
  opacity: 0;
  transition: opacity .6s ease;
}

.work__scrim {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg,
    rgba(25, 24, 32, 0.12),
    rgba(25, 24, 32, 0.02) 40%,
    rgba(25, 24, 32, 0.55));
  pointer-events: none;
}

.work__cap {
  position: absolute;
  bottom: 44px;
  z-index: 2;
  color: #FFFFFF;
  pointer-events: none;
  opacity: 0;
  transform: translateY(24px);
  will-change: opacity, transform;
}

.work__cap-meta {
  font-family: var(--display);
  font-weight: 500;
  font-size: 11px;
  letter-spacing: 0.22em;
  color: rgba(255, 255, 255, 0.78);
}

.work__cap-title {
  font-family: var(--display);
  font-weight: 500;
  font-size: clamp(36px, 4.6vw, 68px);
  line-height: 1.05;
  letter-spacing: -0.015em;
  margin-top: 12px;
}

/* the ink panel that slides in over the film */
.work__about {
  position: absolute;
  top: 0;
  bottom: 0;
  z-index: 3;
  width: min(460px, 42vw);
  box-sizing: border-box;
  background: var(--dark-bg);
  color: #FFFFFF;
  padding: 60px 52px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  will-change: transform;
}

/* odd scenes push in from the right, even ones from the left */
.work__item[data-side="right"] .work__cap   { left: var(--gutter); right: 46%; }
.work__item[data-side="left"]  .work__cap   { left: 46%; right: var(--gutter); }
.work__item[data-side="right"] .work__about { right: 0; left: auto; transform: translateX(108%); }
.work__item[data-side="left"]  .work__about { left: 0; right: auto; transform: translateX(-108%); }

.work__about-kicker {
  display: flex;
  align-items: center;
  gap: 10px;
}

.work__dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  display: inline-block;
}

.work__about-kicker span:last-child {
  font-family: var(--display);
  font-weight: 500;
  font-size: 10.5px;
  letter-spacing: 0.24em;
  color: var(--dark-muted);
}

.work__about h3 {
  font-family: var(--display);
  font-weight: 500;
  font-size: 28px;
  line-height: 1.15;
  letter-spacing: -0.01em;
  margin: 18px 0 6px;
}

.work__about-meta {
  font-family: var(--display);
  font-weight: 500;
  font-size: 10.5px;
  letter-spacing: 0.16em;
  color: var(--dark-muted);
  margin-bottom: 22px;
}

.work__about p {
  margin: 0 0 30px;
  font-size: 15.5px;
  line-height: 1.7;
  color: var(--dark-body);
  text-wrap: pretty;
}

.work__about .pill { align-self: flex-start; }

/* ---------- video lightbox ---------- */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(14, 13, 19, 0.93);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 5vh 5vw;
  box-sizing: border-box;
  animation: bxFadeIn .25s ease both;
  cursor: pointer;
}

.lightbox[hidden] { display: none; }

.lightbox__inner {
  width: min(1180px, 100%);
  cursor: default;
}

.lightbox__bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}

.lightbox__title {
  font-family: var(--display);
  font-weight: 500;
  font-size: 11px;
  letter-spacing: 0.18em;
  color: var(--dark-body);
}

.lightbox__close {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: #FFFFFF;
  border-radius: 999px;
  width: 38px;
  height: 38px;
  font-size: 15px;
  cursor: pointer;
  transition: all .25s;
}

.lightbox__close:hover {
  background: var(--red);
  border-color: var(--red);
}

.lightbox__frame {
  aspect-ratio: 16 / 9;
  background: #000000;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5);
}

.lightbox__frame iframe {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}

/* ---------- page exit wipe ---------- */
.exit {
  position: fixed;
  inset: 0;
  z-index: 120;
  background: #0E0D13;
  display: flex;
  align-items: center;
  justify-content: center;
  transform: translateY(100%);
  transition: transform .55s cubic-bezier(.72, 0, .18, 1);
  pointer-events: none;
}

.exit img { width: 56px; height: 56px; filter: invert(1); }
.exit.is-out { transform: translateY(0); }

/* ---------- mobile ---------- */
/* The scroll choreography is desktop-only. On phones each project becomes a
   plain 16:9 card with its panel stacked underneath. */
@media (max-width: 760px) {
  .hero__copy  { padding: 100px var(--gutter) 96px; }
  .hero__title { font-size: 46px; }

  .work__head {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    padding: 64px var(--gutter) 30px;
  }

  .work__item  { height: auto; }
  .work__scene { position: relative; height: auto; }

  .work__media {
    position: relative;
    inset: auto;
    aspect-ratio: 16 / 9;
    height: auto;
    clip-path: none;
    transform: none !important;
    filter: none !important;
  }

  .work__img { transform: none !important; }

  .work__vid {
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    transform: none;
  }

  .work__cap { display: none; }

  .work__item .work__about {
    position: relative;
    top: auto;
    bottom: auto;
    left: auto;
    right: auto;
    width: auto;
    transform: none !important;
    padding: 30px var(--gutter) 44px;
    justify-content: flex-start;
  }
}

@media (prefers-reduced-motion: reduce) {
  .hero__cue i,
  .intro__rule i { animation: none; }
  .intro__rule i { width: 100%; }
}
