/**
 * Base Styles - Design Tokens & Global Styles
 *
 * CSS Custom Properties (Variables):
 * --bg: page background
 * --card: surface color for cards and inputs
 * --ink: default text color
 * --border: subtle border color
 * --blue: accent color
 * --success: success state color
 * --font-family: base font stack
 *
 * Spacing Tokens:
 * --space-xs through --space-2xl for consistent spacing
 *
 * Theme Colors (RGB components for alpha manipulation):
 * --doc-color: document outline
 * --margin-color: margin areas
 * --printable-color: non-printable areas
 * --score-color: score lines
 * --line-color: layout lines
 */

:root {
    /* ===== Spacing Tokens ===== */
    --space-xs: 4px;
    --space-sm: 8px;
    --space-md: 16px;
    --space-lg: 24px;
    --space-xl: 32px;
    --space-2xl: 48px;

    /* ===== Shadow Tokens ===== */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 2px 4px rgba(0, 0, 0, 0.1);

    /* ===== Border Radius Tokens ===== */
    --radius-sm: 4px;
    --radius-md: 6px;
    --radius-lg: 8px;

    /* ===== Transition Tokens ===== */
    --transition-fast: 0.15s ease;
    --transition-normal: 0.2s ease;
    --transition-slow: 0.3s ease;

    /* ===== Theme Variables ===== */
    --bg: #f5f7fa;
    --card: #ffffff;
    --ink: #212529;
    --border: #dee2e6;
    --blue: #0b5ed7;
    --button-bg: var(--blue);
    --button-ink: var(--card);
    --success: #28a745;
    --font-family: 'Tahoma', 'Verdana', sans-serif;

    /* ===== Canvas Theme Colors (RGB) ===== */
    --doc-color: 0, 0, 0;
    --margin-color: 255, 0, 0;
    --printable-color: 255, 0, 255;
    --score-color: var(--printable-color);
    --line-color: 0, 0, 0;
}

/* ===== Reset & Global Styles ===== */
*,
*::before,
*::after {
    box-sizing: border-box;
}

body {
    font-family: var(--font-family);
    margin: 0;
    padding: 0;
    background-color: var(--bg);
    line-height: 1.45;
    font-size: 16px;
    color: var(--ink);
    transition: background-color var(--transition-normal), color var(--transition-normal);
}

/* ===== Typography ===== */
h1 {
    font-size: 24px;
    margin: 0;
    color: var(--ink);
}

h2 {
    font-size: 20px;
    margin: var(--space-md) 0 var(--space-sm) 0;
    color: var(--ink);
}

h3 {
    font-size: 16px;
    font-weight: 600;
    margin: 0;
}

/* ===== Header ===== */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-sm) var(--space-md);
    background-color: var(--card);
    position: sticky;
    top: 0;
    z-index: 10;
    transition: background-color var(--transition-normal), border-color var(--transition-normal);
}

/* ===== Utility Classes ===== */
.hidden {
    display: none !important;
}

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