/* ===== SHARED VIDEO BACKGROUND ===== */
/* Fixed behind both #services and #portfolio. Shown/hidden by JS via .active class. */
#shared-video-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  display: none;
}
#shared-video-bg canvas {
  width: 100%;
  height: 100%;
  display: block;
}
#shared-video-bg.is-buffering::after {
  content: 'LOADING VIDEO';
  position: absolute;
  bottom: 40px;
  left: 50%;
  transform: translateX(-50%);
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 3px;
  color: rgba(255, 255, 255, 0.4);
  pointer-events: none;
  animation: scrollPulse 2s ease-in-out infinite;
}

/* ===== SERVICES — SCROLL VIDEO ===== */
#services {
  position: relative;
  overflow: hidden;
  background: transparent; /* shared fixed canvas shows through */
}

/* Edge vignette — darkens corners/edges for text contrast */
#svc-vignette {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    radial-gradient(ellipse 80% 80% at 50% 50%, transparent 40%, rgba(0,0,0,0.55) 100%),
    linear-gradient(to bottom, rgba(0,0,0,0.4) 0%, transparent 20%, transparent 80%, rgba(0,0,0,0.4) 100%);
}

/* Base overlay — hidden by default, revealed by JS on scrub */
.svc-overlay {
  position: absolute;
  z-index: 2;
  max-width: min(360px, 86vw);
  opacity: 0;
  pointer-events: none;
  will-change: opacity, transform;
  transition: opacity 0.55s ease, transform 0.55s ease;
}

.svc-overlay.visible {
  opacity: 1;
  pointer-events: auto;
}

/* PROFESSIONAL AUDIO — right, vertically centered */
.svc-overlay[data-seg="audio"] {
  right: 7%;
  top: 50%;
  transform: translateY(calc(-50% + 16px));
  text-align: right;
  max-width: min(440px, max(35vw, 300px));
}
.svc-overlay[data-seg="audio"].visible {
  transform: translateY(-50%);
}

/* LIGHTING DESIGN — left, vertically centered */
.svc-overlay[data-seg="light"] {
  left: 7%;
  top: 50%;
  transform: translateY(calc(-50% + 16px));
}
.svc-overlay[data-seg="light"].visible {
  transform: translateY(-50%);
}

/* LED WALLS — bottom-left */
.svc-overlay[data-seg="led"] {
  left: 7%;
  bottom: 12%;
  transform: translateY(16px);
}
.svc-overlay[data-seg="led"].visible {
  transform: translateY(0);
}

/* STAGE & RIGGING — top-left */
.svc-overlay[data-seg="stage"] {
  left: 7%;
  top: 10%;
  transform: translateY(-16px);
}
.svc-overlay[data-seg="stage"].visible {
  transform: translateY(0);
}

.svc-eyebrow {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: rgba(255,255,255,0.35);
  margin-bottom: 6px;
}

.svc-num {
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 4px;
  color: var(--accent);
  margin-bottom: 10px;
}

.svc-title {
  font-family: var(--font-display);
  font-size: clamp(22px, 3.5vw, 50px);
  letter-spacing: 3px;
  color: var(--text-primary);
  line-height: 1.1;
  margin-bottom: 14px;
  text-shadow: 0 2px 24px rgba(0,0,0,0.7);
  overflow-wrap: normal;
}

.svc-desc {
  font-size: 14px;
  font-weight: 300;
  line-height: 1.75;
  color: var(--text-secondary);
  max-width: 300px;
  text-shadow: 0 1px 8px rgba(0,0,0,0.8);
}

.svc-rule {
  width: 36px;
  height: 1.5px;
  background: var(--accent);
  margin-top: 18px;
}

.svc-overlay[data-seg="audio"] .svc-rule { margin-left: auto; }

/* Section progress dots — bottom-right */
#svc-progress {
  position: absolute;
  bottom: 28px;
  right: 40px;
  z-index: 3;
  display: flex;
  gap: 8px;
  align-items: center;
}

.svc-prog-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(255,255,255,0.25);
  transition: width 0.35s ease, border-radius 0.35s ease, background 0.35s ease;
}

.svc-prog-dot.active {
  width: 22px;
  border-radius: 3px;
  background: var(--accent);
}

/* Shared section text utilities (used in other sections too) */
.section-label {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 16px;
}

.section-title {
  font-family: var(--font-display);
  font-size: clamp(36px, 5vw, 56px);
  letter-spacing: 3px;
  color: var(--text-primary);
}

/* ===== AV SHOWCASE WRAPPER — single GSAP pin target ===== */
#av-wrapper {
  position: relative;
  height: 100vh;
  overflow: visible; /* GSAP adds spacers outside, not inside */
}

/* Both inner sections fill the wrapper absolutely so they overlap in the same viewport */
#services,
#portfolio {
  position: absolute !important;
  inset: 0;
  height: 100% !important;
  overflow: hidden;
}

/* ===== PORTFOLIO — SCROLL VIDEO ===== */
#portfolio {
  background: transparent; /* shared fixed canvas shows through */
}

/* Event image overlays — positioned to match LED screen area in the video.
   Bounds set by JS (updatePfBounds) to correctly account for object-fit: cover scaling.
   Radial mask-image softens edges so images blend naturally into the dark truss surround.
   Opacity is updated by JS for entry + cross-fade transitions between slides. */
.pf-image-overlay {
  position: absolute;
  z-index: 1;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
  -webkit-mask-image: linear-gradient(to right, transparent 0%, black 9%, black 91%, transparent 100%);
  mask-image: linear-gradient(to right, transparent 0%, black 9%, black 91%, transparent 100%);
  /* No transition — opacity animates via JS synchronized to video time */
}

.pf-image-overlay img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}

/* ===== TRUSS CONTENT SLIDES — About / Clients / Contact ===== */
/* Bounds (left/top/width/height) are set by JS to match the LED screen interior area.
   Content appears projected inside the aluminium truss frame at the end of the AV sequence. */
.truss-slide {
  position: absolute;
  z-index: 4;
  opacity: 0;
  pointer-events: none;
  overflow: hidden;
  /* No background — the warm 02-final-frame video stays fully visible behind content */
}

/* Mobile-only contact form slide — hidden on desktop */
.truss-slide[data-truss="contact-form"] { display: none; }

.truss-slide-inner {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  padding: 5% 6%;
  gap: 8%;
  box-sizing: border-box;
}

.truss-slide-inner--centered {
  flex-direction: column;
  justify-content: center;
  text-align: center;
  gap: 4%;
  padding-left: 0;
  padding-right: 0;
}

.truss-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.truss-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 4px;
}

.truss-title {
  font-family: var(--font-display);
  font-size: clamp(28px, 4.5vw, 62px);
  letter-spacing: 2px;
  color: #fff;
  line-height: 1.1;
}

.truss-desc {
  font-size: clamp(13px, 1.2vw, 17px);
  font-weight: 300;
  line-height: 1.7;
  color: rgba(255, 255, 255, 0.72);
  max-width: 340px;
}

/* Stats — About slide right column */
.truss-stats {
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
  align-items: center;
  height: 100%;
  justify-content: center;
}

.truss-stat {
  text-align: center;
}

.truss-stat-num {
  font-family: var(--font-display);
  font-size: clamp(28px, 4vw, 52px);
  color: var(--accent);
  line-height: 1;
  margin-bottom: 4px;
}

.truss-stat-label {
  font-size: 10px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.5);
}

/* Clients marquee inside truss — same animation as #clients but NO hover-pause */
.truss-marquee-wrapper {
  position: relative;
  overflow: hidden;
  width: 100%;
  margin-top: 10px;
  /* Stretch to full slide width — the slide itself has no horizontal padding for this element */
  margin-left: 0;
  margin-right: 0;
}

/* No edge fades — marquee runs full width of the truss frame */

.truss-clients-track {
  display: flex;
  align-items: center;
  /* max-content makes the element's own CSS width equal its flex content width
     (18 items × 172px = 3096px), so translateX(-50%) = -1548px = exactly one
     set of 9 partners. Without this, width defaults to the parent slide width
     (~600px) and the animation snaps after only ~300px — creating the seam. */
  width: max-content;
  padding: 8px 0;
  will-change: transform;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  animation: marqueeScrollHalf 40s linear infinite;
}

@keyframes marqueeScrollHalf {
  from { transform: translate3d(0, 0, 0); }
  to   { transform: translate3d(-50%, 0, 0); }
}

/* Logo tile — flex slot with trailing margin for exact 50% loop math */
.truss-client-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.55;
  transition: opacity 0.25s ease;
  text-decoration: none;
  flex-shrink: 0;
  margin-right: 32px;
  cursor: pointer;
}

.truss-client-logo:hover { opacity: 0.9; }

/* Partners without a URL — rendered as <span>, not clickable */
.truss-client-logo--no-url {
  cursor: default;
  pointer-events: none;
}

/* Real logo images — full colour, fitted to the placeholder frame */
.truss-client-logo img {
  width: 140px;
  height: 64px;
  object-fit: contain;
  display: block;
  transition: transform 0.3s ease;
}

.truss-client-logo:hover img {
  transform: scale(1.25);
}

/* Square logos (≈1:1 ratio) need a larger box so they don't render tiny.
   Width stays 140px to preserve the 172px-per-slot loop math. */
.truss-client-logo--square {
  width: 140px;
}
.truss-client-logo--square img {
  width: 90px;
  height: 90px;
}

/* Pause marquee while hovering so logos are readable and clickable */
.truss-marquee-wrapper:hover .truss-clients-track {
  animation-play-state: paused;
}

.truss-client-placeholder {
  width: 140px;
  height: 64px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.5);
  background: rgba(255, 255, 255, 0.04);
  /* When replaced with <img>, set width/height on the img; this div becomes the frame */
}

/* Contact truss slide — scale the original contact section to fit the frame.
   All child elements reuse the existing .contact-* classes; only dimensions shrink. */
.truss-slide[data-truss="contact"] {
  overflow: auto; /* allow slight scroll if content is tight */
}

.truss-slide[data-truss="contact"] .contact-layout {
  width: 100%;
  height: 100%;
  padding: 5% 6%;
  box-sizing: border-box;
  gap: 5%;
  align-items: center;
}

.truss-slide[data-truss="contact"] .section-label {
  font-size: 9px;
  margin-bottom: 6px;
}

.truss-slide[data-truss="contact"] .section-title {
  font-size: clamp(20px, 3vw, 36px);
  margin-bottom: 8px;
}

.truss-slide[data-truss="contact"] .contact-description {
  font-size: 12px;
  line-height: 1.6;
  margin-bottom: 14px;
}

.truss-slide[data-truss="contact"] .contact-detail {
  margin-bottom: 10px;
  gap: 10px;
}

.truss-slide[data-truss="contact"] .contact-detail-icon {
  width: 30px;
  height: 30px;
}

.truss-slide[data-truss="contact"] .contact-detail-icon svg {
  width: 13px;
  height: 13px;
}

.truss-slide[data-truss="contact"] .contact-detail-text {
  font-size: 11px;
}

.truss-slide[data-truss="contact"] .contact-social {
  margin-top: 12px;
  gap: 10px;
}

.truss-slide[data-truss="contact"] .contact-social a {
  width: 28px;
  height: 28px;
}

.truss-slide[data-truss="contact"] .contact-form-wrapper {
  padding: 18px;
}

.truss-slide[data-truss="contact"] .contact-form {
  gap: 10px;
}

.truss-slide[data-truss="contact"] .form-row {
  gap: 10px;
}

.truss-slide[data-truss="contact"] .form-group {
  gap: 4px;
}

.truss-slide[data-truss="contact"] .form-group label {
  font-size: 9px;
}

.truss-slide[data-truss="contact"] .form-group input,
.truss-slide[data-truss="contact"] .form-group textarea {
  padding: 8px 10px;
  font-size: 11px;
}

.truss-slide[data-truss="contact"] .form-group textarea {
  min-height: 60px;
}

.truss-slide[data-truss="contact"] .form-submit {
  padding: 10px 24px;
  font-size: 11px;
}

/* About truss — full-frame layout mirroring the regular #about section */
.truss-about-inner {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 16px;
  padding: 8% 8%;
  box-sizing: border-box;
}

.truss-about-timeline {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Timeline fill bar — driven by JS .progress() on _trussAboutTl */
.truss-tl-fill {
  position: absolute;
  inset: 0;
  background: var(--accent);
  transform-origin: left center;
  transform: scaleX(0);
}

/* Chapters viewport — clips to one chapter at a time, slider animated by JS */
.truss-chapters-viewport {
  overflow: hidden;
  /* Height enough for one chapter; flex-shrink prevents growing */
  height: clamp(220px, 38vh, 300px);
  flex-shrink: 0;
}

.truss-chapters-slider {
  display: flex;
  flex-direction: column;
  will-change: transform;
}

/* Inherit existing about-chapter styles — they already have correct sizing */

/* ===== END TRUSS SLIDES ===== */

/* Event info text — dark floor area below LED screen, bottom-right */
.pf-info {
  position: absolute;
  bottom: 7%;
  right: 4%;
  z-index: 3;
  max-width: 520px;
  text-align: right;
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.4s ease, transform 0.4s ease;
  pointer-events: none;
}

.pf-info.visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.pf-counter {
  font-family: var(--font-display);
  font-size: 56px;
  color: var(--accent);
  opacity: 0.35;
  line-height: 1;
  margin-bottom: 6px;
}

.pf-event-name {
  font-family: var(--font-display);
  font-size: clamp(28px, 3.5vw, 44px);
  letter-spacing: 2px;
  margin-bottom: 8px;
  text-shadow: 0 2px 16px rgba(0,0,0,0.8);
}

.pf-event-type {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 14px;
}

.pf-event-desc {
  font-size: 14px;
  font-weight: 300;
  line-height: 1.72;
  color: var(--text-secondary);
  max-width: 420px;
  margin-left: auto;
  text-shadow: 0 1px 8px rgba(0,0,0,0.9);
}
