/* In-page anchor landings must clear the FLOATING fixed nav — without a
   scroll margin the target's top (e.g. the video section from the hero's
   Watch Video button) hides underneath it. Applies to any anchorable
   section/element with an id. */
section[id],
div[id] {
  scroll-margin-top: calc(var(--nav-height) + var(--nav-inset-m) * 2 + var(--anchor-clearance));
}

/* ========================================
   Alpha v2 — Global Design System
   Foundation CSS for all pages
   ======================================== */

/* ========================================
   1. CSS CUSTOM PROPERTIES
   ======================================== */

/* NOTE: All :root tokens moved to tokens.css */


/* ========================================
   2. RESET & BASE
   ======================================== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  overflow-x: clip;
}

body {
  font-family: var(--font-family);
  color: var(--color-text);
  line-height: var(--lh-body);
  overflow-x: clip;
  touch-action: pan-y;
  -ms-touch-action: pan-y;
  background: var(--color-bg);
}

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

a {
  text-decoration: none;
  color: inherit;
  transition: opacity var(--ease-fast);
}

a:hover {
  opacity: 0.85;
}

/* ========================================
   3. TYPOGRAPHY
   ======================================== */
h1 {
  font-size: var(--text-h1);
  font-weight: 700;
  line-height: var(--lh-tight);
  letter-spacing: -0.03em;
  color: var(--color-text);
}

h2 {
  font-size: var(--text-h2);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--color-text);
  line-height: var(--lh-h2);
}

h3 {
  font-size: var(--text-h3);
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--color-text);
  line-height: var(--lh-h3);
}

h4 {
  font-size: var(--text-body);
  font-weight: 700;
  color: var(--color-text);
  line-height: var(--lh-h4);
}

p {
  font-size: var(--text-body);
  line-height: var(--lh-body);
  color: var(--color-text-secondary);
}

/* ========================================
   4. SKIP-TO-CONTENT (Accessibility)
   ======================================== */
.skip-to-content {
  position: absolute;
  top: -100%;
  left: 50%;
  transform: translateX(-50%);
  background: var(--color-deep);
  color: var(--color-white);
  padding: 0.75rem var(--space-1-5);
  border-radius: var(--radius-button);
  font-size: var(--text-sm-plus);
  font-weight: 600;
  z-index: var(--z-lightbox);
  transition: top var(--ease-normal);
}

.skip-to-content:focus {
  top: 1rem;
  opacity: 1;
  outline: 2px solid var(--color-white);
  outline-offset: 2px;
}

/* ========================================
   5. NAV
   ======================================== */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: var(--z-dropdown);
  padding: 0 var(--space-page-x);
  height: var(--nav-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--nav-bg);
  backdrop-filter: blur(20px) saturate(1.4);
  -webkit-backdrop-filter: blur(20px) saturate(1.4);
  border-bottom: 1px solid var(--border-light);
  transition: background var(--ease-slower), box-shadow var(--ease-slower);
}

.nav.scrolled {
  background: var(--nav-bg-scrolled);
  box-shadow: var(--shadow-md);
}

.nav-logo {
  display: flex;
  align-items: center;
}

.nav-logo-img {
  height: 36px;
  width: auto;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: var(--gap-section);
  list-style: none;
}

.nav-links a {
  font-size: var(--text-body-sm);
  font-weight: 500;
  color: var(--color-text);
  transition: color var(--ease-fast);
  letter-spacing: 0.01em;
}

.nav-links a:hover {
  color: var(--color-primary);
  opacity: 1;
}

.btn-nav-cta {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  padding: var(--padding-btn-nav);
  background: var(--color-primary);
  color: var(--color-white);
  border-radius: var(--radius-button);
  font-size: var(--text-sm-plus);
  font-weight: 600;
  letter-spacing: 0.01em;
  transition: background var(--ease-normal), transform var(--ease-fast);
  border: none;
  cursor: pointer;
}

.btn-nav-cta:hover {
  background: var(--color-primary-dark);
  opacity: 1;
  transform: translateY(-1px);
}

.btn-nav-cta svg {
  width: 15px;
  height: 15px;
}

.mobile-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: var(--space-2xs);
}

.mobile-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--color-text);
  margin: 5px 0;
  border-radius: var(--r-hairline);
  transition: all var(--ease-normal);
}

.mobile-toggle.active span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}

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

.mobile-toggle.active span:nth-child(3) {
  transform: rotate(-45deg) translate(5px, -5px);
}

/* ========================================
   6. BUTTONS
   Primitives live in primitives.css (.btn-primary = ordinary actions,
   .btn-white = contact-form actions — the only two button styles).
   Only page-specific disabled state lives here.
   ======================================== */
.btn-disabled {
  background: var(--text-muted);
  border-color: var(--text-muted);
  color: var(--color-white);
  cursor: not-allowed;
  opacity: 0.7;
}

.btn-disabled:hover {
  background: var(--text-muted);
  border-color: var(--text-muted);
  transform: none;
  box-shadow: none;
}

/* ========================================
   7. BADGES
   ======================================== */
.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  padding: var(--padding-badge);
  background: var(--badge-bg);
  border: 1px solid var(--badge-border);
  border-radius: var(--radius-button);
  font-size: var(--text-xs-plus);
  font-weight: 600;
  color: var(--color-primary);
  letter-spacing: 0.03em;
  margin-bottom: var(--space-1-8);
}

.hero-badge svg {
  width: var(--icon-xs);
  height: var(--icon-xs);
}

.product-tag {
  position: absolute;
  top: 12px;
  left: 12px;
  padding: var(--padding-tag);
  border-radius: var(--radius-button);
  font-size: var(--text-2xs);
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.product-tag.popular {
  background: var(--color-primary);
  color: var(--color-white);
}

.product-tag.new {
  background: var(--color-deep);
  color: var(--color-white);
}

/* Popular — the promotion signal. Uses the brand accent rather than a
   warning/neutral colour so it reads as a recommendation, not a status. */
.product-tag.popular-pick {
  background: var(--color-primary);
  color: var(--color-white);
}

.product-tag.discontinued {
  background: var(--color-text-muted);
  color: var(--color-white);
}

/* Out of stock is TEMPORARY, unlike discontinued — amber rather than grey, so
   it reads as "come back" instead of "gone". The product stays browsable. */
.product-tag.out-of-stock {
  background: var(--color-warning);
  color: var(--color-ink);
}

/* ========================================
   8. SECTION UTILITIES
   ======================================== */
.section-container {
  /* width:100% + min-width:0 give a DEFINITE width that resolves against
     the parent. Without them, when .section-container is a flex item (the
     full-height horizontal-scroll sections .why / .pd-features), its
     `margin:0 auto` disables flex-stretch, so it sizes to content — and a
     wide card track would inflate it to the 1200px max-width even on a
     narrow phone, pushing the centred header off-screen. */
  width: 100%;
  min-width: 0;
  max-width: 1200px;
  margin: 0 auto;
  position: relative;
  z-index: var(--z-raised);
}

.section-label {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2xs);
  font-size: var(--text-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--color-primary);
  margin-bottom: var(--space-sm);
}

.section-label.light {
  color: var(--text-on-dark-muted);
}

.section-title {
  font-size: var(--text-h2);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--color-text);
  margin-bottom: var(--space-xs);
  line-height: var(--lh-h2);
}

.section-title.light {
  color: var(--color-white);
}

.section-subtitle {
  font-size: var(--text-body-lg);
  color: var(--color-text-secondary);
  max-width: 520px;
  line-height: var(--lh-prose);
  margin-bottom: var(--space-2xl);
}

.section-subtitle.light {
  color: var(--text-on-dark-sub);
}

/* ========================================
   9. WAVE DIVIDERS
   ======================================== */
.wave-divider {
  position: relative;
  z-index: var(--z-base);
  width: 100%;
  line-height: 0;
  font-size: 0;
  margin-top: -1px;
  margin-bottom: -1px;
  overflow: hidden;
}

.wave-divider svg {
  display: block;
  width: 100%;
  height: auto;
  margin-top: -1px;
  margin-bottom: -1px;
}

.wave-hero-to-products { background: var(--color-bg); }
.wave-hero-to-products svg { fill: var(--color-bg-pool); }

.wave-products-to-shower { background: var(--color-bg-pool); }
.wave-products-to-shower svg { fill: var(--color-bg-medium); }

.wave-shower-to-why { background: var(--color-bg-medium); }
.wave-shower-to-why svg { fill: var(--color-bg-dark); }

.wave-why-to-trust { background: var(--color-bg-dark); }
.wave-why-to-trust svg { fill: var(--color-bg-pool); }

.wave-trust-to-cta { background: var(--color-bg-pool); }
.wave-trust-to-cta svg { fill: var(--color-primary); }

.wave-cta-to-footer { background: var(--color-primary); }
.wave-cta-to-footer svg { fill: var(--color-footer); }

/* ========================================
   10. SCROLL REVEAL
   ======================================== */
/* .reveal — hidden by default via opacity only.
   GSAP owns all transform values to avoid CSS↔GSAP conflicts.
   CSS transition only on .visible for non-GSAP fallback. */
.reveal {
  opacity: 0;
  will-change: transform, opacity;
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
  transition: opacity var(--ease-reveal-long), transform var(--ease-reveal-long);
}

/* Heroes are static — no entrance animation. They render visible from
   first paint (the old data-hero-fade fade-up was removed 2026-06-11). */

/* ========================================
   11. FOOTER
   ======================================== */
.footer {
  background: var(--color-footer);
  padding: var(--gap-xl) var(--space-page-x) var(--space-xl);
  color: var(--footer-text);
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1.2fr;
  gap: var(--gap-lg);
  max-width: 1200px;
  margin: 0 auto;
  padding-bottom: var(--space-2xl);
  border-bottom: 1px solid var(--footer-border);
}

.footer-brand {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.footer-logo {
  margin-bottom: var(--space-xs);
}

.footer-logo-img {
  height: var(--footer-logo-h);
  width: auto;
  /* The footer serves alpha-lockup-white.svg, a real white variant — the old
     brightness(0) invert(1) trick cannot work on a gradient logo, and the
     lockup's TYPE is #0b375e which is near-invisible on black. */
  filter: none;
  opacity: 1;
  max-width: 120px;
}

.footer-brand p {
  font-size: var(--text-sm-plus);
  line-height: var(--lh-prose);
  max-width: 300px;
}

.footer h3 {
  font-size: var(--text-sm);
  font-weight: 700;
  color: var(--footer-heading);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  line-height: var(--lh-h4);
  margin-bottom: var(--space-md);
}

/* Footer column headings double as links to their section. */
.footer h3 a {
  color: inherit;
  text-decoration: none;
  transition: color var(--ease-fast);
}

.footer h3 a:hover {
  color: var(--color-primary);
}

.footer-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: var(--gap-btn);
}

.footer-links a {
  font-size: var(--text-sm-plus);
  color: var(--footer-link);
  transition: color var(--ease-fast);
}

.footer-links a:hover {
  color: var(--color-primary);
  opacity: 1;
}

.footer-contact-row {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  margin-bottom: var(--space-xs);
  font-size: var(--text-sm-plus);
}

.footer-contact-row svg {
  width: 16px;
  height: 16px;
  color: var(--color-primary);
  flex-shrink: 0;
}

.footer-contact-row a {
  color: var(--footer-link);
}

.footer-contact-row a:hover {
  color: var(--color-primary);
  opacity: 1;
}

.footer-contact-link {
  display: inline-block;
  margin-top: var(--space-1);
  color: var(--footer-link);
  font-size: var(--text-sm-plus);
  text-decoration: none;
  transition: color var(--ease-normal);
}

.footer-contact-link:hover {
  color: var(--color-primary);
}

.footer-bottom {
  max-width: 1200px;
  margin: 0 auto;
  padding-top: var(--space-1-5);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-1);
}

.footer-bottom p {
  font-size: var(--text-xs-plus);
  color: var(--footer-text-faint);
}

/* ========================================
   12. RESPONSIVE
   ======================================== */
@media (max-width: 1024px) {
  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: var(--gap-section);
  }
}

@media (max-width: 768px) {
  /* Nav mobile dropdown */
  .nav {
    padding: 0 var(--space-page-x-sm);
  }

  .nav-links {
    display: none;
    position: absolute;
    top: var(--nav-height);
    left: 0;
    right: 0;
    background: var(--nav-mobile-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    flex-direction: column;
    padding: var(--space-1-5) var(--space-page-x) var(--space-xl);
    gap: var(--space-1);
    border-bottom: 1px solid var(--border-light);
    box-shadow: var(--shadow-md);
  }

  .nav-links.open {
    display: flex;
  }

  .mobile-toggle {
    display: block;
  }

  /* Footer stacked */
  .footer-grid {
    grid-template-columns: 1fr;
    gap: var(--gap-section);
  }

  .footer-bottom {
    flex-direction: column;
    text-align: center;
  }
}

@media (max-width: 480px) {
  /* Buttons stacked full-width at smallest screens */
  .btn-primary,
  .btn-white,
  .btn-buy {
    width: 100%;
    justify-content: center;
  }
}

/* ========================================
   13. ACCESSIBILITY
   ======================================== */
@media (prefers-reduced-motion: reduce) {
  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }

  .reveal-scale {
    opacity: 1;
    transform: none;
    transition: none;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ========================================
   13b. NO-JS FALLBACK
   Content is visible by default when JavaScript is unavailable.
   The <html> tag starts with class="no-js"; a tiny inline script
   swaps it to "js" before first paint. If JS never runs, these
   rules ensure all content remains visible.
   ======================================== */
.no-js .reveal,
.no-js .reveal-scale {
  opacity: 1;
  transform: none;
  transition: none;
}

.no-js .page-hero h1,
.no-js .page-hero p,
.no-js .brand-heading,
.no-js .product-card,
.no-js .blog-card,
.no-js .hero-badge,
.no-js .hero h1,
.no-js .hero-sub,
.no-js .hero-buttons,
.no-js .hero-stats,
.no-js [data-pd-reveal] {
  opacity: 1;
  transform: none;
}

/* ========================================
   14. UTILITY CLASSES
   ======================================== */
.text-center {
  text-align: center;
}

.container {
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--space-page-x);
  padding-right: var(--space-page-x);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

/* ========================================
   15. PRODUCT CARDS (shared across pages)
   ======================================== */
.product-card {
  background: var(--color-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-card);
  padding: 0;
  overflow: hidden;
  box-shadow: var(--card-shadow);
  transition: transform var(--ease-slow), box-shadow var(--ease-slow), border-color var(--ease-slow);
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
}

/* Only anchor product cards lift on hover — a discontinued card renders as
   a non-clickable <div>, so it stays static. */
a.product-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--card-shadow-hover);
  border-color: var(--card-border-hover);
  opacity: 1;
}

.product-image {
  position: relative;
  /* Matches .kn-card on the home page: a quiet grey media area above a white
     body, so the two card families read as one component (Master, 2026-08-10). */
  height: var(--card-media-h);
  background: var(--surface-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

/* Dark mode: replace the white frame with a deep raised surface so the
   product photo (which has a white background baked into the JPG) sits
   in a dark frame rather than glaring against the page. */
:root[data-theme="dark"] .product-image {
  background: var(--color-surface-light);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .product-image {
    background: var(--color-surface-light);
  }
}

.product-image img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: var(--space-1);
}

.product-image svg {
  width: 64px;
  height: 64px;
  color: var(--color-primary);
  opacity: 0.5;
}

.product-body {
  padding: var(--space-1-5);
  flex: 1;
  display: flex;
  flex-direction: column;
}

.product-name {
  font-size: var(--text-body);
  font-weight: 700;
  color: var(--color-text);
  margin-bottom: var(--space-2xs);
  letter-spacing: -0.01em;
}

.product-tagline {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  margin-bottom: var(--space-1);
  line-height: var(--lh-normal-5);
  font-style: italic;
}

.product-features {
  list-style: none;
  margin-bottom: var(--space-md);
  flex: 1;
}

.product-features li {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  font-size: var(--text-xs-plus);
  color: var(--color-text-secondary);
  padding: var(--space-3xs) 0;
}

.product-features li svg {
  width: var(--icon-xs);
  height: var(--icon-xs);
  color: var(--color-primary);
  flex-shrink: 0;
}

.product-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: var(--space-1);
  border-top: 1px solid var(--color-bg-lighter);
}

.product-price {
  font-size: var(--text-body-lg);
  font-weight: 700;
  color: var(--color-deep);
}

.product-price span {
  font-size: var(--text-xs);
  font-weight: 500;
  color: var(--color-text-muted);
}

.product-enquire {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-primary);
  display: flex;
  align-items: center;
  gap: var(--gap-filter);
  transition: gap var(--ease-fast);
}

.product-enquire:hover {
  gap: var(--gap-btn);
  opacity: 1;
}

.product-enquire svg {
  width: var(--icon-xs);
  height: var(--icon-xs);
}

/* ========================================
   SHARED CTA SECTION
   ======================================== */
.cta {
  /* Keynote: the closing section is the black stage on EVERY page, matching
     the home page's CTA. It was --color-primary (blue) everywhere else, which
     is the single most visible inconsistency Master spotted. */
  background: var(--surface-invert);
  padding: var(--space-section-y) var(--space-page-x);
  position: relative;
  overflow: hidden;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 320px;
}

.cta::before {
  content: '';
  position: absolute;
  inset: 0;
  /* Master asked whether the blue wash here was intentional: it was mine, but
     it made .cta the ONLY black section with a tint - the home page's black
     sections are flat. Flat wins, since home is the reference. A glow belongs
     behind a product (the chapter stages), not behind type. */
  background: none;
  mask-image: linear-gradient(to bottom, transparent, black 15%, black 85%, transparent);
  -webkit-mask-image: linear-gradient(to bottom, transparent, black 15%, black 85%, transparent);
  pointer-events: none;
}

.cta-content {
  position: relative;
  z-index: var(--z-raised);
  max-width: 600px;
  margin: 0 auto;
}

.cta h2 {
  font-size: var(--text-h2);
  font-weight: 700;
  color: var(--color-white);
  margin-bottom: var(--space-sm);
  letter-spacing: -0.02em;
}

.cta p {
  font-size: var(--text-body-lg);
  color: var(--text-on-dark-sub);
  margin-bottom: var(--space-2xl);
  line-height: var(--lh-prose);
}

.cta-buttons {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-1);
  flex-wrap: wrap;
}

.cta-contact {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--gap-section);
  flex-wrap: wrap;
}

.cta-contact-item {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  color: var(--text-on-dark-muted);
  font-size: var(--text-sm-lg);
  font-weight: 500;
}

.cta-contact-item svg {
  width: var(--icon-inline);
  height: var(--icon-inline);
  color: var(--text-on-dark-ghost);
}

.cta-contact-item span {
  color: var(--text-on-dark-ghost);
  font-size: var(--text-xs-plus);
}

.cta-contact-item a {
  color: var(--text-on-dark);
  transition: color var(--ease-fast);
}

.cta-contact-item a:hover {
  color: var(--color-white);
  opacity: 1;
}

@media (max-width: 480px) {
  .cta-buttons {
    flex-direction: column;
    align-items: stretch;
  }

  .cta-buttons .btn-white {
    justify-content: center;
    width: 100%;
  }

  .cta-contact {
    flex-direction: column;
    gap: var(--space-sm);
  }
}

/* `.scroll-to-top` is fully styled in liquid-glass.css (glass FAB).
   The previous block here has been removed to eliminate a duplicate
   component definition. */
