/* WhozTag design tokens.
   This is the ONLY file allowed to contain raw colour values.
   Light theme is the default; dark applies via prefers-color-scheme
   (unless data-theme="light") or explicitly via data-theme="dark". */

/* Fonts are self-hosted, split by script: a browser downloads a file only
   when the page uses characters in its unicode-range. URLs are relative, so
   they stay on the versioned static path. Chinese uses the system's own CJK
   fonts (a CJK web font would be several megabytes). */
@font-face {
  font-family: "Inter";
  src: url("../fonts/inter-var-latin.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
  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";
  src: url("../fonts/inter-var-latin-ext.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0100-02AF, U+0304, U+0308, U+0329, 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";
  src: url("../fonts/inter-var-cyrillic.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: "Noto Sans Hebrew";
  src: url("../fonts/noto-sans-hebrew-var.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0590-05FF, U+20AA, U+25CC, U+FB1D-FB4F;
}
@font-face {
  font-family: "Noto Sans Arabic";
  src: url("../fonts/noto-sans-arabic-var.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0600-06FF, U+0750-077F, U+0870-08FF, U+FB50-FDFF, U+FE70-FEFC;
}

:root {
  color-scheme: light;

  /* ---- Palette (raw) ---- */
  --gray-0: #ffffff;
  --gray-25: #fbfbfd;
  --gray-50: #f6f7f9;
  --gray-100: #eef0f4;
  --gray-200: #e1e4ea;
  --gray-300: #cdd2db;
  --gray-400: #9aa3b2;
  --gray-500: #6b7484;
  --gray-600: #4d5564;
  --gray-700: #363c48;
  --gray-800: #232831;
  --gray-850: #1a1e26;
  --gray-900: #12151b;
  --gray-950: #0b0d11;

  --brand-50: #eef0ff;
  --brand-100: #dfe2ff;
  --brand-200: #c3c8ff;
  --brand-300: #9ea4ff;
  --brand-400: #7b7ffb;
  --brand-500: #5f5cf2;
  --brand-600: #4c45e0;
  --brand-700: #3f37c0;
  --brand-800: #342f99;
  --brand-900: #2d2b78;

  --green-50: #e9f9ef;
  --green-500: #1f9d55;
  --green-600: #17834a;
  --green-400: #45c97f;
  --amber-50: #fff6e5;
  --amber-500: #c27803;
  --amber-600: #a15f00;
  --amber-400: #f2b544;
  --red-50: #fdecec;
  --red-500: #dc3a3a;
  --red-600: #c02d2d;
  --red-400: #f07272;

  /* ---- Semantic colours (light) ---- */
  --color-bg: var(--gray-25);
  --color-bg-subtle: var(--gray-50);
  --color-surface: var(--gray-0);
  --color-surface-raised: var(--gray-0);
  --color-surface-sunken: var(--gray-100);
  --color-border: var(--gray-200);
  --color-border-strong: var(--gray-300);
  --color-text: var(--gray-900);
  --color-text-muted: var(--gray-600);
  --color-text-subtle: var(--gray-500);
  --color-text-inverse: var(--gray-0);

  --color-accent: var(--brand-600);
  --color-accent-hover: var(--brand-700);
  --color-accent-soft: var(--brand-50);
  --color-accent-soft-text: var(--brand-700);
  --color-on-accent: var(--gray-0);
  --color-focus: var(--brand-500);

  --color-success: var(--green-600);
  --color-success-soft: var(--green-50);
  --color-warning: var(--amber-600);
  --color-warning-soft: var(--amber-50);
  --color-danger: var(--red-600);
  --color-danger-hover: var(--red-500);
  --color-danger-soft: var(--red-50);

  --color-overlay: rgb(11 13 17 / 0.5);

  /* White overlays for content on always-dark surfaces (call screen, CTA band, accent buttons).
     Not theme-dependent. */
  --on-dark-fill: rgb(255 255 255 / 0.12);
  --on-dark-fill-strong: rgb(255 255 255 / 0.2);
  --on-dark-border: rgb(255 255 255 / 0.3);
  --on-dark-focus: rgb(255 255 255 / 0.6);
  --on-dark-text-muted: rgb(255 255 255 / 0.75);
  --on-dark-text: rgb(255 255 255 / 0.88);
  --glow-violet: rgb(178 92 242 / 0.45);
  --gradient-hero: radial-gradient(60rem 30rem at 85% -10%, var(--brand-100), transparent 60%),
    radial-gradient(40rem 24rem at -10% 10%, #e6f6ff, transparent 60%);
  --gradient-accent: linear-gradient(135deg, var(--brand-500), #7b5cf2 55%, #b25cf2);

  /* ---- Typography ---- */
  --font-sans: "Inter", "Noto Sans Hebrew", "Noto Sans Arabic", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
  /* Chinese: the device's CJK fonts, Simplified or Traditional by page language. */
  --font-sans-hans: "Inter", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", "Noto Sans SC",
    "Source Han Sans SC", ui-sans-serif, system-ui, sans-serif;
  --font-sans-hant: "Inter", "PingFang TC", "PingFang HK", "Microsoft JhengHei", "Noto Sans CJK TC", "Noto Sans TC",
    "Source Han Sans TC", ui-sans-serif, system-ui, sans-serif;
  --font-mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;

  --text-xs: 0.75rem;
  --text-sm: 0.875rem;
  --text-base: 1rem;
  --text-lg: 1.125rem;
  --text-xl: 1.25rem;
  --text-2xl: clamp(1.375rem, 1.2rem + 0.6vw, 1.625rem);
  --text-3xl: clamp(1.75rem, 1.45rem + 1.2vw, 2.25rem);
  --text-4xl: clamp(2.125rem, 1.6rem + 2.2vw, 3.25rem);
  --text-5xl: clamp(2.5rem, 1.8rem + 3.2vw, 4.25rem);

  --leading-tight: 1.15;
  --leading-snug: 1.35;
  --leading-normal: 1.6;

  --weight-regular: 400;
  --weight-medium: 500;
  --weight-semibold: 600;
  --weight-bold: 700;

  --tracking-tight: -0.02em;
  --tracking-wide: 0.06em;

  /* ---- Spacing (4px scale) ---- */
  --space-0-5: 0.125rem;
  --space-1: 0.25rem;
  --space-1-5: 0.375rem;
  --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;
  --space-20: 5rem;
  --space-24: 6rem;
  --section-y: clamp(3.5rem, 2rem + 6vw, 7rem);

  /* ---- Radii ---- */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 20px;
  --radius-2xl: 28px;
  --radius-full: 999px;

  /* ---- Shadows ---- */
  --shadow-xs: 0 1px 2px rgb(18 21 27 / 0.06);
  --shadow-sm: 0 1px 3px rgb(18 21 27 / 0.08), 0 1px 2px rgb(18 21 27 / 0.04);
  --shadow-md: 0 6px 16px -4px rgb(18 21 27 / 0.10), 0 2px 6px -2px rgb(18 21 27 / 0.06);
  --shadow-lg: 0 18px 40px -12px rgb(18 21 27 / 0.18), 0 6px 14px -6px rgb(18 21 27 / 0.08);
  --shadow-accent: 0 8px 24px -8px rgb(76 69 224 / 0.55);
  --ring-focus: 0 0 0 3px rgb(95 92 242 / 0.35);

  /* ---- Layout ---- */
  --container-max: 72rem;
  --container-narrow: 44rem;
  --gutter: clamp(1rem, 0.5rem + 2vw, 2rem);
  --header-h: 4rem;
  --sidebar-w: 16rem;
  --tabbar-h: 4rem;

  /* ---- Motion ---- */
  --ease-out: cubic-bezier(0.2, 0.8, 0.2, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  --duration-fast: 120ms;
  --duration-base: 200ms;
  --duration-slow: 320ms;

  /* ---- Z-index ---- */
  --z-header: 50;
  --z-tabbar: 60;
  --z-overlay: 100;
  --z-toast: 200;
}

/* ---- Dark theme ---- */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --color-bg: var(--gray-950);
    --color-bg-subtle: var(--gray-900);
    --color-surface: var(--gray-900);
    --color-surface-raised: var(--gray-850);
    --color-surface-sunken: var(--gray-950);
    --color-border: var(--gray-800);
    --color-border-strong: var(--gray-700);
    --color-text: #eef0f4;
    --color-text-muted: var(--gray-400);
    --color-text-subtle: var(--gray-500);
    --color-text-inverse: var(--gray-900);
    --color-accent: var(--brand-400);
    --color-accent-hover: var(--brand-300);
    --color-accent-soft: rgb(95 92 242 / 0.16);
    --color-accent-soft-text: var(--brand-200);
    --color-on-accent: var(--gray-950);
    --color-focus: var(--brand-400);
    --color-success: var(--green-400);
    --color-success-soft: rgb(31 157 85 / 0.16);
    --color-warning: var(--amber-400);
    --color-warning-soft: rgb(194 120 3 / 0.18);
    --color-danger: var(--red-400);
    --color-danger-hover: #f58c8c;
    --color-danger-soft: rgb(220 58 58 / 0.16);
    --color-overlay: rgb(0 0 0 / 0.65);
    --gradient-hero: radial-gradient(60rem 30rem at 85% -10%, rgb(95 92 242 / 0.22), transparent 60%),
      radial-gradient(40rem 24rem at -10% 10%, rgb(56 160 220 / 0.12), transparent 60%);
    --shadow-xs: 0 1px 2px rgb(0 0 0 / 0.4);
    --shadow-sm: 0 1px 3px rgb(0 0 0 / 0.5);
    --shadow-md: 0 8px 20px -6px rgb(0 0 0 / 0.6);
    --shadow-lg: 0 20px 44px -12px rgb(0 0 0 / 0.7);
    --shadow-accent: 0 8px 24px -8px rgb(123 127 251 / 0.45);
    --ring-focus: 0 0 0 3px rgb(123 127 251 / 0.45);
  }
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --color-bg: var(--gray-950);
  --color-bg-subtle: var(--gray-900);
  --color-surface: var(--gray-900);
  --color-surface-raised: var(--gray-850);
  --color-surface-sunken: var(--gray-950);
  --color-border: var(--gray-800);
  --color-border-strong: var(--gray-700);
  --color-text: #eef0f4;
  --color-text-muted: var(--gray-400);
  --color-text-subtle: var(--gray-500);
  --color-text-inverse: var(--gray-900);
  --color-accent: var(--brand-400);
  --color-accent-hover: var(--brand-300);
  --color-accent-soft: rgb(95 92 242 / 0.16);
  --color-accent-soft-text: var(--brand-200);
  --color-on-accent: var(--gray-950);
  --color-focus: var(--brand-400);
  --color-success: var(--green-400);
  --color-success-soft: rgb(31 157 85 / 0.16);
  --color-warning: var(--amber-400);
  --color-warning-soft: rgb(194 120 3 / 0.18);
  --color-danger: var(--red-400);
  --color-danger-hover: #f58c8c;
  --color-danger-soft: rgb(220 58 58 / 0.16);
  --color-overlay: rgb(0 0 0 / 0.65);
  --gradient-hero: radial-gradient(60rem 30rem at 85% -10%, rgb(95 92 242 / 0.22), transparent 60%),
    radial-gradient(40rem 24rem at -10% 10%, rgb(56 160 220 / 0.12), transparent 60%);
  --shadow-xs: 0 1px 2px rgb(0 0 0 / 0.4);
  --shadow-sm: 0 1px 3px rgb(0 0 0 / 0.5);
  --shadow-md: 0 8px 20px -6px rgb(0 0 0 / 0.6);
  --shadow-lg: 0 20px 44px -12px rgb(0 0 0 / 0.7);
  --shadow-accent: 0 8px 24px -8px rgb(123 127 251 / 0.45);
  --ring-focus: 0 0 0 3px rgb(123 127 251 / 0.45);
}

@media (prefers-reduced-motion: reduce) {
  :root {
    --duration-fast: 0ms;
    --duration-base: 0ms;
    --duration-slow: 0ms;
  }
}
