/** {
    border: 1px solid red;
}*/

/* stop overflow on x*/
html, body {
    overflow-x: hidden;
    margin: 0;
    padding: 0;
    width: 100%;
}

/* Full-screen image section */
.hero {
    width: 100%;
    height: 100vh; /* Full viewport height */   
    justify-content: center;
    align-items: center;
    position: relative;
    padding: 5rem 2rem;
    background: 
        radial-gradient(ellipse at 0% 5%, color-mix(in srgb, var(--secondary-colour) 100%, transparent) 0%, transparent 65%),
        var(--primary-colour);
    overflow: hidden;
}

    /* iOS/Safari fallback using @supports (not color-mix) */
    @supports not (background: color-mix(in srgb, red, blue)) {
      .hero {
        background:
          var(--primary-colour);
      }
}

 /*background: radial-gradient(
        circle at center,
        color-mix(in srgb, var(--secondary-colour) 20%, transparent) 0%,  
        transparent 15%                                                  
      ),
      var(--primary-colour);*/


.hero-video {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

.hero-background {
  position: absolute;
  top: 45%;
  left: 50%;
  width: 80%;
  height: 80%;
  transform: translate(-50%, -50%); /* centers */
  object-fit: contain; 
  opacity: 1; 
  transition: opacity 0.5s ease-in-out; /* smooth fade */
}

.hero-background.active {
  opacity: 1;
}

.hero-heading,
.hero-subtext {
  font-family: 'Raleway', sans-serif;
  letter-spacing: 2px;
}

.hero-heading {
  position: absolute;
  top: 25%;
  left: 5%;           /* left third */
  z-index: 5;
  color: #f5f5f5;
  font-weight: 400;
  font-size: 4rem;
  line-height: 7rem;
  text-align: left;
}

.hero-heading span {
  display: block;
  opacity: 0;
  transform: translateX(-50px);
  animation: slideInLeft 0.8s ease forwards;
}

.hero-heading span:nth-child(1) {
  animation-delay: 0.2s;
}
.hero-heading span:nth-child(2) {
  animation-delay: 0.6s;
}
.hero-heading span:nth-child(3) {
  animation-delay: 1s;
}

@keyframes slideInLeft {
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* ====== Subtext Animation (from right, after heading) ====== */
.hero-subtext {
  position: absolute;
  top: 45%;
  right: 5%;
  transform: translateY(-50%) translateX(50px);
  max-width: 30%;
  text-align: right;
  font-weight: 400;
  font-size: 2.5rem;
  color: var(--secondary-colour);
  opacity: 0;
  animation: slideInRight 1s ease forwards;
  animation-delay: 1.6s; /* fires after heading finishes */
}

@keyframes slideInRight {
  to {
    opacity: 1;
    transform: translateY(-50%) translateX(0);
  }
}

/* Streak container at bottom of hero */
.streak-container {
  position: absolute;
  bottom: 2rem;
  left: 0;
  width: 100%;
  height: 4px; /* container height matches streak */
  display: flex;
  justify-content: space-between; /* left and right sides */
  padding: 0;
  pointer-events: none; /* avoid interfering with other elements */
}

/* Streak group: left or right */
.streak-group {
  display: flex;
  align-items: center;
  gap: 15px; /* spacing between lines */
}

/* Individual streak lines */
.streak-group .streak {
  width: 60px;
  height: 4px;
  background: var(--secondary-colour);
  border-radius: 2px;
  animation: flash 2s linear infinite;
}

.streak-group .streak.mid {
  width: 45px;
  animation-delay: 5s;
}

.streak-group .streak.right {
  width: 30px;
  animation-delay: 5.5s;
}

/* Flash animation */
@keyframes flash {
  0%, 100% { opacity: 0; }
  50% { opacity: 1; }
}

/* Mirror the right group */
.streak-group.right {
  flex-direction: row-reverse; /* lines mirrored to the right */
}

/* Product Intro Section */
.product-intro {
    background: 
        radial-gradient(circle at 10% 70%, color-mix(in srgb, var(--secondary-colour) 35%, transparent) 0%, transparent 12%),
        radial-gradient(circle at 25% 70%, color-mix(in srgb, var(--secondary-colour) 30%, transparent) 0%, transparent 15%),
        radial-gradient(circle at 35% 68%, color-mix(in srgb, var(--secondary-colour) 30%, transparent) 0%, transparent 14%),
        radial-gradient(circle at 45% 73%, color-mix(in srgb, var(--secondary-colour) 25%, transparent) 0%, transparent 12%),
        radial-gradient(circle at 50% 60%, color-mix(in srgb, var(--secondary-colour) 35%, transparent) 0%, transparent 18%),
        radial-gradient(circle at 58% 65%, color-mix(in srgb, var(--secondary-colour) 35%, transparent) 0%, transparent 12%),
        radial-gradient(circle at 65% 72%, color-mix(in srgb, var(--secondary-colour) 30%, transparent) 0%, transparent 14%),
        radial-gradient(circle at 72% 68%, color-mix(in srgb, var(--secondary-colour) 30%, transparent) 0%, transparent 16%),
        radial-gradient(circle at 80% 60%, color-mix(in srgb, var(--secondary-colour) 25%, transparent) 0%, transparent 12%),
        radial-gradient(circle at 90% 75%, color-mix(in srgb, var(--secondary-colour) 35%, transparent) 0%, transparent 14%),
        var(--primary-colour);
    display: flex;
    justify-content: center;
    padding: 15rem 2rem;
}

.product-intro-content {
  display: flex;
  justify-content: space-between;
  align-items: center;       /* keeps video aligned with text */
  max-width: 75%;
  width: 100%;
  gap: 3rem;                 /* spacing between text and video */
}

/* Left Column: Text */
.product-intro-text {
  flex: 1;
  color: white;
}

.product-intro-text h1 {
  font-size: var(--h1-font-size);
  font-weight: 400;
  margin-bottom: 1.5rem;
}

.product-intro-text p {
  font-size: var(--text-font-size);
  line-height: 1.6;
  margin-bottom: 2rem;
  color: var(--secondary-colour);
}

/* Initial hidden state for animation */
.animate-on-scroll h1,
.animate-on-scroll h2,
.animate-on-scroll p,
.animate-on-scroll button {
  opacity: 0;
  transform: translateX(-50px); /* slide slightly from left */
  transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

/* When visible on scroll */
.animate-on-scroll.visible h1 {
  opacity: 1;
  transform: translateX(0);
  transition-delay: 0s;
}

.animate-on-scroll.visible h2 {
  opacity: 1;
  transform: translateX(0);
  transition-delay: 0.3s;
}

.animate-on-scroll.visible p {
  opacity: 1;
  transform: translateX(0);
  transition-delay: 0.6s;
}

.animate-on-scroll.visible button {
  opacity: 1;
  transform: translateX(0);
  transition-delay: 0.9s;
}


/* Right Column: Video */
.product-intro-media {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: center;
}

.product-video {
  width: 100%;
  max-width: 1000px;  /* adjust video size */
  border-radius: 1rem;
}

#features {
    font-family: 'Raleway', sans-serif;
    font-weight: 400;
    display: flex;
    flex-wrap: wrap;
    background-color: var(--primary-colour);
    color: white;
    flex-direction: column;
    padding: 5rem 0 5rem 0;
    text-align: center;
    position: relative;
    overflow: hidden;
}

#features h1 {
  font-size: var(--h1-font-size);
}


#features .small-text {
  color: var(--secondary-colour);
}

#features .paragraph-text {
  color: var(--tertiary-colour);
}

#features h2 {
  padding-bottom: 1rem;
}

#features-content {
    display: flex;
    flex-direction: column;
    position: relative;
    z-index: 2;
}

.features-section {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    padding: 4rem 0;
}

#features-content .features-section:nth-child(odd) {
    flex-direction: row-reverse;
}

.features-section img {
    padding-top: 1rem;
    padding-left: 1rem;
    padding-right: 1rem;
    width: 7.5%;
    height: 7.5%;
    justify-content: space-between;

}

.features-section div {
    width: 30%;
    margin: 0; 
}

.features-text{
    padding: 1rem 2rem;
    max-width: 70%;
}

.features-text-left {
  text-align: left;
}

.features-text-right {
  text-align: right;
}

#features h1, h2, .small-text {
  font-weight: 400;
}

/* Features heading initial state */
#features h1, .small-text {
  opacity: 0;
  transform: translateY(20px); /* slightly below */
  transition: all 0.8s ease-out;
}

/* Fade-in when scrolled into view */
#features h1.visible, .small-text.visible {
  opacity: 1;
  transform: translateY(0);
}


/* ===== Feature text hidden initially ===== */
.features-text {
  opacity: 0;
  transform: translateX(50px); /* right for default */
  transition: all 0.8s ease-out;
}

.features-text-left {
  transform: translateX(-50px);
}

.features-text.visible {
  opacity: 1;
  transform: translateX(0);
  transition-delay: 0.3s; /* slight delay after entering viewport */
}

.section-content, .section-content-col-reverse {
  display: flex;
  justify-content: space-between;
  align-items: center;       /* keeps video aligned with text */
  max-width: 75%;
  width: 100%;
  gap: 3rem;                 /* spacing between text and video */
}

.build-your-vacuum {
    display: flex;
    justify-content: center;
    padding: 15rem 2rem;
    background-color: white;
}

.product-intro-plain {
  background: none;
  background-color: var(--primary-colour);
}

.build-text-content h1 {
    font-size: var(--h1-font-size);
    display: inline-block; /* ensures gradient clipping works */
    background: linear-gradient(to right, var(--primary-colour), var(--secondary-colour));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent; /* fallback */
}

.build-image-content {
  display: flex;
  flex-direction: row;
}

.build-image-content img{
  height: 30rem;
  width: auto;
}

.rotater {
  display: inline-block;
  width: 15rem; 
  height: 15rem;
  margin-bottom: 2.5rem;
  margin-right: 5rem;
}

.rotater img {
  width: 100%;
  height: auto;
  animation: spin 20s linear infinite;
  transform-origin: center center;
}

@keyframes spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

/* Optional: pause rotation on hover */
.rotater:hover img {
  animation-play-state: paused;
}

.shop-now-button {
    background-color: var(--primary-colour);
    color: var(--secondary-colour);
    padding: var(--button-padding);
    cursor: pointer;
    font-size: var(--text-font-size);
    font-weight: var(--button-font-weight);
    letter-spacing: var(--four-letter-spacing);
    border: none;
    border-radius: 25px;
    transition: color 0.3s ease;
}

.shop-now-button:hover {
    background-color: var(--secondary-colour);
    color: var(--primary-colour);
}

.LG-button {
    background-color: var(--tertiary-colour);
    color: var(--secondary-colour);
    padding: var(--button-padding);
    cursor: pointer;
    font-size: var(--text-font-size);
    font-weight: var(--button-font-weight);
    letter-spacing: var(--four-letter-spacing);
    border: none;
    border-radius: 25px;
    transition: color 0.3s ease;
}

.LG-button:hover {
    background-color: var(--secondary-colour);
    color: var(--primary-colour);
}

@media (max-width: 1280px) {

  .hero {
    display: flex;
    flex-direction: column;
    justify-content: flex-start; /* heading at top, video center, subtext bottom */
    align-items: center;
    height: auto;
    padding: 0;
    text-align: center;
    position: relative;
    overflow: hidden;
  }

  /* === HEADING === */
  .hero-heading {
    order: 1;
    position: relative;
    top: 0;
    left: 0;
    transform: none;
    z-index: 5; /* ensure above video */
    color: #f5f5f5;
    font-size: var(--hero-font-size-handheld);
    line-height: 2rem;
    margin: 1.5rem 0 0.3rem 0;
    text-align: center;
  }

  /* === VIDEO === */
  .hero-video {
    order: 2;
    position: relative;
    width: 100%;
    height: 25rem;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    z-index: 1;
  }

  .hero-background {
    position: absolute; /* Absolutely positioned within hero-video and width and height dimensions below are in terms of hero-video div size*/
    width: 100%;
    height: 100%;
    object-fit: contain;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 1;

    /* Force browser to render video in normal stacking context */
    will-change: transform;
    mix-blend-mode: normal;
    transform: translate3d(-50%, -50%, 0);
  }

  /* === SUBTEXT === */
.hero-subtext {
  order: 3;
  position: relative;
  bottom: 0;
  z-index: 9999; /* very high, overrides video layer */
  max-width: 90%;
  text-align: center;
  font-size: var(--h1-font-size-handheld);
  line-height: 1.4rem;
  color: var(--secondary-colour);
  margin-top: 2rem;
  margin-bottom: 2rem;
}

.product-intro {
      background: 
        radial-gradient(circle at 10% 87.5%, color-mix(in srgb, var(--secondary-colour) 35%, transparent) 0%, transparent 12%),
        radial-gradient(circle at 25% 89%, color-mix(in srgb, var(--secondary-colour) 30%, transparent) 0%, transparent 15%),
        radial-gradient(circle at 40% 87.5%, color-mix(in srgb, var(--secondary-colour) 25%, transparent) 0%, transparent 12%),
        radial-gradient(circle at 55% 85%, color-mix(in srgb, var(--secondary-colour) 35%, transparent) 0%, transparent 18%),
        radial-gradient(circle at 70% 90%, color-mix(in srgb, var(--secondary-colour) 30%, transparent) 0%, transparent 14%),
        radial-gradient(circle at 85% 88%, color-mix(in srgb, var(--secondary-colour) 30%, transparent) 0%, transparent 16%),
        var(--primary-colour);
    align-items: center;
    padding: 4rem 0;
}


  /* iOS/Safari fallback using @supports (not color-mix) - NEEDS TO BE DEFINED AFTER product-intro definition in screen size 1280px */
  @supports not (background: color-mix(in srgb, red, blue)) {
    .product-intro {
      background:
        var(--primary-colour);
    }
  }

.section-content {
    flex-direction: column; 
    width: 90%;
    max-width: 100%;
    height: auto;
    justify-content: center;
    align-items: center;
    text-align: center;
    z-index: 2; 
}

.section-content-col-reverse {
    flex-direction: column-reverse; 
    width: 90%;
    max-width: 100%;
    height: auto;
    justify-content: center;
    align-items: center;
    text-align: center;
    z-index: 2; 
}

.product-intro-text {
    width: 90%;
    padding: 0;
    border-radius: 10px;
}

.product-intro-image-content {
    display: none;
}

.carousel-image {
    width: 100%;
    height: 60rem;
    object-fit: cover;
}

.product-intro-text h1 {
    font-size: var(--h1-font-size-handheld);
    margin-bottom: 20px;
}

#features h1 {
  font-size: var(--h1-font-size-handheld);
}


#features-content {
    display: flex;
    flex-direction: column;
    position: relative;
    z-index: 2;
}

.features-section {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    padding: 1rem 0;
}

.features-section div {
    width: 90%;
    margin: 0; 
}

.features-text {
    padding: 0.5rem;
    max-width: 50%;
}

.features-text h2 {
  font-size: var(--text-font-size);
}


.features-section img {
    width: 10%;
    height: 10%;
}

.build-your-vacuum{
    padding: 5rem 1rem;
}


.build-text-content h1 {
    font-size: var(--h1-font-size-handheld);

}

.product-intro-plain {
  background: none;
  background-color: var(--primary-colour);
}

.build-image-content img{
  height: 15rem;
}

.rotater {
  margin-bottom: 0rem;
  margin-right: 0;
}

}

@media only screen and (max-width: 768px) {

  .hero {
    padding: 1rem;
  }

  .hero-heading,
  .hero-subtext {
    letter-spacing: 0;
    left: 0;
  }

  .product-intro-image-content {
      height: 60rem;  
  }

  /* Streak container at bottom of hero */
  .streak-container {
    bottom: 0;
    display: flex;
  }

  /* Individual streak lines */
  .streak-group .streak {
    width: 20px;
    border-radius: 1px;
  }

  .streak-group .streak.mid {
    width: 15px;
    animation-delay: 5s;
  }

  .streak-group .streak.right {
    width: 10px;
  }

  .features-section img {
      width: 15%;
      height: 15%;
  }

}

@media only screen and (max-width: 480px) {

  .features-section img {
      width: 30%;
      height: 30%;
  }


}

