/* Project pages (projects/*.html)
   Mobile first: the base rules are for phones, the 861px media query adds the desktop layout. */


/* Player layout */

.player {
  position: relative;
  height: 100vh;
  min-height: 38.75rem;
  overflow: hidden;
  background: var(--black);
  color: var(--cream);
  font-family: var(--font-body);
  font-size: 1rem;
}

.player-scroll {
  position: absolute;
  inset: 0;
  overflow-y: auto;
  padding-bottom: 6.875rem;
  box-sizing: border-box;
}

a {
  color: var(--cream);
}


/* Hero */

.hero {
  position: relative;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
  padding: 5.5rem 1.25rem 0.5rem;
  overflow: hidden;
  background: var(--black);
}

.hero-media {
  position: relative;
  align-items: center;
  width: 100%;
  height: min(38vh, 25rem);
}

.hero-media img {
  border-radius: 0.75rem;
}

.hero-media-contain,
.hero-media-phones {
  display: flex;
  justify-content: center;
  align-items: center;
}

.hero-media-img {
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.hero-cover-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.hero-cover-fade {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, var(--black) 0%, rgb(var(--black-rgb) / 0.55) 18%, rgb(var(--black-rgb) / 0) 42%), linear-gradient(0deg, var(--black) 0%, rgb(var(--black-rgb) / 0) 28%);
}

.player-top {
  position: absolute;
  z-index: 2;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  padding: clamp(0.875rem, 2.4vw, 1.75rem) var(--edge);
}

.back-button {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 2.75rem;
  padding: 0 0.875rem;
  border-radius: 0.625rem;
  background: rgb(var(--black-rgb) / 0.6);
  font-weight: 600;
  text-decoration: none;
}

.now-playing {
  margin: 0;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.375rem 0.75rem;
  border-radius: 0.375rem;
  background: var(--blue);
  color: var(--black);
  font-weight: 700;
  font-size: 0.8125rem;
  letter-spacing: 0.06em;
}

.hero-text {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
  margin-top: 1.25rem;
}

.hero-kind {
  margin: 0;
  font-size: 0.875rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--blue);
}

.hero-title {
  margin: 0;
  font-family: var(--font-heading);
  font-size: clamp(2rem, 9vw, 2.75rem);
  line-height: 1;
  letter-spacing: -0.02em;
}

.hero-summary {
  margin: 0;
  font-size: clamp(1rem, 1.3vw, 1.1875rem);
  line-height: 1.5;
  color: var(--warm-grey);
}

.hero-meta {
  margin: 0;
  font-size: 0.875rem;
  color: var(--grey);
}

.scroll-cue {
  display: inline-flex;
  align-self: flex-start;
  align-items: center;
  gap: 0.625rem;
  min-height: 2.75rem;
  margin-top: 0.375rem;
  font-weight: 600;
  text-decoration: none;
}

.scroll-cue-icon {
  display: inline-flex;
  animation: scroll-cue 1.8s ease-in-out infinite;
}

@keyframes scroll-cue {
  0%, 100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(6px);
  }
}


/* Chapters */

.chapter {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  max-width: 70rem;
  margin: 0 auto;
  padding: 6rem clamp(1.25rem, 4vw, 3.5rem) 0;
}

.chapter-number {
  margin: 0;
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  color: var(--blue);
}

.chapter-title {
  margin: 0;
  font-family: var(--font-heading);
  font-size: clamp(1.75rem, 2.6vw, 2.375rem);
  line-height: 1.1;
}

.chapter-text {
  max-width: 47.5rem;
  margin: 0;
  font-size: 1.125rem;
  line-height: 1.7;
  color: var(--warm-grey);
}

.bullet-list {
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
  max-width: 51.25rem;
  margin: 0;
  padding-left: 1.25rem;
  font-size: 1.125rem;
  line-height: 1.6;
  color: var(--warm-grey);
}

.highlight {
  color: var(--blue);
}


/* Quotes, facts and cards */

.pull-quote {
  margin: 0;
  padding: 1.75rem 2rem;
  border-left: 4px solid var(--blue);
  border-radius: 0 0.875rem 0.875rem 0;
  background: var(--card);
  font-family: var(--font-heading);
  font-size: clamp(1.375rem, 2.2vw, 1.875rem);
  line-height: 1.35;
}

.facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(11.875rem, 1fr));
  gap: 0.75rem;
  margin: 0;
}

.card {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 1.25rem;
  border: 1px solid var(--line-soft);
  border-radius: 0.875rem;
  background: var(--card);
}

.fact-term {
  font-size: 0.8125rem;
  color: var(--grey);
}

.fact-value {
  margin: 0;
  font-weight: 600;
}

.card-list {
  display: grid;
  gap: 0.75rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.card-list-wide {
  grid-template-columns: repeat(auto-fit, minmax(18.75rem, 1fr));
}

.card-list-narrow {
  grid-template-columns: repeat(auto-fit, minmax(15.625rem, 1fr));
}

.card-number {
  font-family: var(--font-heading);
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--blue);
}

.card-title {
  font-weight: 600;
}

.card-text {
  line-height: 1.55;
  color: var(--grey);
}

.persona-name {
  font-family: var(--font-heading);
  font-size: 1.375rem;
  font-weight: 700;
}

.persona-text {
  line-height: 1.6;
  color: var(--warm-grey);
}


/* Findings table */

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line-soft);
  border-radius: 0.875rem;
  background: var(--card);
}

.findings-table {
  width: 100%;
  min-width: 40rem;
  border-collapse: collapse;
  font-size: 0.9375rem;
}

.table-head {
  padding: 0.75rem;
  border-bottom: 1px solid var(--line-mid);
  text-align: left;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--grey);
}

.table-cell {
  padding: 0.875rem 0.75rem;
  border-bottom: 1px solid var(--line-soft);
  vertical-align: top;
  line-height: 1.5;
}


/* Images, zoom and video */

.image-grid {
  display: grid;
  gap: 1rem;
  align-items: start;
}

.image-grid-small {
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
}

.image-grid-large {
  grid-template-columns: repeat(auto-fit, minmax(18.75rem, 1fr));
}

.image-grid-medium {
  grid-template-columns: repeat(auto-fit, minmax(20rem, 1fr));
}

.figure,
.video-figure {
  margin: 0;
}

.figure-wide {
  max-width: 100%;
}

.figure-narrow {
  max-width: 32.5rem;
}

.zoom-button {
  position: relative;
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  border-radius: 0.75rem;
  background: none;
  cursor: zoom-in;
}

.zoom-image,
.video {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--line);
  border-radius: 0.75rem;
}

.zoom-image {
  transition: filter 0.2s ease;
}

.zoom-button:hover .zoom-image {
  filter: brightness(1.06);
}

.zoom-hint {
  position: absolute;
  right: 0.625rem;
  bottom: 0.625rem;
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.375rem 0.625rem;
  border-radius: 999px;
  background: rgb(var(--black-rgb) / 0.78);
  color: var(--cream);
  font: 600 0.75rem Inter, sans-serif;
  opacity: 0.85;
  transition: opacity 0.2s ease;
}

.zoom-button:hover .zoom-hint,
.zoom-button:focus-visible .zoom-hint {
  opacity: 1;
}

.caption {
  margin: 0.5rem 0 0;
  font-size: 0.875rem;
  color: var(--grey);
}

.video {
  background: var(--shadow);
}


/* End card */

.end {
  max-width: 70rem;
  margin: 0 auto;
  padding: 7.5rem clamp(1.25rem, 4vw, 3.5rem) 2.5rem;
}

.end-card {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  padding: clamp(1.75rem, 4vw, 3rem);
  border: 1px solid var(--line);
  border-radius: 1.25rem;
  background: var(--card);
}

.end-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}


/* Buttons (shape comes from .btn in style.css) */

.player-btn {
  cursor: pointer;
  transition: background-color 0.2s ease, transform 0.15s ease;
}

.player-btn:hover {
  background-color: rgb(var(--cream-rgb) / 0.14);
}

.player-btn:active {
  transform: scale(0.96);
}

.btn-large {
  min-height: 3rem;
  padding: 0 1.25rem;
}

.btn-small {
  min-height: 2.75rem;
  padding: 0 1rem;
}

.btn-outline {
  border: 1px solid var(--line-strong);
  background-color: transparent;
  color: var(--cream);
}

.btn-cream {
  border: 0;
  background-color: var(--cream);
  color: var(--black);
}

.btn-blue {
  min-height: 3rem;
  padding: 0 1.375rem;
  background: var(--blue);
  color: var(--black);
  font-weight: 700;
}

.replay-button {
  gap: 0.5rem;
  font: 600 0.9375rem Inter, sans-serif;
}

.lightbox-button {
  gap: 0.5rem;
  font: 600 0.875rem Inter, sans-serif;
}

.lightbox-close {
  font-weight: 700;
}


/* Bottom player bar */

.player-bar {
  position: absolute;
  z-index: 5;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 0.75rem var(--edge) clamp(0.75rem, 1.6vw, 1.125rem);
  border-top: 1px solid var(--line-dark);
  background: var(--black);
}

.progress-track {
  position: relative;
  height: 1.25rem;
  margin-bottom: 0.375rem;
}

.progress {
  position: absolute;
  left: 0;
  right: 0;
  top: 0.4375rem;
  height: 0.375rem;
  border-radius: 3px;
  background: rgb(var(--cream-rgb) / 0.22);
}

.progress-fill {
  width: 0%;
  height: 100%;
  border-radius: 3px;
  background: var(--red);
}

/* Chapter dots on the progress bar (created by js/project.js) */
.chapter-dot {
  position: absolute;
  top: 0.625rem;
  width: 0.75rem;
  height: 0.75rem;
  padding: 0;
  border: 2px solid var(--black);
  border-radius: 50%;
  background: var(--cream);
  transform: translate(-50%, -50%);
  cursor: pointer;
  transition: transform 0.15s ease, background-color 0.2s ease;
}

.chapter-dot:hover {
  transform: translate(-50%, -50%) scale(1.5);
}

.chapter-dot.is-passed {
  background: var(--red);
}

.player-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 1rem;
}

.skip-button {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  width: 2.75rem;
  height: 2.75rem;
  border: 0;
  border-radius: 0.5rem;
  background: transparent;
  color: var(--cream);
}

.player-time {
  font-size: 0.875rem;
  font-variant-numeric: tabular-nums;
  color: var(--cream);
}

.player-total,
.player-dot {
  color: var(--grey);
}

.player-dot,
.player-chapter {
  font-size: 0.875rem;
}

.player-chapter {
  font-weight: 600;
}

.player-title {
  display: none;
}

.spacer {
  flex: 1 1 auto;
}


/* Lightbox (opened by js/project.js) */

.lightbox {
  position: absolute;
  z-index: 50;
  inset: 0;
  display: flex;
  flex-direction: column;
  background: rgb(var(--deep-rgb) / 0.95);
}

.lightbox-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.625rem 1rem;
  padding: 0.75rem clamp(0.75rem, 2.4vw, 1.75rem);
  border-bottom: 1px solid var(--line-soft);
}

.lightbox-caption {
  flex: 1 1 16.25rem;
  min-width: 0;
  margin: 0;
  font-size: 0.875rem;
  color: var(--warm-grey);
}

.lightbox-stage {
  display: flex;
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  padding: 1rem;
}

/* Fit to screen, or actual size when .is-full is added */
.lightbox-image-button {
  display: flex;
  max-width: 100%;
  max-height: 100%;
  margin: auto;
  padding: 0;
  border: 0;
  background: none;
  cursor: zoom-in;
}

.lightbox-image-button.is-full {
  display: block;
  max-width: none;
  max-height: none;
  cursor: zoom-out;
}

.lightbox-image {
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: calc(100vh - 10rem);
  object-fit: contain;
  border-radius: 0.5rem;
}

.lightbox-image.is-full {
  max-width: none;
  max-height: none;
}

.lightbox-hint {
  margin: 0;
  padding: 0.5rem 1rem 0.75rem;
  text-align: center;
  font-size: 0.75rem;
  color: var(--grey-dark);
}


/* Keyboard focus */

a:focus-visible,
button:focus-visible,
.player-scroll:focus-visible {
  outline: 3px solid var(--blue);
  outline-offset: -3px;
}

.zoom-button:focus-visible {
  outline: 3px solid var(--blue);
  outline-offset: 3px;
}


/* Desktop: full-screen hero with text over the image */

@media (min-width: 861px) {
  .player-scroll {
    padding-bottom: 8.75rem;
  }

  .hero {
    display: block;
    height: 100%;
    min-height: 35rem;
    padding: 0;
  }

  .hero-media {
    position: absolute;
    height: auto;
  }

  .hero-media img {
    border-radius: 0;
  }

  .hero-media-contain,
  .hero-media-phones {
    top: 5.25rem;
    right: clamp(0.75rem, 3vw, 3rem);
    width: 56%;
  }

  .hero-media-contain {
    bottom: 6rem;
  }

  .hero-media-phones {
    bottom: 0;
    align-items: flex-end;
  }

  .hero-media-cover {
    top: 0;
    right: 0;
    bottom: 0;
    width: 64%;
  }

  .hero-text {
    position: absolute;
    left: var(--edge);
    max-width: min(38%, 35rem);
    gap: 0.875rem;
    margin-top: 0;
  }

  .hero-text-centre {
    top: calc(50% - 6px);
    transform: translateY(-50%);
  }

  .hero-text-bottom {
    bottom: 14%;
  }

  .hero-title {
    font-size: clamp(2.25rem, 4.4vw, 4rem);
  }

  .player-bar {
    padding-top: 1.625rem;
    border-top: 0;
    background: linear-gradient(0deg, rgb(var(--shadow-rgb) / 0.92) 0%, rgb(var(--shadow-rgb) / 0.75) 60%, rgb(var(--shadow-rgb) / 0) 100%);
  }

  .player-title {
    display: inline;
  }
}


/* Less motion for people who ask for it */

@media (prefers-reduced-motion: reduce) {
  .scroll-cue-icon {
    animation: none;
  }

  .player-btn:active {
    transform: none;
  }
}
