/* ==========================================================================
   Emundia.si – Liquid Glass Design Tokens
   (Clear, Thin, Low-Tint Optical Glass • Edge Lensing • Specular Rim)
   ========================================================================== */

:root {
  /* Typography */
  --font-display: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;

  /* Fluid Type Scale (Mobile-First) */
  --text-xs: 0.75rem;
  --text-sm: 0.875rem;
  --text-base: 1rem;
  --text-lg: 1.125rem;
  --text-xl: 1.25rem;
  --text-2xl: clamp(1.4rem, 3.2vw, 1.85rem);
  --text-3xl: clamp(1.75rem, 4.5vw, 2.65rem);
  --text-4xl: clamp(2.1rem, 5.8vw, 3.4rem);

  /* Spacing */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;

  /* Radii (Smooth curved lens geometry) */
  --radius-sm: 0.8rem;
  --radius-md: 1.25rem;
  --radius-lg: 1.65rem;
  --radius-xl: 2.1rem;
  --radius-pill: 9999px;

  /* Layout */
  --header-height: 4.5rem;
  --container-max: 1240px;

  /* Z-index layers */
  --z-bg: -1;
  --z-base: 1;
  --z-sticky: 30;
  --z-header: 50;
  --z-compare: 60;
  --z-drawer: 80;
  --z-modal: 90;
  --z-toast: 100;

  /* Motion */
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --dur-fast: 170ms;
  --dur-base: 300ms;
  --dur-slow: 480ms;

  /* Brand & Semantic Accents */
  --accent-primary: #38bdf8;
  --accent-secondary: #a78bfa;
  --accent-tertiary: #2dd4bf;
  --accent-pink: #f472b6;
  --accent-gradient: linear-gradient(135deg, #38bdf8 0%, #818cf8 50%, #2dd4bf 100%);
  --score-high: #34d399;
  --score-mid: #38bdf8;
  --score-low: #fbbf24;
  --danger: #fb7185;
}

/* ==========================================================================
   Dark Liquid Glass (Default) – Clear, Thin, Low-Tint Optical Lens
   ========================================================================== */
:root,
[data-theme="dark"] {
  color-scheme: dark;

  --bg-canvas: #040713;
  --bg-canvas-alt: #0b1228;

  /* Clear, thin, low-tint surfaces (almost transparent middle so refraction shines!) */
  --glass-bg: linear-gradient(
    145deg,
    rgba(255, 255, 255, 0.085) 0%,
    rgba(12, 19, 38, 0.22) 38%,
    rgba(8, 14, 30, 0.26) 72%,
    rgba(255, 255, 255, 0.055) 100%
  );
  --glass-bg-elevated: linear-gradient(
    145deg,
    rgba(255, 255, 255, 0.11) 0%,
    rgba(14, 22, 44, 0.26) 40%,
    rgba(10, 16, 36, 0.3) 75%,
    rgba(125, 211, 252, 0.07) 100%
  );
  --glass-bg-strong: linear-gradient(
    145deg,
    rgba(255, 255, 255, 0.12) 0%,
    rgba(10, 18, 38, 0.42) 48%,
    rgba(8, 14, 30, 0.46) 100%
  );
  --glass-bg-hover: linear-gradient(
    145deg,
    rgba(255, 255, 255, 0.14) 0%,
    rgba(16, 26, 52, 0.24) 45%,
    rgba(56, 189, 248, 0.09) 100%
  );
  --glass-bg-subtle: rgba(255, 255, 255, 0.055);

  /* Crisp Specular Rim + Subtle Edge-Only Chromatic Dispersion (RGB Split) */
  --glass-border: rgba(255, 255, 255, 0.22);
  --glass-border-strong: rgba(255, 255, 255, 0.44);
  --glass-specular-rim:
    inset 0 1.25px 0 rgba(255, 255, 255, 0.72),
    inset 1.25px 0 0 rgba(255, 255, 255, 0.34),
    inset 0 -1px 0 rgba(255, 255, 255, 0.16),
    inset -1px 0 0 rgba(255, 255, 255, 0.12);
  --glass-chromatic-edge:
    inset 1.5px 1px 0 rgba(56, 189, 248, 0.26),
    inset -1.5px -1px 0 rgba(244, 114, 182, 0.22);
  --glass-highlight: var(--glass-specular-rim), var(--glass-chromatic-edge);

  --glass-prismatic-border: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.78) 0%,
    rgba(125, 211, 252, 0.42) 22%,
    rgba(255, 255, 255, 0.1) 50%,
    rgba(244, 114, 182, 0.26) 78%,
    rgba(255, 255, 255, 0.52) 100%
  );

  /* Clear optical filter (minimal blur, high optical clarity & saturation) */
  --glass-blur: blur(3.5px) saturate(180%) contrast(1.04) brightness(1.05);
  --glass-blur-heavy: blur(5.5px) saturate(195%) contrast(1.05) brightness(1.06);

  /* Shadows */
  --shadow-sm: 0 10px 30px rgba(0, 0, 0, 0.34);
  --shadow-md: 0 18px 48px rgba(0, 0, 0, 0.46);
  --shadow-lg: 0 28px 80px rgba(0, 0, 0, 0.6);
  --shadow-glow: 0 0 34px rgba(56, 189, 248, 0.2), 0 0 18px rgba(167, 139, 250, 0.14);

  /* Text (crisp readability over clear optical glass) */
  --text-primary: #f8fafc;
  --text-secondary: #d4e0ef;
  --text-muted: #9eb0c9;
  --text-inverse: #040713;
  --glass-text-shadow: 0 1px 10px rgba(4, 7, 19, 0.55);

  /* Backdrop Palette */
  --orb-1: rgba(14, 165, 233, 0.55);
  --orb-2: rgba(139, 92, 246, 0.5);
  --orb-3: rgba(20, 184, 166, 0.48);
  --orb-4: rgba(236, 72, 153, 0.4);
  --glass-glare-color: rgba(255, 255, 255, 0.34);
  --glass-sheen-color: rgba(255, 255, 255, 0.26);
  --backdrop-stroke-strong: rgba(125, 211, 252, 0.55);
  --backdrop-stroke-soft: rgba(255, 255, 255, 0.18);
}

/* ==========================================================================
   Light Liquid Glass – Crystal Clear Thin Water-Glass
   ========================================================================== */
[data-theme="light"] {
  color-scheme: light;

  --bg-canvas: #e5effb;
  --bg-canvas-alt: #d8e7f8;

  --glass-bg: linear-gradient(
    145deg,
    rgba(255, 255, 255, 0.38) 0%,
    rgba(255, 255, 255, 0.14) 45%,
    rgba(224, 242, 254, 0.22) 100%
  );
  --glass-bg-elevated: linear-gradient(
    145deg,
    rgba(255, 255, 255, 0.52) 0%,
    rgba(255, 255, 255, 0.22) 50%,
    rgba(237, 233, 254, 0.28) 100%
  );
  --glass-bg-strong: linear-gradient(
    145deg,
    rgba(255, 255, 255, 0.62) 0%,
    rgba(241, 247, 255, 0.4) 100%
  );
  --glass-bg-hover: linear-gradient(
    145deg,
    rgba(255, 255, 255, 0.62) 0%,
    rgba(255, 255, 255, 0.28) 100%
  );
  --glass-bg-subtle: rgba(255, 255, 255, 0.24);

  --glass-border: rgba(255, 255, 255, 0.72);
  --glass-border-strong: rgba(255, 255, 255, 0.96);
  --glass-specular-rim:
    inset 0 1.5px 0 rgba(255, 255, 255, 0.98),
    inset 1.25px 0 0 rgba(255, 255, 255, 0.72),
    inset 0 -1px 0 rgba(15, 23, 42, 0.08);
  --glass-chromatic-edge:
    inset 1.5px 1px 0 rgba(14, 165, 233, 0.26),
    inset -1.5px -1px 0 rgba(236, 72, 153, 0.2);
  --glass-highlight: var(--glass-specular-rim), var(--glass-chromatic-edge);

  --glass-prismatic-border: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.98) 0%,
    rgba(56, 189, 248, 0.44) 26%,
    rgba(255, 255, 255, 0.45) 54%,
    rgba(244, 114, 182, 0.28) 80%,
    rgba(255, 255, 255, 0.95) 100%
  );

  --glass-blur: blur(3px) saturate(190%) contrast(1.03) brightness(1.03);
  --glass-blur-heavy: blur(5px) saturate(205%) contrast(1.04) brightness(1.04);

  --shadow-sm: 0 8px 26px rgba(15, 38, 92, 0.08);
  --shadow-md: 0 18px 46px rgba(15, 38, 92, 0.13);
  --shadow-lg: 0 28px 72px rgba(15, 38, 92, 0.18);
  --shadow-glow: 0 0 34px rgba(14, 165, 233, 0.2);

  --text-primary: #071024;
  --text-secondary: #1e3150;
  --text-muted: #465a7b;
  --text-inverse: #ffffff;
  --glass-text-shadow: 0 1px 6px rgba(255, 255, 255, 0.65);

  --accent-primary: #0284c7;
  --accent-secondary: #6366f1;
  --accent-tertiary: #0d9488;

  --orb-1: rgba(56, 189, 248, 0.56);
  --orb-2: rgba(139, 92, 246, 0.46);
  --orb-3: rgba(20, 184, 166, 0.48);
  --orb-4: rgba(244, 114, 182, 0.4);
  --glass-glare-color: rgba(255, 255, 255, 0.72);
  --glass-sheen-color: rgba(255, 255, 255, 0.62);
  --backdrop-stroke-strong: rgba(2, 132, 199, 0.48);
  --backdrop-stroke-soft: rgba(15, 23, 42, 0.13);
}
