/* ============================================================
   CASE STUDY — EDITORIAL LAYOUT
   Built for website projects. The page opens on a solid title
   block instead of a full-bleed screenshot, so the studio nav
   never sits on top of the client site's own navigation.
   Screens are shown at natural proportions inside hairline
   frames, with a sticky index that tracks the reader's place.
   Pair with: style.css + casestudy.css (meta / overview / quote)
   Pages using it should give the nav the `nav--solid` modifier.
   ============================================================ */

/* HEAD — title block */
.cse-head {
  padding: 12rem 2.5rem 5rem;
  border-bottom: 1px solid var(--border-subtle);
}

.cse-head__eyebrow {
  font-size: 0.7rem;
  font-weight: 400;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--grey);
  margin-bottom: 2rem;
}

.cse-head__row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: end;
}

.cse-head__title {
  font-family: var(--font-heading);
  font-size: clamp(3.5rem, 9vw, 8rem);
  font-weight: 300;
  line-height: 0.95;
  letter-spacing: -0.02em;
}

.cse-head__title em {
  font-style: italic;
  display: block;
}

.cse-head__intro {
  font-size: 1.1rem;
  color: var(--grey);
  line-height: 1.9;
  max-width: 460px;
  justify-self: end;
  padding-bottom: 0.6rem;
}

/* FRAME — shared hairline container for film and screens */
.cse-frame {
  position: relative;
  border: 1px solid var(--border-subtle);
  background: #0a0a0a;
  overflow: hidden;
  transition: border-color 0.4s ease;
}

.cse-frame:hover {
  border-color: var(--border);
}

/* REEL — hero film */
.cse-reel {
  padding: 5rem 2.5rem;
  border-bottom: 1px solid var(--border-subtle);
}

.cse-reel .cse-frame {
  aspect-ratio: 1600 / 882;
}

.cse-reel video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.cse-caption {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 2rem;
  padding-top: 1.25rem;
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--grey);
}

.cse-caption em {
  font-family: var(--font-heading);
  font-style: italic;
  font-weight: 300;
  font-size: 1.1rem;
  letter-spacing: 0;
  text-transform: none;
}

/* SCREENS — sticky index + stacked screens */
.cse-screens {
  display: grid;
  grid-template-columns: 14rem 1fr;
  gap: 5rem;
  padding: 8rem 2.5rem;
  align-items: start;
}

.cse-index {
  position: sticky;
  top: 8rem;
}

.cse-index__label {
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--grey);
  padding-bottom: 1.25rem;
  margin-bottom: 1.25rem;
  border-bottom: 1px solid var(--border-subtle);
}

.cse-index ol {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.cse-index a {
  display: flex;
  align-items: center;
  gap: 1rem;
  font-size: 0.75rem;
  font-weight: 400;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--grey);
  transition: color 0.3s ease;
}

/* Marker line grows in when the screen is in view */
.cse-index a::before {
  content: '';
  width: 0;
  height: 1px;
  background: var(--white);
  transition: width 0.5s cubic-bezier(0.23, 1, 0.32, 1);
}

.cse-index a span {
  font-family: var(--font-heading);
  font-style: italic;
  font-size: 1rem;
  letter-spacing: 0;
  text-transform: none;
}

.cse-index a:hover,
.cse-index a.is-active {
  color: var(--white);
}

.cse-index a.is-active::before {
  width: 1.5rem;
}

.cse-list {
  display: flex;
  flex-direction: column;
  gap: 6rem;
}

.cse-screen {
  margin: 0;
  width: 100%;
  scroll-margin-top: 7rem;
}

/* Alternating widths give the stack an editorial rhythm */
.cse-screen--right {
  width: 80%;
  margin-left: auto;
}

.cse-screen--left {
  width: 80%;
}

.cse-screen img {
  width: 100%;
  height: auto;
  display: block;
}

.cse-screen figcaption {
  display: grid;
  grid-template-columns: 3rem 1fr;
  gap: 0 1.5rem;
  align-items: baseline;
  padding-top: 1.5rem;
}

.cse-screen__num {
  font-family: var(--font-heading);
  font-style: italic;
  font-size: 1.1rem;
  color: var(--grey);
}

.cse-screen__name {
  font-family: var(--font-heading);
  font-size: 1.6rem;
  font-weight: 300;
  line-height: 1.2;
}

.cse-screen__note {
  grid-column: 2;
  font-size: 0.95rem;
  color: var(--grey);
  line-height: 1.8;
  max-width: 520px;
  margin-top: 0.4rem;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1024px) {
  .cse-head__row {
    grid-template-columns: 1fr;
    gap: 2.5rem;
  }

  .cse-head__intro {
    justify-self: start;
    padding-bottom: 0;
  }

  .cse-screens {
    grid-template-columns: 1fr;
    gap: 3rem;
    padding: 6rem 2.5rem;
  }

  .cse-index {
    position: static;
  }

  .cse-index ol {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 0.75rem 2rem;
  }
}

@media (max-width: 768px) {
  .cse-head {
    padding: 9rem 1.5rem 4rem;
  }

  .cse-reel {
    padding: 3rem 1.5rem;
  }

  .cse-caption {
    flex-direction: column;
    gap: 0.5rem;
  }

  .cse-screens {
    padding: 4rem 1.5rem;
  }

  .cse-list {
    gap: 4rem;
  }

  .cse-screen--right,
  .cse-screen--left {
    width: 100%;
  }
}
