/* Organizations page: photo sections, tension lists, 90-day track and entrance motion.
   Built on the homepage.css tokens; loaded after homepage.css. Motion is driven by assets/js/page-motion.js. */

/* ── Text over a photo, with a gradient ────────────────────── */

.photo-feature {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  padding: clamp(5rem, 11vw, 10rem) 0 clamp(4rem, 8vw, 7rem);
  background: var(--color-dark);
}

.photo-feature__bg {
  position: absolute;
  inset: -9% 0;
  z-index: -2;
}

.photo-feature__bg img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: var(--pos, 50% 40%);
}

.photo-feature::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(90deg, rgba(19, 35, 45, 0.94) 0%, rgba(19, 35, 45, 0.82) 38%, rgba(19, 35, 45, 0.45) 72%, rgba(19, 35, 45, 0.3) 100%),
    linear-gradient(180deg, rgba(19, 35, 45, 0.55) 0%, rgba(19, 35, 45, 0) 30%, rgba(19, 35, 45, 0) 62%, var(--color-dark) 100%);
}

.photo-feature__copy {
  max-width: 38rem;
}

.photo-feature h2 {
  margin-bottom: 1.25rem;
  color: var(--color-white);
  font-size: clamp(2.25rem, 1.5rem + 3.2vw, 4.25rem);
  line-height: 1.05;
}

/* ── Strip of four ─────────────────────────────────────────── */

.hq-strip {
  background: var(--color-dark);
  padding: clamp(2.25rem, 4vw, 3.5rem) 0 0;
}

.hq-strip__label {
  margin: 0 0 1.25rem;
  padding-inline: var(--gutter);
  text-align: center;
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--color-highlight);
}

.hq-strip__grid {
  display: grid;
  grid-template-columns: 1fr 1.35fr 1.5fr 1fr 1fr;
  gap: 4px;
}

.hq-strip figure {
  position: relative;
  height: clamp(13rem, 21vw, 18rem);
  margin: 0;
  overflow: hidden;
}

.hq-strip img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: var(--pos, 50% 35%);
  transition: transform 700ms cubic-bezier(0.16, 1, 0.3, 1);
}

.hq-strip figure::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(19, 35, 45, 0) 55%, rgba(19, 35, 45, 0.82) 100%);
  pointer-events: none;
}

.hq-strip figure:hover img {
  transform: scale(1.06);
}

.hq-strip figcaption {
  position: absolute;
  bottom: 1rem;
  left: 1.1rem;
  z-index: 1;
  color: var(--color-white);
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

/* ── Lists with presence ───────────────────────────────────── */

.tension-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin: 1.75rem 0 0;
  padding: 0;
  list-style: none;
  max-width: var(--container-reading);
}

.tension-list li {
  padding: 1rem 1.25rem;
  border-left: 3px solid var(--color-accent);
  border-radius: 0 var(--radius-control) var(--radius-control) 0;
  background: var(--color-surface);
  box-shadow: 0 1px 0 var(--color-border);
  font-size: var(--text-md);
  line-height: 1.45;
  color: var(--color-dark);
}

/* ── 90-day track ──────────────────────────────────────────── */

.phase-track {
  position: relative;
  margin: clamp(2.5rem, 5vw, 4rem) 0 clamp(2rem, 4vw, 3rem);
  padding-top: 2.25rem;
}

.phase-track__line {
  position: absolute;
  top: 0.55rem;
  left: 0;
  right: 0;
  height: 2px;
  background: rgba(255, 255, 255, 0.18);
}

.phase-track__fill {
  position: relative;
  display: block;
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, var(--color-brand), var(--color-highlight));
  box-shadow: 0 0 12px 1px rgba(185, 228, 238, 0.55);
  transition: width 2400ms linear;
}

/* Glowing head that travels with the leading edge, then fades out. */
.phase-track__fill::after {
  content: "";
  position: absolute;
  top: 50%;
  right: -6px;
  width: 12px;
  height: 12px;
  transform: translateY(-50%);
  border-radius: 50%;
  background: var(--color-white);
  box-shadow: 0 0 16px 7px rgba(185, 228, 238, 0.85);
  transition: opacity 500ms ease 2400ms;
}

.phase-track.is-in .phase-track__fill {
  width: 100%;
}

.phase-track.is-in .phase-track__fill::after {
  opacity: 0;
}

/* After the draw, a soft light keeps sweeping along the line. */
.phase-track__line::after {
  content: "";
  position: absolute;
  top: -3px;
  bottom: -3px;
  left: 0;
  width: 18%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.85), transparent);
  opacity: 0;
  filter: blur(2px);
}

.phase-track.is-in .phase-track__line::after {
  animation: track-sheen 5.5s ease-in-out 2.8s infinite;
}

@keyframes track-sheen {
  0% { transform: translateX(-120%); opacity: 0; }
  15% { opacity: 1; }
  85% { opacity: 1; }
  100% { transform: translateX(560%); opacity: 0; }
}

.phase-track ol {
  display: flex;
  justify-content: space-between;
  margin: 0;
  padding: 0;
  list-style: none;
}

.phase-track li {
  position: relative;
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-on-dark-muted);
}

.phase-track li::before {
  content: "";
  position: absolute;
  top: -2.1rem;
  left: 0;
  width: 0.7rem;
  height: 0.7rem;
  border: 2px solid var(--color-highlight);
  border-radius: 50%;
  background: var(--color-dark);
  transition: background-color 300ms ease, box-shadow 300ms ease;
  transition-delay: calc(var(--n, 0) * 800ms);
}

.phase-track li:nth-child(2) { --n: 1; }
.phase-track li:nth-child(3) { --n: 2; }
.phase-track li:nth-child(4) { --n: 3; }

.phase-track.is-in li::before {
  background: var(--color-highlight);
  box-shadow: 0 0 12px 3px rgba(185, 228, 238, 0.7);
}

.phase-track li:last-child {
  text-align: right;
}

.phase-track li:last-child::before {
  left: auto;
  right: 0;
}

.phase-days {
  display: block;
  margin-top: 0.15rem;
  color: var(--color-highlight);
  font-style: normal;
}

/* ── Entrance motion (driven by page-motion.js) ────────────── */

.motion-ready [data-stagger] > * {
  opacity: 0;
  transform: translateY(1.4rem);
  transition: opacity 700ms ease, transform 800ms cubic-bezier(0.16, 1, 0.3, 1);
  transition-delay: calc(var(--i, 0) * 90ms);
}

.motion-ready [data-stagger].is-in > * {
  opacity: 1;
  transform: none;
}

[data-parallax] {
  will-change: transform;
}

@media (max-width: 56rem) {
  .hq-strip__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .hq-strip figure:last-child {
    grid-column: 1 / -1;
  }

  .hq-strip figure {
    height: clamp(12rem, 44vw, 18rem);
  }

  .photo-feature::after {
    background:
      linear-gradient(180deg, rgba(19, 35, 45, 0.88) 0%, rgba(19, 35, 45, 0.78) 60%, var(--color-dark) 100%);
  }
}

@media (prefers-reduced-motion: reduce) {
  .motion-ready [data-stagger] > * {
    transform: none;
    transition: opacity 500ms ease;
    transition-delay: calc(var(--i, 0) * 60ms);
  }

  .phase-track__line::after {
    display: none;
  }

  .hq-strip img {
    transition: none;
  }

  .hq-strip figure:hover img {
    transform: none;
  }
}

/* ── Hero with looping video beneath a gradient ────────────── */

.hero-video {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  padding-bottom: clamp(4rem, 8vw, 7rem);
}

.hero-video__media {
  position: absolute;
  inset: -10% 0;
  z-index: -2;
}

.hero-video__media video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 40%;
  transition: opacity 700ms ease;
}

.hero-video__media video.is-fading {
  opacity: 0;
}

.hero-video::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(90deg, rgba(19, 35, 45, 0.78) 0%, rgba(19, 35, 45, 0.9) 42%, rgba(19, 35, 45, 0.5) 100%),
    linear-gradient(180deg, rgba(19, 35, 45, 0.2) 0%, rgba(19, 35, 45, 0) 45%, var(--color-dark) 100%);
}

/* ── Mid-page call to action ───────────────────────────────── */

.mid-cta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem 2rem;
  margin-top: clamp(2.5rem, 5vw, 4rem);
  padding: 1.75rem 0 0;
  border-top: 1px solid rgba(255, 255, 255, 0.2);
}

.mid-cta p {
  margin: 0;
  color: var(--color-white);
  font-size: var(--text-lg);
  font-weight: 600;
  line-height: 1.3;
}

.mid-cta .button {
  margin-top: 0;
}

/* ── Final call to action over a team photo ────────────────── */

.final-photo {
  position: relative;
  isolation: isolate;
  overflow: hidden;
}

.final-photo__bg {
  position: absolute;
  inset: -9% 0;
  z-index: -2;
}

.final-photo__bg img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: var(--pos, 50% 40%);
}

.final-photo::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(90deg, rgba(19, 35, 45, 0.95) 0%, rgba(19, 35, 45, 0.84) 45%, rgba(19, 35, 45, 0.55) 100%),
    linear-gradient(180deg, var(--color-dark) 0%, rgba(19, 35, 45, 0) 25%);
}

@media (max-width: 56rem) {
  .final-photo::after {
    background: linear-gradient(180deg, rgba(19, 35, 45, 0.9) 0%, rgba(19, 35, 45, 0.82) 100%);
  }
}

@media (prefers-reduced-motion: reduce) {
  .hero-video__media video {
    transition: none;
  }
}

/* ── Quotes ────────────────────────────────────────────────── */

.tm-voices {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.tm-voices .quote-card {
  display: flex;
  flex-direction: column;
  margin: 0;
}

.tm-voices blockquote.quote-card__text {
  flex: 1;
  margin: 0 0 1.5rem;
  padding: 0;
  border: 0;
  font-size: var(--text-base);
  line-height: 1.65;
}

.tm-voices figcaption {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

@media (max-width: 64rem) {
  .tm-voices {
    grid-template-columns: 1fr;
  }
}

/* ── Photo caption and video pause control ─────────────────── */

.photo-break__caption {
  position: absolute;
  bottom: clamp(1rem, 2.5vw, 1.75rem);
  left: max(var(--gutter), calc((100% - var(--container-main)) / 2));
  z-index: 1;
  margin: 0;
  color: var(--color-white);
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.photo-break--captioned::after {
  background: linear-gradient(180deg, rgba(19, 35, 45, 0.05) 45%, rgba(19, 35, 45, 0.75) 100%);
}

.hero-video__toggle {
  position: absolute;
  right: var(--gutter);
  bottom: 1rem;
  z-index: 1;
  padding: 0.45rem 0.9rem;
  border: 1px solid rgba(197, 209, 214, 0.4);
  border-radius: var(--radius-control);
  background: rgba(19, 35, 45, 0.6);
  color: var(--color-on-dark);
  font: inherit;
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.06em;
  cursor: pointer;
}

.hero-video__toggle:hover,
.hero-video__toggle:focus-visible {
  border-color: var(--color-highlight);
  color: var(--color-white);
  outline: 0;
  box-shadow: var(--focus-ring);
}

/* ── Three items in a row ──────────────────────────────────── */

@media (min-width: 56rem) {
  .detail-list--row {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0 clamp(1.5rem, 3vw, 3rem);
  }
}

/* ── Light-blue band ───────────────────────────────────────── */

.chapter--sky {
  background: var(--color-highlight);
  color: var(--color-dark);
}

.chapter--sky .eyebrow {
  color: var(--color-brand);
}

.chapter--sky .quote-card {
  border-color: transparent;
  background: var(--color-white);
  box-shadow: 0 0.6rem 1.8rem rgba(19, 35, 45, 0.12);
}
