/* ==========================================================================
   AlNajdi — Theme: tokens, typography, reset
   Inspired by clean Baims-style UI: airy whitespace, subtle borders,
   large rounded cards, generous touch targets. Dark mode preserved.
   ========================================================================== */

/* Local copies of the prior Google Fonts setup. Keep fonts self-hosted so they
   work with the production CSP and do not expose student traffic to a third party. */
@font-face {
    font-family: "Cairo";
    font-style: normal;
    font-weight: 500 800;
    font-display: swap;
    src: url("/fonts/cairo-arabic.woff2") format("woff2");
    unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC, U+102E0-102FB, U+10E60-10E7E, U+10EC2-10EC4, U+10EFC-10EFF, U+1EE00-1EE03, U+1EE05-1EE1F, U+1EE21-1EE22, U+1EE24, U+1EE27, U+1EE29-1EE32, U+1EE34-1EE37, U+1EE39, U+1EE3B, U+1EE42, U+1EE47, U+1EE49, U+1EE4B, U+1EE4D-1EE4F, U+1EE51-1EE52, U+1EE54, U+1EE57, U+1EE59, U+1EE5B, U+1EE5D, U+1EE5F, U+1EE61-1EE62, U+1EE64, U+1EE67-1EE6A, U+1EE6C-1EE72, U+1EE74-1EE77, U+1EE79-1EE7C, U+1EE7E, U+1EE80-1EE89, U+1EE8B-1EE9B, U+1EEA1-1EEA3, U+1EEA5-1EEA9, U+1EEAB-1EEBB, U+1EEF0-1EEF1;
}

@font-face {
    font-family: "Cairo";
    font-style: normal;
    font-weight: 500 800;
    font-display: swap;
    src: url("/fonts/cairo-latin.woff2") format("woff2");
    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";
    font-style: normal;
    font-weight: 400 800;
    font-display: swap;
    src: url("/fonts/inter-latin.woff2") format("woff2");
}

@font-face {
    font-family: "JetBrains Mono";
    font-style: normal;
    font-weight: 400 500;
    font-display: swap;
    src: url("/fonts/jetbrains-mono-latin.woff2") format("woff2");
}

:root {
    /* Brand — neutral monochrome ramp (minimal black-on-white) */
    --brand-50:  #f4f4f5;
    --brand-100: #e4e4e7;
    --brand-200: #d4d4d8;
    --brand-300: #a1a1aa;
    --brand-400: #52525b;
    --brand-500: #18181b;   /* primary action (near-black) */
    --brand-600: #000000;   /* primary hover */
    --brand-700: #27272a;   /* text on a light tint */
    --brand-800: #18181b;
    --on-brand:  #ffffff;   /* text/icons placed on a brand-500 surface */

    /* Neutrals (light mode) */
    --bg:          #fafafa;
    --bg-elev:     #ffffff;
    --bg-elev-2:   #f4f4f5;
    --text:        #09090b;
    --text-soft:   #3f3f46;
    --text-mute:   #71717a;
    --border:      #e4e4e7;
    --border-strong: #d4d4d8;

    /* Status (kept functional: correct/wrong/partial need real color) */
    --ok:    #16a34a;
    --ok-bg: #dcfce7;
    --bad:   #dc2626;
    --bad-bg:#fee2e2;
    --warn:  #d97706;
    --warn-bg:#fef3c7;

    /* Accents */
    --info:  #52525b;
    --gold:  #a16207;

    /* Spacing scale */
    --s-1: 4px; --s-2: 8px; --s-3: 12px; --s-4: 16px;
    --s-5: 24px; --s-6: 32px; --s-7: 48px; --s-8: 64px;

    /* Radii */
    --r-sm: 8px; --r-md: 12px; --r-lg: 18px; --r-xl: 24px; --r-full: 9999px;

    /* Shadows */
    --shadow-xs: 0 1px 2px rgba(9, 9, 11, .04);
    --shadow:    0 2px 8px rgba(9, 9, 11, .06);
    --shadow-lg: 0 12px 32px rgba(9, 9, 11, .10);
    --shadow-pop: 0 24px 60px rgba(9, 9, 11, .14);

    /* Type */
    --font-body:    "Inter", -apple-system, "Segoe UI", "Cairo", system-ui, sans-serif;
    --font-display: "Inter", "Cairo", system-ui, serif;
    --font-mono:    "JetBrains Mono", ui-monospace, "SFMono-Regular", monospace;
}

[data-theme="dark"] {
    /* Minimal true-black surfaces — no color tint */
    --bg:           #0a0a0a;
    --bg-elev:      #141414;
    --bg-elev-2:    #1f1f1f;
    --text:         #fafafa;
    --text-soft:    #d4d4d8;
    --text-mute:    #a1a1aa;
    --border:       #262626;
    --border-strong:#3f3f46;

    /* Brand inverts: primary surfaces become light, text on them dark */
    --brand-50:  #1c1c1f;
    --brand-100: #27272a;
    --brand-200: #3f3f46;
    --brand-300: #d4d4d8;
    --brand-400: #a1a1aa;
    --brand-500: #fafafa;
    --brand-600: #ffffff;
    --brand-700: #e4e4e7;
    --brand-800: #fafafa;
    --on-brand:  #0a0a0a;

    /* Status tuned for dark contrast */
    --ok:    #22c55e;
    --bad:   #ef4444;
    --warn:  #f59e0b;
    --ok-bg: #0f2417;
    --bad-bg: #2a1212;
    --warn-bg:#2a1f07;

    --shadow:    0 2px 8px rgba(0, 0, 0, .35);
    --shadow-lg: 0 12px 32px rgba(0, 0, 0, .45);
    --shadow-pop:0 24px 60px rgba(0, 0, 0, .6);
}

[lang="ar"] body, [dir="rtl"] body { font-family: "Cairo", var(--font-body); }
[dir="rtl"] { text-align: start; }

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
    font-family: var(--font-body);
    background: var(--bg);
    color: var(--text);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    line-height: 1.55;
    font-size: 15px;
}
a { color: inherit; text-decoration: none; }
button { font-family: inherit; }
img { max-width: 100%; height: auto; display: block; }
.hidden { display: none !important; }
.center { display: grid; place-items: center; }
