/* =============================================================================
   Open Hearts — Projects page  (spec-exact rebuild)
   Palette: #0f2040  #1e3a6e  #2d5fa8  #f0f4ff  #0f172a  #64748b  white
   Fonts:   var(--font-serif) · var(--font-sans)
   ============================================================================= */

/* ── Keyframes ────────────────────────────────────────────────────── */
@keyframes orbA {
  from { transform: translate(0, 0); }
  to   { transform: translate(60px, 40px); }
}
@keyframes orbB {
  from { transform: translate(0, 0); }
  to   { transform: translate(-50px, -30px); }
}
@keyframes stageFadeUp {
  from { opacity: 0; transform: scale(1.04); }
  to   { opacity: 1; transform: scale(1); }
}
@keyframes wordReveal {
  to { transform: translateY(0); }
}
@keyframes mountUp {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes bobScroll {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(8px); }
}
@keyframes drawLine {
  to { width: 56px; }
}

/* ── Fixed header strip ───────────────────────────────────────────── */
.pj-strip {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 50;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 24px 40px;
  mix-blend-mode: difference;
  color: #fff;
  pointer-events: none;
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.24em;
  text-transform: uppercase;
}
.pj-strip__cur {
  font-size: 14px;
  font-variant-numeric: tabular-nums;
}
.pj-strip__sep { opacity: 0.5; font-variant-numeric: tabular-nums; }


/* ── Intro panel ──────────────────────────────────────────────────── */
.pj-intro {
  position: relative;
  height: 55vh;
  min-height: 380px;
  background: #0f2040;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.pj-intro__orb {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
}
.pj-intro__orb--a {
  top: -20%; left: -10%;
  width: 600px; height: 600px;
  background: radial-gradient(circle, rgba(45,95,168,0.4), transparent 70%);
  filter: blur(40px);
  animation: orbA 14s ease-in-out infinite alternate;
}
.pj-intro__orb--b {
  bottom: -20%; right: -10%;
  width: 700px; height: 700px;
  background: radial-gradient(circle, rgba(30,58,110,0.6), transparent 70%);
  filter: blur(50px);
  animation: orbB 18s ease-in-out infinite alternate;
}
.pj-intro__body {
  position: relative;
  z-index: 1;
  text-align: center;
  max-width: 800px;
  padding: 0 40px;
}

/* Eyebrow */
.pj-intro__eyebrow {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.6);
  margin-bottom: 24px;
  opacity: 0;
}
.pj-intro__eyebrow.is-up {
  animation: mountUp 0.7s cubic-bezier(.2,.8,.2,1) forwards;
}

/* Headline word-reveal */
.pj-intro__hl {
  font-family: var(--font-serif);
  font-size: clamp(48px, 8vw, 120px);
  font-weight: 500;
  line-height: 1.02;
  letter-spacing: -0.02em;
  color: #fff;
  margin-bottom: 24px;
}
.pj-intro__hl .wm {
  display: inline-block;
  overflow: hidden;
  vertical-align: bottom;
}
.pj-intro__hl .wm > span {
  display: inline-block;
  transform: translateY(110%);
}
.pj-intro__hl.is-up .wm > span {
  animation: wordReveal 1s cubic-bezier(.2,.8,.2,1) var(--wd, 0s) both;
}

/* Lede */
.pj-intro__lede {
  font-size: 17px;
  line-height: 1.7;
  max-width: 540px;
  margin: 0 auto 48px;
  color: rgba(255,255,255,0.75);
  opacity: 0;
}
.pj-intro__lede.is-up {
  animation: mountUp 0.7s cubic-bezier(.2,.8,.2,1) 0.9s forwards;
}

/* Scroll indicator */
.pj-intro__scroll {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}
.pj-intro__sl {
  width: 1px; height: 50px;
  background: rgba(255,255,255,0.4);
  animation: bobScroll 2s ease-in-out infinite;
}
.pj-intro__slabel {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.4);
}

/* ── About section ────────────────────────────────────────────────── */
.proj-about {
  background: #07111f;
  padding: 96px 40px 112px;
  position: relative;
  overflow: hidden;
}

/* subtle diagonal grain */
.proj-about::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: repeating-linear-gradient(
    -55deg,
    transparent,
    transparent 80px,
    rgba(255,255,255,0.013) 80px,
    rgba(255,255,255,0.013) 81px
  );
  pointer-events: none;
}

.proj-about__inner {
  max-width: 960px;
  margin: 0 auto;
  position: relative;
  z-index: 1;
}

.proj-about__tag {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.35);
  margin-bottom: 36px;
}

.proj-about__headline {
  font-family: var(--font-serif);
  font-size: clamp(32px, 5.5vw, 74px);
  font-weight: 400;
  line-height: 1.08;
  letter-spacing: -0.025em;
  color: #fff;
  margin-bottom: 0;
}

.proj-about__hl-line {
  display: block;
}

.proj-about__hl-line--em {
  color: transparent;
  -webkit-text-stroke: 1px rgba(255,255,255,0.45);
  padding-left: clamp(24px, 4vw, 72px);
}

.proj-about__divider {
  width: 32px;
  height: 1px;
  background: rgba(255,255,255,0.2);
  margin: 40px 0;
}

.proj-about__statements {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: start;
  border-top: 1px solid rgba(255,255,255,0.08);
  padding-top: 36px;
}

.proj-about__stmt {
  font-size: clamp(15px, 1.5vw, 18px);
  line-height: 1.72;
  color: rgba(255,255,255,0.55);
  margin: 0;
}

.proj-about__stmt--belief {
  color: rgba(255,255,255,0.45);
}

.proj-about__stmt--belief strong {
  color: #fff;
  font-weight: 500;
}

@media (max-width: 680px) {
  .proj-about { padding: 64px 24px 72px; }
  .proj-about__statements { grid-template-columns: 1fr; gap: 20px; }
  .proj-about__hl-line--em { padding-left: 16px; }
}

/* ── Chapters ─────────────────────────────────────────────────────── */
.chapter {
  position: relative;
  min-height: 60vh;
  padding: 72px 0;
  display: flex;
  align-items: center;
  overflow-x: clip;
}
.chapter--light {
  background: #f0f4ff;
  --ch-text:    #0f172a;
  --ch-muted:   #64748b;
  --ch-ey-line: #0f2040;
  --ch-ey-lbl:  #2d5fa8;
  --ch-blurb:   #0f2040;
  --ch-wm:      rgba(15,32,64,0.07);
  --ch-shadow:  0 30px 80px -30px rgba(15,32,64,0.35);
}
.chapter--dark {
  background: #0f2040;
  --ch-text:    #fff;
  --ch-muted:   rgba(255,255,255,0.7);
  --ch-ey-line: rgba(255,255,255,0.4);
  --ch-ey-lbl:  rgba(255,255,255,0.7);
  --ch-blurb:   rgba(255,255,255,0.85);
  --ch-wm:      rgba(255,255,255,0.07);
  --ch-shadow:  0 30px 80px -30px rgba(0,0,0,0.6);
}

/* Background watermark */
.chapter__wm {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  font-family: var(--font-serif);
  font-size: clamp(280px, 36vw, 560px);
  font-weight: 500;
  line-height: 1;
  color: var(--ch-wm);
  user-select: none;
  pointer-events: none;
  opacity: 1;
}
.chapter--light .chapter__wm { left: -20px; right: auto; }
.chapter--dark  .chapter__wm { right: -20px; left: auto; }

/* Two-col grid */
.chapter__grid {
  display: grid;
  grid-template-columns: 0.75fr 2fr;
  gap: 56px;
  max-width: none;
  width: 100%;
  margin: 0;
  padding-left: clamp(40px, 5vw, 120px);
  padding-right: 0;
  align-items: center;
  position: relative;
  z-index: 1;
}
.chapter__grid--rtl {
  direction: rtl;
  padding-left: 0;
  padding-right: clamp(40px, 5vw, 120px);
}
.chapter__grid--rtl > * { direction: ltr; }

/* ── Text column ── */
.chapter__ey {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}
.chapter__ey-line {
  display: inline-block;
  width: 0; height: 1px;
  background: var(--ch-ey-line);
  vertical-align: middle;
  flex-shrink: 0;
}
.chapter.is-in .chapter__ey-line {
  animation: drawLine 1s cubic-bezier(.2,.8,.2,1) 0.2s forwards;
}
.chapter__ey-label {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--ch-ey-lbl);
  white-space: nowrap;
}

.chapter__name {
  font-family: var(--font-serif);
  font-size: clamp(40px, 5.6vw, 78px);
  font-weight: 500;
  line-height: 1.02;
  letter-spacing: -0.02em;
  text-transform: uppercase;
  color: var(--ch-text);
  margin-bottom: 20px;
}
.chapter__name .wm {
  display: inline-block;
  overflow: hidden;
  vertical-align: bottom;
}
.chapter__name .wm > span {
  display: inline-block;
  transform: translateY(105%);
}
.chapter.is-in .chapter__name .wm > span {
  animation: wordReveal 0.9s cubic-bezier(.2,.8,.2,1) var(--wd, 0.3s) both;
}

.chapter__blurb {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 18px;
  line-height: 1.65;
  max-width: 480px;
  color: var(--ch-blurb);
  margin-bottom: 14px;
  opacity: 0;
  transform: translateY(12px);
}
.chapter.is-in .chapter__blurb {
  animation: mountUp 0.7s cubic-bezier(.2,.8,.2,1) 0.7s forwards;
}

.chapter__body {
  font-size: 15px;
  line-height: 1.75;
  max-width: 480px;
  color: var(--ch-muted);
  margin-bottom: 18px;
  opacity: 0;
  transform: translateY(12px);
}
.chapter.is-in .chapter__body {
  animation: mountUp 0.7s cubic-bezier(.2,.8,.2,1) 0.85s forwards;
}

.chapter__cap {
  display: flex;
  align-items: center;
  gap: 3px;
  flex-wrap: wrap;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  color: var(--ch-text);
  opacity: 0;
}
.chapter.is-in .chapter__cap {
  animation: mountUp 0.7s cubic-bezier(.2,.8,.2,1) 1s forwards;
}
.cap__sep, .cap__dash { opacity: 0.5; }

/* ── Media column ── */
.chapter__stage {
  position: relative;
  aspect-ratio: 16/10;
  overflow: hidden;
  box-shadow: var(--ch-shadow);
}

#chapter-5 .chapter__stage {
  aspect-ratio: 4/3;
}
.chapter--light .chapter__stage { border-radius: 8px 0 0 8px; }
.chapter--dark  .chapter__stage { border-radius: 0 8px 8px 0; }
.stage__item {
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none;
}
.stage__item.is-active {
  opacity: 1;
  pointer-events: auto;
}
.stage__item.anim-in {
  animation: stageFadeUp 0.9s cubic-bezier(.2,.8,.2,1) both;
}
.stage__media {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
}
.stage__empty {
  background: linear-gradient(160deg, #0f2040, #1e3a6e);
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
}
.stage__initial {
  font-family: var(--font-serif);
  font-size: 130px;
  line-height: 0.85;
  color: rgba(255,255,255,0.07);
  user-select: none;
}

/* VIDEO chip */
.stage__chip {
  position: absolute;
  top: 12px; left: 12px;
  background: rgba(0,0,0,0.55);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.18em;
  padding: 5px 10px;
  border-radius: 999px;
  pointer-events: none;
  z-index: 2;
}

/* Mute toggle */
.stage__mute {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 4;
  display: none; /* shown by JS when videos present */
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background: rgba(0,0,0,0.45);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 50%;
  cursor: pointer;
  color: #fff;
  transition: background 0.2s, transform 0.15s;
  padding: 0;
}
.stage__mute:hover {
  background: rgba(0,0,0,0.7);
  transform: scale(1.08);
}
.stage__mute.has-video { display: flex; }

.stage__mute-svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}
/* default: show muted icon, hide unmuted */
.stage__mute-svg--on  { display: none; }
.stage__mute-svg--off { display: block; }
/* when audio is on */
.stage__mute.is-unmuted .stage__mute-svg--on  { display: block; }
.stage__mute.is-unmuted .stage__mute-svg--off { display: none; }

/* Inner ticks */
.stage__ticks {
  position: absolute;
  bottom: 16px; left: 16px; right: 16px;
  display: flex;
  gap: 6px;
  z-index: 2;
}
.stage__tick {
  flex: 1;
  height: 2px;
  border-radius: 1px;
  background: rgba(255,255,255,0.35);
  cursor: pointer;
  transition: background 0.3s;
}
.stage__tick.is-active { background: #fff; }

/* Prev / Next */
.stage__nav {
  position: absolute;
  top: 0; bottom: 0;
  width: 72px;
  background: transparent;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 3;
  transition: background 0.25s;
}
.stage__nav:hover { background: rgba(0,0,0,0.15); }
.stage__nav--prev { left: 0; }
.stage__nav--next { right: 0; }
.stage__nav::after {
  content: '';
  display: block;
  width: 18px; height: 18px;
  border-top: 2px solid rgba(255,255,255,0.9);
  border-right: 2px solid rgba(255,255,255,0.9);
  filter: drop-shadow(0 1px 4px rgba(0,0,0,0.6));
}
.stage__nav--prev::after { transform: rotate(-135deg) translate(-2px, 2px); }
.stage__nav--next::after { transform: rotate(45deg)  translate(-2px, 2px); }


/* ── Outro ────────────────────────────────────────────────────────── */
.pj-outro {
  background: #fff;
  min-height: 60vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 80px 40px;
  gap: 24px;
}
.pj-outro__eyebrow {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: #2d5fa8;
  margin: 0;
}
.pj-outro__heading {
  font-family: var(--font-serif);
  font-size: clamp(32px, 4vw, 52px);
  font-weight: 500;
  line-height: 1.3;
  color: #0f2040;
  max-width: 780px;
  margin: 0;
}
.pj-outro__btn {
  display: inline-block;
  background: #0f2040;
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-decoration: none;
  padding: 16px 32px;
  border-radius: 4px;
  transition: background 0.2s;
}
.pj-outro__btn:hover { background: #1e3a6e; text-decoration: none; }

/* ── Responsive ───────────────────────────────────────────────────── */
@media (max-width: 900px) {
  .chapter { padding: 48px 0; min-height: auto; }

  .chapter__grid {
    grid-template-columns: 1fr;
    gap: 36px;
    direction: ltr !important;
    padding-left: 24px;
    padding-right: 0;
  }
  .chapter__grid > * { direction: ltr; }
  .chapter__media { order: -1; }
  .chapter--light .chapter__stage,
  .chapter--dark  .chapter__stage { border-radius: 8px 0 0 8px; }

  .chapter__wm { font-size: clamp(100px, 24vw, 180px); }
  .chapter__grid { max-width: 100%; }

  .pj-strip { padding: 16px 24px; }

  .proj-about__inner { max-width: 100%; }

  .pj-intro { height: auto; min-height: 52vh; }
  .pj-intro__body { padding: 0 24px; }
  .pj-intro__scroll { display: none; }

  .pj-outro { padding: 60px 24px; }
  .pj-outro__heading { font-size: clamp(24px, 6vw, 36px); }

  .stage__mute { width: 44px; height: 44px; }
  .stage__mute-svg { width: 18px; height: 18px; }
}

/* ── Reduced motion ───────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  .pj-intro__orb--a,
  .pj-intro__orb--b     { animation: none; }
  .pj-intro__sl          { animation: none; }

  .pj-intro__eyebrow,
  .pj-intro__lede        { opacity: 1; transform: none; }
  .pj-intro__eyebrow.is-up,
  .pj-intro__lede.is-up  { animation: none; }

  .pj-intro__hl .wm > span,
  .chapter__name .wm > span { transform: translateY(0); animation: none !important; }

  .chapter__blurb,
  .chapter__body,
  .chapter__cap          { opacity: 1; transform: none; }
  .chapter.is-in .chapter__blurb,
  .chapter.is-in .chapter__body,
  .chapter.is-in .chapter__cap { animation: none; }

  .chapter__ey-line      { width: 56px; animation: none; }
  .chapter__wm           { opacity: 1; transition: none; }

  .stage__item           { transition: none; }
  .stage__item.anim-in   { animation: none; }
}
