/* Case-study template, ported from MarsNET's project-template styles and
   re-skinned with the VVEX design tokens from css/style.css. */

/* ---------- section chrome ---------- */
.case-main section {
  padding: clamp(40px, 5vw, 72px) var(--pad);
  position: relative;
  z-index: 10;
}

.section-label {
  display: inline-block;
  background: var(--accent);
  color: var(--bg);
  padding: 4px 12px;
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.12em;
  margin-bottom: 2rem;
}

.case-back {
  display: inline-block;
  font-family: var(--mono);
  font-size: 14px;
  color: var(--text-dim);
  margin-bottom: 28px;
  transition: color 0.15s;
}
.case-back:hover { color: var(--accent); }

.case-kicker {
  display: block;
  font-family: var(--mono);
  font-size: 13px;
  color: var(--accent);
  margin-bottom: 10px;
}

.case-title {
  font-size: clamp(28px, 3.6vw, 56px);
  font-weight: 600;
  line-height: 1.15;
  max-width: 24em;
}

.case-meta {
  margin-top: 10px;
  margin-bottom: clamp(28px, 3vw, 48px);
  font-family: var(--mono);
  font-size: 13px;
  color: var(--text-dim);
}

/* ---------- hero (fixed behind the page, content scrolls over) ---------- */
.hero-section {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  z-index: -1;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
}

.hero-section::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 5vh;
  background: linear-gradient(to top, var(--bg) 0%, transparent 100%);
  pointer-events: none;
}

.hero-media {
  display: block;
  width: 100%;
  height: 100%;
  /* fit the full width so the whole frame stays visible (no edge cropping),
     letterboxing against --bg above/below on taller viewports */
  object-fit: contain;
}

@media (max-width: 768px), (orientation: portrait) {
  /* on portrait / narrow screens a wide hero can't fill the viewport height
     without cropping most of it, so the parallax is dropped: the hero joins
     the normal flow beneath the sticky header at its natural height (fitting
     the width), and the content follows immediately — no 100vh ramp gap */
  .hero-section {
    position: relative;
    height: auto;
    z-index: 0;
  }
  .hero-media {
    height: auto;
    max-height: 80vh;
  }
}

.hero-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 2rem;
  transition: opacity 0.5s ease;
}
.hero-overlay.idle { opacity: 0; }

.hero-controls {
  pointer-events: auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  font-family: var(--mono);
  font-size: 13px;
}

.hero-controls button {
  background: none;
  border: none;
  color: var(--text);
  cursor: pointer;
  font: inherit;
  padding: 0;
}
.hero-controls button:hover { color: var(--accent); }
#hero-mute-btn { margin-left: 1rem; }

.scrub-bar {
  flex-grow: 1;
  height: 4px;
  background: color-mix(in srgb, var(--text) 25%, transparent);
  margin: 0 2rem;
  cursor: pointer;
  position: relative;
}
.scrub-progress {
  height: 100%;
  background: var(--accent);
  width: 0%;
}

/* push the scrolling content below the fixed hero */
.ramp-section {
  margin-top: 100vh;
  height: 0;
  position: relative;
  z-index: 5;
}
@media (max-width: 768px), (orientation: portrait) {
  /* in-flow hero on mobile (see hero rules above) — no 100vh ramp; this
     override must come after the base rule, same specificity */
  .ramp-section { margin-top: 0; }
}

.case-main {
  position: relative;
  z-index: 5;
  /* translucent so the fixed hero stays visible through the scrolling page */
  background: color-mix(in srgb, var(--bg) 55%, transparent);
}

/* text-bearing sections keep a darker backdrop for readability */
.overview-section,
.audio-section,
.credits-section,
.related-projects-section {
  background: color-mix(in srgb, var(--bg) 90%, transparent);
  border-radius: 6px;
}

#app .site-footer {
  position: relative;
  z-index: 5;
  background: var(--bg);
}

/* over the full-screen hero the top bar stays out of the way until the
   visitor moves or scrolls into the content — same idle as the playhead */
.site-header { transition: opacity 0.5s ease; }
.site-header.idle {
  opacity: 0;
  pointer-events: none;
}
@media (max-width: 768px) {
  /* no full-screen hero on mobile, so the header never hides */
  .site-header.idle {
    opacity: 1;
    pointer-events: auto;
  }
}

/* ---------- overview ---------- */
.overview-section { max-width: 880px; }

.overview-content {
  font-size: clamp(16px, 1.3vw, 19px);
  line-height: 1.7;
}
.overview-content p { margin-bottom: 1.5em; }
.overview-content p:last-child { margin-bottom: 0; }
.overview-content a {
  color: var(--accent);
  border-bottom: 1px solid transparent;
  transition: border-color 0.15s;
}
.overview-content a:hover { border-color: var(--accent); }

/* ---------- other videos ---------- */
.other-videos-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 1fr));
  gap: 2rem;
}

.video-thumb { position: relative; cursor: pointer; }

.video-thumb-preview {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  pointer-events: none;
  border: 1px solid var(--line);
  border-radius: 6px;
  transition: border-color 0.15s;
}
.video-thumb:hover .video-thumb-preview { border-color: var(--accent); }

.video-thumb-title {
  margin-top: 0.5rem;
  font-family: var(--mono);
  font-size: 13px;
  color: var(--text-dim);
}

/* ---------- audio ---------- */
.audio-section { max-width: 1000px; }

.audio-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.audio-player {
  display: flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 1rem;
  width: 100%;
  font-family: var(--mono);
  font-size: 13px;
  transition: border-color 0.15s;
}
.audio-player:hover { border-color: var(--accent); }

.audio-player button {
  background: none;
  border: none;
  color: var(--text);
  cursor: pointer;
  font: inherit;
  padding: 0;
}
.audio-player button:hover { color: var(--accent); }
.audio-play-btn { padding-right: 1rem; }
.audio-title { min-width: 150px; }
.audio-scrub-bar { flex-grow: 1; margin: 0 1rem; }
.audio-timecode { min-width: 40px; text-align: right; }
.audio-mute-btn { margin-left: 1rem; }

/* ---------- posters ---------- */
.poster-section {
  display: flex;
  flex-direction: column;
  gap: 2rem;
  align-items: center;
  width: 100%;
}

.poster-row {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 2rem;
  width: 100%;
}

.poster-img {
  max-height: 80vh;
  max-width: 100%;
  height: auto;
  width: auto;
  flex: 0 1 auto;
  min-width: 0;
  cursor: pointer;
  border: 1px solid var(--line);
  border-radius: 6px;
  transition: border-color 0.15s;
}
.poster-img:hover { border-color: var(--accent); }

/* ---------- carousel ---------- */
.carousel-section {
  overflow: hidden;
  padding-left: 0 !important;
  padding-right: 0 !important;
}
.carousel-label { margin-left: var(--pad); }

.carousel-track {
  display: flex;
  gap: 2rem;
  padding: 0 var(--pad);
  width: max-content;
  cursor: grab;
}
.carousel-track:active { cursor: grabbing; }

.carousel-img {
  height: 40vh;
  width: auto;
  object-fit: contain;
  border: 1px solid var(--line);
  border-radius: 6px;
  transition: border-color 0.15s, box-shadow 0.15s;
  user-select: none;
}
.carousel-img:hover {
  border-color: var(--accent);
  box-shadow: 0 0 15px color-mix(in srgb, var(--accent) 25%, transparent);
  cursor: pointer;
}

/* ---------- roles ---------- */
.credits-section {
  max-width: 880px;
  margin: 0 auto;
}

.credits-list { border-top: 1px solid var(--line); }

.credit-row {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 2rem;
  padding: 1rem 0;
  border-bottom: 1px solid var(--line);
  font-family: var(--mono);
  font-size: 14px;
}

.credit-role {
  color: var(--text-dim);
  text-transform: uppercase;
  text-align: right;
  flex: 1;
}
.credit-separator { color: var(--accent); flex: 0 0 auto; }
.credit-name {
  text-transform: uppercase;
  text-align: left;
  flex: 1;
}

/* ---------- related projects ---------- */
.related-projects-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
}
@media (max-width: 768px) {
  .related-projects-grid { grid-template-columns: 1fr; }
}

.related-project {
  display: block;
  font-family: var(--mono);
  font-size: 14px;
  color: var(--text-dim);
  transition: color 0.15s;
}
.related-project:hover { color: var(--accent); }

.related-project img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border: 1px solid var(--line);
  border-radius: 6px;
  margin-bottom: 0.5rem;
  transition: border-color 0.15s;
}
.related-project:hover img { border-color: var(--accent); }

/* ---------- lightbox ---------- */
.lightbox {
  position: fixed;
  inset: 0;
  background: var(--bg);
  z-index: 9999;
  display: none;
  align-items: center;
  justify-content: center;
}
.lightbox.active { display: flex; }

.lightbox-img {
  max-width: 90vw;
  max-height: 90vh;
  object-fit: contain;
  animation: lightbox-fade-in 0.3s ease;
}

.lightbox button {
  background: none;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--text);
  padding: 0.5rem 1rem;
  cursor: pointer;
  font-family: var(--mono);
  font-size: 13px;
  transition: border-color 0.15s, color 0.15s;
}
.lightbox button:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.lightbox-close {
  position: absolute;
  top: 2rem;
  left: 2rem;
}

.lightbox-nav {
  position: absolute;
  bottom: 2rem;
  right: 2rem;
  display: flex;
  gap: 1rem;
}

@keyframes lightbox-fade-in {
  from { opacity: 0; transform: scale(0.98); }
  to { opacity: 1; transform: scale(1); }
}
