/* ═══════════════════════════════════════════════
   PROJECT PAGE — VERTICAL TO HORIZONTAL LAYOUT
   ═══════════════════════════════════════════════ */

/* ── Base ── */
html.project-page-html,
body.project-page {
  background-color: #000;
  color: #fff;
  height: auto;
  overflow-x: hidden;
  /* Ensure smooth scrolling */
}

/* Hide Native Global Cursor if needed */
body.hide-global-cursor .cursor-dot {
  display: none !important;
}

/* ════════════════════════════════
   HERO VIDEO SEQUENCE
   Fixed at top
   ════════════════════════════════ */
.hero-video-bg {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 5; /* Below the scrolling shaded panel */
}

.hero-bg-media {
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
}

/* Ambient Zone -> Detects click/hover over background video */
.ambient-click-zone {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  z-index: 6; /* Below title but above video */
  cursor: none;
}

/* Vimeo Zone -> Full player container */
.vimeo-player-container {
  position: absolute;
  top: 0; left: 0;
  width: 100vw; height: 100vh;
  z-index: 8;
  background: #000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease;
}

.vimeo-player-container.is-active {
  opacity: 1;
  pointer-events: auto;
}

#vimeo-player, #vimeo-player iframe {
  width: 100%; height: 100%;
  pointer-events: none; /* Hide vimeo default clicks */
}

.vimeo-click-zone {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  z-index: 9;
  cursor: none;
}

.hero-overlay-ui {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  z-index: 10;
  pointer-events: none;
  opacity: 0; 
  transition: opacity 0.4s ease;
}

.hero-overlay-ui.is-active {
  opacity: 1;
}

/* Close Button [x] */
.close-btn {
  position: fixed;
  top: 40px; /* Align with standard navbar vertical padding (or slightly above) */
  right: 50px;
  height: auto;
  font-family: var(--font-label);
  font-size: 0.7rem;
  color: #fff;
  background: none;
  border: none;
  padding: 0;
  cursor: none; /* Use custom cursor (dot) instead of pointer */
  pointer-events: auto; /* Always clickable */
  opacity: 1; /* Always visible */
  transition: opacity var(--transition-fast);
  z-index: 1000; /* Pulled out to root document layer to guarantee clicks */
  text-decoration: none;
}
.close-btn:hover {
  opacity: 0.6;
}

/* Title Left Middle */
.project-title-container {
  position: absolute;
  top: 50%;
  left: 5vw;
  transform: translateY(-50%);
  z-index: 7; /* Above ambient click, below vimeo */
  pointer-events: none;
}

.project-title-text {
  font-family: 'PPNeueMachina-InktrapRegular', 'Neue Machina', sans-serif;
  font-weight: 400; /* Inktrap regular */
  font-size: 46px; /* Scaled up by factor of 2 */
  text-transform: uppercase;
  color: #fff;
  margin: 0;
}

/* Bottom Bar */
.hero-bottom-bar {
  position: absolute;
  bottom: 40px;
  left: 5vw;
  right: 5vw;
  display: flex;
  align-items: center;
  pointer-events: auto;
}

.bracket-playhead {
  display: flex;
  align-items: center;
  width: 100%;
  gap: 0;
  cursor: auto;
  position: relative;
  height: 40px; /* Thicker hit area */
  pointer-events: auto;
}

/* We hide the custom cursor completely when hovering the track */
.bracket-playhead:hover ~ .cursor-dot {
  opacity: 0 !important;
  display: none !important;
}

.playhead-track {
  height: 1px;
  flex-grow: 1;
  background: rgba(255, 255, 255, 0.2);
  display: flex;
  align-items: center;
  position: relative;
  pointer-events: none; /* Let bracket-playhead handle click */
}

.playhead-fill {
  position: absolute;
  left: 0;
  height: 1px;
  background: #fff;
  width: 0%;
}

.playhead-fill::after {
  content: '[]';
  position: absolute;
  right: 0;
  top: 50%;
  transform: translate(50%, -50%);
  font-family: var(--font-label);
  font-size: 0.9rem;
  color: #fff;
  background: transparent;
}


/* ════════════════════════════════
   SHADED KPI PANEL SEQUENCE
   Scrolls over hero view
   ════════════════════════════════ */
.shaded-panel-container {
  position: relative;
  z-index: 10;
  margin-top: 100vh; /* Sit exactly below 100vh window */
  width: 100vw;
  background: rgba(15, 15, 15, 0.85); /* Shaded / Dark overlay */
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

/* ─────────────────────────────────────────────────
   KPI PANEL WRAPPER
   This is the actual element used in project.html.
   It sits just below the viewport (margin-top: 100vh)
   and slides up over the fixed hero as you scroll down.
   GSAP pins it once its top reaches the top of the
   viewport, then drives horizontal scroll.
   ───────────────────────────────────────────────── */
.kpi-panel-wrapper {
  position: relative;
  z-index: 10;           /* above the fixed hero (z-index: 5) */
  margin-top: 100vh;     /* pushed below the fold initially    */
  height: 100vh;
  width: 100vw;
  overflow: hidden;      /* masks slides that have animated out */
  display: flex;
  flex-direction: column;
  background: rgba(12, 12, 12, 0.96);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

/* ── Panel top bar ─────────────────────────────── */
.kpi-top-bar {
  flex-shrink: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 24px 5vw;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.kpi-top-title {
  font-family: 'SupplyMono', monospace;
  font-size: 0.65rem;
  font-weight: 400;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.55);
}

.kpi-top-client {
  font-family: 'SupplyMono', monospace;
  font-size: 0.65rem;
  font-weight: 400;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.3);
}

/* ── Horizontal track ─────────────────────────── */
.kpi-horizontal-track {
  flex: 1;
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  width: max-content;   /* grows to fit all slides */
  overflow: visible;
}

/* ── Individual slides ────────────────────────── */
.kpi-slide {
  width: 100vw;
  height: 100%;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 5vw;
  box-sizing: border-box;
}

/* KPI numbers slide */
.kpi-slide-kpi {
  padding-left: 8vw;
}

/* Description slide */
.kpi-slide-desc {
  padding-left: 10vw;
  padding-right: 10vw;
}

/* ── KPIs container (flex row of KPI items) ───── */
.kpis-container {
  display: flex;
  flex-wrap: wrap;
  gap: 4rem 6rem;
}

/* ── Project description block ────────────────── */
.project-desc-block {
  max-width: 820px;
}

.project-desc-title {
  font-family: 'SupplyMono', monospace;
  font-size: 0.6rem;
  font-weight: 400;
  letter-spacing: 0.35em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.35);
  margin-bottom: 2rem;
}

.project-desc-text {
  font-family: 'Neue Machina', sans-serif;
  font-size: clamp(1.2rem, 2.2vw, 2rem);
  font-weight: 400;
  line-height: 1.45;
  color: #fff;
}

/* ── Scroll tracker (bottom of panel) ─────────── */
.scroll-tracker {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 0 5vw 28px;
  opacity: 0;            /* starts hidden; GSAP fades in on pin enter */
  pointer-events: none;
}

.scroll-progress-bg {
  flex: 1;
  height: 1px;
  background: rgba(255, 255, 255, 0.15);
  position: relative;
}

.scroll-progress-fill {
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  width: 0%;
  background: rgba(255, 255, 255, 0.7);
  will-change: width;
}

.scroll-percent {
  font-family: var(--font-label);
  font-size: 0.6rem;
  font-weight: 400;
  letter-spacing: 0.15em;
  color: rgba(255, 255, 255, 0.35);
  white-space: nowrap;
  min-width: 44px;
  text-align: right;
}

/* ── Close button mobile adjustments ─────────── */
@media (max-width: 768px) {
  .close-btn {
    /* Waffle button sits at top ~20px; push CLOSE below it */
    top: 70px;
    right: 20px;
    font-size: 0.65rem;
  }

  .kpi-panel-wrapper {
    border-top: none;
  }

  .kpi-top-bar {
    padding: 16px 6vw;
  }

  .kpi-slide {
    padding: 8vw 6vw;
    justify-content: flex-start;
    padding-top: 10vw;
  }

  .kpis-container {
    gap: 2rem 3rem;
  }

  .kpi-value {
    font-size: clamp(2.5rem, 12vw, 5rem);
  }

  .project-desc-text {
    font-size: clamp(1rem, 4.5vw, 1.4rem);
  }
}

.pin-layout {
  position: relative;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
}

.h-scroll-wrapper {
  display: flex;
  flex-wrap: nowrap;
  width: max-content;
  height: 100vh;
}

.h-panel {
  width: 100vw;
  height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 5vw;
  position: relative;
  box-sizing: border-box;
}

/* ════════════════════════════════
   PANEL 2 — Description
   ════════════════════════════════ */
.description-panel {
  align-items: flex-start;
  padding-left: 10vw;
  padding-right: 10vw;
}

.desc-content {
  max-width: 900px;
}

.project-desc {
  font-family: 'Neue Machina', sans-serif;
  font-size: clamp(1.4rem, 2.5vw, 2.2rem);
  line-height: 1.35;
  font-weight: 400;
  color: #fff;
  margin: 0;
}

/* ════════════════════════════════
   PANEL 3 — KPIs
   ════════════════════════════════ */
.kpis-panel {
  align-items: flex-start;
  padding-left: 5vw;
  padding-right: 15vw;
}

.kpi-grid {
  display: flex;
  gap: 6rem;
}

.kpi-item {
  display: flex;
  flex-direction: column;
}

.kpi-value {
  font-family: 'Neue Machina', sans-serif;
  font-size: clamp(3.5rem, 6vw, 7rem);
  font-weight: 800;
  line-height: 1;
  color: #fff;
  letter-spacing: -0.03em;
}

.kpi-label {
  font-family: var(--font-label);
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.45);
  text-transform: uppercase;
  letter-spacing: 0.2em;
  margin-top: 1rem;
}


/* ════════════════════════════════════
   SCROLL PROGRESS BAR
   ════════════════════════════════════ */
.scroll-progress-container {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100vw;
  padding: 28px 50px;
  display: flex;
  align-items: center;
  gap: 18px;
  z-index: 200;
  pointer-events: none;
  box-sizing: border-box;
  transition: opacity 0.4s ease;
}

.scroll-label {
  font-family: var(--font-label);
  font-size: 0.6rem;
  font-weight: 400;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.35);
  white-space: nowrap;
  flex-shrink: 0;
}

.scroll-track {
  flex-grow: 1;
  height: 1px;
  background-color: rgba(255, 255, 255, 0.15);
  position: relative;
}

.scroll-fill {
  height: 100%;
  width: 0%;
  background-color: rgba(255, 255, 255, 0.6);
  position: absolute;
  left: 0;
  top: 0;
  will-change: width;
  transition: width 0.05s linear;
}

.scroll-percent {
  font-family: var(--font-label);
  font-size: 0.6rem;
  font-weight: 400;
  letter-spacing: 0.15em;
  color: rgba(255, 255, 255, 0.35);
  white-space: nowrap;
  flex-shrink: 0;
  min-width: 42px;
  text-align: right;
}
