/* AK Core design tokens. Brand palette → semantic tokens for light and dark themes.
   Components must use semantic tokens only, never brand hex values directly. */

@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("../fonts/inter-latin-ext.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;
}

@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("../fonts/inter-latin.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;
}

@font-face {
  font-family: "Manrope";
  font-style: normal;
  font-weight: 200 800;
  font-display: swap;
  src: url("../fonts/manrope-latin-ext.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;
}

@font-face {
  font-family: "Manrope";
  font-style: normal;
  font-weight: 200 800;
  font-display: swap;
  src: url("../fonts/manrope-latin.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;
}

:root {
  /* Brand palette (AK Core) */
  --core-navy: #0B1220;
  --core-blue: #315DDF;
  --soft-blue: #89A9FF;
  --cloud-white: #F6F8FC;
  --slate: #152238;

  /* Typography */
  --font-sans: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
  --font-display: "Manrope", "Inter", "Segoe UI", system-ui, sans-serif;
  --text-xs: 0.75rem;
  --text-sm: 0.8125rem;
  --text-base: 0.9375rem;
  --text-lg: 1.0625rem;
  --text-xl: 1.375rem;
  --text-2xl: 1.75rem;

  /* Spacing (8-point system with half steps) */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  --space-7: 48px;

  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 14px;
  --radius-pill: 999px;

  --duration: 160ms;
  --ease: cubic-bezier(0.2, 0, 0, 1);

  --sidebar-width: 248px;
  --sidebar-collapsed: 72px;
  --header-height: 60px;
  --content-max: 1240px;

  /* Sidebar stays dark in both themes (brand identity) */
  --sidebar-bg: var(--core-navy);
  --sidebar-text: #B8C4DA;
  --sidebar-text-strong: #F6F8FC;
  --sidebar-hover: rgba(137, 169, 255, 0.10);
  --sidebar-active-bg: rgba(137, 169, 255, 0.16);
  --sidebar-active-text: #FFFFFF;
  --sidebar-accent: var(--soft-blue);
  --sidebar-border: rgba(255, 255, 255, 0.06);
  --logo-tile: var(--core-blue);
  --logo-stroke: #FFFFFF;
  --logo-accent: #C9D8FF;
  --logo-core: var(--core-navy);
}

/* Light theme (default) */
:root,
:root[data-theme="light"] {
  color-scheme: light;
  --bg: var(--cloud-white);
  --surface: #FFFFFF;
  --surface-2: #F3F6FB;
  --surface-hover: #EEF2F9;
  --text: var(--slate);
  --text-muted: #56637A;
  --text-inverse: #FFFFFF;
  --border: #E4EAF3;
  --border-strong: #C9D3E3;
  --primary: var(--core-blue);
  --primary-hover: #244BC0;
  --primary-contrast: #FFFFFF;
  --primary-soft: #EBF0FE;
  --primary-soft-text: #2347B3;
  --link: #2850CC;
  --focus: #315DDF;
  --focus-ring: 0 0 0 3px rgba(49, 93, 223, 0.28);
  --success: #15803D;
  --success-soft: #E7F5EC;
  --warning: #B45309;
  --warning-soft: #FDF3E4;
  --danger: #B91C1C;
  --danger-hover: #991B1B;
  --danger-soft: #FCEBEB;
  --neutral-soft: #EEF1F6;
  --neutral-text: #4A5770;
  --shadow-sm: 0 1px 2px rgba(11, 18, 32, 0.05);
  --shadow: 0 1px 2px rgba(11, 18, 32, 0.04), 0 4px 16px rgba(11, 18, 32, 0.06);
  --shadow-lg: 0 12px 40px rgba(11, 18, 32, 0.18);
  --backdrop: rgba(11, 18, 32, 0.45);
  --skeleton: #E8EDF5;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #0B1220;
    --surface: #111A2B;
    --surface-2: #162036;
    --surface-hover: #1A2640;
    --text: #E7ECF6;
    --text-muted: #9DAAC2;
    --text-inverse: #0B1220;
    --border: #22304A;
    --border-strong: #33425F;
    --primary: #3D67E6;
    --primary-hover: #5079EE;
    --primary-contrast: #FFFFFF;
    --primary-soft: rgba(137, 169, 255, 0.14);
    --primary-soft-text: #B3C7FF;
    --link: var(--soft-blue);
    --focus: var(--soft-blue);
    --focus-ring: 0 0 0 3px rgba(137, 169, 255, 0.35);
    --success: #4ADE80;
    --success-soft: rgba(74, 222, 128, 0.12);
    --warning: #FBBF24;
    --warning-soft: rgba(251, 191, 36, 0.12);
    --danger: #F87171;
    --danger-hover: #FCA5A5;
    --danger-soft: rgba(248, 113, 113, 0.13);
    --neutral-soft: rgba(157, 170, 194, 0.14);
    --neutral-text: #C3CDDF;
    --shadow-sm: none;
    --shadow: 0 0 0 1px rgba(255, 255, 255, 0.02);
    --shadow-lg: 0 16px 48px rgba(0, 0, 0, 0.5);
    --backdrop: rgba(3, 6, 12, 0.65);
    --skeleton: #1B2740;
    --sidebar-bg: #070C16;
  }
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0B1220;
  --surface: #111A2B;
  --surface-2: #162036;
  --surface-hover: #1A2640;
  --text: #E7ECF6;
  --text-muted: #9DAAC2;
  --text-inverse: #0B1220;
  --border: #22304A;
  --border-strong: #33425F;
  --primary: #3D67E6;
  --primary-hover: #5079EE;
  --primary-contrast: #FFFFFF;
  --primary-soft: rgba(137, 169, 255, 0.14);
  --primary-soft-text: #B3C7FF;
  --link: var(--soft-blue);
  --focus: var(--soft-blue);
  --focus-ring: 0 0 0 3px rgba(137, 169, 255, 0.35);
  --success: #4ADE80;
  --success-soft: rgba(74, 222, 128, 0.12);
  --warning: #FBBF24;
  --warning-soft: rgba(251, 191, 36, 0.12);
  --danger: #F87171;
  --danger-hover: #FCA5A5;
  --danger-soft: rgba(248, 113, 113, 0.13);
  --neutral-soft: rgba(157, 170, 194, 0.14);
  --neutral-text: #C3CDDF;
  --shadow-sm: none;
  --shadow: 0 0 0 1px rgba(255, 255, 255, 0.02);
  --shadow-lg: 0 16px 48px rgba(0, 0, 0, 0.5);
  --backdrop: rgba(3, 6, 12, 0.65);
  --skeleton: #1B2740;
  --sidebar-bg: #070C16;
}
