// =============================================================================
// Decent DS - Base element styles + typographic reset
// =============================================================================
@use 'tokens' as t;

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

html {
    -webkit-text-size-adjust: 100%;
    text-rendering: optimizeLegibility;
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: t.$font-sans;
    font-size: 0.9375rem;
    line-height: 1.55;
    color: var(--dc-text-primary);
    background: var(--dc-bg-canvas);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    transition: background-color t.$motion-base t.$ease-out, color t.$motion-base t.$ease-out;
}

h1, h2, h3, h4, h5, h6 {
    color: var(--dc-text-primary);
    font-weight: 600;
    letter-spacing: -.01em;
    margin: 0 0 t.$space-3 0;
    line-height: 1.25;
}

h1 { font-size: t.$fs-30; }
h2 { font-size: t.$fs-24; }
h3 { font-size: t.$fs-20; }
h4 { font-size: t.$fs-18; }
h5 { font-size: t.$fs-16; }
h6 { font-size: t.$fs-14; text-transform: uppercase; letter-spacing: .06em; color: var(--dc-text-muted); }

p {
    margin: 0 0 t.$space-3 0;
    color: var(--dc-text-secondary);
}

a {
    color: var(--dc-text-link);
    text-decoration: none;
    transition: color t.$motion-fast t.$ease-out;
}
a:hover { text-decoration: underline; }

hr {
    border: 0;
    height: 1px;
    background: var(--dc-border-subtle);
    margin: t.$space-6 0;
}

::selection {
    background: var(--dc-brand-primary-soft);
    color: var(--dc-text-primary);
}

// Focus ring - accessible & consistent across every focusable element.
:focus-visible {
    outline: none;
    box-shadow: var(--dc-focus-ring);
    border-radius: t.$radius-sm;
}

// Density modes
.density-compact  { --dc-density-y: #{t.$space-2}; --dc-density-x: #{t.$space-3}; }
.density-comfortable { --dc-density-y: #{t.$space-3}; --dc-density-x: #{t.$space-4}; }

// Print baseline (invoice-specific stylesheet ships in Sprint 3).
@media print {
    body { background: #fff; color: #000; }
    .no-print { display: none !important; }
}

// Reduced motion
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: .001ms !important;
        transition-duration: .001ms !important;
    }
}
