:root {
  --max-width: 1270px;
  --spacing-xs: 4px;
  --spacing-sm: 12px;
  --spacing-md: 16px;
  --spacing-lg: 24px;
  --spacing-xl: 32px;
  --spacing-xxl: 64px;
  --radius-primary: 20px;
  --radius-secondary: 24px;
  --color-black: #000;
  --color-white: #fff;
  --color-light: #fafafa;
  --color-bg: #eee;
  --color-dark-text: #111;
  --color-gray-text: #686868;
  --color-light-text: #b7b7b7;
  --color-light-border: #cee7e8;
  --color-brand: #057382;
  --color-border-light: #f7f7f7;
  --aspect-hero: 40/13;
  --height-desktop: 414px;
  --height-tablet: 600px;
  --height-mobile: 568px;
  --height-carousel: 468px;
}

@font-face {
  font-family: "non-dottee-regular";
  src: url("./fonts/non-dottee-regular.woff2") format("woff2");
  font-weight: 400;
}
@font-face {
  font-family: "non-dottee-bold";
  src: url("./fonts/non-dottee-bold.woff2") format("woff2");
  font-weight: 600;
}
@font-face {
  font-family: "dottee-regular";
  src: url("./fonts/dottee-regular.woff2") format("woff2");
  font-weight: 400;
}
@font-face {
  font-family: "dottee-bold";
  src: url("./fonts/dottee-bold.woff2") format("woff2");
  font-weight: 600;
}
@font-face {
  font-family: "dottee-condensed-light";
  src: url("./fonts/dottee-condensed-light.woff2") format("woff2");
  font-weight: 400;
}
@font-face {
  font-family: "dottee-condensed-regular";
  src: url("./fonts/dottee-condensed-regular.woff2") format("woff2");
  font-weight: 600;
}
@font-face {
  font-family: "dottee-extended-light";
  src: url("./fonts/dottee-extended-light.woff2") format("woff2");
  font-weight: 300;
}
@font-face {
  font-family: "dottee-extended-regular";
  src: url("./fonts/dottee-extended-regular.woff2") format("woff2");
  font-weight: 600;
}

body {
  font: 16px/1.5 "non-dottee-regular";
  color: var(--color-dark-text);
  margin: 0;
  background: var(--color-bg);
  padding: var(--spacing-xxl) 0;
}

p {
  margin: var(--spacing-xs) 0;
  text-wrap: pretty;
}

a {
  padding: var(--spacing-md) var(--spacing-xl);
  text-decoration: none;
}

h2 {
  font-size: 2.5rem;
  line-height: 1.3;
  margin: var(--spacing-sm) 0;
}

@media (max-width: 767px) {
  h2 {
    font-family: "dottee-regular";
    font-size: 1.8rem;
    line-height: 1.2;
  }
}

/* Typography Classes */
.dottee,
.dottee-extended-light,
.dottee-condensed-regular {
  font-size: 3rem;
  margin: 0 0 var(--spacing-md);
  line-height: 1.05;
  text-wrap: pretty;
}

.dottee {
  font-family: "dottee-regular";
}

.dottee-extended-light {
  font-family: "dottee-extended-light";
}

.dottee-condensed-regular {
  font-family: "dottee-condensed-regular";
  font-size: 6rem;
  line-height: 0.9;
}

@media (max-width: 767px) {
  .dottee-condensed-regular {
    font-size: 4rem;
  }
}

/* Theme System */
.light-theme {
  color: var(--color-dark-text);
}

.light-theme a {
  display: inline-block;
  color: var(--color-white);
  background: var(--color-black);
  border-radius: var(--radius-primary);
  margin-top: var(--spacing-lg);
}

.light-theme p {
  color: var(--color-gray-text);
}

.dark-theme {
  color: var(--color-white);
}

.dark-theme a {
  display: inline-block;
  color: var(--color-black);
  background: var(--color-white);
  border-radius: var(--radius-secondary);
  margin-top: var(--spacing-lg);
}

.dark-theme p {
  color: var(--color-light-text);
}
/* Hero Components */
.full-width-hero,
.contained-hero {
  width: 100%;
  aspect-ratio: var(--aspect-hero);
  display: flex;
  align-items: center;
  margin: var(--spacing-xxl) 0;
}

.full-width-hero {
  height: auto;
}

.contained-hero {
  max-width: var(--max-width);
  height: var(--height-desktop);
  margin: var(--spacing-xxl) auto;
  border: 1px solid var(--color-light-border);
  border-radius: var(--radius-primary);
  background-size: contain;
}

.hero-content {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--spacing-md);
}

.contained-hero .hero-content {
  padding-left: var(--spacing-xxl);
}

.hero-content > * {
  max-width: 40%;
}

.full-width-hero a {
  background: var(--color-black);
  color: var(--color-white);
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-primary);
}

/* Background Images */
.ipad {
  background: url(images/ipad_Desktop.png) no-repeat right center / cover;
}

.iphone17 {
  background: url(images/iphone17_Desktop.png) no-repeat right center / cover;
}

/* Product Carousel */
.multi-product-carousel-contained,
.multi-product-carousel-full-width {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  height: var(--height-carousel);
  margin: var(--spacing-xxl) auto;
  background: url(images/airpodsBleed_Desktop.png) no-repeat right top / cover;
  background-size: 95%;
  box-sizing: border-box;
}

.multi-product-carousel-contained {
  max-width: var(--max-width);
  border: 1px solid var(--color-light-border);
  border-radius: var(--radius-primary);
  background-color: var(--color-white);
  padding: var(--spacing-lg);
}

.multi-product-carousel-full-width {
  padding: 0 0 var(--spacing-xl) 0;
  background-color: var(--color-white);
}

.multi-product-carousel-full-width .copy-and-controls,
.multi-product-carousel-full-width .rail {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
}

.multi-product-carousel-full-width .copy-and-controls {
  margin-top: auto;
  margin-bottom: var(--spacing-lg);
}

.copy-and-controls {
  display: flex;
  flex-direction: row;
  width: 100%;
  margin-top: auto;
}

.copy-and-controls img {
  width: 154px;
  height: 48px;
  margin-top: auto;
}

.copy-and-controls h2 {
  margin: auto 0 0 0;
  width: 100%;
  text-align: left;
  color: var(--color-brand);
}

.copy-and-controls span {
  color: var(--color-dark-text);
}

.rail {
  display: flex;
  gap: var(--spacing-md);
  width: 100%;
  max-width: var(--max-width);
  margin-top: var(--spacing-lg);
  overflow: hidden;
}

.product {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: var(--spacing-sm);
  width: 100%;
  background: var(--color-white);
  border-radius: var(--radius-primary);
  border: 1px solid var(--color-light-border);
  text-align: left;
  padding: var(--spacing-lg) var(--spacing-sm) var(--spacing-lg)
    var(--spacing-lg);
}

.product-content {
  width: 100%;
}

.product h3 {
  margin: 0;
  font-size: 16px;
}

.product p {
  width: 100%;
  color: var(--color-gray-text);
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
}

.product a {
  padding: 0;
  margin-top: var(--spacing-sm);
  display: block;
  color: var(--color-dark-text);
}

.product-image {
  aspect-ratio: 4/5;
  width: 100%;
  max-width: 94px;
  background: url(images/airpodsPro.png) no-repeat right center / contain;
  mix-blend-mode: multiply;
}

.product:nth-child(2) .product-image {
  background: url(images/airpods4.png) no-repeat right center / contain;
}

.product:nth-child(3) .product-image {
  background: url(images/airpodsMax.png) no-repeat right center / contain;
}

.hero-video {
  width: 100%;
  aspect-ratio: var(--aspect-hero);
  background: var(--color-black);
  margin: var(--spacing-xxl) 0;
  display: flex;
  position: relative;
}

.video-intro {
  display: flex;
  width: 100%;
  color: var(--color-white);
  flex-direction: column;
  align-items: flex-end;
  justify-content: center;
  box-sizing: border-box;
}

.video-content {
  width: 100%;
  max-width: 634px;
  text-align: left;
}

.video-intro a {
  display: inline-block;
  width: auto;
  margin: var(--spacing-lg) auto 0 0;
  background: var(--color-white);
  border-radius: var(--radius-primary);
  color: var(--color-dark-text);
}

video {
  width: 50%;
  position: relative;
}

.video-overlay {
  position: absolute;
  top: 0;
  right: 0;
  width: 50%;
  height: 100%;
  z-index: 1;
  background:
    linear-gradient(
      90deg,
      rgba(0, 0, 0, 0) 0%,
      rgba(0, 0, 0, 0) 90%,
      rgba(0, 0, 0, 1) 100%
    ),
    linear-gradient(
      180deg,
      rgba(0, 0, 0, 0) 0%,
      rgba(0, 0, 0, 0) 80%,
      rgba(0, 0, 0, 1) 94%
    ),
    linear-gradient(
      270deg,
      rgba(0, 0, 0, 0) 0%,
      rgba(0, 0, 0, 0) 90%,
      rgba(0, 0, 0, 1) 100%
    ),
    linear-gradient(
      0deg,
      rgba(0, 0, 0, 0) 0%,
      rgba(0, 0, 0, 0) 80%,
      rgba(0, 0, 0, 1) 94%
    );
}

/* Responsive Design Breakpoints */

/* Mobile: 0-567px */
@media (max-width: 767px) {
  .rail .product:nth-child(2),
  .rail .product:nth-child(3) {
    display: none;
  }

  .full-width-hero,
  .contained-hero,
  .multi-product-carousel-contained,
  .multi-product-carousel-full-width {
    height: var(--height-mobile);
  }

  .multi-product-carousel-contained,
  .multi-product-carousel-full-width {
    padding: var(--spacing-lg);
    background: url(images/airpodsBleed_mobile.png) no-repeat right top / cover;
  }

  img {
    display: none;
  }

  .hero-content {
    margin-top: auto;
    text-align: center;
    width: 100%;
    padding: var(--spacing-xl) var(--spacing-md);
  }

  .contained-hero .hero-content {
    padding-left: var(--spacing-sm);
  }

  .hero-content > * {
    max-width: 100%;
  }

  .copy-and-controls h2 {
    text-align: center;
  }

  .ipad {
    background: url(images/ipad_mobile.png) no-repeat top center / cover;
  }

  .iphone17 {
    background: url(images/iphone17_mobile.png) no-repeat top center / cover;
  }
}

/* Tablet: 568-1023px */
@media (min-width: 568px) and (max-width: 1023px) {
  .full-width-hero,
  .contained-hero,
  .multi-product-carousel-contained,
  .multi-product-carousel-full-width {
    height: var(--height-tablet);
    box-sizing: border-box;
  }

  .hero-content {
    text-align: center;
    margin-top: auto;
    padding: 0 0 var(--spacing-xl) 0;
  }

  .hero-content > * {
    width: 100%;
    max-width: 480px;
    margin: 0 auto;
    text-align: center;
  }

  .hero-content a {
    display: inline-block;
    width: auto;
  }

  .contained-hero .hero-content {
    padding-left: 0;
  }

  .multi-product-carousel-contained,
  .multi-product-carousel-full-width {
    background-image: url(images/airpodsBleed_tablet.png);
  }
  .ipad {
    background: url(images/ipad_tablet.png) no-repeat top center / cover;
  }

  .iphone17 {
    background: url(images/iphone17_tablet.png) no-repeat top center / cover;
  }

  .multi-product-carousel-contained .rail .product:last-child,
  .multi-product-carousel-full-width .product:last-child {
    display: none;
  }

  .multi-product-carousel-full-width {
    width: 100%;
    padding: var(--spacing-lg);
  }
}

/* Tablet/Desktop hybrid: 1024-1270px */
@media (min-width: 1024px) and (max-width: 1270px) {
  .contained-hero .hero-content {
    padding-left: var(--spacing-sm);
  }

  .hero-content > * {
    max-width: 50%;
  }

  .full-width-hero {
    height: var(--height-carousel);
  }

  .multi-product-carousel-full-width {
    padding: var(--spacing-lg);
  }

  .hero-content p {
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
  }

  .iphone17 {
    background-color: var(--color-black);
    background-size: 100%;
  }

  .ipad {
    background-color: var(--color-light);
    background-size: 100%;
  }

  .contained-hero .hero-content,
  .multi-product-carousel-contained {
    padding: var(--spacing-lg);
  }

  .multi-product-carousel-full-width {
    width: 100%;
  }

  .video-content {
    width: 100%;
    max-width: 634px;
    text-align: left;
    padding: 0 var(--spacing-xl);
    box-sizing: border-box;
  }
}

/* Desktop: 1920px+ */
@media (min-width: 1920px) {
  .multi-product-carousel-full-width {
    max-width: var(--max-width);
    height: var(--height-carousel);
    margin: var(--spacing-xxl) auto;
    background: url(images/airpodsBleed_Desktop.png) no-repeat right top / cover;
    background-size: 95%;
    border: 1px solid var(--color-light-border);
    background-color: var(--color-white);
    border-radius: var(--radius-primary);
    padding: var(--spacing-xl);
    box-sizing: border-box;
  }

  .full-width-hero {
    max-width: var(--max-width);
    aspect-ratio: var(--aspect-hero);
    height: var(--height-desktop);
    margin: var(--spacing-xxl) auto;
    display: flex;
    align-items: center;
    border: 1px solid var(--color-light-border);
    border-radius: var(--radius-primary);
    background-size: contain;
    padding: var(--spacing-md);
    box-sizing: border-box;
  }
}

/* Global override: 320-1270px */
@media (min-width: 320px) and (max-width: 1270px) {
  .contained-hero,
  .multi-product-carousel-contained {
    border: none;
    border-radius: 0;
  }

  .hero-video {
    flex-direction: column;
  }

  .video-content,
  .video-intro {
    width: 100%;
    max-width: none;
    text-align: center;
  }

  .video-content {
    margin: var(--spacing-xs) 0 var(--spacing-xl) 0;
  }

  .video-intro {
    padding: 0 var(--spacing-md);
  }

  .video-overlay {
    display: none;
  }

  video {
    width: auto;
    order: -1;
    border-radius: 8px;
    margin: var(--spacing-md);
  }
}
