/* ============================================================
   brand-tokens.css
   Single source of truth for the BookmarkForge brand tokens used
   by the static pages (404, offline, privacy-and-terms). Loaded
   BEFORE each page's own stylesheet so the palette variables and
   the self-hosted Inter Variable font are available everywhere.

   Mirrors the app's design tokens in src/index.css ("Dark Flat UI
   with Glow"). DARK is the brand default (matches app);
   [data-theme="light"] provides the app's light-theme tokens.

   Self-hosted fonts keep the local-first / zero-knowledge promise
   (no external font CDN, no third-party IP log on page load) and
   stay inside the strict CSP (font-src 'self').
   ============================================================ */

/* Inter Variable — latin subset */
@font-face {
  font-family: 'Inter Variable';
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url(/fonts/inter-latin-wght-normal.woff2) format('woff2-variations');
  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;
}
/* Inter Variable — latin-ext subset */
@font-face {
  font-family: 'Inter Variable';
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url(/fonts/inter-latin-ext-wght-normal.woff2) format('woff2-variations');
  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;
}

/* ── Brand default: DARK "Dark Flat UI with Glow" (matches app) ─── */
:root,
[data-theme="dark"] {
  /* Backgrounds */
  --bg-primary: #0f172a;
  --bg-secondary: #1e293b;
  --bg-card: #334155;
  --bg-topbar: #1e293b;
  --bg-sidebar: #0f172a;

  /* Text */
  --text-primary: #f1f5f9;
  --text-secondary: #cbd5e1;
  --text-accent: #38bdf8;
  --text-muted: #94a3b8;
  /* Text on accent-colored fills */
  --text-on-accent: #0f172a;

  /* Accent / brand */
  --accent-primary: #00aeef;
  --accent-secondary: #0d7fc4;
  --accent-glow: rgba(0, 174, 239, 0.25);
  --accent-primary-hover: rgba(0, 174, 239, 0.12);
  --accent-primary-glow: rgba(0, 174, 239, 0.30);
  --text-on-accent: #0f1c2e;

  /* States */
  --state-active-border: #00aeef;
  --state-inactive-border: #1e3352;
  --state-hover-bg: rgba(0, 174, 239, 0.08);
  --state-selected-bg: #1565a8;

  /* Semantic */
  --color-success: #34d399;
  --color-success-text: #6ee7b7;
  --color-warning: #f59e0b;
  --color-warning-text: #fbbf24;
  --color-danger: #ef4444;
  --color-danger-hover: #dc2626;
  --color-danger-text: #ff6b6b;

  /* Soft state */
  --success-soft: rgba(16, 185, 129, 0.10);
  --success-soft-border: rgba(16, 185, 129, 0.20);
  --warning-soft: rgba(245, 158, 11, 0.10);
  --warning-soft-border: rgba(245, 158, 11, 0.20);
  --danger-soft: rgba(239, 68, 68, 0.10);
  --danger-soft-border: rgba(239, 68, 68, 0.20);
  --danger-soft-deep: rgba(239, 68, 68, 0.18);

  /* Toggle */
  --toggle-on: #00aeef;
  --toggle-off: #2e4560;

  /* Utilities */
  --divider: #334155;
  --input-bg: #1e293b;

  /* Overlays */
  --modal-overlay: rgba(0, 0, 0, 0.60);
  --scrim-on-accent: rgba(0, 0, 0, 0.25);

  /* Accent soft variants */
  --accent-soft: rgba(0, 174, 239, 0.15);
  --accent-faint: rgba(0, 174, 239, 0.08);
  --accent-glow-soft: rgba(0, 174, 239, 0.25);
  --accent-primary-glow-strong: rgba(0, 174, 239, 0.50);

  /* Border radius */
  --radius-card: 12px;
  --radius-item: 8px;
  --radius-button: 6px;
  --radius-widget: 10px;
  --radius-toggle: 50px;
  --radius-input: 20px;

  /* Spacing */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 32px;
}

/* ── Light theme (matches app) ────────────────────────────────── */
[data-theme="light"] {
  --bg-primary: #f8fafc;
  --bg-secondary: #f1f5f9;
  --bg-card: #ffffff;
  --bg-topbar: #ffffff;
  --bg-sidebar: #f8fafc;

  --text-primary: #0f172a;
  --text-secondary: #334155;
  --text-accent: #0369a1;
  --text-muted: #64748b;
  /* Text on accent-colored fills */
  --text-on-accent: #ffffff;

  --accent-primary: #0095d6;
  --accent-secondary: #0a6fa8;
  --accent-glow: rgba(0, 149, 214, 0.20);
  --accent-primary-hover: rgba(0, 149, 214, 0.10);
  --accent-primary-glow: rgba(0, 149, 214, 0.25);
  --text-on-accent: #04121f;

  --state-active-border: #0095d6;
  --state-inactive-border: #d0dae8;
  --state-hover-bg: rgba(0, 149, 214, 0.06);
  --state-selected-bg: #cce6f5;

  --color-success: #047857;
  --color-success-text: #6ee7b7;
  --color-warning: #d98c0a;
  --color-warning-text: #92400e;
  --color-danger: #dc2626;
  --color-danger-hover: #b91c1c;
  --color-danger-text: #dc2626;

  --success-soft: rgba(16, 185, 129, 0.16);
  --success-soft-border: rgba(110, 231, 183, 0.35);
  --warning-soft: rgba(245, 158, 11, 0.10);
  --warning-soft-border: rgba(245, 158, 11, 0.20);
  --danger-soft: rgba(239, 68, 68, 0.10);
  --danger-soft-border: rgba(239, 68, 68, 0.20);

  --toggle-on: #0095d6;
  --toggle-off: #d0dae8;

  --divider: #d0dae8;
  --input-bg: #ffffff;

  --modal-overlay: rgba(0, 0, 0, 0.40);
  --scrim-on-accent: rgba(0, 0, 0, 0.15);

  --accent-soft: rgba(0, 149, 214, 0.08);
  --accent-faint: rgba(0, 149, 214, 0.04);
  --accent-glow-soft: rgba(0, 149, 214, 0.15);
  --accent-primary-glow-strong: rgba(0, 149, 214, 0.35);

  /* Border radius & spacing same as dark */
}