/* ============================================================================
   AquaCalc — Design Tokens (single source of truth)
   Loaded FIRST on every public + shop-portal page (see page_shell.php page_head
   and inc/ShopAuth.php portal_head). Change a value here and the whole site
   follows. Component stylesheets should reference these tokens, not literals.

   Palette standardised on the public site values (see docs/design-audit.md).
   Decisions: warning amber = #d29922 · Pro/premium accent = purple · body = 16px.
   ============================================================================ */

/* Inter — one webfont for the whole site (public + portal), full unicode
   coverage. Paths are relative to this file (/assets/), so they resolve on any
   page that loads tokens.css. */
@font-face{font-family:'Inter';font-style:normal;font-weight:100 900;font-display:swap;src:url('fonts/inter-latin.woff2') format('woff2');unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}
@font-face{font-family:'Inter';font-style:normal;font-weight:100 900;font-display:swap;src:url('fonts/inter-latin-ext.woff2') format('woff2');unicode-range:U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF}
@font-face{font-family:'Inter';font-style:normal;font-weight:100 900;font-display:swap;src:url('fonts/inter-vietnamese.woff2') format('woff2');unicode-range:U+0102-0103,U+0110-0111,U+0128-0129,U+0168-0169,U+01A0-01A1,U+01AF-01B0,U+0300-0301,U+0303-0304,U+0308-0309,U+0323,U+0329,U+1EA0-1EF9,U+20AB}
@font-face{font-family:'Inter';font-style:normal;font-weight:100 900;font-display:swap;src:url('fonts/inter-greek-ext.woff2') format('woff2');unicode-range:U+1F00-1FFF}
@font-face{font-family:'Inter';font-style:normal;font-weight:100 900;font-display:swap;src:url('fonts/inter-greek.woff2') format('woff2');unicode-range:U+0370-0377,U+037A-037F,U+0384-038A,U+038C,U+038E-03A1,U+03A3-03FF}
@font-face{font-family:'Inter';font-style:normal;font-weight:100 900;font-display:swap;src:url('fonts/inter-cyrillic-ext.woff2') format('woff2');unicode-range:U+0460-052F,U+1C80-1C8A,U+20B4,U+2DE0-2DFF,U+A640-A69F,U+FE2E-FE2F}
@font-face{font-family:'Inter';font-style:normal;font-weight:100 900;font-display:swap;src:url('fonts/inter-cyrillic.woff2') format('woff2');unicode-range:U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116}

:root {
  /* ── Surfaces ───────────────────────────────────────────────────────────── */
  --bg:            #0d1117;   /* page background */
  --bg2:           #161b22;
  --bg3:           #1c2128;
  --card:          #161b22;   /* default card */
  --surface:       #161b22;   /* alias of --card (semantic) */
  --surface-2:     #1c2128;   /* elevated / hover */
  --card2:         #1c2128;   /* portal alias of --surface-2 */
  --border:        #21262d;
  --border2:       #30363d;
  --border-strong: #30363d;

  /* ── Text ───────────────────────────────────────────────────────────────── */
  --text:        #e6edf3;   /* headings + body */
  --text2:       #c9d1d9;   /* secondary body */
  --muted:       #7d8590;   /* muted */
  --text-muted:  #7d8590;
  --faint:       #6b7683;   /* captions */
  --text-faint:  #6b7683;

  /* ── Brand ──────────────────────────────────────────────────────────────── */
  --blue:      #58a6ff;
  --primary:   #58a6ff;     /* links, primary actions */
  --teal:      #1d9e75;
  --secondary: #1d9e75;
  --green:     #3fb950;
  --purple:    #a78bfa;
  --accent:    #a78bfa;     /* Pro / premium highlights */
  --brand-grad: linear-gradient(135deg,#58a6ff 0%,#33c3a3 55%,#1d9e75 100%);
  --grad:       linear-gradient(135deg,#58a6ff 0%,#33c3a3 55%,#1d9e75 100%);
  --grad-soft:  linear-gradient(135deg,rgba(88,166,255,.16),rgba(29,158,117,.16));

  /* ── Semantic ───────────────────────────────────────────────────────────── */
  --success: #3fb950;
  --warning: #d29922;       /* amber (decision) */
  --amber:   #d29922;
  --danger:  #f85149;
  --red:     #f85149;
  --info:    #58a6ff;

  /* Legacy accent tints (kept for blog/status backgrounds) */
  --blue-dark:    #1a3a6e;
  --blue-bg:      #0d1f38;
  --green-bg:     #1c2a1c;
  --green-border: #2d4a2d;
  --teal-bg:      #0a2e24;

  /* Translucent status tints */
  --green-faint:        rgba(63,185,80,.07);
  --green-faint-border: rgba(63,185,80,.2);
  --amber-faint:        rgba(210,153,34,.08);
  --amber-faint-border: rgba(210,153,34,.25);
  --red-faint:          rgba(248,81,73,.08);
  --red-faint-border:   rgba(248,81,73,.25);

  /* ── Typography ─────────────────────────────────────────────────────────── */
  --font-sans: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --fs-xs:   0.75rem;    /* 12 */
  --fs-sm:   0.8125rem;  /* 13 */
  --fs-base: 1rem;       /* 16 — body (decision) */
  --fs-md:   1.125rem;   /* 18 */
  --fs-lg:   1.375rem;   /* 22 */
  --fs-xl:   1.75rem;    /* 28 */

  --h-display: clamp(2.25rem, 6vw, 3.5rem);   /* marketing hero titles */
  --h1: clamp(1.75rem, 4.5vw, 2.75rem);        /* page titles */
  --h2: clamp(1.6rem, 3.8vw, 2.5rem);          /* section titles */
  --h3: clamp(1.25rem, 2.5vw, 1.6rem);         /* card / feature titles */
  --h4: 1.25rem;
  --h5: 1.05rem;
  --h6: 0.95rem;
  --lead: clamp(1.0625rem, 2vw, 1.2rem);       /* subtitles / leads */

  /* Hero H1 — one role for EVERY public page hero (home, for-business, blog,
     plants, content/tool page titles). Size, line-height, tracking and weight
     all flow from here so no hero can drift from another. */
  --h-hero: clamp(2rem, 5vw, 3rem);
  --lh-hero: 1.1;
  --track-hero: -.02em;
  --fw-heading: 700;                            /* hero + page title weight (one control point) */

  --lh-tight: 1.15;
  --lh-snug:  1.4;
  --lh-body:  1.6;
  --track-tight:  -.02em;
  --track-normal: 0;
  --track-wide:   .06em;

  /* ── Spacing (8px base) ─────────────────────────────────────────────────── */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  --space-7: 48px;
  --space-8: 64px;
  --section-y: clamp(3.5rem, 7vw, 5rem);   /* 56px → 80px — the home-page rhythm */
  --card-pad: 24px;

  /* ── Radius ─────────────────────────────────────────────────────────────── */
  --radius-sm:    6px;
  --radius-md:    10px;
  --radius-lg:    16px;
  --radius-pill:  999px;
  --radius-round: 50%;
  --radius:       16px;   /* portal legacy alias of --radius-lg */

  /* ── Elevation ──────────────────────────────────────────────────────────── */
  --shadow-sm: 0 1px 2px rgba(0,0,0,.4);
  --shadow-md: 0 10px 30px -12px rgba(0,0,0,.6);
  --shadow:    0 10px 30px -12px rgba(0,0,0,.7);
  --shadow-lg: 0 24px 60px -20px rgba(0,0,0,.75);
  --ring:      0 0 0 1px var(--border);

  /* ── Motion ─────────────────────────────────────────────────────────────── */
  --transition:      .16s ease;
  --transition-fast: .12s ease;

  /* ── Layout ─────────────────────────────────────────────────────────────── */
  --page-width:  1100px;
  --prose-width: 720px;
}

/* Respect users who prefer less motion (site-wide). */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
}
