* { box-sizing: border-box; }
html, body { height: 100%; }

body {
  margin: 0;
  overflow: hidden;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  line-height: 1.6;
  color: rgba(255,255,255,0.9);
  background: #06060a;
}

/* Background */
#color-bends {
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
}

#color-bends canvas {
  width: 100%;
  height: 100%;
  display: block;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: radial-gradient(circle at 30% 20%,
    rgba(0,0,0,0.08),
    rgba(0,0,0,0.82)
  );
}

.ui { position: relative; height: 100%; }

:root {
  --ui-pad: 40px; /* Increased from 20px for a more premium look */
}

.brand-float {
  position: fixed;
  top: var(--ui-pad);
  left: var(--ui-pad);
  z-index: 10;
  font-weight: 650;
  letter-spacing: 0.06em;
  text-transform: lowercase;
  text-align: bottom;
  line-height: 1;
  height: 18px;
  cursor: pointer;
  user-select: none;
  color: rgba(255,255,255,0.92);
  display: flex;
}

.nav-float{
  position: fixed;
  top: var(--ui-pad);
  right: var(--ui-pad);
  z-index: 10;
  height: 18px;
  display: flex;
  grid-auto-flow: column;
  gap: 18px;
  align-items: center;
}

.navbtn{
  width: 72px;
  justify-content: center;

  display: inline-flex;
  align-items: center;

  border: none;
  background: transparent;
  cursor: pointer;

  font-size: 16px;
  line-height: 1;
  letter-spacing: 0.02em;

  color: rgba(255,255,255,0.72);
  font-weight: 500;
}

.stage{
  position: fixed;
  inset: 0;
  overflow: hidden;
}

.panel{
  position: absolute;
  inset: 0;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;

  opacity: 0;
  pointer-events: none;
  transition: opacity 240ms ease, transform 240ms ease;
}

.panel.is-active{
  opacity: 1;
  pointer-events: auto;
}

/* --- Film reel --- */
.reel{
  width: 100vw;
  display: flex;
  justify-content: center;
}

.gradual-blur {
  pointer-events: none; 
  /* Critical for backdrop-filter to composite correctly against backgrounds */
  isolation: isolate; 
}

.reel-viewport {
  width: 100vw;
  height: clamp(220px, 33vh, 420px);
  overflow: hidden;
  position: relative; /* Ensure it respects local stacking */
  
  /* --- ADD THIS SECTION --- */
  /* Creates a transparency fade at both edges */
  /* 150px matches the size of your Gradual Blur */
  -webkit-mask-image: linear-gradient(
    to right, 
    transparent 0px, 
    black 150px, 
    black calc(100% - 150px), 
    transparent 100%
  );
  
  mask-image: linear-gradient(
    to right, 
    transparent 0px, 
    black 150px, 
    black calc(100% - 150px), 
    transparent 100%
  );
  /* ------------------------ */
}

.reel-track{
  height: 100%;
  display: flex;
  align-items: center;
  gap: 22px;
  will-change: transform;
}

.reel-item {
  height: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 28px;
  position: relative;
  overflow: hidden;
  flex-shrink: 0;
}

.reel-title {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 40px 24px 24px 24px; /* Big top padding for the gradient */
  
  font-size: 18px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: white;
  text-shadow: 0 2px 10px rgba(0,0,0,0.5);
  
  /* Start hidden */
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.3s ease, transform 0.3s ease;
  
  /* Gradient fade for readability */
  background: linear-gradient(to top, rgba(0,0,0,0.8), transparent);
  pointer-events: none; /* Let clicks pass through to the item */
  z-index: 10;
}

/* About / Contact center */
.pageblock{
  width: min(820px, 92vw);
  margin: 0;
  padding: 0;                   /* IMPORTANT: remove the 12vh push-down */
}

.pageblock h2{
  margin: 0 0 14px;
  font-size: clamp(26px, 4vw, 40px);
  letter-spacing: -0.02em;
}

.pageblock p{
  margin: 0 0 14px;
  color: rgba(255,255,255,0.78);
  font-size: 16px;
}

.contactline{
  display: flex;
  gap: 10px;
  align-items: baseline;
}

.contactline span{
  color: rgba(255,255,255,0.55);
  min-width: 64px;
}

.pageblock a{
  color: rgba(255,255,255,0.92);
  text-decoration: none;
  border-bottom: 1px solid rgba(255,255,255,0.18);
}

.pageblock a:hover{
  border-bottom-color: rgba(255,255,255,0.5);
}

/* copyright smaller */
.copyright{
  position: fixed;
  left: 0;
  right: 0;
  bottom: 14px;
  text-align: center;
  font-size: 11px;              /* slightly smaller */
  color: rgba(255,255,255,0.52);
  user-select: none;
}

.navbtn:hover{ color: rgba(255,255,255,0.92); }

.navbtn.is-active{
  color: rgba(255,255,255,0.98);
  font-weight: 800;
}

/* --- MODAL OVERLAY --- */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 2000; /* Above everything */
  display: flex;
  align-items: center;
  justify-content: center;
  
  /* Start hidden */
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.modal-overlay.is-active {
  opacity: 1;
  pointer-events: auto;
}

/* The dark blurred background */
.modal-background {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(16px); /* The heavy blur effect */
  -webkit-backdrop-filter: blur(16px);
}

.modal-content {
  position: relative;
  width: min(90%, 1100px);
  max-height: 90vh;
  z-index: 10;
  display: flex;
  flex-direction: column;
  gap: 24px;
  
  /* Slide up animation */
  transform: translateY(20px);
  transition: transform 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.modal-overlay.is-active .modal-content {
  transform: translateY(0);
}

/* Close Button */
.modal-close {
  position: absolute;
  top: -40px;
  right: 0;
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.6);
  font-size: 24px;
  cursor: pointer;
  padding: 8px;
  transition: color 0.2s;
}

.modal-close:hover {
  color: white;
}

/* 16:9 Video Container */
.modal-video-wrapper {
  position: relative;
  padding-bottom: 56.25%; /* 16:9 Aspect Ratio */
  height: 0;
  background: #000;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0,0,0,0.6);
}

.modal-video-wrapper iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: none;
}

/* Text Info */
.modal-info {
  color: white;
  padding: 0 4px;
}

.modal-info h2 {
  font-size: 32px;
  margin: 0 0 12px 0;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.modal-info p {
  font-size: 16px;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.8);
  max-width: 700px;
  margin: 0;
}

.modal-content.no-video {
  text-align: center;
  align-items: center; /* Center flex children vertically */
  max-width: 700px;    /* Make the text box narrower so it looks intentional */
}

/* Ensure the paragraph is centered too */
.modal-content.no-video .modal-info p {
  margin-left: auto;
  margin-right: auto;
}

/* 2. Style for Links in description */
.modal-info a {
  color: #fff;
  text-decoration: none;
  border-bottom: 1px solid rgba(255,255,255,0.3);
  transition: border-color 0.2s, color 0.2s;
}

.modal-info a:hover {
  border-bottom-color: rgba(255,255,255,1);
  color: #8a5cff; /* Matches your site accent */
}

/* --- MOBILE / RESPONSIVE ADJUSTMENTS --- */
@media (max-width: 768px) {
  
  /* 5. Hide Brand on Mobile */
  .brand-float {
    display: none;
  }

  /* 6. Center Nav Buttons */
  .nav-float {
    left: 0;
    right: 0;
    justify-content: center;
    width: 100%;
    /* Adjust top padding if needed */
  }

  /* 4. Reel Scaling for Mobile */
  .reel-viewport {
    /* Let the height grow based on the item aspect ratio */
    height: auto; 
    min-height: 250px; /* Safety min-height */
    /* Remove the mask on mobile to improve performance and visibility */
    -webkit-mask-image: none;
    mask-image: none;
  }

  .reel-item {
    /* Make the item width based on screen width */
    width: 80vw; 
    height: auto; /* Allow height to scale automatically */
    aspect-ratio: 16 / 9;
    flex-shrink: 0; /* Prevent squishing */
  }
  
  .reel-track {
    /* Adjust gap for mobile */
    gap: 16px;
  }
  
  /* 3. Hide Blur via CSS (Fallback, though we will do this in JS too) */
  .gradual-blur {
    display: none !important;
  }
}