:root {
  /* Apple Inspired Minimal Palette */
  --color-bg: #F5F5F7;
  /* Apple's signature light grey background */
  --color-surface: #FFFFFF;
  /* Pure white cards/surface */

  /* Core Colors */
  --color-primary: #000000;
  /* Pure black for high contrast */
  --color-primary-light: #333333;
  --color-accent: #0071E3;
  /* Apple signature bright blue */
  --color-accent-hover: #0077ED;
  --color-secondary: #000000;
  /* Standardized to black */
  --color-success: #2E7D32;

  --color-text: #000000;
  --color-text-muted: #333333;
  --color-border: #D2D2D7;
  /* Subtle border */

  /* Gradients */
  --gradient-hero: linear-gradient(180deg, #F5F5F7 0%, #FFFFFF 100%);
  --gradient-accent: linear-gradient(135deg, #1D1D1F 0%, #434344 100%);
  /* Sleek dark gradient */

  /* Typography - Sleek Sans-Serif */
  --font-heading: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-body: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;

  /* Spacing */
  --space-1: 0.5rem;
  --space-2: 1rem;
  --space-3: 1.5rem;
  --space-4: 2rem;
  --space-6: 3rem;
  --space-8: 4rem;
  --space-12: 6rem;
  --section-padding: clamp(3rem, 8vw, 5rem);

  /* Shadows & Radii - Smooth and refined */
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 14px rgba(0, 0, 0, 0.08);
  /* Apple style smooth shadow */
  --shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.12);
  --shadow-hover: 0 14px 40px rgba(0, 0, 0, 0.12);

  /* Radii */
  --radius-sm: 8px;
  --radius-md: 18px;
  /* Classic Apple card radius */
  --radius-lg: 24px;
  --radius-pill: 999px;
  /* Pill buttons */

  /* Layout */
  --container-width: 1024px;
  /* Classic contained apple layout */
  --transition-base: 0.25s cubic-bezier(0.2, 0.8, 0.2, 1);
  /* Snappy smooth */
  --transition-smooth: 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);

  /* Apple-style nav heights */
  --nav-height: 52px;
  --subnav-height: 56px;
}

/* Reset & Base */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-family: var(--font-body);
  color: var(--color-text);
  background-color: var(--color-bg);
  line-height: 1.5;
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

img,
picture,
svg {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
  text-decoration: none;
  transition: color var(--transition-base);
}

ul,
ol {
  list-style: none;
}

/* Typography */
h1,
h2,
h3,
h4,
.font-heading {
  font-family: var(--font-heading);
  font-weight: 600;
  /* Apple headings are sleek and strong, but not overly aggressive */
  line-height: 1.1;
  color: var(--color-primary);
  /* no uppercase */
  letter-spacing: -0.015em;
}

.text-primary {
  color: var(--color-primary);
}

.text-accent {
  color: var(--color-accent);
}

.text-muted {
  color: var(--color-text-muted);
}

/* Layout Strings */
.container {
  width: 100%;
  max-width: var(--container-width);
  margin-inline: auto;
  padding-inline: var(--space-4);
}

section {
  padding-block: var(--section-padding);
}

.grid {
  display: grid;
}

.flex {
  display: flex;
}

.flex-col {
  flex-direction: column;
}

.items-center {
  align-items: center;
}

.justify-center {
  justify-content: center;
}

.justify-between {
  justify-content: space-between;
}

.gap-2 {
  gap: var(--space-2);
}

.gap-4 {
  gap: var(--space-4);
}

.gap-6 {
  gap: var(--space-6);
}

.gap-8 {
  gap: var(--space-8);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.6rem 1.5rem;
  /* Sleeker padding */
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 0.95rem;
  /* no uppercase */
  letter-spacing: -0.01em;
  border-radius: var(--radius-pill);
  /* Apple smooth round buttons */
  border: 1px solid transparent;
  cursor: pointer;
  transition: all var(--transition-base);
  text-align: center;
}

.btn-primary {
  background-color: var(--color-accent);
  /* Blue Apple CTA */
  color: #fff;
}

.btn-primary:hover {
  background-color: var(--color-accent-hover);
  color: #fff;
  transform: scale(1.02);
  /* Clean hover */
}

.btn-accent {
  background-color: var(--color-primary);
  /* Dark Apple CTA */
  color: #fff;
}

.btn-accent:hover {
  background-color: #000;
  transform: scale(1.02);
  color: #fff;
}

.btn-outline {
  background-color: transparent;
  color: var(--color-primary);
  border: 1px solid var(--color-primary);
}

.btn-outline:hover {
  background-color: var(--color-primary);
  color: #fff;
}

/* -------------------------------------------------------------------------- */
/* Navigation Customization (Apple Style)
/* -------------------------------------------------------------------------- */

.site-header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: calc(var(--nav-height) + env(safe-area-inset-top));
  padding-top: env(safe-area-inset-top);
  background: rgba(255, 255, 255, 0.85);
  /* Translucent White */
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  z-index: 1000;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  /* Minimal border */
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  align-items: center;
}

.site-header.scrolled {
  height: calc(48px + env(safe-area-inset-top));
  background: rgba(255, 255, 255, 0.95);
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.05);
  border-bottom: none;
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  height: 100%;
}

.logo {
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 1.125rem;
  color: #1d1d1f;
  /* Apple dark grey */
  text-decoration: none;
  letter-spacing: -0.01em;
}

.nav-desktop {
  display: none;
  gap: var(--space-6);
  align-items: center;
}

.nav-link {
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 0.8125rem;
  /* ~13px Apple standard nav font */
  color: rgba(0, 0, 0, 0.8);
  transition: color var(--transition-base);
  letter-spacing: -0.01em;
}

.nav-link:hover,
.nav-link.active {
  color: var(--color-primary);
}

.mobile-toggle {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: #1d1d1f;
  display: block;
  padding: 0.5rem;
  position: relative;
  z-index: 2001;
  /* Keep above everything */
}

/* Apple-style hamburger lines */
.mobile-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background-color: #1d1d1f;
  margin-bottom: 5px;
  transition: all 0.3s ease-in-out;
  transform-origin: left center;
}

.mobile-toggle span:last-child {
  margin-bottom: 0;
}

/* Animate out to an 'X' */
.mobile-toggle.active span:nth-child(1) {
  transform: rotate(45deg);
  width: 26px;
  /* slightly longer for the diagonal */
  margin-top: -3px;
  /* visual bump */
}

.mobile-toggle.active span:nth-child(2) {
  opacity: 0;
  width: 0;
}

.mobile-toggle.active span:nth-child(3) {
  transform: rotate(-45deg);
  width: 26px;
  margin-top: 3px;
}

.mobile-nav {
  position: fixed;
  inset: 0;
  top: 0;
  /* Start from very top to cover header background */
  background: #ffffff;
  /* Fully Opaque */
  z-index: 2000;
  /* Higher than everything else */
  display: flex;
  flex-direction: column;
  padding: calc(60px + env(safe-area-inset-top)) var(--space-6) calc(20px + env(safe-area-inset-bottom));
  /* Top padding to clear logo */
  transform: translateY(-100%);
  opacity: 0;
  pointer-events: none;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Hide navigation obstructions when menu is open */
body.nav-open .apple-chapternav,
body.nav-open .chapter-nav {
  display: none !important;
}

.mobile-nav.open {
  transform: translateY(0);
  opacity: 1;
  pointer-events: auto;
}

.mobile-nav-link {
  font-family: var(--font-heading);
  font-size: 1.75rem;
  /* Bigger more legible links */
  font-weight: 600;
  margin-bottom: var(--space-2);
  display: block;
  color: #1d1d1f;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
  padding-block: 1rem;
  letter-spacing: -0.02em;
  transition: all 0.3s ease;
}

.mobile-nav-link:active {
  background: rgba(0, 0, 0, 0.05);
  padding-left: 10px;
}

/* -------------------------------------------------------------------------- */
/* Apple Sticky Sub-Navigation (Category Jump Links)
/* -------------------------------------------------------------------------- */

.chapter-nav {
  position: sticky;
  top: var(--nav-height);
  z-index: 990;
  height: var(--subnav-height);
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  /* Minimal divider */
  display: flex;
  align-items: center;
  overflow-x: auto;
  /* Scroll horizontally on mobile */
  scrollbar-width: none;
}

.chapter-nav::-webkit-scrollbar {
  display: none;
}

.chapter-nav .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
}

.chapter-title {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 700;
  color: #1d1d1f;
  margin: 0;
  margin-right: var(--space-4);
  white-space: nowrap;
}

.chapter-links {
  display: flex;
  gap: var(--space-4);
  align-items: center;
  margin-left: auto;
  /* Push links to right on desktop */
}

.chapter-link {
  font-size: 0.8125rem;
  font-weight: 500;
  color: rgba(0, 0, 0, 0.6);
  white-space: nowrap;
  transition: color 0.2s ease;
}

.chapter-link:hover {
  color: #1d1d1f;
}

.chapter-btn {
  background: #1d1d1f;
  color: #fff;
  border-radius: var(--radius-pill);
  padding: 0.25rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 600;
  margin-left: var(--space-4);
}

.chapter-btn:hover {
  border-radius: var(--radius-pill);
}

/* Typography Utilities (Apple Style) */
.headline {
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 600;
  letter-spacing: -0.015em;
  line-height: 1.05;
  margin-bottom: 0.25rem;
  color: #000000;
  /* Pure Black */
}

.subhead {
  font-size: clamp(1.2rem, 3vw, 1.7rem);
  font-weight: 400;
  letter-spacing: 0.010em;
  margin-bottom: 0.75rem;
  color: #000000;
}

.promo-text {
  font-size: 1rem;
  color: #333333;
  margin-bottom: 1rem;
}

/* Apple CTA Links (`Learn more >` `Buy >`) */
.apple-link-container {
  display: flex;
  gap: 1.5rem;
  justify-content: center;
  align-items: center;
  margin-top: 1rem;
}

.apple-link {
  color: var(--color-accent);
  font-size: 1.15rem;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  transition: color var(--transition-base);
}

.apple-link:hover {
  text-decoration: underline;
  color: var(--color-accent-hover);
}

.apple-link::after {
  content: ' >';
  font-family: monospace;
  font-size: 0.9em;
  margin-left: 0.25rem;
  position: relative;
  top: 1px;
}

.apple-btn {
  background-color: var(--color-accent);
  color: #fff;
  padding: 0.6rem 1.5rem;
  border-radius: var(--radius-pill);
  font-size: 1.1rem;
  font-weight: 500;
}

.apple-btn:hover {
  background-color: var(--color-accent-hover);
  color: #fff;
  text-decoration: none;
}

/* Apple Hero Sections (Stacked) */
.apple-hero {
  position: relative;
  width: 100%;
  height: auto;
  min-height: 700px;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: center;
  text-align: center;
  padding-top: 80px;
  padding-bottom: 20px;
  overflow: hidden;
  background-color: var(--color-bg);
  border-bottom: 12px solid #fff;
}

/* Apple hero variants */
.apple-hero.dark {
  background-color: #f5f5f7;
  /* Lightened to match black text */
  color: #000000;
}

.apple-hero.dark .headline,
.apple-hero.dark .subhead {
  color: #000000;
}

/* Product-specific colored heroes */
.apple-hero.toilet {
  background-color: #f7faff;
}

.apple-hero.fabric {
  background-color: #faf7ff;
}

.apple-hero.floor {
  background-color: #fff7f7;
}

.hero-content {
  position: relative;
  z-index: 10;
  width: 100%;
  padding-inline: 1.5rem;
  margin-bottom: 40px;
}

.hero-bg-image {
  position: relative;
  width: auto;
  max-width: 90%;
  height: 400px;
  object-fit: contain;
  object-position: bottom center;
  z-index: 1;
  margin-top: auto;
}

/* Apple Bento Grid (2 Column) */
.apple-bento-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  padding: 12px;
  background-color: #fff;
}

@media (min-width: 768px) {
  .apple-bento-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.bento-item {
  position: relative;
  background-color: var(--color-bg);
  height: min(580px, 80vh);
  /* Cap height on mobile */
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: center;
  text-align: center;
  padding-top: 45px;
  padding-inline: 1.5rem;
}

.bento-item.dark {
  background-color: #000;
  color: #fff;
}

.bento-item.dark .headline,
.bento-item.dark .subhead {
  color: #fff;
}

.bento-item .headline {
  font-size: clamp(1.5rem, 4vw, 2.5rem);
}

.bento-item .subhead {
  font-size: clamp(1rem, 2vw, 1.25rem);
}

.bento-img {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 50%;
  object-fit: contain;
  object-position: bottom center;
  z-index: 0;
}

.bento-item .headline,
.bento-item .subhead,
.bento-item .promo-text,
.bento-item .apple-link-container {
  position: relative;
  z-index: 10;
}

/* Form Grid */
.form-grid {
  display: grid;
  gap: var(--space-4);
  grid-template-columns: 1fr;
}

@media (min-width: 768px) {
  .form-grid {
    grid-template-columns: 1fr 1fr;
  }
}

/* Featured Bento Item */
.bento-item-featured {
  grid-column: 1 / -1;
  height: auto;
  min-height: 400px;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 3rem 2rem;
  text-align: center;
}

@media (min-width: 1024px) {
  .bento-item-featured {
    flex-direction: row;
    height: 400px;
  }

  .bento-item-featured>div {
    flex: 1;
    padding: 3rem;
  }
}

/* -------------------------------------------------------------------------- */
/* Apple Product Icon Nav (Chapternav)
/* -------------------------------------------------------------------------- */
.apple-chapternav {
  background: rgba(245, 245, 247, 0.85);
  /* Apple light grey translucent */
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  padding-block: 0.75rem;
  border-bottom: 1px solid #d2d2d7;
  overflow-x: auto;
  scrollbar-width: none;
  display: flex;
  position: sticky;
  top: calc(var(--nav-height) + env(safe-area-inset-top));
  /* Sticks right below main header */
  z-index: 999;
}

/* Main layout styles */

/* Category headers need space from sticky navs */
.category-header {
  text-align: center;
  padding-top: 6rem;
  padding-bottom: 2rem;
  margin-top: 0 !important;
}

.apple-chapternav::-webkit-scrollbar {
  display: none;
}

.apple-chapternav-items {
  display: flex;
  gap: 2rem;
  margin: 0 auto;
  padding-inline: 1rem;
}

.apple-chapternav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-decoration: none;
  min-width: 80px;
  padding-inline: 1rem;
}

.apple-chapternav-label {
  font-size: 0.75rem;
  font-weight: 400;
  color: #1d1d1f;
  margin-top: 0.25rem;
  opacity: 0.8;
  transition: all 0.2s ease;
}

.apple-chapternav-item:hover .apple-chapternav-label {
  opacity: 1;
  color: #0071e3;
}

.apple-chapternav-icon {
  height: 40px;
  /* Standard Apple icon height */
  margin-bottom: 0.5rem;
  object-fit: contain;
}

.apple-chapternav-label {
  font-family: var(--font-body);
  font-size: 0.75rem;
  color: #1d1d1f;
  white-space: nowrap;
}

/* Base Cards */
.card {
  background: var(--color-surface);
  border-radius: var(--radius-md);
  padding: var(--space-6);
  transition: all var(--transition-base);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--color-border);
  /* Subtle thin border */
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  /* Smooth Apple hover cast */
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.75rem;
  border-radius: var(--radius-pill);
  font-size: 0.75rem;
  font-weight: 600;
  /* Not uppercase for Apple */
  letter-spacing: -0.01em;
  background: var(--color-accent);
  color: #fff;
}

/* Animations */
.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1), transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal.in-view {
  opacity: 1;
  transform: translateY(0);
}

.stagger-1 {
  transition-delay: 0.1s;
}

.stagger-2 {
  transition-delay: 0.2s;
}

.stagger-3 {
  transition-delay: 0.3s;
}

/* Footer (Apple style) */
.site-footer {
  background-color: var(--color-bg);
  /* Use soft grey instead of heavy color */
  color: var(--color-text);
  padding-block: var(--space-8) var(--space-4);
  border-top: 1px solid var(--color-border);
}

.site-footer a {
  color: var(--color-text-muted);
  transition: color var(--transition-base);
  font-size: 0.85rem;
}

.site-footer h4 {
  color: var(--color-primary);
  font-weight: 500;
  font-size: 0.95rem;
  letter-spacing: 0;
  margin-bottom: 1rem;
}

.site-footer a:hover {
  color: var(--color-primary);
  text-decoration: underline;
}

.footer-social {
  display: flex;
  gap: 1.5rem;
  margin-top: 1rem;
}

.footer-social a {
  font-size: 1.25rem;
  color: #cbd5e1;
  transition: color 0.3s ease;
  text-decoration: none !important;
}

.footer-social a:hover {
  color: white !important;
}

.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  margin-top: var(--space-6);
  padding-top: var(--space-4);
  text-align: center;
  font-size: 0.75rem;
  color: #94a3b8;
}

@media (max-width: 767px) {

  /* On mobile, center the chapter links, hide the title for more space */
  .chapter-title {
    display: none;
  }

  .chapter-nav .container {
    justify-content: flex-start;
  }

  .chapter-links {
    margin-left: 0;
  }

  /* Specific mobile refinements */
  :root {
    --nav-height: 48px;
    /* Slightly slimmer nav for mobile */
    --subnav-height: 72px;
    /* More space for icons */
  }

  .apple-chapternav-item {
    min-width: 70px;
    padding-inline: 0.5rem;
  }

  .apple-chapternav-label {
    font-size: 0.65rem;
  }

  .apple-hero {
    min-height: 500px;
    /* Prevent massive empty heroes on small screens */
    padding-top: 40px;
  }

  .hero-bg-image {
    max-width: 100%;
    height: 300px;
  }

  .headline {
    font-size: clamp(2rem, 10vw, 2.75rem) !important;
  }

  .subhead {
    font-size: 1.15rem !important;
  }

  /* Avoid sticky overlap hiding content when jumping to anchors */
  [id] {
    scroll-margin-top: calc(var(--nav-height) + var(--subnav-height) + 20px);
  }
}

@media (min-width: 768px) {
  .nav-desktop {
    display: flex;
  }

  .mobile-toggle {
    display: none;
  }

  .mobile-nav {
    display: none;
  }
}