:root {
    /* Colors - Dark theme */
    --bg-primary: rgb(16, 16, 16);
    --bg-secondary: rgb(18, 18, 18);
    --bg-tertiary: rgb(30, 30, 30);

    --text-primary: rgb(240, 240, 240);
    --text-secondary: rgb(180, 180, 180);
    --text-muted: rgb(120, 120, 120);

    --accent-color: rgb(200, 200, 200);
    --accent-hover: rgb(255, 255, 255);

    --border-color: rgb(40, 40, 40);
    --border-light: rgb(60, 60, 60);

    /* Mermaid colors */
    --mermaid-accent-blue: rgb(96, 165, 250);
    --mermaid-task-blue: rgb(59, 130, 246);
    --mermaid-line-color: rgb(148, 163, 184);
    --mermaid-note-bg: rgba(251, 191, 36, 0.2);
    --mermaid-note-border: rgb(245, 158, 11);
    --mermaid-note-text: rgb(254, 243, 199);
    --mermaid-activation-bg: rgba(59, 130, 246, 0.3);

    /* Spacing */
    --spacing-xs: 0.25rem;
    --spacing-sm: 0.5rem;
    --spacing-md: 1rem;
    --spacing-lg: 1.5rem;
    --spacing-xl: 2rem;
    --spacing-xxl: 3rem;

    /* Typography */
    --font-family-sans:
        "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont,
        system-ui, Roboto, "Helvetica Neue", "Segoe UI", "Apple SD Gothic Neo",
        "Noto Sans KR", "Malgun Gothic", "Apple Color Emoji", "Segoe UI Emoji",
        "Segoe UI Symbol", sans-serif;
    --font-family-mono:
        "SF Mono", "Monaco", "Inconsolata", "Fira Mono", "Droid Sans Mono",
        "Source Code Pro", monospace;

    /* Fluid typography */
    --font-size-body: clamp(0.9rem, 0.86rem + 0.18vw, 1.1rem);
    --font-size-small: clamp(0.88rem, 0.84rem + 0.16vw, 1rem);
    --line-height-body: 1.7;

    /* Font sizes */
    --font-size-sm: 65%;
    --font-size-x-small: 60%;
    --font-size-md: 75%;
    --font-size-lg: 100%;
    --font-size-xl: 110%;
    --font-size-xxl: 140%;
    --font-size-xxxl: 180%;

    /* Layout */
    --max-width: 900px;
    --max-width-wide: 1200px;

    /* Breakpoints (for reference) */
    --breakpoint-sm: 576px;
    --breakpoint-md: 768px;
    --breakpoint-lg: 992px;
}

/* =============================================================================
   Base Styles
   ============================================================================= */
*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    font-size: clamp(16px, 15px + 0.35vw, 20px);
    scroll-behavior: smooth;
}

body {
    margin: 0;
    padding: 0;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    font-family: var(--font-family-sans);
    font-size: var(--font-size-body);
    line-height: var(--line-height-body);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

body.search-open {
    overflow: hidden;
}

a {
    color: var(--accent-color);
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover {
    color: var(--accent-hover);
}

img {
    max-width: 100%;
    height: auto;
    border: solid 1px #161616;
    border-radius: 8px;
}

hr {
    border: none;
    border-top: 1px solid var(--border-color);
    margin: var(--spacing-xl) 0;
}

::selection {
    background-color: var(--accent-color);
    color: var(--bg-primary);
}

/* Scrollbar styling */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
    background: var(--border-light);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}
