@layer ui.tokens, ui.base, ui.layout, ui.components, ui.patterns, ui.markdown, ui.hljs, ui.utilities;

@layer ui.tokens {
  :root {
    /* cocopon/iceberg dark palette */
    --iceberg-bg-dark: #0f1117;
    --iceberg-bg: #161821;
    --iceberg-panel: #1e2132;
    --iceberg-line: #3e445e;
    --iceberg-muted: #6b7089;
    --iceberg-fg: #c6c8d1;
    --iceberg-fg-bright: #d2d4de;
    --iceberg-red: #e27878;
    --iceberg-orange: #e2a478;
    --iceberg-green: #b4be82;
    --iceberg-cyan: #89b8c2;
    --iceberg-blue: #84a0c6;
    --iceberg-purple: #a093c7;

    /* Semantic aliases */
    --bg: var(--iceberg-bg);
    --bg-alt: var(--iceberg-bg-dark);
    --panel: var(--iceberg-panel);
    --line: var(--iceberg-line);
    --text: var(--iceberg-fg);
    --text-bright: var(--iceberg-fg-bright);
    --muted: var(--iceberg-muted);
    --accent: var(--iceberg-blue);
    --danger: var(--iceberg-red);

    /* UI surface & state tokens */
    --bg-primary: var(--bg);
    --bg-secondary: var(--bg);
    --bg-tertiary: color-mix(in srgb, var(--panel) 65%, var(--line) 35%);
    --bg-input: var(--bg-alt);
    --border: var(--line);
    --border-subtle: color-mix(in srgb, var(--bg) 70%, var(--line) 30%);
    --border-focus: var(--accent);
    --text-primary: var(--text);
    --text-secondary: var(--text-bright);
    --text-muted: var(--muted);
    --accent-hover: var(--iceberg-cyan);
    --accent-dim: color-mix(in srgb, var(--accent) 18%, transparent);
    --accent-alt: var(--iceberg-purple);
    --accent-alt-dim: color-mix(in srgb, var(--accent-alt) 18%, transparent);
    --success: var(--iceberg-green);
    --warning: var(--iceberg-orange);
    --danger-hover: color-mix(in srgb, var(--danger) 85%, var(--text-bright));

    /* Radii */
    --radius-sm: 4px;
    --radius-md: 6px;
    --radius: 8px;
    --radius-lg: 10px;
    --radius-full: 999px;

    /* Typography */
    --font-sans: var(--font-base, "JetBrains Mono", "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif);
    --font-mono: var(--font-base, "JetBrains Mono", "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace);

    /* Layout */
    --container-max: 1180px;
    --sidebar-width: 220px;
    --app-sidebar-width: 280px;
    --sticky-offset: 74px;

    color-scheme: dark;
  }
}
