/* ==========================================================================
   Eco Water Solutions — Design Tokens
   --------------------------------------------------------------------------
   Single source of truth for color, type, space, radius, elevation, motion
   and layout on The Smart Valve™ landing page.

   Extracted 2026-10-04 from the shipped `styles.css`. Every value below is a
   value the live site already renders, so loading this file changes nothing
   visually — it only gives each value a name.

   Load order matters: tokens.css BEFORE styles.css.

   Companion document: DESIGN-SYSTEM.md (usage rules, components, a11y notes).
   Naming: --ews-<category>-<role>. Prefix avoids collisions when this file is
   dropped into React/Tailwind/Lovable alongside other token sets.
   ========================================================================== */

:root {
  /* ======================================================================
     1. PALETTE — raw colors. Do not use these directly in components.
        Use the semantic tokens in section 2.
     ====================================================================== */

  /* Navy — the environment. Darkest to lightest. */
  --ews-navy-950: #03111d; /* deepest: footer, input fills, mobile bar */
  --ews-navy-900: #061a2b; /* dark sections, nav, utility bar */
  --ews-navy-880: #061c2e; /* page base (body) */
  --ews-navy-800: #0a2b3e; /* raised sections: regional, process */
  --ews-navy-700: #12445a; /* active chip fill */

  /* Navy — gradient and component-chrome stops. Atmosphere only. */
  --ews-navy-hero-stop: #06283b;   /* hero gradient terminus */
  --ews-navy-monitor-stop: #0b354a; /* monitor gradient origin */
  --ews-navy-device-top: #0a3045;   /* phone body gradient */
  --ews-navy-device-base: #041722;  /* phone body gradient */
  --ews-navy-bezel: #102b3a;        /* phone bezel */
  --ews-navy-ring: #1d6c86;         /* meter node ring */
  --ews-navy-field-line: #2b6072;   /* form input border */

  /* Cyan — water, technology, data. */
  --ews-cyan-500: #00a9cf; /* primary cyan */
  --ews-cyan-400: #88cdd9; /* dimmed cyan label */
  --ews-cyan-300: #58d9e7; /* bright cyan: links, accents, hairlines */
  --ews-cyan-200: #a8e2e9; /* palest cyan text */

  /* Cyan — aura and mist. Never used for text. */
  --ews-aura-bright: 0, 190, 231;  /* hero radial highlight */
  --ews-aura-mid: 0, 169, 207;     /* standard cyan glow (= cyan-500) */
  --ews-aura-deep: 0, 115, 167;    /* hero radial depth */
  --ews-mist-light: 86, 223, 239;
  --ews-mist-mid: 52, 196, 222;
  --ews-mist-deep: 0, 164, 211;

  /* Green — conversion, WhatsApp, positive status. */
  --ews-green-700: #087b49; /* primary CTA hover */
  --ews-green-600: #0a8f55; /* primary CTA rest */
  --ews-green-500: #12a866; /* status dots, rules, accents */
  --ews-green-whatsapp: #20b85a; /* WhatsApp badge only */

  /* Orange — numbering and small accents. Never a surface, never a CTA. */
  --ews-orange-500: #f38744;

  /* Neutral text ramp — cool blue-grays, primary to faintest. */
  --ews-gray-000: #ffffff;
  --ews-gray-050: #eaf5f7;
  --ews-gray-200: #b7d0d9;
  --ews-gray-400: #93b1bd;
  --ews-gray-500: #789aa8;
  --ews-gray-600: #608b99;

  /* Alert */
  --ews-red-500: #b94732; /* invalid field border */
  --ews-red-600: #a53a2a; /* error text */

  /* ======================================================================
     2. SEMANTIC COLOR — what components should actually reference.
     ====================================================================== */

  /* Surfaces */
  --ews-surface-page: var(--ews-navy-880);
  --ews-surface-raised: var(--ews-navy-800);
  --ews-surface-dark: var(--ews-navy-900);
  --ews-surface-deepest: var(--ews-navy-950);
  --ews-surface-field: var(--ews-navy-950);
  --ews-surface-nav: rgba(6, 26, 43, 0.96);
  --ews-surface-chip: rgba(6, 26, 43, 0.9);
  --ews-surface-bar: rgba(3, 17, 29, 0.97);
  --ews-surface-inset: rgba(3, 17, 29, 0.42); /* mechanism demo well */

  /* Text */
  --ews-text-strong: var(--ews-gray-000); /* headings on dark sections */
  --ews-text-body: var(--ews-gray-050);   /* default body */
  --ews-text-lead: var(--ews-gray-200);   /* hero lead, emphasized support */
  --ews-text-muted: var(--ews-gray-400);  /* card body, captions */
  --ews-text-faint: var(--ews-gray-500);  /* microcopy, footnotes, legends */
  --ews-text-dim: var(--ews-gray-600);    /* lowest-priority marks */
  --ews-text-accent: var(--ews-cyan-300); /* links, inline accents */
  --ews-text-eyebrow: var(--ews-green-500);
  --ews-text-eyebrow-dark: var(--ews-cyan-300); /* on navy-900 sections */
  --ews-text-numeral: var(--ews-cyan-300);       /* result figures */
  --ews-text-index: var(--ews-orange-500);       /* section numbers, kickers */
  --ews-text-on-nav: rgba(255, 255, 255, 0.78);
  --ews-text-on-chip: rgba(255, 255, 255, 0.8);
  --ews-text-lockup: rgba(255, 255, 255, 0.76);

  /* Hairlines — the structural signature of this design. 1px, cyan-tinted. */
  --ews-rule: rgba(88, 217, 231, 0.18);         /* default grid rule */
  --ews-rule-soft: rgba(88, 217, 231, 0.15);    /* key-figure strip */
  --ews-rule-faint: rgba(88, 217, 231, 0.12);   /* footer dividers */
  --ews-rule-ghost: rgba(88, 217, 231, 0.09);   /* decorative hero circle */
  --ews-rule-strong: rgba(88, 217, 231, 0.42);  /* ghost-button border */
  --ews-rule-pipe: rgba(88, 217, 231, 0.58);    /* diagram pipe walls */
  --ews-rule-arrow: rgba(88, 217, 231, 0.7);    /* diagram flow arrows */

  /* Tints and halos */
  --ews-tint-cyan-weak: rgba(0, 169, 207, 0.09); /* card hover */
  --ews-tint-cyan: rgba(0, 169, 207, 0.14);      /* active tab */
  --ews-tint-glass-1: rgba(255, 255, 255, 0.02);
  --ews-tint-glass-2: rgba(255, 255, 255, 0.03);
  --ews-halo-green: rgba(18, 168, 102, 0.16);    /* status dot ring */
  --ews-halo-focus: rgba(18, 168, 102, 0.12);    /* input focus ring */

  /* Feedback */
  --ews-border-invalid: var(--ews-red-500);
  --ews-text-error: var(--ews-red-600);
  --ews-text-success: var(--ews-green-600);
  --ews-border-focus: var(--ews-green-500);

  /* ======================================================================
     3. TYPOGRAPHY
     ====================================================================== */

  /* Families — serif display against sans UI is the core type decision. */
  --ews-font-display: Georgia, "Times New Roman", serif;
  --ews-font-sans: Inter, ui-sans-serif, system-ui, -apple-system,
    BlinkMacSystemFont, "Segoe UI", sans-serif;

  /* Display scale — serif, weight 400, tight tracking. */
  --ews-text-display-1: clamp(48px, 6vw, 80px);  /* h1 */
  --ews-text-display-2: clamp(38px, 4.8vw, 62px); /* h2 */
  --ews-text-display-3: clamp(34px, 4vw, 50px);   /* feature h3 */
  --ews-text-display-1-sm: clamp(44px, 14vw, 62px); /* h1 <=680px */
  --ews-text-display-2-sm: clamp(35px, 11vw, 48px); /* h2 <=680px */

  /* Numeral scale — serif, weight 400, used for figures only. */
  --ews-text-numeral-xl: 72px; /* documented result */
  --ews-text-numeral-lg: 64px; /* app reading (conceptual) */
  --ews-text-numeral-md: 34px; /* key-figure strip */
  --ews-text-numeral-unit: 19px; /* %/+ suffix inside numeral-md */

  /* Title scale — serif, weight 400. */
  --ews-text-title-1: 28px; /* problem + industry cards */
  --ews-text-title-2: 26px; /* mechanism-quality cards */
  --ews-text-title-3: 22px; /* FAQ question, monitor points */
  --ews-text-title-4: 20px; /* default h3, route point */
  --ews-text-title-nav: 24px; /* mobile nav links */

  /* Body and UI scale — sans. */
  --ews-text-lead-lg: 18px;  /* hero lead */
  --ews-text-lead: 17px;     /* section lead, result description */
  --ews-text-base: 16px;     /* body default, direct-contact value */
  --ews-text-sm: 14px;       /* nav links, dense card body */
  --ews-text-meta: 13px;     /* small button, section index, notes */
  --ews-text-label: 12px;    /* eyebrow, form label, captions */
  --ews-text-micro: 11px;    /* kickers, legends, footnotes */
  --ews-text-nano: 10px;     /* brand line, device chrome */
  --ews-text-pico: 9px;      /* gauge caption */

  /* Weights */
  --ews-weight-display: 400;
  --ews-weight-light: 300; /* FAQ +/x glyph only */
  --ews-weight-medium: 650;
  --ews-weight-semibold: 700;
  --ews-weight-strong: 750; /* buttons, UI emphasis */
  --ews-weight-eyebrow: 800;

  /* Tracking */
  --ews-tracking-numeral: -0.06em;
  --ews-tracking-display: -0.045em;
  --ews-tracking-display-loose: -0.04em;
  --ews-tracking-ui: -0.01em;
  --ews-tracking-utility: 0.055em;
  --ews-tracking-kicker: 0.08em;
  --ews-tracking-caps: 0.1em;
  --ews-tracking-label: 0.12em;
  --ews-tracking-lockup: 0.14em;
  --ews-tracking-eyebrow: 0.18em;

  /* Leading */
  --ews-leading-display-1: 0.98;
  --ews-leading-display-2: 1.04;
  --ews-leading-numeral: 1;
  --ews-leading-brand: 1.15;
  --ews-leading-title: 1.2;
  --ews-leading-body: 1.55;

  /* ======================================================================
     4. SPACE — 4px base. Steps 1-9 are component-internal; 10+ are
        section rhythm. See DESIGN-SYSTEM.md §4 for legacy off-grid values.
     ====================================================================== */
  --ews-space-1: 4px;
  --ews-space-2: 8px;
  --ews-space-3: 12px;
  --ews-space-4: 16px;
  --ews-space-5: 20px;
  --ews-space-6: 24px;
  --ews-space-7: 28px;  /* standard card padding */
  --ews-space-8: 34px;  /* wide card padding */
  --ews-space-9: 48px;
  --ews-space-10: 68px; /* heading -> grid */
  --ews-space-11: 88px; /* section padding, mobile */
  --ews-space-12: 120px; /* section padding, desktop */

  /* ======================================================================
     5. LAYOUT
     ====================================================================== */
  --ews-max: 1240px;
  --ews-gutter: 24px;    /* >=681px */
  --ews-gutter-sm: 16px; /* <=680px */
  --ews-gutter-nav-sm: 14px;

  /* Centered section width (editorial sections). */
  --ews-container: min(calc(100% - 48px), var(--ews-max));
  --ews-container-sm: min(calc(100% - 32px), var(--ews-max));

  /* Full-bleed section padding (background runs edge to edge). */
  --ews-bleed-pad: max(24px, calc((100vw - var(--ews-max)) / 2));

  /* Signature editorial left indent for headings and grids. */
  --ews-indent: clamp(0px, 9vw, 120px);

  /* Vertical section rhythm. */
  --ews-section-y: 120px;
  --ews-section-y-alt: 115px;
  --ews-section-y-sm: 88px;

  /* Fixed chrome heights — needed for scroll offsets and nav overlay insets. */
  --ews-utility-h: 34px;
  --ews-nav-h: 84px;
  --ews-nav-h-sm: 76px;
  --ews-mobile-bar-h: 64px;

  /* Breakpoints are documentation only (CSS cannot interpolate them into
     media queries). Mirror these exactly in JS or a custom-media plugin. */
  --ews-bp-nav: 1120px;     /* nav collapses to drawer */
  --ews-bp-stack: 900px;    /* two-column layouts stack */
  --ews-bp-mobile: 680px;   /* single column + mobile action bar */

  /* ======================================================================
     6. RADIUS — this system is deliberately sharp. Default is 0.
     ====================================================================== */
  --ews-radius-none: 0;
  --ews-radius-xs: 2px;  /* form inputs */
  --ews-radius-sm: 3px;  /* buttons, logo */
  --ews-radius-md: 4px;  /* skip link, chart bars */
  --ews-radius-device: 42px; /* phone mockup */
  --ews-radius-pill: 999px;
  --ews-radius-circle: 50%;

  /* ======================================================================
     7. BORDERS
     ====================================================================== */
  --ews-border-hairline: 1px;
  --ews-border-pipe: 2px;
  --ews-border-accent: 3px;   /* left accent rule on notes and captions */
  --ews-border-emphasis: 4px; /* top rule on result cards */

  /* ======================================================================
     8. ELEVATION AND BLUR — glow, not drop shadow. No shadow on flat cards.
     ====================================================================== */
  --ews-shadow-card: 0 24px 70px rgba(0, 0, 0, 0.32);
  --ews-shadow-float: 0 36px 70px rgba(3, 17, 29, 0.27);
  --ews-shadow-header: 0 12px 35px rgba(3, 17, 29, 0.1);
  --ews-shadow-cta: 0 12px 28px rgba(10, 143, 85, 0.22);
  --ews-shadow-whatsapp: 0 6px 18px rgba(32, 184, 90, 0.24);
  --ews-shadow-node: 0 12px 25px rgba(0, 0, 0, 0.35);
  --ews-shadow-product: 0 30px 45px rgba(0, 0, 0, 0.28);

  --ews-blur-nav: 18px;
  --ews-blur-bar: 15px;
  --ews-blur-chip: 12px;
  --ews-blur-aura: 28px;
  --ews-blur-mist: 22px;
  --ews-blur-glow: 6px;

  /* ======================================================================
     9. MOTION — four durations. Anything longer is ambient atmosphere.
        All of it is disabled under prefers-reduced-motion.
     ====================================================================== */
  --ews-dur-track: 120ms;  /* scroll/pointer-coupled, must feel instant */
  --ews-dur-fast: 180ms;   /* hover, focus, micro-state */
  --ews-dur-nav: 220ms;    /* drawer, header shadow */
  --ews-dur-state: 600ms;  /* diagram state change */
  --ews-dur-reveal: 700ms; /* scroll reveal, air-bubble transition */

  --ews-ease: ease;               /* UI default */
  --ews-ease-out: ease-out;       /* pointer parallax */
  --ews-ease-linear: linear;      /* scroll-coupled, continuous spin */
  --ews-ease-ambient: ease-in-out; /* mist, pulse, breathe */

  /* Ambient loop durations — slow enough to read as atmosphere, not UI. */
  --ews-loop-pulse: 1.8s;   /* flow arrows */
  --ews-loop-breathe: 3.8s; /* conceptual chart bars */
  --ews-loop-travel: 5s;    /* route dot */
  --ews-loop-mist-1: 9s;
  --ews-loop-mist-2: 12s;
  --ews-loop-orbit: 26s;

  --ews-reveal-offset: 24px; /* translateY start for .reveal */

  /* ======================================================================
     10. Z-INDEX — 0-8 is reserved for in-section stacking contexts.
     ====================================================================== */
  --ews-z-hero-bg: 0;
  --ews-z-hero-orbit: 1;
  --ews-z-hero-veil: 2;
  --ews-z-hero-product: 3;
  --ews-z-hero-mist: 4;
  --ews-z-hero-caption: 5;
  --ews-z-hero-copy: 8;
  --ews-z-header: 100;
  --ews-z-mobile-bar: 120;
  --ews-z-skip-link: 1000;
}

/* ==========================================================================
   LEGACY ALIASES
   --------------------------------------------------------------------------
   `styles.css` still declares these seventeen variables itself with the same
   literal values, so it currently overrides this block harmlessly. The aliases
   exist so tokens.css is complete on its own (Lovable, a React port, or any
   new stylesheet can consume it without styles.css present).

   Retiring them: delete the :root block at the top of styles.css, then
   search-and-replace each legacy name with its --ews- equivalent. Do that as
   a separate, reviewable change — not alongside design work.
   ========================================================================== */

:root {
  --navy-950: var(--ews-navy-950);
  --navy-900: var(--ews-navy-900);
  --navy-800: var(--ews-navy-800);
  --navy-700: var(--ews-navy-700);
  --cyan-500: var(--ews-cyan-500);
  --cyan-300: var(--ews-cyan-300);
  --green-600: var(--ews-green-600);
  --green-500: var(--ews-green-500);
  --orange-500: var(--ews-orange-500);
  --ink: var(--ews-text-body);
  --muted: var(--ews-text-muted);
  --paper: var(--ews-navy-800);
  --paper-2: var(--ews-navy-880);
  --white: var(--ews-gray-000);
  --line: var(--ews-rule);
  --shadow: var(--ews-shadow-card);
  --max: var(--ews-max);
}
