/* === Aurum Design Tokens — Terminal Brutalism === */

:root {
    /* Light mode */
    --bg: #ffffff;
    --bg-alt: #fafafa;
    --bg-raised: #ffffff;
    --text: #111111;
    --text-muted: #6b6b6b;
    --text-faint: #999999;
    --border: #e5e5e5;
    --border-strong: #cccccc;
    --hover: #f5f5f5;
    --code-bg: #eeeeee;
    --terminal: #0d0d0d;
    --green: #22c55e;
    --terminal-prompt: #555555;
    --accent: #1a1a1a;

    /* Brutalist shadows — solid offset, not soft blur */
    --shadow-sm: 2px 2px 0 rgba(0, 0, 0, 0.06);
    --shadow-md: 3px 3px 0 rgba(0, 0, 0, 0.08);
    --shadow-lg: 4px 4px 0 rgba(0, 0, 0, 0.10);

    /* Typography — monospace-first */
    --font: "JetBrains Mono", "Cascadia Code", "Fira Code", "Courier New", monospace;

    /* Type scale */
    --text-xs: 0.6875rem;
    --text-sm: 0.75rem;
    --text-base: 0.875rem;
    --text-lg: 0.9375rem;
    --text-xl: 1.125rem;
    --text-2xl: 1.375rem;
    --text-3xl: 2rem;
    --text-4xl: 2.75rem;
    --text-5xl: 3.5rem;

    /* Spacing — 4px baseline */
    --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;
    --space-20: 5rem;
    --space-24: 6rem;

    /* Layout */
    --max-width: 1200px;
    --prose-width: 72ch;
    --nav-height: 60px;
    --grid-size: 40px;
}

/* Dark mode — default for HFT/quant audience */
@media (prefers-color-scheme: dark) {
    :root {
        --bg: #0d0d0d;
        --bg-alt: #111111;
        --bg-raised: #161616;
        --text: #e0e0e0;
        --text-muted: #888888;
        --text-faint: #787878;
        --border: #2a2a2a;
        --border-strong: #3a3a3a;
        --hover: #1c1c1c;
        --code-bg: #1a1a1a;
        --terminal: #080808;
        --green: #22c55e;
        --terminal-prompt: #555555;
        --accent: #e0e0e0;

        --shadow-sm: 2px 2px 0 rgba(0, 0, 0, 0.3);
        --shadow-md: 3px 3px 0 rgba(0, 0, 0, 0.4);
        --shadow-lg: 4px 4px 0 rgba(0, 0, 0, 0.5);
    }
}

/* Manual theme overrides */
[data-theme="light"] {
    --bg: #ffffff;
    --bg-alt: #fafafa;
    --bg-raised: #ffffff;
    --text: #111111;
    --text-muted: #6b6b6b;
    --text-faint: #999999;
    --border: #e5e5e5;
    --border-strong: #cccccc;
    --hover: #f5f5f5;
    --code-bg: #eeeeee;
    --terminal: #0d0d0d;
    --green: #22c55e;
    --terminal-prompt: #555555;
    --shadow-sm: 2px 2px 0 rgba(0, 0, 0, 0.06);
    --shadow-md: 3px 3px 0 rgba(0, 0, 0, 0.08);
    --shadow-lg: 4px 4px 0 rgba(0, 0, 0, 0.10);
}

[data-theme="dark"] {
    --bg: #0d0d0d;
    --bg-alt: #111111;
    --bg-raised: #161616;
    --text: #e0e0e0;
    --text-muted: #888888;
    --text-faint: #787878;
    --border: #2a2a2a;
    --border-strong: #3a3a3a;
    --hover: #1c1c1c;
    --code-bg: #1a1a1a;
    --terminal: #080808;
    --green: #22c55e;
    --terminal-prompt: #555555;
    --accent: #e0e0e0;
    --shadow-sm: 2px 2px 0 rgba(0, 0, 0, 0.3);
    --shadow-md: 3px 3px 0 rgba(0, 0, 0, 0.4);
    --shadow-lg: 4px 4px 0 rgba(0, 0, 0, 0.5);
}

/* === Reset === */

*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    color-scheme: dark light;
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    background-color: var(--bg);
    color: var(--text);
    font-family: var(--font);
    font-size: var(--text-base);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* === Typography === */

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font);
    font-weight: 700;
    line-height: 1.25;
    letter-spacing: 0.02em;
}

h1 { font-size: var(--text-4xl); }
h2 { font-size: var(--text-2xl); }
h3 { font-size: var(--text-xl); }

p {
    color: var(--text-muted);
    line-height: 1.7;
}

p + p {
    margin-top: var(--space-3);
}

a {
    color: var(--text);
    text-decoration: underline;
    text-underline-offset: 3px;
    text-decoration-thickness: 1px;
    text-decoration-color: var(--border-strong);
    transition: text-decoration-color 0.15s ease, color 0.15s ease;
}

a:hover {
    text-decoration-color: var(--text);
}

a:focus-visible,
.btn:focus-visible {
    outline: 2px solid var(--text);
    outline-offset: 4px;
}

/* === Code === */

code {
    padding: 0.15em 0.4em;
    background: var(--code-bg);
    font-family: var(--font);
    font-size: 0.9em;
    color: var(--text);
}

pre {
    overflow-x: auto;
    background: var(--terminal);
    padding: var(--space-5) var(--space-6);
}

pre code {
    padding: 0;
    background: none;
    font-size: var(--text-sm);
    color: var(--green);
    line-height: 1.6;
}

.code-block {
    max-width: 96ch;
    margin: var(--space-8) auto;
    padding: var(--space-8) var(--space-10);
    background: var(--bg);
    border: 1px solid var(--border);
    font-family: var(--font);
    font-size: var(--text-base);
    line-height: 1.8;
    white-space: pre-wrap;
}

/* Athanor syntax highlighting — VS Code Light+ inspired */
.at-keyword  { color: #af00db; font-weight: 700; }
.at-builtin  { color: #795e26; }
.at-source   { color: #267f99; }
.at-field    { color: #001080; }
.at-number   { color: #098658; }
.at-operator { color: #383838; }
.at-comment  { color: #6a737d; font-style: italic; }
.at-ident    { color: #383838; }

/* === Lists === */

ul {
    list-style: none;
    color: var(--text-muted);
    font-size: var(--text-sm);
}

li {
    position: relative;
    padding: var(--space-1) 0 var(--space-1) var(--space-4);
}

li::before {
    position: absolute;
    top: 10px;
    left: 0;
    width: 4px;
    height: 1px;
    background: var(--border-strong);
    content: "";
}

/* === Utility === */

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.prose {
    max-width: var(--prose-width);
}

/* === Reduced motion === */

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
    }
}
