/* ============================================================
   NoteUp — Base Styles
   Design tokens, resets, typography
   ============================================================ */

:root {
    /* Colors */
    --color-paper: #FAF8F5;
    --color-paper-dark: #F2EDE7;
    --color-white: #FFFFFF;
    --color-charcoal: #2C2C2C;
    --color-charcoal-light: #4A4A4A;
    --color-grey: #6B6B6B;
    --color-grey-light: #9B9B9B;
    --color-grey-border: #E0DDD8;
    --color-beige: #D4C5A9;
    --color-beige-light: #E8E0D0;
    --color-brown: #8B7355;
    --color-brown-dark: #6B5740;
    --color-sage: #87A878;
    --color-sage-dark: #6B8B5E;
    --color-terracotta: #C2703E;
    --color-terracotta-dark: #A65D30;
    --color-blue: #6B8FA3;
    --color-blue-dark: #50768E;

    /* Status colors */
    --color-success: #4A7C59;
    --color-warning: #D4A03E;
    --color-error: #C0392B;
    --color-info: #5B8FA8;

    /* Typography */
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, sans-serif;
    --font-serif: 'Playfair Display', Georgia, 'Times New Roman', serif;
    --font-mono: 'SF Mono', 'Cascadia Code', 'Fira Code', monospace;

    /* Font sizes */
    --text-xs: 0.75rem;
    --text-sm: 0.875rem;
    --text-base: 1rem;
    --text-lg: 1.125rem;
    --text-xl: 1.25rem;
    --text-2xl: 1.5rem;
    --text-3xl: 1.875rem;
    --text-4xl: 2.25rem;
    --text-5xl: 3rem;
    --text-6xl: 3.75rem;

    /* Spacing */
    --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;

    /* Borders */
    --border-radius-sm: 4px;
    --border-radius: 8px;
    --border-radius-lg: 12px;
    --border-radius-xl: 16px;
    --border-radius-full: 9999px;

    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.12);
    --shadow-xl: 0 16px 48px rgba(0, 0, 0, 0.16);

    /* Transitions */
    --transition-fast: 150ms ease;
    --transition: 250ms ease;
    --transition-slow: 350ms ease;

    /* Layout */
    --container-max: 1280px;
    --container-narrow: 800px;
    --navbar-height: 72px;
}

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

html {
    font-size: 16px;
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--font-sans);
    font-size: var(--text-base);
    line-height: 1.6;
    color: var(--color-charcoal);
    background-color: var(--color-paper);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    min-height: 100vh;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

a {
    color: inherit;
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--color-sage-dark);
}

ul, ol {
    list-style: none;
}

button {
    cursor: pointer;
    border: none;
    background: none;
    font-family: inherit;
    font-size: inherit;
    line-height: inherit;
}

input, select, textarea {
    font-family: inherit;
    font-size: inherit;
    line-height: inherit;
}

h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    line-height: 1.3;
    color: var(--color-charcoal);
}

h1 { font-size: var(--text-4xl); }
h2 { font-size: var(--text-3xl); }
h3 { font-size: var(--text-2xl); }
h4 { font-size: var(--text-xl); }
h5 { font-size: var(--text-lg); }
h6 { font-size: var(--text-base); }

p {
    margin-bottom: var(--space-4);
}

p:last-child {
    margin-bottom: 0;
}

/* Focus states */
:focus-visible {
    outline: 2px solid var(--color-sage);
    outline-offset: 2px;
    border-radius: var(--border-radius-sm);
}

/* Skip to content */
.skip-link {
    position: absolute;
    top: -100%;
    left: var(--space-4);
    background: var(--color-sage-dark);
    color: var(--color-white);
    padding: var(--space-2) var(--space-4);
    border-radius: var(--border-radius);
    z-index: 10000;
    font-size: var(--text-sm);
    font-weight: 500;
}

.skip-link:focus {
    top: var(--space-4);
}

/* Selection */
::selection {
    background: var(--color-sage);
    color: var(--color-white);
}

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

::-webkit-scrollbar-track {
    background: var(--color-paper-dark);
}

::-webkit-scrollbar-thumb {
    background: var(--color-grey-border);
    border-radius: var(--border-radius-full);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--color-grey-light);
}

/* Utility classes */
.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;
}

.container {
    width: 100%;
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 var(--space-4);
}

.container-narrow {
    max-width: var(--container-narrow);
    margin: 0 auto;
    padding: 0 var(--space-4);
}

.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.mt-2 { margin-top: var(--space-2); }
.mt-4 { margin-top: var(--space-4); }
.mt-8 { margin-top: var(--space-8); }
.mb-2 { margin-bottom: var(--space-2); }
.mb-4 { margin-bottom: var(--space-4); }
.mb-8 { margin-bottom: var(--space-8); }
.mb-12 { margin-bottom: var(--space-12); }

/* Loading state */
.is-loading {
    opacity: 0.6;
    pointer-events: none;
    cursor: not-allowed;
}

/* Print styles */
@media print {
    .navbar, .footer, .toast-container, .search-overlay, .mobile-menu {
        display: none !important;
    }
    body {
        background: white;
        color: black;
    }
}