/* ── RESET ─────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --black:    #000000;
  --grey-bg:  #888888;
  --white:    #ffffff;
  --font:     'IBM Plex Sans', sans-serif;
  --ls-w:     0.18em;
  --ls-xw:    0.28em;
}

html { scroll-behavior: smooth; }
body {
  font-family: var(--font);
  font-weight: 300;
  background: var(--black);
  color: var(--white);
  overflow-x: hidden;
}
img { display: block; max-width: 100%; }
a   { color: inherit; text-decoration: none; }


/* --- TRANSITION LOGO LOGIC (VIDEO HERO) --- */

#header {
  position: fixed;
  top: 0;
  width: 100%;
  height: 110px; /* Base header height */
  z-index: 2000;
  display: flex;
  justify-content: center;
  align-items: center;
  background: rgba(0, 0, 0, 0);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0);
  transition: background 0.4s ease, box-shadow 0.4s ease;
}

.header-logo {
  position: fixed;
  /* Start at exactly the vertical center of the viewport */
  top: 50vh; 
  left: 50%;
  z-index: 2001;
  height: 200px; 
  width: auto;
  /* Use -50% Y to anchor from the center point */
  transform: translate(-50%, -50%) scale(1) translateZ(0);
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  will-change: transform;
  image-rendering: -webkit-optimize-contrast;
  pointer-events: none;
  text-decoration: none;
}


/* --- THE SCROLLED STATE --- */

body.scrolled #header {
  background: rgba(0, 0, 0, 0.95);
  backdrop-filter: blur(0px);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4), 0 1px 2px rgba(0, 0, 0, 0.2);
}

body.scrolled .header-logo {
  /* Halfway point of the 110px header */
  top: 55px; 
  
  /* Math: Target 76px / Base 212px = ~0.36 */
  transform: translate(-50%, -50%) scale(0.36) translateZ(0);
  pointer-events: auto;
  cursor: pointer;
}

body.scrolled .header-logo:hover {
  /* Scale up slightly from 0.36 to 0.38 */
  transform: translate(-50%, -50%) scale(0.38) translateZ(0);
}

/* --- MOBILE ADJUSTMENTS --- */
@media (max-width: 600px) {
  #header { height: 80px; }

  .header-logo {
    top: 40vh;
    height: 167px; /* Scaled for mobile hero impact */
  }
  
  body.scrolled .header-logo {
    top: 40px; /* Center of 80px header */
    transform: translate(-50%, -50%) scale(0.36) translateZ(0);
  }
}


/* ══════════════════════════════════════════════════════════
   HERO — VIDEO BACKGROUND
   
   Structure:
     .hero-bg   — outermost: overflow:hidden, establishes stacking
     #hero-video — absolutely positioned, fills container, z-index 0
     .hero-bg::after — gradient overlay, z-index 1
     .hero       — flex column, pushes content to bottom, z-index 2
   
   VIDEO FALLBACK LOGIC (handled in JS):
   On slow/metered connections (saveData or 2G/slow-2G) the JS
   removes the <source> element before the browser fetches it.
   The CSS background-image on .hero acts as the static fallback
   — it is always present and visible until the video's first
   frame paints, which also covers the no-JS case.
══════════════════════════════════════════════════════════ */
/* 1. Fixed Video Container */
.hero-video-fixed {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  z-index: -1; /* Sits behind everything */
  overflow: hidden;
  background-color: #000;
  
  /* Fallback background image stays fixed until video plays */
  background-image: url('images/hero.jpg');
  background-size: cover;
  background-position: center center;
}

/* Remove fallback image once video starts playing */
.hero-video-fixed.video-playing {
  background-image: none;
}

#hero-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  /* Preserving your custom framing/transform */
  transform: scale(1.13) translate(0%, -20%);
  transform-origin: center center;
}

/* 2. Hero Content Section (Transparent & Scrolling) */
.hero {
  position: relative;
  z-index: 1;
  height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end; /* Bottom alignment for Desktop */
  background: transparent;
}

/* 3. The iPhone & Mobile Adjustments */
@media (max-width: 600px) {
  .hero {
    justify-content: center; /* Center logo vertically on mobile */
    padding-bottom: 0;
  }
  
  #hero-video {
    /* Optional: Adjust scale for mobile if the landscape crop is too tight */
    transform: scale(1.4) translate(0%, -10%); 
  }

  .hero-logo {
    margin-bottom: 40px;
  }
}

/* 4. Layering for subsequent sections */
#about, #slideshow, #contact {
  position: relative;
  z-index: 2; /* Ensures they slide OVER the fixed video */
  background-color: var(--black);
}

.hero-content {
  position: relative;
  z-index: 1;
  color: white;
  text-align: center;
  width: 100%;
}

.hero-logo {
  display: inline-block;
  margin-bottom: 50px;     /* tighter gap between logo and text */
}

.hero-text {
  background-color: #000;
  padding: 60px 20px 70px 20px;
}

#hero .tagline {
  font-size: clamp(1rem, 3.5vw, 1.4rem);   /* scales with viewport, not fixed */
  font-weight: 400;
  text-transform: uppercase;
  color: rgba(255,255,255,0.92);
  line-height: 1.5;
  letter-spacing: 4px;
}
#hero .sub {
  font-size: clamp(0.75rem, 2.2vw, 1rem);  /* proportional to tagline */
  font-weight: 300;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  color: rgba(255,255,255,0.8);
  margin-top: 20px;
}
.hero .tagline,
.hero .sub {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}


/* ══════════════════════════════════════════════════════════
   SLIDESHOW
   Desktop: aspect-ratio locked (2400×793 → 33.04% padding-top).
   Mobile ≤700px: fixed 100vw square — matches the square mobile
   crops (slide-mobile-XX.jpg). The 4th slide (.mobile-hidden) is
   excluded on mobile via CSS + JS.
   Ken Burns zoom: scale(1) → scale(1.04) over 10s linear.
   No lurch on transition: JS snapshots computed transform before
   adding .leaving; .leaving has no transform transition.
══════════════════════════════════════════════════════════ */
#slideshow {
  position: relative;
  width: 100%;
  padding-top: 33.04%;
  overflow: hidden;
  background: #000;
}

.slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transform: scale(1);
  transition: opacity 1.5s ease-in-out, transform 10s linear;
  will-change: opacity, transform;
  pointer-events: none;
}
.slide img,
.slide picture img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}
.slide.active {
  opacity: 1;
  transform: scale(1.04);
  pointer-events: auto;
}
.slide.leaving {
  opacity: 0;
  /* No transform transition — locked via inline style in JS */
  transition: opacity 1.5s ease-in-out;
}

/* 4th slide: visible on desktop, hidden on mobile */
.mobile-hidden { display: block; }

/* Dot navigation */
#slideshow-dots {
  position: absolute;
  bottom: 14px;
  left: 0;
  right: 0;
  display: flex;
  justify-content: center;
  gap: 8px;
  z-index: 10;
}
.slide-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(255,255,255,0.3);
  border: none;
  padding: 0;
  cursor: pointer;
  transition: background 0.3s, transform 0.3s;
}
.slide-dot.active {
  background: rgba(255,255,255,0.85);
  transform: scale(1.35);
}


/* ══════════════════════════════════════════════════════════
   RETAIL PARTNERS
══════════════════════════════════════════════════════════ */
#retailers {
  background: var(--white);
  padding: 76px 60px 84px;
  text-align: center;
}
#retailers h2 {
  font-weight: 300;
  font-size: 1.4rem;
  letter-spacing: 3.5px;
  text-transform: uppercase;
  color: #222222;
  margin-bottom: 64px;
}
.logo-grid {
  display: grid;
  align-items: center;
  justify-items: center;
  width: 100%;
  max-width: 860px;
  margin-left: auto;
  margin-right: auto;
}
.g3 { grid-template-columns: repeat(3, 1fr); gap: 52px 20px; }
.g4 { grid-template-columns: repeat(4, 1fr); gap: 52px 20px; margin-top: 68px; }
.lc {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 52px;
}
.lc img {
  display: block;
  width: auto;
  height: 100%;
  max-width: 160px;
  max-height: 52px;
  object-fit: contain;
}


/* ══════════════════════════════════════════════════════════
   ABOUT
══════════════════════════════════════════════════════════ */
#about {
  background: var(--grey-bg);
  padding: 76px 60px 84px;
  text-align: center;
}
#about .services {
  font-weight: 400;
  font-size: clamp(1.2rem, 1.15vw, 0.78rem);
  letter-spacing: 2px;
  text-transform: uppercase;
  color: rgba(20,20,20,0.92);
  line-height: 2.2;
  margin-bottom: 56px;
  max-width: 1000px;
  margin-left: auto;
  margin-right: auto;
}
#about .collab {
  font-weight: 500;
  font-size: 1rem;
  letter-spacing: 3.5px;
  text-transform: uppercase;
  color: rgba(20,20,20,1);
  margin-bottom: 40px;
}
.brand-list {
  display: grid;
  grid-template-columns: repeat(3, auto);
  justify-content: center;
  gap: 2px 64px;
  max-width: 680px;
  margin: 0 auto;
  text-align: left;
}
.brand-list span {
  font-weight: 500;
  font-size: 1.1rem;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  color: rgba(255,255,255,0.85);
  padding: 6px 0;
  display: block;
}


/* ══════════════════════════════════════════════════════════
   CONTACT
══════════════════════════════════════════════════════════ */
#contact {
  background: #0c0000;
  padding: 90px 40px 100px;
  text-align: center;
}
.contact-line {
  font-weight: 400;
  font-size: 0.85rem;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  color: rgba(255,255,255,0.82);
  margin-bottom: 40px;
}
.contact-line a {
  font-weight: 600;
  color: rgba(255,255,255,0.82);
  border-bottom: none;
  padding-bottom: 2px;
}
.contact-line a:hover { border-bottom: 1px solid rgba(255,255,255,1); }

.social-row {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 20px;
  margin-bottom: 50px;
}
.social-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  text-decoration: none;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  will-change: transform;
  transform: translateZ(0);
  backface-visibility: hidden;
}
.social-link.filled {
  background-color: #999999;
  color: #0c0000;
  border-radius: 4px;
}
.social-link.filled svg {
  width: 28px;
  height: 28px;
  fill: currentColor;
}
.social-link.outlined-glyph {
  background: transparent;
  color: #999999;
}
.social-link.outlined-glyph svg {
  width: 100%;
  height: 100%;
}
.social-link:hover { transform: translateY(-4px); color: #0c0000; }
.social-link.filled:hover { background-color: #ffffff; }
.social-link.outlined-glyph:hover {
  color: #ffffff;
  filter: drop-shadow(0 0 2px rgba(255,255,255,0.2));
}


/* ══════════════════════════════════════════════════════════
   FOOTER
══════════════════════════════════════════════════════════ */
#footer {
  background: #0c0000;
  border-top: 1px solid rgba(255,255,255,0.06);
  padding: 24px 40px;
  text-align: center;
}
#footer p {
  font-weight: 300;
  font-size: 0.8rem;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: rgba(255,255,255,0.55);
}


/* ══════════════════════════════════════════════════════════
   RESPONSIVE BREAKPOINTS
   One rule per breakpoint, no nesting, no duplication.
══════════════════════════════════════════════════════════ */

@media (max-width: 900px) {
  .g3 { gap: 36px 14px; }
  .g4 { gap: 36px 14px; margin-top: 52px; }
  .brand-list { grid-template-columns: repeat(2, auto); gap: 2px 48px; }
  #retailers, #about { padding: 56px 32px 64px; }
}

@media (max-width: 700px) {
  /* Slideshow: square container to match square mobile crops */
  #slideshow {
    padding-top: 0;
    height: 100vw;
  }

  /* Hide 4th slide (desktop-only content) */
  .mobile-hidden { display: none !important; }

  /* Logo grids: 2-column */
  .g3 { grid-template-columns: repeat(2, 1fr); gap: 28px 16px; }
  .g4 { grid-template-columns: repeat(2, 1fr); gap: 28px 16px; margin-top: 28px; }
  #retailers { padding: 48px 20px 56px; }

}

@media (max-width: 600px) {

    #header {
      height: 90px;
    }

    body.scrolled .header-logo {
      top: 27px;
      transform: translate(-50%, -50%) scale(0.36) translateZ(0);
    }

    .hero-video-fixed {
      height: 26vh; /* Takes up 60% of the screen instead of 100% */
      overflow: hidden;
      top: 0px;
    }

    .hero {
    justify-content: center; 
    padding-bottom: 0;
    background-size: 180%; /* Larger than contain, less crop than cover */
    background-position: center -30px;
    padding-top: 0;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
  }

  .header-logo {
    top: calc(50vh - 50px);
    height: 100px;
  }

  .hero-text {
    background-color: #000;
    padding: 40px 20px 70px;
  }

  #hero .sub { margin-top: 50px; }

  .hero-logo { margin-bottom: 40px; }
  .hero-logo img { height: clamp(50px, 14vw, 72px); }

  .brand-list { grid-template-columns: 1fr 1fr; gap: 2px 24px; }
  #about { padding: 48px 20px 56px; }
  #contact { padding: 64px 20px 80px; }
  .lc { height: 40px; }
  .lc img { max-height: 40px; }
}

@media (max-width: 480px) {
  #about .services {
    font-size: 0.78rem;
    letter-spacing: 1.2px;
    line-height: 2;
    word-spacing: 2px;
  }
  #about .collab {
    font-size: 0.78rem;
    letter-spacing: 2px;
  }
  .brand-list {
    grid-template-columns: 1fr;
    text-align: center;
    gap: 0;
    max-width: 260px;
  }
  .brand-list span {
    font-size: 0.9rem;
    letter-spacing: 2px;
  }
  .g3 { grid-template-columns: 1fr; gap: 30px 0; }
  .g4 { grid-template-columns: 1fr; gap: 30px 0; margin-top: 30px; }
}
