/* =============================================
   Ecolife Aquatech v10 — Shared Brand Stylesheet
   ============================================= */

/* Font imports */
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;600;700;800&family=Inter:wght@400;500;600&family=JetBrains+Mono:wght@400;500&display=swap');

/* ---- :root tokens (VERBATIM from design.md §1) ---- */
:root {
  /* Color — locked from ecolife.md §2 */
  --brand-primary:    #1AABE2;  --brand-primary-rgb:   26, 171, 226;
  --brand-secondary:  #0D2B45;  --brand-secondary-rgb: 13, 43, 69;
  --brand-bg:         #F7FBFF;
  --brand-accent:     #3CB371;  --brand-accent-rgb:    60, 179, 113;
  --brand-ink:        #0D2B45;

  /* Derived tokens for WCAG AA contrast on light surfaces */
  --brand-primary-strong: color-mix(in srgb, var(--brand-primary) 38%, var(--brand-secondary)); /* deeper cerulean for text-on-light; WCAG AA */
  --brand-text-muted: color-mix(in srgb, var(--brand-secondary) 72%, var(--brand-bg));           /* muted body/label text-on-light; WCAG AA */
  --brand-text-muted-dark: color-mix(in srgb, var(--on-dark) 68%, var(--brand-secondary));       /* muted label text-on-dark(navy); WCAG AA */

  /* Readable text on each surface */
  --on-light:    #0D2B45;  --on-light-rgb: 13, 43, 69;
  --on-dark:     #F7FBFF;  --on-dark-rgb:  247, 251, 255;

  /* Type */
  --brand-font-display: 'Plus Jakarta Sans', system-ui, sans-serif;
  --brand-font-body:    'Inter', system-ui, sans-serif;
  --brand-font-mono:    'JetBrains Mono', ui-monospace, monospace;
}

/* ---- Base resets ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: auto; /* Lenis handles smooth scroll */ }
body {
  background: var(--brand-bg);
  color: var(--brand-ink);
  font-family: var(--brand-font-body);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  line-height: 1.6;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; }
ul, ol { list-style: none; }

/* ---- Typography scale ---- */
h1, h2, h3, h4 {
  font-family: var(--brand-font-display);
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1.08;
  color: var(--brand-ink);
}
.section-label {
  font-family: var(--brand-font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--brand-primary-strong);
}
.section-label--dark {
  color: var(--brand-primary);
}

/* ---- Surface system ---- */
.surface--light { background: var(--brand-bg); color: var(--brand-ink); }
.surface--dark  { background: var(--brand-secondary); color: var(--on-dark); }

/* ---- Section utilities ---- */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 clamp(20px, 4vw, 48px);
}
.section-pad {
  padding-top: clamp(72px, 10vw, 140px);
  padding-bottom: clamp(72px, 10vw, 140px);
}

/* ---- Provenance-spine base classes ---- */
.spine { pointer-events: none; }
.spine svg { width: 100%; height: 100%; }
.spine .spine-path {
  fill: none;
  stroke: var(--brand-primary);
  stroke-width: 2;
  stroke-linecap: round;
}
.spine .spine-node {
  fill: var(--brand-bg);
  stroke: var(--brand-primary);
  stroke-width: 2;
}
.spine .spine-node--proof {
  stroke: var(--brand-accent);
}
.spine .spine-label {
  font-family: var(--brand-font-mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  fill: rgba(13, 43, 69, 0.55);
}

/* ---- Duotone image treatment ---- */
.treated {
  position: relative;
  overflow: hidden;
}
.treated img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.duotone-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(13, 43, 69, 0.6), transparent);
  z-index: 1;
}
.duotone-overlay::after {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--brand-secondary);
  opacity: 0.18;
  mix-blend-mode: multiply;
  z-index: 2;
}
.treated__grain {
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  opacity: 0.35;
  mix-blend-mode: overlay;
}
.treated__content {
  position: relative;
  z-index: 4;
}

/* ---- Custom cursor ---- */
#cursor-dot {
  position: fixed;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--brand-primary);
  pointer-events: none;
  transform: translate(-50%, -50%);
  z-index: 9999;
  will-change: transform;
}
#cursor-ring {
  position: fixed;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1.5px solid rgba(var(--brand-primary-rgb), 0.7);
  pointer-events: none;
  transform: translate(-50%, -50%);
  z-index: 9998;
  will-change: transform;
}
/* Section-aware cursor colors */
[data-surface="dark"] ~ #cursor-dot,
[data-surface="dark"] #cursor-dot,
.cursor-surface--dark #cursor-dot {
  background: var(--brand-primary);
}
[data-surface="dark"] ~ #cursor-ring,
[data-surface="dark"] #cursor-ring,
.cursor-surface--dark #cursor-ring {
  border-color: rgba(var(--brand-primary-rgb), 0.9);
}
@media (pointer: coarse) {
  #cursor-dot, #cursor-ring { display: none !important; }
}

/* ---- Navbar ---- */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px clamp(20px, 4vw, 48px);
  background: rgba(247, 251, 255, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(var(--brand-primary-rgb), 0.08);
  transition: background 0.4s, border-color 0.4s;
}
.navbar--scrolled {
  background: rgba(247, 251, 255, 0.95);
  border-bottom-color: rgba(var(--brand-primary-rgb), 0.15);
}
.navbar__logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--brand-font-display);
  font-weight: 800;
  font-size: 18px;
  letter-spacing: -0.02em;
  color: var(--brand-ink);
}
.navbar__logo img {
  height: 32px;
  width: auto;
}
.navbar__links {
  display: flex;
  align-items: center;
  gap: 32px;
}
.navbar__links a {
  font-family: var(--brand-font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--brand-ink);
  transition: color 0.3s;
}
.navbar__links a:hover,
.navbar__links a:focus-visible {
  color: var(--brand-primary-strong);
}
.navbar__cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--brand-primary-strong);
  color: var(--on-dark);
  font-family: var(--brand-font-display);
  font-weight: 700;
  font-size: 13px;
  padding: 12px 22px;
  border-radius: 4px;
  box-shadow: 0 12px 32px -8px rgba(var(--brand-primary-rgb), 0.45);
  transition: transform 0.35s cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 0.35s;
}
.navbar__cta:hover {
  transform: translateY(-2px);
  box-shadow: 0 18px 40px -8px rgba(var(--brand-primary-rgb), 0.6);
}
.navbar__cta:focus-visible {
  outline: 2px solid var(--brand-accent);
  outline-offset: 3px;
}
/* Force CTA label color: a.navbar__cta (0,1,1) ties .navbar__links a and wins on source order */
a.navbar__cta { color: var(--on-dark); }
.navbar__mobile-toggle {
  display: none;
  background: none;
  border: none;
  padding: 8px;
  cursor: pointer;
}
.navbar__mobile-toggle svg {
  width: 24px;
  height: 24px;
  stroke: var(--brand-ink);
}
@media (max-width: 768px) {
  .navbar__links { display: none; }
  .navbar__cta-desktop { display: none; }
  .navbar__mobile-toggle { display: flex; }
  .navbar__links--mobile-open {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--brand-bg);
    padding: 24px;
    gap: 20px;
    border-bottom: 1px solid rgba(var(--brand-primary-rgb), 0.12);
  }
}

/* ---- Preloader ---- */
.preloader {
  position: fixed;
  inset: 0;
  z-index: 9990;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--brand-bg);
}
.preloader svg {
  width: 80px;
  height: 80px;
}
.preloader .wave-path {
  fill: none;
  stroke: var(--brand-primary);
  stroke-width: 3;
  stroke-linecap: round;
  stroke-dasharray: 200;
  stroke-dashoffset: 200;
}

/* ---- Footer ---- */
.footer {
  background: var(--brand-secondary);
  color: var(--on-dark);
  padding: clamp(60px, 8vw, 100px) clamp(20px, 4vw, 48px) 32px;
}
.footer__top {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1fr;
  gap: clamp(24px, 4vw, 56px);
  padding-bottom: clamp(40px, 6vw, 72px);
  border-bottom: 1px solid rgba(247, 251, 255, 0.1);
}
.footer__brand-tagline {
  font-family: var(--brand-font-display);
  font-weight: 800;
  font-size: clamp(20px, 2.5vw, 28px);
  letter-spacing: -0.03em;
  margin-bottom: 16px;
}
.footer__brand-desc {
  font-size: 14px;
  line-height: 1.7;
  color: rgba(247, 251, 255, 0.6);
  max-width: 32ch;
}
.footer__col-title {
  font-family: var(--brand-font-mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--brand-primary);
  margin-bottom: 20px;
}
.footer__col a {
  display: block;
  font-size: 14px;
  color: rgba(247, 251, 255, 0.55);
  padding: 6px 0;
  transition: color 0.3s;
}
.footer__col a:hover { color: var(--on-dark); }
.footer__contact-item {
  font-size: 13px;
  color: rgba(247, 251, 255, 0.55);
  line-height: 1.7;
}
.footer__contact-item a {
  color: rgba(247, 251, 255, 0.55);
  transition: color 0.3s;
}
.footer__contact-item a:hover { color: var(--brand-primary); }
.footer__spine {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 24px;
  padding: clamp(32px, 5vw, 56px) 0;
}
.footer__spine-node {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--brand-font-mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--brand-text-muted-dark);
}
.footer__spine-node .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--brand-primary);
}
.footer__spine-node .dot--proof {
  background: var(--brand-accent);
}
.footer__spine-line {
  width: 40px;
  height: 1px;
  background: rgba(var(--brand-primary-rgb), 0.25);
}
.footer__bottom {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 24px;
  font-size: 12px;
  color: var(--brand-text-muted-dark);
}
@media (max-width: 768px) {
  .footer__top { grid-template-columns: 1fr 1fr; }
  .footer__bottom { flex-direction: column; gap: 12px; text-align: center; }
}
@media (max-width: 480px) {
  .footer__top { grid-template-columns: 1fr; }
}

/* ---- Skip link (a11y) ---- */
.skip-link{position:absolute;left:-9999px;top:8px;z-index:9001;background:var(--brand-secondary);color:var(--on-dark);padding:10px 16px;font-family:var(--brand-font-mono);font-size:12px;text-decoration:none;border-radius:0 0 6px 0}
.skip-link:focus{left:8px}

/* ---- Prefers-reduced-motion ---- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  /* Force every hidden-start element to visible final state */
  .hero-line > span,
  .reveal,
  .spine,
  .spine .spine-path,
  .eyebrow,
  .sub,
  .stats,
  .actions,
  .preloader .wave-path {
    opacity: 1 !important;
    transform: none !important;
    stroke-dashoffset: 0 !important;
  }
  .preloader { display: none !important; }
  #cursor-dot, #cursor-ring { display: none !important; }
}
