/* ==========================================================================
   UNIRAY - design tokens
   Colours are taken from the logo: charcoal wordmark, lime recycling arrows.
   ========================================================================== */
@layer tokens {
  :root {
    /* ---- ink scale (dark UI base) */
    --ink-950: #0B0F0C;
    --ink-900: #111712;
    --ink-850: #151C17;
    --ink-800: #1A221C;
    --ink-700: #243026;
    --ink-600: #31402F;

    /* ---- brand */
    --lime: #A6CE39;          /* logo arrows - primary accent, focus, active */
    --lime-soft: #D2E388;     /* logo light green - pill buttons w/ dark text */
    --lime-deep: #86A92A;
    --charcoal: #404041;      /* logo wordmark */

    /* ---- light surfaces (product photos have white backgrounds) */
    --paper: #F4F6EF;
    --paper-2: #E9EDE1;

    /* ---- text */
    --text: #EEF2E7;
    --text-2: rgba(238, 242, 231, .78);
    /* .5 dropped below 4.5:1 on the lighter glass panels - .66 clears it */
    --text-3: rgba(238, 242, 231, .66);
    --text-on-light: #1A221C;
    --text-on-light-2: rgba(26, 34, 28, .7);

    /* ---- lines */
    --line: rgba(255, 255, 255, .10);
    --line-strong: rgba(255, 255, 255, .22);
    --line-dark: rgba(26, 34, 28, .12);

    /* ---- glass */
    --glass-fill: linear-gradient(180deg, rgba(255, 255, 255, .14), rgba(255, 255, 255, .05));
    --glass-fill-strong: linear-gradient(180deg, rgba(255, 255, 255, .20), rgba(255, 255, 255, .07));
    --glass-border: 1px solid rgba(255, 255, 255, .18);
    --glass-edge: inset 0 1px 0 rgba(255, 255, 255, .28);
    --glass-blur: saturate(135%) blur(18px);
    --glass-blur-m: saturate(130%) blur(12px);
    --glass-solid: rgba(21, 28, 23, .92);

    /* ---- glass material, three levels (pass 2)
       Each level = fill + blur + border + specular edge. A faint lime tint
       keeps glass in the brand family instead of reading as neutral grey. */
    --glass-tint: rgba(210, 227, 136, .05);
    --glass-1-fill: linear-gradient(180deg, rgba(255,255,255,.07), rgba(255,255,255,.025));
    --glass-1-blur: saturate(120%) blur(10px);
    --glass-1-border: rgba(255, 255, 255, .10);
    --glass-2-fill: linear-gradient(180deg, rgba(255,255,255,.13), rgba(255,255,255,.05));
    --glass-2-blur: saturate(135%) blur(18px);
    --glass-2-border: rgba(255, 255, 255, .17);
    --glass-3-fill: linear-gradient(180deg, rgba(255,255,255,.19), rgba(255,255,255,.075));
    --glass-3-blur: saturate(150%) blur(26px);
    --glass-3-border: rgba(255, 255, 255, .24);
    --glass-specular: inset 0 1px 0 rgba(255,255,255,.30), inset 1px 0 0 rgba(255,255,255,.12);
    /* 3% grain, inlined so it costs no request and works from disk */
    --grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3'/%3E%3C/filter%3E%3Crect width='120' height='120' filter='url(%23n)' opacity='.34'/%3E%3C/svg%3E");

    /* ---- page background, sampled from the rendered home page at 1440x900.
       The preloader reuses these so its fade-out lands on the same colour the
       hero gutter already is (measured: header #1B261C, gutters #141E17). */
    --bg-sample-light: #1B261C;
    --bg-sample-mid: #141F18;

    /* ---- icon sizes */
    --icon-xs: 14px;
    --icon-sm: 16px;
    --icon-md: 20px;
    --icon-lg: 24px;
    --icon-xl: 28px;
    --icon-gap: 8px;
    --icon-gap-lg: 10px;

    /* ---- radii */
    --radius-xs: 8px;
    --radius-s: 14px;
    --radius-m: 20px;
    --radius-l: 28px;
    --radius-xl: 36px;
    --radius-pill: 999px;

    /* ---- shadows */
    --shadow-1: 0 10px 30px -12px rgba(0, 0, 0, .45);
    --shadow-2: 0 40px 120px -40px rgba(0, 0, 0, .65);
    --shadow-lime: 0 0 0 1px rgba(166, 206, 57, .35), 0 8px 30px -10px rgba(166, 206, 57, .45);

    /* ---- easing / duration */
    --ease-out: cubic-bezier(.22, 1, .36, 1);
    --ease-inout: cubic-bezier(.76, 0, .24, 1);
    --dur-1: .18s;
    --dur-2: .32s;
    --dur-3: .6s;

    /* ---- section rhythm (pass 3) -----------------------------------------
       ONE number owns the space between two sections, everywhere on the site.
       Sections themselves carry no vertical padding; see base.css. Pass 2 had
       every section padding 160px top AND bottom, so a boundary measured up to
       320px - the gap the owner reported. 152px is that halved.
       ~152px desktop / ~100px tablet / 72px mobile. */
    --section-gap: clamp(72px, 10vw, 152px);
    --section-gap-tight: calc(var(--section-gap) * .5);

    /* head rhythm: eyebrow -> h2 -> intro -> content */
    --head-eyebrow: 16px;
    --head-intro: 20px;
    --head-content: 48px;

    /* ---- layout */
    --header-h: 84px;
    --tabbar-h: 0px;
    --fab: 56px;
    --fab-gap: 20px;
    --gutter: clamp(18px, 4vw, 56px);
    --maxw: 1440px;
    --measure: 68ch;

    /* ---- type scale (fluid) */
    --fs-eyebrow: clamp(11px, .72vw, 13px);
    --fs-small: clamp(13px, .9vw, 14px);
    --fs-body: clamp(15px, 1.05vw, 17px);
    --fs-lead: clamp(17px, 1.35vw, 20px);
    --fs-h3: clamp(1.15rem, 1.6vw, 1.5rem);
    --fs-h2: clamp(2rem, 4.2vw, 3.6rem);
    --fs-h1: clamp(2.4rem, 6vw, 5rem);

    --font-display: 'Montserrat', system-ui, -apple-system, 'Segoe UI', sans-serif;
    --font-body: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
    --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;

    /* ---- z-index ladder */
    --z-grid: 0;
    --z-content: 1;
    --z-hero-ui: 20;
    --z-header: 60;
    --z-fab: 70;
    --z-tabbar: 75;
    --z-sheet: 80;
    --z-toast: 90;
    --z-preloader: 100;

    color-scheme: dark;
  }

  @media (max-width: 767px) {
    :root {
      --header-h: 60px;
      --tabbar-h: 72px;
      --glass-blur: var(--glass-blur-m);
      /* head rhythm scaled down ~25% on small screens */
      --head-eyebrow: 12px;
      --head-intro: 15px;
      --head-content: 36px;
    }
  }

  /* ---- progressive-enhancement fallbacks -------------------------------- */
  @supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
    :root {
      --glass-fill: linear-gradient(180deg, rgba(21, 28, 23, .94), rgba(17, 23, 18, .94));
      --glass-fill-strong: linear-gradient(180deg, rgba(26, 34, 28, .96), rgba(21, 28, 23, .96));
    }
  }

  @media (prefers-reduced-transparency: reduce) {
    :root {
      --glass-fill: linear-gradient(180deg, rgba(21, 28, 23, .96), rgba(17, 23, 18, .96));
      --glass-fill-strong: linear-gradient(180deg, rgba(26, 34, 28, .98), rgba(21, 28, 23, .98));
      --glass-blur: none;
      --glass-blur-m: none;
    }
  }

  @media (forced-colors: active) {
    :root {
      --lime: Highlight;
      --text: CanvasText;
      --line: CanvasText;
      --glass-fill: Canvas;
    }
  }
}
